</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" name="form1" method="get" action="storeWizbase.php" >
  <table width=700 border="0" align="center" cellpadding="10" cellspacing="0" bordercolor="#0066FF" border-collapse="collapse">
    <tr style="height:270px;">
      <td width="679" valign="top" ><?php if ($_SESSION['error']==1) { ?>
        <div class="wizard_warning_frame">&nbsp;
<table width="582" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="47"><img src="../images/exclamation_mark_blue.png" width="16" height="16">&nbsp;&nbsp;<label class="label_std">A product / store item with the name "<?php echo $_SESSION['item_name']?>" allready exists, please use another name.</label></td>
  </tr>
</table>
        </div>
        <?php 

		 
	 } ?>
     <?php
     if ( $_SESSION['category'] == "Product" ) { ?>
	    <div class="wizard_frame">
	      <br />
	        <label class="label_std">Enter name of the product:.
              
          &nbsp;&nbsp;&nbsp;
          <input name="item_name_text" type="text" id="item_name_text" class="text300"  onkeyup="ToLower(this)" onBlur="capitalize(this);" value="<?php echo $_SESSION['item_name'] ?>" autofocus maxlength="50" tabindex="4" />
          *  </label> <input name="sub_cat_select" type="hidden" value="Salt product">
          <br>
          <br />
          <br>
          
        </div>
     <?php } ?>
	    
         
     <?php if ( $_SESSION['category'] == "Direct material")  { ?>
	   <div class="wizard_frame" ><br />
          <label class="label_std">What is the name of the store item?</label>
          &nbsp;&nbsp;&nbsp;
          <input name="item_name_text" type="text" id="item_name_text" class="text300"  onkeyup="ToLower(this)" onBlur="capitalize(this);" value="<?php echo $_SESSION['item_name'] ?>" autofocus maxlength="50" tabindex="4" autocomplete="off"/>
          <label class="star">*</label><br><br>

			Select sub category:  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select name="sub_cat_select"  class="select120">
			  <option value="Salt">Salt</option>
              <option value="Minerals">Minerals</option>
              <option value="Packaging">Packaging</option>
              <option value="Ingredients">Ingredients</option>
			  <option value="<?php echo $_SESSION['subCategory'] ?>" selected="selected"><?php echo $_SESSION['subCategory'] ?></option>
            </select>
         &nbsp;&nbsp;<label class="star">*</label> <br />
          <br />
        </div>
      <?php } ?> 
     
     <?php if ($_SESSION['category'] == "Stores") { ?>
	   <div class="wizard_frame" ><br />
          <label class="label_std">What is the name of the store item?</label>
          &nbsp;&nbsp;&nbsp;
          <input name="item_name_text" type="text" id="item_name_text" class="text300"  onkeyup="ToLower(this)" onBlur="capitalize(this);" value="<?php echo $_SESSION['item_name'] ?>" autofocus maxlength="50" tabindex="4" />
          <label class="star">*</label>
          <br />
          <br />
          <label class="label_std">Select  sub category :</label>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <select name="sub_cat_select" class="select200" id="sub_cat_select" >
    <option value="Cleaning materials">Cleaning materials</option>
    <option value="Consumables">Consumables</option>
    <option value="Lubricants">Lubricants</option>
    <option value="PPE">PPE</option>
    <option value="Tools">Tools</option>
    <option value=" " selected="selected"> </option>
  </select>
       &nbsp;&nbsp;<label class="star">*</label> </div>
      <?php } ?> 
	 
     </td>
    </tr>
    <tr>
      <td><table width="590" height="50" align="left" 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','storeWizbase.php?s=&amp;p=1');return document.MM_returnValue" /></td>
            <td width="82"><input name="error" type="hidden" id="error" value="0" />
              <input name="p" type="hidden" id="p" value="2" />
              <input name="s" type="hidden" id="s" value="2" /></td>
            <td width="132">&nbsp;</td>
            <td width="125" align="left"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onClick="needToConfirm = false; cancel_confirmation(1, '../store/store_main.php?date=0&subCatSelect=Tiles');" value="Cancel" /></td>
            <td width="110" align="left"><input type="submit" name="next_button" id="next_button" class="imagebutton" value="Next" onClick="needToConfirm = false; MM_showHideLayers('wait','','show'); validate();  " tabindex="5" /></td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>
</div>
<script language="JavaScript" type="text/javascript" xml:space="preserve">

  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  <?php if ( $_SESSION['category'] == "Product")  { ?>
  frmvalidator.addValidation("item_name_text","req","- product name.");
  <?php } ?>
  
  <?php if ( $_SESSION['category'] != "Product")  { ?>
  frmvalidator.addValidation("item_name_text","req","- item name.");
  frmvalidator.addValidation("sub_cat_select","req","- sub category.");
  <?php } ?>
      
</script>

</body>