<?php
	include('common/header.php');									
?>
<br>
<br>
</h5>
<div class="row">
  <section class="panel panel-default">
  	<div class="panel-body bs-example form-horizontal">
	<div class="col-xs-12">
		<div class="table-header">
			
		</div>
		<div class="widget-body">
					<div class="widget-main">
						<div class="row">
							<div class="col-sm-12">
								<form class="form-horizontal" role="form" method="post" name="module_form" id="module_form" action="<?php echo base_url();?>index.php/gc/refill_due_report/excel_refill_due" >
								<!-- <input type="hidden" name="excel_country_id" value="<?php echo $this->_page_data['excel_country_id']; ?>">

           						<input type="hidden" name="excel_state_id" value="<?php echo $this->_page_data['excel_state_id']; ?>">

            				    <input type="hidden" name="excel_city_id" value="<?php echo $this->_page_data['excel_city_id']; ?>">

           					    <input type="hidden" name="excel_customer_id" value="<?php echo $this->_page_data['excel_customer_id']; ?>">

            					<input type="hidden" name="excel_dispenser_id" value="<?php echo $this->_page_data['excel_dispenser_id']; ?>">

            					<input type="hidden" name="excel_refill_due" value="<?php echo $this->_page_data['excel_refill_due']; ?>">

            					<input type="hidden" name="excel_export" value="<?php echo 1; ?>"> -->

            					<!-- <input type="hidden" name="dis_country_name" value="<?php echo $dis_country_name; ?>">
            					<input type="hidden" name="dis_state_name" value="<?php echo $dis_state_name; ?>">
            					<input type="hidden" name="dis_city_name" value="<?php echo $dis_city_name; ?>">
            					<input type="hidden" name="dis_customer_name" value="<?php echo $dis_customer_name; ?>"> -->
            					<input type="hidden" name="customer_id" value="<?php echo $customer_id; ?>">
            					<input type="hidden" name="dispenser_id" value="<?php echo $dispenser_id; ?>">
            					
								<div class="">
									<!-- PAGE CONTENT BEGINS -->
									
									<?php  
									 if($dis_customer_name!=""){
									?>
									<div class="form-group">  
										<label class="col-sm-5 control-label" for="form-field-2" ><?php echo 'Customer Name ';?> :</label>
										<div class="col-sm-7" style="padding: 4px;">	
											<?php echo $dis_customer_name;?>
										</div>
									</div>
									<?php }
									 if($dis_product_name!=""){
									?>
									<div class="form-group">  
                                        <label class="col-sm-5 control-label" for="form-field-2" ><?php echo 'Dispenser';?> :</label>
                                        <div class="col-sm-7" style="padding: 4px;">  
                                          <?php echo $dis_product_name;?>
                                        </div>
                                    </div>
									 <?php }?>
									
								</div>
								
							</div>
						</div>
					</div>	
				</div>
				
		<div class="table-responsive">
		<table  cellspacing="0" width="100%" class="table table-bordered dataTables">
            <thead>
                <tr>
					<th class="text-center">Sr No</th>
                    <th class="text-center">Date</th>
                    <th class="text-center">Customer Name</th>
                 
                    <th class="text-center">Dispenser</th>
                    <th class="text-center">Refill</th>
                    <th class="text-center">Last refill date</th>
                    <th class="text-center">Action</th>
                </tr>   
            </thead>
            <tbody>
				<?php 
				$icnt=0;
     			$count=count($stop_refill);
     			if ($count>0) {
                 foreach ($stop_refill as $value) {
                 $dispenser_sales_id=$value->dispenser_sales_id;
                 $dispenser_refill_details_id=$value->dispenser_refill_details_id;
                // $id= $this->encrypt->encode($dispenser_sales_id);
                //$dispenser_refill_details_id= $this->encrypt->encode($dispenser_refill_details_id);
				$dispenser_refill_details_id=encrypt_decrypt_parameters($dispenser_refill_details_id,'encrypt');
                 $installation_date=$value->installation_date;
                 $customer_name=$value->customer_name;
                 $city_name=$value->city_name;
                 $refill_name=$value->refill_name;
                 $refill_date=$value->refill_date;
                 $dispenser=$value->dispenser;
                  $icnt++;
        		$sr=$offset+$icnt;

				 ?>
				<tr>
					<td><?php echo $sr; ?></td>
					<?php 
                     if ($installation_date=='0000-00-00') {?>
					<td><?php echo $installation_date; ?></td><?php }else{?>
					<td><?php echo get_date_dmy_format_wo_time($installation_date); ?></td>
					<?php } ?>
					<td><?php echo $customer_name; ?></td>
					<td><?php echo $dispenser; ?></td>	
					<td><?php echo $refill_name; ?></td>	
					<?php 
                     if ($refill_date=='0000-00-00') {?>
					<td><?php echo $refill_date; ?></td><?php }else{?>
					<td><?php echo get_date_dmy_format_wo_time($refill_date); ?></td>
					<?php } ?>
					
					<td>
						<b><a href="<?php echo base_url();?>index.php/gc/refill_track/stop_refill_data/<?php echo $dispenser_refill_details_id;?>/stop">Stop Refill</a></b>
					</td>
				</tr>
			<?php 
			//$srno=$srno+1;
		     } 
		     }else{?>
              <td colspan="8" class="text-center">no data found</td>
         <?php } ?>
               
            </tbody>
        </table>
		</div>
  <?php
     if($num_results > 0) { ?>
      <div class="block"> </div>
        <div class="clearfix">
        <div class="row">
          <?php 
            if (strlen($pagination)): 
              $label_disp="Stop Refill";
              $data['label_disp']=$label_disp;
              $data['count']=$count;
              $this->load->view('pagination_view.php',$data);
            endif; ?>
            </div>
        </div>
          <div class="block"> </div>
      <?php } ?>
   </div>	
</section>
		<div class="clearfix form-actions">
			<div class="col-md-offset-5 col-md-5">
				<button class="btn btn-info" type="button" onclick="javascript:window.location='<?php echo base_url();?>index.php/gc/refill_track/manage_stop_refill'">
					Back
				</button>
			</div>
		</div>
		</form>	
		
	</div>
</div>
<div>
	<!-- /.page-row -->
    <!-- /.page-content --> 
</div>
<!-- /.main-content --> 
</div>
<!-- /#ace-settings-container --> 
</div>
<!-- /.main-container-inner -->
<script>
	$(document).ready(function() {
    $('#simple-table').hide();
});
</script> 

<script>
	$(document).ready(function() {
    $("#change").click(function(){
     $('#simple-table').show();
 });
});
</script> 
<?php
	include('common/footer.php');
?>
<script type="text/javascript">
$(document).ready(function() {
    $('#example').DataTable( {
    destroy: true,
    searching: false,
    "order": [],
    "columnDefs": [
      { "orderable": false, "targets":  [] }
      ]
  } );
});
</script>
