<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); 

//define('SITEURL','http://localhost/design2/');
include('database_connection.php');
if(isset($_POST['submit']))
{
  $COAName=$_POST['AccountName'];  
  $Attr2=$_POST['Attr2'];//Customer Type
  $Attr3=$_POST['Attr3'];//   as State
  $Attr4=$_POST['Attr4'];// as License
  $Attr5=$_POST['Attr5'];// as BusinessArea
  $Attr6=$_POST['Attr6'];// as Address
  $Attr8=$_POST['Attr8'];//as Fax
  $Attr9=$_POST['Attr9'];//  as Tel
  $Attr10=$_POST['Attr10'];//  as Mobile 
  $Attr11=$_POST['Attr11'];//  as email
  $Attr12=$_POST['Attr12'];//  as ContactPerson
  $Attr15=$_POST['Attr15'];//  as Trn
  $Attr16=$_POST['Attr16'];// as LicenseExpiryDate
  $Attr17=$_POST['Attr17'];// as website
  //$Attr18=$_POST['Attr18'];// as VatRegdate
/*  $Attr19=$_POST['Attr19'];//
  $Attr20=$_POST['Attr20'];
*/ 
  $Attr21=$_POST['Attr21'];//as NoOfVehicles
  $Attr22=$_POST['Attr22'];//  as NoOfEmployees
  $Attr23=$_POST['Attr23'];//  as WorkCompetitor
  $Attr24=$_POST['Attr24'];//as AnnualTurnOver
  $ContactPerson1=$_POST['ContactPerson1'];
  $ContactDesignation1=$_POST['ContactDesignation1'];
  $ContactPerson2=$_POST['ContactPerson2'];
  $ContactDesignation2=$_POST['ContactDesignation2'];
  $ContactPerson3=$_POST['ContactPerson3'];
  $ContactDesignation3=$_POST['ContactDesignation3'];


$Attr5=11;//rent a car business
  $Under=54;
  $Degree=5;
  $Active=1;
  $NatureID=14;
  $TableID=2;
  $GLCode="1.1.2.1.".generateCode($Under,$NatureID,$connection);
$COAID=getCOAID($connection);
 $sqlinsert="insert into Accounts (COAID,COAName,Degree,Under,Active,NatureID,TableID, GLCode,
  Attr2,Attr3,Attr4,Attr5,Attr6,Attr8 
  ,Attr9,Attr10, Attr11,Attr12,Attr15,Attr16,Attr17,
  Attr21,Attr22,Attr23,Attr24,ContactPerson1,ContactDesignation1,ContactPerson2,ContactDesignation2,ContactPerson3,ContactDesignation3) values('$COAID','$COAName','$Degree','$Under','$Active','$NatureID','$TableID','$GLCode','$Attr2','$Attr3','$Attr4','$Attr5','$Attr6','$Attr8 
  ','$Attr9','$Attr10','$Attr11','$Attr12','$Attr15','$Attr16','$Attr17 ','$Attr21','$Attr22','$Attr23','$Attr24','$ContactPerson1','$ContactDesignation1','$ContactPerson2','$ContactDesignation2','$ContactPerson3','$ContactDesignation3')";
odbc_exec($connection,$sqlinsert);
echo "<script>alert('Dealer Created Sucessfully');</script>";
}
function getCOAID($connection)
{
    $sql="select max(COAID) as total from accounts";
     $result=odbc_exec($connection,$sql);
    while($row=odbc_fetch_array($result))
    {
            $total=$row['total'];
            $total=$total+1;
    }
return $total;
}
function generateCode($under,$NatureID,$connection)
{
    $total=1;
   echo $sql="select count(COAID) as total from accounts where under='$under' and NatureID='$NatureID'";
    $result=odbc_exec($connection,$sql);
    while($row=odbc_fetch_array($result))
    {
            $total=$row['total'];
            $total=$total+1;
    }
return $total;
}
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="author" content="ITS Circle LLC">
    <link rel="icon" href="<?php echo SITEURL;?>assets/images/favicon.png" type="image/x-icon" />
    <link rel="shortcut icon" href="<?php echo SITEURL;?>assets/images/favicon.png" type="image/x-icon" />
    <title>Sub-Page</title>

    <!--JSGrid css-->
    <link rel="stylesheet" type="text/css" href="<?php echo SITEURL;?>assets/css/datatables.css" />

    <!--Google font-->
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Raleway:300,400,500,600,700" rel="stylesheet">

    <!-- Font Awesome -->
    <link rel="stylesheet" type="text/css" href="<?php echo SITEURL;?>assets/css/fontawesome.css">

    <!-- ico-font -->
    <link rel="stylesheet" type="text/css" href="<?php echo SITEURL;?>assets/css/icofont.css">

    <!-- Themify icon -->
    <link rel="stylesheet" type="text/css" href="<?php echo SITEURL;?>assets/css/themify.css">

    <!-- Flag icon -->
    <link rel="stylesheet" type="text/css" href="<?php echo SITEURL;?>assets/css/flag-icon.css">

    <!-- prism css -->
    <link rel="stylesheet" type="text/css" href="<?php echo SITEURL;?>assets/css/prism.css">

    <!-- Tour css -->
    <link rel="stylesheet" type="text/css" href="<?php echo SITEURL;?>assets/css/tour.css">

    <!-- Owl css -->
    <link rel="stylesheet" type="text/css" href="<?php echo SITEURL;?>assets/css/owlcarousel.css">

    <!-- Bootstrap css -->
    <link rel="stylesheet" type="text/css" href="<?php echo SITEURL;?>assets/css/bootstrap.css">

    <!-- App css -->
    <link rel="stylesheet" type="text/css" href="<?php echo SITEURL;?>assets/css/style.css">

    <!-- Chartist -->
    <link rel="stylesheet" type="text/css" href="<?php echo SITEURL;?>assets/css/chartist.css">

    <!-- Responsive css -->
    <link rel="stylesheet" type="text/css" href="<?php echo SITEURL;?>assets/css/responsive.css">

    <!-- DatePicker css -->
    <link rel="stylesheet" type="text/css" href="<?php echo SITEURL;?>assets/css/date-picker.css">

    <!--Select2 css-->
    <link rel="stylesheet" type="text/css" href="<?php echo SITEURL;?>assets/css/select2.css" />

    <!-- Animate icon -->
    <link rel="stylesheet" href="<?php echo SITEURL;?>assets/css/animate.css">

    <style>

        table#invoice {
            table-layout: fixed;
        }

        table#invoice {
            font-size: small;
        }

        .tabbed-card .col-1,
        .col-2,
        .col-3,
        .col-4,
        .col-5,
        .col-6,
        .col-7,
        .col-8,
        .col-9,
        .col-10,
        .col-11,
        .col-12,
        .col,
        .col-auto,
        .col-sm-1,
        .col-sm-2,
        .col-sm-3,
        .col-sm-4,
        .col-sm-5,
        .col-sm-6,
        .col-sm-7,
        .col-sm-8,
        .col-sm-9,
        .col-sm-10,
        .col-sm-11,
        .col-sm-12,
        .col-sm,
        .col-sm-auto,
        .col-md-1,
        .col-md-2,
        .col-md-3,
        .col-md-4,
        .col-md-5,
        .col-md-6,
        .col-md-7,
        .col-md-8,
        .col-md-9,
        .col-md-10,
        .col-md-11,
        .col-md-12,
        .col-md,
        .col-md-auto,
        .col-lg-1,
        .col-lg-2,
        .col-lg-3,
        .col-lg-4,
        .col-lg-5,
        .col-lg-6,
        .col-lg-7,
        .col-lg-8,
        .col-lg-9,
        .col-lg-10,
        .col-lg-11,
        .col-lg-12,
        .col-lg,
        .col-lg-auto,
        .col-xl-1,
        .col-xl-2,
        .col-xl-3,
        .col-xl-4,
        .col-xl-5,
        .col-xl-6,
        .col-xl-7,
        .col-xl-8,
        .col-xl-9,
        .col-xl-10,
        .col-xl-11,
        .col-xl-12,
        .col-xl,
        .col-xl-auto {
            padding-left: 4px !important;
            padding-right: 4px !important;

        }

        #select2-cheque_cboVendor-container {
            font-size: smaller;
        }

        .card.full-card {
            top: 0px !important;
            left: 0px !important;
            right: 0px !important;
            height: 100% !important;
            width: 100% !important;
        }

        .lbl_edit {
            color: blue;
            text-align: center;
        }
    </style>


