
<?php
include("index.cma.db.php");
mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
$key1 = $_POST['key'];

$table1 = $_POST['table'];

?>

<?PHP
if ($key1 == "personil"){
$p_nama1 = $_POST["p_nama"];
$p_nip1 = $_POST["p_nip"];
$p_nrp1 = $_POST["p_nrp"];
$p_pangkat1 = $_POST["p_pangkat"];
$p_nohp1 = $_POST["p_nohp"];
$p_jenis1 = $_POST["p_jenis"];
$error = "";
if ($p_nama1 == ""){$error = "Nama harus diisi<BR>";}
if ($p_nip1 == ""){$error = "NIP Harus Diisi!.<BR>";}
if ($p_nrp1 == ""){$error = "NRP Harus Diisi!.<BR>";}
if ($p_pangkat1 == ""){$error = "Pangkat Harus Dipilih!.<BR>";}
if ($p_nohp1 == ""){$error = "Nomor HP wajib di isi!.<BR>";}
if ($p_jenis1 == ""){$error = "Definisi Jaksa/TU Harus Dipilih!.<BR>";}
include("index.cma.db.php");
if ($error == ""){

$query = "INSERT INTO $table1 (daftar_nama, daftar_nip, daftar_nrp, daftar_pangkat, daftar_nohp, daftar_jenis) VALUES ('$p_nama1','$p_nip1','$p_nrp1','$p_pangkat1','$p_nohp1','$p_jenis1')";
$result = mysql_query($query);
print ('<a href="index.3.php" class="menu">BERHASIL DISIMPAN KLIK UNTUK KEMBALI</a>');
}
else
{
echo "<br>$error. GAGAL MEMPOSTING <a href=\"index.3.php\">KLIK DISINI UNTUK KEMBALI</a>";
} } 




?>
