<LINK href="images/index.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
    function refreshAndClose() {
        window.opener.location.reload(true);
        window.close();
    }
</script>
<body onbeforeunload="refreshAndClose();">
<?PHP
$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"];
$p_np1 = $_POST["npyad"];
$p_kgb1 = $_POST["kgbyad"];
$p_id1 = $_POST["uid"];
$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 = "UPDATE tab_personil Set daftar_nama = '$p_nama1' where daftar_pegid = '$p_id1'";  
$result = mysql_query($query); 
$query = "UPDATE tab_personil Set daftar_nip = '$p_nip1' where daftar_pegid = '$p_id1'";  
$result = mysql_query($query); 
$query = "UPDATE tab_personil Set daftar_nrp = '$p_nrp1' where daftar_pegid = '$p_id1'";  
$result = mysql_query($query); 
$query = "UPDATE tab_personil Set daftar_pangkat = '$p_pangkat1' where daftar_pegid = '$p_id1'";  
$result = mysql_query($query); 
$query = "UPDATE tab_personil Set daftar_nohp = '$p_nohp1' where daftar_pegid = '$p_id1'";  
$result = mysql_query($query); 
$query = "UPDATE tab_personil Set daftar_npyad = '$p_np1' where daftar_pegid = '$p_id1'";  
$result = mysql_query($query); 
$query = "UPDATE tab_personil Set daftar_kgbyad = '$p_kgb1' where daftar_pegid = '$p_id1'";  
$result = mysql_query($query); 

$query = "UPDATE tab_personil Set daftar_jenis = '$p_jenis1' where daftar_pegid = '$p_id1'";  
$result = mysql_query($query); 
print ('<table width="50%"  border="0" align="center" cellpadding="6" cellspacing="6">
  <tr>
    <td>BERHASIL DISIMPAN TUTUP JENDELA INI</td>
  </tr>
</table>');
}
else
{
echo "$error.";
} 
?>
