<?php include_once('headeraging.php');?>
<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>Aging Report</h5>
                                    <span>to define customer Balances.</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">

                                                                                 <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-12 col-md-12 col-form-label" style="background-color:#ab8ce4;text-align: center;">Report Date Information</label>
 
                                                </div>


                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Select Dealer</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                       <select class="col-12 col-md-12 col-sm-6 form-control" id="dealer" name="dealer"  tabindex="-1" aria-hidden="true">
                                                                    <option value="" data-select2-id="2">--Select Customer </option>
                                                                <?php 
                                                $result=odbc_exec($connection,'select COAID,COAName from accounts where under=54 and natureid=14');
  while ($row = odbc_fetch_array($result)) {
   echo "<option value='".$row['COAID']."'>".$row['COAName']."</option>";
  }
                                                                ?>

                                                                </select>
                                                    </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">Contact Date
                                                        </label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <div class="select2-drpdwn">
                                                            <div class="mb-2">
                                                                <input type="date" name="visitdate" id="visitdate" class="form-control">
                                                              
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>



                                                <div class="row m-20 form-group">
                                                    <label for="inputEmail3" class="col-sm-3 col-form-label">New Appointment Arrange</label>
                                                    <div class="col-2 col-md-2 col-sm-6">
                                                        <div class="select2-drpdwn">
                                                            <div class="mb-2">
                                                                <input type="radio" id="appointarrange1" name="appointarrange" class="form-group" value="1">Yes 
                                                                <input type="radio" id="appointarrange0" name="appointarrange" class="form-group" value="0">No 
                                                                
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div class="row m-20 form-group">
                                                    <label for="inputEmail3" class="col-sm-3 col-form-label">New Appointment 
                                                        Date</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <div class="select2-drpdwn">
                                                            <div class="mb-2">
                                                                        <input type="date" name="appointdate" id="appointdate" class="form-control">
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Addition info Appointment</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="text" id="additional_info" name="additional_info" class="form-control" placeholder="Additional Infomration" id="attr6">
                                                    </div>
                                                </div>
                                                <div class="row m-20 form-group">
                                             <label class="col-sm-12 col-md-12 col-form-label" style="background-color:#ab8ce4;text-align: center;">Contact Information</label>
 
                                                </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="ContactPerson" 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 Type</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                           <select class="col-12 col-md-12 col-sm-6 form-control" id="contactTypeId" name="contactTypeId"  tabindex="-1" aria-hidden="true">
                                                                    <option value="" data-select2-id="2">--Select Contact  Type--</option>
                                                                <option value="9" data-mastervalueid="9" data-mastervalue="CORPORATE">Telephone</option><option value="10" data-mastervalueid="10" data-mastervalue="INDIVIDUALS">Physical</option></select>
                                                    </div>
                                                </div>
                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Type of Contact</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                           <select class="col-12 col-md-12 col-sm-6 form-control" id="TypeContactId" name="TypeContactId"  tabindex="-1" aria-hidden="true">
                                                            <option value="" data-select2-id="2">--Select Type of Contact  --</option>
                                                 <?php 
                                                $result=odbc_exec($connection,'select id,title from TypeContact');
  while ($row = odbc_fetch_array($result)) {
   echo "<option value='".$row['id']."'>".$row['title']."</option>";
  }
                                                                ?>

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

                                                     <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Customer Category</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                           <select class="col-12 col-md-12 col-sm-6 form-control" id="customerCategoryId" name="customerCategoryId"  tabindex="-1" aria-hidden="true">
                                                                    <option value="" data-select2-id="2">--Select Customer Category</option>
                                                                                              <?php 
                                                $result=odbc_exec($connection,'select id,title from CustomerCategory');
  while ($row = odbc_fetch_array($result)) {
   echo "<option value='".$row['id']."'>".$row['title']."</option>";
  }
                                                                ?>

                                                                     </select>
                                                    </div>

                                                </div>
                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">What has been Discuss</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <textarea id="discuss" name="discuss" class="form-control" placeholder="Discuss" id="attr4"></textarea>
                                                    </div>
                                                </div>

                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Feedback</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <textarea  name="feedback" class="form-control" placeholder="Feedback" id="feedback"></textarea>
                                                    </div>
                                                </div>
      <div class="row m-20 form-group">
                                             <label class="col-sm-12 col-md-12 col-form-label" style="background-color:#ab8ce4;text-align: center;">Notes</label>
 
                                                </div>
                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Sales Rep Note</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <textarea name="notes" class="form-control" placeholder="Sales Rep Note" id="notes"></textarea>
                                                    </div>
                                                </div>


                                                <div class="row m-20 form-group">
                                                    <label class="col-sm-3 col-form-label">Sales Manager Notes</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <textarea name="managernotes" class="form-control" placeholder="Sales Manager Notes" id="managernotes">
                                                            </textarea>
                                                    </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">Visit Card Picture</label>
                                                    <div class="col-12 col-md-4 col-sm-6">
                                                        <input type="file" name="ContactDesignation1" class="form-control" placeholder="Contact Designation 1" id="contactdesignation1">
                                                    </div>
                                                </div>



                                                <!--Opening Balance End-->

                                                <div class="card-footer">
                                                    <!-- onclick="javascript:void(0);submitInvoice(this)"-->
                                                    <button class="btn btn-primary" name="submit" type="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></table>
                                                <table
                                                    class="table table-bordered table-hover table-striped table-condensed"
                                                    id="invoice">
                                                    <thead  class="thead-light">

                                                        <tr >
                                                            <th>ID</th>
                                                            <th>Customer Name</th>
                                                            <th>Opening Balance</th>
                                                            <th>Total Due</th>
                                                            <th>Total Received</th>
                                                            <th>30 Days</th>
                                                            <th>60 Days</th>
                                                            <th>90 Days</th>
                                                            <th>Balance</th>

                                                        </tr>
<!--                                                         <tr>
                                                            <?php
$img="".SITEURL."assets/images/its-report-header.png";
                                                            ?>
                                                            <th colspan=6><img src='<?php echo $img;?>' width="100" height="100"></th>
                                                        </tr>
 -->                                                    </thead>
                                                    <tbody>
                                                        <!-- <tr id="invoice-no-data">
                                                                <td colspan="7" style="text-align:center"> 
                                                                    There's no data 
                                                                </td>
                                                            </tr> -->
                                                    </tbody>
                                                </table>
<?php 
$img = file_get_contents($img); 
  
//echo $dataimg =base64_encode($img);
?>
                                            </div>

                                        </div>

                                    </div>
                                </div>

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

                </div>

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

        </div>
    </div>
<?php include_once('footeraging.php');?>
</body>

</html>
<?php
// We're done! Save the cached content to a file
    /*$fp = fopen($cachefile, 'w');
    fwrite($fp, ob_get_contents());
    fclose($fp);
    // finally send browser output
    ob_end_flush();*/
?>