</head>

<body>

    <!-- Loader starts -->
    <div class="loader-wrapper">
        <div class="loader bg-white">
            <div class="line"></div>
            <div class="line"></div>
            <div class="line"></div>
            <div class="line"></div>
            <h4>Have a great day at work today <span>&#x263A;</span></h4>
        </div>
    </div>
    <!-- Loader ends -->

    <!--page-wrapper Start-->
    <div class="page-wrapper">

        <!--Page Body Start-->
        <div class="page-body-wrapper">

            <!--Page Body Start-->
            <div class="page-body" style="margin-top:0!important">

                <!-- Container-fluid starts -->
                <div class="container-fluid">

                    <div class="row">
                        <div class="col-sm-12 col-xl-12 xl-100">
                            <div class="card">
                                <div class="card-header">
                                    <h5>Dealers Accounts</h5>
                                    <span>Use this form to define customer accounts.</span>
                                    <div class="card-header-right">
                                        <i class="icofont icofont-maximize full-card"></i>
                                        <i class="icofont icofont-minus minimize-card"></i>
                                    </div>
                                </div>

                                <div class="card-body">
                                    <ul class="nav nav-tabs" id="myTab" role="tablist">
                                        <li class="nav-item">
                                            <a class="nav-link active" id="supplier-tabs" data-toggle="tab"
                                                href="#supplier" role="tab" aria-controls="supplier"
                                                aria-selected="true">Search</a>
                                        </li>

                                        <li class="nav-item">
                                            <a class="nav-link" id="basic-tab" data-toggle="tab" href="#basic"
                                                role="tab" aria-controls="basic" aria-selected="false">Basic</a>
                                        </li>

                                    </ul>
                                    <div class="tab-content" id="myTabContent">

                                        <div class="tab-pane fade" id="basic" role="tabpanel"
                                            aria-labelledby="basic-tab">
