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

$formname = 'Customer Normal';
$maindb = 'accmast';
$trandb = 'custvehicle';
$printfile = "customer_print.php";
$file = 'customer.php';
$trandbexist = 0;
$keyfld = "accode";
$focusfield = "name";
$mgrpcode = '010';
$keycond = "AND `grpcode`='$mgrpcode'";

////////////////// FB ////////////////////
$adduser = $_SESSION['username_' . $dbname];
date_default_timezone_set("Asia/Kolkata");
$adddate = date("Y-m-d");
$addtime = date("h:i:sa");
//$usertype = $_SESSION["usertype_" . $dbname];
$usertype = $_SESSION["usertype"];
// browse($usertype);

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);
include("includes/code_generate.php");
include("includes/prev&next.php");
// browse($qvouch);


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

    $a = 1;
    $name = mysqli_real_escape_string($conn, $_POST["name"]);
    $custcode = mysqli_real_escape_string($conn, $_POST["custcode"]);
    $area = mysqli_real_escape_string($conn, $_POST["area"]);
    $add1 = mysqli_real_escape_string($conn, $_POST["add1"]);
    $add2 = mysqli_real_escape_string($conn, $_POST["add2"]);
    $add3 = mysqli_real_escape_string($conn, $_POST["add3"]);
    $qvouch = $_POST["vouchno"];

    $state = $_POST["state"];
    $statecode = $_POST["statecode"];
    $city = $_POST["city"];
    $pin = $_POST["pin"];
    $coun = $_POST["country"];
    $mob = $_POST["mobile"];
    $mob2 = $_POST["mobile2"];
    $tel = $_POST["tel"];
    $email = $_POST["email"];
    $web = $_POST["website"];
    $cpers1 = $_POST["contpers"];
    $vat = $_POST["vattin"];
    $cst = $_POST["csttin"];
    $gstno = $_POST["gstno"];
    $pan = $_POST["pan"];
    $openbal = $_POST["openbal"];
    $opendc = $_POST["opendc"];
    $disc1 = $_POST["disc1"];
    $disc2 = $_POST["disc2"];
    $disc3 = $_POST["disc3"];
    $disc4 = $_POST["disc4"];
    $username = $_POST["username"];
    $password = $_POST["password"];

    $gdisc1 = $_POST["gdisc1"];
    $gdisc2 = $_POST["gdisc2"];
    $gdisc3 = $_POST["gdisc3"];
    $gdisc4 = $_POST["gdisc4"];

    $sdisc1 = $_POST["sdisc1"];
    $sdisc2 = $_POST["sdisc2"];
    $sdisc3 = $_POST["sdisc3"];
    $sdisc4 = $_POST["sdisc4"];

    $billtype = $_POST["billtype"];
    $billcycle = $_POST["billcycle"];
    $deposit = $_POST["deposit"];
    $credtype = $_POST["credtype"];
    $credlimit = $_POST["credlimit"];

    $apply = $_POST["apply"];
    $charges = $_POST["charges"];
    $opendate = $_POST["opendate"];
    $closedate = $_POST["closedate"];

    $tdsapply = $_POST["tdsapply"];
    $discapply = $_POST["discapply"];
    $discdies = $_POST["discdies"];
    $tcsapply = $_POST["tcsapply"];
    $tcsperc = $_POST["tcsperc"];
    $dailyprint = $_POST["dailyprint"];

    $oms = $_POST["oms"];
    $gstregno = $_POST["gstregno"];
    $credcard = $_POST["credcard"];
    $suppcard = $_POST["suppcard"];

    $count = $_POST["items"];
