$hasil = mysql_query( "UPDATE `pos_produkjasa` SET `kode`='$kode',`jenjang`='$jenjang',`nama`='$nama',`jenis`='$jenis',`hargajual`='$hargajual' WHERE `id`='$id'" ); if($hasil){ $admin .= '<div class="sukses"><b>Berhasil di Update.</b></div>'; $style_include[] ='<meta http-equiv="refresh" content="1; url=admin.php?pilih=produkjasa&mod=yes" />'; }else{ $admin .= '<div class="error"><b>Gagal di Update.</b></div>'; } } } $query = mysql_query ("SELECT * FROM `pos_produkjasa` WHERE `id`='$id'"); $data = mysql_fetch_array($query); $jenis = $data['jenis']; $jenjang = $data['jenjang']; $kode = $data['kode']; $generatekode=generatekodeedit('KPJ','kode','pos_produkjasa',$id); $admin .= '<div class="panel panel-info"> <div class="panel-heading"><h3 class="panel-title">Edit Jasa</h3></div>'; $admin .= ' <form method="post" action=""> <table border="0" cellspacing="0" cellpadding="0"class="table INFO"> <tr> <td>Jenis</td> <td>:</td> <td><select name="jenis" class="form-control" required>'; $hasil = $koneksi_db->sql_query("SELECT * FROM pos_jenisproduk where jenis='JASA' ORDER BY nama asc"); $admin .= '<option value="">== Jenis ==</option>'; while ($datas = $koneksi_db->sql_fetchrow ($hasil)){ $pilihan = ($datas['id']==$jenis)?"selected":''; $admin .= '<option value="'.$datas['id'].'"'.$pilihan.'>'.$datas['nama'].'</option>'; }
$hasil = mysql_query( "UPDATE `pos_produkbiaya` SET `kode`='$kode',`jenjang`='$jenjang',`nama`='$nama',`jenis`='$jenis',`hargajual`='$hargajual' WHERE `id`='$id'" ); if($hasil){ $admin .= '<div class="sukses"><b>Berhasil di Update.</b></div>'; $style_include[] ='<meta http-equiv="refresh" content="1; url=admin.php?pilih=bebanbiaya&mod=yes" />'; }else{ $admin .= '<div class="error"><b>Gagal di Update.</b></div>'; } } } $query = mysql_query ("SELECT * FROM `pos_produkbiaya` WHERE `id`='$id'"); $data = mysql_fetch_array($query); $jenis = $data['jenis']; $jenjang = $data['jenjang']; $kode = $data['kode']; $generatekode=generatekodeedit('KBB','kode','pos_produkbiaya',$id); $admin .= '<div class="panel panel-info"> <div class="panel-heading"><h3 class="panel-title">Edit Biaya</h3></div>'; $admin .= ' <form method="post" action=""> <table border="0" cellspacing="0" cellpadding="0"class="table INFO"> <tr> <td>Jenis</td> <td>:</td> <td><select name="jenis" class="form-control" required>'; $hasil = $koneksi_db->sql_query("SELECT * FROM pos_jenisproduk ORDER BY nama asc"); $admin .= '<option value="">== Jenis ==</option>'; while ($datas = $koneksi_db->sql_fetchrow ($hasil)){ $pilihan = ($datas['id']==$jenis)?"selected":''; $admin .= '<option value="'.$datas['id'].'"'.$pilihan.'>'.$datas['nama'].'</option>'; }
}else{ $admin .= '<div class="error"><b>Gagal di Update.</b></div>'; } unset($kode); } } $query = mysql_query ("SELECT * FROM `pos_supplier` WHERE `id`='$id'"); $data = mysql_fetch_array($query); $kode = $data['kode']; $nama = $data['nama']; $alamat = $data['alamat']; $telepon = $data['telepon']; $carabayar = $data['carabayar']; $termin = $data['termin']; $generatekode=generatekodeedit('SUP','kode','pos_supplier',$id); if(!$kode){$kode = $generatekode;} $sel2 = '<select name="carabayar" class="form-control">'; $arr2 = array ('Tunai','Debet Card','Hutang'); foreach ($arr2 as $kk=>$vv){ if ($carabayar == $vv){ $sel2 .= '<option value="'.$vv.'" selected="selected">'.$vv.'</option>'; }else { $sel2 .= '<option value="'.$vv.'">'.$vv.'</option>'; } } $sel2 .= '</select>'; $admin .= '<div class="panel panel-info"> <div class="panel-heading"><h3 class="panel-title">Edit Supplier</h3></div>'; $admin .= '
} unset($kode); unset($nama); unset($jumlah); unset($jumlah2); unset($hargabeli); unset($hargajual); } } $query = mysql_query ("SELECT * FROM `pos_produk` WHERE `id`='$id'"); $data = mysql_fetch_array($query); $jenis = $data['jenis']; $jenjang = $data['jenjang']; $kode = $data['kode']; $generatekode=generatekodeedit('KPR','kode','pos_produk',$id); if(!$kode){$kode = $generatekode;} $admin .= '<div class="panel panel-info"> <div class="panel-heading"><h3 class="panel-title">Edit Produk</h3></div>'; $admin .= ' <form method="post" action=""> <table border="0" cellspacing="0" cellpadding="0"class="table INFO"> <tr> <td>Jenis</td> <td>:</td> <td><select name="jenis" class="form-control" required>'; $hasil = $koneksi_db->sql_query("SELECT * FROM pos_jenisproduk where jenis='BARANG' ORDER BY nama asc"); $admin .= '<option value="">== Jenis Produk==</option>'; while ($datas = $koneksi_db->sql_fetchrow ($hasil)){ $pilihan = ($datas['id']==$jenis)?"selected":''; $admin .= '<option value="'.$datas['id'].'"'.$pilihan.'>'.$datas['nama'].'</option>';