<!-- onsubmit="return false;"-->
                                         <form id="InvoiceForm" method="post">
                                                <div class="row m-20 form-group">
                                                    <h5>
                                                        <span class="lbl_edit" id="RetreiveKeyField"></span>
                                                    </h5>
                                                </div>


                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Dealer Name</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" class="form-control" aria-describedby="basic-addon2" placeholder="Dealer Name" name="AccountName" id="accountname">
                                                    </div>
                                                </div>

                                             <!--    <div class="row m-20 form-group">
                                                    <label for="inputEmail3" class="col-sm-3 col-form-label">COA
                                                        Head</label>
                                                    <div class="col-12 col-md-4 col-sm-6">

                                                        <div class="select2-drpdwn">
                                                            <div class="mb-2">
                                                                <select class="col-12 col-md-4 col-sm-6 select2-hidden-accessible" id="cboCategory" name="CategoryID" onchange="javascript:Get_GLCode()" data-select2-id="cboCategory" tabindex="-1" aria-hidden="true"><option value="null" selected="" data-select2-id="9">--Select Category--</option><option value="54" data-coaid="54" data-coaname="RENT A CAR CUSTOMERS" data-degree="4" data-l3="ACCOUNTS RECEIVABLE" data-l2="CURRENT ASSETS" data-l1="ASSETS">RENT A CAR CUSTOMERS</option><option value="55" data-coaid="55" data-coaname="CASH CUSTOMERS" data-degree="4" data-l3="ACCOUNTS RECEIVABLE" data-l2="CURRENT ASSETS" data-l1="ASSETS">CASH CUSTOMERS</option><option value="56" data-coaid="56" data-coaname="STAFF RECEIVABLES " data-degree="4" data-l3="ACCOUNTS RECEIVABLE" data-l2="CURRENT ASSETS" data-l1="ASSETS">STAFF RECEIVABLES&nbsp;</option><option value="57" data-coaid="57" data-coaname="RELATED PARTY TRANSACTION RECEIVABLES" data-degree="4" data-l3="ACCOUNTS RECEIVABLE" data-l2="CURRENT ASSETS" data-l1="ASSETS">RELATED PARTY TRANSACTION RECEIVABLES</option><option value="58" data-coaid="58" data-coaname="INSURANCE COMPANY CUSTOMERS" data-degree="4" data-l3="ACCOUNTS RECEIVABLE" data-l2="CURRENT ASSETS" data-l1="ASSETS">INSURANCE COMPANY CUSTOMERS</option><option value="59" data-coaid="59" data-coaname="REFUNDABLE DEPOSITS" data-degree="4" data-l3="ACCOUNTS RECEIVABLE" data-l2="CURRENT ASSETS" data-l1="ASSETS">REFUNDABLE DEPOSITS</option><option value="60" data-coaid="60" data-coaname="PREPAID EXPENSES" data-degree="4" data-l3="ACCOUNTS RECEIVABLE" data-l2="CURRENT ASSETS" data-l1="ASSETS">PREPAID EXPENSES</option><option value="61" data-coaid="61" data-coaname="Government Co." data-degree="4" data-l3="ACCOUNTS RECEIVABLE" data-l2="CURRENT ASSETS" data-l1="ASSETS">Government Co.</option><option value="62" data-coaid="62" data-coaname="Inventory" data-degree="4" data-l3="ACCOUNTS RECEIVABLE" data-l2="CURRENT ASSETS" data-l1="ASSETS">Inventory</option><option value="260" data-coaid="260" data-coaname="TRADE RECEIVABLES" data-degree="4" data-l3="ACCOUNTS RECEIVABLE" data-l2="CURRENT ASSETS" data-l1="ASSETS">TRADE RECEIVABLES</option></select><span class="select2 select2-container select2-container--default" dir="ltr" data-select2-id="7" style="width: 100%;"><span class="selection"><span class="select2-selection select2-selection--single" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-labelledby="select2-cboCategory-container"><span class="select2-selection__rendered" id="select2-cboCategory-container" role="textbox" aria-readonly="true" title="--Select Category--">--Select Category--</span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span></span></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>
                                                                <span id="CategoryDescription"></span>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
 -->

                                                <!-- <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Opening Balance</label>
                                                    <div class="col-12 col-md-4 col-sm-6">   
                                                    <input type="number" name="Attr1" class="form-control" placeholder="Opening Balance" id="attr1">
                                                    </div>
                                                </div> -->

                                                <div class="row m-20 form-group">
                                                    <label for="inputEmail3" class="col-sm-3 col-form-label">Customer
                                                        Type</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <div class="select2-drpdwn">
                                                            <div class="mb-2">
                                                                <select class="col-12 col-md-12 col-sm-6 form-control" name="Attr2"  tabindex="-1" aria-hidden="true">
                                                                    <option value="" data-select2-id="2">--Select Customer Type--</option>
                                                                <option value="9" data-mastervalueid="9" data-mastervalue="CORPORATE">CORPORATE</option><option value="10" data-mastervalueid="10" data-mastervalue="INDIVIDUALS">INDIVIDUALS</option></select>
                                                                <!-- <span class="select2 select2-container select2-container--default" dir="ltr" data-select2-id="1" style="width: 100%;"><span class="selection"><span class="select2-selection select2-selection--single" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-labelledby="select2-cboAttr2-container"><span class="select2-selection__rendered" id="select2-cboAttr2-container" role="textbox" aria-readonly="true"><span class="select2-selection__placeholder">--Select Customer Type--</span></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span></span></span><span class="dropdown-wrapper" aria-hidden="true"></span></span> -->
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>



                                                <div class="row m-20 form-group">
                                                    <label for="inputEmail3" class="col-sm-3 col-form-label">Emirates</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <div class="select2-drpdwn">
                                                            <div class="mb-2">
                                                                <select class="col-12 col-md-12 col-sm-6 form-control" id="cboAttr3" name="Attr3" data-select2-id="cboAttr3" tabindex="-1" aria-hidden="true">
                                                                    <option value="" data-select2-id="4">--Select States--</option>
                                                                <option value="11" data-mastervalueid="11" data-mastervalue="Abu Dhabi">Abu Dhabi</option><option value="12" data-mastervalueid="12" data-mastervalue="Dubai">Dubai</option><option value="13" data-mastervalueid="13" data-mastervalue="Sharjah">Sharjah</option><option value="121" data-mastervalueid="121" data-mastervalue="Umulquain">Umul Quain</option><option value="641" data-mastervalueid="641" data-mastervalue="rasulkhaima">Ras ul Khaima</option></select><!-- <span class="select2 select2-container select2-container--default" dir="ltr" data-select2-id="3" style="width: 100%;"><span class="selection"><span class="select2-selection select2-selection--single" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-labelledby="select2-cboAttr3-container"><span class="select2-selection__rendered" id="select2-cboAttr3-container" role="textbox" aria-readonly="true"><span class="select2-selection__placeholder">--Select Status--</span></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span></span></span><span class="dropdown-wrapper" aria-hidden="true"></span></span> -->
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div class="row m-20 form-group">
                                                    <label for="inputEmail3" class="col-sm-3 col-form-label">Select 
                                                        Business Area</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <div class="select2-drpdwn">
                                                            <div class="mb-2">
                                                                <select class="col-12 col-md-12 col-sm-6 form-control" id="cboAttr5" name="Attr5" data-select2-id="cboAttr5" tabindex="-1" aria-hidden="true">
                                                                    <option value="" data-select2-id="6">--Select Business Area
                                                                    </option>
                                                                <option value="14" data-mastervalueid="14" data-mastervalue="RENT A CAR COMPANY">RENT A CAR COMPANY</option><option value="16" data-mastervalueid="16" data-mastervalue="INSURANCE COMPANY">INSURANCE COMPANY</option><option value="106" data-mastervalueid="106" data-mastervalue="Other">Other</option></select><!-- <span class="select2 select2-container select2-container--default" dir="ltr" data-select2-id="5" style="width: 100%;"><span class="selection"><span class="select2-selection select2-selection--single" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-labelledby="select2-cboAttr5-container"><span class="select2-selection__rendered" id="select2-cboAttr5-container" role="textbox" aria-readonly="true"><span class="select2-selection__placeholder">--Select Field Of Business--</span></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span></span></span><span class="dropdown-wrapper" aria-hidden="true"></span></span> -->
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Address</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="Attr6" class="form-control" placeholder="Address" id="attr6">
                                                    </div>
                                                </div>
                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Fax</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="Attr8" class="form-control" placeholder="Fax Number" id="attr8">
                                                    </div>
                                                </div>
                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Website</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="Attr17" class="form-control" placeholder="Website" id="attr17">
                                                    </div>
                                                </div>

                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Tel</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="Attr9" class="form-control" placeholder="TEL" id="attr9">
                                                    </div>
                                                </div>

                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Mobile</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="Attr10" class="form-control" placeholder="Mobile" id="attr10">
                                                    </div>
                                                </div>


                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Email</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="Attr11" class="form-control" placeholder="EMAIL" id="attr11">
                                                    </div>
                                                </div>

                                                <div class="row m-20 form-group" style="display: none;">
                                                    <label class="col-sm-3 col-form-label">Contact Person1 Info</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <textarea name="Attr12" class="form-control" placeholder="Contact Person Info" id="attr12" cols="30" rows="3"></textarea>
                                                    </div>
                                                </div>


                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Contact Person 1</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="ContactPerson1" class="form-control" placeholder="Contact Person 1" id="contactperson1">
                                                    </div>
                                                </div>

                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Contact Designation 1</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="ContactDesignation1" class="form-control" placeholder="Contact Designation 1" id="contactdesignation1">
                                                    </div>
                                                </div>



                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Contact Person 2</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="ContactPerson2" class="form-control" placeholder="Contact Person 2" id="contactperson2">
                                                    </div>
                                                </div>

                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Contact Designation 2</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="ContactDesignation2" class="form-control" placeholder="Contact Designation 2" id="contactdesignation2">
                                                    </div>
                                                </div>



                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Contact Person 3</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="ContactPerson3" class="form-control" placeholder="Contact Person 3" id="contactperson3">
                                                    </div>
                                                </div>

                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Contact Designation 3</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="ContactDesignation3" class="form-control" placeholder="Contact Designation 3" id="contactdesignation3">
                                                    </div>
                                                </div>




                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Numbers of Vehicles</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="Attr21" class="form-control" placeholder="Payment Terms" id="Attr21">
                                                    </div>
                                                </div>

                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Number of Employees</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="Attr22" class="form-control" placeholder="Payment Method" id="Attr22">
                                                    </div>
                                                </div>

                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Does Work with Competitor</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="Attr23" class="form-control" placeholder="Credit Limit" id="Attr23">
                                                    </div>
                                                </div>
                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Trade License Number</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <!-- <input type="date" name="Attr16" class="form-control" placeholder="Bank Clearance Date" id="attr16"> -->
                                                        <input type="text" data-language="en" class="form-control" aria-describedby="basic-addon2" placeholder="License Expiry" name="Attr4" autocomplete="off" id="attr4">
                                                    </div>
                                                </div>


                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Trade License Expiry</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <!-- <input type="date" name="Attr16" class="form-control" placeholder="Bank Clearance Date" id="attr16"> -->
                                                        <input type="text" data-language="en" class="datepicker-here form-control" aria-describedby="basic-addon2" placeholder="License Expiry" name="Attr16" autocomplete="off" id="attr16">
                                                    </div>
                                                </div>
                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">VAT Number</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <!-- <input type="date" name="Attr16" class="form-control" placeholder="Bank Clearance Date" id="attr16"> -->
                                                        <input type="text" data-language="en" class="form-control" aria-describedby="basic-addon2" placeholder="License Expiry" name="Attr15" autocomplete="off" id="attr15">
                                                    </div>
                                                </div>

                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Annual Turn Over</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" name="Attr24" class="form-control" placeholder="" id="Attr24">
                                                    </div>
                                                </div>


