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

$formname = 'Company Setup';
$maindb = 'company';
$printfile = "company_print.php";
$file = 'company.php';
$trandbexist = 0;
$grid = '';
$keyfld = "code";
$focusfield = "compname";

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

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

    $a = 1;
    $name = $_POST["compname"];
    $bank = $_POST["bankname"];
    $branch = $_POST["branchname"];
    $acname = $_POST["acname"];
    $acno = $_POST["acno"];
    $ifccode = $_POST["ifccode"];
    $gstno = $_POST["gstno"];
    $panno = $_POST["panno"];
    $hoadd1 = mysqli_real_escape_string($conn, $_POST["hoadd1"]);
    $hoadd2 = mysqli_real_escape_string($conn, $_POST["hoadd2"]);
    $hoadd3 = mysqli_real_escape_string($conn, $_POST["hoadd3"]);
    $hmob = $_POST["hmob"];
    $email = $_POST["email"];
    $hocity = $_POST["hocity"];
    $hopin = $_POST["hopin"];
    $htel = $_POST["htel"];
    $opadd1 = mysqli_real_escape_string($conn, $_POST["opadd1"]);
    $opadd2 = mysqli_real_escape_string($conn, $_POST["opadd2"]);
    $opadd3 = mysqli_real_escape_string($conn, $_POST["opadd3"]);
    $opmob = $_POST["opmob"];
    $opemail = $_POST["opemail"];
    $opcity = $_POST["opcity"];
    $oppin = $_POST["oppin"];
    $optel = $_POST["optel"];
    $state = $_POST["state"];
    $statecode = $_POST["statecode"];
    $hocountry = $_POST["hocountry"];
    $fadd1 = mysqli_real_escape_string($conn, $_POST["fadd1"]);
    $fadd2 = mysqli_real_escape_string($conn, $_POST["fadd2"]);
    $fadd3 = mysqli_real_escape_string($conn, $_POST["fadd3"]);
    $fcity = $_POST["fcity"];
    $fpin = $_POST["fpin"];
    $fcountry = $_POST["fcountry"];
    $ftel = $_POST["ftel"];
    $sadd1 = mysqli_real_escape_string($conn, $_POST["sadd1"]);
    $sadd2 = mysqli_real_escape_string($conn, $_POST["sadd2"]);
    $sadd3 = mysqli_real_escape_string($conn, $_POST["sadd3"]);
    $scity = $_POST["scity"];
    $spin = $_POST["spin"];
    $scountry = $_POST["scountry"];
    $stel = $_POST["stel"];
    $deeminv = $_POST["deeminv"];
    $tdscode = $_POST["tdscode"];
    $tcsperc = $_POST["tcsperc"];
    $tcsmin = $_POST["tcsmin"];


    ################ ONLINE BANK DETAILS ########################

    $banknameonl = $_POST["banknameonl"];
    $branchnameonl = $_POST["branchnameonl"];
    $acnonl = $_POST["acnonl"];
    $ifccodeonl = $_POST["ifccodeonl"];


    #############################################################


    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["compname"])) {
        $result = mysqli_query($conn, "SELECT * FROM `$maindb` WHERE `compname`= '$name' AND code != '$qvouch'") or die(mysqli_error($conn));
        if (mysqli_num_rows($result) > 0) {
            $a = 0;
            browse("Name Already Exist");
            header("refresh: 1; $file?mode=last");
        }
    }



    $mvouch = $qvouch;
    mysqli_query($conn, "UPDATE `$maindb` SET `compname`='$name',`bankname`='$bank',`branchname`='$branch', `acname`='$acname',
                        `acno`='$acno',`ifccode`='$ifccode',`gstno`='$gstno',panno='$panno',
                        `hoadd1`='$hoadd1', `hoadd2`='$hoadd2', `hoadd3`='$hoadd3', `hocity`='$hocity',
                        `opadd1`='$opadd1', `opadd2`='$opadd2', `opadd3`='$opadd3', `opcity`='$opcity',
                        `opmob`='$opmob', `opemail`='$opemail', `optel`='$optel', `oppin`='$oppin',
                        `hopin`='$hopin',`hocountry`='$hocountry', htel='$htel', `state`='$state', `statecode`='$statecode',
                        `fadd1`='$fadd1', `fadd2`='$fadd2', `fadd3`='$fadd3', `fcity`='$fcity',`fpin`='$fpin',
                        `fcountry`='$fcountry', ftel='$ftel',`tdscode`='$tdscode',`tcsperc`='$tcsperc',`tcsmin`='$tcsmin',
                        `sadd1`='$sadd1', `sadd2`='$sadd2', `sadd3`='$sadd3', `scity`='$scity',`spin`='$spin',`deeminv`='$deeminv',
                        `scountry`='$scountry', ftel='$ftel', `banknameonl`='$banknameonl', `branchnameonl`='$branchnameonl', 
                        `acnonl`='$acnonl', `ifccodeonl`='$ifccodeonl',`hmob`='$hmob', `email`='$email' where code = '$mvouch' ") or die(mysqli_error($conn));

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

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

include("includes/linkshead.php");
?>
<!--<script src="MyScript/challan.js" type="text/javascript"></script>-->
<script src="MyScript/company_search.js" type="text/javascript"></script>
<script>
    $(document).ready(function() {
        $('#hadd').hide();
        $('#hsearch').hide();
        $('#hprint').hide();
        $('#hdelete').hide();
        $('#hprevious').hide();
        $('#hnext').hide();

    });
</script>
<style>
    .tclr {
        color: red;
        font-weight: 545;
    }
</style>
</head>

<body>
    <form action='' method='POST'>
        <!-- Default box -->
        <div class="row">
            <div class="col-lg-6">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><?php echo $formname; ?></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">
                        <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">Company Name</label>
                            </div>
                            <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form focusfield" name="compname" value="<?php echo ($addflag != 1) ? $get["compname"] : ""; ?>" required>
                            </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">Bank Name</label>
                            </div>
                            <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form " name="bankname" value="<?php echo ($addflag != 1) ? $get["bankname"] : ""; ?>">
                            </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">Branch Name</label>
                            </div>
                            <div class="col-lg-6 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form branchname" name="branchname" value="<?php echo ($addflag != 1) ? $get["branchname"] : ""; ?>">
                            </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">Account Name</label>
                            </div>
                            <div class="col-lg-6 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form acname" name="acname" value="<?php echo ($addflag != 1) ? $get["acname"] : ""; ?>">
                            </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">Account No.</label>
                            </div>
                            <div class="col-lg-6 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form " name="acno" value="<?php echo ($addflag != 1) ? $get["acno"] : ""; ?>">
                            </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">IFSC Code</label>
                            </div>
                            <div class="col-lg-5 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form" name="ifccode" value="<?php echo ($addflag != 1) ? $get["ifccode"] : ""; ?>">
                            </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">GST No.</label>
                            </div>
                            <div class="col-lg-5 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form " name="gstno" value="<?php echo ($addflag != 1) ? $get["gstno"] : ""; ?>">
                            </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">PAN No.</label>
                            </div>
                            <div class="col-lg-5 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form " name="panno" value="<?php echo ($addflag != 1) ? $get["panno"] : ""; ?>">
                            </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">Deemed Export Invoice No.</label>
                            </div>
                            <div class="col-lg-5 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form" name="deeminv" value="<?php echo ($addflag != 1) ? $get["deeminv"] : ""; ?>" maxlength="6">
                            </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">TDS Code</label>
                            </div>
                            <div class="col-lg-3 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form numeric tdscode" readonly name="tdscode" value="<?php echo ($addflag != 1) ? $get["tdscode"] : ""; ?>">
                            </div>
                            <div class="col-lg-3 col-md-8 col-sm-8 col-xs-8 pad">
                                <i class="fa fa-search tdssearch" style="font-size: 20px;" aria-hidden="true"></i>
                            </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">TCS%</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 pad">
                                <input type="number" step="any" class="form-control form numeric tcsperc"  name="tcsperc" value="<?php echo ($addflag != 1) ? $get["tcsperc"] : ""; ?>">
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">TCS Min :</label>
                            </div> 
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 pad">
                                <input type="number" step="any" class="form-control form numeric tcsmin"  name="tcsmin" value="<?php echo ($addflag != 1) ? $get["tcsmin"] : ""; ?>">
                            </div>                       
                        </div>-->

                        <!--<br>-->
                        <div class="navs-tabs-customs">
                            <ul class="nav nav-tabs">
                                <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">Head Office</a></li>
                                <li class=""><a href="#tab_2" data-toggle="tab" aria-expanded="true">Operating Office</a></li>
                            </ul>
                            <div class="tab-content">
                                <!--#################################HEAD OFFICE########################################-->
                                <div class="tab-pane active" id="tab_1">
                                    <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">Address</label>
                                        </div>
                                        <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                            <input type="text" class="form-control form" name="hoadd1" value="<?php echo ($addflag != 1) ? $get["hoadd1"] : ""; ?>">
                                            <input type="text" class="form-control form" name="hoadd2" value="<?php echo ($addflag != 1) ? $get["hoadd2"] : ""; ?>">
                                            <input type="text" class="form-control form" name="hoadd3" value="<?php echo ($addflag != 1) ? $get["hoadd3"] : ""; ?>">
                                        </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">City</label>
                                        </div>
                                        <div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 pad">
                                            <input type="text" class="form-control form" name="hocity" value="<?php echo ($addflag != 1) ? $get["hocity"] : ""; ?>">
                                        </div>
                                        <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                            <label class="label-control marg">Pin</label>
                                        </div>
                                        <div class="col-lg-2 col-md-2 col-sm-5 col-xs-5 text-center ">
                                            <input type="text" class="form-control form" name="hopin" value="<?php echo ($addflag != 1) ? $get["hopin"] : ""; ?>">
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-lg-3 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">
                                            <select name="state" class="form-control form state select2" required>
                                                <option value="<?php echo ($addflag != 1) ? $get['state'] : ""; ?>"><?php echo ($addflag != 1) ? $get['state'] : " "; ?></option>
                                                <?php
                                                $mown4 = mysqli_query($conn, "SELECT `code`, `name` FROM $zdb.`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" name="statecode" value="<?php echo ($addflag != 1) ? $get["statecode"] : ""; ?>" readonly>
                                        </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">Country</label>
                                        </div>
                                        <div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 pad">
                                            <input type="text" class="form-control form" name="hocountry" value="<?php echo ($addflag != 1) ? $get["hocountry"] : ""; ?>">
                                        </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">Telephone</label>
                                        </div>
                                        <div class="col-lg-3 col-md-5 col-sm-5 col-xs-5 pad">
                                            <input type="text" class="form-control form" name="htel" value="<?php echo ($addflag != 1) ? $get["htel"] : ""; ?>">
                                        </div>
                                        <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                            <label class="label-control marg">Mobile</label>
                                        </div>
                                        <div class="col-lg-3 col-md-5 col-sm-5 col-xs-5 pad">
                                            <input type="number" class="form-control form" name="hmob" value="<?php echo ($addflag != 1) ? $get["hmob"] : ""; ?>">
                                        </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">Email</label>
                                        </div>
                                        <div class="col-lg-3 col-md-5 col-sm-5 col-xs-5 pad">
                                            <input type="text" class="form-control form" name="email" value="<?php echo ($addflag != 1) ? $get["email"] : ""; ?>">
                                        </div>
                                    </div>
                                </div>
                                <div class="tab-pane" id="tab_2">
                                    <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">Address</label>
                                        </div>
                                        <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                            <input type="text" class="form-control form" name="opadd1" value="<?php echo ($addflag != 1) ? $get["opadd1"] : ""; ?>">
                                            <input type="text" class="form-control form" name="opadd2" value="<?php echo ($addflag != 1) ? $get["opadd2"] : ""; ?>">
                                            <input type="text" class="form-control form" name="opadd3" value="<?php echo ($addflag != 1) ? $get["opadd3"] : ""; ?>">
                                        </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">City</label>
                                        </div>
                                        <div class="col-lg-3 col-md-5 col-sm-5 col-xs-5 pad">
                                            <input type="text" class="form-control form" name="opcity" value="<?php echo ($addflag != 1) ? $get["opcity"] : ""; ?>">
                                        </div>
                                        <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                            <label class="label-control marg">Pin</label>
                                        </div>
                                        <div class="col-lg-2 col-md-2 col-sm-5 col-xs-5 pad ">
                                            <input type="text" class="form-control form" name="oppin" value="<?php echo ($addflag != 1) ? $get["oppin"] : ""; ?>">
                                        </div>
                                    </div>
                                    <!-- <div class="row">
                                        <div class="col-lg-3 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">
                                            <select name="state" class="form-control form state select2" required>
                                                <option value="<?php echo ($addflag != 1) ? $get['state'] : ""; ?>"><?php echo ($addflag != 1) ? $get['state'] : " "; ?></option>
                                                <?php
                                                $mown4 = mysqli_query($conn, "SELECT `code`, `name` FROM $zdb.`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" name="statecode" value="<?php echo ($addflag != 1) ? $get["statecode"] : ""; ?>" readonly>
                                        </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">Country</label>
                                        </div>
                                        <div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 pad">
                                            <input type="text" class="form-control form" name="hocountry" value="<?php echo ($addflag != 1) ? $get["hocountry"] : ""; ?>">
                                        </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">Telephone</label>
                                        </div>
                                        <div class="col-lg-3 col-md-5 col-sm-5 col-xs-5 pad">
                                            <input type="text" class="form-control form" name="optel" value="<?php echo ($addflag != 1) ? $get["optel"] : ""; ?>">
                                        </div>
                                        <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                            <label class="label-control marg">Mobile</label>
                                        </div>
                                        <div class="col-lg-3 col-md-5 col-sm-5 col-xs-5 pad">
                                            <input type="number" class="form-control form" name="opmob" value="<?php echo ($addflag != 1) ? $get["opmob"] : ""; ?>">
                                        </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">Email</label>
                                        </div>
                                        <div class="col-lg-3 col-md-5 col-sm-5 col-xs-5 pad">
                                            <input type="text" class="form-control form" name="opemail" value="<?php echo ($addflag != 1) ? $get["opemail"] : ""; ?>">
                                        </div>
                                    </div>
                                </div>

                            </div>
                            <div class="panel-footer">
                                <? include("includes/buttons.php"); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--            <div class="col-lg-6">
                <div class="panel panel-default">
                    <div class="panel-heading">

                        <h3 class="panel-title">Bank Details Online</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:#67e6dc;">
                        <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 tclr" >Bank Name</label>
                            </div>
                            <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form " name="banknameonl" value="<?php echo ($addflag != 1) ? $get["banknameonl"] : ""; ?>" >
                            </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 tclr">Branch Name</label>
                            </div>
                            <div class="col-lg-6 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form " name="branchnameonl" value="<?php echo ($addflag != 1) ? $get["branchnameonl"] : ""; ?>" >
                            </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 tclr">Account No.</label>
                            </div>
                            <div class="col-lg-6 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form " name="acnonl" value="<?php echo ($addflag != 1) ? $get["acnonl"] : ""; ?>" >
                            </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 tclr">IFSC Code</label>
                            </div>
                            <div class="col-lg-5 col-md-8 col-sm-8 col-xs-8 pad">
                                <input type="text" class="form-control form" name="ifccodeonl" value="<?php echo ($addflag != 1) ? $get["ifccodeonl"] : ""; ?>" >
                            </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="1">Code</option>
                                <option value="2">Name</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>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control orderAs">
                                <option value="desc">Desc</option>
                                <option value="asc">Asc</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <input type="text" value="" class="form-control ssearch" placeholder="Search Here">
                        </div>
                        <div class="col-lg-2">
                            <input type="button" class="btn btn-primary sload" value="Search">
                        </div>
                    </div>
                    <div class="col-lg-12 sloader text-center">
                        <img src="images/search.gif" alt="loading">
                    </div>
                    <div class="col-lg-12 snoRecord text-center">
                        <h3>NO RECORDS FOUND</h3>
                    </div>
                    <div class="table-responsive" style="max-height: 400px;overflow: auto;">
                        <table id="" class="table table-striped table-condensed table-bordered" width="100%">
                            <thead>
                                <tr style="background-color:#1ABC9C;">
                                    <th width="20%">Code</th>
                                    <th width="40%">Name</th>
                                    <th width="20%">Group Code</th>
                                    <th width="20%">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>
    <!--                <div class="modal fade bs-example-modal-lg" 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=" table-responsive">
                                        <table id="example1" class="table table-striped">
                                            <thead>
                                                <tr class="mySearchTr">
                                                    <th>Name</th>
                                                    <th>Address</th>
                                                    <th>City</th>
                                                    <th>Mobile</th>
                                                    <th>Email</th>
                                                    <th>Action</th>
                                                </tr>
                                            </thead>
                                            <tbody>
    <?php
    //                                            $srchresult = mysqli_query($conn, "SELECT * FROM `$maindb`") or die(mysqli_error($conn));
    //                                            while ($row = mysqli_fetch_array($srchresult)) {
    //                                                echo "<tr class='clickable-row' data-href='$file?mode=edit&$keyfld=$row[$keyfld]'>";
    //                                                echo "<td align='left'>$row[name]</td>";
    //                                                echo "<td align='left'>$row[add1]</td>";
    //                                                echo "<td align='left'>$row[city]</td>";
    //                                                echo "<td align='left'>$row[mobile]</td>";
    //                                                echo "<td align='left'>$row[email]</td>";
    //                                                echo "<td align='left'><a href=\"$file?mode=edit&$keyfld=$row[$keyfld]\"><i class='fa fa-pencil' style='font-size:1.3em;color:#00C0EF;cursor:pointer;'></i></a></td>";
    //                                                echo "</tr>";
    //                                            }
    ?>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                                <div class="modal-footer"></div>
                            </div>
                        </div>
                    </div>-->
    <?php include("includes/linksfoot.php"); ?>
</body>

</html>