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

$formname = 'Rent Item Entry';
$maindb = 'rentmain';
$trandb = 'renttran';
// $stkdb = 'transacn';

$printfile = "rentitem_pdf.php";
$file = 'rentitem.php';
$trandbexist = 1;
$keyfld = "vouchno";
$source = "";

$fseries = $_SESSION["series_" . $dbname];
$keycond = " and `series`='$fseries'";

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

// $stkdb1 = 'tran';
// $zroot = $_SESSION["zdir"];
// $combstkdb = $stkdb1 . $myyear;

$zyear = right($zdb, 4);
$zStartDate = getzdates($zyear, 'S');
$zEndDate = getzdates($zyear, 'E');
//for adding entry and edit timings
$adduser = $_SESSION['username_' . $dbname];
date_default_timezone_set("Asia/Kolkata");
$adddate = date("Y-m-d");
$addtime = date("h:i:sa");
$rettime = date("h:i:sa");
$usertype = $_SESSION["usertype_" . $dbname];
//end

date_default_timezone_set("Asia/Calcutta");   //India time (GMT+5:30)


mysqli_select_db($conn, $zdb);
include("includes/vouchno_generate.php");
include("includes/prev&next.php");

if (isset($_POST["submit"])) {
    $a = 1;
    $vouchno = $_POST["vouchno"];
    $vouchdt = $_POST["vouchdt"];
    $formem = $_POST["formem"];
    $name = mysqli_real_escape_string($conn, $_POST['name']);
    $add1 = $_POST["add1"];
    $add2 = $_POST["add2"];
    $add3 = $_POST["add3"];
    $mob1 = $_POST["mob1"];
    $mob2 = $_POST["mob2"];
    $timespan = $_POST["timespan"];
    $remark1 = $_POST["remark1"];
    $remark2 = $_POST["remark2"];
    $totamt = $_POST["totamt"];
    $billamt = $_POST["billamt"];
    $retdate = $_POST["retdate"];
    $advance = $_POST["advance"];
    $bal = $_POST["bal"];
    $days = $_POST["days"];
    $count = $_POST["items"];
    $mvouch = $qvouch;
    
    $nwdate = date("Y-m-d",strtotime($vouchdt));

    if ($a == 1) {

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

        mysqli_query($conn, "DELETE FROM `$trandb` WHERE `$keyfld`='$mvouch' $keycond") or die(mysqli_error($conn));
        // mysqli_query($conn, "DELETE FROM `$stkdb` WHERE `$keyfld`='$mvouch' and `source`='$source' $keycond") or die(mysqli_error($conn));
        //        mysqli_query($conn, "DELETE FROM $zroot.$combstkdb WHERE `$keyfld`='$mvouch' AND `source`='$source' and `compcode`='$compcd'")or die(mysqli_error($conn));


        $srl = 0;
        for ($i = 0; $i < $count; $i++) {
            $srno = $_POST["srno_$i"];
            $itemname = $_POST["itemname_$i"];
            $trqty = $_POST["trqty_$i"];
            $rate = $_POST["rate_$i"];
            $amount = $_POST["amount_$i"];

            if (!empty($itemname)) {
                $srl++;
                mysqli_query($conn, "INSERT INTO `$trandb`(`srno`, series,  `vouchno`, `vouchdt`, `item`, `qty`, `rate`, `amount`)
                                        VALUES( '$srl', '$fseries', '$qvouch', '$vouchdt', '$itemname', '$trqty', '$rate', '$amount')") or die(mysqli_error($conn));

                ##########sTOCK pART########
                // mysqli_query($conn, "INSERT INTO `$stkdb`(`srno`, series, `compcode`, `yearno`, `vouchno`, `vouchdt`, `source`, `barcode`, `itemcode`,  `qty`, `unit`, `mrp`, `rate`, `amount`,color)
                //                         VALUES( '$srl', '$fseries', '$compcd', '$myyear', '$qvouch', '$vouchdt', '$source', '$barcode', '$item', '$trqty', '$unit', '$mrp', '$rate', '$amount','$color')") or die(mysqli_error($conn));

                //                ##########Combine Stock Part########
                //                mysqli_query($conn, "INSERT INTO $zroot.$combstkdb(`srno`, `compcode`, `yearno`, `vouchno`, `vouchdt`, `source`, `barcode`, `itemcode`,  `qty`, `unit`, `mrp`, `rate`, `amount`)
                //                                        VALUES( '$srl', '$compcd', '$myyear', '$qvouch', '$vouchdt', '$source', '$barcode', '$item', '$trqty', '$unit', '$mrp', '$rate', '$amount')") or die(mysqli_error($conn));
            }
        }

        #################################TRAN PART END #################################


        ############################## MAIN ######################################################
        if ($addflag == 1) {
            mysqli_query($conn, "INSERT INTO `$maindb`(`vouchno`, series, `date`, `vouchdt`,`formem`, `memcode` ,`name`, `add1`, `add2`,
             `add3`, `mob1`, `mob2`, `adduser`, `adddate`, `addtime`, `timespan`,`remark1`,`remark2`,`totamt`, `billamt`,`retdate`, `rettime`, `advance`, `bal`, `days`)
                                     VALUES ('$qvouch', '$fseries', '$nwdate', '$vouchdt',  '$formem', '$memcode',	'$name', '$add1' , '$add2', 
                                     '$add3','$mob1', '$mob2','$adduser','$adddate','$addtime', '$timespan', '$remark1', '$remark2'
                                     ,'$totamt', '$billamt', '$retdate' , '$rettime', '$advance', '$bal', '$days')") or die(mysqli_error($conn));
            insmess();
            $mvouch = $qvouch; //1
            header("refresh: 1; $file?$keyfld=$mvouch&mode=edit&series=$fseries");
        } else {
            $mvouch = $qvouch; //1
            $editdate = date("Y-m-d");
            $edittime = date("h:i:sa");

            mysqli_query($conn, "UPDATE `$maindb` SET `vouchdt`='$vouchdt', `date`='$nwdate',  `formem` = '$formem' ,	`memcode` = '$memcode', `name` = '$name', 
                                `add1` = '$add1' , `add2`='$add2', `add3`='$add3', `mob1`='$mob1', `mob2`='$mob2',`edituser`='$adduser',
                                `edittime`='$edittime',`editdate`='$editdate', `timespan`='$timespan' , `remark1`='$remark1'
                                ,`remark2`='$remark2' ,`totamt`='$totamt' ,`billamt`='$billamt',`retdate`='$retdate', `rettime`='$rettime',
                                 `advance`='$advance',`bal`='$bal', `days`='$days' WHERE `vouchno`= '$mvouch' $keycond") or die(mysqli_error($conn));
            updmess();
            header("refresh: 1; $file?$keyfld=$mvouch&mode=edit&series=$fseries");
        }
    }
}

if ($addflag != 1) {

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

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

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

if (isset($_GET["delete"])) {
    //    delete($zdb, "$maindb", "$keyfld", $_GET[$keyfld], "$file?mode=last");
    //    delete($zdb, "$trandb", "$keyfld", $_GET[$keyfld], "$file?mode=last");
    $delcondn = " vouchno = '$_GET[vouchno]' $keycond";
    $delcond = " source = '$source' and vouchno = '$_GET[vouchno]' $keycond";
    delnew($zdb, "$maindb", "$delcondn", "$file?mode=last&series=$fseries");
    delnew($zdb, "$trandb", "$delcondn", "$file?mode=last&series=$fseries");
    delnew($zdb, "$stkdb", "$delcond", "$file?mode=last&series=$fseries");
}

include("includes/linkshead.php");
?>
<script src="MyScript/rentitem.js" type="text/javascript"></script>
<script src="MyScript/rentitem_search.js" type="text/javascript"></script>
<script src="MyScript/checkdate.js" type="text/javascript"></script>
</head>

<body>

    <form action='' method='POST'>
        <!-- Default box -->
        <div>
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12  pad">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <?php include("includes/usermention.php");
                        ?>
                        <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-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Voucher</label>
                            </div>
                            <div class="col-lg-1 col-md-2 col-sm-8 col-xs-8 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-3 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Date</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-8 col-xs-8 pad">
                                <input type="datetime-local" name="vouchdt" class="form-control  form vouchdt" value="<?php echo ($addflag != 1) ? $get["vouchdt"] : date("Y-m-d h:i:sa"); ?>">
                                <input type="hidden" value="<?= $zStartDate ?>" class="zstdate">
                                <input type="hidden" value="<?= $zEndDate ?>" class="zenddate">
                            </div>
                            <div class="col-lg-1 col-md-5 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control text-size marg">Received Date</label>
                            </div>
                            <div class="col-lg-2 col-md-1 col-sm-8 col-xs-8 pad">
                                <input type="datetime-local" class="form-control form retdate" name="retdate" value="<?php echo ($addflag != 1) ? $get["retdate"] : date('Y-m-d'); ?>">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">For</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-8 col-xs-8 pad">
                                <select class="select2 form-control form formem" name="formem" id="formem">
                                    <option value="<?php echo ($addflag != 1) ? $get['formem'] : ""; ?>"><?php echo ($addflag != 1) ? $get['formem'] : ""; ?></option>
                                    <option value=""></option>
                                    <option value="Member">Member</option>
                                    <option value="Non-Member">Non-Member</option>
                                </select>
                            </div>
                            <?php
                            $vis = "";
                            if ($get['formem'] != 'Member') {
                                $vis = "style ='display:none'";
                            } ?>
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right hidemem pad" <?= $vis ?>>
                                <label class="label-control marg">Member Code</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-8 col-xs-8 hidemem pad" <?= $vis ?>>
                                <input type="text" class="form-control form memcode" name="memcode" value="<?php echo ($addflag != 1) ? $get['memcode'] : ""; ?>">
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Name</label>
                            </div>
                            <div class="col-lg-3 col-md-1 col-sm-8 col-xs-8 pad">
                            <?php
                            $col = "";
                            if ($get['formem'] != 'Member') {
                                $col = "style ='color:blue'";
                            } ?> 
                                <input type="text" class="form-control form name" name="name" <?= $col ?> value="<?php echo ($addflag != 1) ? $get['name'] : ""; ?>">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Address</label>
                            </div>
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="text" name="add1" id="add1" class="form-control form add1" value="<? echo ($addflag != 1) ? $get["add1"] : ""; ?>">
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Mobile</label>
                            </div>
                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="text" name="mob1" class="form-control form mob1" value="<? echo ($addflag != 1) ? $get["mob1"] : ""; ?>">
                            </div>                            
                        </div>
                        <div class="row">
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg"></label>
                            </div>
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="text" name="add2" id="add2" class="form-control form add2" value="<? echo ($addflag != 1) ? $get["add2"] : ""; ?>">
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Alternate Number</label>
                            </div>
                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="text" name="mob2" class="form-control form mob2" value="<? echo ($addflag != 1) ? $get["mob2"] : ""; ?>">
                            </div>
                            <div class="col-lg-2 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">No. of Days</label>
                            </div>
                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="text" name="days" class="form-control text-right form days" value="<? echo ($addflag != 1) ? $get["days"] : ""; ?>">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg"></label>
                            </div>
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="text" name="add3" id="add3" class="form-control form add3" value="<? echo ($addflag != 1) ? $get["add3"] : ""; ?>">
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Time Span</label>
                            </div>
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="text" placeholder="Rent Period" name="timespan" class="form-control form timespan" value="<? echo ($addflag != 1) ? $get["timespan"] : ""; ?>">
                            </div>
                            <div class="col-lg-1 col-md-5 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control text-size marg">Total Amount</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control text-right form billamt" id="billamt" name="billamt" value="<?php echo ($addflag != 1) ? $get['billamt'] : ""; ?>" readonly>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control text-size marg">Remark</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form remark1" name="remark1" value="<?php echo ($addflag != 1) ? $get["remark1"] : ""; ?>">
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Advance</label>
                            </div>
                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="text" name="advance" class="form-control text-right form advance" value="<? echo ($addflag != 1) ? $get["advance"] : ""; ?>">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control text-size marg"></label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-8 col-xs-8 pad">
                            <input type="text" class="form-control form remark2" name="remark2" value="<?php echo ($addflag != 1) ? $get["remark2"] : ""; ?>">
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Balance</label>
                            </div>
                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="text" name="bal" class="form-control form text-right bal" value="<? echo ($addflag != 1) ? $get["bal"] : ""; ?>">
                            </div>
                        </div>

                        <div class="table-responsive">
                            <table class="table table-striped table-condensed table-bordered table-padd" width="100%">
                                <thead class="mySearchTr">
                                    <tr>
                                        <th width="2%"></th>
                                        <th width="3%" class='text-right'>Sr.</th>
                                        <th width="20%">Itemname</th>
                                        <th width="11%" class='text-right'>Qty.</th>
                                        <th width="10%" class='text-right'>Rate</th>
                                        <th width="10%" class='text-right'>Amount</th>
                                    </tr>
                                </thead>
                                <tbody class="tbody">
                                    <?php
                                    if ($addflag != 1) {
                                        $ctr = 0;
                                        $tqty = 0;
                                        $tamt = 0;
                                        $trate = 0;
                                        $gettran = mysqli_query($conn, "SELECT * FROM `$trandb` WHERE `vouchno`='$get[vouchno]' $keycond ORDER BY `srno`") or die(mysqli_error($conn));
                                        while ($tran = mysqli_fetch_array($gettran)) {
                                            $getitem1 = mysqli_query($conn, "SELECT * FROM `rentitems` WHERE `code`='$tran[item]' ") or die(mysqli_error($conn));
                                            $fitem = mysqli_fetch_array($getitem1);
                                            echo "<tr>";
                                            echo "<td><i class='fa fa-close remove' style='display:none;'></i></td>";
                                            echo "<td><input type='text' class='form-control form text-right srno'  name='srno_$ctr'        value='$tran[srno]'></td>";
                                            echo "<td>";
                                            echo "<select class='form-control form select2 itemname' name='itemname_$ctr' style='width:100%'>";
                                            echo "<option value='$fitem[code]'>$fitem[name]</option>";
                                            $gitem = mysqli_query($conn, 'SELECT * FROM `rentitems` order by name') or die(mysqli_error($conn));
                                            while ($item = mysqli_fetch_array($gitem)) {
                                                echo "<option value='$item[code]'>$item[name]</option>";
                                            }
                                            echo "</select>";
                                            echo "</td>";
                                            echo "<td><input type='text' class='form-control form text-right trqty'  name='trqty_$ctr' value='$tran[qty]'>  </td>";
                                            echo "<td><input type='text' class='form-control form text-right rate'   name='rate_$ctr'        value='$tran[rate]'>   </td>";
                                            echo "<td><input type='text' class='form-control form text-right amount' name='amount_$ctr'      value='$tran[amount]'> </td>";
                                            echo "</tr >";
                                            $ctr++;
                                            $tqty = $tqty + $tran['qty'];
                                            $tamt = $tamt + $tran['amount'];
                                        }
                                    } else {
                                        $pctr = 0;
                                    ?>
                                        <tr>
                                            <td><i class="fa fa-close remove"></i></td>
                                            <td><input type="text" class="form-control form text-right srno" name="srno_<?= $pctr ?>" value="1"></td>
                                            <td>
                                                <select name="itemname_<?= $pctr ?>" class="form-control form  itemname" style="width: 100%">
                                                    <option value=""></option>
                                                    <?
                                                    $getitem = mysqli_query($conn, "SELECT * FROM `rentitems` ORDER BY name") or die(mysqli_error($conn));
                                                    while ($item1 = mysqli_fetch_array($getitem)) {
                                                        echo "<option value='$item1[code]'>$item1[name]</option>";
                                                    }
                                                    ?>
                                                </select>
                                            </td>
                                            <td><input type="text" class="form-control form text-right trqty" name="trqty_<?= $pctr ?>" value=""></td>
                                            <td><input type="text" class="form-control form text-right rate" name="rate_<?= $pctr ?>" value=""></td>
                                            <td><input type="text" class="form-control form text-right amount" name="amount_<?= $pctr ?>" value="" readonly></td>
                                        </tr>
                                    <?php
                                    }
                                    $pctr++;
                                    ?>
                                </tbody>
                            </table>
                        </div>

                        <div class="row">
                            <div class="col-lg-1">
                                <button type="button" class="btn btn-square form" style="background-color: #78909C" id="addnew">
                                    <i class="fa fa-plus" style="color:#ffffff" data-toggle='tooltip' title='Add Row'></i>
                                </button>
                                <input type="hidden" id="items" name="items" value="<?php echo ($addflag != 1) ? $ctr : $pctr; ?>" />
                            </div>
                        </div>
                    </div>
                    <div class="row">
                    <div class="col-lg-9 col-md-5 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control text-size marg">Bill Amount</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form text-right totamt" name="totamt" value="<?php echo ($addflag != 1) ? $get['totamt']  : ""; ?>" readonly>
                            </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12 col-md-5 col-sm-9 col-xs-9 pad">
                <?php include("includes/buttons.php"); ?>
            </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">Name</option>
                                <option value="4">Address</option>
                                <option value="5">Mobile</option>
                                <option value="6">Amount</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">Name</option>
                                <option value="4">Address</option>
                                <option value="5">Mobile</option>
                                <option value="6">Amount</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 table-striped table-condensed table-bordered" width="100%">
                            <thead>
                                <tr class="mySearchTr">
                                    <th width="10%">Voucher</th>
                                    <th width="10%">Date</th>
                                    <th width="10%">Name</th>
                                    <th width="10%">Address</th>
                                    <th width="10%">Mobile</th>
                                    <th width="10%">Amount</th>
                                    <th 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>