
<?php 
$page_name = "Production-plan";
include ("../navigation/access.php");

require_once ('../include/tc_calendar.php');
$production_date = strtotime($_SESSION['production_date']);
$d = date("d", $production_date );
$m = date("m", $production_date );
$y = date("Y", $production_date );

if ($permission_num==1) {
	


	
$temp_table_name = $_SESSION['db_prefix']."_production_plan_lines_temp";	

$table_name = $_SESSION['db_prefix']."_production_plan_lines_temp";
$line_query = "SELECT mix_design_id FROM $table_name WHERE user_name = '".$_SESSION['username']."' ";
$line_result = mySQL_query($line_query);
$line_num = mysql_num_rows($line_result);

    
include('../include/store_item_select_header_production_plan.php');
?>
</head>

<?php 

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

<div class="page_middle_frame">
  <form id="form1" name="form1" method="get" action="production_planWizbase.php">
    
<?php 
include('../include/store_item_select_table_production_plan.php');
?>
    
   <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','production_planWizbase.php?s=&p=1&e=0');return document.MM_returnValue" /></td>
            <td width="115"></td>
            <td width="99"><input name="p" type="hidden" id="p" value="2" />
              <input name="error" type="hidden" id="error" value="0" />
              <input name="s" type="hidden" id="s" value="2" /></td>
            <td width="125" align="left"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onClick="needToConfirm = false; cancel_confirmation(1, '../production/production_main.php?date=0&subCatSelect=Tiles');" value="Cancel"  tabindex="-1"/></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>
</form>

<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
     
  for (i = 0; i < 20; i++) {
	frmvalidator.addValidation("store_item_id"+i,"req","- product on line "+(i+1)+".");
	frmvalidator.addValidation("quantity_text"+i,"req","- quantity  on line "+(i+1)+".");
  }
  </script>
</div>
</body>
<?php } else { ?>
<script> needToConfirm = false; </script>
<?php
    $_SESSION['denied_return'] = "production/production_main.php?date=0&subCatSelect=Tiles";	?>
<body onLoad="accessdenied(); return false">
</body>
<?php }
?>
