<?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;">    Diary:   Select Date  <input id="ddate" style="width: 150px;padding: 4px; border-radius: 7px;" type="date" required=""  >&nbsp&nbsp&nbsp<button onclick="showcases() " style="color: navy; border-radius: 13px;" >Load</button>   </h3>

 

    <table id="container" style="width: 90%;text-align: center;border:1px solid navy;margin-left: 50px;float: center;">
	
    
	 
 

</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>
<head>

	<script type="text/javascript">
  function showcases() {
 
	 var opt=document.getElementById("ddate").value ; 
  if (opt.length == 0) {
   alert("Choose Correct date.");
    return;
  } else {
    const xmlhttp = new XMLHttpRequest();
    xmlhttp.onload = function() {
    document.getElementById("container").innerHTML = this.responseText;
    }
    
  xmlhttp.open("GET", "load_diary.php?opt="+opt);
  xmlhttp.send();
  }
}
	</script>
</head>