<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'];
//------------------------------
$hobinya='';
$hobi_dipilih=$_POST['a'];
for($b=0;$b<count($_POST['a']);$b++){
$hobinya=$hobinya.$hobi_dipilih[$b].',';
}
$ekspedisi1 = substr(strrev($hobinya),1);
$disposisi1 = $_POST['tu_disposisi'];
//------------------------------
$query = "UPDATE $mytable Set tu_ekspedisi  = '$ekspedisi1' where tu_id = '$id1'";  
$result = mysql_query($query); 
$query = "UPDATE $mytable Set tu_disposisi  = '$disposisi1' where tu_id = '$id1'";  
$result = mysql_query($query); 
$kasubsi1 = $_POST['kasubsi'];
$extra1 = $_POST['extra'];
if ($kasubsi1 !== "") {
$query = "UPDATE $mytable Set tu_ekspedisikasubsi = '$kasubsi1' where tu_id = '$id1'";  
$result = mysql_query($query); 
} 
elseif ($kasubsi1 == "") {
print ('');
}
if ($extra1 !== "") {
$query = "UPDATE $mytable Set tu_ekspedisiextra  = '$extra1' where tu_id = '$id1'";  
$result = mysql_query($query); 
} 
elseif ($extra1 == "") {
print ('');
}
echo "<b>UPDATE DISPOSISI TELAH DISIMPAN SILAHKAN TUTUP JENDELA INI</b>";
?>
