<LINK href="images/index.css" rel="stylesheet" type="text/css"><?
mysql_connect("localhost", "root", "benk");
mysql_select_db("cma");
$mytable = "sidang_events";

$day1=date("d");
$year1=date("Y");
$month1=date("m");

if(empty($action))
{
if (empty($order)) $order =  2;
if (empty($page))  $page  =  1;
if (empty($hits))  $hits  = 30;
$start = $hits*($page-1);
$query = "SELECT * FROM $mytable WHERE event_day = '$day1' and  event_month = '$month1' and event_year = '$year1' AND event_tipe = '$tipe1'";
$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 "MOU DATUN <strong>$xnum</strong> | ";
//for ($i=1;$i<=$stw2;$i++) {if($page==$i){
//echo "Halaman <b>$i</b> ";
} 
//else{echo " <font size=\"2\"><a href=\"?id=$id1&page=$i\">$i</A></font> ";}}
//print ('<br><br>');
$query  = "SELECT * FROM ".$mytable." WHERE event_day = '$day1' and  event_month = '$month1' and event_year = '$year1'";
if(!empty($squery)) { $query .= "WHERE event_day = '$day1' and  event_month = '$month1' and event_year = '$year1' AND event_tipe = '$tipe1' LIKE \"%$squery%\" ";}
$query .= "ORDER BY event_id DESC LIMIT $start,$hits";
$res = mysql_query($query);
print ('<table id="myTable" width="100%"  border="0" cellspacing="1" cellpadding="1" bgcolor="#999900">
        <thead><tr>
<td width="5%"><strong>NO</strong></td>
<td width="35%"><strong>TERDAKWA</strong></td>
<td width="20%"><strong>AGENDA</strong></td>
<td width="40%"><strong>P.U.</strong></td>


</tr></thead><tbody>');
$no=1; // fungsi nomor
 $x=0;
  while($row = mysql_fetch_array($res))
  {
   $x++;
   if($x==2) {$barva = "FFFFFF";$x=0;} else {$barva = "FFFFD9";$x=1;}


print ('<tr bgcolor=#'.$barva.'>');
print ('<td><center>'.$no++.'</center></td>');
print ('<td><span class="stylesidang">'.$row['event_terdakwa'].'</span></td>');
print ('<td><span class="stylesidang">'.$row['event_agenda'].'</span></td>');
print ('<td><span class="stylesidang">'.$row['event_jaksa'].' </span></td>');


		


print ('</tr>');
}
print ('</tbody></table>');
?>
