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

$formname = 'Company Setup';
$maindb = 'company';
$trandb = 'soctran';
$printfile = "company_print.php";
$file = 'company.php';
$trandbexist = 0;
$grid = '';
$keyfld = "code";
$focusfield = "compname";
$compcd = $_SESSION['tit_' . $dbname];
$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"];
    $acno = $_POST["acno"];
    $ifccode = $_POST["ifccode"];
    $gstno = $_POST["gstno"];
    $panno = $_POST["panno"];
    $iatano = $_POST["iatano"];
    $emergencyno = $_POST["emergencyno"];
    $hoadd1 = mysqli_real_escape_string($conn, $_POST["hoadd1"]);
    $hoadd2 = mysqli_real_escape_string($conn, $_POST["hoadd2"]);
    $hoadd3 = mysqli_real_escape_string($conn, $_POST["hoadd3"]);
    $hocity = $_POST["hocity"];
    $hopin = $_POST["hopin"];
    $hostate = $_POST["hostate"];
    $hostatecode = $_POST["hostatecode"];
    $hocountry = $_POST["hocountry"];
    $htel = $_POST["htel"];
    
    $email = $_POST["email"];
    $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"];
    $helpmak = $_POST["helpmak"];
    $helpmed = $_POST["helpmed"];
    $tcsperc = $_POST["tcsperc"];
    $tcsmin = $_POST["tcsmin"];
    $locflsec = $_POST["locflsec"];
    
    $invnote1 = $_POST["invnote1"];
    $invnote2 = $_POST["invnote2"];
    $invnote3 = $_POST["invnote3"];
    $invnote4 = $_POST["invnote4"];
    $invnote5 = $_POST["invnote5"];
    $invnote6 = $_POST["invnote6"];
    $invnote7 = $_POST["invnote7"];
    $vchnote1 = $_POST["vchnote1"];
    $vchnote2 = $_POST["vchnote2"];
    $vchnote3 = $_POST["vchnote3"];
    $vchnote4 = $_POST["vchnote4"];
    $vchnote5 = $_POST["vchnote5"];
    $vchnote6 = $_POST["vchnote6"];
    $vchnote7 = $_POST["vchnote7"];
    $count = $_POST["items"];



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

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

    $ctr = 0;
    for ($i = 0; $i <= $count; $i++) {
        $ctr++;
        $msrno = $_POST["srno_$i"];
        $maintype = $_POST["maintype_$i"];



        if (!empty($maintype)) {
            mysqli_query($conn, "INSERT INTO `$trandb`(`cono`,`srno`, `maintype`)
                             VALUES('$qvouch', '$msrno', '$maintype')") or die(mysqli_error($conn));
        }
    }

    $mvouch = $qvouch;
    mysqli_query($conn, "UPDATE `$maindb` SET `compname`='$name',`bankname`='$bank',`branchname`='$branch',
                        `acno`='$acno',`ifccode`='$ifccode',`gstno`='$gstno',panno='$panno',
                        `hoadd1`='$hoadd1', `hoadd2`='$hoadd2', `hoadd3`='$hoadd3', `hocity`='$hocity',
                        `hopin`='$hopin',`hocountry`='$hocountry', htel='$htel', `email`='$email',
                        `fadd1`='$fadd1', `fadd2`='$fadd2', `fadd3`='$fadd3', `fcity`='$fcity',`fpin`='$fpin',
                        `fcountry`='$fcountry', ftel='$ftel',`helpmed`='$helpmed',`tcsperc`='$tcsperc',`tcsmin`='$tcsmin',
                        `sadd1`='$sadd1', `sadd2`='$sadd2', `sadd3`='$sadd3', `scity`='$scity',`spin`='$spin',`helpmak`='$helpmak',
                        `scountry`='$scountry', ftel='$ftel', `banknameonl`='$banknameonl', `branchnameonl`='$branchnameonl', `acnonl`='$acnonl', `ifccodeonl`='$ifccodeonl',
                        `invnote1`='$invnote1',`invnote2`='$invnote2',`invnote3`='$invnote3',`invnote4`='$invnote4',`invnote5`='$invnote5', `invnote6`='$invnote6',
                        `vchnote1`='$vchnote1',`vchnote2`='$vchnote2',`vchnote3`='$vchnote3',`vchnote4`='$vchnote4',`vchnote5`='$vchnote5',`vchnote6`='$vchnote6',
                        `invnote7`='$invnote7', `vchnote7`='$vchnote7', `hostate`='$hostate', `hostatecode`='$hostatecode', `iatano`='$iatano', 
                        `emergencyno`='$emergencyno', `locflsec`='$locflsec'
                        WHERE compcd = '$compcd' ") 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 `compcd`='$compcd' ") or die(mysqli_error($conn));
    $get = mysqli_fetch_array($result);
}
//mysqli_query($conn, "DELETE FROM `$trandb` WHERE `cono`='$qvouch'") or die(mysqli_error($conn));


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();
        $("body").off('click').on("click", '.remove', remove);
        $("body").on("change blur", '.maintype', chkrepeat);
        $("body").on("change", ".hostate", getStateCode);

        function getStateCode() {
            var state = $(".hostate").val();
            $.get('get_stcode.php', {
                state: state
            }, function(data) {
                $(".hostatecode").val(data);
            });
        }

        function chkrepeat() {
            var tr = $(this).closest('tr'),
                maintype = tr.find('.maintype').val(),
                srno = tr.find('.srno').val();
            $(".tbody").find('tr').each(function() {
                var row = $(this),
                    lmaintype = row.find('.maintype').val(),
                    loopsrno = row.find('.srno').val();

                if (lmaintype == maintype && loopsrno != srno && lmaintype != '') {
                    alert('MAINTENANCE CANNOT BE SAME !!!');
                    tr.find('.maintype').val('').trigger("change");
                    return false;
                }
            });
        }
        $('#addnew').click(function() {
            AddRows();
        });

        function remove() {
            $(this).closest("tr").remove();
        }

        function AddRows() {
            var ctr = $('#items').val();

            var hide_check = "";
            if ($("#del_all").prop("checked")) {
                hide_check = 0;
            } else {
                hide_check = 1;
            }
            var detail = ".detailpart_" + ctr;
            $.post('company_add.php', {
                ctr: ctr,
                hide: hide_check
            }, function(data) {
                $(data).appendTo('.tbody');
                ctr++;
                $('#items').val(ctr);
                $(detail).select2();
            });
        }

    });
