<?php $pageno = 2; ?>
<!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'); ?>
	<!--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
		});
	});
	function chkConfirm()
	{
		var chk=confirm('Are you sure to delete Vander Details');
		if(chk==true)
		{
			return true;
		}
		else
		{
			return false;
		}	
	}
	function changeStatus(toStatus,id){

	document.frmUsers.action="?mode=changeStatus&st="+toStatus+"&proid="+id;
	document.frmUsers.submit();
}
    </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/BusesList/" class="current" ><span>Master Details</span></a></li> 
			<li><a href="<?php echo base_url(); ?>index.php/Administrator/RouteList/" ><span>Route List</span></a></li> 
			<li><a href="<?php echo base_url(); ?>index.php/Administrator/BusDayReport/" ><span>Day Report</span></a></li>
			<li><a href="<?php echo base_url(); ?>index.php/Administrator/BusReport/" ><span>Month Report/Bus</span></a></li>
			<li><a href="<?php echo base_url(); ?>index.php/Administrator/BusReportRoute/" ><span>Month Report/Route</span></a></li>
		</ul>
	</div>   
</div>
<div class="container_16" id="wrapper">	
    <div class="grid_16" id="content"> 
		<div class="grid_9">
			<h1 class="user">Route Details</h1>
		</div>
		<div class="grid_15" id="textcontent">
		<?php if(($LoginDetails[0] == 1) || ($LoginDetails[0] == 4))
		{ ?>
			<table style="float: right;">
				<tr> 			
					<td align="right" colspan="9">
						<a style="float:left;margin-top: -5px;margin-left: 5px;" class="button" href="<?php echo base_url(); ?>index.php/Administrator/Addroutedetails/"><span>Add Route Details</span></a>
					</td>
				</tr>
			</table>
		<?php } ?>
			<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="#" method="post" enctype="multipart/form-data" name="frmUsers" id="frmTransaction" >
					<table id="datatables" class="display">
						<thead>
							<tr>
								<th>Sno</th>
								<th>Route Name</th> 
								<th>Route No.</th>
								<th>Status</th>
								<th>Edit</th>
							</tr>
						</thead>
						<tbody>
							<?php
							$i=0;
							foreach ($query as $row)
							{
								$i++;
								$proid  = $row->vehicle_id;
							?>
							<tr>
								<td><?php echo $i;?></td>
								<td><?php echo $row->route_details; ?></td>
								<td><?php echo $row->route_id; ?></td>
								<td>
								
									<?php
									$status = $row->route_status;
									if($status=='D'){
										?><img src='<?php echo base_url(); ?>assets/images/red-point.gif' alt='Inactive' border='0'><?php
									}else{
										?><img src='<?php echo base_url(); ?>assets/images/green-point.gif' alt='Active' border='0'><?php
									}
									?>
								
								</td>
								<td><a href="<?php echo base_url(); ?>index.php/Administrator/EditRouteDetails/
								<?php echo $proid; ?><?php echo $row->route_id; ?>" title="Edit" class="edit_icon"></a></td>
							</tr>
							<?php
							}
							?>
						</tbody>
					</table>
					</form>	
				</div>
			</div>
		</div>
		<div class="clear"> </div>		
	</div>
</div>
<?php include('template/footer.php'); ?>
</body>
</html>
		