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

$formname = 'Offer Letter';
$maindb = 'offerletter';

$file = 'offerletter.php';

$keyfld = "vouchno";
$trandbexist = 0;
$focusfld = "name";
$printfile = 'offerletter_pdf.php';
$usertype = $_SESSION["usertype"];
$username = $_SESSION["username_" . $dbname];
$comp = $_SESSION["comp_" . $dbname];
$zroot = $_SESSION["zdir"];

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

$gtcomp = mysqli_query($conn, "SELECT code,compname FROM $zroot.`company` WHERE code = '$comp'") or die(mysqli_error($conn));
$ftcomp = mysqli_fetch_object($gtcomp); 

$zStartDate = getzdates($zyear, 'S');
$zEndDate = getzdates($zyear, 'E');
date_default_timezone_set('Asia/Kolkata');

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

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

    $a = 1;

    $qvouch = $_POST["vouchno"];


    $insert_fields = "";
    $insert_values = "";
    $comma = "";
    foreach ($_POST as $key => $value) {
        $exclude_fld = ["addfg", "submit", "vouchno"];
        if (in_array($key, $exclude_fld)) {
            continue;
        }
        $$key = $value;

        $insert_fields .= " $comma`$key`";
        $insert_values .= " $comma'$value'";

        $update_fields .= " $comma$key='$value'";

        $comma = ",";
    }

    $mvouch = $qvouch;


    if ($a == 1) {
        mysqli_query($conn, "LOCK TABLES `$maindb` WRITE") or die(mysqli_error($conn));

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

        $insert_fields .= ",vouchno,adduser";
        $insert_values .= ",'$mvouch','$username'";
        $update_fields .= ",`edituser`='$username'";

        $insert_qry = "INSERT INTO $maindb ($insert_fields) VALUES ($insert_values)";

        $increcode = $myyear . $mvouch;

        $update_qry = "UPDATE $maindb SET $update_fields  where vouchno = '$mvouch'";


        if ($addflag == 1) {
            mysqli_query($conn, $insert_qry) or die(mysqli_error($conn));
            insmess();
            header("refresh: 1; $file?$keyfld=$mvouch&mode=true&series=$fseries&par=A");
        } else {
            $mvouch = $qvouch;

            mysqli_query($conn, $update_qry) or die(mysqli_error($conn));
            updmess();
            header("refresh: 1; $file?$keyfld=$mvouch&mode=edit&series=$fseries");
        }

        mysqli_query($conn, "UNLOCK TABLES");


    }
}

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

    $getdept = mysqli_query($conn, "SELECT * FROM `dept` WHERE `code` = '$get[department]'") or die(mysqli_error($conn));
    $showdept = mysqli_fetch_array($getdept);

    $gtcompdt = mysqli_query($conn, "SELECT `code`,compname FROM $zroot.`company` WHERE `code` = '$get[company]'") or die(mysqli_error($conn));
    $ftcompdt = mysqli_fetch_object($gtcompdt);

}

