<?php $this->load->view("common/header"); ?>

<!-- end: HEAD -->

<!-- end: CSS REQUIRED FOR THIS PAGE ONLY -->

<!-- end: HEAD -->

<!-- start: BODY -->

<body>

<!-- start: HEADER -->

<div class="navbar navbar-inverse navbar-fixed-top"> 
  
  <!-- start: TOP NAVIGATION CONTAINER -->
  
  <div class="container">
    <div class="navbar-header"> 
      
      <!-- start: RESPONSIVE MENU TOGGLER -->
      
      <button data-target=".navbar-collapse" data-toggle="collapse" class="navbar-toggle" type="button"> <span class="clip-list-2"></span> </button>
      
      <!-- end: RESPONSIVE MENU TOGGLER --> 
      
      <!-- start: LOGO -->
      
      <?php $this->load->view("common/logo"); ?>
      
      <!-- end: LOGO --> 
      
    </div>
    <div class="navbar-tools"> 
      
      <!-- start: TOP NAVIGATION MENU -->
      
      <?php $this->load->view("common/notifications.php"); ?>
      
      <!-- end: TOP NAVIGATION MENU --> 
      
    </div>
  </div>
  
  <!-- end: TOP NAVIGATION CONTAINER --> 
  
</div>

<!-- end: HEADER --> 

<!-- start: MAIN CONTAINER -->

<div class="main-container">
<div class="navbar-content"> 
  
  <!-- start: SIDEBAR -->
  
  <?php $this->load->view("common/navigation"); ?>
  
  <!-- end: SIDEBAR --> 
  
</div>

<!-- start: PAGE -->

<div class="main-content">

<!-- end: SPANEL CONFIGURATION MODAL FORM -->

<div class="container">

<!-- start: PAGE HEADER -->

<div class="row">
  <div class="col-sm-12"> 
    
    <!-- start: PAGE TITLE & BREADCRUMB -->
    
    <ol class="breadcrumb">
      <li> <a href="#"> Dashboard </a> </li>
      <li> <a href="<?php echo base_url(''); ?>"> Unload Delivery </a> </li>
      <li class="active"> Unload Balance Details </li>
      <li class="search-box">
        <form class="sidebar-search">
          <div class="form-group">
            <input type="text" placeholder="Start Searching...">
            <button class="submit"> <i class="clip-search-3"></i> </button>
          </div>
        </form>
      </li>
    </ol>
    <div class="page-header">
      <h1>Unload Balance Details</h1>
    </div>
    <p>Please fill in the information below. The field labels marked with * are required input fields.</p>
  </div>
</div>

<!-- end: PAGE HEADER --> 

<!-- start: PAGE CONTENT 

                    <!-- start grid -->

<div class="row">
  <div class="col-md-12"> 
    
    <!-- start: DYNAMIC TABLE PANEL -->
    
    <div class="panel panel-default">
      <div class="panel-heading"> <i class="fa fa-plus"></i> Unload Balance Details</div>
      <div class="panel-body">
        <div class="alert alert-danger" style="display:none;">
          <button class="close" data-dismiss="alert"> × </button>
          <i class="fa fa-times-circle"></i> <strong></strong> <span class="errortxt"></span> </div>
        <div class="alert alert-success" style="display:none;">
          <button class="close" data-dismiss="alert"> × </button>
          <i class="fa fa-check-circle"></i> <strong></strong><span class="succetxt"></span> </div>
        <form role="form" class="form-horizontal" id="create_sales_form" action="#" method="post">
          <div class="col-md-12"></div>
          <!--col-md-12-->
          
          <div class="col-md-12">
            <div class="col-md-12">
              <div class="panel panel-default">
                <div class="panel-heading" style="font-weight: 700;">Date Time - <?php echo $delivary_details['loading_date_time']?> | Route - <?php echo $delivary_details['route_name']?> | Vehicle - <?php echo $delivary_details['vehicle_code']?> | Sales Rep - <?php echo $delivary_details['user_first_name']?> </div>
                <div class="panel-body">
                  <input type="hidden" name="delivary_id" value="<?php echo $delivary_details['id']?>">
                  <input type="hidden" name="route_id" value="<?php echo $delivary_details['route_id']?>">
                  <div class="col-md-12">
                    <div class="form-group">
                      <table class="table items table-striped table-bordered table-condensed table-hover" id="term_table">
                        <thead>
                          <tr>
                            <th class="col-md-7">Product</th>
                            <th class="col-md-3">Loaded<br>
                              QTY</th>
                            <th class="col-md-3">Balance Qty</th>
                          </tr>
                        </thead>
                        <tbody>
                          <?php

$totqty1=0;
$totqty2=0;


