<?php 
session_start();
require_once 'config.php';
require_once 'auth.php';
$MainPage="Report";
$Page = "OPD-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="assets/libs/datatable-buttons/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">OPD 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-4">
<label class="form-label">Type</label>
<select class="form-control" style="width: 100%" name="Type" id="Type" >
    <option value="" selected="">All</option>
     
    <option <?php if($_REQUEST['Type'] == 1){?> selected <?php } ?> value="1">OPD</option>
    <option <?php if($_REQUEST['Type'] == 2){?> selected <?php } ?> value="2">OPD Receipt</option>
                               
  </select>
<div class="clearfix"></div>
</div>-->
<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="button" name="submit" class="btn btn-primary btn-finish" onclick="patientReport()">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">
                                        
                                      


  
                                    </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 type="text/javascript">
 function patientReport(){
    var Type = $('#Type').val();
    var FromDate = $('#FromDate').val();
    var ToDate = $('#ToDate').val();
        setTimeout(function() {
            window.open(
              'view-opd-patient-month-wise-report.php?Type='+Type+'&FromDate='+FromDate+"&ToDate="+ToDate, 'deletedPatients',
               'toolbar=1, scrollbars=1, location=1,statusbar=0, menubar=1, resizable=1, width=1500, height=1000'
           );
     }, 1);
    
 }
    $(document).ready(function() {
    $('#example').DataTable({
      
        "scrollX": true,
        dom: 'Bfrtip',
        buttons: [
            
            'excelHtml5'
           
        ]
    });
});
</script>


</body>

</html>