/* DELETE */
if (isset($_GET["delete"])) {
    mysqli_query($conn, "LOCK TABLES `$maindb` WRITE") or die(mysqli_error($conn));

    delete($zdb, "$maindb", "$keyfld", $_GET[$keyfld], "$file?mode=last");

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

include("includes/linkshead.php");
?>
<script src="MyScript/expentry.js?a=<?= mt_rand() ?>" type="text/javascript"></script>
<script src="MyScript/expentry_search.js?b=<?= mt_rand() ?>" type="text/javascript"></script>
<script src="MyScript/shortkeys.js" type="text/javascript"></script>
<script>
function checkJoinDate() {
    var joinDate = document.getElementById("joiningdt").value;
    var vouchno = document.getElementById("vouchno").value;
    if (!joinDate) {
        alert("Please Enter the Joining Date.");
        return;
    }
    // Proceed to open the PDF
    window.open("joiningletter_pdf.php?vouchno=" + vouchno, "_blank");
}
</script>
<!-- <script src="MyScript/checkdate.js" type="text/javascript"></script> -->
<style type="text/css">
    .bgsale {
        background-color: #e3f2e1;
    }

    .bgpurch {
        background-color: #8fcccc;
    }

    .row {
        width: 100%;
        margin-right: 0px;
        margin-left: 0px;
    }

    .styled-table {
        width: 100%;
        border-collapse: collapse;
        font-family: 'Segoe UI', sans-serif;
        font-size: 14px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        margin-bottom: 20px;
    }

    .styled-table thead tr {
        background-color: #343a40;
        color: #ffffff;
        text-align: center;
    }

    .styled-table th,
    .styled-table td {
        font-size: 12px;
        padding: 7px 8px;
        border: 1px solid #ddd;
    }

    .styled-table tbody tr {
        background-color: #ffffff;
        transition: background-color 0.2s ease;
    }

    .styled-table tbody tr:hover {
        background-color: #f1f1f1;
    }

    .styled-table .text-right {
        text-align: right;
    }

    .styled-table .text-center {
        text-align: center;
    }

    .styled-table tfoot td {
        font-weight: bold;
        color: #e74c3c;
    }

    .skpad {
        padding: 15px;
    }

    @media (max-width: 768px) {
        .styled-table {
            font-size: 12px;
        }
    }


    /* From Uiverse.io by Na3ar-17 */ 
.container {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
}

.label {
  background-color: transparent;
  border: 2px solid rgb(91, 91, 240);
  display: flex;
  align-items: center;
  border-radius: 50px;
  width: 160px;
  cursor: pointer;
  transition: all 0.4s ease;
  padding: 5px;
  position: relative;
}

.label::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  width: 8px;
  height: 8px;
  transition: all 0.4s ease;
  border-radius: 100%;
  margin: auto;
  opacity: 0;
  visibility: hidden;
}

.label .input {
  display: none;
}

.label .title {
  font-size: 17px;
  color: #fff;
  transition: all 0.4s ease;
  position: absolute;
  right: 18px;
  bottom: 14px;
  text-align: center;
}

.label .title:last-child {
  opacity: 0;
  visibility: hidden;
}

.label .circle {
  height: 45px;
  width: 45px;
  border-radius: 50%;
  background-color: rgb(91, 91, 240);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.4s ease;
  position: relative;
  box-shadow: 0 0 0 0 rgb(255, 255, 255);
  overflow: hidden;
}

.label .circle .icon {
  color: #fff;
  width: 30px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.4s ease;
}

.label .circle .square {
  aspect-ratio: 1;
  width: 15px;
  border-radius: 2px;
  background-color: #fff;
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.4s ease;
}

.label .circle::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  background-color: #3333a8;
  width: 100%;
  height: 0;
  transition: all 0.4s ease;
}

.label:has(.input:checked) {
  width: 57px;
  animation: installed 0.4s ease 3.5s forwards;
}

.label:has(.input:checked)::before {
  animation: rotate 3s ease-in-out 0.4s forwards;
}

.label .input:checked + .circle {
  animation:
    pulse 1s forwards,
    circleDelete 0.2s ease 3.5s forwards;
  rotate: 180deg;
}

.label .input:checked + .circle::before {
  animation: installing 3s ease-in-out forwards;
}

.label .input:checked + .circle .icon {
  opacity: 0;
  visibility: hidden;
}

.label .input:checked ~ .circle .square {
  opacity: 1;
  visibility: visible;
}

.label .input:checked ~ .title {
  opacity: 0;
  visibility: hidden;
}

.label .input:checked ~ .title:last-child {
  animation: showInstalledMessage 0.4s ease 3.5s forwards;
}

/* From Uiverse.io by adamgiebl */ 
.cssbuttons-io-button {
  display: flex;
  align-items: center;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
  font-size: 16px;
  padding: 0.5em 1.6em 0.4em 1.3em;
  color: white;
  background: #ad5389;
  background: linear-gradient( 0deg, rgba(77, 54, 208, 1) 0%, rgba(132, 116, 254, 1) 100%
  );
  border: none;
  box-shadow: 0 0.7em 1.5em -0.5em #4d36d0be;
  letter-spacing: 0.05em;
  border-radius: 20em;
  margin-top: 4px;
}

.cssbuttons-io-button svg {
  margin-right: 8px;
}

.cssbuttons-io-button:hover {
  box-shadow: 0 0.5em 1.5em -0.5em #4d36d0be;
}

.cssbuttons-io-button:active {
  box-shadow: 0 0.3em 1em -0.5em #4d36d0be;
}

