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

$maindb = 'felocmain';
$trandb = 'feloctran';
$printfile = "feprice_print.php";
$file = 'feloc.php';
$trandbexist = 1;
$keyfld = "vouchno";
$myyear = $_SESSION["tit_" . $dbname];
date_default_timezone_set('Asia/Kolkata');
$time = date('H:i:s');

$zroot = $_SESSION["zdbroot"];

$usertype = $_SESSION["usertype"];
$username = $_SESSION["username_" . $dbname];

$formname = 'Foreign Price Local';
include("includes/vouchno_generate.php");
include("includes/prev&next.php");

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$zyear = right($zdb, 4);
$zStartDate = getzdates($zyear, 'S');
$zEndDate = getzdates($zyear, 'E');
mysqli_select_db($conn, $zdb);

if (isset($_POST["submit"])) {


    $a = 1;
    $vouchdt = trim($_POST["vouchdt"]);
    $voucher = trim($_POST["voucher"]);
    $mono = trim($_POST["mon"]);
    $party = $_POST["party"];
    $roe = $_POST["roe"];
    $currency = $_POST["currency"];
    $count = $_POST["items"];

    if ($voucher <= 0) {
        browse("Voucher Cannot Be Empty");
        $a = 0;
    }

    if ($vouchdt <= 0) {
        browse("Voucher Cannot Be Empty");
        $a = 0;
    }

    if ($vouchdt == '0000-00-00') {
        browse("Voucher Cannot Be Empty");
        $a = 0;
    }

    if ($vouchdt == '') {
        browse("Voucher Cannot Be Empty");
        $a = 0;
    }


    if ($a == 1) {

        mysqli_query($conn, "LOCK TABLES $zroot.`$maindb` WRITE, $zroot.`$trandb` WRITE, `product` WRITE");

        if ($addflag == 1) {
            $gen1 = mysqli_query($conn, "SELECT MAX(vouchno+0) AS maxcode FROM $zroot.$maindb where vouchno != '' $keycond 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';
            }
            $time = strtotime($vouchdt);
            $month = date("m", $time);
            $intmonth = intval($month);
            if ($intmonth < 10) {
                $intmonth = '0' . $intmonth;
            }
            $voucher = $intmonth . $mvouch;
        }


        $mvouch = $qvouch;



//**************************************************    auto cash Entry End    *************************************** 
        mysqli_query($conn, "DELETE FROM $zroot.`$trandb` WHERE vouchno='$mvouch' ") or die(mysqli_error($conn));

        for ($i = 0; $i <= $count; $i++) {
            $cnt++;
            $msrno = $_POST["srno_$i"];
            $mbarcode = $_POST["barcode_$i"];
            $mitemcode = $_POST["itemcode_$i"];
            $hsncode = $_POST["hsncode_$i"];
            $gram = $_POST["gram_$i"];
            $mrp = $_POST["mrp_$i"];
            $price_dz = $_POST["price_dz_$i"];
            $discperc = $_POST["discperc_$i"];
            $discount = $_POST["discount_$i"];
            $price = $_POST["price_$i"];
            $ratefe = $_POST["ratefe_$i"];

            if (!empty($mbarcode) > 0) {
                mysqli_query($conn, "INSERT INTO $zroot.`$trandb`(`srno`, `vouchno`, `barcode`, `itemcode`, `hsncode`, 
                                                            `gram`, `mrp`, `price_dz`, `discperc`, `discamt`, `price`, `ratefe`)
                                                   VALUES('$cnt', '$mvouch', '$mbarcode', '$mitemcode', '$hsncode',
                                                             '$gram', '$mrp', '$price_dz', '$discperc', '$discount', '$price', '$ratefe')") or die(mysqli_error($conn));
            }
        }


        if ($addflag == 1) {
            mysqli_query($conn, "INSERT INTO $zroot.`$maindb`(`username`, vouchno, `vouchdt`, `voucher`, `party`, `roe`, `currency`, `monno`, `rem1`, `rem2`)
                                               VALUES('$username', '$mvouch', '$vouchdt', '$voucher', '$party', '$mono', '$roe', '$currency', '$rem1', '$rem2')") or die(mysqli_error($conn));
            insmess();
        } else {
            mysqli_query($conn, "UPDATE $zroot.`$maindb` SET  `vouchdt`='$vouchdt', `voucher`='$voucher', `party`='$party', `roe`='$roe', `currency`='$currency', `monno`='$mono', `rem1`='$rem1', `rem2`='$rem2'  WHERE `vouchno` = '$mvouch' ") or die(mysqli_error($conn));
            updmess();

            header("refresh: 1; $file?mode=last");
        }
        mysqli_query($conn, "UNLOCK TABLES");
    }
}

if ($addflag != 1) {

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

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

    $getparty = mysqli_query($conn, "SELECT `accode`,`name` FROM `accmast` WHERE `accode`= '$get[party]'") or die(mysqli_error($conn));
    $lparty = mysqli_fetch_array($getparty);
}

if (isset($_GET["delete"])) {
    mysqli_query($conn, "LOCK TABLES $zroot.`$maindb` WRITE, $zroot.`$trandb` WRITE")or die(mysqli_error($conn));

    $delcond = " source = '$source' and vouchno = '$_GET[vouchno]'";
    $delcond2 = " vouchno = '$_GET[vouchno]'";

    delnew($zroot, "$maindb", "$delcond2", "$file?mode=last");
    delnew($zroot, "$trandb", "$delcond2", "$file?mode=last");

    mysqli_query($conn, "UNLOCK TABLES");
}

include("includes/linkshead.php");
?>
<script src="MyScript/feloc.js?A=<?= mt_rand(); ?>" type="text/javascript"></script>
<script src="MyScript/search_item.js?A=<?= mt_rand(); ?>" type="text/javascript"></script>
<script src="MyScript/sale_ti_search.js" type="text/javascript"></script>
<script src="MyScript/checkdate.js" type="text/javascript"></script>

</head>
<body>
    <form action='' method='POST'>
        <div class="col-lg-3 pad text-center" id="overlay_form" style="display:none;z-index:999;">
            <button type="button" id="close_form" style="float: right;font-weight: bold;font-size: 18px;color:red;" ><i class="fa fa-close"></i></button>
            <div style='width:100%;' id='browdata'>
            </div>
        </div>
        <!-- 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" style="height:40px">
                        <div class="col-lg-10 col-md-10 col-sm-10  col-xs-10">
                            <h3 class="panel-title" style="color:#78909C"><a class="myPrint"><?php echo $formname; ?></a></h3>
                        </div>
                        <div class="col-lg-2 col-md-2 col-sm-2  col-xs-2">
                            <input type="date" value="<?= $zStartDate ?>" style="width: 1px;border: none" class="zstdate">
                            <input type="date" value="<?= $zEndDate ?>" style="width: 1px;border: none" class="zenddate">
                            <h4 class="panel-title" style="float:right"><b><?php echo $get['username'] ?></b></h4>
                        </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" style="color: #26A69A; font-weight: 600;">Voucher</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                <input type="text" name="voucher" class="form-control form voucher" value="<?php echo ($addflag != 1) ? $get['voucher'] : '' ?>" tabindex="-1" readonly required>
                                <input type="hidden" name="monno" class="form-control form monno" value="<?php echo ($addflag != 1) ? $get['monno'] : '' ?>" >
                                <input type="hidden" class="form-control addflag" value="<?php echo $addflag ?>" >
                                <input type="hidden" name="source" class="form-control form source" value="<?= $source; ?>" id="source">
                                <input type="hidden" name="vouchno" class="form-control form vouchno" id="vouchno" value="<?php echo ($addflag != 1) ? $get['vouchno'] : $qvouch ?>" >
                                <input type="hidden" class="form-control form" name="cashvouch" value="<?php Echo ($addflag != 1) ? $get["cashvouch"] : ""; ?>" >
                                <input type="hidden" class="form-control form canc_flag" name="" value="<?php Echo ($addflag != 1) ? $get["canc_flag"] : ""; ?>" >
                            </div>
                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg" style="color: #26A69A; font-weight: 600;">Date</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-1 col-xs-8 pad" style="width:10%">
                                <input type="date" class="form-control form vouchdt focusfield" name="vouchdt"  value="<?php Echo ($addflag != 1) ? $get["vouchdt"] : date("Y-m-d"); ?>" autofocus required>
                            </div>
                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg" style="color: #26A69A; font-weight: 600;">Currency</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                <input type="text"  class="form-control form currency" name="currency" value="<?php Echo ($addflag != 1) ? $get["currency"] : ""; ?>" >  
                            </div>

                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg" style="color: #26A69A; font-weight: 600;">R.O.E</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                <input type="text" name="roe" class="form-control form roe" value="<?php echo ($addflag != 1) ? $get['roe'] : '' ?>" >
                            </div>
                            <div class="col-lg-1 pad text-right">
                                <label class="label-control marg">Party</label>
                            </div>
                            <div class="col-lg-2 pad" style="width:20%">
                                <select class="form-control form cmbparty party select2" id="party" name="party" style="width: 100%" required>
                                    <option value="<?php Echo ($addflag != 1) ? $lparty["accode"] : ""; ?>"><?php Echo ($addflag != 1) ? $lparty["name"] : ""; ?></option>
                                    <?php
//                                    do not remove this condition.Talk to Fairoz Sir first.
//                                    if ($addflag == 1) {
                                    $gparty = mysqli_query($conn, "SELECT `accode`,`name` FROM `accmast` WHERE `grpcode`='010' order by name")or die(mysqli_error($conn));
                                    while ($tparty = mysqli_fetch_array($gparty)) {
                                        Echo "<option value='$tparty[accode]'>$tparty[name]</option>";
                                    }
//                                    }
                                    ?>
                                </select>
                            </div>

                        </div>
                    </div>
                    <div class="table-responsive">
                        <table class="table-striped table-condensed table-bordered" style="width: 100%">
                            <thead  class="mySearchTr">
                                <tr>
                                    <th style="width: 1%"></th>
                                    <th style="width: 2%">Sr.</th>
                                    <th style="width: 10%;">Barcode</th>
                                    <th style="width: 5%;display: none">Item code</th> 
                                    <th style="width: 20%;">Product Name</th> 
                                    <th style='width: 7%'>Hsncode</th>
                                    <th style='width: 8%'>Weight In Gms</th>
                                    <th style='width: 7%' class="text-right">Mrp</th>
                                    <th style='width: 7%' class="text-right">Price/DZ</th>
                                    <th style='width: 7%' class="text-right">Disc%</th>
                                    <th style='width: 7%' class="text-right">Discount</th>
                                    <th style='width: 7%' class="text-right">Price</th>
                                    <th style='width: 7%' class="text-right">Rate in F.E</th>
                                </tr>
                            </thead>
                            <tbody class="tbody">
                                <?php
                                if ($addflag != 1) {
                                    $qry = mysqli_query($conn, "SELECT * FROM $zroot.`$trandb` WHERE vouchno='$getvouch' ORDER BY srno") or die(mysqli_error($conn));
                                    $ctr = 0;
                                    while ($row = mysqli_fetch_array($qry)) {

                                        $gitemname = mysqli_query($conn, "SELECT `code`,`name` FROM `product` WHERE `prodcode`='$row[itemcode]'")or die(mysqli_error($conn));
                                        $fitemname = mysqli_fetch_array($gitemname);

                                        Echo "<tr>";
                                        Echo "<input type='hidden' name='itemcode_$ctr' class='itemcode form-control form' value='$geti[code]'>";
                                        Echo "<td><i class='fa fa-close remove' style='display:none;'></i></td>";
                                        Echo "<td><input type='text' name='srno_$ctr' class='srno form-control  form'  value='$row[srno]'></td>";
                                        Echo "<td>";
                                        Echo "<input type='text' name='barcode_$ctr' class='barcode form-control form' value='$row[barcode]' required>";
                                        Echo "</td>";
                                        Echo "<td  style='display:none' >";
                                        Echo "<input type='text' name='itemcode_$ctr' required='true' class='itemcode form-control  form' value='$row[itemcode]' readonly required>";
                                        Echo "</td>";
                                        Echo "<td>";
                                        Echo "<input type='text' name='itemname_$ctr' required='true' class='itemname form-control  form' value='$fitemname[name]' readonly required>";
                                        Echo "</td>";
                                        Echo "<td>";
                                        Echo "<input type='text' name='hsncode_$ctr' required='true' class='hsncode form-control  form' value='$row[hsncode]' readonly required>";
                                        Echo "</td>";
                                        Echo "<td><input type='text' name='gram_$ctr' class='gram form-control  form' value='$row[gram]' readonly></td>";
                                        Echo "<td><input type='text' name='mrp_$ctr' class='mrp form-control text-right  form' value='$row[mrp]' ></td>";
                                        Echo "<td><input type='text' name='price_dz_$ctr' class='price_dz text-right form-control   form' value='$row[price_dz]' ></td>";
                                        Echo "<td><input type='text' name='discperc_$ctr' class='discperc form-control text-right  form'  value='$row[discperc]' ></td>";
                                        Echo "<td><input type='text' name='discamt_$ctr' class='discamt discount  form-control text-right  form'  value='$row[discamt]' ></td>";
                                        Echo "<td><input type='text' name='price_$ctr' class='price form-control text-right  form' value='$row[price]' ></td>";
                                        Echo "<td><input type='text' name='ratefe_$ctr' class='ratefe form-control text-right form' value='$row[ratefe]' ></td>";
                                        $ctr++;
                                    }
                                } else {
                                    ?>
                                    <tr>                                    
                                        <td><i class='fa fa-close remove'></i></td>
                                        <td><input type='text' name='srno_0' class='srno form-control form' value='1'></td>
                                        <td><input type='text' name='barcode_0' class='barcode  form-control form' value='' required></td> 
                                        <td style="display:none">
                                            <input type='text' name='itemcode_0' required='true' class='itemcode form-control  form' value='' readonly required>
                                        </td>
                                        <td>
                                            <input type='text' name='itemname_0' required='true' class='itemname form-control  form' value='' readonly required>
                                        </td>
                                        <td>
                                            <input type='text' name='hsncode_0' required='true' class='hsncode form-control  form' value='' readonly required>
                                        </td>

                                        <td><input type='text' name='gram_0' class='gram form-control  form' value='' readonly></td>
                                        <td><input type='text' name='mrp_0' class='mrp text-right form-control   form' value='0' ></td>
                                        <td><input type='text' name='price_dz_0' class='rate price_dz text-right form-control   form' value='0' ></td>
                                        <td><input type='text' name='discperc_0' class='discperc text-right form-control   form' value='0' ></td>
                                        <td><input type='text' name='discamt_0' class='discount discamt text-right form-control   form' value='0' ></td>
                                        <td><input type='text' name='price_0' class='price text-right form-control   form' value='0' ></td>
                                        <td><input type='text' name='ratefe_0' class='ratefe text-right form-control   form' value='0' ></td>
                                    </tr>
                                    <?php
                                }
                                ?>
                            </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>
                        <input type="hidden" id="items" name="items" value="<?php Echo ($addflag != 1) ? $ctr : 1; ?>">  
                        <!--<input type="hidden" class="mandatoryId" name="manId" value="">-->  
                    </div>
                    <div class="col-lg-12 col-xs-12 pad">


                        <div class="col-lg-6 col-xs-12 pad">

                            <!--                            <div class="col-lg-12 col-xs-12 pad">
                                                            <div class="col-lg-3 pad text-right">
                                                                <label class="label-control marg">G.S.T NO.</label>
                                                            </div>
                                                            <div class="col-lg-4 pad">
                                                                <input type="text" name="gstno" class="form-control form gstno" value="<? Echo ($addflag != 1) ? $get["gstno"] : ""; ?>" tabindex="-1">
                                                            </div>
                                                        </div>-->
                            <div class="col-lg-12 col-xs-12 pad">
                                <div class="col-lg-3 pad text-right">
                                    <label class="label-control marg">Remarks</label>
                                </div>
                                <div class="col-lg-9 pad">
                                    <input type="text" name="remark1" class="form-control form " value="<? Echo ($addflag != 1) ? $get["rem1"] : ""; ?>">
                                </div>
                            </div>
                            <div class="col-lg-12 col-xs-12 pad">
                                <div class="col-lg-3 pad text-right"></div>
                                <div class="col-lg-9 pad">
                                    <input type="text" name="remark2" class="form-control form " value="<? Echo ($addflag != 1) ? $get["rem2"] : ""; ?>">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 pad">
            <div class="panel panel-default">
                <div class="panel-body">
                                         <?php include("includes/buttsale.php"); ?>

                </div>
            </div>
        </div>
    </div>
</div>
</form>

<div class="modal fade" id="cancmodel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="col-lg-11">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel">Cancel Bill</h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-lg-12 upload">
                            <form id="upload_form" method="post">

                                <div class="row pad">
                                    <input type="hidden" name="cancvouch" id="cancvouch" value='<?php Echo ($addflag != 1) ? $get['vouchno'] : "$qvouch"; ?>'>
                                    <input type="hidden" name="cashvouch2" id="cashvouch2" value='<?php Echo ($addflag != 1) ? $get['cashvouch'] : ""; ?>'>
                                    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-5 text-right">
                                        <label class="label-control marg">Cancel Date</label>
                                    </div>
                                    <div class="col-lg-4 col-md-4 col-sm-6 col-xs-7">

                                        <input type="date" name="cancdate" value="<?php Echo ($addflag != 1) ? $get['cancdate'] : ""; ?>" class="form-control cancdate">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-lg-6 col-md-6 col-sm-7 col-xs-8 text-right">
                                        <input type="submit" value="Cancel"  name="cancbtn" class="btn btn-square" style="background-color: #C0CA33; color: white">
                                    </div>
                                </div>

                            </form>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal fade itemModal" 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">
                <input type="hidden" value="<?php // Echo $fseries                                                                                ?>" class="form-control series">
                <input type="hidden" value="<?php Echo $get[vouchno]; ?>" class="form-control vouchno">
                <input type="hidden" value="<?php Echo $file ?>" class="form-control file">
                <input type="hidden" value="<?php Echo $para ?>" class="form-control para">
                <div class="row">
                    <div class="col-lg-3">
                        <select class="form-control ifield">
                            <option value="1">Name</option>
                            <option value="2">Barcode</option>
                            <option value="3">Itemcode</option>
                            <option value="4">Gram</option>
                            <option value="5">Unit</option>
                        </select>
                    </div>
                    <div class="col-lg-2">
                        <select class="form-control ioperator">
                            <option value=""></option>
                            <option value="%">Like</option>
                            <option value="=">Exactly</option>
                        </select>
                    </div>
                    <div class="col-lg-4">
                        <input type="text" value="" class="form-control isearch">
                    </div>
                    <div class="col-lg-3">
                        <input type="button" class="btn btn-primary iload" value="Search">
                    </div>
                </div>

                <div class="col-lg-12 iloader text-center">
                    <img src="images/search.gif" alt="loading">       
                </div>
                <div class="col-lg-12 inoRecord 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="8%">Itemcode</th>
                                <th width="49%">Name</th>
                                <th width="17%">Barcode</th>
                                <th width="8%">Gram</th>
                                <th width="8%">Unit</th>
                                <th width="8%">Rate</th>
                            </tr>
                        </thead>
                        <tbody class="iTbody">
                        </tbody>
                    </table>
                </div>
                <div class="row">
                    <div class="col-xs-12 text-right search-action-bar">
                        <input type="button"  class="btn btn-primary iprevious" value="Previous">
                        <input type="button"  class="btn btn-primary inext" value="Next">
                    </div>
                </div>
            </div>
            <div class="modal-footer"></div>
        </div>
    </div>
</div>
<div class="modal fade searchModal bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
    <div class="modal-dialog modal-lg" style="margin-top: 15%">
        <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">
                <input type="hidden" value="<?php Echo $fseries ?>" class="form-control series">
                <input type="hidden" value="<?php Echo $get['vouchno']; ?>" class="form-control vouchno">
                <input type="hidden" value="<?php Echo $file ?>" class="form-control file">
                <input type="hidden" value="<?php Echo $para ?>" class="form-control para">
                <div class="row">
                    <div class="col-lg-2">
                        <select class="form-control sfield">
                            <option value="1"> Party Name</option>
                            <option value="4">Voucher</option>
                            <option value="2">Invoice No.</option>
                            <option value="3">Date</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="4"> Party Name</option>
                            <option value="1">Voucher</option>
                            <option value="2">Invoice No.</option>
                            <option value="3">Date</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">
                    <img src="images/search.gif" alt="loading">       
                </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="5%">Voucher</th>
                                <th width="10%">Invoice No.</th>
                                <th width="15%">Date</th>
                                <th width="20%">Party Name</th>
                                <th width="10%">Mobile</th>
                                <th width="15%">Amount</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>
