<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="../css/main.css" rel="stylesheet" type="text/css" />
<?php
include ("../navigation/header.php");
require_once('../include/tc_calendar.php');

date_default_timezone_set('Africa/Gaborone');
$entry_date = date("Y-m-d H:i:s", time()); 

$fuel_id = $_GET['fuel_id'];

$table_name = $_SESSION['db_prefix']."_fuel_supply";
$fuel_query = "SELECT * FROM $table_name WHERE fuel_id = '".$fuel_id."'  ";
$fuel_result = mySQL_query($fuel_query);
$fuel_num = mysql_num_rows($fuel_result);
$supply_date = mysql_result($fuel_result, 0, "supply_date");
$vehicle_id = mysql_result($fuel_result, 0, "vehicle_id");
$fuel = mysql_result($fuel_result, 0, "fuel");
$qty_supplied = mysql_result($fuel_result, 0, "qty_supplied");
$reference = mysql_result($fuel_result, 0, "rec_no");
$mileage = mysql_result($fuel_result, 0, "mileage");
$driver = mysql_result($fuel_result, 0, "driver");
$notes = mysql_result($fuel_result, 0, "notes");

	
	

$table_name = $_SESSION['db_prefix']."_vehicle";
$vehicle_query = "SELECT vehicle_id, registration_no, make, model, fuel FROM $table_name WHERE vehicle_id ='".$vehicle_id."' ";
$vehicle_result = mySQL_query($vehicle_query);
$vehicle_num = mysql_num_rows($vehicle_result);	
$vehicle_name = mysql_result($vehicle_result, 0, "registration_no").' '.mysql_result($vehicle_result, 0, "make").' '.mysql_result($vehicle_result, 0, "model");
$fuel = mysql_result($vehicle_result, 0, "fuel"); 	



?>
</head>



<?php

$page_name = "Stores-main";
include ("../navigation/access.php");
if ($permission_num==1) {
	include ("../navigation/store_sidebar.php");
?>

<body>

<div class="main_frame"  style="height:auto; min-height:570px;">

<div class="page_head_frame">
        <table width="809" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><label class="label_page_head">Fuel recording</label></td>
            </tr>
        </table>
      </div>
        <br /><br />
        <div class="page_middle_frame">
          <div class="hidden_frame" id="hidden_frame">
<div class="page_inside_frame">
  Fuel for:&nbsp;&nbsp; <label class="label_caption_green"> <?php echo $vehicle_name; ?></label>
  <br><br>
  <table width="645"  id="table_display">
    <tr>
      <td width="158" height="29">Fuel supply  date:</td>
      <td><?php echo date("d-m-Y", strtotime($supply_date)) ?>&nbsp;</td>
      <td>Record no:</td>
      <td><?php echo $fuel_id ?>&nbsp;</td>
      </tr>
    <tr>
      <td height="43">Fuel type:</td>
      <td>&nbsp;<?php echo $fuel ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
      <td>km reading:</td>
      <td><?php echo $mileage ?>&nbsp;km</td>
      </tr>
    <tr>
      <td height="43">Qty:</td>
      <td width="164"><?php echo $qty_supplied ?>&nbsp;ltr. </td>
      <td width="93">&nbsp;</td>
      <td width="210">&nbsp;</td>
    </tr>
    <tr>
      <td height="43">Fuel book no:</td>
      <td><?php echo $reference ?>&nbsp;</td>
      <td>Received by:</td>
      <td><?php echo $driver ?>&nbsp;</td>
    </tr>
    <tr>
      <td height="58">Notes:</td>
      <td colspan="3"><?php echo $notes ?>&nbsp;</td>
      </tr>
</table>
  
</div>


<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form2");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("fuel_price_text","req","- fuel price. (To be set in the presets page)");
  frmvalidator.addValidation("qty_text","req","- quantity.");
  frmvalidator.addValidation("mileage_text","req","- km meter reading.");
  frmvalidator.addValidation("provider_select","req","- provider.");
  frmvalidator.addValidation("reference_text","req","- reference.");
  frmvalidator.addValidation("received_select","req","- received by.");
  
</script>
</div>     
</div>
</div>





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


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