Jumat, 16 Juli 2010

Alert php


}

$kode_produk = $_POST['kode_produk'];
$nama = $_POST['nama'];
$harga = $_POST['harga'];
$status = $_POST['status'];

if ($_POST['status']=="Ada") {
$a = "checked";
$b = "";
$c = "";
}
if ($_POST['status']=="Kosong") {
$a = "";
$b = "checked";
$c = "";
}
else {
$a = "";
$b = "";
$c = "checked";
}

$sql_cek="select * from produk_sp where kode_produk='$kode_produk'";
$qry_cek=mysql_query($sql_cek,$koneksi);
$jum_cek=mysql_num_rows($qry_cek);
if($jum_cek>=1){
alert("Kode Produk Sudah di kenal");
include"produknew.php";
}
else {
$tanggal = date('Y-m-d');
$sqlSimpan = "INSERT INTO produk_sp SET
kode_produk ='$kode_produk',
nama ='$nama',
harga='$harga',
status='$status',
tanggal ='$tanggal'";
mysql_query($sqlSimpan, $koneksi)
or die ("Gagal Perintah SQL". mysql_error());

alert("PENYIMPANAN DATA PRODUK BARU BERHASIL.");

include"produknew.php";
}
*/-->
scrip tutup php