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

$formname = 'User Creation';
$maindb = 'passmain';
$trandb = 'usercomp';
$printfile = "";
$file = 'user.php';
$trandbexist = 0;
$grid = '';
$keyfld = "code";

$admin = $_SESSION["admin_" . $dbname];
$username = $_SESSION["username_" . $dbname];
$password = $_SESSION["password_" . $dbname];
$spectype = $_SESSION["spltype_" . $dbname];

// browse($spectype);
if ($spectype == "1") {
    $speccond = "and `compchng`='1'";
} else {
    $speccond = "and `compchng`=''";
}

$keycond = "and `spltype`='$spectype'";
//browse($spectype);

include("includes/vouchno_generate.php");
include("includes/prev&next.php");

if (isset($_POST["submit"])) {
    $a = 1;
    $user     = $_POST["user"];
    $password = $_POST["password"];
    $usertype = $_POST["usertype"];
    $spltype  = $_POST["spltype"];

    ################## MASTERS ##################
    $customer  = $_POST["customer"];
    $supplier  = $_POST["supplier"];
    $maker     = $_POST["maker"];
    $agency    = $_POST["agency"];
    $openbal   = $_POST["openbal"];
    $transport = $_POST["transport"];
    $color     = $_POST["color"];
    $bank      = $_POST["bank"];
    $cash      = $_POST["cash"];
    $expense   = $_POST["expense"];
    $group     = $_POST["group"];
    $otherac   = $_POST["otherac"];   

    ################## Raw Material ###############
    $rawmatgrp         = $_POST["rawmatgrp"];
    $rawmat            = $_POST["rawmat"];
    $rawchrateop       = $_POST["rawchrateop"];
    $purchmatgst       = $_POST["purchmatgst"];
    $debnoterawgst     = $_POST["debnoterawgst"];
    $debothgst_raw     = $_POST["debothgst_raw"];
    $salematgstmulti   = $_POST["salematgstmulti"];
    $crednoterawgst    = $_POST["crednoterawgst"];
    $inwardraw         = $_POST["inwardraw"];
    $outwardraw        = $_POST["outwardraw"];
    $damagedraw        = $_POST["damagedraw"];
    $purchrawgstreg    = $_POST["purchrawgstreg"];
    $debnoterawgstreg  = $_POST["debnoterawgstreg"];
    $debothrawgstreg  = $_POST["debothrawgstreg"];
    $slmatmultigstreg  = $_POST["slmatmultigstreg"];
    $crednoterawgstreg = $_POST["crednoterawgstreg"];
    $inwregraw         = $_POST["inwregraw"];
    $outregraw         = $_POST["outregraw"];
    $damregraw         = $_POST["damregraw"];
    $rawstock          = $_POST["rawstock"];
    $rawinwout         = $_POST["rawinwout"];
    $rawmatwise        = $_POST["rawmatwise"];
    $rawmatwisesale    = $_POST["rawmatwisesale"];
    $rawgrpwisesale    = $_POST["rawgrpwisesale"];
    $partygrpwisesale  = $_POST["partygrpwisesale"];
    $jobgiven          = $_POST["jobgiven"];
    $jobord            = $_POST["jobord"];
    $einvoicermgen     = $_POST["einvoicermgen"];
    $einvoicermcredgen = $_POST["einvoicermcredgen"];
    $jobgivenreg       = $_POST["jobgivenreg"];
    $jobordreg          = $_POST["jobordreg"];
    $jobpend           = $_POST["jobpend"];

    ################## Product ##################
    $itemgrp            = $_POST["itemgrp"];
    $item               = $_POST["item"];
    $chrateop           = $_POST["chrateop"];
    $purchase           = $_POST["purchase"];
    $debnote            = $_POST["debnote"];
    $debothgst          = $_POST["debothgst"];
    $sale               = $_POST["sale"];
    $creditnotemulti    = $_POST["creditnotemulti"];
    $inwardgst          = $_POST["inwardgst"];
    $outwardgst         = $_POST["outwardgst"];   
    $damagedgst         = $_POST["damagedgst"];
    $einvoiceslgen      = $_POST["einvoiceslgen"];
    $einvoicecdgen      = $_POST["einvoicecdgen"];
    $purchgstreg        = $_POST["purchgstreg"];
    $debnotereg         = $_POST["debnotereg"];
    $debothgstreg    = $_POST["debothgstreg"];
    $salereg            = $_POST["salereg"];
    $crdntreg           = $_POST["crdntreg"];   
    $inwreg             = $_POST["inwreg"];   
    $outreg             = $_POST["outreg"];   
    $damreg             = $_POST["damreg"];
    $stock              = $_POST["stock"];
    $inwout             = $_POST["inwout"];
    $itemwise           = $_POST["itemwise"];
    $itemwisesale       = $_POST["itemwisesale"];
    $itemgrpwisesale    = $_POST["itemgrpwisesale"];
    $partygrpwisesalepr = $_POST["partygrpwisesalepr"];
    $jobreceived        = $_POST["jobreceived"];
    $einvoicepdgen      = $_POST["einvoicepdgen"];
    $einvoicepdcredgen  = $_POST["einvoicepdcredgen"];
    $jobrecdreg         = $_POST["jobrecdreg"];

    ################## Accounts ##################
    $bankrecp    = $_POST["bankrecp"];
    $bankpay     = $_POST["bankpay"];   
    $cashrecp    = $_POST["cashrecp"];
    $cashpay     = $_POST["cashpay"];
    $contra      = $_POST["contra"];
    $journal     = $_POST["journal"];
    $jventry     = $_POST["jventry"];
    $discgvn     = $_POST["discgvn"];
    $discrecd    = $_POST["discrecd"];
    $bankrecon   = $_POST["bankrecon"];    
    $ledger      = $_POST["ledger"];
    $receivable  = $_POST["receivable"];
    $purchase_exp = $_POST["purchase_exp"];
    $payable     = $_POST["payable"];
    $bankrecorep = $_POST["bankrecorep"];
    $leadparty   = $_POST["leadparty"];
    $dailyreport = $_POST["dailyreport"];
    $dailyrawreport = $_POST["dailyrawreport"];
    $dailycashrp = $_POST["dailycashrp"];
    $bankbook    = $_POST["bankbook"];
    $cashbook    = $_POST["cashbook"];
    $jvbook      = $_POST["jvbook"];
    $discbook    = $_POST["discbook"];
    $jvsingle    = $_POST["jvsingle"];
    $purchexprep = $_POST["purchexprep"];
    $bccrep = $_POST["bccrep"];

    ################## GST Reports ##################
    $gstr1_1   = $_POST["gstr1_1"];
    $gstr1_1_R = $_POST["gstr1_1_R"];
    $gstr2_4 = $_POST["gstr2_4"];
    $gstr1_4   = $_POST["gstr1_4"];
    $gstr1_10  = $_POST["gstr1_10"];
    $gstr1_10_R = $_POST["gstr1_10_R"];
    $gstr2_b2b = $_POST["gstr2_b2b"];
    $gstr2_b2br = $_POST["gstr2_b2br"];

    $gstr1_2   = $_POST["gstr1_2"];
    $gstr1_3   = $_POST["gstr1_3"];
    $gstr1_5   = $_POST["gstr1_5"];
    $gstr1_6   = $_POST["gstr1_6"];
    $gstr1_7   = $_POST["gstr1_7"];
    $gstr1_8   = $_POST["gstr1_8"];
    $gstr1_9   = $_POST["gstr1_9"];
    $gstr1_11  = $_POST["gstr1_11"];
    $gstr3B    = $_POST["gstr3B"];
    $pugstrep  = $_POST["pugstrep"];
    $slgstrep  = $_POST["slgstrep"];
    $gstsumrep = $_POST["gstsumrep"];

    ################## Finalization ##################
    $trbal    = $_POST["trbal"];
    $profit   = $_POST["profit"];
    $profshar = $_POST["profshar"];
    $balsheet = $_POST["balsheet"];
    $closestk = $_POST["closestk"];

    ################################# MAIN PART #################################
    if (isset($_POST["name"])) {
        $result = mysqli_query($conn, "SELECT * FROM `$maindb` WHERE `user`= '$user' AND code != '$qvouch' and `spltype`='$spectype'") or die(mysqli_error($conn));
        if (mysqli_num_rows($result) > 0) {
            $a = 0;
            browse("Name Already Exist");
            header("refresh: 1; $file?code=$qvouch&mode=last");
        }
    }

    if ($a == 1) {
        if ($addflag == 1) {
            $gen1 = mysqli_query($conn, "SELECT MAX($keyfld) AS maxcode FROM `$maindb` LIMIT 0,1 ") or die(mysqli_error($conn));

            if (mysqli_num_rows($gen1) > 0) {
                $vvouch = mysqli_fetch_assoc($gen1);
                $qvouch = $vvouch["maxcode"] + 1;
            } else {
                $qvouch = '1';
            }
            $mvouch = $qvouch;
        }

        ################################# TRAN PART #################################

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

        $count = $_POST["items"];

        for ($i = 0; $i < $count; $i++) {
            $cono = $_POST["cono_$i"];
            $finyear = $_POST["finyear_$i"];
            $yearname = $_POST["yearname_$i"];
            $startdate = $_POST["startdate_$i"];
            $lastdate = $_POST["lastdate_$i"];

            if (!empty($cono)) {
                $company = mysqli_query($conn, "SELECT `name` FROM `company` WHERE `code`='$cono'")or die(mysqli_error($conn));
                $co = mysqli_fetch_array($company);
                $cname = $co['name'];

                mysqli_query($conn, "INSERT INTO `$trandb`(`username`,`cono`,`cname`, `finyear`, `yearname`, `startdate`, `lastdate`, `spltype`) 
                    VALUES ('$qvouch', '$cono', '$cname', '$finyear', '$yearname', '$startdate', '$lastdate', '$spltype')") or die(mysqli_error($conn));
            }
        }

############################## MAIN  ######################################################

if ($addflag == 1) {

            $usecode = mysqli_query($conn, "SELECT code FROM `passmain` WHERE user='$username' and `password`='$password' and `spltype`='$spltype'")or die(mysqli_error($conn));
            $getuser = mysqli_fetch_object($usecode);
            $code = $getuser->code;

    mysqli_query($conn, "INSERT INTO `$maindb`(`code`, `user`, `password`, `spltype`, `usertype`, 
                                            `customer`, `agency`, `maker`,`supplier`, `openbal`, `transport`, `color`, `bank`, `cash`, 
                                            `expense`, `group`, `otherac`,  -- MASTERS
                                            `rawmatgrp`, `rawmat`,`rawchrateop`, `purchmatgst`, `debnoterawgst`,`debothgst_raw`, 
                                            `salematgstmulti`, `crednoterawgst`, `inwardraw`, `outwardraw`,`damagedraw`, `purchrawgstreg`, 
                                            `debnoterawgstreg`,`debothrawgstreg` ,`slmatmultigstreg`, `crednoterawgstreg`,`inwregraw`,`outregraw`,`damregraw`,
                                            `rawstock`, `rawinwout`, `rawmatwise`, `rawmatwisesale`,`rawgrpwisesale`, `partygrpwisesale`,
                                            `jobgiven`, `jobord`,`einvoicermgen`,`einvoicermcredgen`, `jobgivenreg`,`jobordreg`,
                                            `jobpend`, -- RAW MATERIAL
                                            `itemgrp`, `item`, `chrateop`, `purchase`, `sale`, `debnote`, `creditnotemulti`, `inwardgst`,
                                            `outwardgst`, `damagedgst`,`debothgst`,`einvoiceslgen`, `einvoicecdgen`, `purchgstreg`, 
                                            `debnotereg`, `debothgstreg`,`salereg`,`crdntreg`, `inwreg`, `damreg`, `jobrecdreg`,`stock`, `inwout`,
                                            `itemwise`, `itemwisesale`, `itemgrpwisesale`,`partygrpwisesalepr`,`jobreceived`,`einvoicepdgen`,
                                            `einvoicepdcredgen`, -- PRODUCT          
                                            `bankrecp`, `bankpay`, `cashrecp`, `cashpay`, `contra`, `journal`, `jventry`, `discgvn`, `discrecd`, `bankrecon`, `ledger`,
                                            `receivable`, `purchase_exp`,`payable`,  `bankrecorep`, `leadparty`, `dailyreport`, `dailyrawreport`,`dailycashrp`,
                                            `bankbook`, `cashbook`, `jvbook`,`discbook`,`jvsingle`,`purchexprep`,`bccrep`, -- ACCOUNTS
                                            `gstr1_1`, `gstr1_1_R`, `gstr1_2`, `gstr1_3`, `gstr1_4`, `gstr1_5`, `gstr1_6`, `gstr1_7`, `gstr1_8`, `gstr1_9`, 
                                            `gstr1_10`, `gstr1_11`, `gstr3B`, `pugstrep`, `slgstrep`, `gstsumrep`,
                                            `gstr2_4`, `gstr1_10_R`, `gstr2_b2b`, `gstr2_b2br`, -- GST REPORTS
                                            `trbal`, `profit`, `profshar`, `balsheet`, `closestk` -- FINALIZATION
                                            )
                                    VALUES('$qvouch', '$user', '$password', '$spectype', '$usertype', 
                                           '$customer','$agency','$maker','$supplier','$openbal','$transport','$color','$bank','$cash',
                                           '$expense','$group','$otherac', -- MASTERS
                                           '$rawmatgrp','$rawmat','$rawchrateop','$purchmatgst','$debnoterawgst','$debothgst_raw',
                                           '$salematgstmulti','$crednoterawgst','$inwardraw', '$outwardraw','$damagedraw',
                                           '$purchrawgstreg','$debnoterawgstreg','$debothrawgstreg','$slmatmultigstreg','$crednoterawgstreg','$inwregraw',
                                           '$outregraw','$damregraw', '$rawstock','$rawinwout','$rawmatwise','$rawmatwisesale',
                                           '$rawgrpwisesale','$partygrpwisesale','$jobgiven', '$jobord','$einvoicermgen','$einvoicermcredgen',
                                           '$jobgivenreg','$jobordreg','$jobpend', -- RAW MATERIAL          
                                           '$itemgrp','$item','$chrateop','$purchase','$sale','$debnote', '$creditnotemulti',
                                           '$inwardgst','$outwardgst','$damagedgst','$debothgst','$einvoiceslgen','$einvoicecdgen',
                                           '$purchgstreg','$debnotereg','$debothgstreg', '$salereg','$crdntreg','$inwreg','$damreg','$jobrecdreg',
                                           '$stock','$inwout','$itemwise','$itemwisesale','$itemgrpwisesale','$partygrpwisesalepr',
                                           '$jobreceived', '$einvoicepdgen','$einvoicepdcredgen', -- PRODUCT
                                           '$bankrecp','$bankpay','$cashrecp','$cashpay','$contra','$journal', '$jventry', '$discgvn','$discrecd','$bankrecon', '$ledger',
                                           '$receivable','$purchase_exp','$payable','$bankrecorep','$leadparty','$dailyreport','$dailyrawreport','$dailycashrp',
                                           '$bankbook','$cashbook','$jvbook','$discbook','$jvsingle','$purchexprep','$bccrep', -- ACCOUNTS
                                           '$gstr1_1','$gstr1_1_R','$gstr1_2','$gstr1_3','$gstr1_4','$gstr1_5','$gstr1_6','$gstr1_7','$gstr1_8','$gstr1_9',
                                           '$gstr1_10', '$gstr1_11','$gstr3B','$pugstrep','$slgstrep','$gstsumrep',
                                           '$gstr2_4', '$gstr1_10_R','$gstr2_b2b','$gstr2_b2br',  -- GST REPORTS
                                           '$trbal','$profit','$profshar','$balsheet', '$closestk' -- FINALIZATION
                                           )") or die(mysqli_error($conn));
            insmess();
            $mvouch = $qvouch;
            header("refresh: 1; $file?$keyfld=$mvouch&mode=edit&spltype=$spectype");
        } else {
            $mvouch = $qvouch;

            $usecode = mysqli_query($conn, "SELECT code FROM `passmain` WHERE user='$username' and `password`='$password' and `spltype`='$spltype'")or die(mysqli_error($conn));
            $getuser = mysqli_fetch_object($usecode);
            $code = $getuser->code;

    mysqli_query($conn, "UPDATE `$maindb` SET  `user`='$user', `password`='$password', `usertype`='$usertype', `spltype`='$spectype',
                                               `customer`='$customer',`agency`='$agency',`maker`='$maker',`supplier`='$supplier', `openbal`='$openbal',
                                               `transport`='$transport', `color`='$color', `bank`='$bank',`cash`='$cash',`expense`='$expense',
                                               `group`='$group', `otherac`='$otherac', -- MASTERS
                                               `rawmatgrp`='$rawmatgrp',`rawmat`='$rawmat',`rawchrateop`='$rawchrateop',`purchmatgst`='$purchmatgst',
                                               `debnoterawgst`='$debnoterawgst',`debothgst_raw`='$debothgst_raw',`salematgstmulti`='$salematgstmulti', 
                                               `crednoterawgst`='$crednoterawgst',`inwardraw`='$inwardraw', `outwardraw`='$outwardraw',`damagedraw`='$damagedraw',
                                               `purchrawgstreg`='$purchrawgstreg',`debnoterawgstreg`='$debnoterawgstreg',`debothrawgstreg`='$debothrawgstreg',`slmatmultigstreg`='$slmatmultigstreg',
                                               `crednoterawgstreg`='$crednoterawgstreg',`inwregraw`='$inwregraw',`outregraw`='$outregraw',`damregraw`='$damregraw',
                                               `rawstock`='$rawstock',`rawinwout`='$rawinwout',`rawmatwise`='$rawmatwise',`rawmatwisesale`='$rawmatwisesale',
                                               `rawgrpwisesale`='$rawgrpwisesale',`partygrpwisesale`='$partygrpwisesale', `jobgiven`='$jobgiven',`jobord`='$jobord',
                                               `einvoicermgen`='$einvoicermgen',`einvoicermcredgen`='$einvoicermcredgen',`jobgivenreg`='$jobgivenreg',
                                               `jobordreg`='$jobordreg', `jobpend`='$jobpend', -- RAW MATERIAL                                               
                                               `itemgrp`='$itemgrp', `item`='$item',`chrateop`='$chrateop', `purchase`='$purchase',`sale`='$sale',`debnote`='$debnote',
                                               `creditnotemulti`='$creditnotemulti',`inwardgst`='$inwardgst',`outwardgst`='$outwardgst', `damagedgst`='$damagedgst',
                                               `debothgst`='$debothgst',`einvoiceslgen`='$einvoiceslgen',`einvoicecdgen`='$einvoicecdgen',`purchgstreg`='$purchgstreg',
                                               `debnotereg`='$debnotereg',`debothgstreg`='$debothgstreg',`salereg`='$salereg',`crdntreg`='$crdntreg',`inwreg`='$inwreg',`damreg`='$damreg',
                                               `jobrecdreg`='$jobrecdreg', `stock`='$stock',`inwout`='$inwout', `itemwise`='$itemwise',`itemwisesale`='$itemwisesale',
                                               `itemgrpwisesale`='$itemgrpwisesale',`partygrpwisesalepr`='$partygrpwisesalepr',`jobreceived`='$jobreceived',
                                               `einvoicepdgen`='$einvoicepdgen',`einvoicepdcredgen`='$einvoicepdcredgen', -- PRODUCT 
                                               `bankrecp`='$bankrecp',`bankpay`='$bankpay',`cashrecp`='$cashrecp',`cashpay`='$cashpay',`contra`='$contra',
                                               `journal`='$journal', `jventry`='$jventry', `discgvn`='$discgvn',`discrecd`='$discrecd',`bankrecon`='$bankrecon',`ledger`='$ledger',
                                               `receivable`='$receivable',`purchase_exp`='$purchase_exp',`payable`='$payable',`bankrecorep`='$bankrecorep',`leadparty`='$leadparty',
                                               `dailyreport`='$dailyreport',`dailyrawreport`='$dailyrawreport',`dailycashrp`='$dailycashrp',`bankbook`='$bankbook',
                                               `cashbook`='$cashbook', `jvbook`='$jvbook',`discbook`='$discbook',`jvsingle`='$jvsingle', `purchexprep`='$purchexprep', `bccrep`='$bccrep', -- ACCOUNTS
                                               `gstr1_1`='$gstr1_1',`gstr1_1_R`='$gstr1_1_R', `gstr1_2`='$gstr1_2',`gstr1_3`='$gstr1_3', `gstr1_4`='$gstr1_4',
                                               `gstr1_5`='$gstr1_5',`gstr1_6`='$gstr1_6', `gstr1_7`='$gstr1_7',`gstr1_8`='$gstr1_8',`gstr1_9`='$gstr1_9',
                                               `gstr1_10`='$gstr1_10', `gstr1_11`='$gstr1_11',`gstr3B`='$gstr3B',`pugstrep`='$pugstrep', `slgstrep`='$slgstrep',
                                               `gstsumrep`='$gstsumrep',`gstr2_4`='$gstr2_4',`gstr1_10_R`='$gstr1_10_R', `gstr2_b2b`='$gstr2_b2b', 
                                               `gstr2_b2br`='$gstr2_b2br', -- GST REPORTS
                                               `trbal`='$trbal',`profit`='$profit',`profshar`='$profshar',`balsheet`='$balsheet', `closestk`='$closestk' WHERE code = '$mvouch'") or die(mysqli_error($conn));
            updmess();
//            browse($spectype);
            header("refresh: 1; $file?$keyfld=$mvouch&spltype=$spectype&mode=edit");
        }
    }
}

if ($addflag != 1) {

    $getvouch = '';
    if ($addflag == 0) {
        $getvouch = $_GET[$keyfld];
    } else {
        $getvouch = $qvouch;
    }
//    browse($speccond);
    $result = mysqli_query($conn, "SELECT * FROM `$maindb` WHERE $keyfld='$getvouch' $keycond") or die(mysqli_error($conn));
    $get = mysqli_fetch_array($result);
}

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

/* DELETE */
if (isset($_GET["delete"])) {
    delete($zdb, "$maindb", "$keyfld", $_GET[$keyfld], "$file?mode=last&spltype=$spectype");
}
?>
<?php include("includes/linkshead.php"); ?>
<style>
    input[type = checkbox]{
        width: 20px;
        height: 20px;
    }
</style>
<script src="MyScript/user_obd.js" type="text/javascript"></script>
<body>
     <!--Default box--> 
    <form action='' method='POST'>
         <!--Default box--> 
        <div class="">
            <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>
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <label class="col-sm-3 control-label marg">User Name</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control form" name="user" placeholder="User Name" autocomplete="off" value='<? echo ($addflag != 1) ? $get['user'] : ''; ?>' required="" autofocus>
                            </div>
                        </div>
                        <div class="row">
                            <label class="col-sm-3 control-label marg">Password</label>
                            <div class="col-sm-6">
                                <input type="password" class="form-control form" name="password" id="pass" autocomplete="off" placeholder="Password" value='<? echo ($addflag != 1) ? $get['password'] : ''; ?>' required="">
                            </div>
                        </div>
                        <div class="row">
                            <label class="col-sm-3 control-label marg">Confirm Pass</label>
                            <div class="col-sm-6">
                                <input type="password" name="confpass" id="confpass" class="form-control form"  placeholder="Cofirm Password" required="" value='<? echo ($addflag != 1) ? $get['password'] : ''; ?>'>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6">
                                <p id="alert"></p>
                            </div>
                        </div>
                        <div class="row">
                            <label class="col-sm-3 control-label marg">User Type</label>
                            <div class="col-sm-6">

                                <select class='form-control select2 form' name="usertype" id="usertype">                                    
                                    <?php
                                    if ($addflag != 1) {
                                        $usertyp = "";
                                        if ($get['usertype'] == 1) {
                                            $ucode = "1";
                                            $usertyp = "Admin";
                                        }
                                        if ($get['usertype'] == 2) {
                                            $ucode = "2";
                                            $usertyp = "Supervisor";
                                        }
                                        if ($get['usertype'] == 3) {
                                            $ucode = "3";
                                            $usertyp = "Staff";
                                        }
                                        echo "<option value='$ucode'>$usertyp</option>";
                                    }
                                    ?>
                                    <option value=""></option>
                                    <option value="3">Staff</option>
                                    <option value="2">Supervisor</option>
                                    <option value="1">Admin</option>
                                </select>
                            </div>
                        </div>
                        <?php
                        if ($spectype == "1") {
                            ?>
                            <!-- <div class="row">
                                <label class="col-sm-4 control-label marg">Special</label>
                                <div class="col-sm-2" style="margin-top:6px">
                                    <input type="checkbox" class="form  spltype" id="spltype" name="spltype" value="1" <?
                                    // if ($get['spltype'] == 1) {
                                    //     Echo "checked";
                                    // }
                                    ?> required>
                                </div>
                            </div> -->
                        <?php } ?>
                       <div class="nav-tabs-custom">
                            <ul class="nav nav-tabs">
                                <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">Masters</a></li>
                                <li class=""><a href="#tab_2" data-toggle="tab" aria-expanded="false">Raw Material</a></li>
                                <li class=""><a href="#tab_3" data-toggle="tab" aria-expanded="false">Product</a></li>
                                <li class=""><a href="#tab_4" data-toggle="tab" aria-expanded="false">Accounts</a></li>
                                <li class=""><a href="#tab_5" data-toggle="tab" aria-expanded="false">GST Reports</a></li>
                                <li class=""><a href="#tab_6" data-toggle="tab" aria-expanded="false">Finalization</a></li>
                            </ul>
                            <div class="tab-content">
                                <!-- TAB_1 STARTS FROM HERE -->
                                <div class="tab-pane active" id="tab_1">
                                    <div class="row">
                                        <label class="col-sm-6 control-label marg selectall">Select All/UnSelect All</label>
                                        <div class="col-sm-1" style="margin-top:6px">
                                            <input type="checkbox" class="form " id="Smasters" value="1">
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Customer</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  masters" id="customer" name="customer" value="1" <?
                                            if ($get['customer'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Agency</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  masters" id="agency" name="agency" value="1" <?
                                            if ($get['agency'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Maker / Karigar</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  masters" id="maker" name="maker" value="1" <?
                                            if ($get['maker'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Supplier</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  masters" id="supplier" name="supplier" value="1" <?
                                            if ($get['supplier'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Opening Balance</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  masters" id="openbal" name="openbal" value="1" <?
                                            if ($get['openbal'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Transporter</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  masters" id="transport" name="transport" value="1" <?
                                            if ($get['transport'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Color</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  masters" id="color" name="color" value="1" <?
                                            if ($get['color'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Bank</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  masters" id="bank" name="bank" value="1" <?
                                            if ($get['bank'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Cash</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  masters" id="cash" name="cash" value="1" <?
                                            if ($get['cash'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Expense</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  masters" id="expense" name="expense" value="1" <?
                                            if ($get['expense'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Group</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  masters" id="group" name="group" value="1" <?
                                            if ($get['group'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Other A/C</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  masters" id="otherac" name="otherac" value="1" <?
                                            if ($get['otherac'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                </div>

                            <!-- RAW MATERIAL TAB_2 STARTS FROM HERE -->

                                <div class="tab-pane" id="tab_2">
                                    <div class="row">
                                        <label class="col-sm-6 control-label marg selectall">Select All/UnSelect All</label>
                                        <div class="col-sm-1" style="margin-top:6px">
                                            <input type="checkbox" class="form " id="Srawmaterial" value="1">
                                         
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Raw Material Group</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="rawmatgrp" name="rawmatgrp" value="1" <?
                                            if ($get['rawmatgrp'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Raw Material</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="rawmat" name="rawmat" value="1" <?
                                            if ($get['rawmat'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Change of Rates</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="rawchrateop" name="rawchrateop" value="1" <?
                                            if ($get['rawchrateop'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Purchase Raw Material</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="purchmatgst" name="purchmatgst" value="1" <?
                                            if ($get['purchmatgst'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Purchase Return</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="debnoterawgst" name="debnoterawgst" value="1" <?
                                            if ($get['debnoterawgst'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Purchase Return - Others</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="debothgst_raw" name="debothgst_raw" value="1" <?
                                            if ($get['debothgst_raw'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Sale Raw Material</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="salematgstmulti" name="salematgstmulti" value="1" <?
                                            if ($get['salematgstmulti'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Sale Return</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="crednoterawgst" name="crednoterawgst" value="1" <?
                                            if ($get['crednoterawgst'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Inward Raw Material</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="inwardraw" name="inwardraw" value="1" <?
                                            if ($get['inwardraw'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Outward Raw Material</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="outwardraw" name="outwardraw" value="1" <?
                                            if ($get['outwardraw'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Damaged Raw Material</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="damagedraw" name="damagedraw" value="1" <?
                                            if ($get['damagedraw'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Job Given</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="jobgiven" name="jobgiven" value="1" <?
                                            if ($get['jobgiven'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Job Order</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="jobord" name="jobord" value="1" <?
                                            if ($get['jobord'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                    <label class="col-sm-4 control-label marg">E-Invoice Generation</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="einvoicermgen" name="einvoicermgen" value="1" <?
                                            if ($get['einvoicermgen'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    <label class="col-sm-4 control-label marg">E-Invoice (Credit Note)</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="einvoicermcredgen" name="einvoicermcredgen" value="1" <?
                                            if ($get['einvoicermcredgen'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    <div class="row">
                                        
                                        <label class="col-sm-4 control-label marg">Purchase Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="purchrawgstreg" name="purchrawgstreg" value="1" <?
                                            if ($get['purchrawgstreg'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                            
                                        </div>
                                        <label class="col-sm-4 control-label marg">Purchase Return Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="debnoterawgstreg" name="debnoterawgstreg" value="1" <?
                                            if ($get['debnoterawgstreg'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    <div class="row">    
                                        <label class="col-sm-4 control-label marg">Purchase Return - Others Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="debothrawgstreg" name="debothrawgstreg" value="1" <?
                                            if ($get['debothrawgstreg'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                            
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Sale Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="slmatmultigstreg" name="slmatmultigstreg" value="1" <?
                                            if ($get['slmatmultigstreg'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                            
                                        </div>
                                        <label class="col-sm-4 control-label marg">Sale Return Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="crednoterawgstreg" name="crednoterawgstreg" value="1" <?
                                            if ($get['crednoterawgstreg'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Inward Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="inwregraw" name="inwregraw" value="1" <?
                                            if ($get['inwregraw'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                            
                                        </div>
                                        <label class="col-sm-4 control-label marg">Outward Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="outregraw" name="outregraw" value="1" <?
                                            if ($get['outregraw'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Damaged Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="damregraw" name="damregraw" value="1" <?
                                            if ($get['damregraw'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                            
                                        </div>
                                        <label class="col-sm-4 control-label marg">Job Given Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="jobgivenreg" name="jobgivenreg" value="1" <?
                                            if ($get['jobgivenreg'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Job Order Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="jobordreg" name="jobordreg" value="1" <?
                                            if ($get['jobordreg'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                            
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Stock</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="rawstock" name="rawstock" value="1" <?
                                            if ($get['rawstock'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                            
                                        </div>
                                        <label class="col-sm-4 control-label marg">Pending Job</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="jobpend" name="jobpend" value="1" <?
                                            if ($get['jobpend'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Inward/Outward History</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="rawinwout" name="rawinwout" value="1" <?
                                            if ($get['rawinwout'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                            
                                        </div>
                                        <label class="col-sm-4 control-label marg">Raw Material Wise P/L</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="rawmatwise" name="rawmatwise" value="1" <?
                                            if ($get['rawmatwise'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Raw Material Wise Sale</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="rawmatwisesale" name="rawmatwisesale" value="1" <?
                                            if ($get['rawmatwisesale'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                            
                                        </div>
                                        <label class="col-sm-4 control-label marg">Raw Material Groupwise Sale</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="rawgrpwisesale" name="rawgrpwisesale" value="1" <?
                                            if ($get['rawgrpwisesale'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Partywise Raw Material Group Sale</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  rawmaterial" id="partygrpwisesale" name="partygrpwisesale" value="1" <?
                                            if ($get['partygrpwisesale'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                            
                                        </div>
                                    </div>
                                </div>
                            
                            <!-- PRODUCT TAB_3 STARTS FROM HERE -->

                                <div class="tab-pane" id="tab_3">
                                    <div class="row">
                                        <label class="col-sm-6 control-label marg selectall">Select All/UnSelect All</label>
                                        <div class="col-sm-4" style="margin-top:6px">
                                            <input type="checkbox" class="form" id="Sproduct" value="1">
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Product Group</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="itemgrp" name="itemgrp" value="1" <?
                                            if ($get['itemgrp'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Product</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="item" name="item" value="1" <?
                                            if ($get['item'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Change of Rates</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="chrateop" name="chrateop" value="1" <?
                                            if ($get['chrateop'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Purchase</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="purchase" name="purchase" value="1" <?
                                            if ($get['purchase'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Sale</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="sale" name="sale" value="1" <?
                                            if ($get['sale'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Purchase Return</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="debnote" name="debnote" value="1" <?
                                            if ($get['debnote'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Purchase Return - Others </label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="debothgst" name="debothgst" value="1" <?
                                            if ($get['debothgst'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Sale Return/Credit Note - Goods Return</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="creditnotemulti" name="creditnotemulti" value="1" <?
                                            if ($get['creditnotemulti'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    
                                    <div class="row">
                                    <label class="col-sm-4 control-label marg">Inward</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="inwardgst" name="inwardgst" value="1" <?
                                            if ($get['inwardgst'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Outward</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="outwardgst" name="outwardgst" value="1" <?
                                            if ($get['outwardgst'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                    <label class="col-sm-4 control-label marg">Damaged</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="damagedgst" name="damagedgst" value="1" <?
                                            if ($get['damagedgst'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Job Received</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="jobreceived" name="jobreceived" value="1" <?
                                            if ($get['jobreceived'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    
                                    <div class="row">
                                    <label class="col-sm-4 control-label marg">E-Invoice Generation</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="einvoicepdgen" name="einvoicepdgen" value="1" <?
                                            if ($get['einvoicepdgen'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    <label class="col-sm-4 control-label marg">E-Invoice (Credit Note)</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="einvoicepdcredgen" name="einvoicepdcredgen" value="1" <?
                                            if ($get['einvoicepdcredgen'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        </div>
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Purchase Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="purchgstreg" name="purchgstreg" value="1" <?
                                            if ($get['purchgstreg'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Sale Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="salereg" name="salereg" value="1" <?
                                            if ($get['salereg'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Purchase Return Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="debnotereg" name="debnotereg" value="1" <?
                                            if ($get['debnotereg'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Sale Return / Credit Note Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="crdntreg" name="crdntreg" value="1" <?
                                            if ($get['crdntreg'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Purchase Return - Others Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="debothgstreg" name="debothgstreg" value="1" <?
                                            if ($get['debothgstreg'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Inward Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="inwreg" name="inwreg" value="1" <?
                                            if ($get['inwreg'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Damaged Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="damreg" name="damreg" value="1" <?
                                            if ($get['damreg'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Job Received Register</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="jobrecdreg" name="jobrecdreg" value="1" <?
                                            if ($get['jobrecdreg'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Stock</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="stock" name="stock" value="1" <?
                                            if ($get['stock'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Inward/Outward History</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="inwout" name="inwout" value="1" <?
                                            if ($get['inwout'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Itemwise P/L</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="itemwise" name="itemwise" value="1" <?
                                            if ($get['itemwise'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Itemwise Sale</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="itemwisesale" name="itemwisesale" value="1" <?
                                            if ($get['itemwisesale'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Item Groupwise Sale</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="itemgrpwisesale" name="itemgrpwisesale" value="1" <?
                                            if ($get['itemgrpwisesale'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Partywise Item Group Sale</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  product" id="partygrpwisesalepr" name="partygrpwisesalepr" value="1" <?
                                            if ($get['partygrpwisesalepr'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                </div>

                            <!-- Accounts TAB_4 STARTS FROM HERE -->
                                <div class="tab-pane" id="tab_4">
                                    <div class="row">
                                        <label class="col-sm-6 control-label marg selectall">Select All/UnSelect All</label>
                                        <div class="col-sm-4" style="margin-top:6px">
                                            <input type="checkbox" class="form " id="Saccounts" value="1">
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Bank Receipt</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="bankrecp" name="bankrecp" value="1" <?
                                            if ($get['bankrecp'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Bank Payment</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="bankpay" name="bankpay" value="1" <?
                                            if ($get['bankpay'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Cash Receipt</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="cashrecp" name="cashrecp" value="1" <?
                                            if ($get['cashrecp'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Cash Payment</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="cashpay" name="cashpay" value="1" <?
                                            if ($get['cashpay'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Contra</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="contra" name="contra" value="1" <?
                                            if ($get['contra'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Journal</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="journal" name="journal" value="1" <?
                                            if ($get['journal'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Discount Given</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="discgvn" name="discgvn" value="1" <?
                                            if ($get['discgvn'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Discount Received</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="discrecd" name="discrecd" value="1" <?
                                            if ($get['discrecd'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Bank Reconcilation</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="bankrecon" name="bankrecon" value="1" <?
                                            if ($get['bankrecon'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Purchase Expense</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="purchase_exp" name="purchase_exp" value="1" <?
                                            if ($get['purchase_exp'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Single JV</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="jventry" name="jventry" value="1" <?
                                            if ($get['jventry'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>

                                        <label class="col-sm-4 control-label marg">Ledger</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="ledger" name="ledger" value="1" <?
                                            if ($get['ledger'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">O/s Receivable</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="receivable" name="receivable" value="1" <?
                                            if ($get['receivable'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">O/s Payable</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="payable" name="payable" value="1" <?
                                            if ($get['payable'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Reconcilation Report</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="bankrecorep" name="bankrecorep" value="1" <?
                                            if ($get['bankrecorep'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Leading Parties</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="leadparty" name="leadparty" value="1" <?
                                            if ($get['leadparty'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                    <label class="col-sm-4 control-label marg">Daily Report</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="dailyreport" name="dailyreport" value="1" <?
                                            if ($get['dailyreport'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Daily Cash</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="dailycashrp" name="dailycashrp" value="1" <?
                                            if ($get['dailycashrp'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    
                                    <div class="row">
                                    <label class="col-sm-4 control-label marg">Bank Book</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="bankbook" name="bankbook" value="1" <?
                                            if ($get['bankbook'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Cash Book</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="cashbook" name="cashbook" value="1" <?
                                            if ($get['cashbook'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Journal Book</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="jvbook" name="jvbook" value="1" <?
                                            if ($get['jvbook'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Purchase Expense Report</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="purchexprep" name="purchexprep" value="1" <?
                                            if ($get['purchexprep'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Daily Report (Raw)</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="dailyrawreport" name="dailyrawreport" value="1" <?
                                            if ($get['dailyrawreport'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Bank/Cash/Contra Tally Report</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="bccrep" name="bccrep" value="1" <?
                                            if ($get['bccrep'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Discount Book</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="discbook" name="discbook" value="1" <?
                                            if ($get['discbook'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">JV Single</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  accounts" id="jvsingle" name="jvsingle" value="1" <?
                                            if ($get['jvsingle'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                </div> 

                                <!-- Accounts TAB_5 STARTS FROM HERE -->
                                <div class="tab-pane" id="tab_5">
                                    <div class="row">
                                        <label class="col-sm-6 control-label marg selectall">Select All/UnSelect All</label>
                                        <div class="col-sm-4" style="margin-top:6px">
                                            <input type="checkbox" class="form " id="Sgstreports" value="1">
                                        </div>
                                    </div>
                                    
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">B2B For Product</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr1_1" name="gstr1_1" value="1" <?
                                            if ($get['gstr1_1'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">B2B For Raw Material</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr1_1_R" name="gstr1_1_R" value="1" <?
                                            if ($get['gstr1_1_R'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Credit Debit Note (Product)</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr2_4" name="gstr2_4" value="1" <?
                                            if ($get['gstr2_4'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Credit Debit Note (Raw)</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr1_4" name="gstr1_4" value="1" <?
                                            if ($get['gstr1_4'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">HSN Summary - Product</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr1_10" name="gstr1_10" value="1" <?
                                            if ($get['gstr1_10'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">HSN Summary - Raw</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr1_10_R" name="gstr1_10_R" value="1" <?
                                            if ($get['gstr1_10_R'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    <div class="row">
                                    <label class="col-sm-4 control-label marg">B2B - Product (Purchase)</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr2_b2b" name="gstr2_b2b" value="1" <?
                                            if ($get['gstr2_b2b'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    <label class="col-sm-4 control-label marg">B2B - Raw Material (Purchase)</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr2_b2br" name="gstr2_b2br" value="1" <?
                                            if ($get['gstr2_b2br'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    <div class="row">
                                    <label class="col-sm-4 control-label marg">Credit Debit Note for URD</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr1_5" name="gstr1_5" value="1" <?
                                            if ($get['gstr1_5'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <!-- <label class="col-sm-4 control-label marg">Export</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr1_6" name="gstr1_6" value="1" <?
                                            if ($get['gstr1_6'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div> -->
                                    </div>
                                    <!-- <div class="row">
                                        <label class="col-sm-4 control-label marg">Advanced Adjusted</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr1_8" name="gstr1_8" value="1" <?
                                            if ($get['gstr1_8'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Nil / Exempted / Non GST</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr1_9" name="gstr1_9" value="1" <?
                                            if ($get['gstr1_9'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div> -->
                                    <!-- <div class="row">
                                        <label class="col-sm-4 control-label marg">B2B Large</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr1_2" name="gstr1_2" value="1" <?
                                            if ($get['gstr1_2'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">B2B Small</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr1_3" name="gstr1_3" value="1" <?
                                            if ($get['gstr1_3'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div> -->
                                    <!-- <div class="row">
                                        <label class="col-sm-4 control-label marg">HSN Summary</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr1_10" name="gstr1_10" value="1" <?
                                            if ($get['gstr1_10'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Document Summary</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr1_11" name="gstr1_11" value="1" <?
                                            if ($get['gstr1_11'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div> -->
                                    <!-- <div class="row">
                                        <label class="col-sm-4 control-label marg">GSTR - B</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr3B" name="gstr3B" value="1" <?
                                            if ($get['gstr3B'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">GST Purchase</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="pugstrep" name="pugstrep" value="1" <?
                                            if ($get['pugstrep'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div> -->
                                    <!-- <div class="row">
                                        <label class="col-sm-4 control-label marg">GST Sale</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="slgstrep" name="slgstrep" value="1" <?
                                            if ($get['slgstrep'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">GST Summary</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstsumrep" name="gstsumrep" value="1" <?
                                            if ($get['gstsumrep'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div> -->
                                    <!-- <div class="row">
                                        <label class="col-sm-4 control-label marg">Advanced Receipt</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr1_7" name="gstr1_7" value="1" <?
                                            if ($get['gstr1_7'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">HSN Summary - Raw Material</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  gstreports" id="gstr1_10_R" name="gstr1_10_R" value="1" <?
                                            // if ($get['gstr1_10_R'] == 1) {
                                            //     Echo "checked";
                                            // }
                                            ?>>
                                        </div>
                                    </div> -->
                                </div>

                                <!-- Finalization TAB_6 STARTS FROM HERE -->
                                <div class="tab-pane" id="tab_6">
                                    <div class="row">
                                        <label class="col-sm-6 control-label marg selectall">Select All/UnSelect All</label>
                                        <div class="col-sm-4" style="margin-top:6px">
                                            <input type="checkbox" class="form " id="Sfinalization" value="1">
                                        </div>
                                    </div>
                                    
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Trial Balance</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  finalization" id="trbal" name="trbal" value="1" <?
                                            if ($get['trbal'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Profit / Loss</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  finalization" id="profit" name="profit" value="1" <?
                                            if ($get['profit'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Profit Sharing</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  finalization" id="profshar" name="profshar" value="1" <?
                                            if ($get['profshar'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                        <label class="col-sm-4 control-label marg">Balance Sheet</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  finalization" id="balsheet" name="balsheet" value="1" <?
                                            if ($get['balsheet'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                    
                                    <div class="row">
                                        <label class="col-sm-4 control-label marg">Closing Stock</label>
                                        <div class="col-sm-2" style="margin-top:6px">
                                            <input type="checkbox" class="form  finalization" id="closestk" name="closestk" value="1" <?
                                            if ($get['closestk'] == 1) {
                                                Echo "checked";
                                            }
                                            ?>>
                                        </div>
                                    </div>
                                </div>
                            </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 pad">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">Year Details</h3>
                        <div class="actions pull-right">
                            <i class="fa fa-chevron-down"></i>
                        </div>
                    </div>
                
                    <div class="panel-body">
                        <div class="table-responsive">
                            <table class="table table-striped table-condensed table-bordered" width="100%">
                                <thead  class="mySearchTr">
                                    <tr>
                                        <th width="3%"></th>
                                        <th width="17%">Company</th>
                                        <th width="10%">Year</th>
                                        <th width="10%">Name</th>
                                        <th width="10%">From</th>
                                        <th width="10%">To</th>
                                    </tr>
                                </thead>
                                <tbody class="tbody">
                                    <?php
                                    if ($addflag != 1) {
                                        $ctr = 0;
                                        $gettran = mysqli_query($conn, "SELECT `cono`,`cname`,`finyear`,`startdate`,`lastdate`,`yearname` FROM `usercomp`
                                                                         WHERE `username`='$get[code]'  ORDER BY `cono`")or die(mysqli_error($conn));
 
                                        while ($tran = mysqli_fetch_array($gettran)) {
                                            $fetcomp = mysqli_query($conn, "SELECT `code`,`name` FROM `company` WHERE `code`='$tran[cono]'")or die(mysqli_error($conn));
                                            $fcomp = mysqli_fetch_array($fetcomp);

                                            $fetyear = mysqli_query($conn, "SELECT `finyear` FROM `compyear` WHERE `finyear`='$tran[finyear]'")or die(mysqli_error($conn));
                                            $fyear = mysqli_fetch_array($fetyear);

                                            Echo "<tr>";
                                            Echo "<td><i class='fa fa-close remove' style='display:none;'></i></td>";
                                            Echo "<td>";
                                            Echo "<select class='form-control form cono select2' name='cono_$ctr' style='width:100%'>";
                                            Echo "<option value='$fcomp[code]'>$fcomp[name]</option>";
                                            $gcomp = mysqli_query($conn, "SELECT `code`,`name` FROM `company` where code !='' $speccond")or die(mysqli_error($conn));
                                            while ($comp = mysqli_fetch_array($gcomp)) {
                                                Echo "<option value='$comp[code]'>$comp[name]</option>";
                                            }
                                            Echo "</select>";
                                            Echo "</td>";
                                            Echo "<td>";
                                            Echo "<select class='form-control form finyear select2' name='finyear_$ctr' style='width:100%'>";
                                            Echo "<option value='$fyear[finyear]'>$fyear[finyear]</option>";

                                            $gyear = mysqli_query($conn, "SELECT `finyear` FROM `compyear` where finyear != '' group by finyear")or die(mysqli_error($conn));
                                            while ($year = mysqli_fetch_array($gyear)) {
                                                Echo "<option value='$year[finyear]'>$year[finyear]</option>";
                                            }
                                            Echo "</select>";
                                            Echo "</td>";
                                            Echo "<td><input type='text' class='form-control form yearname' name='yearname_$ctr' value='$tran[yearname]' readonly></td>";
                                            Echo "<td><input type='text' class='form-control form startdate' name='startdate_$ctr' value='$tran[startdate]' readonly></td>";
                                            Echo "<td><input type='text' class='form-control form lastdate' name='lastdate_$ctr' value='$tran[lastdate]' readonly></td>";
                                            Echo "</tr >";
                                            $ctr++;
                                        }
                                    } else {
                                        ?>
                                        <tr>
                                            <td><i class='fa fa-close remove'></i></td>
                                            <td>
                                                <select class="form-control form cono select2" name="cono_0" style='width:100%' required>
                                                    <option value=""></option>
                                                    <?php
                                                    $gcomp = mysqli_query($conn, "SELECT `code`,`name` FROM `company` where code !='' $speccond")or die(mysqli_error($conn));

                                                    while ($comp = mysqli_fetch_array($gcomp)) {
                                                        Echo "<option value='$comp[code]'>$comp[name]</option>";
                                                    }
                                                    ?>
                                                </select>
                                            </td>
                                            <td>
                                                <select class="form-control form finyear select2" name="finyear_0" style='width:100%' required>
                                                    <option value=""></option>
                                                    <?php
                                                    $gyear = mysqli_query($conn, "SELECT `finyear` FROM `compyear` group by finyear")or die(mysqli_error($conn));
                                                    while ($year = mysqli_fetch_array($gyear)) {
                                                        Echo "<option value='$year[finyear]'>$year[finyear]</option>";
                                                    }
                                                    ?>
                                                </select>
                                            </td>
                                            <td><input type="text" class="form-control form yearname" name="yearname_0" value="" readonly></td>
                                            <td><input type="text" class="form-control form startdate" name="startdate_0" value="" readonly></td>
                                            <td><input type="text" class="form-control form lastdate" name="lastdate_0" value="" readonly></td>
                                        </tr>  
                                        <?
                                    }
                                    ?>
                                </tbody>
                            </table>
                        </div>
                        <div class="col-lg-12 pad">
                            <button type="button" class="btn btn-primary btn-square form"  id="addnew">
                                <i class="fa fa-plus" data-toggle='tooltip' title='Add Row'></i>    
                            </button>
                            <input type="hidden" id="items" name="items" value="<?php echo ($addflag != 1) ? $ctr : 1; ?>" />  
                        </div>
                    
                
           
                    </div>
                </div>
            </div>
        </div>
    </form>
    <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>code</th>
                                    <th>Name</th>
                                    <th>Action</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                if ($addflag != 1) {
                                    $srchresult = mysqli_query($conn, "SELECT * FROM `$maindb` where code!='' $keycond")or die(mysqli_error($conn));
                                    while ($row = mysqli_fetch_array($srchresult)) {
                                        echo "<tr>";
                                        echo "<td align='left'>$row[code]</td>";
                                        echo "<td align='left'>$row[user]</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>
</body>
</html>
<?php include("includes/linksfoot.php"); ?>