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

$formname = 'Food Entry';
$maindb = 'foodslmain';
$trandb = 'foodsltran';
$accdb = "actran";
// $printfile = "hotelsl_invprint.php";
$printfile = "foodsl_invoice_print.php";
$file = 'foodsl.php';
$trandbexist = 1;
$keyfld = "vouchno";

$source = "FDSL";
$tourcode = $_SESSION['tourcode'];

$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/vouchno_generate.php");
include("includes/prev&next.php");

if (isset($_POST["submit"])) {
    $a = 1;
    $qvouch = $_POST["vouchno"];
    $vouchdt = $_POST["vouchdt"];
    $customer = $_POST["customer"];
    $remark1 = $_POST["remark1"];
    $remark2 = $_POST["remark2"];
    $roe = $_POST["roe"];
    $foodamt = $_POST["foodamt"];
    $foodinramt = $_POST["foodinramt"];
    $foodnights = $_POST["foodnights"];
    $foodpax = $_POST["foodpax"];


    $count = $_POST["items"];

    $mvouch = $qvouch;

    $salecode = 11;

    if ($a == 1) {
        // mysqli_query($conn, "LOCK TABLES `$maindb` WRITE, `$trandb` WRITE ");

        if ($addflag == 1) {
            $gen1 = mysqli_query($conn, "SELECT MAX(vouchno) AS maxcode FROM `$maindb` where vouchno != '' LIMIT 0,1 ") or die(mysqli_error($conn));
            if (mysqli_num_rows($gen1) > 0) {
                $vvouch = mysqli_fetch_assoc($gen1);
                $qvouch = $vvouch["maxcode"] + 1;
            } else {
                $qvouch = '1';
            }
            $mvouch = $qvouch;
        }

        #################################TRAN PART #################################

        mysqli_query($conn, "DELETE FROM `$trandb` WHERE `$keyfld`='$mvouch'") or die(mysqli_error($conn));
        // mysqli_query($conn, "DELETE FROM `roomsacn` WHERE `$keyfld`='$mvouch' and source = '$source' ") or die(mysqli_error($conn));

        $srl = 0;
        $batch = date("Y-m-d") . $mvouch;
        $cnt = 0;
        for ($i = 0; $i <= $count; $i++) {

            $srno = $_POST["srno_$i"];
            $fcheckin = $_POST["fcheckin_$i"];
            $fcheckout = $_POST["fcheckout_$i"];
            $fnopax = $_POST["fnopax_$i"];
            $fnonights = $_POST["fnonights_$i"];
            $frate = $_POST["frate_$i"];
            $famount = $_POST["famount_$i"];
            $fhotel = $_POST["fhotel_$i"];

            $finramt = round($roe * $famount, 0);

            if ($fhotel != "") {
                $fcnt++;
                mysqli_query($conn, "INSERT INTO `$trandb`(`vouchno`, `srno`, `checkin`, `checkout`, `hotel`, `nopax`, `nonights`, `rate`, `amount`, `roe`, `inramt`)
                                    VALUES('$mvouch', '$fcnt', '$fcheckin', '$fcheckout', '$fhotel', '$fnopax', '$fnonights', '$frate', '$famount', '$roe', '$finramt')") or die(mysqli_error($conn));
            }
        }


        $rate = $_POST["rate"];
        $amount = $nopax * $rate;

        $purcode = 12;

        // mysqli_query($conn, "DELETE FROM `$accdb` WHERE `vouchno` = '$mvouch' AND `source` = '$source'") or die(mysqli_error($conn));

        // if ($visapuramt > 0) {
        //     $samtmin = $visapuramt * -1;

        //     // purchase part
        //     mysqli_query($conn, "INSERT INTO `$accdb`(date, vouchno, source, trnno, accode, grpcode, amount, ord)
        //          VALUES ('$visainvdt','$mvouch', '$source', '001', '$purcode','004', '$samtmin', '16')") or die(mysqli_error($conn));
        //     // party part
        //     mysqli_query($conn, "INSERT INTO `$accdb`(date, vouchno, source, trnno, accode, grpcode, amount, ord)
        //          VALUES ('$visainvdt','$mvouch', '$source', '002', '$hotelamt','009', '$visapuramt', '16')") or die(mysqli_error($conn));
        // }

        // mysqli_query($conn, "DELETE FROM `$accdb` WHERE `vouchno`='$mvouch' and source = '$source'") or die(mysqli_error($conn));

        // if ($amount > 0) {
        //     $minus_amt = ($amount * -1);

        //     // sale part
        //     mysqli_query($conn, "INSERT INTO `$accdb`(date, vouchno, source, trnno, accode, grpcode, amount, regnno, tour, ord)
        //             VALUES ('$vouchdt', '$mvouch', '$source', '001', '30','005', '$amount', '$mvouch', '$tourcode', '17')") or die(mysqli_error($conn));

        //     // party part
        //     mysqli_query($conn, "INSERT INTO `$accdb`(date, vouchno, source, trnno, accode, grpcode, amount, regnno, tour, ord)
        //              VALUES ('$vouchdt', '$mvouch', '$source', '002', '$customer','010', '$minus_amt', '$mvouch', '$tourcode', '17')") or die(mysqli_error($conn));
        // }
        #################################TRAN PART END #################################
        ############################## MAIN ######################################################
        if ($addflag == 1) {

            $uuid = $_SESSION["uuid"];

            mysqli_query($conn, "INSERT INTO `$maindb`(`vouchno`, `vouchdt`, `customer`,  `roe`, `remark1`, `remark2`,
                                                       `foodpax`, `foodnights`,`foodamt`, `foodinramt`, `uuid`)
                                               VALUES ($qvouch, '$vouchdt',  '$customer', '$roe', '$remark1', '$remark2',
                                                        '$foodpax', '$foodnights','$foodamt', '$foodinramt', '$uuid')") or die(mysqli_error($conn));
            insmess();
            $mvouch = $qvouch; //1
            header("refresh: 1; $file?$keyfld=$mvouch&mode=edit");
        } else {
            $mvouch = $qvouch; //1
            mysqli_query($conn, "UPDATE `$maindb` SET `vouchdt`='$vouchdt', `customer`='$customer', `roe`='$roe', `remark1`='$remark1',
                                                    `remark2`='$remark2', `foodpax`='$foodpax', `foodnights`='$foodnights',`foodamt`='$foodamt', `foodinramt`='$foodinramt'
                                                       WHERE `vouchno`= '$mvouch' ") or die(mysqli_error($conn));
            updmess();
            header("refresh: 1; $file?$keyfld=$mvouch&mode=edit");
        }

        ################################# MAIN PART END #################################
    }
}

if ($addflag != 1) {

    $getvouch = '';
    if ($addflag == 0) {
        $getvouch = $_GET[$keyfld];
    } else {
        $getvouch = $qvouch;
    }

    $result = mysqli_query($conn, "SELECT * FROM `$maindb` WHERE $keyfld='$getvouch'") or die(mysqli_error($conn));
    $get = mysqli_fetch_array($result);

    $magent = mysqli_query($conn, "SELECT accode,name FROM accmast where accode='$get[customer]'") or die(mysqli_error($conn));
    $lagent = mysqli_fetch_array($magent);
}

$senable = "";
$cenable = "";

if (isset($_GET["delete"])) {
    delete($zdb, "$maindb", "$keyfld", $_GET[$keyfld], "$file?mode=last");
    delete($zdb, "$trandb", "$keyfld", $_GET[$keyfld], "$file?mode=last");
    $delcond = " source = '$source' and vouchno = '$_GET[vouchno]' ";
    $delcond2 = " source = '$source' and vouchno = '$_GET[vouchno]' ";
    // delnew($zdb, "actran", "$delcond", "$file?mode=last");
    // delnew($zdb, "actran", "$delcond2", "$file?mode=last");
}

include("includes/linkshead.php");
?>
<script src="MyScript/shortkeys.js?a=2" type="text/javascript"></script>
<script src="MyScript/foodsl.js?a=3" type="text/javascript"></script>
<script src="MyScript/foodsl_search.js?a=2" type="text/javascript"></script>
<style>
    .sknewbtn {
        background-image: linear-gradient(135deg, #09C6F9 10%, #045DE9 100%) !important;
        color: white !important;
    }
</style>
</head>

<body>
    <form action='' method='POST'>
        <!-- Default box -->
        <div>
            <div class="col-lg-12 col-md-10 col-sm-12 col-xs-12  pad">
                <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="panel-body">
                        <div class="row">
                            <div class="col-lg-1  col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Voucher</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 pad">
                                <input type="text" class="form-control text-size form" name="vouchno" value="<?php echo ($addflag != 1) ? $get["vouchno"] : "$qvouch"; ?>" required readonly>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Date</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4 pad">
                                <input type="date" class="form-control form focusfield" name="vouchdt" value="<?php echo ($addflag != 1) ? $get["vouchdt"] : date('Y-m-d'); ?>" autofocus>
                            </div>
                            <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Agent / Customer</label>
                            </div>
                            <div class="col-lg-3 col-md-3 col-sm-4 col-xs-4 pad">
                                <select name="customer" class="form-control form customer select2" style="width: 100%;">
                                    <option value='<?php echo ($addflag != 1) ? $lagent['accode'] : '' ?>'><?php echo ($addflag != 1) ? $lagent['name'] : '' ?></option>
                                    <?php
                                    $mhotl = mysqli_query($conn, "SELECT `accode`,`name` FROM `accmast` where `grpcode`='044' OR `grpcode`='010'") or die(mysqli_error($conn));
                                    while ($thotl = mysqli_fetch_array($mhotl)) {
                                        echo "<option value='$thotl[accode]'>$thotl[name]</option>";
                                    }
                                    ?>
                                </select>
                            </div>
                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad" style="width: 3.333333%;">
                                <label class="label-control marg" style="color:red">ROE</label>
                            </div>
                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad adjcol">
                                <input type="number" class="form-control form text-right roe" name="roe" value="<?php echo ($addflag != 1) ? $get["roe"] : ""; ?>" step='any'>
                            </div>
                        </div>
                        <br>
                        <div class="table-responsive">
                            <table class="table table-striped table-condensed table-bordered table-padd" width="100%">
                                <thead class="mySearchTr">
                                    <tr class="mySearchTr">
                                        <th style="width:5%"></th>
                                        <th style="width:5%">Sr.</th>
                                        <th style="width:10%">Check In</th>
                                        <th style="width:10%">Check Out</th>
                                        <th style="width:30%">Hotel</th>
                                        <th style="width:10%" class='text-right'>No. Nights</th>
                                        <th style="width:10%" class='text-right'>No. Pax</th>
                                        <th style="width:10%" class='text-right'>Rate</th>
                                        <th style="width:10%" class='text-right'>Amount</th>
                                    </tr>
                                </thead>
                                <tbody class="tbody">
                                    <?php
                                    if ($addflag != 1) {
                                        $ctr = 0;
                                        $fctr = 0;
                                        $mctr = 0;
                                        $tqty = 0;
                                        $tamt = 0;
                                        $getfooddtl = mysqli_query($conn, "Select * from `$trandb` where vouchno ='$get[vouchno]' order by srno") or die(mysqli_error($conn));
                                        while ($fetfood = mysqli_fetch_array($getfooddtl)) {
                                            $getho = mysqli_query($conn, "SELECT `code`,`hotelnm` FROM `hotels` where code='$fetfood[hotel]'") or die(mysqli_error($conn));
                                            $fetho = mysqli_fetch_array($getho);
                                            echo "<tr>";
                                            echo "<td style='text-align:center'><i class='fa fa-close remove' style='display:none;'></i></td>";

                                            echo "<td><input type='text' name='fsrno_$fctr' value='$fetfood[srno]' class='form-control form'></td>";
                                            echo "<td><input type='date' name='fcheckin_$fctr' value='$fetfood[checkin]' class='form-control form fcheckin'></td>";
                                            echo "<td><input type='date' name='fcheckout_$fctr' value='$fetfood[checkout]' class='form-control form fcheckout'></td>";
                                            echo "<td>";
                                            echo "<select class='form-control form fhotel select2' name='fhotel_$fctr' style='width:100%'  >";
                                            echo "<option value='$fetho[code]'>$fetho[hotelnm]</option>";
                                            $git = mysqli_query($conn, "SELECT `code`,`hotelnm` FROM `hotels` ORDER BY `hotelnm`") or die(mysqli_error($conn));
                                            while ($itm = mysqli_fetch_array($git)) {
                                                echo "<option value='$itm[code]'>$itm[hotelnm]</option>";
                                            }

                                            echo "</select>";
                                            // food section 
                                            echo "</td>";
                                            echo "<td><input type='number' name='fnonights_$fctr' value='$fetfood[nonights]' class='form-control form fnonights  text-right' readonly></td>";
                                            echo "<td><input type='number' name='fnopax_$fctr' value='$fetfood[nopax]' class='form-control form fnopax text-right'></td>";
                                            echo "<td><input type='number' name='frate_$fctr' value='$fetfood[rate]' class='form-control form frate text-right'></td>";
                                            echo "<td><input type='number' name='famount_$fctr' value='$fetfood[amount]' class='form-control form famount text-right' readonly>"
                                                . "<input type='hidden' name='froe_$fctr' value='$fetfood[roe]' class='form-control form froe text-right'>"
                                                . "<input type='hidden' name='finramt_$fctr' value='$fetfood[inramt]' class='form-control form finramt text-right'></td>";
                                            echo "</tr>";
                                            $fctr++;
                                        }
                                    } else {
                                        echo "<tr>";
                                        echo "<td style='text-align:center'><i class='fa fa-close remove' ></i></td>";

                                        echo "<td><input type='text' name='fsrno_0' value='1' class='form-control form'></td>";
                                        echo "<td><input type='date' name='fcheckin_0' value='' class='form-control form fcheckin'></td>";
                                        echo "<td><input type='date' name='fcheckout_0' value='' class='form-control form fcheckout'></td>";
                                        echo "<td>";
                                        echo "<select class='form-control form fhotel select2' name='fhotel_0' style='width:100%'  >";
                                        echo "<option value=''></option>";
                                        $git = mysqli_query($conn, "SELECT `code`,`hotelnm` FROM `hotels` ORDER BY `hotelnm`") or die(mysqli_error($conn));
                                        while ($itm = mysqli_fetch_array($git)) {
                                            echo "<option value='$itm[code]'>$itm[hotelnm]</option>";
                                        }
                                        echo "</select>";
                                        echo "</td>";
                                        echo "<td><input type='number' name='fnonights_0' value='0' class='form-control form fnonights text-right' readonly></td>";
                                        echo "<td><input type='number' name='fnopax_0' value='0' class='form-control form fnopax text-right'></td>";
                                        echo "<td><input type='number' name='frate_0' value='0' class='form-control form frate text-right'></td>";
                                        echo "<td><input type='number' name='famount_0' value='0' class='form-control form famount text-right' readonly>"
                                            . "<input type='hidden' name='froe_0' value='0' class='form-control form froe text-right'>"
                                            . "<input type='hidden' name='finramt_0' value='0' class='form-control form finramt text-right'></td>";
                                        echo "</tr>";
                                    }
                                    ?>
                                    <input type="hidden" id="items" name="items" value="<?php echo ($addflag != 1) ? $ctr : 1; ?>" />
                                </tbody>
                            </table>
                        </div>
                        <div class="col-lg-12 pad">
                            <button type="button" class="btn btn-primary btn-square form" id="addnew">
                                <i class="fa fa-plus" data-toggle='tooltip' title='Add Row'></i>
                            </button>
                        </div>

                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Remarks</label>
                            </div>
                            <div class="col-lg-4 col-md-3 col-sm-4 col-xs-4  pad">
                                <input type="text" class="form-control remark1 form" name="remark1" value="<?php echo ($addflag != 1) ? $get["remark1"] : ""; ?>">
                            </div>
                            <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Total</label>
                            </div>
                            <div class="col-lg-1">
                                <input type="text" class="form-control form text-right foodnights" name="foodnights" value="<?php echo ($addflag != 1) ? $get["foodnights"] : ""; ?>" readonly>
                            </div>
                            <div class="col-lg-1">
                                <input type="text" class="form-control form text-right  foodpax" name="foodpax" value="<?php echo ($addflag != 1) ? $get["foodpax"] : ""; ?>" readonly>
                            </div>
                            <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">FE</label>
                            </div>
                            <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                <input type="text" class="form-control text-right text-size foodamt form" name="foodamt" value="<?php echo ($addflag != 1) ? $get["foodamt"] : ""; ?>" required>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg"></label>
                            </div>
                            <div class="col-lg-4 col-md-3 col-sm-4 col-xs-4  pad">
                                <input type="text" class="form-control remark2 form" name="remark2" value="<?php echo ($addflag != 1) ? $get["remark2"] : ""; ?>">
                            </div>
                            <div class="col-lg-4 col-md-2 col-sm-2 col-xs-2 text-right pad" style='color: blue'>
                                <label class="label-control marg"><b>INR</b></label>
                            </div>
                            <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                <input type="text" class="form-control text-right text-size foodinramt form" name="foodinramt" value="<?php echo ($addflag != 1) ? $get["foodinramt"] : ""; ?>" required>
                            </div>
                        </div>
                        <!-- <div style="background-color:#E3F2E1;width: 50%;display: none;" class="pvisa">

                            <div class="row">
                                <div class="col-lg-3 text-right pad">
                                    <label class="label-control marg" style="color:red">Supplier</label>
                                </div>
                                <div class="col-lg-6 adjcolj pad">
                                    <select name="visasupp" class="form-control form pad visasupp" style="color:red;background-color:white;">
                                        <option value="<?php echo ($addflag != 1) ? $get["visasupp"] : ""; ?>"> <?php echo ($addflag != 1) ? $fetvsupp["name"] : ""; ?></option>
                                        <?php
                                        $gnm = mysqli_query($conn, "SELECT `accode`,`name` FROM `accmast` where grpcode = '009' ORDER BY `name`") or die(mysqli_error($conn));
                                        while ($fnm = mysqli_fetch_array($gnm)) {
                                            echo "<option value='$fnm[accode]'>$fnm[name]</option>";
                                        }
                                        ?>

                                    </select>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-3 text-right pad">
                                    <label class="label-control marg" style="color:red">Invoice No.</label>
                                </div>
                                <div class="col-lg-2 adjcolj pad">
                                    <input type="text" class="form-control form text-right  visainvno" style="color:red;background-color:white" name="visainvno" value="<?php echo ($addflag != 1) ? $get["visainvno"] : ""; ?>">
                                </div>
                                <div class="col-lg-2 text-right pad">
                                    <label class="label-control marg" style="color:red">Invoice Date</label>

                                </div>
                                <div class="col-lg-2 text-right pad">
                                    <input type="date" class="form-control form text-right  visainvdt" style="color:red;background-color:white" name="visainvdt" value="<?php echo ($addflag != 1) ? $get["visainvdt"] : ""; ?>">
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-3 text-right pad">
                                    <label class="label-control marg" style="color:red">Rate</label>
                                </div>
                                <div class="col-lg-2 adjcolj pad">
                                    <input type="text" class="form-control form text-right  visarate" style="color:red;background-color:white" name="visarate" value="<?php echo ($addflag != 1) ? $get["visarate"] : ""; ?>">
                                </div>
                                <div class="col-lg-2 text-right pad">
                                    <label class="label-control marg" style="color:red">Amount</label>
                                </div>
                                <div class="col-lg-2 text-right pad">
                                    <input type="text" class="form-control form text-right  visapuramt" style="color:red;background-color:white" name="visapuramt" value="<?php echo ($addflag != 1) ? $get["visapuramt"] : ""; ?>">
                                </div>
                            </div>
                        </div> -->
                        <!-- <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <button type="button" id='print' class="btn btn-pad btn-square sknewbtn visapurch">
                                    Visa Purchase
                                </button>
                            </div>
                            <div class="col-lg-8 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Amount</label>
                            </div>
                            <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                <input type="text" class="form-control text-right text-size totamt form" name="amount" value="<?php echo ($addflag != 1) ? $get["totamt"] : ""; ?>" readonly>
                            </div>
                        </div> -->

                    </div>
                    <div class="panel-footer">

                        <?php include("includes/buttons.php"); ?>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <div class="modal fade bs-example-modal-lg searchModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal"><span>&times;</span></button>
                    <h4 class="modal-title" id="myLargeModalLabel">Search <? echo $formname; ?></h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-lg-2">
                            <select class="form-control sfield">
                                <option value="1">Voucher</option>
                                <option value="2">Date</option>
                                <option value="3">Customer/Agent</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control soperator">
                                <option value="">Type of Search</option>
                                <option value="%">Like</option>
                                <option value="=">Exactly</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control sortBy">
                                <option value="">Sort By</option>
                                <option value="1">Voucher</option>
                                <option value="2">Date</option>
                                <option value="3">Customer/Agent</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control orderAs">
                                <option value="desc">Desc</option>
                                <option value="asc">Asc</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <input type="text" value="" class="form-control ssearch" placeholder="Search Here">
                        </div>
                        <div class="col-lg-2">
                            <input type="button" class="btn btn-primary sload" value="Search">
                        </div>
                    </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 class="table-responsive" style="max-height: 400px;overflow: auto;">
                        <table id="" class="table-striped table-condensed table-bordered" width="100%">
                            <thead>
                                <tr class="mySearchTr">
                                    <th style="width:8%">Voucher</th>
                                    <th style="width:10%">Date</th>
                                    <th style="width:42%">Customer / Agent</th>
                                    <th style="width:5%">Action</th>
                                </tr>
                            </thead>
                            <tbody class="sTbody">
                            </tbody>
                        </table>
                    </div>
                    <div class="row">
                        <div class="col-xs-12 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 class="modal-footer"></div>
            </div>
        </div>
    </div>
    <?php include("includes/linksfoot.php"); ?>
</body>

</html>