<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>

<!DOCTYPE html>

<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">

<link href="font-awesome-4.4.0/css/font-awesome.min.css"
	rel="stylesheet" />

<link rel="stylesheet" href="<?php echo base_url(); ?>assets/admin_css/css/jquery.datetimepicker.css" />
<!-- <link href="css/for_mobile.css" rel="stylesheet" /> -->
<link href="<?php echo base_url(); ?>assets/admin_css/css/bootstrap.min.css" rel="stylesheet" />
<link href="<?php echo base_url(); ?>assets/font-awesome-4.4.0/css/font-awesome.min.css"
	rel="stylesheet" />
<link href="<?php echo base_url(); ?>assets/admin_css/css/jquery.dataTables.css" rel="stylesheet"></link>
<link href="<?php echo base_url(); ?>assets/admin_css/css/jquery.dataTables.min.css" rel="stylesheet"></link>
<link href="<?php echo base_url(); ?>assets/admin_css/css/buttons.dataTables.min.css" rel="stylesheet"></link>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="<?php echo base_url(); ?>assets/admin_js/js/jquery-1.9.1.js"></script>
<script type="text/javascript"
	src="<?php echo base_url(); ?>assets/admin_js/js/jquery.dataTables.min.js"></script>
<script type="text/javascript"
	src="<?php echo base_url(); ?>assets/admin_js/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/admin_js/js/buttons.print.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/admin_js/js/buttons.colVis.min.js"></script>
<script src="<?php echo base_url(); ?>assets/admin_js/js/bootstrap.min.js"></script>
<script src="<?php echo base_url(); ?>assets/admin_js/js/jquery.datetimepicker.js"></script>

<script type="text/javascript">
	$(document)
			.ready(
					function() {

						$('#example')
								.dataTable(
										{
											// dom: 'Bfrtip',

											//  dom: 'Bfrtip',
											"lengthMenu" : [
													[ 20, 100, 500, -1 ],
													[ 20, 100, 500, "All" ] ],
											//  iDisplayLength: 20,

											/* 	dom : 'Bf<"top"i>rt<"left"lp><"clear">', */
											dom : '<"top"lBf>rt<"left"i><"clear">p',
											/*  buttons: [
											     'print'
											 ],  */
											buttons : [
													{
														extend : 'print',
														title : "",
														message : "<table class='table ' align='center'><tr><td colspan='7' align='center'><label for='exampleInputEmail1'>"

																+ " </label></td></tr><tr><td colspan='8' align='center'><label for='exampleInputEmail1'>All Customer List</label></td></tr> </table>",
														exportOptions : {
															columns : ':visible'
														}
													}, 'colvis'

											],
											columnDefs : [ {
												//		targets : -1,
												visible : false
											} ]
										});
					});
</script>


<script>
	$(function() {
		$('#date1').datetimepicker();
	});

	$(function() {
		$('#date2').datetimepicker();
	});
</script>


</head>
<body>


	<div class="row">

		<h3 style="text-align: center;"> All Pending Bilty Report  </h3>

		<form id="form1" action="" method="post">
	</br>
	<div class="col-md-1"></div>
	<div class="col-md-10">


		<!-- <div class="col-md-1">To</div> -->

		<div class="col-md-1">
			<center>
				<label>Date</label>
			</center>
		</div>
		<div class="col-md-2">
			<input type="date" class="form-control" placeholder="Date"
				id="date1" name="date1" placeholder="Date."
				value="" />
		</div>
		<div class="col-md-1">
			<center>
				<label>Date</label>
			</center>
		</div>
		<div class="col-md-2">
			<input type="date" class="form-control" placeholder="Date"
				id="date2" name="date2" placeholder="Date."
				value="" />
		</div>


		<div class="col-md-1">
			<center>
				<button class="submit" type="submit">Get</button>
			</center>

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


		<div class="row">


			<div class="col-md-12">
				</br>

				<div class="table-responsive">

					<table class="table table-bordered" id="example">
						<thead class="thead_bg">

							
							<tr style="
    font-size: 14px;