//   browse($count);
    $transporter = $_POST["transporter"];
    $mvouch = $qvouch;

    if ($name == "") {
        $a = 0;
        browse("Name Cannot Be Empty");
        if ($addflag == 1) {
            header("location:javascript://history.go(-1)");
        } else {
            header("refresh: ; $file?mode=last");
        }
    }

    if (isset($_POST["name"])) {
        $result = mysqli_query($conn, "SELECT * FROM `$maindb` WHERE `name`= '$name' AND `grpcode`='$mgrpcode' AND accode != '$qvouch'") or die(mysqli_error($conn));
        if (mysqli_num_rows($result) > 0) {
            $a = 0;
            browse("Customer Name Already Exist");
            header("refresh: 1; $file?mode=last");
        }
    }

    if (isset($_POST["custcode"])) {
        $result = mysqli_query($conn, "SELECT * FROM `$maindb` WHERE `custcode`= '$custcode' AND `grpcode`='$mgrpcode' AND accode != '$qvouch'") or die(mysqli_error($conn));
        if (mysqli_num_rows($result) > 0) {
            $a = 0;
            browse("Customer Code Already Exist");
            header("refresh: 1; $file?mode=last");
        }
    }

    if ($statecode == "") {
        $a = 0;
        browse("State Code Cannot Be Empty");
        if ($addflag == 1) {
            header("location:javascript://history.go(-1)");
        } else {
            header("refresh: ; $file?mode=last");
        }
    }

    if ($a == 1) {

        mysqli_query($conn, "LOCK TABLE `$maindb`,`$trandb` WRITE");
//        mysqli_query($conn, "LOCK TABLE `$maindb` WRITE");

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

            mysqli_query($conn, "INSERT INTO `$maindb`(accode,`name`, `custcode`, `add1`, `add2`, `add3`, `state`, `statecode`,`city`, `pin`, 
                                               `country`, mobile , mobile2 ,tel,  `email`,`website`, `contpers`, `vattin`, `csttin`,
                                                openbal, `dc`, grpcode,`gstno`, `disc1`,`disc2`,`disc3`,`disc4`,`gdisc1`,`gdisc2`,`gdisc3`,
                                                `gdisc4`, `sdisc1`,`sdisc2`,`sdisc3`, `sdisc4`, `init`, `area`, `pan`, `oms`, `transporter`, 
                                                `adduser`, `adddate`, `addtime`,`billtype`, `billcycle`,`deposit`,`credtype`, `apply`, `charges`,
                                                `opendate`, `closedate`, `tdsapply`, `discapply`, `discdies`, `tcsapply`, `tcsperc`, `credlimit`,`credcard`,suppcard,
                                                `gstregno`, `username`, `password`, `dailyprint`)
                                        VALUES($qvouch,'$name', '$custcode', '$add1', '$add2', '$add3', '$state', '$statecode', '$city', '$pin',
                                               '$coun', '$mob' , '$mob2' , '$tel', '$email', '$web', '$cpers1', '$vat', '$cst', '$openbal',
                                               '$opendc', '$mgrpcode','$gstno','$disc1','$disc2','$disc3','$disc4','$gdisc1','$gdisc2','$gdisc3',
                                               '$gdisc4', '$sdisc1','$sdisc2','$sdisc3','$sdisc4', 'SDR','$area', '$pan', '$oms', '$transporter',
                                               '$adduser', '$adddate', '$addtime','$billtype', '$billcycle','$deposit','$credtype','$apply','$charges',
                                               '$opendate', '$closedate', '$tdsapply', '$discapply','$discdies', '$tcsapply', '$tcsperc', '$credlimit','$suppcard',
                                               '$credcard','$gstregno','$username','$password', '$dailyprint')") or die(mysqli_error($conn));
//            insmess();

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


            ////////////////FF///////////
            $editdate = date("Y-m-d");
            $edittime = date("h:i:sa");
            mysqli_query($conn, "UPDATE `$maindb` SET `name`='$name',`custcode`='$custcode', `add1`='$add1', `add2`='$add2', `add3`='$add3', `state`='$state', 
                        `statecode`='$statecode', `city`='$city', `pin`='$pin', `country`='$coun', mobile= '$mob', mobile2= '$mob2',tel='$tel', `area`='$area',
                          mobile='$mob', `email`='$email', `website`='$web', `contpers`='$cpers1', `vattin`='$vat', `csttin`='$cst',
                         openbal='$openbal', `dc`='$opendc', grpcode='$mgrpcode', `gstno`='$gstno', `disc1`='$disc1', `disc2`='$disc2', `disc3`='$disc3', `disc4`='$disc4',
                         `gdisc1`='$gdisc1', `gdisc2`='$gdisc2', `gdisc3`='$gdisc3', `gdisc4`='$gdisc4', `pan`='$pan', `oms`='$oms', `transporter`='$transporter',
                         `billtype`='$billtype', `billcycle`='$billcycle', `deposit`='$deposit', `credtype`='$credtype', `apply`='$apply', `charges`='$charges', `opendate`='$opendate',
                         `closedate`='$closedate', `tdsapply`='$tdsapply', `discapply`='$discapply', `discdies`='$discdies', `tcsapply`='$tcsapply', `tcsperc`='$tcsperc', `credlimit`='$credlimit',
                         `sdisc1`='$sdisc1', `sdisc2`='$sdisc2', `sdisc3`='$sdisc3', `sdisc4`='$sdisc4',  `credcard`='$credcard', suppcard='$suppcard', `gstregno`='$gstregno',`username`='$username',`password`='$password',
                         `edituser`='$adduser',`edittime`='$edittime',`editdate`='$editdate', `dailyprint`='$dailyprint'  where $keyfld = '$mvouch' ") or die(mysqli_error($conn));
//            updmess();
//            header("refresh: 1; $file?$keyfld=$mvouch&mode=edit");
            header("refresh: 1; $file?mode=edit&$keyfld=$mvouch");
        }



        mysqli_query($conn, "DELETE FROM `$trandb` WHERE accode='$mvouch' ") or die(mysqli_error($conn));

        for ($i = 0; $i <= $count; $i++) {
            $cnt++;
            $msrno = $_POST["srno_$i"];
            $vehicleno = $_POST["vehicleno_$i"];
            $description = $_POST["description_$i"];
            $product = $_POST["product_$i"];
            $productname = $_POST["productname_$i"];

            if (!empty($vehicleno)) {

                mysqli_query($conn, "INSERT INTO `$trandb`(`srno`,vehicleno, description, product, `productname`, `accode`)
                                    VALUES('$cnt', '$vehicleno', '$description', '$product', '$productname', '$mvouch')") or die(mysqli_error($conn));
            }
        }


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

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

    $result = mysqli_query($conn, "SELECT * ,DATE_FORMAT(`adddate`, '%d-%m-%Y') as addt, DATE_FORMAT(`editdate`, '%d-%m-%Y') as eddt FROM `$maindb` WHERE $keyfld='$getvouch' AND `grpcode`='010'") or die(mysqli_error($conn));
    $get = mysqli_fetch_array($result);

    $getarea = mysqli_query($conn, "SELECT `code`,`area` FROM `area` WHERE `area`= '$get[area]'") or die(mysqli_error($conn));
    $larea = mysqli_fetch_array($getarea);

    $gettransporter = mysqli_query($conn, "SELECT `code`, `name` FROM `transport` WHERE `code`= '$get[transporter]'") or die(mysqli_error($conn));
    $ltransport = mysqli_fetch_array($gettransporter);

    $gettran = mysqli_query($conn, "SELECT * FROM `$trandb` WHERE `accode` = '$get[accode]' ORDER BY `srno`") or die(mysqli_error($conn));

    $rd = "readonly";
}

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

if (isset($_GET["delete"])) {
    $getcustdtl = mysqli_query($conn, "SELECT * FROM `actran` WHERE `accode` = '$_GET[$keyfld]'") or die(mysqli_error($conn));
    if (mysqli_num_rows($getcustdtl) > 0) {
        browse("Entry Exist in Transaction");
        header("refresh: 1; $file?mode=last");
    } else {
        delete($zdb, "$maindb", "$keyfld", $_GET[$keyfld], "$file?mode=last");
    }
}

include("includes/linkshead.php");
?>
<script src="MyScript/openbal.js"  type="text/javascript"></script>   
<script src="MyScript/customer.js" type="text/javascript"></script>
<script src="MyScript/customer_search.js" type="text/javascript"></script>
<style>
    .switch {
        position: relative;
        display: inline-block;
        width: 60px;
        height: 34px;
    }

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    .slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ccc;
        -webkit-transition: .4s;
        transition: .4s;
    }

    .slider:before {
        position: absolute;
        content: "";
        height: 26px;
        width: 26px;
        left: 4px;
        bottom: 4px;
        background-color: white;
        -webkit-transition: .4s;
        transition: .4s;
    }

    input:checked + .slider {
        background-color: #2196F3;
    }

    input:focus + .slider {
        box-shadow: 0 0 1px #2196F3;
    }

    input:checked + .slider:before {
        -webkit-transform: translateX(26px);
        -ms-transform: translateX(26px);
        transform: translateX(26px);
    }

    /* Rounded sliders */
    .slider.round {
        border-radius: 34px;
    }

    .slider.round:before {
        border-radius: 50%;
    }
    .disc{
        width:80px;
    }
    .disc1{
        width:50px;
    }
