mohon bantuannya gan udah stuck mau update data tapi inputannya gak kebaca, ini codenya :
Spoiler for edit:
Code:
<form action="update_laku.php" method="post">
<table class="table">
<tr>
<td></td>
<td><input type="hidden" name="id" value="<?php echo $d['id'] ?>"></td>
</tr>
<?php
echo "<legend>Edit Penjualan</legend>";
$id=$_GET['id'];
$query=mysql_query("select id_cust,nama_cust,id_brg,nama_brg,jumlah,keterangan from detail_penjualan where id ='$id'");
$nomor=mysql_fetch_array(mysql_query("select * from penjualan where id='$id'"));
?>
<div class='navbar-form pull-right'>
Nota : <input type='text' name='id' value="<?php echo $nomor['id'] ?>" disabled>
<input type='text' name='tanggal' value="<?php echo $nomor['tanggal'] ?>" disabled>
</div>
<tr>
<td><input type="text" name="id_cust" class="form-control" placeholder="ID Customer" value="<?php echo $nomor['id_cust']?>" readonly ></td>
<td><input type="text" name="nama_cust" class="form-control" placeholder="Nama Customer" value="<?php echo $nomor['nama_cust']?>" readonly></td>
</tr>
</tr>
<tr>
<td>Kode Barang</td>
<td>Nama</td>
<td>Jumlah Beli</td>
<td>Keterangan</td>
<td colspan=2>Tools</td>
<?php
$query=mysql_query("select * from detail_penjualan where id ='$id'");
while($r=mysql_fetch_array($query)){
?>
<tr>
<td><input type="text" name="id_brg"class="form-control" value="<?php echo $r['id_brg'] ?>" readonly></td>
<td><input type="text" name="nama_brg"class="form-control" value="<?php echo $r['nama_brg'] ?>" readonly></td>
<td><input type="text" name="jumlah" value="<?php echo $r['jumlah'] ?>"></td>
<td><input type="text" name="keterangan" value="<?php echo $r['keterangan'] ?>"></td>
<td><input type="submit" class="btn btn-info" value="Update"></td>
<?php
echo"<td><a href='pk.php?op=hapusedit&id=$r[id]+&id_brg=$r[id_brg]'id='hapusedit'>Hapus</a></td>";
?>
</tr>
<?php
}
?>
</tr>
</table>
</form>
Spoiler for edit2:
Code:
<?php
include 'config.php';
$id=$_POST['id'];
$id_brg=$_POST['id_brg'];
$jumlah = $_POST['jumlah'];
$keterangan = $_POST['keterangan'];
mysql_query("update detail_penjualan set jumlah='$jumlah', keterangan='$keterangan' where id ='$id' and id_brg ='$id_brg'");
?>
mohon bantuannya gan,
terima kasih