<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
include("../index.cma.db.php");
mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
$mytable = $_POST["table"];
$id1 = $_POST["uid"];
$tu_noagenda1 = $_POST["tu_noagenda"];
$tu_tglsrt1 = $_POST["tu_tglsrt"];
$tu_asalsrt1 = $_POST["tu_asalsrt"];
$tu_nosrt1 = $_POST["tu_nosrt"];
$tu_lamp1 = $_POST["tu_lamp"];
$tu_tglterima1 = $_POST["tu_tglterima"];
$tu_perihal1 = $_POST["tu_perihal"];
$error = "";
if ($tu_tglsrt1 == ""){$error = "TANGGAL SURAT BELUM DI INPUT<BR>";}
if ($tu_tglterima1 == ""){$error = "TANGGAL TERIMA SURAT BELUM DI INPUT<BR>";}
if ($tu_noagenda1 == ""){$error = "NO URUT AGENDA BELUM DI INPUT<BR>";}
if ($tu_asalsrt1 == ""){$error = "ASAL SURAT BELUM DI INPUT<BR>";}
if ($tu_nosrt1 == ""){$error = "NO SURAT BELUM DI INPUT<BR>";}
if ($tu_perihal1 == ""){$error = "PERIHAL SURAT BELUM DI INPUT<BR>";}
$query = "UPDATE $mytable Set tu_noagenda = '$tu_noagenda1' where tu_id = '$id1'";  
$result = mysql_query($query); 
$query = "UPDATE $mytable Set tu_tglsrt = '$tu_tglsrt1' where tu_id = '$id1'";  
$result = mysql_query($query); 
$query = "UPDATE $mytable Set tu_asalsrt = '$tu_asalsrt1' where tu_id = '$id1'";  
$result = mysql_query($query); 
$query = "UPDATE $mytable Set tu_nosrt = '$tu_nosrt1' where tu_id = '$id1'";  
$result = mysql_query($query); 
$query = "UPDATE $mytable Set tu_lamp = '$tu_lamp1' where tu_id = '$id1'";  
$result = mysql_query($query); 
$query = "UPDATE $mytable Set tu_tglterima = '$tu_tglterima1' where tu_id = '$id1'";  
$result = mysql_query($query); 
$query = "UPDATE $mytable Set tu_perihal = '$tu_perihal1' where tu_id = '$id1'";  
$result = mysql_query($query); 
print ('<table width="100%"  border="0" cellspacing="1" cellpadding="1">
  <tr>
    <td bgcolor="#993300"><table width="100%"  border="0" cellspacing="4" cellpadding="4">
      <tr>
        <td bgcolor="#FF6600">SURAT MASUK BERHASIL DIUPDATE SILAHKAN TUTUP JENDELA INI</td>
      </tr>
    </table></td>
  </tr>
</table>');

?>


