<?php
session_start();
 
 if(empty($_SESSION["user_id"])||$_SESSION["Logdin"]===false||empty($_SESSION["court_id"]))
{
    header("Location:login.php");
    exit();
}
include './connection.php';
include "header.php";

 ?>
 <h3 style="text-align: center;">::  Proceedings:: &nbsp &nbsp &nbsp &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp  Select Date For Previous <form action="./loadc.php" method="POST"><br> <input style="width: 150px;padding-left: 4px; border-radius: 7px;" type="date" required="" name="cdate">&nbsp&nbsp&nbsp<button style="color: navy; border-radius: 13px;" >Load</button> </h3></form>



    <table style="width: 90%;text-align: center;border:1px solid navy;margin-left: 50px;float: center;">
	<tr style="background-color: lightgray;color: black;">
	    
		<th>مقدمہ نمبر</th>
		<th>رجوعہ</th>
		<th>عنوان مقدمہ</th>
        <th>تاریخ پیشی</th>
        <th>       کاروائی</th>
		<th>آئیندہ پیشی</th>
		<th>آئیندہ کاروائی</th>
		<th>Update</th>
		<th>Choose </th>
		<th>Dispose Date</th>
		<th>Dispose</th>
	</tr>
    
	 <?php
 $date=date("d/m/Y");
 
    $q1="SELECT * FROM caseproceedings WHERE proceedingdate='".$date."'   AND status='0' AND pcourtid='".$_SESSION["court_id"]."' ";
    $result=$conn->query($q1);
    
    if (!empty($result) && $result->num_rows > 0)
     {

    while( $row1=$result->fetch_assoc())
        {
    echo '<tr><form action="./updateproc.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 name="caseno">'.$row["caseno"].'</td>';
        echo '<td>'.$row["instdate"].'</td>';
        echo '<td>'.$row["casetitle"].'</td>';
        echo '<td >'.$row1["proceedingdate"].'</td>';
        echo '<td>'.$row1["proceeding"].'</td>';
        echo '<td> <input  type="date" name="nextdate" style=" padding_top=4px;" required="" ></td>';
 
        echo '<td>';
        ?>
        <select   name="proceed"  class="txt"  > <?php
        $q22="Select * from courtproceedings";
    $result12=$conn->query($q22);
    if (!empty($result12) && $result12->num_rows > 0)
     {

    while( $row12=$result12->fetch_assoc())
    {
    echo '<option value="';echo $row12["proceedingtitle"];echo '">';echo $row12["proceedingtitle"]; echo '</option>';
    }
        echo '</select>';
     }

   
 
echo '</td><td><button   style="color:white; border-radius: 7px;background-color:green;">Proceed</button></td></form>

<td><form action="./dispose_php.php" method="POST"><select required="" name="dtype" class="txt">
							<option  >Contested(Trial)</option>
						    <option  >Contested(Non Trial)</option>
					    	<option  >Withdrawl</option>
							<option  >Uncontested</option>
							<option  >Ex-Parte</option>
							<option  >Dismissed in Default</option>
							<option  >Compromised</option>
							<option  >Adjourned Sine Die</option>
							<option  >Others</option></select></td>
<td><input required="" type="date" class="txt" name="ddate"><input type="hidden" value="'.$row["ID"].'" name="id"></td>
<td><button>Dispose</button></td></td></form>




</tr>';
   
     }
    
}
     }

       ?>

 

</table>

 <style type="text/css">
     table{
    font-family: jameel noori nastaleeq;
}
        table,   td {
  border: 1px solid black;
  border-collapse: collapse;
        }
th  {
  border: 1px solid black;
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 18px;
}
 button:hover{
          background-color: yellow;
        font-size: 16px;
        color:white;
    }
  button:active{
          background-color: red;
        font-size: 16px;
        color:white;
    }
 </style>
  