<?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";

 ?>
 <!DOCTYPE html>  
<html>
<head>
 <script type="text/javascript">
  


 </script>
</head>
<body>
 

</body>
</html>


<style type="text/css">

  button{
    border-radius: 10px;
    
    background-color: navy;
    color: white;
    border-color: lightgreen;
    padding: 6px;
    margin-left:  6px;
  }
  button:hover{
    background-color: green;
    color:black;
    border-color: red;
  }
  button:active{
    background-color: red;
    color: white;
    border-color: green;
  }
  .header{
    border-radius: 7px;
    background-color: gray;
    color: black;
    padding-top: 25px;
    padding-bottom: 7px;
    margin-bottom: 5px;
    margin-left: 5px;
  }
</style>

<div id="div2"  >
  <table   style="width: 98%;text-align: center;border:1px solid navy">
  <tr style="background-color: darkgreen;color: white;">
         
            <th>Case No</th>
          <th>Case Title</th>
          <th>Restored Date</th>
        
          
  </tr>
  <?php 


   $q1="SELECT * FROM tbl_restored WHERE court_id='".$_SESSION["court_id"]."'   ";
        $result=$conn->query($q1);
        if (!empty($result) && $result->num_rows > 0)
         {
         echo "Total Restored: ".$result->num_rows;
        while( $row=$result->fetch_assoc())
        {
         
            echo '  <tr>';
              $q="Select * from caseinfo WHERE ID=".$row["case_id"]."";
                  $resul=$conn->query($q);
                  $r=$resul->fetch_assoc();
              echo '<td>'.$r["caseno"].'</td>';
              echo '<td>'.$r["casetitle"].'</td>';
                echo '<td>'.$row["rdate"].'</td>'; echo ' </tr> ';
            }
         }

  ?>

</div>



<div id="div1"  >
  <table id="reslt2" style="width: 98%;text-align: center;border:1px solid navy">
  <tr style="background-color: darkgreen;color: white;">
         
            <th>Case No</th>
          <th>Case Title</th>
          <th>Disposal Type</th>
        
          
  </tr>
  <?php 
include 'connection.php';
   $q121="SELECT * FROM tbl_disposals WHERE court_id='".$_SESSION["court_id"]."' AND status='1' ";
        $result21=$conn->query($q121);
        if (!empty($result21) && $result21->num_rows > 0)
         {
         echo "<br>Total Disposal: ".$result21->num_rows;
        while( $row21=$result21->fetch_assoc())
        {
         
            echo '<tr>';
              $q21="SELECT * FROM caseinfo WHERE ID=".$row21["case_id"]."";
                  $resul21=$conn->query($q21);
                  $r21=$resul21->fetch_assoc();
              echo '<td>'.$r21["caseno"].'</td>';
              echo '<td>'.$r21["casetitle"].'</td>';
                echo '<td>'.$row21["type"].'</td>';
              echo ' </tr> ';
            }
         }

  ?>

</div>






