<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.db.php");
mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
$mytable = "$tahun_now";
$id1 = $_POST['id'];
$do1 = $_POST['do'];
$notujuan = $_POST['notelp'];
$isipesan = $_POST['isipesan'];
$day1 = date("d");
$month1 = date("m");
$year1 = date("Y");
$tanggalexec = "$day1/$month1/$year1";
if ($do1 == "SMS"){
$query = "UPDATE $mytable Set ntfy_sms  = '1' where ID = '$id1'";  
$result = mysql_query($query); 
mysql_connect("localhost", "root", "benk");
mysql_select_db("cma");
$DestinationNumber=addslashes(strip_tags($notujuan));	
$TextDecoded=addslashes(strip_tags($isipesan)); 
$sql="INSERT INTO outbox (`UpdatedInDB` ,`InsertIntoDB` ,`SendingDateTime` ,`Text` ,`DestinationNumber` ,`Coding` ,`UDH` ,`Class` ,`TextDecoded` ,`ID` ,`MultiPart` ,`RelativeValidity` ,`SenderID` ,`SendingTimeOut` ,`DeliveryReport` ,`CreatorID`)
VALUES (NOW() , NOW(), '0000-00-00 00:00:00', NULL , '$DestinationNumber', 'Default_No_Compression', NULL , '-1', '$TextDecoded', NULL , 'false', '-1', NULL , '0000-00-00 00:00:00', 'default', '')";
mysql_query($sql); 
echo "$isipesan Telah terkirim ke Nomor : $notujuan";
echo "<br><br>PESAN SMS TELAH TERKIRIM SILAHKAN TUTUP JENDELA INI";
}
//----------ENDSTEP
//----------STEP
if ($do1 == "SURAT"){
$query = "UPDATE $mytable Set ntfy_surat  = '1' where ID = '$id1'";  
$result = mysql_query($query); 
echo "<b>NOTIFICATION PENGIRIMAN SURAT TELAH DIUPDATE</b>";
}
//----------ENDSTEP
?>