<head>
<?php
$table_name = $_SESSION['db_prefix']."_supply_customer_temp";
$line_query = "SELECT *  FROM $table_name WHERE  user =  '".$_SESSION['username']."' ";
$line_result = mySQL_query($line_query);
$line_num = mysql_num_rows($line_result);
?>
</head>
<body>
<div class="page_middle_frame">
<form id="feedbackform" method="get" action="supplyOrderWiz6.php" >
  <table width=595 border="0" align="left" cellpadding="10" cellspacing="0" bordercolor="#0066FF" border-collapse="collapse">
    <tr>
      <td width="525" ><table width="592" id="table_resume_wizard" >
          <tr>
            <td width="148" align="left" valign="top">Supplied to:</td>
            <td width="184" align="left" valign="top"><?php echo $_SESSION['cust_name'] ?></td>
            <td width="105" align="left" valign="top">Date:</td>
            <td width="135" align="left" valign="top"><?php echo date("d-m-Y", strtotime($_SESSION['supply_date'] )) ?></td>
          </tr>
          <tr>
            <td align="left" valign="top"><?php if ($_SESSION['job_no']!='') { ?>
              Supplied for job no:
              <?php } ?></td>
            <td align="left" valign="top"><?php if ($_SESSION['job_no']!='') { echo "J".$_SESSION['job_no']; } ?></td>
            <td align="left" valign="top">Deliver note no:</td>
            <td align="left" valign="top"><?php echo $_SESSION['delivery_no']?></td>
          </tr>
          <tr>
            <td colspan="2" align="left" valign="top">&nbsp;</td>
            <td align="left" valign="top">Receipt no</td>
            <td align="left" valign="top"><?php echo $_SESSION['receipt_no'] ?>&nbsp;</td>
          </tr>
        </table>
        <br>
        <table width="592" id="table_resume_wizard" >
          <tr>
            <td height="26" colspan="2" align="left" valign="top">Item</td>
            <td width="86" align="left" valign="top">Quantity</td>
            <td width="94" align="left" valign="top">&nbsp;</td>
          </tr>
          <?php
				$i=0;
				$sub_tot=0;
				$a6_total=0;
				 while ($i<$line_num){
					 $a0 = mysql_result($line_result, $i, "supply_id");
					 $a1 = mysql_result($line_result, $i, "store_item_id");
					 $table_name = $_SESSION['db_prefix']."_store_items";
						$item_query = "SELECT item_name FROM $table_name WHERE store_item_id = '".$a1."' ";
						$item_result = mySQL_query($item_query);
						$a1a = mysql_result($item_result, 0, "item_name");
					 $a2 = mysql_result($line_result, $i, "quantity");
					 
					?>
          <tr>
            <td colspan="2" valign="top"><?php echo $a1a ?></td>
            <td valign="top"><?php echo $a2 ?></td>
            <td align="right" valign="top">&nbsp;</td>
          </tr>
          <?php 
			   // $a6_total=$a6_total+$a6;
				$i++;
				 }
				 ?>
          <tr>
            <td colspan="2" align="left" valign="top">&nbsp;</td>
            <td align="left" valign="top">&nbsp;</td>
            <td align="left" valign="top">&nbsp;</td>
          </tr>
          <tr>
            <td colspan="2" align="left" valign="top">&nbsp;</td>
            <td align="left" valign="top">&nbsp;</td>
            <td align="left" valign="top">&nbsp;</td>
          </tr>
        </table>
        <br />
        <div class="wizard_frame">
          <input name="s" type="hidden" id="s" value="4" />
          <input name="p" type="hidden" id="p" value="4" />
          <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></td>
    </tr>
    <tr>
      <td><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','supplyOrderWizbase.php?s=&p=2');return document.MM_returnValue" tabindex="3"/></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" tabindex="4"/></td>
            <td width="125"><input type="submit" name="new_button" class="imagebutton" id="new_button" value="New" onClick="needToConfirm = false; MM_showHideLayers('wait','','show'); " tabindex="2"/></td>
            <td width="110"><input  name="finish_button" type="submit" class="imagebutton" id="finish_button" value="Finish" onClick="needToConfirm = false; MM_showHideLayers('wait','','show');"  tabindex="1" /></td>
          </tr>
        </table></td>
    </tr>
  </table>
  </table>
</form>
</div>
<body>
