<table width="100%"  border="0" cellspacing="1" cellpadding="0">
  <tr>
    <td width="9%"><a href="?g=viewsuratjenis&i=index&jenissurat=1" class="menu">UMUM</a></td>
    <td width="9%"><a href="?g=viewsuratjenis&i=index&jenissurat=2" class="menu">DALAM</a></td>
    <td width="12%"><a href="?g=viewsuratjenis&i=index&jenissurat=3" class="menu">NOTA DINAS </a></td>
    <td width="11%"><a href="?g=printspdp&i=index" class="menu">SPDP</a></td>
    <td width="16%"><a href="?g=viewsuratjenis&i=index&jenissurat=5" class="menu">KEPUTUSAN</a></td>
    <td width="13%"><a href="?g=viewsuratjenis&i=index&jenissurat=6" class="menu">PRINT</a></td>
    <td width="13%"><a href="?g=viewsuratjenis&i=index&jenissurat=7" class="menu">PENGANTAR</a></td>
    <td width="17%"><a href="?g=viewsuratjenis&i=index&jenissurat=8" class="menu">RAHASIA</a></td>
  </tr>
</table>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="panel">
  <tr>
    <td><table width="100%"  border="0" cellspacing="6" cellpadding="6">
      <tr>
        <td>Untuk Cetak ulang Lembar disposisi klik &quot;nomor surat&quot; untuk lihat Arsip digital klik &quot;perihal&quot; untuk Edit klik NA atau Nomor Agenda </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="4" cellpadding="4">
  <tr>
    <td><? mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