<div id="map"></div>
<!-- Replace the value of the key parameter with your own API key. -->
<!-- <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk"></script>
 -->                                                <!--Opening Balance Start-->
                                               <!--  <div class="table-responsive mt-2">
                                                    <table class="table table-bordered table-hover table-condensed table-striped" id="opening_balance">
                                                        <thead class="thead-dark">
                                                            <tr>
                                                                <th scope="col" style="width: 280px">Opening Balance
                                                                </th>
                                                                <th scope="col" style="width: 80px">Debit</th>
                                                                <th scope="col" style="width: 80px">Credit</th>
                                                            </tr>
                                                        </thead>
                                                        <tbody>
                                                            <tr id="opening-no-data" style="display: none;">
                                                                <td colspan="3" style="text-align:center">
                                                                    There's no data
                                                                </td>
                                                            </tr>
                                                        <tr data-balance="0" data-guid="null" data-godownid="1" data-row="{" guid":null,"godownid":1,"godownname":"almutakamela="" vehicles="" testing="" &="" registration="" l.l.c.","debit":null,"credit":null,"cost":null,"salvagevalue":null}"="" style="">
    <td name="col_CostCenter">Almutakamela Vehicles Testing &amp; Registration L.L.C.</td>
    <td name="col_Debit"><input type="number" min="0" class="openingDebit" placeholder="Debit" value="0"></td>
    <td name="col_Credit"><input type="number" min="0" class="openingCredit" placeholder="Credit" value="0"></td>
