<script type="text/javascript">
      function updateText1()
    {	
    var dd = document.getElementById("s_spdpdari");
    var ddtext = dd.options[dd.selectedIndex].text;
    var sp_ddtext = ddtext.replace(/[^. a-zA-Z]+/g,'');
    document.getElementById("spdpdari").value = sp_ddtext;
    }
	</script>
	<?PHP
date_default_timezone_set('ASIA/JAKARTA');
$tablename1 = $_GET["table"];
$tablename2 = $_GET["jenis"];
$tablename3 = $tablename1.''.$tablename2;
$next_increment     = 0;
$qShowStatus        = "SHOW TABLE STATUS LIKE '$tablename3'";
$qShowStatusResult  = mysql_query($qShowStatus) or die ( "Query failed: " . mysql_error() . "<br/>" . $qShowStatus );
$row = mysql_fetch_assoc($qShowStatusResult);
$next_increment = $row['Auto_increment'];
$day = date("d");
$month = date("m");
$year = date("Y");
?>
<style type="text/css">
<!--
.style55 {color: #FF0000}
.style33 {color: #FFFFFF}
-->
</style>

<table width="100%"  border="0" cellspacing="4" cellpadding="4" class="panel">
  <tr>
    <td bgcolor="#FFFFCC"><strong>TAHAP I (INPUT DATA SPDP) </strong></td>
  </tr>
  <tr>
    <td>Bahwa Sesuai SOP sejak tanggal diterimanya SPDP maka di hitung selama 30 hari hingga terbitnya P17 apabila tidak disertai Berkas Tahap 1</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><form name="form1" method="post" action="index.pratut.post.spdp.add.php">
      <table width="100%"  border="0" cellspacing="4" cellpadding="4">
        <tr>
          <td colspan="3"><table width="100%"  border="0" cellspacing="4" cellpadding="4" class="panel">
            <tr>
              <td><table width="100%"  border="0" cellspacing="4" cellpadding="4">
                  <tr>
                    <td>Surat di input pada Jenis Surat : <strong>
                      <?PHP
if ($tablename2 == "1")  {echo "BIASA UMUM";} 
elseif ($tablename2 == "2") {echo "BIASA DALAM";} 
elseif ($tablename2 == "3") {echo "SPDP";} 
elseif ($tablename2 == "4") {echo "NOTA DINAS";} 
elseif ($tablename2 == "5") {echo "KEPUTUSAN";} 
elseif ($tablename2 == "6") {echo "SURAT PERINTAH";} 
elseif ($tablename2 == "7") {echo "PENGANTAR";} 
elseif ($tablename2 == "8") {echo "RAHASIA";} 
elseif ($tablename2 == "9") {echo "UNDANGAN";} 
?>
                      </strong>
                        <input name="jenis" type="hidden" id="jenis3" value="<?PHP echo "$tablename2";?>">
            Dalam Table : <strong><? echo "$tablename3";?></strong>
            <input name="tu_dbtahun" type="hidden" id="tu_dbtahun3" value="<?PHP echo "$tablename3";?>"></td>
                  </tr>
              </table></td>
            </tr>
          </table></td>
          <td width="33%" rowspan="21" valign="top"><table width="100%"  border="0" cellspacing="6" cellpadding="6" class="panel">
            <tr>
              <td bgcolor="#FFCC99"><strong>OPTIONAL</strong></td>
            </tr>
            <tr>
              <td>Silahkan cetak form dibawah ini untuk diberikan kepada penyidik yang menyerahkan SPDP agar di isi Nama, Nomor Telpnya serta Nomor Telp Pelapor Lalu tempelkan pada SPDP yang diberikan </td>
            </tr>
            <tr>
              <td><hr></td>
            </tr>
            <tr>
              <td> <div id="printData"><LINK href="../images/index.css" rel="stylesheet" type="text/css">
                <table width="100%"  border="0" cellspacing="2" cellpadding="2">
                  <tr>
                    <td colspan="3"><?PHP echo $satker; ?></td>
                  </tr>
                  <tr>
                    <td colspan="3">&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="44%">Tanggal Serah </td>
                    <td width="3%">:</td>
                    <td width="53%" bgcolor="#E5E5E5">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>Nama Penyidik </td>
                    <td width="3%">:</td>
                    <td width="53%" bgcolor="#E5E5E5">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>No Telp HP </td>
                    <td>:</td>
                    <td bgcolor="#E5E5E5">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>No Telp Pelapor </td>
                    <td>:</td>
                    <td bgcolor="#E5E5E5">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td><?PHP echo $kota; ?></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>Yang Menyerahkan SPDP </td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>----------------------</td>
                  </tr>
                </table>
              </div></td>
            </tr>
          </table>
            <table width="100%"  border="0" cellspacing="4" cellpadding="4">
              <tr>
                <td width="88%"><div align="center"></div></td>
                <td width="12%"><div align="center"><a href="#"  onClick="printF('printData')"><img src="print-icon.png" border="0"></a></div></td>
              </tr>
            </table></td>
        </tr>
        <tr>
          <td colspan="3">&nbsp;</td>
        </tr>
        <tr>
          <td>Apakah Ini Perkara ANAK</td>
          <td width="1%">:</td>
          <td width="41%" bgcolor="#FF3300"><select name="berkasanak" id="select">
            <option value="0" selected>BUKAN</option>
            <option value="1">YA INI PERKARA ANAK</option>
          </select>
            <span class="style33">*Wajib dipilih jika Perkara Anak </span></td>
        </tr>
        <tr>
          <td width="25%">Nomor Agenda </td>
          <td width="1%">:</td>
          <td><input name="s_agenda" type="text" id="s_agenda" value="<?PHP echo $next_increment; ?>" size="5"> 
            Nomor urut otomatis tidak bisa di edit </td>
        </tr>
        <tr>
          <td>Nama Tersangka </td>
          <td width="1%">:</td>
          <td width="41%"><input name="s_nama" type="text" id="s_nama" style="text-transform:uppercase;" onKeyUp="javascript:this.value=this.value.toUpperCase();" value="0" size="60">            </td>
          </tr>
        <tr>
          <td>&nbsp;</td>
          <td width="1%">&nbsp;</td>
          <td>(Tulis 0/nol jika belum ada nama tersangka) </td>
        </tr>
        <tr>
          <td>No Induk Kependudukan </td>
          <td>:</td>
          <td><input name="s_nik" type="text" id="s_nik" value="0" size="40"> 
            Isikan &quot;0&quot; jika tidak ada </td>
          </tr>
        <tr>
          <td>Tanggal SPDP/Tgl Surat </td>
          <td>:</td>
          <td><select name="day1" id="day1">
            <option value="01" <? IF($_GET['day'] == "1"){ echo "selected"; } ?>>01</option>
            <option value="02" <? IF($_GET['day'] == "2"){ echo "selected"; } ?>>02</option>
            <option value="03" <? IF($_GET['day'] == "3"){ echo "selected"; } ?>>03</option>
            <option value="04" <? IF($_GET['day'] == "4"){ echo "selected"; } ?>>04</option>
            <option value="05" <? IF($_GET['day'] == "5"){ echo "selected"; } ?>>05</option>
            <option value="06" <? IF($_GET['day'] == "6"){ echo "selected"; } ?>>06</option>
            <option value="07" <? IF($_GET['day'] == "7"){ echo "selected"; } ?>>07</option>
            <option value="08" <? IF($_GET['day'] == "8"){ echo "selected"; } ?>>08</option>
            <option value="09" <? IF($_GET['day'] == "9"){ echo "selected"; } ?>>09</option>
            <option value="10" <? IF($_GET['day'] == "10"){ echo "selected"; } ?>>10</option>
            <option value="11" <? IF($_GET['day'] == "11"){ echo "selected"; } ?>>11</option>
            <option value="12" <? IF($_GET['day'] == "12"){ echo "selected"; } ?>>12</option>
            <option value="13" <? IF($_GET['day'] == "13"){ echo "selected"; } ?>>13</option>
            <option value="14" <? IF($_GET['day'] == "14"){ echo "selected"; } ?>>14</option>
            <option value="15" <? IF($_GET['day'] == "15"){ echo "selected"; } ?>>15</option>
            <option value="16" <? IF($_GET['day'] == "16"){ echo "selected"; } ?>>16</option>
            <option value="17" <? IF($_GET['day'] == "17"){ echo "selected"; } ?>>17</option>
            <option value="18" <? IF($_GET['day'] == "18"){ echo "selected"; } ?>>18</option>
            <option value="19" <? IF($_GET['day'] == "19"){ echo "selected"; } ?>>19</option>
            <option value="20" <? IF($_GET['day'] == "20"){ echo "selected"; } ?>>20</option>
            <option value="21" <? IF($_GET['day'] == "21"){ echo "selected"; } ?>>21</option>
            <option value="22" <? IF($_GET['day'] == "22"){ echo "selected"; } ?>>22</option>
            <option value="23" <? IF($_GET['day'] == "23"){ echo "selected"; } ?>>23</option>
            <option value="24" <? IF($_GET['day'] == "24"){ echo "selected"; } ?>>24</option>
            <option value="25" <? IF($_GET['day'] == "25"){ echo "selected"; } ?>>25</option>
            <option value="26" <? IF($_GET['day'] == "26"){ echo "selected"; } ?>>26</option>
            <option value="27" <? IF($_GET['day'] == "27"){ echo "selected"; } ?>>27</option>
            <option value="28" <? IF($_GET['day'] == "28"){ echo "selected"; } ?>>28</option>
            <option value="29" <? IF($_GET['day'] == "29"){ echo "selected"; } ?>>29</option>
            <option value="30" <? IF($_GET['day'] == "30"){ echo "selected"; } ?>>30</option>
            <option value="31" <? IF($_GET['day'] == "31"){ echo "selected"; } ?>>31</option>
          </select><select name="month1" id="month1">
            <option value="01" <? IF($_GET['month'] == "1"){ echo "selected"; } ?>>01</option>
            <option value="02" <? IF($_GET['month'] == "2"){ echo "selected"; } ?>>02</option>
            <option value="03" <? IF($_GET['month'] == "3"){ echo "selected"; } ?>>03</option>
            <option value="04" <? IF($_GET['month'] == "4"){ echo "selected"; } ?>>04</option>
            <option value="05" <? IF($_GET['month'] == "5"){ echo "selected"; } ?>>05</option>
            <option value="06" <? IF($_GET['month'] == "6"){ echo "selected"; } ?>>06</option>
            <option value="07" <? IF($_GET['month'] == "7"){ echo "selected"; } ?>>07</option>
            <option value="08" <? IF($_GET['month'] == "8"){ echo "selected"; } ?>>08</option>
            <option value="09" <? IF($_GET['month'] == "9"){ echo "selected"; } ?>>09</option>
            <option value="10" <? IF($_GET['month'] == "10"){ echo "selected"; } ?>>10</option>
            <option value="11" <? IF($_GET['month'] == "11"){ echo "selected"; } ?>>11</option>
            <option value="12" <? IF($_GET['month'] == "12"){ echo "selected"; } ?>>12</option>
          </select>
		   <select name="year1" id="year1">
            <option value="2016" <? IF($_GET['year'] == "2016"){ echo "selected"; } ?>>2016</option>
            <option value="2017" <? IF($_GET['year'] == "2017"){ echo "selected"; } ?>>2017</option>
            <option value="2018" <? IF($_GET['year'] == "2018"){ echo "selected"; } ?>>2018</option>
            <option value="2019" <? IF($_GET['year'] == "2019"){ echo "selected"; } ?>>2019</option>
            <option value="2020" <? IF($_GET['year'] == "2020"){ echo "selected"; } ?>>2020</option>
        </select>
		   *Tanggal terima surat </td>
          </tr>
        <tr>
          <td>Nomor SPDP </td>
          <td>:</td>
          <td><input name="s_nomorspdp" type="text" id="s_nomorspdp" size="40"></td>
          </tr>
        <tr>
          <td>Nomor Laporan</td>
          <td>:</td>
          <td><input name="s_nolaporan" type="text" id="s_nolaporan" size="40"></td>
          </tr>
        <tr>
          <td>Tanggal Agenda / Tanggal Terima Surat </td>
          <td>:</td>
          <td><select name="day2" id="select2">
            <option value="01" <? IF($_GET['day'] == "1"){ echo "selected"; } ?>>01</option>
            <option value="02" <? IF($_GET['day'] == "2"){ echo "selected"; } ?>>02</option>
            <option value="03" <? IF($_GET['day'] == "3"){ echo "selected"; } ?>>03</option>
            <option value="04" <? IF($_GET['day'] == "4"){ echo "selected"; } ?>>04</option>
            <option value="05" <? IF($_GET['day'] == "5"){ echo "selected"; } ?>>05</option>
            <option value="06" <? IF($_GET['day'] == "6"){ echo "selected"; } ?>>06</option>
            <option value="07" <? IF($_GET['day'] == "7"){ echo "selected"; } ?>>07</option>
            <option value="08" <? IF($_GET['day'] == "8"){ echo "selected"; } ?>>08</option>
            <option value="09" <? IF($_GET['day'] == "9"){ echo "selected"; } ?>>09</option>
            <option value="10" <? IF($_GET['day'] == "10"){ echo "selected"; } ?>>10</option>
            <option value="11" <? IF($_GET['day'] == "11"){ echo "selected"; } ?>>11</option>
            <option value="12" <? IF($_GET['day'] == "12"){ echo "selected"; } ?>>12</option>
            <option value="13" <? IF($_GET['day'] == "13"){ echo "selected"; } ?>>13</option>
            <option value="14" <? IF($_GET['day'] == "14"){ echo "selected"; } ?>>14</option>
            <option value="15" <? IF($_GET['day'] == "15"){ echo "selected"; } ?>>15</option>
            <option value="16" <? IF($_GET['day'] == "16"){ echo "selected"; } ?>>16</option>
            <option value="17" <? IF($_GET['day'] == "17"){ echo "selected"; } ?>>17</option>
            <option value="18" <? IF($_GET['day'] == "18"){ echo "selected"; } ?>>18</option>
            <option value="19" <? IF($_GET['day'] == "19"){ echo "selected"; } ?>>19</option>
            <option value="20" <? IF($_GET['day'] == "20"){ echo "selected"; } ?>>20</option>
            <option value="21" <? IF($_GET['day'] == "21"){ echo "selected"; } ?>>21</option>
            <option value="22" <? IF($_GET['day'] == "22"){ echo "selected"; } ?>>22</option>
            <option value="23" <? IF($_GET['day'] == "23"){ echo "selected"; } ?>>23</option>
            <option value="24" <? IF($_GET['day'] == "24"){ echo "selected"; } ?>>24</option>
            <option value="25" <? IF($_GET['day'] == "25"){ echo "selected"; } ?>>25</option>
            <option value="26" <? IF($_GET['day'] == "26"){ echo "selected"; } ?>>26</option>
            <option value="27" <? IF($_GET['day'] == "27"){ echo "selected"; } ?>>27</option>
            <option value="28" <? IF($_GET['day'] == "28"){ echo "selected"; } ?>>28</option>
            <option value="29" <? IF($_GET['day'] == "29"){ echo "selected"; } ?>>29</option>
            <option value="30" <? IF($_GET['day'] == "30"){ echo "selected"; } ?>>30</option>
            <option value="31" <? IF($_GET['day'] == "31"){ echo "selected"; } ?>>31</option>
          </select>
            <select name="month2" id="select3">
              <option value="01" <? IF($_GET['month'] == "1"){ echo "selected"; } ?>>01</option>
              <option value="02" <? IF($_GET['month'] == "2"){ echo "selected"; } ?>>02</option>
              <option value="03" <? IF($_GET['month'] == "3"){ echo "selected"; } ?>>03</option>
              <option value="04" <? IF($_GET['month'] == "4"){ echo "selected"; } ?>>04</option>
              <option value="05" <? IF($_GET['month'] == "5"){ echo "selected"; } ?>>05</option>
              <option value="06" <? IF($_GET['month'] == "6"){ echo "selected"; } ?>>06</option>
              <option value="07" <? IF($_GET['month'] == "7"){ echo "selected"; } ?>>07</option>
              <option value="08" <? IF($_GET['month'] == "8"){ echo "selected"; } ?>>08</option>
              <option value="09" <? IF($_GET['month'] == "9"){ echo "selected"; } ?>>09</option>
              <option value="10" <? IF($_GET['month'] == "10"){ echo "selected"; } ?>>10</option>
              <option value="11" <? IF($_GET['month'] == "11"){ echo "selected"; } ?>>11</option>
              <option value="12" <? IF($_GET['month'] == "12"){ echo "selected"; } ?>>12</option>
            </select>
            <select name="year2" id="select4">
              <option value="2016" <? IF($_GET['year'] == "2016"){ echo "selected"; } ?>>2016</option>
              <option value="2017" <? IF($_GET['year'] == "2017"){ echo "selected"; } ?>>2017</option>
              <option value="2018" <? IF($_GET['year'] == "2018"){ echo "selected"; } ?>>2018</option>
              <option value="2019" <? IF($_GET['year'] == "2019"){ echo "selected"; } ?>>2019</option>
              <option value="2020" <? IF($_GET['year'] == "2020"){ echo "selected"; } ?>>2020</option>
            </select></td>
          </tr>
        <tr>
          <td>SPDP Dari/Asal Surat </td>
          <td>:</td>
          <td><select name="s_spdpdari" id="s_spdpdari" onChange="updateText1();">
                    <option value=0 selected>- Pilih Asal SPDP -</option>
                    <?php
mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
$sql=mysql_query("select * from tab_polisi");
while ($data=mysql_fetch_array($sql)){
print('<option value="'.$data["p_nomor"].'">'.$data["p_nama"].'</option>');
}
?>
                  </select>
            <input name="spdpdari" type="hidden" id="spdpdari">
            *Jika kurang setting di pengaturan             </td>
          </tr>
        <tr>
          <td>Pasal SPDP/Perihal</td>
          <td>:</td>
          <td><input name="s_pasalspdp" type="text" id="s_pasalspdp" size="60"></td>
          </tr>
        <tr>
          <td>Jumlah Lampiran </td>
          <td>:</td>
          <td><input name="tu_lamp" type="text" id="tu_lamp" value="-" size="10"></td>
        </tr>
        <tr>
          <td colspan="3">&nbsp;</td>
          </tr>
        <tr>
          <td colspan="3" bgcolor="#CCCCCC"><table width="100%"  border="0" cellspacing="2" cellpadding="2">
            <tr>
              <td>Modul SMS Penyidik (<strong>Optional</strong>) Aplikasi akan mengirim SMS kepada penyidik untuk informasi Jaksa yang telah ditunjuk dan tahapan perkara secara otomatis </td>
            </tr>
          </table></td>
          </tr>
        <tr>
          <td>Nama Penyidik </td>
          <td>:</td>
          <td bgcolor="#FF3300"><input name="namapenyidik" type="text" id="namapenyidik">
          *(<strong>Wajib Terisi</strong>)* </td>
          </tr>
        <tr>
          <td rowspan="2">No Hp Penyidik Layanan Informasi Pantauan Perkara Bagi Penyidik           </td>
          <td rowspan="2">:</td>
          <td><input name="telppenyidik" type="text" id="telppenyidik3" value="0">
            (<strong>Wajib</strong>) * Isi tanpa +62 contoh: 08172727272 </td>
          </tr>
        <tr>
          <td><span class="style55">Biarkan &quot;0&quot; jika tidak ada </span></td>
        </tr>
        <tr>
          <td rowspan="2">Modul SMS Pelapor (<strong>Optional</strong>) Layanan Informasi Pantauan Perkara Bagi Pelapor            </td>
          <td rowspan="2">:</td>
          <td><input name="telppelapor" type="text" id="telppelapor3" value="0">
            Isi tanpa +62 contoh: 08172727272 </td>
          </tr>
        <tr>
          <td><span class="style55">Biarkan &quot;0&quot; jika tidak ada </span></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td colspan="2">&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td colspan="2"><input type="submit" name="Submit" value="SIMPAN ISIAN INI"></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td colspan="2">Cukup klik satu kali dan tunggu. </td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td colspan="2">&nbsp;</td>
        </tr>
      </table>
    </form></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
