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

$formname = 'Sale Others';
$maindb = 'slotmain';
$trandb = 'slottran';
$accdb = 'actran';
$printfile = "saleoth_print.php";
$file = 'saleoth.php';
$trandbexist = 1;
$keyfld = "vouchno";

$source = "SLO";

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

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

if (isset($_POST["submit"])) {
    $vouchdt = trim($_POST["vouchdt"]);
    $invdate = trim($_POST["invdate"]);
    $voucher = trim($_POST["voucher"]);
    $party = trim($_POST["party"]);
    $mono = $_POST["monno"];
    $godown = trim($_POST["godown"]);
    $gsttype = trim($_POST["gsttype"]);
    $rem1 = trim($_POST["remark1"]);
    $rem2 = trim($_POST["remark2"]);
    $grossamt = trim($_POST["grossamt"]);
    $discperc = trim($_POST["discperc"]);
    $totdiscamt = trim($_POST["totdiscamt"]);
    $cgstrate = trim($_POST["cgstrate"]);
    $cgstamt = trim($_POST["cgstamt"]);
    $sgstrate = trim($_POST["sgstrate"]);
    $sgstamt = trim($_POST["sgstamt"]);
    $igstrate = trim($_POST["igstrate"]);
    $igstamt = trim($_POST["igstamt"]);
    $taxableamt = trim($_POST["taxableamt"]);
    $roundoff = trim($_POST["roundoff"]);
    $totbillamt = trim($_POST["totbillamt"]);
    $oms = $_POST['oms'];

    $count = $_POST["items"];

    $mvouch = $qvouch;

//    $gstamount = $totbillamt - $taxableamt;
    $gstamount = $cgstamt + $sgstamt + $igstamt;

    $salecode = 30;
    $a = 1;

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

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


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

        mysqli_query($conn, "DELETE FROM `$trandb` WHERE `$keyfld`='$mvouch'") or die(mysqli_error($conn));
//        mysqli_query($conn, "DELETE FROM `$stkdb` WHERE `$keyfld`='$mvouch' AND `source`='$source'")or die(mysqli_error($conn));
        $group = $source . $mvouch;
        $srl = 0;
        for ($i = 0; $i < $count; $i++) {
            $msrno = $_POST["srno_$i"];
            $descrip = $_POST["descrip_$i"];
            $amount = $_POST["amount_$i"];

            if (!empty($descrip)) {
                $srl = $srl + 1;

                mysqli_query($conn, "INSERT INTO `$trandb`(`vouchno`, `vouchdt`, `srno`, `descrip`, `amount`) 
                    VALUES ('$qvouch', '$vouchdt', '$srl', '$descrip', '$amount')") or die(mysqli_error($conn));
            }
        }

############################## Accounts Part ######################################################
        mysqli_query($conn, "DELETE FROM `$accdb` WHERE `vouchno` = '$mvouch' AND `source` = '$source' ") OR die(mysqli_error($conn));
        if ($totbillamt > 0) {
            $minus_amt = ($totbillamt * -1);

            // sale part
            mysqli_query($conn, "INSERT INTO `$accdb`(date, vouchno,`godown`, source, trnno, accode, grpcode, amount, monno)
                            VALUES ('$vouchdt','$mvouch','$godown', '$source', '001', '$salecode','005', '$taxableamt','$mono')") or die(mysqli_error($conn));

            mysqli_query($conn, "INSERT INTO `$accdb`(date, vouchno,`godown`, source, trnno, accode, grpcode, amount, monno)
                            VALUES ('$vouchdt','$mvouch','$godown', '$source', '003', '5','020', '$gstamount','$mono')") or die(mysqli_error($conn));
            
            //            round off part
            mysqli_query($conn, "INSERT INTO `$accdb`(date, vouchno,`godown`, source, trnno, accode, grpcode, amount, monno)
                            VALUES ('$vouchdt','$mvouch','$godown', '$source', '004', '25','012', '$roundoff','$mono')") or die(mysqli_error($conn));

            // party part
            mysqli_query($conn, "INSERT INTO `$accdb`(date, vouchno, `godown`, source, trnno, accode, grpcode, amount, monno)
                                VALUES ('$vouchdt','$mvouch','$godown', '$source', '002', '$party','010', '$minus_amt','$mono')") or die(mysqli_error($conn));
        }


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

            mysqli_query($conn, "INSERT INTO `$maindb`(vouchno, `vouchdt`, `voucher`, `invno`, `invdate`,`monno`, `party`, `oms`, 
                                               `rem1`, `rem2`, `discamt`,`grossamt`, `godown`,
                                               `taxableamt`, `gsttype`, `discperc`, `cgstrate`, `cgstamt`, `sgstrate`,`sgstamt`, 
                                               `igstrate`,`igstamt`, `salecode`, `billamt`,roundoff)
                                      VALUES('$mvouch', '$vouchdt', '$newvoucher', '$mvouch', '$invdate','$mono', '$party', '$oms',
                                              '$rem1', '$rem2', '$totdiscamt','$grossamt', '$godown', 
                                              '$taxableamt', '$gsttype', '$discperc', '$cgstrate','$cgstamt', '$sgstrate', '$sgstamt', 
                                              '$igstrate' ,'$igstamt','$salecode','$totbillamt','$roundoff')") or die(mysqli_error($conn));
            insmess();
            $mvouch = $qvouch; //1
            header("refresh: 1; $file?$keyfld=$mvouch&mode=edit");
        } else {
            $mvouch = $qvouch; //1

            mysqli_query($conn, "UPDATE `$maindb` SET  `vouchdt`='$vouchdt', `invno`='$mvouch', `invdate`='$invdate',`monno`='$mono', `party`='$party',
                                               `rem1`='$rem1', `rem2`='$rem2', `discamt`='$totdiscamt',`grossamt`='$grossamt',roundoff='$roundoff',
                                               `godown`='$godown', `taxableamt`='$taxableamt', `gsttype`='$gsttype', `discperc`='$discperc',
                                               `cgstrate`='$cgstrate',`cgstamt`='$cgstamt',`sgstrate`='$sgstrate',`sgstamt`='$sgstamt',
                                               `igstrate`='$igstrate', `igstamt`='$igstamt', `billamt`='$totbillamt' WHERE `vouchno` = '$mvouch' ") or die(mysqli_error($conn));
            updmess();

            header("refresh: 1; $file?$keyfld=$mvouch&mode=edit");
        }
    }
}

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

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

    $getgst = mysqli_query($conn, "SELECT * FROM `gsttype` WHERE per='$get[gsttype]'") or die(mysqli_error($conn));
    $fetgst = mysqli_fetch_array($getgst);

    $getgodown = mysqli_query($conn, "SELECT * FROM `godown` WHERE `code`= '$get[godown]'") or die(mysqli_error($conn));
    $getgd = mysqli_fetch_array($getgodown);
}

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

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

include("includes/linkshead.php");
?>
<script src="MyScript/saleoth.js" type="text/javascript"></script>
<script src="MyScript/saleoth_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">   
                        <input type="date" value="<?= $zStartDate ?>" style="width: 1px;border: none" class="zstdate">
                        <input type="date" value="<?= $zEndDate ?>" style="width: 1px;border: none" class="zenddate">

                        <h3 class="panel-title" style="color:#1ABC9C"><?php Echo $formname; ?></h3>
                    </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-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>
                                <input type="hidden" name="monno" class="form-control form monno" value="<?php echo ($addflag != 1) ? $get['monno'] : '' ?>" >
                                <input type="hidden" name="vouchno" class="form-control form vouchno" value="<?php echo ($addflag != 1) ? $get['vouchno'] : $qvouch ?>" >
                            </div>
                            <div class="col-lg-1 col-md-3 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-1 col-xs-8 pad">
                                <input type="date" class="form-control form vouchdt" name="vouchdt"  value="<?php Echo ($addflag != 1) ? $get["vouchdt"] : date("Y-m-d"); ?>" autofocus>
                            </div>
                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Oms</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad" tabindex="-1">
                                <input type="checkbox"  class="form-control form oms" <?php
                                if ($get[oms] == "1") {
                                    Echo "checked";
                                }
                                ?> value="1" name="oms" style="background-color: yellowgreen; ">                            
                            </div>
                            <div class="col-lg-1 pad text-right">
                                <label class="label-control marg">Party</label>
                            </div>
                            <div class="col-lg-3 pad">
                                <select class="form-control form cmbparty select2" 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 ($party = mysqli_fetch_array($gparty)) {
                                            Echo "<option value='$party[accode]'>$party[name]</option>";
                                        }
                                    }
                                    ?>
                                </select>
                            </div>
                        </div>
                        <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">Godown</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                <select name="godown" class="form-control form godown select2">
                                    <option value="<?php echo ($addflag != 1) ? $getgd['code'] : " "; ?>"><?php echo ($addflag != 1) ? $getgd['gcode'] : " "; ?></option>
                                    <?php
                                    $mown = mysqli_query($conn, "SELECT * FROM `godown`") or die(mysqli_error($conn));
                                    while ($trow = mysqli_fetch_array($mown)) {
                                        echo "<option value=$trow[code]>$trow[gcode]</option>";
                                    }
                                    ?>
                                </select>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 numeric text-right pad">
                                <label class="label-control marg">GST %</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                <select class="form-control form select2 gstperc" name="gsttype" style="width:100%" required>
                                    <option value="<?php echo ($addflag != 1) ? $fetgst['per'] : ""; ?>"><? echo ($addflag != 1) ? $fetgst['name'] : ""; ?></option>
                                    <?php
                                    $ggsttype = mysqli_query($conn, "SELECT * FROM `gsttype` order by per")or die(mysqli_error($conn));
                                    while ($fgsttype = mysqli_fetch_object($ggsttype)) {
                                        Echo "<option value='$fgsttype->per'>$fgsttype->name</option>";
                                    }
                                    ?>
                                </select>
                            </div>
                        </div>
                        <div class="table-responsive">
                            <table class="table table-striped table-condensed table-bordered" width="100%">
                                <thead  class="mySearchTr">
                                    <tr>
                                        <th width="5%"></th>
                                        <th width="5%" class='text-right'>Sr.</th>
                                        <th width="70%" class='text-left'>Description</th>
                                        <th width="20%" class='text-right'>Amount</th>
                                    </tr>
                                </thead>
                                <tbody class="tbody">
                                    <?php
                                    if ($addflag != 1) {
                                        $ctr = 0;
                                        $gettran = mysqli_query($conn, "SELECT * FROM `$trandb` WHERE `vouchno`='$get[vouchno]' ORDER BY `srno`")or die(mysqli_error($conn));
                                        while ($tran = mysqli_fetch_array($gettran)) {
                                            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 "<input type='text' class='form-control form descrip' name='descrip_$ctr' value='$tran[descrip]'>";
                                            Echo "</td>";
                                            Echo "<td>";
                                            Echo "<input type='number' step='any' class='form-control text-right form amount' name='amount_$ctr' value='$tran[amount]'>";
                                            Echo "</td>";
                                            Echo "</tr >";
                                            $ctr++;
                                        }
                                    } else {
                                        ?>
                                        <tr>
                                            <td><i class="fa fa-close remove"></i></td>
                                            <td><input type="text" class="form-control form text-right srno" name="srno_0" value="1"></td>
                                            <td><input type="text" class="form-control form itemcode barcode" name="descrip_0" name="descrip" required></td>
                                            <td><input type='number' step='any' class="form-control form text-right amount"   name="amount_0"      value="0"></td>
                                        </tr>  
                                        <?
                                    }
                                    ?>
                                </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; ?>" />  
                        </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">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 class="col-lg-6 col-xs-12 pad">
                                <div class="col-lg-12 col-xs-12 pad">
                                    <div class="col-lg-3 pad"></div>
                                    <div class="col-lg-3 pad"></div>
                                    <div class="col-lg-3 pad text-right">
                                        <label class="label-control marg">Subtotal</label>
                                    </div>
                                    <div class="col-lg-3 pad">
                                        <input type="number" step="any" name="grossamt" class="form-control form text-right grossamt" value="<?php Echo ($addflag != 1) ? $get['grossamt'] : "0"; ?>" readonly >
                                    </div>
                                </div>
                                <div class="col-lg-12 col-xs-12 pad">
                                    <div class="col-lg-3 pad"></div>
                                    <div class="col-lg-3 pad text-right">
                                        <label class="label-control marg">Discount</label>
                                    </div>
                                    <div class="col-lg-2 pad text-right">
                                        <input type="number" step="any" name="discperc" class="form-control form text-right discperc" value="<?php Echo ($addflag != 1) ? $get['discperc'] : "0"; ?>"  >
                                    </div>
                                    <div class="col-lg-1 pad">
                                        <label class="label-control marg">%</label>
                                    </div>
                                    <div class="col-lg-3 pad">
                                        <input type="number" step="any" name="totdiscamt" class="form-control form text-right totdiscamt" value="<?php Echo ($addflag != 1) ? $get['discamt'] : "0"; ?>"  readonly>
                                    </div>
                                </div>
                                <div class="col-lg-12 col-xs-12 pad">
                                    <div class="col-lg-3 pad"></div>
                                    <div class="col-lg-3 pad"></div>
                                    <div class="col-lg-3 pad text-right">
                                        <label class="label-control marg">Taxable Amount</label>
                                    </div>
                                    <div class="col-lg-3 pad">
                                        <input type="number" step="any" name="taxableamt" class="form-control form text-right taxableamt" value="<?php Echo ($addflag != 1) ? $get['taxableamt'] : "0"; ?>" readonly >
                                    </div>
                                </div>
                                <div class="col-lg-12 col-xs-12 pad">
                                    <div class="col-lg-5 pad"></div>
                                    <div class="col-lg-1 pad">
                                        <label class="label-control marg">CGST</label>                                        
                                    </div>
                                    <div class="col-lg-2 pad text-right">
                                        <input type="number" step="any" name="cgstrate" class="form-control form text-right cgstperc" value="<?php Echo ($addflag != 1) ? $get['cgstrate'] : "0"; ?>"  >
                                    </div>
                                    <div class="col-lg-1 pad">
                                        <label class="label-control marg">%</label>
                                    </div>
                                    <div class="col-lg-3 pad">
                                        <input type="number" step="any" name="cgstamt" class="form-control form text-right cgstamt" value="<?php Echo ($addflag != 1) ? $get['cgstamt'] : "0"; ?>" readonly >
                                    </div>
                                </div>
                                <div class="col-lg-12 col-xs-12 pad">
                                    <div class="col-lg-5 pad"></div>
                                    <div class="col-lg-1 pad">
                                        <label class="label-control marg">SGST</label>                                        
                                    </div>
                                    <div class="col-lg-2 pad text-right">
                                        <input type="number" step="any" name="sgstrate" class="form-control form text-right sgstperc" value="<?php Echo ($addflag != 1) ? $get['sgstrate'] : "0"; ?>"  >

                                    </div>
                                    <div class="col-lg-1 pad">
                                        <label class="label-control marg">%</label>
                                    </div>
                                    <div class="col-lg-3 pad">
                                        <input type="number" step="any" name="sgstamt" class="form-control form text-right sgstamt" value="<?php Echo ($addflag != 1) ? $get['sgstamt'] : "0"; ?>" readonly >
                                    </div>
                                </div>
                                <div class="col-lg-12 col-xs-12 pad">
                                    <div class="col-lg-5 pad"></div>
                                    <div class="col-lg-1 pad text-right">
                                        <label class="label-control marg">IGST</label>
                                    </div>
                                    <div class="col-lg-2 pad">
                                        <input type="number" step="any" name="igstrate" class="form-control form text-right igstperc" value="<?php Echo ($addflag != 1) ? $get['igstrate'] : "0"; ?>"  >
                                    </div>
                                    <div class="col-lg-1 pad">
                                        <label class="label-control marg">%</label>
                                    </div>
                                    <div class="col-lg-3 pad">
                                        <input type="number" step="any" name="igstamt" class="form-control form text-right igstamt" value="<?php Echo ($addflag != 1) ? $get['igstamt'] : "0"; ?>" readonly >
                                    </div>
                                </div>
                                <div class="col-lg-12 col-xs-12 pad">
                                    <div class="col-lg-3 pad"></div>
                                    <div class="col-lg-3 pad"></div>
                                    <div class="col-lg-3 pad text-right">
                                        <label class="label-control marg">Round Off</label>
                                    </div>
                                    <div class="col-lg-3 pad">
                                        <input type="number" step="any" name="roundoff"  class="form-control form text-right roundoff" value="<?php echo ($addflag != 1) ? $get['roundoff'] : "0"; ?>" tabindex="-1">
                                    </div>
                                </div>
                                <div class="col-lg-12 col-xs-12 pad">
                                    <div class="col-lg-3 pad"></div>
                                    <div class="col-lg-3 pad"></div>
                                    <div class="col-lg-3 pad text-right">
                                        <label class="label-control marg">Net Amount</label>
                                    </div>
                                    <div class="col-lg-3 pad">
                                        <!--<input type="text"  name="totbillamt" required="true" class="form-control form text-right totbillamt" value="<?php Echo ($addflag != 1) ? $get['billamt'] : "0"; ?>" readonly tabindex="-1">-->
                                        <input type="number" step="any" name="totbillamt" class="form-control form text-right totbillamt" value="<?php Echo ($addflag != 1) ? $get['billamt'] : "0"; ?>" readonly >
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="panel panel-footer">
                        <?php include("includes/buttons.php"); ?>
                    </div>
                </div>
            </div>
        </div>
    </form>

    <div class="modal fade bs-example-modal-lg searchModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal"><span>&times;</span></button>
                    <h4 class="modal-title" id="myLargeModalLabel">Search <? Echo $formname; ?></h4>
                </div>
                <div class="modal-body">
                    <input type="hidden" value="<?php Echo $file ?>" class="form-control file">

                    <div class="row">
                        <div class="col-lg-2">
                            <select class="form-control sfield">
                                <option value="1">Party</option>
                                <option value="2">Voucher</option>
                                <option value="3">Date</option>
                                <option value="4">GST%</option>
                                <option value="5">Godown</option>
                                <option value="6">Net 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">Party</option>
                                <option value="2">Voucher</option>
                                <option value="3">Date</option>
                                <option value="4">GST%</option>
                                <option value="5">Godown</option>
                                <option value="6">Net 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 style="background-color:#1ABC9C;">
                                    <th width="6%">Voucher</th>
                                    <th width="10%">Date</th>
                                    <th width="25%">Party</th>
                                    <th width="9%">Godown</th>
                                    <th width="10%">GST%</th>
                                    <th width="15%" style='text-align: right'>Net 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>