</tr><tr data-balance="0" data-guid="null" data-godownid="2" data-row="{" guid":null,"godownid":2,"godownname":"car="" control="" l.l.c.","debit":null,"credit":null,"cost":null,"salvagevalue":null}"="" style="">
    <td name="col_CostCenter">Car Control L.L.C.</td>
    <td name="col_Debit"><input type="number" min="0" class="openingDebit" placeholder="Debit" value="0"></td>
    <td name="col_Credit"><input type="number" min="0" class="openingCredit" placeholder="Credit" value="0"></td>
</tr><tr data-balance="0" data-guid="null" data-godownid="3" data-row="{" guid":null,"godownid":3,"godownname":"royal="" polishing="" l.l.c.","debit":null,"credit":null,"cost":null,"salvagevalue":null}"="" style="">
    <td name="col_CostCenter">Royal Polishing L.L.C.</td>
    <td name="col_Debit"><input type="number" min="0" class="openingDebit" placeholder="Debit" value="0"></td>
    <td name="col_Credit"><input type="number" min="0" class="openingCredit" placeholder="Credit" value="0"></td>
</tr><tr data-balance="0" data-guid="null" data-godownid="4" data-row="{" guid":null,"godownid":4,"godownname":"pasha="" wash="" l.l.c.","debit":null,"credit":null,"cost":null,"salvagevalue":null}"="" style="">
    <td name="col_CostCenter">Pasha Wash L.L.C.</td>
    <td name="col_Debit"><input type="number" min="0" class="openingDebit" placeholder="Debit" value="0"></td>
    <td name="col_Credit"><input type="number" min="0" class="openingCredit" placeholder="Credit" value="0"></td>
