<?php
$table_name = $_SESSION['db_prefix']."_store_items";
$name_query = "SELECT item_name FROM $table_name WHERE store_item_id = '".$_SESSION['store_item_id']."'  ";
$name_result = mySQL_query($name_query);
$_SESSION['store_item_name'] = mysql_result($name_result, 0, "item_name");

if ($_SESSION['supply_group']=='vehicle') { 
$table_name2 = $_SESSION['db_prefix']."_vehicle";
$vehicle_query = "SELECT vehicle_id, registration_no, make, model FROM $table_name2 WHERE vehicle_id ='".$_SESSION['supply_to']."' ";
$vehicle_result = mySQL_query($vehicle_query);
$vehicle_num = mysql_num_rows($vehicle_result);	
$_SESSION['vehicle_name'] = mysql_result($vehicle_result, 0, "make").' '.mysql_result($vehicle_result, 0, "model").' '.mysql_result($vehicle_result, 0, "registration_no"); 
}

if ($_SESSION['supply_group']=='machinery') { 
$table_name2 = $_SESSION['db_prefix']."_machinery";
$machine_query = "SELECT machine_id, machine_name FROM $table_name2 WHERE machine_id ='".$_SESSION['supply_to']."' ";
$machine_result = mySQL_query($machine_query);
$machine_num = mysql_num_rows($machine_result);	
$_SESSION['machine_name'] = mysql_result($machine_result, 0, "machine_name"); 
}
?>
</head>
<?php include('../include/wait.php') ?>

<body onLoad="MM_showHideLayers('wait','','hide')" onFocus="MM_showHideLayers('wait','','hide');"  onBlur="MM_showHideLayers('wait','','hide');">
<div class="wizard_page_middle_frame">
<form id="feedbackform" method="get" action="supply_internalWiz6c.php" ><br>
<br>
<div class="wizard_frame" style="height:auto; min-height:150px;">
  <table width="560" id="table_details_display">
    <tr>
      <td width="154">Store item to supply:</td>
      <td width="390"><?php echo $_SESSION['store_item_name'] ?> </td>
    </tr>
    <tr>
      <td>Supply to:</td>
      <td><?php if ($_SESSION['supply_group']=='vehicle') {  echo $_SESSION['vehicle_name']; } ?>
          <?php if ($_SESSION['supply_group']=='machinery') {  echo $_SESSION['machine_name']; }?>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $_SESSION['received_by'] ; ?>  </td>
    </tr>
    <tr>
      <td>Qty to supply:&nbsp;</td>
      <td><?php echo $_SESSION['supply_qty'] ?></td>
    </tr>
    <tr>
      <td>Clock reading:</td>
      <td><?php echo $_SESSION['clock_reading'] ?>&nbsp;<?php echo $_SESSION['clock'] ?></td>
    </tr>
    <tr>
      <td>Reason for supply:&nbsp;</td>
      <td><?php echo $_SESSION['supply_reason'] ?></td>
    </tr>
  </table>
 </div>
<div class="wizard_frame">
      <input name="s" type="hidden" id="s" value="3" />
          <input name="p" type="hidden" id="p" value="3" />
          <label class="label_std">If you want to make changes use the 'Prev' button to go back. <br />
            Click 'New' to make a new entry or to finish the wizard click 'Finish'.</label>
        </div>
        <div class="wizard_frame">
      <table width="590" height="50" align="center" id="table_button_bar">
          <tr>
            <td width="117"><input type="button" name="lastprev_button" class="imagebutton" value="Prev" onClick="needToConfirm = false;   MM_showHideLayers('wait','','show'); MM_goToURL('parent','supply_internalWizbase.php?s=&p=2&l=c');return document.MM_returnValue" /></td>
            <td width="115">&nbsp;</td>
            <td width="99"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onClick="javascript:cancel_confirmation(1, '../store/store_main.php'); needToConfirm = false;" value="Cancel" /></td>
            <td width="125"><input type="submit" name="new_button" class="imagebutton" id="new_button" value="New" onClick="needToConfirm = false; MM_showHideLayers('wait','','show');" /></td>
            <td width="110"><input  name="finish_button" type="submit" class="imagebutton" id="finish_button" value="Finish" onClick="needToConfirm = false; MM_showHideLayers('wait','','show');"  /></td>
          </tr>
        </table>
        </div>
  
  
</form>
</div>
