<?php
ob_start();
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');
header("Content-Type: text/html;charset=UTF-8");

$formname = 'Medical';
$maindb = 'medent';
$file = 'medical.php';
$printfile = 'medical_print.php';
$keyfld = "myvouch";
$myyear = $_SESSION["tit_" . $dbname];

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$username = $_SESSION["username_" . $dbname];
$zroot = $_SESSION["zdir"];
$modet = $_GET["mode"];
mysqli_select_db($conn, $zdb);
include("includes/vouchno_generate.php");
include("includes/prev&next.php");
include("includes/linkshead.php");


//mysqli_query($conn, "Create temporary table `med` SELECT date_Format(`vouchdt`, '%d/%m/%Y') as mydt, myvouch,
//                        manualno, paxname, mobile,passport, broker,doctor FROM `$maindb` WHERE myvouch != '' ORDER BY vouchdt DESC")or die(mysqli_error($conn));

//$srchresult = "SELECT vouchdt,date_Format(`vouchdt`, '%d/%m/%Y') as mydt, myvouch,manualno, paxname, mobile,passport, broker,doctor FROM `$maindb` WHERE myvouch != '' ORDER BY vouchdt DESC"or die(mysqli_error($conn));
$srchresult = "SELECT * FROM `medent` ORDER BY `medent`.`myvouch` DESC";

$result = mysqli_query($conn, $srchresult)or die(mysqli_error($conn));
?>
<!--<script src="MyScript/medical_search.js"  type="text/javascript"></script>-->   
<?
include("includes/linkshead.php");
?>
<h1 class="panel-title">
    <?php Echo $formname; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <span style="color: #5D96E4;font-size: 11px">
</h1>
<!--<script src="MyScript/crm_search.js"  type="text/javascript"></script>-->   
<div class="col-lg-11 table responsive ssload" style="overflow-y: scroll;height: 480px;">
    <table id="example1" class="table table-striped table-condensed table-bordered" width="100%" >
        <thead>
            <tr class="mySearchTr">
                <th style="width:2%;">Date</th>
                <th style="width:5%;">File No.</th>
                <th style="width:15%;">Pax Name</th>
                <th style="width:10%;">Mobile</th>
                <th style="width:10%;">Passport</th>
                <th style="width:10%;">Agent</th>
                <th style="width:7%;">Doctor</th>
                <th style="width:5%;">Status</th> 
                <th align="center"  style="width:1%;">Action</th>
            </tr>
        </thead>
        <tbody class="sTbody">
            <?php
            while ($row = mysqli_fetch_array($result)) {
                
//                if($row[fitness] == 1){
//                    $fitness = 'Fit';
//                    
//                }elseif($row[fitness] == 2){
//                    $fitness = 'Unfit';
//
//                }elseif($row[fitness] == 3){
//                    $fitness = 'Pending';
//
//                }else{
//                       $fitness = 'Repeat';
//
//                }
                
                echo "<tr class='' data-href='$file?mode=edit&$keyfld=$row[$keyfld]'>";
                echo "<td align='left'>$row[vouchdt]</td>";
                echo "<td align='left'>$row[manualno]</td>";
                echo "<td align='left'>$row[paxname]</td>";
                echo "<td align='left'>$row[mobile]</td>";
                echo "<td align='left'>$row[passport]</td>";
                echo "<td align='left'>$row[broker]</td>";
                echo "<td align='left'>$row[doctor]</td>";
                echo "<td align='left'>$fitness</td>";
                echo "<td align='left'><a href=\"$file?mode=edit&$keyfld=$row[$keyfld]\"><i class='fa fa-pencil' style='font-size:1.3em;color:#00C0EF;cursor:pointer;'></i></a></td>";
                echo "</tr>";
            }
            ?>
        </tbody>  
    </table>
</div>
<br>
<div class="row">
    <div id="example1" 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>

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


