<strong>Barang Berfungsi untuk mengelola data Barang (tambah, edit, hapus) yang tersimpan di dalam database
produk
<strong>pelanggan Berfungsi untuk mengelola data produk pelanggan (tambah, edit, hapus) yang tersimpan di dalam database
<strong>Transaksi Berfungsi untuk memproses penjualan yang terjadi dan mencetak nota penjualan
transaksi
<strong>Laporan Penjualan Berfungsi untuk laporan penjualan dalam periode satu bulan atau satu tahun
mengetahui
<strong>Manajemen admin Berfungsi untuk mengelola data admin (tambah, edit, hapus) yang tersimpan di dalam database
<strong>Log Out Keluar dari sistem aplikasi
Java.php
function getbarang(){ $barang = new barang(); $barang->connect(); $query = "select * FROM barang order by k_brg"; $hasil = mysql_query($query); return $hasil; }
function cekKodebarang($k_brg) { $barang = new barang(); $barang->connect(); $query = "SELECT k_brg FROM barang WHERE k_brg='$k_brg'"; $hasil = mysql_query($query);
function getMaxKodebarang(){ $barang = new barang(); $barang->connect(); $query = "SELECT max(k_brg) AS last FROM barang"; $hasil = mysql_query($query); return $hasil; } function insertbarang($k_brg, $nama_brg, $jenis, $harga, $satuan) { $barang = new barang(); $barang->connect(); $query = "insert into barang(k_brg, nama_brg, jenis, harga, satuan) VALUES ('$k_brg','$nama_brg', '$jenis', '$harga','$satuan')"; $hasil = mysql_query($query); if($hasil){ return "T"; } else { return "F"; } } function getbarangEdit($k_brg) { $barang = new barang(); $barang->connect(); $query = "select * FROM barang WHERE k_brg='$k_brg'"; $hasil = mysql_query($query); return $hasil; }
function updatebarang($k_brg, $nama_brg, $jenis, $harga, $satuan) { $barang = new barang(); $barang->connect(); $query = "update barang set nama_brg='$nama_brg', harga='$harga', satuan='$satuan' WHERE k_brg='$k_brg'"; $hasil = mysql_query($query); if($hasil){ return "T"; } else { return "F"; } }
function deletebarang($k_brg) { $barang =
new barang();
$barang->connect(); $query = "delete FROM barang WHERE k_brg='$k_brg'"; $hasil = mysql_query($query); if($hasil){ return "T"; } else { return "F"; } }
function getHargabarang($k_brg) { $barang = new barang(); $barang->connect(); $query = "select harga FROM barang WHERE k_brg='$k_brg'"; $hasil = mysql_query($query); return $hasil; } }
jenis='$jenis',
?> DetailTransaksi connect(); $query = "select no_faktur, k_brg, harga, jumlah FROM detailtransaksi, WHERE k_brg = k_brg AND no_faktur='$no_faktur'"; $hasil = mysql_query($query); return $hasil; } function insertDetailTransaksi($no_faktur, $k_brg, $jumlah, $subtotal) { $detail = new DetailTransaksi(); $detail->connect(); $query = "insert into detailtransaksi(no_faktur, k_brg, jumlah, subtotal) VALUES ('$no_faktur','$k_brg', '$jumlah', '$subtotal')"; $hasil = mysql_query($query); if($hasil){ return "T"; } else { return "F"; } } function deleteDetailTransaksi($no_faktur, $k_brg) { $detail = new DetailTransaksi();
$detail->connect(); $query = "delete FROM detailtransaksi WHERE no_faktur='$no_faktur' AND k_brg='$k_brg'"; $hasil = mysql_query($query); if($hasil){ return "T"; } else { return "F"; }
}
function deleteDetailTransaksiAll($no_faktur) { $detail = new DetailTransaksi(); $detail->connect(); $query = "delete FROM detailtransaksi WHERE no_faktur='$no_faktur'"; $hasil = mysql_query($query); if($hasil){ return "T"; } else { return "F"; }
}}?>
User.php connect(); $query = "select * FROM admin order by username"; $hasil = mysql_query($query); return $hasil; } function getIdUser($username) { $user = new User(); $user->connect(); $query = "SELECT username FROM admin WHERE username='$username'"; $hasil = mysql_query($query); $x=0; while($data = mysql_fetch_array($hasil)) { $x = $x+1; } return $x;
function getUserEdit($username) { $user = new User(); $user->connect(); $query = "select * FROM admin WHERE username='$username'"; $hasil = mysql_query($query); return $hasil; } function updateUser($username, $password, $nama, $level) { $user = new User(); $user->connect(); $query = "update admin set password='$password', level='$level' WHERE username='$username'"; $hasil = mysql_query($query); if($hasil){ return "T"; } else { return "F"; } }
nama='$nama',
function deleteUser($username) { $user = new User(); $user->connect(); $query = "delete FROM admin WHERE username='$username'"; $hasil = mysql_query($query); if($hasil){ return "T"; } else { return "F"; } } function cekLogin($username, $password) { $user = new User(); $user->connect(); $query = "SELECT username, password, nama, username='$username' AND password='$password'"; $hasil = mysql_query($query); $cek = mysql_num_rows($hasil); return $hasil; /*if($cek >= 1){ return $id; } else { return "gagal"; }*/ }
level
FROM
admin
/*function cekUserAktif($username, $password){ $user = new User(); $user->connect(); $query = "SELECT status FROM user WHERE id='$id' && sandi='$sandi'"; $hasil = mysql_query($query);
WHERE
$x=0; while($data = mysql_fetch_array($hasil)) { $res[$x] = $data["status"]; $x = $x+1; } $hsl = $res[0]; return $hsl; } */ } Transaksi.php connect(); $query = "SELECT max(no_faktur) AS last FROM transaksi WHERE no_faktur LIKE '$today%'"; $hasil = mysql_query($query); return $hasil; } function insertTransaksi($no_faktur, $tanggal, $grand_total, $bayar,$k_pel) { $transaksi = new Transaksi(); $transaksi->connect(); $query = "insert into transaksi(no_faktur, tanggal, grand_total, bayar, depo, k_pel) VALUES ('$no_faktur','$tanggal', '$grand_total', '$bayar','$k_pel')"; $hasil = mysql_query($query); if($hasil){ return "T"; } else { return "F"; } } function getTransaksi(){ $transaksi = new Transaksi(); $transaksi->connect(); $query = "SELECT * FROM transaksi ORDER BY no_faktur DESC"; $hasil = mysql_query($query); return $hasil; } function getHistoryTransaksi($tanggal_awal, $tanggal_akhir){ $transaksi = new Transaksi(); $transaksi->connect(); $query = "SELECT * FROM transaksi WHERE tanggal BETWEEN '$tanggal_awal' AND '$tanggal_akhir' ORDER BY no_nota ASC"; $hasil = mysql_query($query); return $hasil; } function deleteTransaksi($no_faktur) { $transaksi = new Transaksi(); $transaksi->connect(); $query = "delete FROM transaksi WHERE no_faktur='$no_faktur'"; $hasil = mysql_query($query); if($hasil){ return "T"; } else { return "F"; } } } ?> Logout.php
{ if(ISSET($_SESSION['username'])) { UNSET($_SESSION ['username']); } } header("location: index.php"); session_destroy(); ?> cek_login.php
$user = new User(); //$status = $user->cekUserAktif($usernamex, $passwordx); $hasil = $user->cekLogin($usernamex, $passwordx); $datax = mysql_fetch_array($hasil); $cek = mysql_num_rows($hasil); $username = $datax["username"]; $level = $datax["level"]; $nama = $datax["nama"]; //echo $cek." - ".$username." - ".$level; if($cek>0){ session_start(); $_SESSION['username'] = $usernamex; $_SESSION['level'] = $level; $_SESSION['nama'] = $nama; header("location: index_admin.php"); } else { header("location: index.php"); } ?> master_java.php Sistem Informasi Penjualan <style> .editbox { 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; }