<?PHP include("../../index.cma.db.php"); ?>
<LINK href="index.css" rel="stylesheet" type="text/css">
<table width="100%"  border="0" cellspacing="4" cellpadding="4" class="panel">
  <tr>
    <td><table width="100%"  border="0" cellspacing="6" cellpadding="6">
        <tr>
          <td><strong>Welcome </strong></td>
        </tr>
        <tr>
          <td><?php
$query = "Select * from tab_surat where s_id = '1'"; 
$result = mysql_query($query); 
if($row = mysql_fetch_array($result)){ 
$mytable1 = $row['s_nama'];
$mytabler1 = $mytable1.'1';
$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result1 = mysql_query("SELECT * FROM $mytabler1 where tu_disposisi =''", $link);
$num_rows = mysql_num_rows($result1);
if ($num_rows == "0") {print ('');} 
elseif ($num_rows !== "0") {
print ('<a href="index.kiri.php?g=viewsurat&i=index&jenis=1" target="load" class="menu">You have '.$num_rows.' new letter for disposition <strong>[ SURAT BIASA ] Check now</strong></a><br>');

}
//--------------
$mytabler2 = $mytable1.'2';
$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result2 = mysql_query("SELECT * FROM $mytabler2 where tu_disposisi =''", $link);
$num_rows2 = mysql_num_rows($result2);
if ($num_rows2 == "0") {print ('');} 
elseif ($num_rows2 !== "0") {
print ('<a href="index.kiri.php?g=viewsurat&i=index&jenis=2" target="load" class="menu">You have '.$num_rows2.' new letter for disposition <strong>[ KEPUTUSAN ]</strong><strong>Check now</strong></a><br>');
}
//-------end
//--------------
$mytabler3 = $mytable1.'3';
$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result3 = mysql_query("SELECT * FROM $mytabler3 where tu_disposisi =''", $link);
$num_rows3 = mysql_num_rows($result3);
if ($num_rows3 == "0") {print ('');} 
elseif ($num_rows3 !== "0") {
print ('<a href="index.kiri.php?g=viewsurat&i=index&jenis=3" target="load" class="menu">You have '.$num_rows3.' new letter for disposition <strong>[ SPDP ] Check now</strong></a><br>');
}
//-------end
//--------------
$mytabler4 = $mytable1.'4';
$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result4 = mysql_query("SELECT * FROM $mytabler4 where tu_disposisi =''", $link);
$num_rows4 = mysql_num_rows($result4);
if ($num_rows4 == "0") {print ('');} 
elseif ($num_rows4 !== "0") {
print ('<a href="index.kiri.php?g=viewsurat&i=index&jenis=4" target="load" class="menu">You have '.$num_rows4.' new letter for disposition <strong>[ NODIS ] Check now</strong></a><br>');
}
//-------end
//--------------
$mytabler5 = $mytable1.'5';
$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result5 = mysql_query("SELECT * FROM $mytabler5 where tu_disposisi =''", $link);
$num_rows5 = mysql_num_rows($result5);
if ($num_rows5 == "0") {print ('');} 
elseif ($num_rows5 !== "0") {
print ('<a href="index.kiri.php?g=viewsurat&i=index&jenis=5" target="load" class="menu">You have '.$num_rows5.' new letter for disposition <strong>[ KEPUTUSAN ] Check now</strong></a><br>');
}
//-------end
//--------------
$mytabler6 = $mytable1.'6';
$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result6 = mysql_query("SELECT * FROM $mytabler6 where tu_disposisi =''", $link);
$num_rows6 = mysql_num_rows($result6);
if ($num_rows6 == "0") {print ('');} 
elseif ($num_rows6 !== "0") {
print ('<a href="index.kiri.php?g=viewsurat&i=index&jenis=6" target="load" class="menu">You have '.$num_rows6.' new letter for disposition <strong>[ SPRINT ] Check now</strong></a><br>');
}
//-------end
//--------------
$mytabler7 = $mytable1.'7';
$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result7 = mysql_query("SELECT * FROM $mytabler7 where tu_disposisi =''", $link);
$num_rows7 = mysql_num_rows($result7);
if ($num_rows7 == "0") {print ('');} 
elseif ($num_rows7 !== "0") {
print ('<a href="index.kiri.php?g=viewsurat&i=index&jenis=7" target="load" class="menu">You have '.$num_rows7.' new letter for disposition <strong>[ PENGANTAR ] Check now</strong></a><br>');
}
//-------end
//--------------
$mytabler8 = $mytable1.'8';
$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result8 = mysql_query("SELECT * FROM $mytabler8 where tu_disposisi =''", $link);
$num_rows8 = mysql_num_rows($result8);
if ($num_rows8 == "0") {print ('');} 
elseif ($num_rows8 !== "0") {
print ('<a href="index.kiri.php?g=viewsurat&i=index&jenis=8" target="load" class="menu">You have '.$num_rows8.' new letter for disposition <strong>[ RAHASIA ] Check now</strong></a><br>');
}
//-------end
//--------------
$mytabler9 = $mytable1.'9';
$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result9 = mysql_query("SELECT * FROM $mytabler9 where tu_disposisi =''", $link);
$num_rows9 = mysql_num_rows($result9);
if ($num_rows9 == "0") {print ('');} 
elseif ($num_rows9 !== "0") {
print ('<a href="index.kiri.php?g=viewsurat&i=index&jenis=9" target="load" class="menu">You have '.$num_rows9.' new letter for disposition <strong>[ UNDANGAN ] Check now</strong></a><br>');
}
//-------end
}
?></td>
        </tr>
    </table></td>
  </tr>
</table>
