<?php 
session_start();
require_once 'config.php';
require_once 'auth.php';
$MainPage="Report";
$Page = "Follow-Patient-Report";
?>
<!DOCTYPE html>

<html lang="en" class="default-style">

<head>
    <title><?php echo $Proj_Title; ?></title>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="" />
    <meta name="keywords" content="">
    <meta name="author" content="Codedthemes" />
    <?php include_once 'header_script.php'; ?>
    <link rel="stylesheet" href="https://cdn.datatables.net/responsive/2.2.3/css/responsive.bootstrap.min.css">
 <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.6.2/css/buttons.dataTables.min.css">
</head>

<body>
  
    <!-- [ Layout wrapper ] Start -->
    <div class="layout-wrapper layout-1 layout-without-sidenav">
        <div class="layout-inner">
         
         <?php include 'sidenavi.php'; ?>

<div class="layout-container">
                 <div class="layout-content">

                    <!-- [ content ] Start -->
                    <div class="container-fluid flex-grow-1 container-p-y">
                     
<h4 class="font-weight-bold py-3 mb-0">Follow Patient Report</h4>
<div class="card mb-4">
<div class="card-body">
<div id="alert_message"></div>
<form id="validation-form" method="post" enctype="multipart/form-data" action="">
<div class="form-row">

<div class="form-group col-md-3">
<label class="form-label">From Date </label>
<input type="date" name="FromDate" id="FromDate" class="form-control" value="<?php echo $_POST['FromDate'] ?>" autocomplete="off" required>
</div>
<div class="form-group col-md-3">
<label class="form-label">To Date</label>
<input type="date" name="ToDate" id="ToDate" class="form-control" value="<?php echo $_POST['ToDate'] ?>" autocomplete="off" required>
</div>
<input type="hidden" name="Search" value="Search">
<div class="form-group col-md-2" style="padding-top:20px;">
<button type="submit" name="submit" class="btn btn-primary btn-finish">Search</button>
</div>
</div>

</form>
</div>
</div>
                        <div class="row">
                            <!-- customar project  start -->
                            <div class="col-xl-12">
                                <div class="card">
                                    <div class="card-body">
                                        
                                      

  <style>
table, td, th {  
  border: 1px solid #ddd;
  text-align: left;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  padding: 15px;
}
</style>     

     <?php if($_REQUEST['Search'] == 'Search') {?>     
     <input type="hidden" id="ConsultantId" value="<?php echo $_REQUEST['ConsultantId'];?>">
     <input type="hidden" id="FromDate" value="<?php echo $_REQUEST['FromDate'];?>">
     <input type="hidden" id="ToDate" value="<?php echo $_REQUEST['ToDate'];?>">               
    <div class="table-responsive">
       <table id="example" class="table-striped table-bordered">
            <thead>
             <tr>
                <th>Sr.No</th>
                <th>Mrd. No</th>
                <th>Name</th>
                <th>Gender</th>
                <th>Phone No</th>
                <th>Follow Date</th>
                
            </tr>
            </thead>
            <tbody>
          <?php 
          $i=1;
          $sql3 = "SELECT * FROM tbl_consultant WHERE Status=1";
          if($_REQUEST['FromDate']!=''){
                $FromDate = $_REQUEST['FromDate'];
                $sql3.=" AND FollowUpDate>='$FromDate'";
          }
          if($_REQUEST['ToDate']!=''){
                $ToDate = $_REQUEST['ToDate'];
                $sql3.=" AND FollowUpDate<='$ToDate'";
          }
          //echo $sql3;
          $row3 = getList($sql3);
          foreach($row3 as $result){
           ?>      
                <tr>
                    <td><?php echo $i; ?>.</td>
                   <td><?php echo $result['MrdNo']; ?></td>
                    <td><?php echo $result['PatientName']; ?></td>
                    <td><?php echo $result['Gender']; ?></td>
                    <td><?php echo $result['Phone']; ?></td>
                    <td><?php echo date("d/m/Y", strtotime(str_replace('-', '/',$result['FollowUpDate'])));?></td>
               </tr>
           <?php $i++;} ?>
            </tbody>
        </table>
                                        </div>
                                    <?php } ?>
                                    </div>
                                </div>
                            </div>
                            <!-- customar project  end -->
                        </div>
                    </div>
                    <!-- [ content ] End -->
                    <!-- [ Layout footer ] Start -->
                   <?php include 'footer.php'; ?>
                    <!-- [ Layout footer ] End -->
                </div>

                
                <!-- [ Layout content ] Start -->
            </div>
            <!-- [ Layout container ] End -->
        </div>
        <!-- Overlay -->
        <div class="layout-overlay layout-sidenav-toggle"></div>
    </div>


    <!-- [ Layout wrapper] End -->



<?php include_once 'footer_script.php'; ?>
<script src="https://cdn.datatables.net/responsive/2.2.3/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.2.3/js/responsive.bootstrap.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.6.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.html5.min.js"></script>

<script type="text/javascript">
 
  $(document).ready(function() {
    $('#example').DataTable({
      "order": [[ 2, "desc" ]],
       dom: 'Bfrtip',
        buttons: [
            'excelHtml5',
            'pdfHtml5'
        ]
    });
});
</script>


</body>

</html>
