<head>

<?php
$table_name = $_SESSION['db_prefix']."_store_items";
$additional_query = "SELECT store_item_id, item_name, unit, price FROM $table_name WHERE subCategory='Sundries' AND class='' ORDER BY item_name";
$additional_result = mySQL_query($additional_query);
$additional_num = mysql_num_rows($additional_result);
?>

<!--jscript-->
<script language="JavaScript" src="../jscript/numbers_only.js"  type="text/javascript"></script>  

</head>

<?php include('../include/wait.php') ?>
<body onLoad="MM_showHideLayers('wait','','hide')" onFocus="MM_showHideLayers('wait','','hide');"  onBlur="MM_showHideLayers('wait','','hide');">

<div class="page_middle_frame">
<form action="captureJobWizbase.php?p=7&s=6" method="post">
<table id="tableMain" width="595">
    <!--begin of tableMain-->
    <tr>
      <td><!--center of tableMain-->
        <div class="scroll_frame_medium" style="height:340px; width:640px;">
          <table width="599">
            <tr>
              <td colspan="4"><label class="label_std" style="font-size:14px;">Additional sundries:</label></td>
            </tr>
            <?php 
				  $m=0;
				  $_SESSION['list_6'] = $additional_num;
				  while ($m<$additional_num) { 
					    $_SESSION['additional_item_id'.$m] = mysql_result($additional_result, $m, "store_item_id");
						$item_name = mysql_result($additional_result, $m, "item_name"); 
						$unit = mysql_result($additional_result, $m, "unit"); 
						$_SESSION['sundries_price'.$m] = mysql_result($additional_result, $m, "price");			
				 ?>
            <tr>
              <td colspan="2"><label class="label_std" ><?php echo $item_name ?>
                <input type="hidden" name="additional_item_id_<?php echo $m?>" id="additional_item_id_<?php echo $m?>" value="<?php echo $_SESSION['additional_item_id'.$m] ?>">
              </label></td>
              <td width="148"><label for="textfield"></label>
                <input name="additional_quantity_<?php echo $m?>" type="text" class="text60" id="additional_quantity_<?php echo $m?>" style="text-align:right" onKeyPress="return numbersonly(this, event)"  value="<?php echo $_SESSION['additional_quantity_'.$m] ?>" autocomplete="off" onBlur="<?php if ($m==$additional_num-1) { ?> document.getElementById('next_button').focus();<?php } ?>" autofocus>
                &nbsp;&nbsp;<?php echo $unit ?></td>
              <td width="180">&nbsp;</td>
            </tr>
            <?php
			  $m++;
             }
             ?>
          </table>
      </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','captureJobWizbase.php?s=&amp;p=5');return document.MM_returnValue" /></td>
          <td width="115">&nbsp;</td>
          <td width="99"><input name="p" type="hidden" id="p" value="6" />
            <input name="s" type="hidden" id="s" value="6" />
            </span></td>
          <td width="125" align="right"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onClick="needToConfirm = false; cancel_confirmation(1, '../production/production_main.php');" value="Cancel" /></td>
          <td width="110" align="right"><input type="submit" name="next_button" id="next_button" class="imagebutton" value="Next" tabindex="0" onClick="needToConfirm = false; MM_showHideLayers('wait','','show'); " /></td>
        </tr>
      </table></td>
      </tr>
      </table>
</form>
</div>
</body>      