
<table width="100%"  border="0" cellspacing="1" cellpadding="1">
  <tr>
    <td bgcolor="#FFFFDD"><table width="100%"  border="0" align="center" cellpadding="5" cellspacing="5">
      <tr>
        <td width="73%" valign="top"><?php
include "intel_kirimsmsdb.php";
mysql_connect("localhost", "root", "benk");
mysql_select_db("sikenes2013");
?>
            <style type="text/css">
<!--
.style1 {	color: #FFFFFF;
	font-weight: bold;
}
-->
      </style>
            <link href="images/index.css" rel="stylesheet" type="text/css">
            <style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
}
-->
      </style>
            <script type="text/javascript">

/*
Form field Limiter script- By Dynamic Drive
For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
This credit MUST stay intact for use
*/

var ns6=document.getElementById&&!document.all

function restrictinput(maxlength,e,placeholder){
if (window.event&&event.srcElement.value.length>=maxlength)
return false
else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
if (pressedkey.test(String.fromCharCode(e.which)))
e.stopPropagation()
}
}

function countlimit(maxlength,e,placeholder){
var theform=eval(placeholder)
var lengthleft=maxlength-theform.value.length
var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
if (window.event||e.target&&e.target==eval(placeholder)){
if (lengthleft<0)
theform.value=theform.value.substring(0,maxlength)
placeholderobj.innerHTML=lengthleft
}
}


function displaylimit(thename, theid, thelimit){
var theform=theid!=""? document.getElementById(theid) : thename
var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b> Batasan karakter'
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); 
}
}

      </script>
            <form method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
              <table width="100%"  border="0" cellspacing="2" cellpadding="2">
                <tr>
                  <td bgcolor="#00CC66"><table width="100%"  border="0" cellspacing="2" cellpadding="2">
                      <tr>
                        <td width="67%"><span class="style1"><strong>PENGIRIMAN PESAN SINGKAT </strong></span></td>
                      </tr>
                  </table></td>
                </tr>
              </table>
              <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td>&nbsp;</td>
                </tr>
              </table>
              <table width="100%"  border="0" cellspacing="6" cellpadding="6">
                <tr>
                  <td><div align="right"><strong>NO SMS CENTER </strong></div>
                      <div align="left"></div></td>
                  <td>:</td>
                  <td><strong>08-5959-311118 </strong></td>
                </tr>
                <tr>
                  <td width="22%"><div align="right"><b>Pilih Nama Penerima</b></div></td>
                  <td width="2%">:</td>
                  <td width="76%"><select name="jaksa" onChange="this.form.submit()">
                      <option value=0 selected>- Pilih Nama -</option>
                      <?php

$sql=mysql_query("select * from slm_daftarintel");
while ($data=mysql_fetch_array($sql)){
echo "<option value=$data[daftar_nohp]>$data[daftar_nama]</option>";
}

?>
                  </select></td>
                </tr>
                <tr>
                  <td><div align="right"><b>Masukkan isi SMS</b></div></td>
                  <td>:</td>
                  <td><textarea name="sms" id="sms" cols="70" rows="7" wrap="VIRTUAL"></textarea>
                      <br>
                      <script>
displaylimit("","sms",160)
        </script>
                  </td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>(maksimum panjang SMS adalah 160 karakter) </td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td><input type="submit" name="submit" value="Kirim SMS"></td>
                </tr>
              </table>
            </form>
            <table width="100%"  border="0" cellspacing="6" cellpadding="6">
              <tr>
                <td colspan="3"><strong>SMS DIKIRIMKAN KEDAFTAR NAMA: </strong></td>
              </tr>
              <tr>
                <td width="22%">&nbsp;</td>
                <td width="2%">&nbsp;</td>
                <td width="76%"><?php


if ($_POST['submit'])
{
//-------KATEGORI
$jaksa1 = $_POST['jaksa'];
echo "<b>SMS DIKIRIM:</b><br>";
echo "NO : " .$jaksa1. "<br>";
include "smsdb.php";
$query3 = "INSERT INTO outbox (DestinationNumber, TextDecoded, CreatorID, class) VALUES ('$jaksa1', '$sms', 'Gammu', '-1')";
mysql_query($query3);
}
//-------KATEGORI
echo "<hr><b>SMS TELAH TERKIRIM KE NOMOR DIATAS</b>";
?></td>
              </tr>
          </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