</style>

</head>

<body>
    <form action='' method='POST'>
        <!-- Default box -->
        <div class="row">
            <div class="col-lg-6 pad">
                <div class="panel panel-flat" style="margin-bottom: -11px;">
                    <div class="panel-heading">
                        <?php include("includes/usermention.php");
                        ?>
                        <div class="heading-elements">

                        </div>
                        <a class="heading-elements-toggle"><i class="icon-menu"></i></a>
                    </div>
                    <div class="panel-body">
                        <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">Code</label>
                            </div>
                            <div class="col-lg-1 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form focusfield" required name="custcode" value="<?php Echo ($addflag != 1) ? $get["custcode"] : ""; ?>" <?= $rd ?> autofocus>
                            </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">Name</label>
                            </div>
                            <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="hidden" class="form-control form focusfield vouchno" required name="vouchno" value="<?php Echo ($addflag != 1) ? $qvouch : $qvouch; ?>" >
                                <input type="text" class="form-control form" required name="name" value="<?php Echo ($addflag != 1) ? $get["name"] : ""; ?>" autofocus>
                            </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">Billing Type</label>
                            </div>
                            <div class="col-lg-2 col-md-4 col-sm-4 col-xs-4 pad">
                                <select name="billtype" class="form-control form billtype select2" required>
                                    <option value="<?php echo ($addflag != 1) ? $get['billtype'] : ""; ?>"></option>
                                    <option <?php
                                    if ($get['billtype'] == 'M') {
                                        echo "selected=selected";
                                    }
                                    ?> value="M">Multiple Bill</option>
                                    <option <?php
                                    if ($get['billtype'] == 'S') {
                                        echo "selected=selected";
                                    }
                                    ?> value="S">Single Bill</option>
                                </select>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Billing Cycle</label>
                            </div>
                            <div class="col-lg-2 col-md-4 col-sm-4 col-xs-4 pad">
                                <select name="billcycle" class="form-control form billcycle select2" required>
                                    <option value="<?php echo ($addflag != 1) ? $get['billcycle'] : ""; ?>"></option>
                                    <option <?php
                                    if ($get['billcycle'] == 'M') {
                                        echo "selected=selected";
                                    }
                                    ?> value="M">Monthly</option>
                                    <option <?php
                                    if ($get['billcycle'] == 'H') {
                                        echo "selected=selected";
                                    }
                                    ?> value="H">15 Days</option>
                                    <option <?php
                                    if ($get['billcycle'] == 'W') {
                                        echo "selected=selected";
                                    }
                                    ?> value="W">Weekly</option>
                                    <option <?php
                                    if ($get['billcycle'] == 'D') {
                                        echo "selected=selected";
                                    }
                                    ?> value="D">Daily</option>
                                    <option <?php
                                    if ($get['billcycle'] == 'T') {
                                        echo "selected=selected";
                                    }
                                    ?> value="T">Ten Days</option>

                                </select>
                            </div>


                            <?php
                            if ($get['billcycle'] == 'D') {
                            ?>
                                <div class="skhide">
                            <?php } else { ?>
                                <div class="skhide" style="display:none">
                            <?php } ?>

                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Bill Sale Entry</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                            <input type="checkbox"  class="form-control form dailyprint" 
                                <?php
                                if ($get['dailyprint'] == "1") {
                                    Echo "checked";
                                }
                                ?> 
                                value="1" name="dailyprint" > 
                            </div>
                        </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">Address</label>
                            </div>
                            <div class="col-lg-8 col-md-7 col-sm-7 col-xs-7 pad">
                                <input type="text" class="form-control form alphanumeric" name="add1" value="<?php Echo ($addflag != 1) ? $get["add1"] : ""; ?>" >
                                <input type="text" class="form-control form alphanumeric" name="add2" value="<?php Echo ($addflag != 1) ? $get["add2"] : ""; ?>" >
                                <input type="text" class="form-control form alphanumeric" name="add3" value="<?php Echo ($addflag != 1) ? $get["add3"] : ""; ?>" >
                            </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">City</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 pad">
                                <input type="text" class="form-control form alpha" name="city"  value="<?php Echo ($addflag != 1) ? $get["city"] : ""; ?>" >
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Pin</label>
                            </div>
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="text" class="form-control form number" name="pin" value="<?php Echo ($addflag != 1) ? $get["pin"] : ""; ?>" >
                            </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">State</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 pad">
                                <!--<input type="text" class="form-control form alpha" name="state" value="<?php // Echo ($addflag != 1) ? $get["state"] : "";                                    ?>" >-->
                                <select name="state" class="form-control form state select2" required>
                                    <option value="<?php echo ($addflag != 1) ? $get['state'] : ""; ?>"></option>
                                    <?php
                                    $mown4 = mysqli_query($conn, "SELECT `code`, `name` FROM `state` ORDER BY name") or die(mysqli_error($conn));
                                    while ($trow4 = mysqli_fetch_array($mown4)) {
                                        echo "<option value='$trow4[name]'>$trow4[name]</option>";
                                    }
                                    ?>
                                </select>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">State Code</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 pad">
                                <input type="text" class="form-control form number numeric statecode" required name="statecode" value="<?php Echo ($addflag != 1) ? $get["statecode"] : ""; ?>" readonly>
                            </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">Area</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 pad">
                                <select name="area" class="form-control form area select2"  >
                                    <option value="<?php echo ($addflag != 1) ? $larea['area'] : ""; ?>"><?php echo ($addflag != 1) ? $larea['area'] : " "; ?></option>
                                    <?php
                                    $mown2 = mysqli_query($conn, "SELECT `code`, `area` FROM `area` ORDER BY area") or die(mysqli_error($conn));
                                    while ($trow2 = mysqli_fetch_array($mown2)) {
                                        echo "<option value='$trow2[area]'>$trow2[area]</option>";
                                    }
                                    ?>
                                </select>
                            </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">Country</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 pad">
                                <input type="text" class="form-control form alpha" name="country" value="<?php Echo ($addflag != 1) ? $get["country"] : ""; ?>" >
                            </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">Tel.</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 pad">
                                <input type="text" class="form-control form " name="tel" value="<?php Echo ($addflag != 1) ? $get["tel"] : ""; ?>" >
                            </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">Mobile 1</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 pad">
                                <input type="text" class="form-control form  number" name="mobile"  value="<?php Echo ($addflag != 1) ? $get["mobile"] : ""; ?>" >
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Mobile 2</label>
                            </div>
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="text" class="form-control form number" name="mobile2" value="<?php Echo ($addflag != 1) ? $get["mobile2"] : ""; ?>" >
                            </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">Email</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control form email" name="email" value="<?php Echo ($addflag != 1) ? $get["email"] : ""; ?>" >
                            </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">Website</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control form" name="website" value="<?php Echo ($addflag != 1) ? $get["website"] : ""; ?>" >
                            </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">Contact Person</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control form" name="contpers" value="<?php Echo ($addflag != 1) ? $get["contpers"] : ""; ?>" >
                            </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">VAT TIN No.</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control form" name="vattin" value="<?php Echo ($addflag != 1) ? $get["vattin"] : ""; ?>" >
                            </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">Deposit</label>
                            </div>
                            <div class="col-lg-2 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control form" name="deposit" value="<?php Echo ($addflag != 1) ? $get["deposit"] : ""; ?>" >
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Credit Type</label>
                            </div>
                            <div class="col-lg-2 col-md-4 col-sm-4 col-xs-4 pad">
                                <select name="credtype" class="form-control form credtype select2" required>
                                    <option value="<?php echo ($addflag != 1) ? $get['credtype'] : ""; ?>"><?php echo ($addflag != 1) ? $get['credtype'] : " "; ?></option>
                                    <option <?php
                                    if ($get['credtype'] == 'S') {
                                        echo "selected=selected";
                                    }
                                    ?> value="S">Supply Block</option>
                                    <option <?php
                                    if ($get['credtype'] == 'F') {
                                        echo "selected=selected";
                                    }
                                    ?> value="F">Follow Back</option>
                                </select>
                            </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">Apply Operating Charges</label>
                            </div>
                            <div class="col-lg-2 col-md-4 col-sm-4 col-xs-4 pad">
                                <select name="apply" class="form-control form apply select2" required>
                                    <option value="<?php echo ($addflag != 1) ? $get['apply'] : ""; ?>"><?php echo ($addflag != 1) ? $get['apply'] : " "; ?></option>
                                    <option
                                    <?php
                                    if ($get['apply'] == 'Y') {
                                        echo "selected=selected";
                                    }
                                    ?> value='Y'>YES</option>
                                    <option
                                    <?php
                                    if ($get['apply'] == 'N') {
                                        echo "selected=selected";
                                    }
                                    ?> value='N'>NO</option>
                                </select>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Charges %</label>
                            </div>
                            <div class="col-lg-2 col-md-4 col-sm-4 col-xs-4 pad">
                                <input type="text" class="form-control form" name="charges" value="<?php Echo ($addflag != 1) ? $get["charges"] : ""; ?>" > 
                            </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">Opening Date</label>
                            </div>
                            <div class="col-lg-2 col-md-4 col-sm-4 col-xs-4 pad">
                                <input type="date" class="form-control form" name="opendate" value="<?php Echo ($addflag != 1) ? $get["opendate"] : ""; ?>" > 
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Closing Date</label>
                            </div>
                            <div class="col-lg-2 col-md-4 col-sm-4 col-xs-4 pad">
                                <input type="date" class="form-control form" name="closedate" value="<?php Echo ($addflag != 1) ? $get["closedate"] : ""; ?>" > 
                            </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">Credit Limit</label>
                            </div>
                            <div class="col-lg-2 col-md-4 col-sm-4 col-xs-4 pad">
                                <input type="text" class="form-control form" name="credlimit" value="<?php Echo ($addflag != 1) ? $get["credlimit"] : ""; ?>" > 
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Apply TDS</label>
                            </div>
                            <div class="col-lg-2 col-md-4 col-sm-4 col-xs-4 pad">
                                <select name="tdsapply" class="form-control form appchrg select2" required>
                                    <option value="<?php echo ($addflag != 1) ? $get['tdsapply'] : ""; ?>"><?php echo ($addflag != 1) ? $get['tdsapply'] : " "; ?></option>
                                    <option
                                    <?php
                                    if ($get['tdsapply'] == 'Y') {
                                        echo "selected=selected";
                                    }
                                    ?> value='Y'>YES</option>
                                    <option
                                    <?php
                                    if ($get['tdsapply'] == 'N') {
                                        echo "selected=selected";
                                    }
                                    ?> value='N'>NO</option>
                                </select>
                            </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">Discount On Diesel</label>
                            </div>
                            <div class="col-lg-2 col-md-4 col-sm-4 col-xs-4 pad">
                                <select name="discapply" class="form-control form discapply select2" required>
                                    <option value="<?php echo ($addflag != 1) ? $get['discapply'] : ""; ?>"><?php echo ($addflag != 1) ? $get['discapply'] : " "; ?></option>
                                    <option
                                    <?php
                                    if ($get['discapply'] == 'Y') {
                                        echo "selected=selected";
                                    }
                                    ?> value='Y'>YES</option>
                                    <option
                                    <?php
                                    if ($get['discapply'] == 'N') {
                                        echo "selected=selected";
                                    }
                                    ?> value='N'>NO</option>
                                </select>

                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Discount</label>
                            </div>
                            <div class="col-lg-2 col-md-4 col-sm-4 col-xs-4 pad">
                                <input type="text" class="form-control form" name="discdies" value="<?php Echo ($addflag != 1) ? $get["discdies"] : ""; ?>" > 
                            </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">Apply TCS</label>
                            </div>
                            <div class="col-lg-2 col-md-4 col-sm-4 col-xs-4 pad">
                                <select name="tcsapply" class="form-control form tcsapply select2" required>
                                    <option value="<?php echo ($addflag != 1) ? $get['tcsapply'] : ""; ?>"><?php echo ($addflag != 1) ? $get['tcsapply'] : " "; ?></option>
                                    <option
                                    <?php
                                    if ($get['tcsapply'] == 'Y') {
                                        echo "selected=selected";
                                    }
                                    ?> value='Y'>YES</option>
                                    <option
                                    <?php
                                    if ($get['tcsapply'] == 'N') {
                                        echo "selected=selected";
                                    }
                                    ?> value='N'>NO</option>
                                </select>

                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">TCS %</label>
                            </div>
                            <div class="col-lg-2 col-md-4 col-sm-4 col-xs-4 pad">
                                <input type="text" class="form-control form" name="tcsperc" value="<?php Echo ($addflag != 1) ? $get["tcsperc"] : ""; ?>" > 
                            </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">Pan No.</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control form" pattern="[A-Za-z]{5}\d{4}[A-Za-z]{1}"  name="pan" value="<?php Echo ($addflag != 1) ? $get["pan"] : ""; ?>" >
                            </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">GST No.</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control form " name="gstno" pattern="^([0]{1}[1-9]{1}|[1-2]{1}[0-9]{1}|[3]{1}[0-7]{1})([a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}[1-9a-zA-Z]{1}[zZ]{1}[0-9a-zA-Z]{1})+$" value="<?php Echo ($addflag != 1) ? $get["gstno"] : ""; ?>" >
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Transporter</label>
                            </div>
                            <div class="col-lg-6 col-md-7 col-sm-7 col-xs-7 pad">
                                <select class="form-control form select2" id="transporter"  name="transporter" style='width:100%' >

                                    <option value="<?php echo ($addflag != 1) ? $ltransport['code'] : " "; ?>" ><?php echo ($addflag != 1) ? $ltransport['name'] : " "; ?></option>
                                    <option value=""></option>
                                    <?php
                                    $mtran = mysqli_query($conn, "SELECT `code`, `name` FROM `transport` WHERE code !='' ORDER BY `name` ") or die(mysqli_error($conn));
                                    while ($ttran = mysqli_fetch_array($mtran)) {
                                        echo "<option value=$ttran[code]>$ttran[name]</option>";
                                    }
                                    ?>

                                </select>
                            </div>
                            <!--                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                                            <label style="color:#26A69A"label-control marg ><b id="bankamt"></b></label>
                                                        </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">Opening Balance</label>
                            </div>
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="text" size="40" name="openbal" class="form-control form text-right openbal" value="<?php echo ($addflag != 1) ? $get['openbal'] : ""; ?>"/>
                            </div>

                            <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 pad">                            
                                <select name="opendc" class="form-control form pad select2">
                                    <option
                                    <?php
                                    if ($get['dc'] == 'D') {
                                        echo "selected=selected";
                                    }
                                    ?> value='D'>DR</option>
                                    <option
                                    <?php
                                    if ($get['dc'] == 'C') {
                                        echo "selected=selected";
                                    }
                                    ?> value='C'>CR</option>
                                </select>

                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-2 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">
                                <input type="checkbox"  class="form-control form oms" <?php
                                if ($get['oms'] == "1") {
                                    Echo "checked";
                                }
                                ?> value="1" name="oms" >                         
                            </div>
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Credit Card</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                <input type="checkbox"  class="form-control form credcard" <?php
                                if ($get['credcard'] == "1") {
                                    Echo "checked";
                                }
                                ?> value="1" name="credcard" >                         
                            </div>
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Supplier Card</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                <input type="checkbox"  class="form-control form suppcard" <?php
                                if ($get['suppcard'] == "1") {
                                    Echo "checked";
                                }
                                ?> value="1" name="suppcard" >                         
                            </div>
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">GST Regn.</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                <input type="checkbox"  class="form-control form gstregno" <?php
                                if ($get['gstregno'] == "1") {
                                    Echo "checked";
                                }
                                ?> value="1" name="gstregno" >                         
                            </div>

                        </div>
                    </div>
                    <div class="panel-footer">
                        <?php include("includes/buttons.php"); ?>
                    </div>
                </div>
            </div>

            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12 ">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">Vehicle Details</h3>
                    </div>
                    <div class="panel-body">
                        <div class='table-responsive' style="overflow-y:scroll; height: 300px">
                            <table class="table table-striped table-condensed table-bordered" width="100%">
                                <thead  class="mySearchTr">
                                    <tr>
                                        <th style="width: 5%"></th>
                                        <th style="width: 10%;text-align: right;">Sr.</th>
                                        <th style="width: 20%;" >Vehicle No.</th>
                                        <!--<th style="width: 25%;">Description</th>-->
                                        <th style="width: 20%;">Product</th>
                                        <th style="width: 20%;">Product Name</th>
                                    </tr>
                                </thead>
                                <tbody id="tabledata">
                                    <?php
                                    if ($addflag != 1) {
                                        $ctr = 0;
                                        while ($tran = mysqli_fetch_array($gettran)) {
                                            Echo "<tr>";
                                            Echo "<td align='center' valign='top'><span class='remove fa fa-times ' name='remove' value='remove' style='display:none;'></span></td>";
                                            Echo "<td><input type='text' value='$tran[srno]'  name='srno_$ctr'  class='form-control form text-right' style='text-align:right;' readonly></td>";
                                            Echo "<td>";
                                            Echo "<input type='text' value='$tran[vehicleno]' name='vehicleno_$ctr' class='form-control form vehicleno'>";
                                            Echo "</td>";
//                                            Echo "<td>";
//                                            Echo "<input type='text' value='$tran[description]' name='description_$ctr' class='form-control form description'>";
//                                            Echo "</td>";
                                            Echo "<td>";
                                            Echo "<input type='text' value='$tran[product]' name='product_$ctr' class='form-control form product'>";
                                            Echo "</td>";
                                            Echo "<td>";
                                            Echo "<input type='text' value='$tran[productname]' name='productname_$ctr' class='form-control form productname' readonly>";
                                            Echo "</td>";
                                            Echo "</tr>";
                                            $ctr++;
                                        }
                                    } else {
                                        $pctr = 0;
                                        $yctr = 0;
                                        for ($i = $pctr; $i < 10; $i++) {
                                            $yctr++;
                                            echo "<tr>";
                                            Echo "<td align='center'><span class='remove fa fa-times ' name='remove' value='remove' style='display:none;'></span></td>";
                                            echo "<td  align='left'><input type='text' size='6' maxlength='6' name='srno_$pctr' class='sno form-control form' style='text-align:right' value='$yctr' readonly></td>";

                                            echo "<td align='center'><input type='text' size=''  name='vehicleno_$pctr' class='vehicleno form-control form' style='text-align:left;' value='' /></td>";
//                                            echo "<td align='center'><input type='text' size=''  name='description_$pctr' class='description form-control form' style='text-align:left;' value='' /></td>";
                                            echo "<td align='center'><input type='text' size=''  name='product_$pctr' class='product form-control form' style='text-align:left;' value='' /></td>";
                                            echo "<td align='center'><input type='text' size=''  name='productname_$pctr' class='productname form-control form' style='text-align:left;' value='' readonly/></td>";
                                            echo "</tr>";
                                            $pctr++;
                                        }
                                    }
                                    ?>
                                </tbody>
                            </table>
                        </div>
                        <div class="row">
                            <button type="button" class="btn btn-success btn-square form"  id="addnew">
                                <i class="fa fa-plus" style="color:#ffffff" data-toggle='tooltip' title='Add Row'></i>    
                            </button>
                            <input type="hidden" id="items" name="items" value="<?php echo ($addflag != 1) ? $ctr : $pctr; ?>" />  
                        </div>
                    </div>
                </div>
            </div>      

            <div class="col-lg-6 pad">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"  style="color:#4EB3C7">Customer Rights</h3>
                        <div class="actions pull-right">
                            <i class="fa fa-chevron-down"></i>
                            <!--<i class="fa fa-times"></i>-->
                        </div>
                    </div>

                    <div class="panel-body" style="background-color: white">
                        <!--                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                                        <label class="label-control marg">Email</label>
                                                    </div>
                                                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                                        <input type="text" class="form-control form email" name="email" value="<?php // Echo ($addflag != 1) ? $get["email"] : "";  ?>" >
                                                    </div>-->
                        <!--<div class="row" style="background-color: #1ABC9C;margin-left: -4px;margin-right: -4px" >-->
                        <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg" style="color: black">Username</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" size="40"  maxlength="40" name="username" class="form-control form username" value="<?php echo ($addflag != 1) ? $get['username'] : ""; ?>">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Password</label>
                            </div>
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="password"  name="password" class="form-control form password" value="<?php echo ($addflag != 1) ? $get['password'] : ""; ?>"/>
                            </div>
                        </div>
                        <!--                        <div class="row">
                                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                                        <label class="label-control marg">Confirm Password</label>
                                                    </div>
                                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 pad">
                                                        <input type="password"  name="confpass" class="form-control form cpass" value="<?php // echo ($addflag != 1) ? $get['confpass'] : "";  ?>"/>
                                                    </div>
                                                                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad text-right">
                                                                                    <button type="button" class="btn btn-primary CMail" style="margin-right: 20px"><i class="fa fa-envelope"></i> Send Mail To Customer</button>
                                                                                </div>
                                                </div>-->
                        <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad"></div>
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 pad checkdiv"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!--            <div class="col-lg-5">
                        <div class="panel panel-flat">
                            <div class="panel-heading">
                                    <h5 class="panel-title"><?php ?></h5>
                                <div class="heading-elements">
                                    <ul class="icons-list">
                                                                <li><a data-action="collapse"></a></li>
                                                                <li><a data-action="reload"></a></li>
                                                                <li><a data-action="close"></a></li>
                                </ul>
                            </div>
        
                            <div class="row">
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4">
                                    <label class=""></label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:center;">
                                    <label class="label-control marg"><b style="color:green;text-align: center;">&nbsp;</b></label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:center;">
                                    <label class="label-control marg"><b style="color:green;text-align: center;">1</b></label>
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad disc">
                                    <label class="label-control marg">Discount</label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:center;" >
                                    <label class="label-control marg"><b style="color:orange;text-align: center;">2</b></label>                            </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad disc">
                                    <label class="label-control marg">Discount</label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:center;">
                                    <label class="label-control marg" style="color:blue; "><b>3</b></label>                            </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad disc">
                                    <label class="label-control marg">Discount</label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:center;">
                                    <label class="label-control marg"><b style="color:red; text-align:center ;">4</b></label>                            </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:center;">
                                    <label class="label-control marg"><b style="color:black;text-align: center;font-size: 22px">&nbsp;</b></label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:center;">
                                    <label class="label-control marg"><b style="color:#26A69A;text-align: center;font-size: 22px">O<sub style="font-size: 11px;">thers</sub></b></label>
                                </div>
        
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad disc">
                                    <label class="label-control marg">Discount </label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:right;">
                                    <input type="number" step="any" class="form-control form disc " name="disc1" value="<?php Echo ($addflag != 1) ? $get["disc1"] : ""; ?>" >                           
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad disc">
                                    <label class="label-control marg">Discount</label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:right;">
                                    <input type="number" step="any"  class="form-control form " name="disc2" value="<?php Echo ($addflag != 1) ? $get["disc2"] : ""; ?>" >                           
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad disc">
                                    <label class="label-control marg">Discount</label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:right;">
                                    <input type="number" step="any"  class="form-control form " name="disc3" value="<?php Echo ($addflag != 1) ? $get["disc3"] : ""; ?>" >
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad disc">
                                    <label class="label-control marg">Discount</label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:right;">
                                    <input type="number" step="any"  class="form-control form " name="disc4" value="<?php Echo ($addflag != 1) ? $get["disc4"] : ""; ?>" >
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:center;">
                                    <label class="label-control marg"><b style="color:black;text-align: center;font-size: 22px">&nbsp;</b></label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:left;">
                                    <label class="label-control marg"><b style="color:#26A69A;text-align: center;font-size: 22px">G<sub style="font-size: 11px;">el</sub></b></label>
                                </div>
        
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad disc">
                                    <label class="label-control marg">Discount </label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:right;">
                                    <input type="number" step="any" class="form-control form disc " name="gdisc1" value="<?php Echo ($addflag != 1) ? $get["gdisc1"] : ""; ?>" >                           
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad disc">
                                    <label class="label-control marg">Discount</label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:right;">
                                    <input type="number" step="any"  class="form-control form " name="gdisc2" value="<?php Echo ($addflag != 1) ? $get["gdisc2"] : ""; ?>" >                           
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad disc">
                                    <label class="label-control marg">Discount</label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:right;">
                                    <input type="number" step="any"  class="form-control form " name="gdisc3" value="<?php Echo ($addflag != 1) ? $get["gdisc3"] : ""; ?>" >
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad disc">
                                    <label class="label-control marg">Discount</label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:right;">
                                    <input type="number" step="any"  class="form-control form " name="gdisc4" value="<?php Echo ($addflag != 1) ? $get["gdisc4"] : ""; ?>" >
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:center;">
                                    <label class="label-control marg"><b style="color:black;text-align: center;font-size: 22px">&nbsp;</b></label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:left;">
                                    <label class="label-control marg"><b style="color:#26A69A;text-align: center;font-size: 22px">S<sub style="font-size: 11px;">B</sub></b></label>
                                </div>
        
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad disc">
                                    <label class="label-control marg">Discount </label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:right;">
                                    <input type="number" step="any" class="form-control form disc " name="sdisc1" value="<?php Echo ($addflag != 1) ? $get["sdisc1"] : ""; ?>" >                           
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad disc">
                                    <label class="label-control marg">Discount</label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:right;">
                                    <input type="number" step="any"  class="form-control form " name="sdisc2" value="<?php Echo ($addflag != 1) ? $get["sdisc2"] : ""; ?>" >                           
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad disc">
                                    <label class="label-control marg">Discount</label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:right;">
                                    <input type="number" step="any"  class="form-control form " name="sdisc3" value="<?php Echo ($addflag != 1) ? $get["sdisc3"] : ""; ?>" >
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad disc">
                                    <label class="label-control marg">Discount</label>
                                </div>
                                <div class="col-lg-1 col-md-4 col-sm-4 col-xs-4 pad disc1" style="text-align:right;">
                                    <input type="number" step="any"  class="form-control form " name="sdisc4" value="<?php Echo ($addflag != 1) ? $get["sdisc4"] : ""; ?>" >
                                </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">
                <div class="row">
                    <div class="col-lg-2">
                        <select class="form-control sfield">
                            <option value="1">Code</option>
                            <option value="2">Name</option>
                            <option value="3">Address</option>
                            <option value="4">City</option>
                            <option value="5">Pin</option>
                            <option value="6">Telephone</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">Code</option>
                            <option value="2">Name</option>
                            <option value="3">Address</option>
                            <option value="4">City</option>
                            <option value="5">Pin</option>
                            <option value="6">Telephone</option>
                        </select> 
                    </div>
                    <div class="col-lg-2">
                        <select class="form-control orderAs">
                            <option value="asc">Asc</option>
                            <option value="desc">Desc</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="10%">Code</th>
                                <th width="25%">Name</th>
                                <th width="20%">Address</th>
                                <th width="10%">City</th>
                                <th width="10%">Pin</th>
                                <th width="10%">Telephone</th>
                                <th width="10%">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>
