<?php
ob_start();
//echo "1";
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');
//browse(1);
$maindb = 'slipmain';
$trandb = 'sliptran';
//$accdb = 'actran';
//$stkdb = 'transacn';
$printfile = "slip_print.php";
$file = 'slipent.php';
$trandbexist = 1;
//$source = "SLCC";
$keyfld = "vouchno";
$myyear = $_SESSION["tit_" . $dbname];
$zroot = $_SESSION["zdir"];

date_default_timezone_set('Asia/Kolkata');
$time = date("h:i A");
$date = date("Y-m-d");
$usertype = $_SESSION["usertype"];
$username = $_SESSION["username_" . $dbname];

$formname = 'Slip Entry';
$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);

$lcustcode = $laccode = $lname = "";
if ($usertype == 99) {
    $getparty2 = mysqli_query($conn, "SELECT `accode`,`name`,custcode FROM `accmast` WHERE `username`= '$username'") or die(mysqli_error($conn));
    $lparty2 = mysqli_fetch_array($getparty2);
    $lcustcode = $lparty2['custcode'];
    $laccode = $lparty2['accode'];
    $lname = $lparty2['name'];
    $keycond1 = " and custcode='$lcustcode'";
}

include("includes/vouchno_generate.php");
include("includes/prev&next.php");


