<?php 
session_start();
include "./connection.php";
$opt = $_REQUEST["opt"];
 
 if($opt==="all")
 {
 	$q1="SELECT * FROM caseinfo WHERE currentcourtid='".$_SESSION["court_id"]."' AND status='1'";
 }else{
 	$q1="SELECT * FROM caseinfo WHERE currentcourtid='".$_SESSION["court_id"]."' AND status='1' LIMIT ".$opt."";
 }
 
    $result=$conn->query($q1);
    if (!empty($result) && $result->num_rows > 0)
     {
 echo '	<tr style="background-color: darkgreen;color: white;">
		<th>مقدمہ نمبر</th>
		<th>رجوعہ</th>
		<th>عنوان مقدمہ</th>
		<th>نوعیت</th>
		<th>Update</th>
		 
	</tr>';
while( $row=$result->fetch_assoc())
{
   		 echo "<tr>";

		echo '<td>'.$row["caseno"].'</td>';
		echo '<td>'.$row["instdate"].'</td>';
		echo '<td>'.$row["casetitle"].'</td>';
		echo '<td>'.$row["casetype"].'</td>';
		echo '<td><a href="./caseupdate.php?id='.$row["ID"].'" style="color:darkgreen;">Update</a></td>';
 
    echo "</tr>";
}
     } 

 ?>