<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 id="form1" method="get" action="receivingPlatesWizbase.php">
  <table id="tableMain" width="595">
    <!--begin of tableMain-->
    <tr>
      <td><!--center of tableMain-->
        
        <table width=595 border="0" align="center" cellpadding="10" cellspacing="0" bordercolor="#0066FF" border-collapse="collapse">
          <tr>
            <td width="525" height="336" valign="top" >
            <div class="wizard_frame" style="font-weight:normal;">
                <table width="600" border="0">
                  <tr>
                    <td align="left"><label class="label_std">Plates</label></td>
                  </tr>
                  <?php 
				 	$table_name = $_SESSION['db_prefix']."_store_items";
					$name_query = "SELECT store_item_id, item_name FROM $table_name WHERE subCategory='Mitek' AND class='plate' ORDER BY item_name  ASC";
					$name_result = mySQL_query($name_query);
					$name_num = mysql_num_rows($name_result);
					
					$k=0;
					
					while ($k<$name_num) {
					
					?>
                  <tr>
                    <?php
                     $i=0;
					 while ($i<3) {
						 
					 if ($k<$name_num) {
					 $a1 = mysql_result($name_result, $k, "store_item_id"); 
					 $a2 = mysql_result($name_result, $k, "item_name");
					 }
					 else {
						 $a1='';
						 $a2='';
					 }
					
					$checked='no';
					$table_name = $_SESSION['db_prefix']."_receive_store_lines_temp";
					$check_query = "SELECT receive_line_id FROM $table_name WHERE user =  '".$_SESSION['username']."' AND store_item_id='".$a1."'  ";
					$check_result = mySQL_query($check_query);
					$check_num = mysql_num_rows($check_result);
					if ($check_num!=0) {
						  $checked='yes';
						}		
					 ?>
                    <td width='60' align="left"><input type="checkbox" name="<?php echo "check".$k ?>" id="<?php echo "check".$k ?>" value="<?php echo $a1 ?>" <?php if ($checked=='yes') { ?>  checked="checked" <?php } ?>  >
                      <?php echo $a2 ?>&nbsp;
                      <input type="hidden" name="<?php echo "item_no".$k ?>" id="<?php echo "item_no".$k ?>" value="<?php echo $a1 ?>"></td>
                    <?php
					$k++;
					$i++;
					
					 }
					  ?>
                  </tr>
                  <?php
				   	 }  
				 	
				  ?>
                </table>
                </div>
                <div class="wizard_frame" style="font-weight:normal;">
                <table width="600" border="0">
                  <tr>
                    <td align="left"><label class="label_std">Mitek products</label></td>
                  </tr>
                  <?php 
				 	$table_name = $_SESSION['db_prefix']."_store_items";
					$name_query = "SELECT store_item_id, item_name FROM $table_name WHERE subCategory='Mitek' AND class<>'plate' ORDER BY item_name  ASC";
					$name_result = mySQL_query($name_query);
					$name_num = mysql_num_rows($name_result);
					
					$j=0;
					
					while ($j<$name_num) {
					
					?>
                  <tr>
                    <?php
                     $i=0;
					 while ($i<3) {
						 
					 if ($j<$name_num) {
					 $a1 = mysql_result($name_result, $j, "store_item_id"); 
					 $a2 = mysql_result($name_result, $j, "item_name");
					 }
					 else {
						 $a1='';
						 $a2='';
					 }
					
					$checked='no';
					$table_name = $_SESSION['db_prefix']."_receive_store_lines_temp";
					$check_query = "SELECT receive_line_id FROM $table_name WHERE user =  '".$_SESSION['username']."' AND store_item_id='".$a1."'  ";
					$check_result = mySQL_query($check_query);
					$check_num = mysql_num_rows($check_result);
					if ($check_num!=0) {
						  $checked='yes';
						}		
					 ?>
                    <td width='60' align="left"><input type="checkbox" name="<?php echo "check".($j+$k) ?>" id="<?php echo "check".($j+$k) ?>" value="<?php echo $a1 ?>" <?php if ($checked=='yes') { ?>  checked="checked" <?php } ?>  tabindex="<?php echo $j+$k?> " >
                      <?php echo $a2 ?>&nbsp;
                      <input type="hidden" name="<?php echo "item_no".($j+$k) ?>" id="<?php echo "item_no".($j+$k) ?>" value="<?php echo $a1 ?>"></td>
                    <?php
					$j++;
					$i++;
					
					 }
					  ?>
                  </tr>
                  <?php
				   	 }  
				 	
				  ?>
                </table>
                <?php
				 				  
				   $_SESSION['list_no_2']=$k+$j;
				   
				  ?>
                  </div>
                <p><br />
                  <br />
                  <br />
                </p>
              
              <br />
              <br>
              <br></td>
            <!--center of tableMain--> 
          </tr>
          <tr>
            <td><!--center of tableMain-->
              
              <table width="660" height="50" align="left" cellpadding="20"  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','receivingPlatesWizbase.php?s=&amp;p=1');return document.MM_returnValue" /></td>
                  <td width="115">&nbsp;</td>
                  <td width="99"><input name="p" type="hidden" id="p" value="2" />
                    <input name="s" type="hidden" id="s" value="2" />
                    </span></td>
                  <td width="125" align="right"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onClick="needToConfirm = false;  MM_showHideLayers('wait','','show'); cancel_confirmation(1, '../store/store_main.php');;" value="Cancel" /></td>
                  <td width="110" align="right"><input type="submit" name="next_button" class="imagebutton" value="Next" tabindex="<?php echo $j+$k+1?>" onClick="needToConfirm = false; MM_showHideLayers('wait','','show');" /></td>
                </tr>
              </table></td>
          </tr>
        </table>
  </table>
  <!--end of tableMain-->
</form>
</div>
</body>