</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 " 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 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">IATA 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="iatano" value="<?php echo ($addflag != 1) ? $get["iatano"] : ""; ?>">
                            </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">Makkah Helpline 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 helpmak" name="helpmak" value="<?php echo ($addflag != 1) ? $get["helpmak"] : ""; ?>">
                            </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">Emergency Contact 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 emergencyno" name="emergencyno" value="<?php echo ($addflag != 1) ? $get["emergencyno"] : ""; ?>">
                            </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">Medina Helpline 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 helpmed" name="helpmed" value="<?php echo ($addflag != 1) ? $get["helpmed"] : ""; ?>">
                            </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">Local Flight Sector</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                <input type="text" class="form-control form locflsec" maxlength="3" name="locflsec" value="<?php echo ($addflag != 1) ? $get["locflsec"] : ""; ?>">
                            </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="false">Invoice Notes</a></li>
                                <li class=""><a href="#tab_3" data-toggle="tab" aria-expanded="false">Voucher Notes</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 pad">
                                            <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-3 col-sm-3 col-xs-3 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="hostate" class="form-control form hostate select2">
                                                <option value="<?php echo ($addflag != 1) ? $get['hostate'] : ""; ?>"><?php echo ($addflag != 1) ? $get['hostate'] : " "; ?></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 hostatecode" name="hostatecode" value="<?php echo ($addflag != 1) ? $get["hostatecode"] : ""; ?>" 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-5 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>
                                    <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-5 col-md-5 col-sm-5 col-xs-5 pad">
                                            <input type="text" class="form-control form" name="email" maxlength="50" value="<?php echo ($addflag != 1) ? $get["email"] : ""; ?>">
                                        </div>
                                    </div>
                                </div>
                                <!--#################################FACTORY########################################-->
                                <div class="tab-pane" id="tab_2">
                                    <div class="row">
                                        <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad"></div>
                                        <div class="col-lg-10 col-md-8 col-sm-8 col-xs-8 pad">
                                            <input type="text" class="form-control form invnote1" name="invnote1" value="<?php echo ($addflag != 1) ? $get["invnote1"] : ""; ?>">
                                            <input type="text" class="form-control form invnote2" name="invnote2" value="<?php echo ($addflag != 1) ? $get["invnote2"] : ""; ?>">
                                            <input type="text" class="form-control form invnote3" name="invnote3" value="<?php echo ($addflag != 1) ? $get["invnote3"] : ""; ?>">
                                            <input type="text" class="form-control form invnote4" name="invnote4" value="<?php echo ($addflag != 1) ? $get["invnote4"] : ""; ?>">
                                            <input type="text" class="form-control form invnote5" name="invnote5" value="<?php echo ($addflag != 1) ? $get["invnote5"] : ""; ?>">
                                            <input type="text" class="form-control form invnote6" name="invnote6" value="<?php echo ($addflag != 1) ? $get["invnote6"] : ""; ?>">
                                            <input type="text" class="form-control form invnote7" name="invnote7" value="<?php echo ($addflag != 1) ? $get["invnote7"] : ""; ?>">
                                        </div>
                                    </div>
                                </div>
                                <!-- #################################SALES######################################## -->
                                <div class="tab-pane" id="tab_3">
                                    <div class="row">
                                        <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad"></div>
                                        <div class="col-lg-10 col-md-8 col-sm-8 col-xs-8 pad">
                                            <input type="text" class="form-control form vchnote1" name="vchnote1" value="<?php echo ($addflag != 1) ? $get["vchnote1"] : ""; ?>">
                                            <input type="text" class="form-control form vchnote2" name="vchnote2" value="<?php echo ($addflag != 1) ? $get["vchnote2"] : ""; ?>">
                                            <input type="text" class="form-control form vchnote3" name="vchnote3" value="<?php echo ($addflag != 1) ? $get["vchnote3"] : ""; ?>">
                                            <input type="text" class="form-control form vchnote4" name="vchnote4" value="<?php echo ($addflag != 1) ? $get["vchnote4"] : ""; ?>">
                                            <input type="text" class="form-control form vchnote5" name="vchnote5" value="<?php echo ($addflag != 1) ? $get["vchnote5"] : ""; ?>">
                                            <input type="text" class="form-control form vchnote6" name="vchnote6" value="<?php echo ($addflag != 1) ? $get["vchnote6"] : ""; ?>">
                                            <input type="text" class="form-control form vchnote7" name="vchnote7" value="<?php echo ($addflag != 1) ? $get["vchnote7"] : ""; ?>">
                                        </div>
                                    </div>
                                </div>
                                <!--</div>-->
                                <div class="panel-footer">
                                    <? include("includes/buttons.php"); ?>
                                </div>
                            </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>