">
											<th style="text-align: center;" width="4%">S.N</th>
												<th style="text-align: center;" width="21%">Print</th>
												<th style="text-align: center;" width="21%">Edit</th>
											<th style="text-align: center;" width="21%">LR No</th>
											<th style="text-align: center;" width="25%">Date</th>

											<th style="text-align: center;" width="10%">Consignor
												Name</th>
											<th style="text-align: center;" width="10%">Consignor
												GSTIN</th>
											<th style="text-align: center;" width="10%">Consignor
												Address</th>
											<th style="text-align: center;" width="10%">Consignee
												Name</th>
											<th style="text-align: center;" width="10%">Consignee
												GSTIN</th>
											<th style="text-align: center;" width="25%">Consignee
												Address</th>


											<th style="text-align: center;" width="25%">From</th>
											<th style="text-align: center;" width="10%">TO</th>
											<th style="text-align: center;" width="10%">Truck No</th>

											<th style="text-align: center;" width="10%">Lot No</th>
											<th style="text-align: center;" width="25%">PR No.</th>
											<th style="text-align: center;" width="10%">PM</th>
											<th style="text-align: center;" width="10%">Quality</th>
											<th style="text-align: center;" width="10%">Product</th>
											<th style="text-align: center;" width="10%">Weight</th>
											<th style="text-align: center;" width="10%">Rate</th>
											<th style="text-align: center;" width="10%">Total Amt.</th>									
										
											<th style="text-align: center;" width="10%">Packages</th>
											<th style="text-align: center;" width="10%">Remark</th>	
											<th width="5%" style="text-align: center;">Consignee</th>										
											<th width="5%" style="text-align: center;">Consignor</th>
											<th width="5%" style="text-align: center;">Blank</th>

											<th width="3%" style="text-align: center;">Action</th>
							</tr>
						</thead>

						<tbody style="background: #fff;">




                                  <?php


																	$total_final_price = 0;
																	$total_package = 0;
																	$count=0;

																	foreach($all_info as  $dto){



																		$originalDate1 = $dto->bill_date;
																$newDate1 = date("d-m-Y", strtotime($originalDate1));

															

																$total_final_price += $dto->total_amount;

																

																

																$total_package += number_format((float)$dto->packages, 2, '.', '');

															


                                  ?>
							<tr style="font-size: 14px;">

								<td style="text-align: center;"> <?php  echo $count+1 ?></td>
								
								<td style="text-align: center;"><a
                      	href="<?php echo site_url().'/BiltyControllers/getInfoById/'.$dto->id; ?>"> <i
	             	class="fa fa-print" aria-hidden="true" title="Print"></i>
                                </a></td>
                         
						 
						   <td style="text-align: center;"><a
									href="<?php echo site_url().'/biltyControllers/getFullInfoById/'.$dto->id; ?>"> <i
										class="fa fa-pencil" aria-hidden="true" title="Update"></i>
								</a></td>


								</a></td>
								<td style="text-align: center;"><?php echo $dto->invoice_no; ?></td>

								<td style="text-align: center;"><?php echo $newDate1 ?></td>




<td style="text-align: center;"><?php echo $dto->consignor_name; ?></td>
<td style="text-align: center;"><?php echo $dto->consignor_gstin; ?></td>
<td style="text-align: center;"><?php echo $dto->consignor_address; ?></td>
<td style="text-align: center;"><?php echo $dto->consignee_name; ?></td>
<td style="text-align: center;"><?php echo $dto->consignee_gstin; ?></td>
<td style="text-align: center;"><?php echo $dto->consignee_address; ?></td>
<td style="text-align: center;"><?php echo $dto->source; ?></td>
<td style="text-align: center;"><?php echo $dto->destination; ?></td>

<td style="text-align: center;"><?php echo $dto->truck_no; ?></td>
<td style="text-align: center;"><?php echo $dto->lot_no; ?></td>
<td style="text-align: center;"><?php echo $dto->pr_no; ?></td>
<td style="text-align: center;"><?php echo $dto->pm; ?></td>
<td style="text-align: center;"><?php echo $dto->quality; ?></td>
<td style="text-align: center;"><?php echo $dto->item; ?></td>
<td style="text-align: center;"><?php echo $dto->weight; ?></td>
<td style="text-align: center;"><?php echo $dto->rate; ?></td>
<td style="text-align: center;"><?php echo $dto->total_amount; ?></td>

<td style="text-align: center;"><?php echo $dto->packages; ?></td>

<td style="text-align: center;"><?php echo $dto->remark; ?></td>

<td style="text-align: center;"><a
                      	href="<?php echo site_url().'/BiltyControllers/getInfoByIdConsignee/'.$dto->id; ?>"> <i
	             	class="fa fa-print" aria-hidden="true" title="Print"></i>
                                </a></td>

								<td style="text-align: center;"><a
                      	href="<?php echo site_url().'/BiltyControllers/getInfoByIdConsignor/'.$dto->id; ?>"> <i
	             	class="fa fa-print" aria-hidden="true" title="Print"></i>
                                </a></td>

<td style="text-align: center;"><a
                      	href="<?php echo site_url().'/BiltyControllers/getInfoByIdBlank/'.$dto->id; ?>"> <i
	             	class="fa fa-print" aria-hidden="true" title="Print"></i>
                                </a></td>




								<td style="text-align: center;"><a
									href="<?php echo site_url().'/biltyControllers/deleteInfo/'.$dto->id; ?>?id="> 	<i class="fa fa-trash" aria-hidden="true" title="Delete "></i>
								</a></td>






							</tr>

							  <?php



$count++;

							 } ?>



						</tbody>

						<tfoot>
										<tr>
										<th style="text-align: center;" width="5%"></th>
											<th style="text-align: center;" width="5%"></th>
											<th style="text-align: center;"></th>
													<th style="text-align: center;"></th>
										
											
											
											<th style="text-align: center;"> </th>


                                     <th style="text-align: center;"> </th>
                                        <th style="text-align: center;"> </th>
                                       <th style="text-align: center;"></th>
                                       <th style="text-align: center;"></th>
                                       <th style="text-align: center;"></th>

									   <th style="text-align: center;"> </th>
                                        <th style="text-align: center;"> </th>
                                       <th style="text-align: center;"></th>
                                       <th style="text-align: center;"></th>
									  
                                       <th style="text-align: center;"></th>
									   <th style="text-align: center;"> </th>
                                        <th style="text-align: center;"> </th>
                                       <th style="text-align: center;"></th>
                                       <th style="text-align: center;"></th>
									
                                       <th style="text-align: center;"></th>
									   <th style="text-align: center;">Total:-</th>
									   <th style="text-align: center;"><?php echo $total_final_price ?></th>
									   <th style="text-align: center;"><?php echo $total_package ?> </th>
                                        <th style="text-align: center;"> </th>
                                       <th style="text-align: center;"></th>
                                       <th style="text-align: center;"></th>
                                       <th style="text-align: center;"></th>
									   <th style="text-align: center;"></th>


										</tr>
									</tfoot>


					</table>

					<br></br>



				</div>


			</div>
		</div>

	</div>
</body>
</html>
