<?PHP include("../index.cma.db.php"); ?>
<table width="100%"  border="0" cellspacing="6" cellpadding="6">
  <tr>
    <td width="83%" valign="top"><table width="100%"  border="0" cellspacing="4" cellpadding="4">
      <tr bgcolor="#FFC1C1">
        <td colspan="2"><strong>Rekap Perkara </strong></td>
        <td colspan="2"><strong>TOTAL</strong></td>
      </tr>
      <tr>
        <td width="4%"><div align="center">1.</div></td>
        <td width="31%" bgcolor="#FF3333">SPDP MASUK </td>
        <td width="12%" bgcolor="#CCCCCC"><?php
$query = "Select * from tab_dataperkara where t_id = '1'"; 
$result = mysql_query($query); 
if($row = mysql_fetch_array($result)){ 
$mytabler1 = $row['t_table'];
$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result1 = mysql_query("SELECT * FROM $mytabler1", $link);
$num_rows = mysql_num_rows($result1);
$query = "UPDATE tab_perkaragrafik Set jumlah_a = '$num_rows'";  
$result = mysql_query($query); 
print (''.$num_rows.'');
}
 ?></td>
        <td width="53%">SPDP</td>
      </tr>
      <tr>
        <td width="4%"><div align="center">2.</div></td>
        <td width="31%" bgcolor="#FF3333">SPDP TANPA NAMA </td>
        <td width="12%" bgcolor="#CCCCCC"><?php

$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result33 = mysql_query("SELECT * FROM $mytabler1 where spdp_namatsk ='TANPA NAMA'", $link);
$num_rows33 = mysql_num_rows($result33);
$query = "UPDATE tab_perkaragrafik Set jumlah_b = '$num_rows33'";  
$result = mysql_query($query); 
print (''.$num_rows33.'');
 ?></td>
        <td>SPDP</td>
      </tr>
      <tr>
        <td><div align="center">2.</div></td>
        <td bgcolor="#FF3333">SUDAH P21 </td>
        <td bgcolor="#CCCCCC"><?php

$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result2 = mysql_query("SELECT * FROM $mytabler1 where berkas_tahap1p21tgl !=''", $link);
$num_rows2 = mysql_num_rows($result2);
$query = "UPDATE tab_perkaragrafik Set jumlah_c = '$num_rows2'";  
$result = mysql_query($query); 
print (''.$num_rows2.'');
 ?>
            <div align="right"></div></td>
        <td>Berkas Perkara </td>
      </tr>
      <tr>
        <td><div align="center">3.</div></td>
        <td bgcolor="#FF3333">SUDAH LIMPAH </td>
        <td bgcolor="#CCCCCC"><?php
$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result3 = mysql_query("SELECT * FROM $mytabler1 where berkas_limpahp31tgl !=''", $link);
$num_rows3 = mysql_num_rows($result3);
$query = "UPDATE tab_perkaragrafik Set jumlah_d = '$num_rows3'";  
$result = mysql_query($query); 
print (''.$num_rows3.'');
 ?>
            <div align="right"></div></td>
        <td>Berkas Perkara </td>
      </tr>
      <tr>
        <td><div align="center">4.</div></td>
        <td bgcolor="#FF3333">SUDAH PUTUS </td>
        <td bgcolor="#CCCCCC"><?php
$link = mysql_connect("$server", "$username", "$password"); mysql_select_db("$database", $link);
$result4 = mysql_query("SELECT * FROM $mytabler1 where berkas_p48tgl !=''", $link);
$num_rows4 = mysql_num_rows($result4);
$query = "UPDATE tab_suratgrafik Set jumlah_e = '$num_rows4'";  
$result = mysql_query($query); 
print (''.$num_rows4.'');
 ?>
            <div align="right"></div></td>
        <td>Berkas Perkara / Berkekuatan Hukum Tetap </td>
      </tr>
    </table></td>
  </tr>
</table>
