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

$formname   = 'Invoice';
$maindb     = 'invmain';
$trandb     = 'invtran';
$chaldb     = 'chalmain';
$chaltrandb = 'chaltran';
$accdb      = 'actran';
$stkdb      = '';
$printfile   = "invoice_pdf.php";
$file        = 'invoice.php';
$trandbexist = 1;
$keyfld      = "vouchno";
$myyear     = $_SESSION["tit_" . $dbname];

date_default_timezone_set('Asia/Kolkata');
$time = date('H:i:s');

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

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$par = $_GET["par"];
$zyear = right($zdb, 4);
$comp = $_SESSION["comp_" . $dbname];

$zStartDate = getzdates($zyear, 'S', $conn);
$zEndDate = getzdates($zyear, 'E', $conn);

mysqli_select_db($conn, $zdb);

include("includes/vouchno_generate.php");
include("includes/prev&next.php");
if (isset($_POST["submit"])) {

    $a = 1;

    $vouchdt = trim($_POST["vouchdt"]);
    $rem1 = trim($_POST["rem1"]);
    $rem2 = trim($_POST["rem2"]);
    $billamt = trim($_POST["amount"]);
    $party = trim($_POST["party"]);
    $vesselm = trim($_POST["vesselm"]);
    $maninvno = trim($_POST["maninvno"]);
    $jobno = trim($_POST["jobno"]);
    $count = $_POST["newitem"];
    $mvouch = $qvouch;

    $gtacode = mysqli_query($conn, "Select accode from accmast where `name`='$party'") or die(mysqli_error($conn));
    $ftacode = mysqli_fetch_array($gtacode);
    $accode = $ftacode['accode'];

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

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

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


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

        mysqli_query($conn, "LOCK TABLES `$maindb` WRITE,  `$trandb` WRITE, `$chaldb` WRITE, `$chaltrandb` WRITE");

        if ($addflag == 1) {
            $gen1 = mysqli_query($conn, "SELECT MAX(vouchno) 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;
        }

        ############################### Tran Part ######################################################
        mysqli_query($conn, "DELETE FROM `$trandb` WHERE vouchno='$mvouch' ") or die(mysqli_error($conn));

        $cnt = 0;
        $cntamt = 0;
        mysqli_query($conn, "UPDATE `$chaltrandb` SET `invno`='0', `chalmark`='0' WHERE invno='$mvouch'") or die(mysqli_error($conn));

        for ($i = 0; $i < $count; $i++) {
            $cnt++;
            $mmark = $_POST["mark_$i"];
            $chalno = $_POST["chalno_$i"];
            $chalsrno = $_POST["srno_$i"];
            $mchaldate = $_POST["chaldate_$i"];
            $launch = $_POST["launch_$i"];
            $anchor = $_POST["anchor_$i"];
            $vessel = $_POST["vessel_$i"];
            $nohrs = $_POST["nohrs_$i"];
            $nomin = $_POST["nomin_$i"];
            $amount = $_POST["amount_$i"];
            // browse($mmark);
            // browse($mvouch);
            // browse($chalno);
            // browse($chalsrno);
            if (!empty($mmark)) {
                mysqli_query($conn, "INSERT INTO `$trandb`(`srno`,`vouchno`, `vouchdt`, `chalno`, `chaldate`, `launch`, `anchor`,`vessel`, `nohrs`, `nomin`, `amount`,`mark`)
                                                    VALUES('$cnt', '$mvouch', '$vouchdt', '$chalno', '$mchaldate', '$launch', '$anchor','$vessel','$nohrs','$nomin', '$amount','$mmark')") or die(mysqli_error($conn));

                mysqli_query($conn, "UPDATE `$chaltrandb` SET `invno`='$mvouch', `chalmark`='1' WHERE vouchno='$chalno' AND srno='$chalsrno'") or die(mysqli_error($conn));
            }
        }
        ############################### Main Part ######################################################

        if ($addflag == 1) {
            mysqli_query($conn, "INSERT INTO `$maindb`(`vouchno`, `invno`,`vouchdt`,`invdt`,`party`,`amount`, `rem1`, `rem2`,`vessel`, `maninvno`, `jobno`)
                                                VALUES('$mvouch', '$mvouch', '$vouchdt','$vouchdt', '$accode','$billamt', '$rem1', '$rem2','$vesselm','$maninvno','$jobno')") or die(mysqli_error($conn));
            header("refresh: 1; $file?mode=last");
        } else {
            mysqli_query($conn, "UPDATE `$maindb` SET  `vouchdt`='$vouchdt',`party`='$accode',`rem1`='$rem1',`rem2`='$rem2',
                                                        `amount`='$billamt',`vessel`='$vesselm',`maninvno`='$maninvno',`jobno`='$jobno' WHERE `vouchno` = '$mvouch' ") or die(mysqli_error($conn));
            updmess();
        }

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

if ($addflag == 1) {
    $gendt = mysqli_query($conn, "SELECT vouchdt FROM $maindb order by vouchno desc limit 1") or die(mysqli_error($conn));
    $fetdt = mysqli_fetch_assoc($gendt);
    $prevdt = $fetdt['vouchdt'];
}

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);
    if ($get['type'] == 'H') {
        $type = "Hours";
    } else {
        $type = "Lumsum";
    }
    $getparty = mysqli_query($conn, "SELECT `accode`,`name` FROM `accmast` WHERE `accode`= '$get[party]'") or die(mysqli_error($conn));
    $lparty = mysqli_fetch_array($getparty);

    $getvessel = mysqli_query($conn, "SELECT `code`,`name` FROM `vessel` WHERE `code`= '$get[vessel]'") or die(mysqli_error($conn));
    $fetvessel = mysqli_fetch_array($getvessel);
} else {
    $result1 = mysqli_query($conn, "SELECT * FROM `$maindb` WHERE $keyfld < $qvouch order by vouchno desc limit 0,1") or die(mysqli_error($conn));
    if (mysqli_num_rows($result1) > 0) {
        $get1 = mysqli_fetch_array($result1);
        if ($par == 'A') {
            $vchdt = $get1['vouchdt'];
        } else {
            $vchdt = date("Y-m-d");
        }
    }
}

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

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

    delnew($zdb, "$maindb", "$delcond2", "$file?mode=last$para", $conn);
    delnew($zdb, "$trandb", "$delcond2", "$file?mode=last$para", $conn);
    mysqli_query($conn, "UPDATE `$chaltrandb` SET  `chalmark`='0',`invno`='0' WHERE invno=$get[vouchno]");

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

include("includes/linkshead.php");
?>
<script src="MyScript/invoice.js?a=5" type="text/javascript"></script>
<script src="MyScript/invoice_search.js" type="text/javascript"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.full.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
    .tabital {
        font-family: verdana;
        font-style: italic;
    }

    .PTbody>tr>td>input:focus {
        border: 1px solid #ff0066 !important;
    }

    .tbodyy tr:nth-child(even) {
        background-color: #ede3ff;
    }

    .btnpdf {
        max-width: 20%;
    }

    .bgrow {
        background-color: #a2d2ff;
        color: #780000 !important;
    }

    .bgfrmrow {
        background-color: #ffafcc;
        color: #780000 !important;
    }

    .bgtorow {
        background-color: #ffe5d9;
        color: #780000 !important;
    }

    .panel {
        margin-bottom: 0px !important;
    }

    .fetchal {
        background-color: #a7c957;
    }

    /* input[type=checkbox] {
        width: 6%;
        height: 10px;
        } */
        
        .challanTbl input[type=checkbox] {
            width: 30px;
            height: 16px;
            margin-top: -10px;
            padding-left: 10px;
    }

    input[type="file"] {
        position: relative;
    }

    input[type="file"]::file-selector-button {
        width: 136px;
        color: transparent;
    }

    /* Faked label styles and icon */
    input[type="file"]::before {
        position: absolute;
        pointer-events: none;
        top: 5px;
        left: 16px;
        height: 20px;
        width: 20px;
        content: "";
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230964B0'%3E%3Cpath d='M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5-5 5z'/%3E%3C/svg%3E");
    }

    input[type="file"]::after {
        position: absolute;
        pointer-events: none;
        top: 5px;
        left: 40px;
        color: #0964b0;
        content: "Upload File";
    }

    /* ------- From Step 1 ------- */

    /* file upload button */
    input[type="file"]::file-selector-button {
        border-radius: 4px;
        padding: 0 5px;
        height: 25px;
        cursor: pointer;
        background-color: white;
        border: 1px solid rgba(0, 0, 0, 0.16);
        box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.05);
        margin-right: 5px;
        transition: background-color 200ms;
    }

    /* file upload button hover state */
    input[type="file"]::file-selector-button:hover {
        background-color: #f3f4f6;
    }

    /* file upload button active state */
    input[type="file"]::file-selector-button:active {
        background-color: #e5e7eb;
    }

    @media only screen and (min-width: 1280px) {
        .divMob {
            display: none;
        }
    }

    @media only screen and (max-width: 600px) {
        .divMob {
            display: block;
        }
    }

    .challanScroll {
        position: relative;
    }

    .challanTbl thead th {
        position: sticky;
        top: 0;
        z-index: 5;
        background-color: #451165;
        /* set this to whatever color mySearchTr actually uses in your global css, so text doesn't show through on scroll */
        color: white;
    }

    .challanTbl {
        border-collapse: collapse;
        /* required for sticky header to work cleanly with borders */
    }
</style>
</head>

<body>
    <form action='' method='POST' enctype="multipart/form-data">
        <div class="col-lg-3 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 class="row">
            <div class="col-lg-5 col-md-6 col-sm-6 col-xs-12 ">
                <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">

                            <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-3 col-md-2 col-sm-2 col-xs-2 text-right">
                                <label class="label-control marg">Invoice No.</label>
                            </div>
                            <div class="col-lg-2 col-md-1 col-sm-3 col-xs-3 pad">
                                <input type="hidden" class="tno" value="<?= $tno ?>" />

                                <input type="hidden" class="form-control einvpar" value="<?php echo $_SESSION["einv"] ?>">
                                <input type="hidden" class="form-control par" value="<?php echo $par ?>">
                                <input type="hidden" class="form-control addflag" value="<?php echo $addflag ?>">
                                <input type="text" name="vouchno" tabindex="-1" class="form-control form vouchno" id="vouchno" value="<?php echo ($addflag != 1) ? $get['vouchno'] : "$qvouch" ?>" readonly>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-1 col-xs-1 text-right">
                                <label class="label-control marg">Date</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-5 col-xs-6 pad">
                                <input type="date" class="form-control form focusfield vouchdt " name="vouchdt" value="<?php echo ($addflag != 1) ? $get["vouchdt"] : $prevdt; ?>" autofocus required>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-3 col-md-2 col-sm-2 col-xs-2 text-right">
                                <label class="label-control marg">Manual Inv No.</label>
                            </div>
                            <div class="col-lg-2 col-md-1 col-sm-3 col-xs-3 pad">
                                <input type="text" name="maninvno" class="form-control form maninvno" id="maninvno" value="<?php echo ($addflag != 1) ? $get['maninvno'] : 0 ?>">
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-1 col-xs-1 text-right">
                                <label class="label-control marg">Job No.</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-5 col-xs-6 pad">
                                <input type="text" name="jobno" class="form-control form jobno" id="jobno" value="<?php echo ($addflag != 1) ? $get['jobno'] : "" ?>">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-3 col-xs-2 text-right">
                                <label class="label-control marg">Party</label>
                            </div>
                            <div class="col-lg-6 col-xs-9 pad">
                                <input type="text" name="party" class="srchparty party form-control form" autocomplete="off" value="<?php echo ($addflag != 1) ? $lparty['name'] : '' ?>" required>
                                <div class="table-responsive PartySrchTbl" style="max-height: 350px;overflow: auto;">
                                    <table width="100%">
                                        <tbody class="PTbody">
                                            <?php
                                            $getparty = mysqli_query($conn, "SELECT `accode`, `name` FROM `accmast` WHERE `grpcode`='010' order by name asc") or die(mysqli_error($conn));
                                            while ($fparty = mysqli_fetch_array($getparty)) {

                                                echo "<tr class='bordcolr'>";
                                                echo "<td><input type='text' name='disblsrchparty' class='form-control disblsrchparty' value='$fparty[name]' readonly></td>";
                                                echo "</tr>";
                                                $ctr++;
                                            }
                                            ?>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-3 col-xs-2 text-right">
                                <label class="label-control marg">Vessel</label>
                            </div>
                            <div class="col-lg-6 col-xs-9 pad">
                                <select class="form-control form  vessel select2" id="vessel" name="vesselm" style="width: 100%">
                                    <option value="<?php echo ($addflag != 1) ? $get["vessel"] : ''; ?>"><?php echo ($addflag != 1) ? $fetvessel["name"] : ''; ?></option>
                                    <?php
                                    $gvessel = mysqli_query($conn, "SELECT `code`,`name` FROM `vessel` WHERE `code`!='' order by name") or die(mysqli_error($conn));
                                    while ($fvessel = mysqli_fetch_array($gvessel)) {
                                        echo "<option value='$fvessel[code]'>$fvessel[name]</option>";
                                    }
                                    ?>
                                </select>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-3 col-xs-2 text-center">
                            </div>
                            <div class="col-lg-3 col-xs-2 pad">
                                <button type="button" class="btn btn-primary btn-square getChal form">Get Challan</button>
                            </div>
                            <?php if ($addflag != 1) { ?>
                                <div class="col-lg-3 col-xs-2 pad">
                                    <button type="button" class="btn btn-primary btn-square fetChal form">Re-Fetch Challan</button>
                                </div>
                            <?php } ?>
                        </div>
                        <div class="row bgrow">
                            <div class="col-lg-3 col-xs-3 text-right">
                                <label class="label-control marg" style="font-weight:bold">Amount</label>
                            </div>
                            <div class="col-lg-4 col-xs-3 text-right pad">
                                <input type="number" step="any" name="amount" class="form-control form text-right billamt amount" value="<?php echo ($addflag != 1) ? $get['amount'] : '0' ?>" required readonly>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-3 col-md-2 col-sm-2 col-xs-2  text-right">
                                <label class="label-control marg">Remarks</label>
                            </div>
                            <div class="col-lg-8 col-md-8 col-sm-10 col-xs-10 pad">
                                <input type="text" name="rem1" class="form-control form " value="<?php echo ($addflag != 1) ? $get["rem1"] : ""; ?>">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-3 col-md-2 col-sm-2 col-xs-2  text-right">
                                <label class="label-control marg"></label>
                            </div>
                            <div class="col-lg-8  col-md-8 col-sm-10  col-xs-10 pad">
                                <input type="text" name="rem2" class="form-control form " value="<?php echo ($addflag != 1) ? $get["rem2"] : ""; ?>">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <div class="panel panel-default">
                            <div class="panel-footer">
                                <div class="row">
                                    <div class="col-lg-3 col-md-4 col-sm-4 col-xs-4 text-right pad">
                                        <img src="MyStyle/download.png" title="Pdf Print" class="btnpdf pdf" style="height:40px;width:30px;display: <?= $editdisabled ?>" onclick="window.open('invoice_pdf.php?vouchno=<?= $qvouch ?>&para=img')">
                                    </div>
                                    <div class="col-lg-9 col-md-8 col-sm-8 col-xs-8 pad">
                                        <?php include("includes/buttons.php"); ?>
                                    </div>
                                </div>
                                <?php // include("includes/buttons.php"); 
                                ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-7 col-md-7 col-sm-7 col-xs-7 ">
                <div class="panel panel-default">
                    <div class="challanScroll" style="max-height: 650px; overflow-y: auto;">
                        <table class="table-bordered challanTbl" style="width: 100%;">
                            <thead>
                                <tr class="mySearchTr" style="color:white;">
                                    <th style="width:4%;">Sr.</th>
                                    <th style="width:6%;">Chal No.</th>
                                    <th style="width:8%;">Date</th>
                                    <th style="width:10%;" class='text-center'>Launch</th>
                                    <th style="width:10%;" class='text-center'>Anchor</th>
                                    <th style="width:10%;" class='text-center'>Vessel</th>
                                    <th style="width:5%;" class='text-center'>Hrs</th>
                                    <th style="width:8%;" class='text-center'>Amount</th>
                                    <?php if ($addflag == 1) { ?>
                                        <th style="width:5%;"><input type="checkbox" class="form Sselall" id="Sselall" name="Sselall" value="1"></th>
                                    <?php } else {  ?>
                                        <th style="width:5%;"></th>
                                    <?php } ?>
                                </tr>
                            </thead>
                            <tbody class="tbodyy">
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <!-- <div class="col-lg-7 col-md-7 col-sm-7 col-xs-7 ">
                <div class="panel panel-default">
                    <table class="table-bordered" style="width: 100%;">
                        <thead>
                            <tr class="mySearchTr" style="color:white;">
                                <th style="width:4%;">Sr.</th>
                                <th style="width:6%;">Chal No.</th>
                                <th style="width:8%;">Date</th>
                                <th style="width:10%;" class='text-center'>Launch</th>
                                <th style="width:10%;" class='text-center'>Anchor</th>
                                <th style="width:10%;" class='text-center'>Vessel</th>
                                <th style="width:5%;" class='text-center'>Hrs</th>
                                <th style="width:8%;" class='text-center'>Amount</th>
                                <?php if ($addflag == 1) { ?>
                                    <th style="width:5%;"><input type="checkbox" class="form Sselall" id="Sselall" name="Sselall" value="1"></th>
                                <?php } else {  ?>
                                    <th style="width:5%;"></th>
                                <?php } ?>
                            </tr>

                        </thead>
                        <tbody class="tbodyy">
                        </tbody>
                    </table>
                </div>
            </div> -->
        </div>
        <input type="date" value="<?= $zStartDate ?>" style="width: 1px;border: none" class="zstdate">
        <input type="date" value="<?= $zEndDate ?>" style="width: 1px;border: none" class="zenddate">
    </form>

    <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: 4%">
            <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 <?php 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">Manual No</option>
                                <option value="2">Date</option>
                                <option value="3">Invoice No</option>
                                <option value="4">Job No</option>
                                <option value="5">Party</option>
                                <option value="6">Vessel</option>
                                <option value="7">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">Manual No</option>
                                <option value="2">Date</option>
                                <option value="3">Invoice No</option>
                                <option value="4">Job No</option>
                                <option value="5">Party</option>
                                <option value="6">Vessel</option>
                                <option value="7">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%">Invoice No</th>
                                    <th width="8%">Date</th>
                                    <th width="8%">Manual No</th>
                                    <th width="8%">Job No</th>
                                    <th width="20%">Party</th>
                                    <th width="20%">Vessel</th>
                                    <th width="15%">Amount</th>
                                    <th width="9%">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>