<LINK href="images/index.css" rel="stylesheet" type="text/css">
<?PHP 
include("../index.cma.db.php");
mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
$query = "Select * from tab_dataperkara where t_id = '1'"; 
$result = mysql_query($query); 
if($row2 = mysql_fetch_array($result)){ 
$tabler = $row2['t_table'];
$key1 = $_POST["key"];
//kirim SMS
//late_p31
//Mencari file yang terlambat
$SQL     = "SELECT * FROM $tabler where $key1 = '3' ORDER BY uid DESC";
$results = mysql_query($SQL);
while ($row = mysql_fetch_array($results)){
$jaksa1 = $row['p16_jaksa1'];
$namatsk11 = $row['spdp_namatsk'];
//mencari nomor hp
$SQL2     = "SELECT * FROM tab_personil where daftar_pegid = '$jaksa1'";
$results2 = mysql_query($SQL2);
while ($row2 = mysql_fetch_array($results2)){
$notujuan = $row2['daftar_nohp'];
$pesan1 = $_POST["pesan"];
$maxlen=50;
if (strlen($smspasal1)>$maxlen)$smspasal2 = substr($smspasal1,0,$maxlen-3)."*";
else 
$smspasal2 = $smspasal1;
$isipesan = "$pesan1 | $namatsk11 (SMSCENTER) ";
echo "$isipesan Telah terkirim ke Nomor : $notujuan <br>";
$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); 

///-------------------KIRIM SMS END
}
}
}
print ('PENGIRIMAN BERHASIL KlIK BACK PADA BROWSER UNTUK KEMBALI');
?>