<?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 = $con->query($name_query);
$row = mysqli_fetch_assoc($name_result);
$_SESSION['store_item_name'] = $row["item_name"];


if ($_SESSION['supply_group']=='employee') { 
$table_name2 = $_SESSION['db_prefix']."_employee";
$employee_query = "SELECT emp_first_name, emp_last_name FROM $table_name2 WHERE emp_id ='".$_SESSION['supply_to']."' ";
$employee_result = $con->query($employee_query);
$row = mysqli_fetch_assoc($employee_result);
$_SESSION['emp_name'] = $row["emp_first_name"].' '.$row["emp_last_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_internalWiz6.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']=='employee') {  echo $_SESSION['emp_name']; } else { echo $_SESSION['supply_to'] ; } ?>&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>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" />
          <input name="l" type="hidden" id="l" value="b" />
          <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=a');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>