$jenissurat = $_GET["jenissurat"];
$query = "Select * from tab_surat where s_id = '1'"; 
$result = mysql_query($query); 
if($row = mysql_fetch_array($result)){ 
$mytable = $row['s_nama'];
$edisi = $row['s_tahun'];?><form action="index.pencarian.php" method="get" enctype="multipart/form-data" name="form1">
      <table width="100%"  border="0" cellspacing="4" cellpadding="4">
        <tr>
          <td width="11%">Cari Surat </td>
          <td width="2%">:</td>
          <td width="26%"><input name="query" class="baca1" id="query" onFocus="if(this.value=='Cari Surat') this.value='';" onBlur="if(this.value=='') this.value='Cari Surat';" onKeyUp="showUser(this.value)" size="40" type="text" maxlength="255"/></td>
          <td width="13%">Dalam Database </td>
          <td width="2%">:</td>
          <td width="9%"><select name="db" id="db">
              <option value="<? echo $mytable; ?>" selected><? echo $mytable; ?></option>
          </select></td>
          <td width="37%"><input type="submit" name="Submit" value="Search">
        Klik Perihal untuk Melihat Arsip Digital </td>
        </tr>
        <tr>
          <td colspan="7">&nbsp;</td>
        </tr>
        <tr>
          <td colspan="7"><?
if(empty($action))
{
if (empty($order)) $order =  2;
if (empty($page))  $page  =  1;
if (empty($hits))  $hits  = 20;
$start = $hits*($page-1);
$query = "SELECT * FROM $mytable where tu_jenissurat = '$jenissurat'";
$res = mysql_query("$query"); 
$xnum = mysql_num_rows($res);
$stw2 = (int)($xnum/$hits);
if ($xnum%$hits > 0) {$stw2++;}
$np = $page+1;
$pp = $page-1;
if ($page == 1) { $pp=1; }
if ($np > $stw2) { $np = $stw2;} 
echo "SURAT TAHUN : $edisi - <strong>$xnum</strong> | ";
for ($i=1;$i<=$stw2;$i++) {if($page==$i){
echo "Halaman <b>$i</b> ";} 
else{echo " <font size=\"2\"><a href=\"?g=viewsurat&i=index&page=$i\">$i</A></font> ";}}
print ('<br><br>');
$query  = "SELECT * FROM ".$mytable." where tu_jenissurat = '$jenissurat'";
if(!empty($squery)) { $query .= "WHERE tu_id LIKE \"%$squery%\" ";}
$query .= "ORDER BY tu_id DESC LIMIT $start,$hits";
$res = mysql_query($query);
print ('<table id="myTable" width="100%"  border="0" cellspacing="1" cellpadding="1" bgcolor="#B05800">
        <thead><tr>
<td width="9%"><span class="style1"><strong>N.A.</strong></span></td>
<td width="8%"><span class="style1"><strong>TGL SURAT</strong></span></td>
<td width="18%"><span class="style1"><strong>NO SURAT</strong></span></td>
<td width="10%"><span class="style1"><strong>ASAL SURAT</strong></span></td>
<td width="5%"><span class="style1"><strong>LAMP</strong></span></td>
<td width="30%"><span class="style1"><strong>PERIHAL / ISI SURAT</strong></span></td>
<td width="20%"><span class="style1"><strong>EKPEDISI</strong></span></td>
</tr></thead><tbody>');
 $x=0;
  while($row = mysql_fetch_array($res))
  {
   $x++;
   if($x==2) {$barva = "FFFFB7";$x=0;} else {$barva = "FFD8B0";$x=1;}


print ('<tr bgcolor=#'.$barva.'>');
print ('<td>');
if ($row['tu_jenissurat'] == "0") {echo "LAINNYA";} 
elseif ($row['tu_jenissurat'] == "1") {echo "B-";} 
elseif ($row['tu_jenissurat'] == "2") {echo "B-";} 
elseif ($row['tu_jenissurat'] == "3") {echo "ND-";} 
elseif ($row['tu_jenissurat'] == "4") {echo "SPDP-";} 
elseif ($row['tu_jenissurat'] == "5") {echo "KEP-";} 
elseif ($row['tu_jenissurat'] == "6") {echo "PRINT-";}
elseif ($row['tu_jenissurat'] == "8") {echo "TAR-";}  
elseif ($row['tu_jenissurat'] == "9") {echo "R-";} 
elseif ($row['tu_jenissurat'] == "10") {echo "LAINNYA";} 
print ('17'.$row['tu_noagenda'] .'</td>');
print ('<td>'.$row['tu_tglsrt'].'</td>');
print ('<td><a href="index.viewsurat.print.php?uid='.$row['tu_id'].'" target="_blank">');
print (''.$row['tu_nosrt'].'</a></td>');
print ('<td>'.$row['tu_asalsrt'].'</td>');
print ('<td>'.$row['tu_lamp'].'</td>');
print ('<td><a href="'.$mytable.'/');
if ($row['tu_jenissurat'] == "0") {echo "LAINNYA";} 
elseif ($row['tu_jenissurat'] == "1") {echo "B-";} 
elseif ($row['tu_jenissurat'] == "2") {echo "B-";} 
elseif ($row['tu_jenissurat'] == "3") {echo "ND-";} 
elseif ($row['tu_jenissurat'] == "4") {echo "SPDP-";} 
elseif ($row['tu_jenissurat'] == "5") {echo "KEP-";} 
elseif ($row['tu_jenissurat'] == "6") {echo "PRINT-";}
elseif ($row['tu_jenissurat'] == "8") {echo "TAR-";}  
elseif ($row['tu_jenissurat'] == "9") {echo "R-";} 
elseif ($row['tu_jenissurat'] == "10") {echo "LAINNYA";} 
print ('17'.$row['tu_noagenda'].'.pdf" target="_blank">'.$row['tu_perihal'].'</a></td>');
print ('<td><b>');
if ($row['tu_ekspedisi'] == "0") {
$id = $row['tu_id'];
$nosrt = $row['tu_nosrt'];
echo "<a href=\"index.viewsurat.disposisi.php?uid=$id&table=$mytable&nosurat=$nosrt \" onclick=\"NewWindow(this.href,'mywin','700','300','yes','center');return false\" onfocus=\"this.blur()\"  class=\"menu\" >UPDATE</a>";
} 
elseif ($row['tu_ekspedisi'] == "1") {echo "KAJATI: ";} 
elseif ($row['tu_ekspedisi'] == "2") {echo "WAKAJATI: ";} 
elseif ($row['tu_ekspedisi'] == "3") {echo "ASBIN: ";} 
elseif ($row['tu_ekspedisi'] == "4") {echo "ASINTEL: ";} 
elseif ($row['tu_ekspedisi'] == "5") {echo "ASPIDUM: ";} 
elseif ($row['tu_ekspedisi'] == "6") {echo "ASPIDSUS: ";} 
elseif ($row['tu_ekspedisi'] == "7") {echo "ASDATUN: ";} 
elseif ($row['tu_ekspedisi'] == "8") {echo "ASWAS: ";} 
elseif ($row['tu_ekspedisi'] == "9") {echo "KABAG TU: ";}
elseif ($row['tu_ekspedisi'] == "10") {echo "LAINNYA: ";}  
print ('</b>');
if ($row['tu_disposisi'] !== "") {print (''.$row['tu_disposisi'].'');
} 
elseif ($row['tu_print'] == "") {
print ('');
}
print ('</td>');
print ('</tr>');
}
print ('</tbody></table>');
echo "<br><br>Ditampilkan $hits /Halaman";
}

?></td>
        </tr>
        <tr>
          <td colspan="7"><div align="right">*Diurutkan berdasarkan Surat paling baru masuk </div></td>
        </tr>
      </table>
    </form></td>
  </tr>
</table>
<? } ?>