</tr></tbody>
                                                        <tfoot>
                                                            <tr id="table_footer_1">
                                                                <td>Opening Balance</td>
                                                                <td style="text-align:left" id="total_opening_debit">0</td>
                                                                <td style="text-align:left" id="total_opening_credit">0</td>
                                                            </tr>
                                                        </tfoot>
                                                    </table>
                                                </div> -->
                                                <!--Opening Balance End-->
<!-- onclick="javascript:void(0);submitInvoice(this)"-->
                                                <div class="card-footer">
                                                    <button class="btn btn-primary" name="submit">Submit</button>
                                                    <button class="btn btn-secondary" onclick="javascript:void(0);resetInvoice(this)">Clear</button>
                                                    <button class="btn btn-danger" onclick="javascript:void(0);ClearForm(true)">Cancel</button>
                                                </div>
                                            </form>

                                        </div>

                                        <div class="tab-pane fade  show active" id="supplier" role="tabpanel"
                                            aria-labelledby="supplier-tab">

                                            <!-- <form id="searchForm" onsubmit="return false;">
                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-1 col-12 col-md-1  col-form-label">Account Name</label>
                                                    <div class="col-12 col-md-2 col-sm-2 m-b-20">                                           
                                                        <input type="text"  class="form-control" aria-describedby="basic-addon2" placeholder="Search" id="Search_Account" name="COAName">
                                                    </div>
                                                
                                                    <label class="col-sm-1 col-12 col-md-1  col-form-label">Trade License #</label>
                                                    <div class="col-12 col-md-2 col-sm-2 m-b-20">                                           
                                                        <input type="text"  class="form-control" aria-describedby="basic-addon2" placeholder="Search" id="Search_Attr4" name="Attr4">
                                                    </div>
                                                
                                                    <label class="col-sm-1 col-12 col-md-1  col-form-label">Category</label>
                                                    <div class="col-12 col-md-2 col-sm-2 m-b-20">                                           
                                                        <input type="text"  class="form-control" aria-describedby="basic-addon2" placeholder="Search" id="Search_Category" name="Category">
                                                    </div>
                                                
                                                    <label class="col-sm-1 col-12 col-md-1  col-form-label">Mob</label>
                                                    <div class="col-12 col-md-2 col-sm-2 m-b-20">                                            
                                                        <input type="text"  class="form-control" aria-describedby="basic-addon2" placeholder="Search" id="Search_Attr10" name="Attr10">
                                                    </div>
                                                
                                                    <label class="col-sm-1 col-12 col-md-1  col-form-label">VAT #</label>
                                                    <div class="col-12 col-md-2 col-sm-2 m-b-20">                                            
                                                        <input type="text"  class="form-control" aria-describedby="basic-addon2" placeholder="Search" id="Search_Attr15" name="Attr15">
                                                    </div>

                                                    <button class="btn btn-primary m-b-20"   onclick="javascript:void(0);doPost(this)">Search</button>
                                                </div>
                                            </form> -->
                                            <form id="searchForm" onsubmit="return false;">
                                                <div class="row m-2 m-l-0 form-group">

                                                    <div class="col-12 col-sm-2 col-md-2 form-group">
                                                        <!-- <label for="Search_Group" class="col-form-label-xsm">Customer Name</label> -->
                                                        <input type="text" class="form-control form-control-sm"
                                                            placeholder="Customer Name" id="Search_Account"
                                                            name="COAName" />
                                                    </div>

                                                    <div class="col-12 col-sm-2 col-md-2 form-group">
                                                        <!-- <label for="Search_Description" class="col-form-label-xsm">Trade Lic #</label> -->
                                                        <input type="text" class="form-control form-control-sm"
                                                            placeholder="Trade License #" id="Search_Attr4"
                                                            name="Attr4" />
                                                    </div>

                                                    <div class="col-12 col-sm-2 col-md-2 form-group">
                                                        <!-- <label for="Search_Category" class="col-form-label-xsm">Category</label> -->
                                                        <input type="text" class="form-control form-control-sm"
                                                            placeholder="Category" id="Search_Category"
                                                            name="Category" />
                                                    </div>
                                                    <!-- <div class="col-12 col-sm-2 col-md-2 form-group">
                                                        <input type="text" class="form-control form-control-sm"  placeholder="Level3" id="Search_L3" name="L3"/>
                                                    </div>
                                                    <div class="col-12 col-sm-2 col-md-2 form-group">
                                                        <input type="text" class="form-control form-control-sm"  placeholder="Level2" id="Search_L2" name="L2"/>
                                                    </div>
                                                    <div class="col-12 col-sm-2 col-md-2 form-group">
                                                        <input type="text" class="form-control form-control-sm"  placeholder="Level1" id="Search_L1" name="L1"/>
                                                    </div> -->

                                                    <div class="col-12 col-sm-2 col-md-2 form-group">
                                                        <!-- <label for="Search_Code" class="col-form-label-xsm">Mobile</label> -->
                                                        <input type="text" class="form-control form-control-sm"
                                                            placeholder="Mobile" id="Search_Attr10" name="Attr10" />
                                                    </div>
                                                    <div class="col-12 col-sm-2 col-md-2 form-group">
                                                        <!-- <label for="Search_Level" class="col-form-label-xsm">VAT REG #</label> -->
                                                        <input type="text" class="form-control form-control-sm"
                                                            placeholder="TRN #" id="Search_Attr15" name="Attr15" />
                                                    </div>

                                                    <div class="col-12 col-sm-2 col-md-2 form-group">
                                                        <!-- <label for="Search_Level" class="col-form-label-xsm"></label> -->
                                                        <button class="btn-primary form-control form-control-sm"
                                                            onclick="javascript:void(0);doPost(this)">Search</button>
                                                    </div>

                                                </div>
                                            </form>

                                            <div class="table-responsive mt-2">
                                    <!-- <table id="example" class="display" style="width:100%">
        <thead class="thead-light">
                                                    <tr>
                                                            <th>Account Name</th>
                                                            <th>Trade License #</th>
                                                            <th>Mobile #</th>
                                                            <th>Email</th>
                                                            <th>TRN #</th>
                                                        </tr>
        </thead>
         <tbody>
                                                        <tr id="invoice-no-data">
                                                                <td colspan="4" style="text-align:center"> 
                                                                    There's no data 
                                                                </td>
                                                            </tr>
                                                    </tbody>
                                                </table> -->

                                                <table
                                                    class="table table-bordered table-hover table-striped table-condensed"
                                                    id="invoice">
                                                    <thead class="thead-light">
                                                        <tr>
                                                            <th>Account Name</th>
                                                            <th>Trade License #</th>
                                                            <th>Mobile #</th>
                                                            <th>Email</th>
                                                            <th>TRN #</th>
                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                                        <!-- <tr id="invoice-no-data">
                                                                <td colspan="7" style="text-align:center"> 
                                                                    There's no data 
                                                                </td>
                                                            </tr> -->
                                                    </tbody>
                                                    <tfoot>
                                                        <tr>
                                                            <th>Account Name</th>
                                                            <th>Address</th>
                                                            <th>Trade License #</th>
                                                            <th>Mobile #</th>
                                                            <th>TRN #</th>
                                                        </tr>
                                                    </tfoot>
                                                </table>

                                            </div>

                                        </div>

                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>

                </div>

                <!-- Container-fluid Ends -->
            </div>
            <!--Page Body Ends-->

        </div>
    </div>

    <!-- latest jquery-->
    <script src="<?php echo SITEURL;?>assets/js/jquery-3.2.1.min.js"></script>

    <!-- Bootstrap js-->
    <script src="<?php echo SITEURL;?>assets/js/bootstrap/popper.min.js"></script>
    <script src="<?php echo SITEURL;?>assets/js/bootstrap/bootstrap.js"></script>

    <!-- Counter js-->
    <script src="<?php echo SITEURL;?>assets/js/counter/jquery.waypoints.min.js"></script>
    <script src="<?php echo SITEURL;?>assets/js/counter/jquery.counterup.min.js"></script>
    <!-- <script src="<?php echo SITEURL;?>assets/js/counter/counter-custom.js"></script> -->

    <!-- owlcarousel js-->
    <script src="<?php echo SITEURL;?>assets/js/owlcarousel/owl.carousel.js"></script>

    <!-- prism js -->
    <script src="<?php echo SITEURL;?>assets/js/prism/prism.min.js"></script>

    <!-- clipboard js -->
    <script src="<?php echo SITEURL;?>assets/js/clipboard/clipboard.min.js"></script>

    <!-- custom card js  -->
    <script src="<?php echo SITEURL;?>assets/js/custom-card/custom-card.js"></script>

    <!--Height Equal Js-->
    <script src="<?php echo SITEURL;?>assets/js/height-equal.js"></script>

    <!-- Sidebar jquery-->
    <script src="<?php echo SITEURL;?>assets/js/sidebar-menu.js"></script>
    <script src="<?php echo SITEURL;?>assets/js/compact-small-button.js"></script>

    <!-- Theme js-->
    <script src="<?php echo SITEURL;?>assets/js/script.js"></script>

    <!-- tour js -->
    <script src="<?php echo SITEURL;?>assets/js/tour/intro.js"></script>
    <script src="<?php echo SITEURL;?>assets/js/tour/intro-init.js"></script>

    <!-- Chartist  -->
    <script src="<?php echo SITEURL;?>assets/js/chartis/chartist.js"></script>

    <!--Sparkline  Chart JS-->
    <script src="<?php echo SITEURL;?>assets/js/sparkline/sparkline.js"></script>

    <!--Dashboard business js-->
    <!-- <script  src="<?php echo SITEURL;?>assets/js/dashboard-business.js"></script> -->
    <script src="<?php echo SITEURL;?>assets/js/date-picker/datepicker.js"></script>
    <script src="<?php echo SITEURL;?>assets/js/date-picker/datepicker.en.js"></script>

    <script src="<?php echo SITEURL;?>assets/js/bootbox.min.js"></script>

    <!-- bootstrap notify js -->
    <script src="<?php echo SITEURL;?>assets/js/notify/bootstrap-notify.min.js"></script>

    <!-- Select2 js -->
    <script type="text/javascript" src="<?php echo SITEURL;?>assets/js/select2/select2.full.min.js"></script>


    <script src="<?php echo SITEURL;?>assets/js/datatables/jquery.dataTables.min.js"></script>
    <script src="<?php echo SITEURL;?>assets/js/datatables/datatable.custom.js"></script>

    <script>
