<?php $pageno = 4; error_reporting(0); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php include('template/head.php'); ?>
	<link rel="stylesheet" href="<?php echo base_url(); ?>assets/datepicker/jquery-ui.css" />
	<!--<script src="<?php echo base_url(); ?>assets/datepicker/jquery-1.9.1.js"></script>-->
	<script src="<?php echo base_url(); ?>assets/datepicker/jquery-ui.js"></script>
	<script type="text/javascript">
	$(function() {
		$( "#datepicker" ).datepicker({ dateFormat: "yy-mm-dd" }).val();
		$( "#datepicker1" ).datepicker({ dateFormat: "yy-mm-dd" }).val();
	});
	</script>
	<!--DATA TABLE --> 
    <script type="text/javascript" src="<?php echo base_url(); ?>assets/data_table/js/jquery.dataTables.js"></script>
    <link href="<?php echo base_url(); ?>assets/data_table/css/demo_table_jui.css" rel="stylesheet" type="text/css"/>
    <link href="<?php echo base_url(); ?>assets/data_table/css/jquery-ui-1.8.4.custom.css" rel="stylesheet" type="text/css"/>
    <!--DATA TABLE -->   
    <script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
		$('#datatables').dataTable({
			"sPaginationType":"full_numbers",
			"iDisplayLength": 100,
			"aaSorting":[[0, "asc"]],
			"bJQueryUI":true
		});
	});
    </script>
	<script type="text/javascript">
	function submitDeleteAll(){
		var countChecked = 0;
		var checkBox = document.getElementsByName('checkbox[]');
		var totalCheckboxes = document.getElementsByName('checkbox[]').length;
	
		if(totalCheckboxes!=0){
			for(var i=0; i<totalCheckboxes; i++){
				if(checkBox[i].checked == true){
					countChecked = countChecked+1;
				}	
			}	
		}

		if(countChecked==0){
			alert("Please select at least one Details");
			return false;
		}
	}
	</script>
	<SCRIPT LANGUAGE="JavaScript">	
	$(document).ready(function() {
		$('#selecctall').click(function(event) {  //on click
			if(this.checked) { // check select status
				$('.checkbox1').each(function() { //loop through each checkbox
					this.checked = true;  //select all checkboxes with class "checkbox1"              
				});
			}else{
				$('.checkbox1').each(function() { //loop through each checkbox
					this.checked = false; //deselect all checkboxes with class "checkbox1"                      
				});        
			}
		});
	   
	});
	</script>
</head>
<body>
<?php include('template/header.php'); ?> 
<div class="grid_16" id="navheader">
	<?php include('template/topnav.php'); ?>
</div>
<div class="grid_16" id="tabs">
	<div class="container">
		<ul>
			<li><a href="<?php echo base_url(); ?>index.php/Administrator/Billing/" class="current" ><span>Billing Details</span></a></li> 
			<li><a href="<?php echo base_url(); ?>index.php/Administrator/PenaltyList/"><span>Penalties</span></a></li>
			<li><a href="<?php echo base_url(); ?>index.php/Administrator/BusRoundList/" ><span>Buses Monthly Round Details</span></a></li>
		</ul>
	</div>   
</div>
<div class="container_16" id="wrapper">	
    <div class="grid_16" id="content"> 
		<div class="grid_9">
			<h1 class="news_edit">Billing Details</h1>
		</div>
		<div class="grid_15" id="textcontent">
			<div id="table">
				<div id="user_profile_main_div">
					<div id="message">
					<?php 
					if($this->session->flashdata('flsh_msg')) {
						?><p id="success" class="info"><span class="info_inner"><?php echo $this->session->flashdata('flsh_msg'); ?></span></p> <?php
					} 
					if($this->session->flashdata('flsh_msg1')) {
						?><p id="error" class="info"><span class="info_inner"><?php echo $this->session->flashdata('flsh_msg1'); ?></span></p> <?php
					} 
					?>
					</div>
					<div class="clear"></div>
					<form action="<?php echo base_url(); ?>index.php/Administrator/BillingReport/" method="post" enctype="multipart/form-data" name="frmUsers" id="frmTransaction" >
					<table style="float: left;margin-top: 14px;">
					<tr>
						<td>
							<span  style="margin-top:10px;">
							<b>Check All</b><input type="checkbox" id="selecctall"/>
							</span >
						</td>
					</tr>
					</table>
					<table style="float: right;">
						<tr>
							<td align="right" colspan="9">
								<input type="text" class="smallInput" name="from" placeholder="Date From" id="datepicker"/>
								<input type="text" class="smallInput" name="to" placeholder="Date To" id="datepicker1"/>
								<input type="text" class="smallInput" name="trip" placeholder="Trip" id="trip"/>
								<span class="button">
									<input name="savereport" class="buttoncc" type="submit" id="delete" value="save as excel" onclick="return submitDeleteAll();">
								</span>
							</td>
						</tr>
					</table>
					<table id="datatables" class="display">
						<thead>
							<tr>
								<th align="left"></th>
								<th>S No</th>
								<th>Tag Id</th>
								<th>Vehicle Number</th>
								<th>Charges (Rs.)</th>
								<th>Route No.</th>
								<th>Vendor</th>
							</tr>
						</thead>
						<tbody>
							<?php
							$i=0;
							foreach ($query as $row)
							{
								$i++;
								$VehicleId = $row->vehicle_id;
							?>
							<tr>
								<td><input class="checkbox1" type="checkbox" name="checkbox[]" value="<?php echo $VehicleId; ?>"></td>
								<td><?php echo $i;?></td>
								<td><?php echo $row->tag_no; ?></td>
								<td>
									<a href="<?php echo base_url(); ?>index.php/Administrator/VehicleDetails/<?php echo $VehicleId; ?>" title="View" class="ajax"><?php echo $row->vehicle_number; ?></a>
								</td>
								<td><?php echo $row->charges; ?></td>
								<td><?php echo $row->route_no; ?></td>
								<td><?php echo $row->vender; ?></td>
							</tr>
							<?php
							}
							?>
						</tbody>
					</table>
					</form>
				</div>
			</div>
		</div>
		<div class="clear"> </div>		
	</div>
</div>
<?php include('template/footer.php'); ?>
</body>
</html>