<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../jscript/jquery.1.4.2.js"></script>
<script language="javascript" src="../jscript/calendar.js"></script>

<?php
include ("../navigation/header.php");


$page = $_GET['page'];
	
if ($page=='vehicle') {
$reference='vehicle_fuel_list.php?date=&vehicle_id=';	
$page_display='Vehicle fuel.';
$ref='vehicle';
$table_name = $_SESSION['db_prefix']."_vehicle";
$vehicleQuery = "SELECT vehicle_id, registration_no, make, model FROM $table_name  ORDER BY registration_no ASC";
$vehicleResult = execsql($vehicleQuery);
$vehicleNum = mysql_num_rows($vehicleResult);
	$w = 0;
	$arrId4 = array ();
	$arrName4 = array ();
	while ($w < $vehicleNum) {
		$arrId4[$w] = mysql_result($vehicleResult, $w, 'vehicle_id');
		$arrName4[$w] = mysql_result($vehicleResult, $w, 'registration_no').' '.mysql_result($vehicleResult, $w, 'make').' '.mysql_result($vehicleResult, $w, 'model');
		$w++;
	}
}

if ($page=='company') {
$reference='company_fuel_list.php?date=&company=';	
$page_display='Company fuel.';
$ref='company';
$table_name = $_SESSION['db_prefix']."_list_company";

    $position_query = "SELECT item_name FROM $table_name ORDER BY item_name ASC";
	$arrId2 = array ();
	$arrName2 = array ();
	$position_result = execsql($position_query);
	if ($position_result!="") {
	$position_num = mysql_num_rows($position_result);
	$b = 0;
	while ($b < $position_num) {
		$arrId2[$b] = mysql_result($position_result, $b, "item_name");
		$arrName2[$b] = mysql_result($position_result, $b, "item_name");
		$b++;
	}
	}
}

?>
</head>

<body>
<?php

$page_name = "stores-main";
include ("../navigation/access.php");
if ($permission_num==1) {
	include ("../navigation/store_sidebar.php");
?>
<div class="main_frame">
<div class="page_head_frame">
        <table width="630" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="385"><label class="label_page_head">Select </label></td>
            <td align="right">&nbsp;</td>
          </tr>
        </table>
      </div>
       
<div class="page_middle_frame"><br />

<?php 
if ($page=='vehicle') { ?>
<div class="page_inside_frame">
  <label class="label_std" style="font-size:16px;"><?php echo $page_display?></label>
  <br />
  <br />
  <form action="" method="get">
  
    <label class="label_std"> Select <?php echo $ref?> : &nbsp;&nbsp;</label>
    <select name="vehicle_select" autofocus class="selectbox300" id="vehicle_select" onchange="window.location.href= this.form.vehicle_select.options[this.form.vehicle_select.selectedIndex].value"> 
      <option value=" " selected="selected" >&nbsp;</option>
      <?php
    	for ($j = 0; $j < count($arrId4); $j++) {
			echo "<option value=".$reference.$arrId4[$j].">".$arrName4[$j]."</option>";	
		}
     ?>
    </select>
  
  </form>
  <br />
  <br />
<br />
<br />
<br />
</div>
<?php } ?>


<?php 
if ($page=='company') { ?>
<div class="page_inside_frame">
  <label class="label_std" style="font-size:16px;"><?php echo $page_display?></label>
  <br />
  <br />
  <form action="" method="get">
  
    <label class="label_std"> Select <?php echo $ref?> : &nbsp;&nbsp;</label>
    <select name="company_select" autofocus class="selectbox300" id="company_select" onchange="window.location.href= this.form.company_select.options[this.form.company_select.selectedIndex].value"> 
      <option value=" " selected="selected" >&nbsp;</option>
      <?php
    	for ($j = 0; $j < count($arrId2); $j++) {
			echo "<option value='".$reference.$arrId2[$j]."'>".$arrName2[$j]."</option>";	
		}
     ?>
    </select>
  
  </form>
  <br />
  <br />
<br />
<br />
<br />
</div>
<?php } ?>





    
</div>
</div>
<?php include ('../navigation/side_bar.php'); ?>


<?php } else {
    $_SESSION['denied_return'] = "transport/transport_main.php?date=";	
    include ("../navigation/hr_sidebar.php");?>
    <?php include ('../navigation/side_bar.php'); ?>
	<body onLoad="accessdenied(); return false">	
	</body>
<?php }
?>

</body>
</html>