Lampiran 1
STRUKTUR ORGANISASI PT. DAYA MANUNGGAL SALATIGA
OPERATION
DIRECTUR
FACTORY
MANAGER
KA. DEPT. PENGADAAN MGR. PROCESSING MGR. SPINNING MGR. PPC, MISC, LOGISTIK MGR. ACCOUNTING MGR. POWER UTILITY MGR. PROCESSING MGR. UM-PERS KADEPT. SPINNING KADEPT. WV AJL 1 KADEPT. WV SL KADEPT. WVAJL 2 KADEPT. TEKNIK
KADEPT. PRINTING
KADEPT. DYENG KADEPT.
ENGINERING KA.DIV EDP
KADEPT. PENGUPAHAN KADEPT. KASIR KADEPT. ACCOUNTING KADEPT. UMUM-PERS MR ISO KADEPT LOGISTIK KADEPT PPC, MICS GUDANG
Lampiran 2
A.
Class Diagram
B.
Activity Diagram
b. Activity Diagram (Input Data)
d. Activity Diagram - Delete
f. Activity Diagram (Timbang Keluar)
Lampiran 3
Index.php
<title>Sistem Informasi Jembatan Timbang</title>
<link type="text/css" href="asset/css/style.css" rel="stylesheet"> <div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.1 Argomulyo Salatiga 50717 <br> Telp: (0298) 313789" ?></h2>
<div id="body">
<p><b>MASUKKAN USERNAME DAN PASSWORD ANDA UNTUK LOGIN!</b></p> <div id="bg-line">
<form action="cek_login.php" method="post"> Username :
<input type="text" name="username" class="input-teks-login" placeholder="Masukkan username..." />
Password :
<input type="password" name="password" class="input-teks-login" placeholder="Masukkan Password..." />
<input type="submit" value="Log In" class="btn-kirim-login" name="login"/> </div> </form> </div> Cek_login.php <?php include"koneksi.php"; session_start(); if(isset($_POST['login'])) { $username = $_POST['username']; $password = $_POST['password'];
$sql = mysql_query("SELECT * FROM admin WHERE id_admin='$username' && password='$password'"); $num = mysql_num_rows($sql); if($num==1) { $_SESSION['id_admin'] = $username; $_SESSION['password'] = $password; ?> <script language="JavaScript"> document.location='home.php'</script><?php } else { ?><script language="JavaScript"> document.location='index.php'</script><?php } } ?> Home.php
<title>Sistem Informasi Jembatan Timbang</title>
<link type="text/css" href="asset/css/style.css" rel="stylesheet"> <div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.1 Argomulyo Salatiga 50717<br> Telp: (0298) 313789" ?></h2> <div id="body"> <?php include("menu.php"); ?> <div id="list"> <ul>
<li><strong>Supplier & Customer</strong><br />Berfungsi untuk memasukkan data Supplier dan Customer baru</li>
<li><strong>Barang</strong><br />Berfungsi untuk memasukkan data Barang baru</li> <li><strong>Transaksi Timbang</strong><br />Berfungsi untuk melakukan transaksi timbang masuk sampai timbang keluar serta untuk melakukan cetak nota setelah melakukan transaksi timbang</li>
<li><strong>Rekap Timbang</strong><br />Berfungsi untuk rekap timbang sesuai tanggal dan kode barang yang dimasukkan</li>
<li><strong>Log Out</strong><br />Keluar dari sistem aplikasi</li> </ul>
</div> </div>
Tampilan Supplier, Customer dan Barang Suppcust.php <?php class suppcust { function connect() { include("koneksi.php"); } function getsupplier(){ $suppcust = new suppcust(); $suppcust->connect();
$query = "select * FROM suppcust where kode_suppcust like 'SUP%'"; $hasil = mysql_query($query);
return $hasil; }
function getcustomer(){ $suppcust = new suppcust(); $suppcust->connect();
$query = "select * FROM suppcust where kode_suppcust like 'CUST%'"; $hasil = mysql_query($query);
return $hasil; }
function getMaxNamasupplier(){ $suppcust = new suppcust(); $suppcust->connect();
$query = "SELECT max(kode_suppcust) AS last from suppcust where kode_suppcust like 'SUP%'";
$hasil = mysql_query($query); return $hasil;
}
function getMaxNamacustomer(){ $suppcust = new suppcust(); $suppcust->connect();
$query = "SELECT max(kode_suppcust) AS last from suppcust where kode_suppcust like 'CUST%'"; $hasil = mysql_query($query); return $hasil; } function getsupplieredit($kode_supplier) {
$suppcust = new suppcust(); $suppcust->connect();
$query = "select * FROM suppcust WHERE kode_suppcust='$kode_supplier'"; $hasil = mysql_query($query);
return $hasil; }
function getcustomeredit($kode_customer) {
$suppcust = new suppcust(); $suppcust->connect();
$query = "select * FROM suppcust WHERE kode_suppcust='$kode_customer'"; $hasil = mysql_query($query); return $hasil; } } ?> Datasupp.php
<title>Sistem Informasi Jembatan Timbang</title> <head>
<style> </style>
<link type="text/css" href="asset/css/style.css" rel="stylesheet" /> <script src="asset/js/menu.js" type="text/javascript"></script> </head>
<div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.1 Argomulyo Salatiga 50717 <br> Telp: (0298) 313789" ?></h2>
<div id="body"> <?php
include("suppcust.php"); $suppcust= new suppcust; ?>
<div class="cleaner_h10"></div>
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
<tr style="background-color:#000000; color:#FFFFFF;" align="center"><td colspan="9" height="25" class="hurufx">Data Supplier</td></tr>
<tr style="background-color:#333; color:#FFFFFF;" align="center" class="hurufx"> <td align="center">No.</td>
<td align="center">Kode Supplier</td> <td align="center">Nama Supplier</td> <td align="center">Alamat Supplier</td> <td align="center">No Telepon</td>
<td colspan="2"><a href="tsupplier.php" class="cbbarang"><div class="btn-add">Tambah Supplier</div></a></td> </tr> <?php $i = 1; $result = $suppcust->getsupplier(); while($row = mysql_fetch_array($result)) { ?> <tr align="center" class="hurufx"> <td><?php echo $i; ?></td> <td><?php echo $row["kode_suppcust"]; ?></td> <td><?php echo $row["nama_suppcust"]; ?></td> <td><?php echo $row["alamat_suppcust"]; ?></td> <td><?php echo $row["notelp_suppcust"]; ?></td> <td width="90"><a href="editsupp.php?kode_supplier=<?php echo
$row['kode_suppcust']; ?>" class="cbbarang"><div class="btn-edit">Edit Supplier</div></a></td>
<td width="100"><a href="deletesupp.php?kode_supplier=<?php echo $row['kode_suppcust']; ?>" onclick="return confirm('Hapus Data?');"><div class="btn-delete">Hapus Supplier</div></a></td> </tr></font> <?php $i++; } ?> </table> <br /><br /> Tsupplier.php
<title>Sistem Informasi Jembatan Timbang</title> <head> <style> td { padding:5px; } </style>
<link type="text/css" href="asset/css/style.css" rel="stylesheet" /> <script src="asset/js/menu.js" type="text/javascript"></script> </head>
<div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.1 Argomulyo Salatiga 50717<br> Telp: (0298) 313789" ?></h2>
<div id="body"> <?php
include("menu.php"); include("suppcust.php"); $suppcust = new suppcust();
$hasil = $suppcust->getMaxNamasupplier(); $datax = mysql_fetch_array($hasil); $lastkodesupplier= $datax['last'];
$lastNoUrut = substr($lastkodesupplier, 3, 3); $nextNoUrut = $lastNoUrut + 1;
$nextkodesupplier = "SUP".sprintf('%03s', $nextNoUrut); ?>
<br /> <div>
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
<form action="insert_supp.php" method="post" name="myForm" onSubmit="return cekInputan()">
<tr style="background-color:#000000; color:#FFFFFF;" align="center"><td colspan="9" height="25" class="hurufx">Input Data Supplier</td></tr>
<tr class="hurufx"> <td>Kode Supplier </td>
<td><input type="text" name="kode_supplier" size="30" value="<?php echo $nextkodesupplier; ?>" readonly="readonly"></td>
</tr>
<tr class="hurufx">
<td>Nama Supplier</td>
<td><input type="text" name="nama_supplier" size="30"></td> </tr>
<tr class="hurufx">
<td>Alamat Supplier</td>
<td><input type="text" name="alamat_supplier" size="30" id="alamat_supplier"> </tr>
<tr class="hurufx"> <td>No Telepon</td>
<td><input type="text" name="notelp_supplier" size="30" id="notelp_supplier"> </tr>
<tr> <td></td>
<td><input type="submit" value="Simpan" class="btn-kirim-login"><input type="reset" value="Reset" class="btn-kirim-login"></td>
</tr> </form> </table> </div> <br /><br /> Insert_supp.php <?php include("koneksi.php"); $kode_supplier = $_POST["kode_supplier"]; $nama_supplier= $_POST["nama_supplier"]; $alamat_supplier = $_POST["alamat_supplier"]; $notelp_supplier = $_POST["notelp_supplier"];
$query = mysql_query("insert into suppcust values('$kode_supplier', '$nama_supplier', '$alamat_supplier', '$notelp_supplier')") or die (mysql_error()); if ($query) { header('location: datasupp.php?message=success'); } ?> editsupp.php
<title>Sistem Informasi Jembatan Timbang</title> <head>
<link type="text/css" href="asset/css/style.css" rel="stylesheet" /> <script src="asset/js/menu.js" type="text/javascript"></script> </head>
<div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.1 Argomulyo Salatiga 50717<br> Telp: (0298) 313789" ?></h2>
<div id="body"> <?php
include ("menu.php"); include("suppcust.php"); $suppcust = new suppcust();
$kode_supplier = $_GET["kode_supplier"];
$datax = $suppcust->getsupplieredit($kode_supplier); while ($row = mysql_fetch_array($datax)){
$nama_supplier = $row["nama_suppcust"]; $alamat_supplier = $row["alamat_suppcust"]; $notelp_supplier = $row["notelp_suppcust"]; } ?> <div class="cleaner_h10"></div> <div>
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
<form action="updatesupp.php" method="post"> <tr class="hurufx">
<td>Kode Supplier</td>
<td><input type="text" name="kode_supplier" size="40" value="<?php echo $kode_supplier; ?>" readonly></td>
</tr>
<tr class="hurufx">
<td>Nama Supplier</td>
<td><input type="text" name="nama_supplier" size="40" value="<?php echo $nama_supplier; ?>"></td>
</tr>
<tr class="hurufx">
<td>Alamat Supplier</td>
<td><input type="text" name="alamat_supplier" size="40" value="<?php echo $alamat_supplier; ?>"></td>
</tr>
<tr class="hurufx">
<td>No Telepon:</td>
<td><input type="text" name="notelp_supplier" size="40" value="<?php echo $notelp_supplier; ?>"></td>
</tr> <tr> <td></td>
<td><input type="submit" value="Update" class="btn-kirim-login"><input type="reset" value="Reset" class="btn-kirim-login"></td>
</tr> </form> </table> </div> <div class="cleaner_h10"></div> <table align="center"> <tr align="center"> <td> <?php echo "<br>"; ?> </td> </tr> </table> </div> Update.php <?php include("koneksi.php"); $kode_supplier = $_POST["kode_supplier"]; $nama_supplier = $_POST["nama_supplier"]; $alamat_supplier = $_POST["alamat_supplier"]; $notelp_supplier = $_POST["notelp_supplier"];
$query = mysql_query("update suppcust set nama_suppcust='$nama_supplier', alamat_suppcust='$alamat_supplier', notelp_suppcust='$notelp_supplier' WHERE kode_suppcust='$kode_supplier'") or die (mysql_error());
if ($query) { header('location: datasupp.php?message=success'); } Hapus.php <?php include('koneksi.php'); $kode_supplier = $_GET['kode_supplier'];
$query = mysql_query("delete from suppcust where kode_suppcust='$kode_supplier'") or die(mysql_error()); if ($query) { header('location:datasupp.php?message=delete'); } ?> Datacust.php
<title>Sistem Informasi Jembatan Timbang</title> <head>
<style> </style>
<link type="text/css" href="asset/css/style.css" rel="stylesheet" /> <script src="asset/js/menu.js" type="text/javascript"></script>
</head>
<div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.1 Argomulyo Salatiga 50717 <br> Telp: (0298) 313789" ?></h2>
<div id="body"> <?php
include ("menu.php"); include("suppcust.php"); $suppcust= new suppcust; ?>
<div class="cleaner_h10"></div>
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
<tr style="background-color:#000000; color:#FFFFFF;" align="center"><td colspan="9" height="25" class="hurufx">Data Customer</td></tr>
<tr style="background-color:#333; color:#FFFFFF;" align="center" class="hurufx"> <td align="center">No.</td>
<td align="center">Kode Customer</td>
<td align="center">Nama Customer</td> <td align="center">Alamat Customer</td> <td align="center">No Telepon</td>
<td colspan="2"><a href="tcustomer.php" class="cbbarang"><div class="btn-add">Tambah Customer</div></a></td> </tr> <?php $i = 1; $result = $suppcust->getcustomer(); while($row = mysql_fetch_array($result)) { ?> <tr align="center" class="hurufx"> <td><?php echo $i; ?></td> <td><?php echo $row["kode_suppcust"]; ?></td> <td><?php echo $row["nama_suppcust"]; ?></td> <td><?php echo $row["alamat_suppcust"]; ?></td> <td><?php echo $row["notelp_suppcust"]; ?></td> <td width="90"><a href="editcust.php?kode_customer=<?php echo
$row['kode_suppcust']; ?>" class="cbbarang"><div class="btn-edit">Edit Customer</div></a></td>
<td width="100"><a href="deletecust.php?kode_customer=<?php echo
$row['kode_suppcust']; ?>" onclick="return confirm('Hapus Data?');"><div class="btn-delete">Hapus Customer</div></a></td> </tr></font> <?php $i++; } ?> </table> <br /><br /> Tcustomer.php
<title>Sistem Informasi Jembatan Timbang</title> <head> <style> td { padding:5px; } </style>
<link type="text/css" href="asset/css/style.css" rel="stylesheet" /> <script src="asset/js/menu.js" type="text/javascript"></script> </head>
<div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.1 Argomulyo Salatiga 50717 <br> Telp: (0298) 313789" ?></h2>
<div id="body"> <?php
include("menu.php"); include("suppcust.php"); $suppcust = new suppcust();
$hasil = $suppcust->getMaxNamacustomer(); $datax = mysql_fetch_array($hasil); $lastkodecustomer= $datax['last'];
$lastNoUrut = substr($lastkodecustomer, 4, 3); $nextNoUrut = $lastNoUrut + 1;
$nextkodecustomer = "CUST".sprintf('%03s', $nextNoUrut); ?>
<br /> <div>
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
<form action="insert_customer.php" method="post" name="myForm" onSubmit="return cekInputan()">
<tr class="hurufx"> <td>Kode Customer </td>
<td><input type="text" name="kode_customer" size="30" value="<?php echo $nextkodecustomer; ?>" readonly="readonly"></td>
</tr>
<tr class="hurufx">
<td>Nama Customer</td>
<td><input type="text" name="nama_customer" size="30"></td> </tr>
<tr class="hurufx">
<td>Alamat Customer</td>
<td><input type="text" name="alamat_customer" size="30" id="alamat_customer"> </tr>
<tr class="hurufx">
<td>No Telepon</td>
<td><input type="text" name="notelp_customer" size="30" id="notelp_customer"> </tr>
<tr> <td></td>
<td><input type="submit" value="Simpan" class="btn-kirim-login"><input type="reset" value="Reset" class="btn-kirim-login"></td>
</tr> </form> </table> </div> <br> Insert_customer.php <?php include("koneksi.php"); $kode_customer = $_POST["kode_customer"]; $nama_customer= $_POST["nama_customer"]; $alamat_customer = $_POST["alamat_customer"]; $notelp_customer = $_POST["notelp_customer"];
$query = mysql_query("insert into suppcust values('$kode_customer', '$nama_customer', '$alamat_customer', '$notelp_customer')") or die (mysql_error()); if ($query) { header('location: datacust.php?message=success'); } ?> Editcust.php
<title>Sistem Informasi Jembatan Timbang</title> <head>
<link type="text/css" href="asset/css/style.css" rel="stylesheet" /> <script src="asset/js/menu.js" type="text/javascript"></script> </head>
<div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.1 Argomulyo Salatiga 50717 <br> Telp: (0298) 313789" ?></h2>
<div id="body"> <?php
include ("menu.php"); include("suppcust.php"); $suppcust = new suppcust();
$kode_customer = $_GET["kode_customer"];
$datax = $suppcust->getcustomeredit($kode_customer); while ($row = mysql_fetch_array($datax)){
$nama_customer = $row["nama_suppcust"]; $alamat_customer = $row["alamat_suppcust"]; $notelp_customer = $row["notelp_suppcust"];
} ?>
<div class="cleaner_h10"></div> <div>
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
<form action="updatecust.php" method="post"> <tr class="hurufx">
<td>Kode Customer</td>
<td><input type="text" name="kode_customer" size="40" value="<?php echo $kode_customer; ?>" readonly></td>
</tr>
<tr class="hurufx">
<td>Nama Customer</td>
<td><input type="text" name="nama_customer" size="40" value="<?php echo $nama_customer; ?>"></td>
</tr>
<tr class="hurufx">
<td>Alamat Customer</td>
<td><input type="text" name="alamat_customer" size="40" value="<?php echo $alamat_customer; ?>"></td>
</tr>
<tr class="hurufx">
<td>No Telepon:</td>
<td><input type="text" name="notelp_customer" size="40" value="<?php echo $notelp_customer; ?>"></td>
</tr> <tr>
<td></td>
<td><input type="submit" value="Update" class="btn-kirim-login"><input type="reset" value="Reset" class="btn-kirim-login"></td>
</tr> </form> </table> </div> <div class="cleaner_h10"></div> <table align="center"> <tr align="center"> <td> <?php echo "<br>"; ?> </td> </tr> </table> </div> Updatecust.php <?php include("koneksi.php"); $kode_customer = $_POST["kode_customer"]; $nama_customer= $_POST["nama_customer"]; $alamat_customer = $_POST["alamat_customer"]; $notelp_customer = $_POST["notelp_customer"];
$query = mysql_query("update suppcust set nama_suppcust='$nama_customer', alamat_suppcust='$alamat_customer', notelp_suppcust='$notelp_customer' WHERE kode_suppcust='$kode_customer'")or die (mysql_error());
if ($query) { header('location: datacust.php?message=success'); } Deletecust.php <?php include('koneksi.php'); $kode_customer = $_GET['kode_customer'];
$query = mysql_query("delete from suppcust where kode_suppcust='$kode_customer'") or die(mysql_error());
if ($query) {
header('location:datacust.php?message=delete'); }
Barang.php <?php class barang { function connect() { include("koneksi.php"); } function getbarang(){ $barang = new barang(); $barang->connect();
$query = "select * FROM barang order by kode_barang"; $hasil = mysql_query($query);
return $hasil; }
function cekKodebarang($kode_barang) {
$barang = new barang(); $barang->connect();
$query = "SELECT kode_barang FROM barang WHERE kode_barang='$kode_barang'"; $hasil = mysql_query($query); $x=0; while($data = mysql_fetch_array($hasil)) { $x = $x+1; } return $x; } function getMaxNamabarang(){ $barang= new barang(); $barang->connect();
$query = "SELECT max(kode_barang) AS last from barang where kode_barang like 'B%'"; $hasil = mysql_query($query); return $hasil; } function getbarangedit($kode_barang) {
$barang = new barang(); $barang->connect();
$query = "select * FROM barang WHERE kode_barang='$kode_barang'"; $hasil = mysql_query($query); return $hasil; } } ?> Databar.php
<title>Sistem Informasi Jembatan Timbang</title> <head>
<style> </style>
<link type="text/css" href="asset/css/style.css" rel="stylesheet" /> <script src="asset/js/menu.js" type="text/javascript"></script> </head>
<div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.150717 Argomulyo Salatiga 50717<br> Telp: (0298) 313789" ?></h2>
<div id="body"> <?php
include ("menu.php"); include("barang.php"); $barang = new barang; ?>
<div class="cleaner_h10"></div>
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
<tr style="background-color:#000000; color:#FFFFFF;" align="center"><td colspan="9" height="25" class="hurufx">Data Barang</td></tr>
<tr style="background-color:#333; color:#FFFFFF;" align="center" class="hurufx"> <td align="center">No.</td>
<td align="center">Kode Barang</td> <td align="center">Nama Barang</td> <td align="center">Keterangan</td>
<td colspan="2"><a href="tbarang.php" class="cbbarang"><div class="btn-add">Tambah Barang</div></a></td> </tr> <?php $i = 1; $result = $barang->getbarang(); while($row = mysql_fetch_array($result)) { ?> <tr align="center" class="hurufx"> <td><?php echo $i; ?></td> <td><?php echo $row["kode_barang"]; ?></td> <td><?php echo $row["nama_barang"]; ?></td> <td><?php echo $row["keterangan"]; ?></td>
<td width="90"><a href="editbar.php?kode_barang=<?php echo $row['kode_barang']; ?>" class="cbbarang"><div class="btn-edit">Edit Barang</div></a></td>
<td width="100"><a href="deletebar.php?kode_barang=<?php echo $row['kode_barang']; ?>" onclick="return confirm('Hapus Data?');"><div class="btn-delete">Hapus
Barang</div></a></td> </tr></font> <?php $i++; } ?> </table> <br /><br /> Tbarang.php
<title>Sistem Informasi Jembatan Timbang</title> <head> <style> td { padding:5px; } </style>
<link type="text/css" href="asset/css/style.css" rel="stylesheet" /> <script src="asset/js/menu.js" type="text/javascript"></script> </head>
<div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.1 Argomulyo Salatiga 50717 <br> Telp: (0298) 313789" ?></h2>
<div id="body"> <?php
include("menu.php"); include("barang.php"); $barang = new barang();
$hasil = $barang->getMaxNamabarang(); $datax = mysql_fetch_array($hasil); $lastkodebarang= $datax['last'];
$lastNoUrut = substr($lastkodebarang, 1, 3); $nextNoUrut = $lastNoUrut + 1;
$nextkodebarang = "B".sprintf('%03s', $nextNoUrut); ?>
<br /> <div>
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
<form action="insert_bar.php" method="post" name="myForm" onSubmit="return cekInputan()">
<tr style="background-color:#000000; color:#FFFFFF;" align="center"><td colspan="9" height="25" class="hurufx">Input Data Barang</td></tr> <tr class="hurufx">
<td>Kode Barang </td>
<td><input type="text" name="kode_barang" size="30" value="<?php echo $nextkodebarang; ?>" readonly="readonly"></td>
</tr>
<tr class="hurufx">
<td>Nama Barang</td>
<td><input type="text" name="nama_barang" size="30"></td> </tr>
<tr class="hurufx">
<td><input type="text" name="keterangan" size="30" id="keterangan"> </tr>
<tr> <td></td>
<td><input type="submit" value="Simpan" class="btn-kirim-login"><input type="reset" value="Reset" class="btn-kirim-login"></td>
</tr> </form> </table> </div> <br /><br /> Insert_bar.php <?php include("koneksi.php"); $kode_barang = $_POST["kode_barang"]; $nama_barang= $_POST["nama_barang"]; $keterangan = $_POST["keterangan"];
$query = mysql_query("insert into barang values('$kode_barang', '$nama_barang', '$keterangan')") or die (mysql_error());
if ($query) {
header('location: databar.php?message=success'); }
?>
Editbar.php
<title>Sistem Informasi Jembatan Timbang</title> <head>
<link type="text/css" href="asset/css/style.css" rel="stylesheet" /> <script src="asset/js/menu.js" type="text/javascript"></script> </head>
<div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.1 Argomulyo Salatiga 50717 <br> Telp: (0298) 313789" ?></h2>
<div id="body"> <?php
include ("menu.php"); include("barang.php"); $barang = new barang();
$kode_barang = $_GET["kode_barang"];
$datax = $barang->getbarangedit($kode_barang); while ($row = mysql_fetch_array($datax)){ $nama_barang = $row["nama_barang"]; $keterangan = $row["keterangan"]; } ?> <div class="cleaner_h10"></div> <div>
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
<form action="updatebar.php" method="post"> <tr class="hurufx">
<td>Kode Barang</td>
<td><input type="text" name="kode_barang" size="40" value="<?php echo $kode_barang; ?>" readonly></td>
</tr>
<tr class="hurufx">
<td>Nama Barang</td>
<td><input type="text" name="nama_barang" size="40" value="<?php echo $nama_barang; ?>"></td>
</tr>
<tr class="hurufx">
<td>Keterangan</td>
<td><input type="text" name="keterangan" size="40" value="<?php echo $keterangan; ?>"></td>
</tr> <tr> <td></td>
<td><input type="submit" value="Update" class="btn-kirim-login"><input type="reset" value="Reset" class="btn-kirim-login"></td>
</tr> </form> </table>
</div> <div class="cleaner_h10"></div> <table align="center"> <tr align="center"> <td> <?php echo "<br>"; ?> </td> </tr> </table> </div> Updatebar.php <?php include("koneksi.php"); $kode_barang = $_POST["kode_barang"]; $nama_barang= $_POST["nama_barang"]; $keterangan = $_POST["keterangan"];
$query = mysql_query("update barang set nama_barang='$nama_barang',
keterangan='$keterangan' WHERE kode_barang='$kode_barang'")or die (mysql_error()); if ($query) { header('location: databar.php?message=success'); } Deletebar.php <?php include('koneksi.php'); $kode_barang = $_GET['kode_barang'];
$query = mysql_query("delete from barang where kode_barang='$kode_barang'") or die(mysql_error()); if ($query) { header('location:databar.php?message=delete'); } ?> PROSES TRANSAKSI Transakasi.php <?php class transaksi { function connect() { include("koneksi.php"); } function gettransaksi(){ $transaksi = new transaksi(); $transaksi->connect();
$query = "select * FROM transaksi order by id_transaksi"; $hasil = mysql_query($query);
return $hasil; }
function cekidtransaksi($id_transaksi) {
$transaksi = new transaksi(); $transaksi->connect();
$query = "SELECT id_transaksi FROM transaksi WHERE id_transaksi='$id_transaksi'"; $hasil = mysql_query($query); $x=0; while($data = mysql_fetch_array($hasil)) { $x = $x+1; } return $x; } function getMaxidtransaksi(){ $transaksi= new transaksi(); $transaksi->connect();
$query = "SELECT max(id_transaksi) AS last from transaksi where id_transaksi like 'T%'";
$hasil = mysql_query($query); return $hasil;
}
$transaksi = new transaksi(); $transaksi->connect(); $tanggal_awal=strtotime($tanggal_awal); $awal=date("Y-m-d H:i:s",mktime(0,0,0,date("m",$tanggal_awal),date("d",$tanggal_awal),date("Y",$tang gal_awal))); $tanggal_akhir=strtotime($tanggal_akhir); $akhir=date("Y-m-d H:i:s",mktime(23,59,59,date("m",$tanggal_akhir),date("d",$tanggal_akhir),date("Y", $tanggal_akhir)));
$query = "SELECT * FROM transaksi WHERE (tgl_jam_masuk BETWEEN
'$awal' AND '$akhir') AND kode_barang='$barang' ORDER BY id_transaksi ASC"; $hasil = mysql_query($query);
return $hasil; }
function getDetailTransaksi($id_transaksi){ $transaksi = new transaksi();
$transaksi->connect();
$query = "select id_transaksi, nopol_kendaraan, tgl_jam_masuk, tgl_jam_keluar, nama_sopir, nama_barang, timbang1, timbang2, berat_bersih FROM transaksi WHERE id_transaksi ='$id_transaksi'"; $hasil = mysql_query($query); return $hasil; } } ?> Timbang.php <?php if (isset($_POST['nopol'])){ include 'koneksi.php'; $nopol = $_POST['nopol']; session_start(); $_SESSION['nopol'] = $nopol; $ada_nopol = ""; $ada_masuk = "";
$sql = "SELECT EXISTS(select nopol_kendaraan from transaksi where nopol_kendaraan = '$nopol') as ada_nopol";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)){ $ada_nopol = $row['ada_nopol'];
}
if ($ada_nopol == 1){
$query2 = mysql_query("SELECT EXISTS(select status_keluar from transaksi where nopol_kendaraan = '$nopol' AND status_keluar = '0') as ada_masuk"); while($hasil = mysql_fetch_array($query2)){
$ada_masuk = $hasil['ada_masuk']; }
if ($ada_masuk == 1){
header ('Location: timbangkeluar.php'); }else{
header ('Location: timbangmasuk.php'); }
}else{
header ('Location: timbangmasuk.php'); }
} ?>
<title>Sistem Informasi Jembatan Timbang</title> <head> <style> td { padding:5px; } </style>
<link type="text/css" href="asset/css/style.css" rel="stylesheet" /> <script src="asset/js/menu.js" type="text/javascript"></script> </head>
<div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.1 Argomulyo Salatiga 50717<br> Telp: (0298) 313789" ?></h2>
<?php
include("menu.php"); ?>
<br /> <div>
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
<form action="timbang.php" method="post" name="myForm" onSubmit="return cekInputan()">
<tr class="hurufx">
<td>NOPOL KENDARAAN </td>
<td><input type="text" name="nopol" size="30" value=""></td> </tr>
<tr> <td></td>
<td><input type="submit" value="Timbang" class="btn-kirim-login"><input type="reset" value="Reset" class="btn-kirim-login"></td>
</tr> </form> </table> </div> <br> timbangmasuk.php <html>
<title>Sistem Informasi Jembatan Timbang</title> <head> <style> .editbox5 { display:none } td { padding:5px; } .editbox { font-size:14px; width:70px; background-color:#ffffcc; border:solid 1px #000; padding:4px; } .edit_tr:hover { cursor:pointer; } </style>
<link type="text/css" href="asset/css/style.css" rel="stylesheet" /> <script src="asset/js/menu.js" type="text/javascript"></script> <script language="javascript" src="asset/js/jquery.js"></script> <script> function showNamaSuppcust(str) { if (str=="") { document.getElementById("nama_suppcust").value=""; return; } if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("nama_suppcust").value=xmlhttp.responseText; } } xmlhttp.open("GET","get_nama_suppcust.php?q="+str,true); xmlhttp.send(); } function showNamaBarang(str) { if (str=="") {
document.getElementById("nama_barang").value=""; return;
}
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("nama_barang").value=xmlhttp.responseText; } xmlhttp.open("GET","get_nama_barang.php?q="+str,true); xmlhttp.send(); } </script> </head> <?php session_start(); ?> <div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.1 Argomulyo Salatiga 50717 <br> Telp: (0298) 313789" ?></h2> <div id="body"> <?php include("menu.php"); include("suppcust.php"); include("barang.php"); include("transaksi.php"); $transaksi = new transaksi(); $suppcust= new suppcust(); $barang = new barang();
$result = $suppcust->getsupplier(); $result1 = $suppcust->getcustomer(); $result2 = $barang->getbarang(); $hasil = $transaksi->getMaxidtransaksi(); $datax = mysql_fetch_array($hasil); $lastidtransaksi= $datax['last']; $lastNoUrut = substr($lastidtransaksi, 1, 3); $nextNoUrut = $lastNoUrut + 1;
$nextidtransaksi = "T".sprintf('%03s', $nextNoUrut); date_default_timezone_set("Asia/Jakarta");
$today = date("yyyy-mm-dd"); ?>
<div class="cleaner_h10"></div>
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
<form name="timbang1" action="timbang1.php" method="post">
<tr style="background-color:#000000; color:#FFFFFF;" align="center"><td colspan="9" height="25" class="hurufx">Proses Timbang Masuk</td></tr> <tr class="hurufx">
<td>Id Transaksi </td>
<td><input type="text" name="id_transaksi" size="30" value="<?php echo $nextidtransaksi; ?>" readonly="readonly"></td>
</tr>
<tr class="hurufx"> <td>Tanggal</td>
<td><input type="text" name="tanggal" value="<?php echo date("Y-m-d H:i:s")?>" readonly="readonly"></td>
</tr>
<tr class="hurufx"> <td>Kode Suppcust </td>
<td><input type="text" id="suppcust" name="suppcust" required="required" onchange="showNamaSuppcust(this.value);">
<input type='text' id="nama_suppcust" name="nama_suppcust" readonly="readonly"></td>
</tr>
<tr class="hurufx"> <td>Barang</td>
<td><input type="text" id="barang" name="barang" required="required" onchange="showNamaBarang(this.value);">
</tr>
<tr class="hurufx"> <td>Nopol Kendaraan</td>
<td><input type="text" name="nopol" value='<?php echo $_SESSION['nopol'];?>'></td> </tr>
<tr class="hurufx"> <td>Nama Supir</td>
<td><input type="text" name="supir" value="" required="required"></td> </tr>
<tr class="hurufx"> <td>Timbang1</td>
<td><input type="text" name="timbang1" value="" required="required" >Kg <input type="submit" name="Timbang1" value="Timbang1" class="btn-kirim-login"></td> </tr> </form> </table> <html> Timbang1.php <?php include("koneksi.php"); session_start(); $id_transaksi = $_POST["id_transaksi"];
$tanggal = date ("Y-m-d H:i:s", strtotime($_POST['tanggal'])); $suppcust = $_POST["suppcust"]; $nama_suppcust = $_POST["nama_suppcust"]; $barang= $_POST["barang"]; $nama_barang= $_POST["nama_barang"]; $supir = $_POST["supir"]; $nopol = $_POST["nopol"]; $timbang1= $_POST["timbang1"];
$query=mysql_query ("INSERT INTO transaksi(id_transaksi, kode_suppcust, nama_suppcust, kode_barang, nama_barang, nama_sopir, nopol_kendaraan,
tgl_jam_masuk, timbang1, status_keluar) VALUES('$id_transaksi', '$suppcust', '$nama_suppcust', '$barang', '$nama_barang', '$supir', '$nopol', '$tanggal', '$timbang1', '0')",$connection)or die (mysql_error());
session_destroy(); ?> <script language="JavaScript"> document.location='timbang.php'</script> tumbangkeluar.php <html>
<title>Sistem Informasi Jembatan Timbang</title> <head> <style> .editbox5 { display:none } td { padding:5px; } .editbox { font-size:14px; width:70px; background-color:#ffffcc; border:solid 1px #000; padding:4px; } .edit_tr:hover { cursor:pointer; } </style>
<link type="text/css" href="asset/css/style.css" rel="stylesheet" /> <script src="asset/js/menu.js" type="text/javascript"></script> <script>
function hitung(t2, t1) { if (t2=="") {
document.getElementById("bb").value = 0; return; }else{ var bb; if (parseFloat(t2) > parseFloat(t1)){ bb = (t2 - t1); }else{ bb = (t1 - t2); } document.getElementById("bb").value = bb; } } </script> </head> <div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.1 Argomulyo Salatiga 50717 <br> Telp: (0298) 313789" ?></h2> <div id="body"> <?php include("menu.php"); include("suppcust.php"); include("barang.php"); include("transaksi.php"); $suppcust= new suppcust(); $barang = new barang(); $transaksi = new transaksi(); $result = $suppcust->getsupplier(); $result1 = $suppcust->getcustomer(); $result2 = $barang->getbarang(); date_default_timezone_set("Asia/Jakarta"); $today = date("d-m-y"); ?> <div class="cleaner_h10"></div> <?php session_start(); $nopol = $_SESSION['nopol'];
$sql="select t.*, b.nama_barang, s.nama_suppcust from transaksi t, barang b, suppcust s where nopol_kendaraan='$nopol' AND status_keluar = '0' AND
t.kode_barang = b.kode_barang AND t.kode_suppcust = s.kode_suppcust order by tgl_jam_masuk DESC"; $query = mysql_query($sql); while($row = mysql_fetch_array($query)){ $id_transaksi = $row['id_transaksi']; $kode_suppcust = $row['kode_suppcust']; $nama_suppcust = $row['nama_suppcust']; $barang= $row['kode_barang']; $nama_barang= $row['nama_barang']; $sopir = $row['nama_sopir']; $timbang1 = $row['timbang1']; } ?>
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
<form name="timbang2.php" action="timbang2.php" method="post" target= "_blank"> <tr style="background-color:#000000; color:#FFFFFF;" align="center"><td
colspan="9" height="25" class="hurufx">Proses Timbang Keluar</td></tr> <tr class="hurufx">
<td>Id Transaksi </td>
<td><input type="text" name="id_transaksi" size="30" value="<?php echo $id_transaksi;?>" readonly="readonly"></td>
</tr>
<tr class="hurufx"> <td>Tanggal</td>
<td><input type="text" name="tanggalkeluar" value="<?php echo date("Y-m-d H:i:s")?>" readonly="readonly"></td>
</tr>
<tr class="hurufx">
<td>Supplier/Customer</td>
<td><input type="text" name="suppcust" value="<?php echo $kode_suppcust; ?>" readonly="readonly">
<input type="text" name="namasuppcust" value="<?php echo $nama_suppcust; ?>" readonly></td>
<tr class="hurufx"> <td>Barang</td>
<td><input type="text" name="barang" value="<?php echo $barang;?>" readonly="readonly" >
<input type="text" name="namabarang" value="<?php echo $nama_barang; ?>" readonly="readonly"></td>
</tr>
<tr class="hurufx"> <td>Nopol Kendaraan</td>
<td><input type="text" name="nopol" value='<?php echo $_SESSION['nopol'];?>' readonly></td>
</tr>
<tr class="hurufx"> <td>Nama Supir</td>
<td><input type="text" name="supir" value="<?php echo $sopir;?>" readonly="readonly"></td>
</tr>
<tr class="hurufx"> <td>Timbang1</td>
<td><input type="text" id="timbang1" name="timbang1" value="<?php echo $timbang1;?>" readonly="readonly">
</tr>
<tr class="hurufx"> <td>Timbang2</td>
<td><input type="text" id="timbang2" name="timbang2" value="" required="required">Kg
<input type="button" name="timbang" value="timbang2" class="btn-kirim-login" onclick='hitung(document.getElementById("timbang2").value,
document.getElementById("timbang1").value);'></td> </tr>
<tr class="hurufx"> <td>Berat Bersih</td>
<td><input type="text" id="bb" name="bb" value="" required readonly>Kg <input type="submit" name="simpan" value="Simpan & Cetak" class="btn-kirim-login"></td> </tr> </form> </table> <html> Timbang2.php <?php
// Define relative path from this script to mPDF
$nama_dokumen='PDF With MPDF'; //Beri nama file PDF hasil. define('_MPDF_PATH','MPDF57/');
include(_MPDF_PATH . "mpdf.php");
$mpdf=new mPDF('utf-8', 'A4'); // Create new mPDF Document //Memulai proses untuk menyimpan variable
ob_start(); ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Laporan Hasil Jembatan Timbang</title>
</head> <?php include("koneksi.php"); session_start(); $id_transaksi = $_GET['id_transaksi']; date_default_timezone_set("Asia/Jakarta"); $today = date("d-m-y"); $jam= date("h:i:s"); $nopol = $_SESSION["nopol"]; $id = $_POST['id_transaksi']; $tanggal = $_POST['tanggalkeluar']; $timbang2= $_POST["timbang2"]; $bb = $_POST["bb"]; $timbang1=$_POST['timbang1']; $namabarang=$_POST['namabarang']; $supir=$_POST['supir'];
$query=mysql_query ("UPDATE transaksi SET tgl_jam_keluar = '$tanggal', timbang2 = '$timbang2', berat_bersih = '$bb', status_keluar = '1' WHERE id_transaksi = '$id'",$connection)or die (mysql_error());
?> <body>
<style type="text/css"> HTML, body{ margin:0; pagging:0; } #wreaper{ width:900px; height:auto; margin:0 auto; } #header{ margin-top:50px; width:100%; height:100px; } #kiri{ float:left; width:100%; height:auto; text-align:left; } #kanan{ float:right; widows:50%; height:auto; text-align:left; } #isi{ height: auto; padding:2px; } #footer{ height:100%; clear:both; margin-bottom:100px; } .table{
font:Georgia, "Times New Roman", Times, serif; color:#036; width:100%; text-align:center; border-collapse:collapse; font-size:0.90vw; margin-bottom:10px; } .table caption h3{ } .table td{ border:solid 1px #999; } .table th{ padding:8px 0; } .table td{ padding:4px 8px; } .dropmenu { background-color:RGBA(255, 255, 255,0.6); height:36px; list-style-type:none; margin:0; padding:0px; position:fixed; width:100%; bottom:10px; } .dropmenu li { border-right:solid 1px #FFF; float:left; height:36px; } .dropmenu li a { display:block;
font: 12px Arial, Helvetica, sans-serif; font-weight:bold; padding:10px 20px; text-decoration:none; vertical-align:text-bottom; bottom:0; left:-1px; color:RGBA(0,0,0,0.1); } .dropmenu li a:hover { background-color:RGBA(6, 139, 156,0.4); position: relative;
-ms-transition: all 0.4s ease 0s; -o-transition: all 0.4s ease 0s;
transition: all 0.4s ease 0s; }</style> <div id="wreaper"> <div id="header"> <div id="kiri"> <table> <tr> <td><b>PT. DAYA MANUNGGAL</b></td> </tr> <tr>
<td><b>JL Argobusono No.1 Argomulyo Salatiga 50717</b></td> </tr> <tr><td></td></tr> <tr><td></td></tr> </table> <table> <tr>
<td colspan=2>No Kendaraan</td><td>: <?php echo $nopol?></td> </tr>
<tr>
<td colspan=2>Tanggal/Jam</td><td>: <?php echo $tanggal ?></td> </tr>
<tr><td></td></tr> <tr><td></td></tr> <tr>
<td colspan=2>Timbang Pertama </td><td align="left">:</td><td align="right"><?php echo $timbang1 ?></td>
<td>KG</td> </tr> <tr>
<td colspan=2>Timbang Kedua </td><td align="left">:</td><td align="right"><?php echo $timbang2 ?></td>
<td>KG</td> </tr> <tr>
<td colspan=2>Berat Bersih </td><td align="left">:</td><td align="right"><?php echo $bb ?></td> <td>KG</td> </tr> <tr><td></td></tr> <tr><td></td></tr> <tr>
<td colspan=2>Nama Barang </td><td>: <?php echo $namabarang ?></td> </tr>
<tr>
<td colspan=2>Nama Sopir </td><td>: <?php echo $supir ?></td> </tr>
</table> </div>
<div id="footer">
<div id="kiri"><table width="200%" > <tr><td></td></tr>
<tr><td></td></tr> <tr >
<td colspan="3" align="center">Mengetahui</div></td> <td colspan="2" align="center">Security</div></td> <td colspan="2" align="center">Petugas Timbang</div></td> <td colspan="2" align="center">Gudang1</div></td>
</tr> <tr>
<td height="63"> </td> </tr> </table> </div> </div> </div> </div> </body> </html> <?php
//Menutup mpdf dan generate ke dalam format pdf
$html = ob_get_contents(); //Proses untuk mengambil hasil dari OB.. ob_end_clean();
//Disini dimulai proses convert UTF-8, kalau ingin ISO-8859-1 cukup mengganti $mpdf->WriteHTML($html); $mpdf->WriteHTML(utf8_encode($html)); $mpdf->Output($nama_dokumen.".pdf" ,'I'); exit; session_destroy(); ?> <script language="JavaScript"> document.location='timbang.php'</script> CETAK NOTA Cetak_nota1.php
<title>Sistem Informasi Jembatan Timbang</title> <head> <style> td { padding:5px; } </style>
<link type="text/css" href="asset/css/style.css" rel="stylesheet" /> <script src="asset/js/menu.js" type="text/javascript"></script> </head>
<div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.1 Argomulyo Salatiga 50717 <br> Telp: (0298) 313789" ?></h2> <div id="body"> <?php include("menu.php"); include("koneksi.php"); include("transaksi.php"); $transaksi= new transaksi(); ?>
<br /> <div>
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
<form action="lihat_nota.php" method="post" name="myForm" onSubmit="return cekInputan()">
<tr class="hurufx">
<td align="center">NOPOL KENDARAAN </td>
<td><input type="text" name="nopol" size="30" value=""></td> </tr>
<tr> <td></td>
<td><input type="submit" value="Cari" class="btn-kirim-login"><input type="reset" value="Reset" class="btn-kirim-login"></td>
</tr> </form> </table>
Lihat_nota.php
<title>Sistem Informasi Jembatan Timbang</title> <head>
<style> td {
padding:5px; }
</style>
<link type="text/css" href="asset/css/style.css" rel="stylesheet" /> <script src="asset/js/menu.js" type="text/javascript"></script> </head>
<div id="container">
<h1><?php echo "Sistem Informasi Jembatan Timbang" ?></h1>
<h2><?php echo "PT. DAYA MANUNGGAL <br> JL Argobusono No.1 Argomulyo Salatiga 50717 <br> Telp: (0298) 313789" ?></h2> <div id="body"> <?php include("menu.php"); include("koneksi.php"); include("transaksi.php"); $transaksi= new transaksi(); $batas = 10;
$pg = isset( $_GET['pg'] ) ? $_GET['pg'] : ""; if ( empty( $pg ) ) { $posisi = 0; $pg = 1; } else { $posisi = ( $pg - 1 ) * $batas; } ?> <br />
<div><form action="nota_pdf.php" method="post" target="_blank">
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
<tr class="hurufx"> <td align="center">No.</td> <td align="center">Id Transaksi</td> <td align="center">Nopol Kendaraan</td> <td align="center">Nama Sopir</td> <td align="center">Nama Barang</td> <td align="center">Tgl/Jam Masuk</td> <td align="center">Tgl/Jam Keluar</td> <td align="center">Berat Bersih</td> <td align="center" colspan="2">Action</td> </tr> <?php
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING)); $nopol = $_POST['nopol'];
$query1="select * from transaksi where nopol_kendaraan='$nopol' ORDER BY tgl_jam_keluar DESC limit $posisi, $batas";
$result=mysql_query($query1) or die(mysql_error()); $i = 1; while($row = mysql_fetch_array($result)){ ?> <tr align="center" class="hurufx"> <td><?php echo $i; ?></td> <td><?php echo $row["id_transaksi"]; ?></td> <td><?php echo $row["nopol_kendaraan"]; ?></td> <td><?php echo $row["nama_sopir"]; ?></td> <td><?php echo $row["nama_barang"]; ?></td> <td><?php echo $row["tgl_jam_masuk"]; ?></td> <td><?php echo $row["tgl_jam_keluar"]; ?></td> <td><?php echo $row["berat_bersih"]; ?></td>
<td width="90"><a href="nota_pdf.php?id_transaksi=<?php echo
$row['id_transaksi']; ?>" class="cbbarang" target="_blank"><div class="btn-tampil">Buat Nota</div></a></td> </tr></font> <?php $i++; } ?> <tr><td colspan=6><?php //hitung jumlah data
$jml_data = mysql_num_rows(mysql_query("SELECT * FROM transaksi where nopol_kendaraan='$nopol' ORDER BY tgl_jam_keluar DESC"));
//Jumlah halaman
//Navigasi ke sebelumnya if ( $pg > 1 ) {
$link = $pg-1;
$prev = "<a href='?pg=$link'>Sebelumnya </a>"; } else {
$prev = "Sebelumnya "; }
//Navigasi nomor $nmr = '';
for ( $i = 1; $i<= $JmlHalaman; $i++ ){ if ( $i == $pg ) { $nmr .= $i . " "; } else { $nmr .= "<a href='?pg=$i'>$i</a> "; } } //Navigasi ke selanjutnya if ( $pg < $JmlHalaman ) { $link = $pg + 1;
$next = " <a href='?pg=$link'>Selanjutnya</a>"; } else {
$next = " Selanjutnya"; }
//Tampilkan navigasi echo $prev . $nmr . $next; ?>
</td></tr> </table>
<table><tr><td><a href="#top"><font color="black">Ke Atas</font></a></td><td></td></tr></table>
Nota.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <?php
// Define relative path from this script to mPDF
$nama_dokumen='PDF With MPDF'; //Beri nama file PDF hasil. define('_MPDF_PATH','MPDF57/');
include(_MPDF_PATH . "mpdf.php");
$mpdf=new mPDF('utf-8', 'A4'); // Create new mPDF Document //Memulai proses untuk menyimpan variable
ob_start(); ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Laporan Hasil Jembatan Timbang</title>
</head> <?php session_start(); include ("koneksi.php"); $id_transaksi = $_GET['id_transaksi']; date_default_timezone_set("Asia/Jakarta"); $today = date("d-m-y"); $jam= date("h:i:s"); ?> <? mysql_connect('localhost','root',''); mysql_select_db('jembatan_timbang');
$hasil=mysql_query("SELECT * FROM transaksi where
id_transaksi='".mysql_real_escape_string($_GET['id_transaksi'])."'"); $data=mysql_fetch_array($hasil); ?> <body> <style type="text/css"> HTML, body{ margin:0; pagging:0; } #wreaper{ width:900px; height:auto; margin:0 auto; }
#header{ margin-top:50px; width:100%; height:100px; } #kiri{ float:left; width:100%; height:auto; text-align:left; } #kanan{ float:right; widows:50%; height:auto; text-align:left; } #isi{ height: auto; padding:2px; } #footer{ height:100%; clear:both; margin-bottom:100px; } .table{
font:Georgia, "Times New Roman", Times, serif; color:#036; width:100%; text-align:center; border-collapse:collapse; font-size:0.90vw; margin-bottom:10px; } .table caption h3{ } .table td{ border:solid 1px #999; } .table th{ padding:8px 0; } .table td{ padding:4px 8px; } .dropmenu { background-color:RGBA(255, 255, 255,0.6); height:36px; list-style-type:none; margin:0; padding:0px; position:fixed; width:100%; bottom:10px; } .dropmenu li { border-right:solid 1px #FFF; float:left; height:36px; } .dropmenu li a { display:block;
font: 12px Arial, Helvetica, sans-serif; font-weight:bold; padding:10px 20px; text-decoration:none; vertical-align:text-bottom; bottom:0; left:-1px; color:RGBA(0,0,0,0.1); } .dropmenu li a:hover {
background-color:RGBA(6, 139, 156,0.4); position: relative;
-ms-transition: all 0.4s ease 0s; -o-transition: all 0.4s ease 0s;
transition: all 0.4s ease 0s; }</style>
<?php
$query1 = mysql_query("select id_transaksi, nopol_kendaraan, tgl_jam_masuk, tgl_jam_keluar, nama_sopir, nama_barang, timbang1, timbang2, berat_bersih FROM transaksi WHERE id_transaksi ='$id_transaksi'");
$data=mysql_fetch_array($query1); ?> <div id="wreaper"> <div id="header"> <div id="kiri"> <table> <tr> <td><b>PT. DAYA MANUNGGAL</b></td> </tr> <tr>
<td><b>JL Argobusono No.1 Argomulyo Salatiga 50717</b></td> </tr> <tr><td></td></tr> <tr><td></td></tr> </table> <table> <tr>
<td colspan=2>No Kendaraan</td><td>: <?php echo"$data[nopol_kendaraan]"; ?></td> </tr> <tr> <td colspan=2>Tanggal/Jam</td><td>: <?php echo"$data[tgl_jam_keluar]"; ?></td> </tr> <tr><td></td></tr> <tr><td></td></tr> <tr>
<td colspan=2>Timbang Pertama </td><td align="left">:</td><td align="right"><?php echo"$data[timbang1]"; ?></td>
<td>KG</td> </tr> <tr>
<td colspan=2>Timbang Kedua </td><td align="left">:</td><td align="right"><?php echo"$data[timbang2]"; ?></td>
<td>KG</td> </tr> <tr>
<td colspan=2>Berat Bersih </td><td align="left">:</td><td align="right"><?php echo"$data[berat_bersih]"; ?></td> <td>KG</td> </tr> <tr><td></td></tr> <tr><td></td></tr> <tr>
<td colspan=2>Nama Barang </td><td>: <?php echo"$data[nama_barang]"; ?></td> </tr>
<tr>
<td colspan=2>Nama Sopir </td><td>: <?php echo"$data[nama_sopir]"; ?></td> </tr>
</table> </div>
<div id="footer">
<div id="kiri"><table width="200%" > <tr><td></td></tr>
<tr><td></td></tr> <tr >
<td colspan="3" align="center">Mengetahui</div></td> <td colspan="2" align="center">Security</div></td> <td colspan="2" align="center">Petugas Timbang</div></td> <td colspan="2" align="center">Gudang1</div></td> </tr> <tr> <td height="63"> </td> </tr> </table>
</div> </div> </div> </div> </body> </html> <?php
//Menutup mpdf dan generate ke dalam format pdf
$html = ob_get_contents(); //Proses untuk mengambil hasil dari OB.. ob_end_clean();
//Disini dimulai proses convert UTF-8, kalau ingin ISO-8859-1 cukup mengganti $mpdf->WriteHTML($html); $mpdf->WriteHTML(utf8_encode($html)); $mpdf->Output($nama_dokumen.".pdf" ,'I'); exit; ?> Rekap.php <html>
<title>Sistem Informasi Jembatan Timbang</title> <head> <style> .editbox5 { display:none } td { padding:5px; } .editbox { font-size:14px; width:70px; background-color:#ffffcc; border:solid 1px #000; padding:4px; } .edit_tr:hover { cursor:pointer; } </style>
<link type="text/css" href="asset/css/style.css" rel="stylesheet" /> <script src="asset/js/menu.js" type="text/javascript"></script> <script language="javascript" type="text/javascript"
src="asset/js/datetimepicker_css.js"></script>
<script language="javascript" src="asset/js/jquery.js"></script> <script> function showNamaBarang(str) { if (str=="") { document.getElementById("nama_barang").value=""; return; } if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("nama_barang").value=xmlhttp.responseText; } } xmlhttp.open("GET","get_nama_barang.php?q="+str,true); xmlhttp.send(); } </script> </head> <div id="container">