<!DOCTYPE html>
<html>
   <head>
      <!-- TABLES CSS CODE -->
      <?php include"comman/code_css.php"; ?>
      <!-- </copy> -->  
   </head>
   <body class="hold-transition skin-blue sidebar-mini">
      <div class="wrapper">
         <?php include"sidebar.php"; ?>
         <!-- Content Wrapper. Contains page content -->
         <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
               <h1>
                  <?=$page_title;?>
                  <small></small>
               </h1>
               <ol class="breadcrumb">
                  <li><a href="<?php echo $base_url; ?>dashboard"><i class="fa fa-dashboard"></i> Home</a></li>
                  <li class="active"><?=$page_title;?></li>
               </ol>
            </section>
            <!-- Main content -->
            <section class="content">
               <div class="row">
                  <!-- right column -->
                  <div class="col-md-12">
                     <!-- Horizontal Form -->
                     <div class="box box-primary ">
                        <div class="box-header with-border">
                           <h3 class="box-title">Please Enter Valid Information</h3>
                        </div>
                        <!-- /.box-header -->
                        <!-- form start -->
                        <form class="form-horizontal" id="report-form" onkeypress="return event.keyCode != 13;">
                           <input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
                           <input type="hidden" id="base_url" value="<?php echo $base_url;; ?>">
                           <div class="box-body">
                              <div class="form-group">
                                 <!-- Store Code -->
                                  <?php if(store_module() && is_admin()) {$this->load->view('store/store_code',array('show_store_select_box'=>true,'store_id'=>get_current_store_id(),'div_length'=>'col-sm-3','show_all'=>'true','form_group_remove' => 'true')); }else{
                                     echo "<input type='hidden' name='store_id' id='store_id' value='".get_current_store_id()."'>";
                                     }?>
                                  <!-- Store Code end -->

                                 <label for="customer_id" class="col-sm-2 control-label"><?= $this->lang->line('customer_name'); ?></label>
                                 <div class="col-sm-3">
                                    <select class="form-control select2 " id="customer_id" name="customer_id" >
                                    </select>
                                    <span id="customer_id_msg" style="display:none" class="text-danger"></span>
                                 </div>
                                 <label for="from_date" class="col-sm-2 control-label"><?= $this->lang->line('from_date'); ?> <label class="text-danger">*</label></label>
                                 <div class="col-sm-3">
                                    <div class="input-group date">
                                       <div class="input-group-addon">
                                          <i class="fa fa-calendar"></i>
                                       </div>
                                       <input type="text" class="form-control pull-right datepicker" id="from_date" name="from_date" value="<?php echo show_date(date('Y-m-d'));?>">
                                    </div>
                                    <span id="from_date_msg" style="display:none" class="text-danger"></span>
                                 </div>
                              </div>
                              <div class="form-group">
                                 <label for="to_date" class="col-sm-2 control-label"><?= $this->lang->line('to_date'); ?> <label class="text-danger">*</label></label>
                                 <div class="col-sm-3">
                                    <div class="input-group date">
                                       <div class="input-group-addon">
                                          <i class="fa fa-calendar"></i>
                                       </div>
                                       <input type="text" class="form-control pull-right datepicker" id="to_date" name="to_date" value="<?php echo show_date(date('Y-m-d'));?>">
                                    </div>
                                    <span id="to_date_msg" style="display:none" class="text-danger"></span>
                                 </div>
                                 
                                 <div class="col-sm-12">
                                    <br/>
                                    <button type="button" id="view_report" class="btn btn-primary btn-sm"><i class="fa fa-filter" aria-hidden="true"></i> <?= $this->lang->line('view_report'); ?></button>
                                    <button type="button" id="view_all" class="btn btn-warning btn-sm "><i class="fa fa-eye" aria-hidden="true"></i> <?= $this->lang->line('view_all'); ?></button>
                                 </div>
                              </div>
                           </div>
                        </form>
                     </div>
                  </div>
               </div>
               <div class="row">
                  <div class="col-md-12">
                     <div class="box" id="data_tbl">
                        <div class="box-header">
                           <h3 class="box-title">Customer Accounts Report - Legacy Outstanding Report</h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body table-responsive no-padding">
                           <table class="table table-bordered table-hover " id="report-data-table">
                              <thead>
                                 <tr class="bg-gray ">
                                    <th style=""><?= $this->lang->line('sl_no'); ?></th>
                                    <?php if(store_module() && is_admin()) { ?>
                                    <th><?= $this->lang->line('store'); ?></th>
                                    <?php } ?>
                                    <th><?= $this->lang->line('customer_code'); ?></th>
                                    <th><?= $this->lang->line('customer_name'); ?></th>
                                    <th class="text-right">Opening Balance</th>
                                    <th class="text-right">Sales Due</th>
                                    <th class="text-right">Return Due</th>
                                    <th class="text-right">Advance</th>
                                    <th class="text-right">Total Debits</th>
                                    <th class="text-right">Total Credits</th>
                                    <th class="text-right">Current Balance</th>
                                    <th class="text-center">Status</th>
                                    <th class="text-right">Credit Limit</th>
                                 </tr>
                              </thead>
                              <tbody id="sales-report-tbody">
                                 <tr>
                                    <td class="text-center text-danger" colspan="13">No Records Found</td>
                                 </tr>
                              </tbody>
                           </table>
                        </div>
                        <!-- /.box-body -->
                     </div>
                     <!-- /.box -->
                  </div>
               </div>
            </section>
            <!-- /.content -->
         </div>
         <!-- /.content-wrapper -->
         <?php include"footer.php"; ?>
         <!-- Add the sidebar's background. This div must be placed
            immediately after the control sidebar -->
         <div class="control-sidebar-bg"></div>
      </div>
      <!-- ./wrapper -->
      <!-- SOUND CODE -->
      <?php include"comman/code_js_sound.php"; ?>
      <!-- TABLES CODE -->
      <?php include"comman/code_js.php"; ?>

      <script src="<?php echo $theme_link; ?>js/customer_accounts_report.js"></script>
      <script src="<?php echo $theme_link; ?>js/ajaxselect/customer_select_ajax.js"></script>
      <!-- Make sidebar menu hughlighter/selector -->
      <script>$(".report-menu").addClass("active");</script>
   </body>
</html>
