<?php
include("../include/session.php");
if(!$session->isAdmin()){
	header("Location: ../Store/denied2.php");
}else{
	include("../storeHeader.php");
	
	$vehicleId = mysql_real_escape_string($_GET['vehicleId']);
	
   
	
	$w=0;
	while ($w < 12) {
	$a = 'a';	
	   ${$a.$w} = '';
	   $w++;
	}
	$repNum='';
	
	
	$vehicleQuery = "SELECT * FROM nam_vehicle WHERE vehicleId ='". $vehicleId. "' ";
	$vehicleResult = execsql($vehicleQuery);
	$a1 = mysql_result($vehicleResult, 0, "reg_no");
	$a2 = mysql_result($vehicleResult, 0, "make");
	$a3 = mysql_result($vehicleResult, 0, "model");
	$a4 = mysql_result($vehicleResult, 0, "company");
	$a5 = mysql_result($vehicleResult, 0, "driver");
	$a6 = mysql_result($vehicleResult, 0, "fuel");
	$a7 = mysql_result($vehicleResult, 0, "manufactured");
	$a8 = mysql_result($vehicleResult, 0, "purchase");
	$a9 = mysql_result($vehicleResult, 0, "chassis_no");
	$a10 = mysql_result($vehicleResult, 0, "license");
	$a11 = mysql_result($vehicleResult, 0, "mileage");
	$a12 = mysql_result($vehicleResult, 0, "notes");
	?>
<script type="text/javascript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
<script type="text/javascript">
function checkifempty(){
if (document.form2.account_no_text.value==''){
document.getElementById("add_button").disabled=true
}
else {
document.getElementById("add_button").disabled=false	
}
}
if (document.all || document.getElementById)
setInterval("checkifempty()",100)
</script>
<script type="text/javascript" src="../css/tablesort.js"></script>

<table id="tableMain" width="595">
  <!--begin of tableMain-->
  <tr>
    <td ><div class="headerbox2"> Tocotex Vehicle</div>
    <p class="main">
	<label class="std"><b><font size="3"><?php echo $a1."  -  ".$a2." ".$a3 ?> </font></b></label>
	</p>
    </td>
    <!--center of tableMain-->
  </tr>
  <tr>
    <td><!--center of tableMain-->
      <table width="600" id="tablePlain">
        <tr>
          <td width="113">registration:</td>
          <td width="159"><b><?php echo $a1 ?></b></td>
          <td colspan="2"></b></td>
        </tr>
        <tr>
          <td>make:</td>
          <td><b><?php echo $a2 ?></b></td>
          <td>model</td>
          <td><?php echo $a3 ?></td>
        </tr>
        <tr>
          <td>company:</td>
          <td><?php echo $a4 ?></td>
          <td width="129">driver:</td>
          <td width="179"><?php echo $a5 ?></td>
        </tr>
        <tr>
          <td>fuel:</td>
          <td><b><?php echo $a6 ?></b></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>manufactured:</td>
          <td><b><?php echo $a7 ?></b></td>
          <td>purchase:</td>
          <td><?php echo date("d-m-Y", strtotime($a8 ))?></td>
        </tr>
        <tr>
          <td>chassis number:</td>
          <td colspan="3"><b><?php echo $a9 ?></b></td>
        </tr>
        <tr>
          <td>expiry license:</td>
          <td colspan="3"><?php echo $a10 ?></td>
        </tr>
        <tr>
          <td>mileage:</td>
          <td colspan="3"><?php echo $a11 ?></td>
        </tr>
        <tr>
          <td>notes:</td>
          <td colspan="3"><b><?php echo $a12 ?></b></td>
        </tr>
      </table></td>
  </tr>
   <tr>
  <td><label class="std">&nbsp;&nbsp;&nbsp;<span class="main">
    <input name="button4" type="button" class="linkbutton" id="button4" onclick="MM_goToURL('parent','vehicleReport.php?date=0&RegNoText=<?php echo $a1 ?>');return document.MM_returnValue" value="Report" />
  </span>&nbsp;</label>
    <p class="main">
      
      <input name="button" type="button" class="imagebutton" id="button" onclick="MM_goToURL('parent','showAllProducts.php?cat=Tiles and Accessories&amp;productSelect=All&amp;colorSelect=All');return document.MM_returnValue" value="Done" />
  </p>
  </p></td>
  </tr>
</table>
<!--end of tableMain-->
<?php

	include("../footer.php");
}
?>
