<?php
ob_start();
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');

mysqli_query($conn, "SET NAMES 'utf8'");
mysqli_query($conn, 'SET CHARACTER SET utf8');

$formname = 'Patient Search';

$ztit = $_SESSION["tit_" . $dbname];

$maindb = 'patient';

$file = 'patient.php';
$keyfld = "vouchno";

$keycond = "";


$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$myyear = $_SESSION[$myyear];
$compcd = $_SESSION["comp_" . $dbname];

$zroot = $_SESSION["zdir"];

mysqli_select_db($conn, $zdb);

include("includes/linkshead.php");
?>
<script src="MyScript/patient_main_search.js" type="text/javascript"></script>
<style type="text/css">
    .button-container {
        display: flex;
        justify-content: center; /* Centers the button horizontally */
        align-items: center;     /* Centers the button vertically, if needed */
        height: 100vh;          /* Optional: adjust based on your layout */
    }

    .btn {
        text-align: center;      /* Centers the text inside the button */
        display: inline-block;    /* Ensures proper sizing */
    }
   
    .bookapp {
    background-color: #454752; /* Charcoal black background */
    color: white;              /* White text */
    border: none;              /* No borders */
    padding: 2px 1px;        /* Padding */
    text-align: center;        /* Centered text */
    text-decoration: none;     /* Remove underline */
    display: block;            /* Block display for full width */
    font-size: 12px;           /* Font size */
    border-radius: 8px;        /* Rounded corners */
    line-height: 2em;        /* Line height to center text vertically */
    height: 30px;
    transition: background-color 0.3s ease; /* Transition effect */
}

.bookapp:hover {
    background-color: #adb5bd; /* Slightly lighter charcoal on hover */
}



</style>
</head>

<body onload="getSearchData()">
    <form action='' method='POST'>
        <!-- Default box -->
        <!--<br>-->
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title" style="color:inherit"><?php echo $formname; ?></h3>
                <div class="actions pull-right">
                    <!--<i class="fa fa-chevron-down"></i>-->
                    <!--<i class="fa fa-times"></i>-->
                </div>
            </div>
            <div class="row">
                <!--<div class="col-lg-1"></div>-->
                <!--                <div class="col-lg-1 " style="padding-left: 2%">
                                    <input id='addnew' value="Add New Entry" type="button"  class="btn btn-success" style="" onclick="window.location.href = '<?= $file . "?mode=true" ?>'" class="btn btn-labeled btn-success">
                                </div>-->
            </div>
            <div class="panel-body">
                <div class="row">
                    <div class="col-lg-12">
                        <input type="hidden" class="vouchno" value="<?php echo $getvouch; ?>">
                        <input type="hidden" class="series" value="<?php echo $bseries; ?>">
                        <div class="col-lg-2">
                            <select class="form-control select2 sfield">
                                <option value="1">Name</option>
                                <option value="2">Mobile</option>
                                <option value="3">Accode</option>
                                <option value="4">Address</option>
                                <option value="5">Age</option>
                                <option value="6">DOB</option>

                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control select2 soperator">
                                <option value="">Type of Search</option>
                                <option value="%">Like</option>
                                <option value="=">Exactly</option>
                            </select>
                        </div>
                        <div class="col-lg-3">
                            <input type="text" value="" class="form-control ssearch" placeholder="Search Here">
                        </div>
                        <div class="col-lg-1">
                            <input type="button" class="btn btn-primary sload" value="Search" style="padding: 3px;width: 100%">
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control select2 sortBy">
                                <option value="">Sort By</option>
                                <option value="1">Name</option>
                                <option value="2">Mobile</option>
                                <option value="3">Accode</option>
                                <option value="4">Address</option>
                                <option value="5">Age</option>
                                <option value="6">DOB</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control select2 orderAs">
                                <option value="desc">Desc</option>
                                <option value="asc">Asc</option>
                            </select>
                        </div>

                        <div class="col-lg-12 sloader text-center">
                        </div>
                        <div class="col-lg-12 snoRecord text-center">
                            <h3>NO RECORDS FOUND</h3>
                        </div>

                    </div>
                </div>

                <div class="col-lg-11 table responsive ssload" style="overflow-y: scroll;height: 480px;">
                    <table class="table table-striped table-condensed table-bordered" width="100%">
                        <thead>
                            <tr class="mySearchTr">
                                <th width="6%">Patient No.</th>
                                <th width="25%">Name</th>
                                <th width="20%">Address</th>
                                <th width="5%">Age</th>
                                <th width="10%">DOB</th>
                                <th width="7%">Mobile</th>
                                <th width="10%">Email</th>
                                <th width="5%">Gender</th>
                                <th width="5%" class="text-right">Balance</th>
                                <th width="14%"></th>
                            </tr>
                        </thead>
                        <tbody class="sTbody">

                        </tbody>
                    </table>
                </div>
                <br>
                <div class="row">
                    <div class="col-xs-11 text-right search-action-bar">
                        <input type="button" class="btn btn-primary sprev" value="Previous">
                        <input type="button" class="btn btn-primary snext" value="Next">
                    </div>
                </div>
            </div>
        </div>



        <!--        <div class="row">
                    <div class="col-xs-10 text-right search-action-bar">
                        <input type="button"  class="btn btn-primary sprev" value="Previous">
                        <input type="button"  class="btn btn-primary snext" value="Next">
                    </div>
                </div>-->

        <?php include("includes/linksfoot.php"); ?>

</body>

</html>