/* From Uiverse.io by adamgiebl */ 
.cssbuttons-io-button2 {
  display: flex;
  align-items: center;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
  font-size: 16px;
  padding: 0.5em 1.6em 0.4em 1.3em;
  color: white;
  background: #ad5389;
  background: linear-gradient( 0deg, rgba(169, 132, 103, 1) 0%, rgba(169, 132, 103, 1) 100%
  );
  border: none;
  box-shadow: 0 0.7em 1.5em -0.5em #a98467;
  letter-spacing: 0.05em;
  border-radius: 20em;
  margin-top: 4px;
}

.cssbuttons-io-button2 svg {
  margin-right: 8px;
}

.cssbuttons-io-button2:hover {
  box-shadow: 0 0.5em 1.5em -0.5em #a98467;
}

.cssbuttons-io-button2:active {
  box-shadow: 0 0.3em 1em -0.5em #a98467;
}

</style>


</head>

<body>
    <form action='' method='POST'>
        <div class="row">
            <div class="col-lg-6 col-md-10 col-sm-12 col-xs-12 pad">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title" style="color:#78909C"><a class="myPrint">Offer Letter Entry</a></h3>
                    </div>

                    <div class="panel-body">

                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Letter No.</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 pad">
                                <input type="text" name="vouchno" 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-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Letter Date</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-4 col-xs-4 pad">
                                <input type="date" name="vouchdt" class="form-control form vouchdt" value="<?php echo ($addflag != 1) ? $get['vouchdt'] : date('Y-m-d'); ?>" required>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Employee Name</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-9 col-xs-9 pad">
                                <input type="text" name="employee" class="form-control form employee" maxlength="50" value="<?php echo ($addflag != 1) ? $get['employee'] : ''; ?>" required>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Address</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-9 col-xs-9 pad">
                                <input type="text" name="add1" class="form-control form add1" maxlength="30" value="<?php echo ($addflag != 1) ? $get['add1'] : ''; ?>">
                                <input type="text" name="add2" class="form-control form add2" maxlength="30" value="<?php echo ($addflag != 1) ? $get['add2'] : ''; ?>">
                                <input type="text" name="add3" class="form-control form add3" maxlength="30" value="<?php echo ($addflag != 1) ? $get['add3'] : ''; ?>">
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Job Title</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-9 col-xs-9 pad">
                                <input list="mjobtitle" name="jobtitle" value="<?php echo ($addflag != 1) ? $get['jobtitle'] : '' ?>" maxlength="40" class="form-control form jobtitle" autocomplete="off">
                                <datalist id="mjobtitle">
                                    <option value="">
                                        <?php
                                        $gtjobtt = mysqli_query($conn, "SELECT jobtitle FROM `$maindb` WHERE jobtitle != '' GROUP BY jobtitle order by jobtitle") or die(mysqli_error($conn));
                                        while ($fetjobtt = mysqli_fetch_array($gtjobtt)) {
                                            $jobtt = $fetjobtt['jobtitle'];
                                            echo "<option value='$jobtt'>";
                                        }
                                        ?>
                                </datalist>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Company Name</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-9 col-xs-9 pad">
                                <select id="company" name="company" class="form-control form company select2" required>
                                    <option value="<?php echo ($addflag != 1) ? $ftcompdt->code : "$ftcomp->code"; ?>"><?php echo ($addflag != 1) ? $ftcompdt->compname : "$ftcomp->compname"; ?></option>
                                </select>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Work Location</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-9 col-xs-9 pad">
                                <input type="text" name="worklocation" class="form-control form" maxlength="40" value="<?php echo ($addflag != 1) ? $get['worklocation'] : ''; ?>">
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Start Date</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-4 col-xs-4 pad">
                                <input type="date" name="startdate" class="form-control form" value="<?php echo ($addflag != 1) ? $get['startdate'] : ''; ?>" required>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Reporting To</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 pad">
                                <input list="mreportingto" name="reportingto" value="<?php echo ($addflag != 1) ? $get['reportingto'] : '' ?>" maxlength="40" class="form-control form reportingto" autocomplete="off">
                                <datalist id="mreportingto">
                                    <option value="">
                                        <?php
                                        $gtreportto = mysqli_query($conn, "SELECT reportingto FROM `$maindb` WHERE reportingto != '' GROUP BY reportingto order by reportingto") or die(mysqli_error($conn));
                                        while ($fetreportto = mysqli_fetch_array($gtreportto)) {
                                            $reportto = $fetreportto['reportingto'];
                                            echo "<option value='$reportto'>";
                                        }
                                        ?>
                                </datalist>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Department</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 pad">
                                <select name="department" class="form-control form select2 department">
                                   <option value="<?php echo ($addflag != 1) ? $showdept["code"] : ""; ?>"> <?php echo ($addflag != 1 ) ? $showdept["name"] : ""; ?></option>
                                    <?php
                                        $getcode = mysqli_query($conn, "SELECT code,name FROM `dept` order by name")or die(mysqli_error($conn));
                                        while ($fetcode = mysqli_fetch_array($getcode)) {
                                            Echo "<option value='$fetcode[code]'>$fetcode[name]</option>";
                                        }
                                    ?>
                                </select>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Monthly Salary </label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 pad">
                                <input type="number" step="any" name="monsalary" class="form-control form monsalary text-right"  value="<?php echo ($addflag != 1) ? $get['monsalary'] : ''; ?>">
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Ruppes in words</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-7 col-xs-7 pad">
                                <input type="text" class="form-control form monsalrsword" readonly value="<?php echo ($addflag != 1) ? rsword($get['monsalary']) : ''; ?>">
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Salary On</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-7 col-xs-7 pad">
                                <input type="text" name="salaryon" class="form-control form salaryon" value="<?php echo ($addflag != 1) ? $get['salaryon'] : '10th working day of the month'; ?>">
                            </div>
                        </div>


                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Working Hours</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad">
                                <label class="label-control marg">Start</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 pad">
                                <input type="time" name="starttime" class="form-control form" value="<?php echo ($addflag != 1) ? $get['starttime'] : ''; ?>">
                            </div>

                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad">
                                <label class="label-control marg">End</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 pad">
                                <input type="time" name="endtime" class="form-control form" value="<?php echo ($addflag != 1) ? $get['endtime'] : ''; ?>">
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Weekly Off</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 pad">
                                <select name="weeklyoff" class="form-control form select2 weeklyoff">
                                    <?php
                                    $weeklys = ['SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY'];
                                    foreach ($weeklys as $week) {
                                        $selected = ($addflag != 1 && $get['weekly'] == $week) ? 'selected' : '';
                                        echo "<option value='$week' $selected>$week</option>";
                                    }
                                    ?>
                                </select>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Termination Notice</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                <input type="number" name="terminationdays" class="form-control form text-right"  value="<?php echo ($addflag != 1) ? $get['terminationdays'] : '30'; ?>">
                            </div>
                            <div class="text-left">
                                <label class="label-control marg"><b>days</b></label>
                            </div>
                        </div>

                        <div class="row" style="background-color: #e8d1ba;">
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Joining Date</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-4 col-xs-4 pad">
                                <input type="date" name="joiningdt" class="form-control form joiningdt" id="joiningdt" value="<?php echo ($addflag != 1) ? $get['joiningdt'] : ''; ?>">
                            </div>
                        </div>

                    </div>

                    <div class="panel-footer">
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-right pad">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 pad">
                                <button type="button" class="cssbuttons-io-button" onclick="window.open('offerletter_pdf.php?vouchno=<?= $get['vouchno'] ?>', '_blank')">
                                  <span>Offer Letter</span>
                                </button>
                            </div>
                                
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad">
                                <?php include("includes/buttons.php"); ?>
                            </div>

                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 pad">
                                <button type="button" class="cssbuttons-io-button2" onclick="checkJoinDate()">
                                  <span>Job Letter</span>
                                </button>
                            </div>
                            
                        </div>                        
                    </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="">Sort By</option>
                                <option value="1">Voucher</option>
                                <option value="2">Date</option>
                                <option value="3">Expense</option>
                                <option value="4">Unit</option>
                                <!-- <option value="5">Paid By</option> -->
                                <option value="6">Payee</option>
                                <option value="7">Amount</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">Expense</option>
                                <option value="4">Unit</option>
                                <!-- <option value="5">Paid By</option> -->
                                <option value="6">Payee</option>
                                <option value="7">Amount</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%">Sr</th>
                                    <th width="10%">Date</th>
                                    <th width="25%">Expense</th>
                                    <th width="10%">Unit</th>
                                    <!-- <th width="10%">Paid By</th> -->
                                    <th width="10%">Payee</th>
                                    <th width="10%">Amount</th>
                                    <th width="2%">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>