<?php 
session_start();
include './connection.php';
$date=$_REQUEST["opt"];
 
 $date=date("d/m/Y",strtotime($date));   
 

$q1="SELECT * FROM caseproceedings WHERE proceedingdate='".$date."'  AND pcourtid='".$_SESSION["court_id"]."' ";
    $result=$conn->query($q1);
    if (!empty($result) && $result->num_rows > 0)
     {
        echo '<tr style="background-color: lightgray;color: black;">
 
      <th>  پیشیوں کی تفصیل  </th>
        <th>گزشتہ کاروائی</th>
          <th>گزشتہ پیشی</th>
            <th>عنوان مقدمہ</th> 
            <th>رجوعہ</th>
        <th>مقدمہ نمبر</th>
       
    </tr>';

while( $row1=$result->fetch_assoc())
{
    echo '<tr><form action="./updatediary.php" method="GET">';
	$q11="Select * from caseinfo Where ID='".$row1["caseid"]."'";
 echo '<input name="q" type="hidden" value="0">';
  echo '<input name="pdate" type="hidden" value="'.$row1["proceedingdate"].'">';
     echo '<input name="caseid" type="hidden" value="'.$row1["caseid"].'">';
    $result1=$conn->query($q11);
    if (!empty($result1) && $result1->num_rows > 0)
     {
     	$row=$result1->fetch_assoc();

echo '<td> <a style="color:blue;" href="./caseinfo.php?id='.$row1["caseid"].'&title='.$row["casetitle"].'">Show</a></td>';
 
echo '<td>'.$row1["proceeding"].'</td>';
echo '<td >'.$row1["proceedingdate"].'</td>';
echo '<td>'.$row["casetitle"].'</td>'; 
echo '<td>'.$row["instdate"].'</td>';  
echo '<td name="caseno">'.$row["caseno"].'</td></tr>';
     }
    
}
     }else{echo '<h4 style="color:red; ">There is no record founded.</h4>';}

       ?>