$(document).ready(function() {
 /* $('#invoice thead th').each( function () {
        var title = $(this).text();
        $(this).html( '<input type="text" placeholder="Search '+title+'" />' );
    } );
 */
    var table=$('#invoice').dataTable( {
  "sAjaxDataProp":"",
                    "stateSave": false,
                    "bProcessing": false,
                    "autoWidth": false,
                    "bServerSide": false,    
                    "sAjaxSource": "addDealers.php?view=dealers",
         "columns": [
            { "data": "COAName" },
            { "data": "Attr4" },
            { "data": "Attr10" },
            { "data": "Attr11" },
            { "data": "Attr15" }
        ],
        "aoColumnDefs": [{ 'bSortable': false, 'aTargets': [3] }],
             "bSort": true,
             "scrollY": false,
             "scrollX": false,
             dom: 'Blfrtip',
             lengthMenu: [
                 [10, 25, 50, -1],
                 ['10 rows', '25 rows', '50 rows', 'Show all']
             ],
             buttons: [
                 'excelHtml5'
             ],

    } );

    /*  var t = $('#invoice').DataTable( {
        "columnDefs": [ {
            "searchable": false,
            "orderable": false,
            "targets": 0
        } ],
        "order": [[ 1, 'asc' ]]
    } );
 
    t.on( 'order.dt search.dt', function () {
        t.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) {
            cell.innerHTML = i+1;
        } );
    } ).draw();*/
   /*  $('#example').DataTable( {
"bProcessing": true,
"sAjaxDataProp":"",
"bServerSide": true,
        "ajax": 'addDealers.php?view=dealers',
        "columns": [
            { "data": "COAName" },
            { "data": "Attr4" },
            { "data": "Attr10" },
            { "data": "Attr11" },
            { "data": "Attr15" }
        ]
    } );*/

    // DataTable
 //   var table = $('#invoice').DataTable();
 
    // Apply the search
    /*table.columns().every( function () {
        var that = this;
 
        $( 'input', this.footer() ).on( 'keyup change clear', function () {
            if ( that.search() !== this.value ) {
                that
                    .search( this.value )
                    .draw();
            }
        } );
    } );*/
} );
    </script>
</body>

</html>