$count=0;
 foreach($comman_balance_array as $row2){
	 $count++;
	 $totqty1+=$row2['loaded_qty'];
	 $totqty2+=$row2['product_qty'];
	 
	   

?>
                          <tr data-item-id="144680019784" id="row_1446800197032">
                            <td><?php echo $row2['product_name']?> - (<?php echo $row2['book_year']?>) </td>
                            <td><?php echo  $row2['loaded_qty']?></td>
                            <td><?php echo  $row2['product_qty']?></td>
                          </tr>
                          <?php }?>
                        </tbody>
                        <tfoot>
                          <tr class="tfoot active" id="tfoot">
                            <th ></th>
                            <th > Total Qty - <?php echo $totqty1?></th>
                            <th > Total Qty - <?php echo $totqty2?></th>
                          </tr>
                        </tfoot>
                      </table>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <!--col-md-8-->
          
          <div class="col-md-12">
            <div class="modal-footer" style="margin-bottom:10px;"> <a class="btn btn-warning pull-left"  href="<?php echo base_url('marketing_sample_process/cus_sample_manage_new/'.$delivary_details['id']); ?>"> Manual Sample Issue </a> <a class="btn btn-warning pull-left"  href="<?php echo base_url('marketing_chit_invoice_process/manual_customer_invoice/'.$delivary_details['id']); ?>"> Manual Invoice </a> <a class="btn btn-warning pull-left"  href="<?php echo base_url('marketing_chit_invoice_process/arrange_loading_pending/'.$delivary_details['id']); ?>"> Manual Free Issue </a> <a class="btn btn-danger pull-left"  href="<?php echo base_url('marketing_delivery_process/sales_rep_sample_load/'.$delivary_details['id']); ?>"> Lost Items </a>
              <input type="button" class="btn btn-primary" value="Unloading Sheet(Expand)" name="nn" id="nn" onClick="expand_unloading_sheet_print(<?php echo $delivary_details['id'] ?> )">
              <input type="button" class="btn btn-primary" value="Unloading Sheet" name="pp" id="pp" onClick="unloading_sheet_print(<?php echo $delivary_details['id'] ?> )">
            </div>
          </div>
        </form>
        
        <!-- end: DYNAMIC TABLE PANEL --> 
        
      </div>
    </div>
    
    <!-- end grid --> 
    
  </div>
  
  <!-- end: PAGE --> 
  
</div>

<!-- end: MAIN CONTAINER --> 

<!-- start: FOOTER -->

<div class="footer clearfix">
  <div class="footer-inner"> 2014 &copy; clip-one by cliptheme. </div>
  <div class="footer-items"> <span class="go-top"><i class="clip-chevron-up"></i></span> </div>
</div>

<!-- end: FOOTER --> 

<!-- start: RIGHT SIDEBAR --> 

<!-- end: RIGHT SIDEBAR -->

<div id="event-management" class="modal fade" tabindex="-1" data-width="760" style="display: none;">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times; </button>
        <h4 class="modal-title">Event Management</h4>
      </div>
      <div class="modal-body"></div>
      <div class="modal-footer">
        <button type="button" data-dismiss="modal" class="btn btn-light-grey"> Close </button>
        <button type="button" class="btn btn-danger remove-event no-display"> <i class='fa fa-trash-o'></i> Delete Event </button>
        <button type='submit' class='btn btn-success save-event'> <i class='fa fa-check'></i> Save </button>
      </div>
    </div>
  </div>
</div>
<input name="tmpVal" type="hidden" id="tmpVal" value="0">
<input name="" id="type_sale" type="hidden" value="22">

<!-- start ajax model -->

<div id="ajax-modal" class="modal fade" data-backdrop="static" data-keyboard="false" tabindex="-1" style="display: none;"></div>

<!-- end ajax model --> 

<!-- start: MAIN JAVASCRIPTS -->

<?php $this->load->view("common/footer"); ?>
<script src="<?php echo asset_url(); ?>js/jquery-ui.js" ></script> 
<script src="<?php echo asset_url(); ?>js/moment-with-locales.js"></script> 
<script type="text/javascript" src="<?php echo asset_url(); ?>js/bootstrap-datetimepicker.js"></script> 
<script type="text/javascript" src="<?php echo asset_url(); ?>js/bootbox.min.js"></script> 
<script type="text/javascript" src="<?php echo asset_url(); ?>js/accounting.js"></script> 
<script type="text/javascript" src="<?php echo asset_url(); ?>js/accounting.min.js"></script> 

<!-- end: MAIN JAVASCRIPTS --> 

<!-- start: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY VALIDATION--> 

<!-- end: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY  VALIDATION--> 
<script>
   
function unloading_sheet_print(id) 
{
	u=location.href;
	t=document.title;
	window.open('<?php echo base_url() ?>marketing_delivery_process/unloading_sheet_print?id='+id,'sharer','toolbar=0,status=0,width=700,height=700, left=10, top=10,scrollbars=yes');return false;
}

function expand_unloading_sheet_print(id) 
{
	u=location.href;
	t=document.title;
	window.open('<?php echo base_url() ?>marketing_delivery_process/expand_unloading_sheet_print?id='+id,'sharer','toolbar=0,status=0,width=700,height=700, left=10, top=10,scrollbars=yes');return false;
}
   
  
</script>
</body>

<!-- end: BODY -->

</html>