if (isset($_POST["submit"])) {
//
    $a = 1;

    $vouchdt = trim($_POST["vouchdt"]);
    $qvouch = $_POST["vouchno"];
    $custvouch = $_POST["custvouch"];
    $voucher = trim($_POST["voucher"]);
    $mono = $_POST["monno"];
    $custcode = $_POST["custcode"];
    $vehicleno = $_POST["vehicleno"];
//    $shift = trim($_POST["shift"]);
//    $rtgs = trim($_POST["rtgs"]);
    $party = trim($_POST["owner"]);
    $otpdsrecv = trim($_POST["otpdsrecv"]);
    $subtotal = trim($_POST["subtotal"]);
    $totqty = trim($_POST["totqty"]);


    $invno = $_POST["invno"];
    $godown = $_POST["godown"];
    $addgst = $_POST["addgst"];
    $addpack = $_POST["addpack"];
    $debitac = $_POST["debitac"];
    $paidby = trim($_POST["paidby"]);
    $salesman = trim($_POST["salesman"]);
    $taxableamt = trim($_POST["taxableamt"]);
    $totbillamt = trim($_POST["totbillamt"]);
    $grossamt = trim($_POST["grossamt"]);
    $gstno = trim($_POST["gstno"]);
    $totdisc = trim($_POST["totdisc"]);
    $totvat = trim($_POST["totvat"]);
    $packby = trim($_POST["packby"]);
    $mobile = trim($_POST["mobile"]);
    $architect = trim($_POST["architect"]);
    $rem1 = trim($_POST["remark1"]);
    $rem2 = trim($_POST["remark2"]);
    $tvatperc = trim($_POST["tvatperc"]);
    $ldiscperc = trim($_POST["ldiscperc"]);
    $ntprint = trim($_POST["ntprint"]);

    $lrno = $_POST["lrno"];
    $lrdate = $_POST["lrdate"];
    $transporter = $_POST["transporter"];
    $area = $_POST["area"];
    $totadv = $_POST["totadv"];
    $totbal = $_POST["totbal"];

    $count = $_POST["items"];
    $mvouch = $qvouch;


    //browse($count);
    //    if ($paidby == "R") {
    //        $purcode = '15';
    //    } else {
//        $purcode = '14';
//    }

    $accode = $party;
    $grpcode = '010';

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

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


    if ($accode == "") {
        browse("Party Cannot Be Empty");
        $a = 0;
    }

    if ($a == 1) {
        mysqli_query($conn, "LOCK TABLES `$maindb` WRITE, `$trandb` WRITE, `product` WRITE, `$stkdb` WRITE, `$accdb` WRITE, `cashrecp` WRITE, `accmast` WRITE");

        if ($addflag == 1) {
            $gen1 = mysqli_query($conn, "SELECT MAX(vouchno+0) AS maxcode FROM `$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';
            }
            $mvouch = $qvouch;

            $genc = mysqli_query($conn, "SELECT MAX(custvouch) AS maxcode FROM `$maindb` where vouchno != '' $keycond $keycond1 LIMIT 0,1 ") or die(mysqli_error($conn));
            if (mysqli_num_rows($genc) > 0) {
                $vvouchc = mysqli_fetch_assoc($genc);
                $qvouchc = $vvouchc["maxcode"] + 1;
            } else {
                $qvouchc = '1';
            }
            $custvouch = $qvouchc;
        }
//**************************************************        auto cash Entry End    *************************************** 

        mysqli_query($conn, "DELETE FROM `$trandb` WHERE vouchno='$mvouch' ") or die(mysqli_error($conn));
        $cnt = 0;
        $cntamt = 0;

        for ($i = 0; $i <= $count; $i++) {
            $msrno = $_POST["srno_$i"];
            $mitem = mysqli_real_escape_string($conn, $_POST["prodname_$i"]);
            $qty = $_POST["qty_$i"];
            $unit = $_POST["unit_$i"];
            $rate = $_POST["rate_$i"];
            $amt = $_POST["amount_$i"];

            if (!empty($mitem)) {

                $cnt++;
                mysqli_query($conn, "INSERT INTO `$trandb`(vouchno, vouchdt, srno, product, qty, rate, unit, amount)
                                                    VALUES('$mvouch', '$vouchdt', '$cnt', '$mitem', '$qty', '$rate', '$unit', '$amt')") or die(mysqli_error($conn));
            }
        }

        if ($addflag == 1) {
            $newvoucher = $mono . $mvouch;

            mysqli_query($conn, "INSERT INTO `$maindb`(vouchno, `vouchdt`, `mono`, `custcode`, `vehicleno`, `party`,custvouch,otpdsrecv,totqty,subtotal,username, addtime,adddate,adduser)
                                      VALUES('$mvouch', '$vouchdt', '$mono', '$custcode', '$vehicleno', '$party','$custvouch','$otpdsrecv','$totqty','$subtotal','$username','$time','$date','$username')") or die(mysqli_error($conn));

//            $_SESSION['print_voucher'] = $mvouch;
        } else {

            mysqli_query($conn, "UPDATE `$maindb` SET  `vouchdt`='$vouchdt',  `mono`='$mono', `custcode`='$custcode', custvouch='$custvouch',totqty='$totqty',subtotal='$subtotal',  `vehicleno`='$vehicleno', `party`='$party'
                                 WHERE `vouchno` = '$mvouch' ") or die(mysqli_error($conn));
        }


        mysqli_query($conn, "UNLOCK TABLES");
        if ($addflag == 1) {
            insmess();
            header("refresh: 1; $file?mode=edit&$keyfld=$mvouch&form=$form");
        } else {
            updmess();
        }
    }
}


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);

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

    $delcsh = $get['cashvouch'];
}
//, `$stkdb` WRITE, `$accdb` WRITE, `cashrecp` WRITE(deletepart)
if (isset($_GET["delete"])) {
    mysqli_query($conn, "LOCK TABLES `$maindb` WRITE, `$trandb` WRITE")or die(mysqli_error($conn));

    $delcond = " source = '$source' and vouchno = '$_GET[vouchno]'";
    $delcond1 = " source = 'CR' and vouchno = '$delcsh'";
    $delcond3 = " vouchno = '$delcsh'  ";
    $delcond2 = " vouchno = '$_GET[vouchno]'";

    delnew($zdb, "$maindb", "$delcond2", "$file?mode=last");
    delnew($zdb, "$trandb", "$delcond2", "$file?mode=last");
//    delnew($zdb, "$stkdb", "$delcond", "$file?mode=last");
//    delnew($zdb, "$accdb", "$delcond", "$file?mode=last");
//    delnew($zdb, "$accdb", "$delcond1", "$file?mode=last");
//    delnew($zdb, "cashrecp", "$delcond3", "$file?mode=last");

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

include("includes/linkshead.php");
?>
<script src="MyScript/slipent.js?A=<?= mt_rand(); ?>" type="text/javascript"></script>
<!--<script src="MyScript/search_item_sale.js?A=<?= mt_rand(); ?>" type="text/javascript"></script>-->
<script src="MyScript/slipent_search.js" type="text/javascript"></script>
<script src="MyScript/checkdate.js" type="text/javascript"></script>
<!--<script>
    $(document).ready(function () {
      
    })
</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-12">
                            <h3 class="panel-title" style="color:black"><a class="myPrint"><?php echo $formname; ?></a></h3>
                        </div>
                        <div class="col-lg-2 col-md-2 col-sm-2 col-xs-12">

                            <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-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-2 col-sm-2 col-xs-2 pad">
                                <input type="hidden" name="otpdssend" id="otpdssend" class="form-control otpdssend">

                                <input type="text" name="custvouch" class="form-control form custvouch" value="<?php echo ($addflag != 1) ? $get['custvouch'] : '' ?>" tabindex="-1" readonly >
                                <input type="hidden" name="vouchno" class="form-control form vouchno" id="vouchno" readonly value="<?php echo ($addflag != 1) ? $get['vouchno'] : $qvouch ?>" >
                                <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" 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-1 col-sm-2 col-xs-3 text-right pad">
                                <label class="label-control marg" >Date</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-4 pad">
                                <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>

                        <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">A/C. Code</label>
                            </div>
                            <div class="col-lg-1 col-md-2 col-sm-4 col-xs-4  pad">
                                <input type="text" name="custcode" class="form-control form custcode" value="<?php echo ($addflag != 1) ? $get['custcode'] : "$lcustcode"; ?>">
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2  pad text-right">
                                <label class="label-control marg">Party</label>
                            </div>
                            <div class="col-lg-3 col-md-3 col-sm-7 col-xs-9  pad">
                                <select name="owner" class="form-control form  select2 owner party" required>
                                    <option value="<?php echo ($addflag != 1) ? $lparty['accode'] : "$laccode"; ?>"><?php echo ($addflag != 1) ? $lparty['name'] : "$lname"; ?></option>
                                    <?php
                                    if ($usertype != 99) {
                                        $getcust = mysqli_query($conn, "SELECT `accode`,`name` FROM `accmast` WHERE grpcode = '010' ") or die(mysqli_error($conn));
                                        while ($trow = mysqli_fetch_array($getcust)) {
                                            echo "<option value='$trow[accode]'>$trow[name]</option>";
                                        }
                                    }
                                    ?>
                                </select>
                            </div>
                        </div>

                        <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">Vehicle No.</label>
                            </div>
                            <div class="col-lg-1 col-md-2 col-sm-5 col-xs-5  pad">
                                <input list='vehicleno' name='vehicleno' class='vehicleno form-control form focusfield' value='<?php echo ($addflag != 1) ? $get['vehicleno'] : ""; ?>' >
                                <datalist id='vehicleno' char="#">
                                    <option value=''></option>
                                    <?php
                                    $gvehicleno = mysqli_query($conn, "SELECT vehicleno FROM `custvehicle` where accode='$laccode' group by vehicleno") or die(mysqli_error($conn));
                                    while ($tvehicleno = mysqli_fetch_array($gvehicleno)) {
                                        $vehicleno = $tvehicleno['vehicleno'];
                                        echo "<option value='$vehicleno'>";
                                    }
                                    ?>
                                </datalist>
                            </div>
                        </div>
                    </div>


                    <div class="table-responsive">
                        <table class="table-striped table-condensed table-bordered tab" width="100%">
                            <thead  class="mySearchTr">
                                <tr>
                                    <th style="width: 5%"></th>
                                    <th style="width: 5%" class="text-right">Sr.</th>
                                    <th style='width: 25%' class="text-left">Product Name</th>                                        
                                    <th style='width: 15%' class="text-right">Qty.</th>
                                    <th style='width: 15%' class="text-left">Unit</th>
                                    <th style='width: 15%' class="text-right">Rate</th>
                                    <th style='width: 20%' class="text-right">Amount</th>                                        

                                </tr>
                            </thead>
                            <tbody class="tbody">
                                <?php
                                if ($addflag != 1) {
                                    $qry = mysqli_query($conn, "SELECT * FROM `$trandb` WHERE vouchno='$getvouch' ORDER BY srno") or die(mysqli_error($conn));
                                    $ctr = 0;
                                    while ($row = mysqli_fetch_array($qry)) {
                                        $getitem = mysqli_query($conn, "SELECT code, name FROM `product` WHERE code = '$row[product]'") or die(mysqli_error($conn));
                                        $geti = mysqli_fetch_array($getitem);
                                        Echo "<tr>";
                                        Echo "<td><i class='fa fa-close remove' style='display:none;'></i></td>";
                                        Echo "<td><input type='text' name='srno_$ctr' class='srno text-right form-control  form'  value='$row[srno]'></td>";
                                        Echo "<td>";
                                        echo"<select name='prodname_$ctr' class='form-control form  select2 product' style='width:100%'>";
                                        Echo "<option value='$geti[code]'>$geti[name]</option>";
                                        $getp = mysqli_query($conn, "SELECT `code`,`name` FROM `product`") or die(mysqli_error($conn));
                                        while ($trow = mysqli_fetch_array($getp)) {
                                            echo "<option value='$trow[code]'>$trow[name]</option>";
                                        }
                                        echo"</select>";
                                        Echo "</td>";
                                        Echo "<td><input type='text' class='form-control form text-right qty'     name='qty_$ctr' value='$row[qty]'></td>";
                                        Echo "<td><input type='text' class='form-control form unit'               name='unit_$ctr'  value='$row[unit]'  readonly tabindex='-1'></td>";
                                        Echo "<td><input type='text' class='form-control form text-right rate'    name='rate_$ctr'  value='$row[rate]'  readonly tabindex='-1'></td>";
                                        Echo "<td><input type='text' class='form-control form text-right amount'  name='amount_$ctr'  value='$row[amount]'  readonly tabindex='-1'></td>";
                                        Echo "</tr>";
                                        $ctr++;
                                    }
                                } else {
                                    ?>
                                    <tr>                                    
                                        <td><i class='fa fa-close remove'></i></td>
                                        <td><input type='text' name='srno_0' class='srno text-right form-control form' value='1'></td>
                                        <td>

                                            <select name="prodname_0" class="form-control form  select2 product" style="width:100%" required>
                                                <option value=''></option>
                                                <?php
                                                $getp = mysqli_query($conn, "SELECT `code`,`name` FROM product ORDER BY name") or die(mysqli_error($conn));
                                                while ($trow = mysqli_fetch_array($getp)) {
                                                    echo "<option value='$trow[code]'>$trow[name]</option>";
                                                }
                                                ?>
                                            </select>
                                        </td>
                                        <td><input type='text' name='qty_0' class='qty text-right form-control form' value='0' ></td>
                                        <td><input type='text' name='unit_0' class='unit form-control form' value=''  readonly tabindex='-1'></td>
                                        <td><input type='text' name='rate_0' class='rate text-right form-control form' value='0'  readonly tabindex='-1'></td>
                                        <td><input type='text' name='amount_0' class='amount text-right form-control form' value='0'  readonly tabindex='-1'></td>
                                    </tr>
                                    <?php
                                }
                                ?>
                            <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>
<!--                            <input type="hidden" class="mandatoryId" name="manId" value="">  -->
                    </div>






                    <div class="row">
                        <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6">    
                            <input type="button" name="gendsotp" class="form-control gendsotp form" style="color:red;border: none;" value="Click to Generate OTP">
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right"><label class="label-control marg otplbl">OTP</label></div>
                        <div class="col-lg-2  col-md-4 col-sm-6 col-xs-6 ">
                            <input type="text" name="otpdsrecv" id="otpdsrecv" class="form-control form otpdsrecv" style="background-color: white;color: green;" readonly value="<?php Echo ($addflag != 1) ? $get['otpdsrecv'] : ""; ?>" maxlength="6">
                        </div>
                    </div>
                    <input type="hidden" name="otpdssucs" id="otpdssucs" class="form-control  otpdssucs">

                    <div class="col-lg-12 col-xs-12 pad">
                        <div class="col-lg-12 col-xs-12 pad">
                            <div class="col-lg-5 pad"></div>
                            <div class="col-lg-3  col-md-3 col-sm-3 col-xs-3 pad text-right">
                                <label class="label-control marg text-right">Total Qty.</label>
                            </div>
                            <div class="col-lg-1  col-md-1 col-sm-3 col-xs-3 pad">
                                <input type="number" step="any" name="totqty" class="form-control form text-right totqty" value="<?php Echo ($addflag != 1) ? $get['totqty'] : "0"; ?>" readonly>

                            </div>
                            <div class="col-lg-1  col-md-1 col-sm-3 col-xs-3 pad text-right">
                                <label class="label-control marg">Amount(Rs.)</label>
                            </div>
                            <div class="col-lg-2  col-md-2 col-sm-3 col-xs-3 pad">
                                <input type="number" step="any" name="subtotal" class="form-control form text-right subtotal" value="<?php Echo ($addflag != 1) ? $get['subtotal'] : "0"; ?>" readonly>    
                            </div>
                        </div>    


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

                            <?php
//                                        browse($get['canc_flag']);
                            if ($get['canc_flag'] != '') {
                                ?>
                                <img src="images/cancel.jpg" alt="Cancelled Bill" style="width:100%;height:100%">
                            <?php } ?>

                        </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/buttons.php"); ?>
                    <script>
                        $(document).ready(function () {

                            var usertype = <?= $usertype ?>;
                            if (usertype == 3) {
                                $("#hedit").hide();
                            }
                        });
                    </script>
                </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 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="S" class="form-control parasrch">
                <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">Vehicle No.</option>
                            <option value="4">Party Name</option>
                            <option value="5">Total Qty.</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">Vehicle No.</option>
                            <option value="4">Party Name</option>
                            <option value="5">Total Qty.</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="7%">Date</th>
                                <th width="10%">Vehicle No.</th>
                                <th width="26%">Party Name</th>
                                <th style="text-align: right" width="13%">Total Qty.</th>
                                <th style="text-align: right" width="13%">Subtotal</th>
                                <th width="8%">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>
