<?php
include("../include/session.php");
//include ('../include/db.php');
if( !$session->isAdmin() && !$session->isRadstoneReceptionUser()){
	//header("Location: ../Store/storeMenu.php");?>
<script language="javascript" type="text/javascript">
        <!--
		  window.location="denied.php";
        -->
       </script>
<?php 
}else{
	
	include("../storeHeader.php");
		
	//$_SESSION['ContactText'];
	$s = $_GET['s'];
	$p = $_GET['p'];
	
	$_SESSION['p']=$p;
	$_SESSION['s']=$s;
	
		
	if (isset($_GET['prev_button']) )
	   {
		 $_SESSION['p']= $_SESSION['p']-1;
	   }
		 
	if (isset($_GET['next_button']) )
	  {
		$_SESSION['p']=$_SESSION['p']+1;
	  }
	
	
	
	if ($s==1) {
	//	echo "READING NO 1";
	// $_SESSION['OrderNoText'] = $_GET['orderNo'];
	// $_SESSION['CustomerNoText'] = $_GET['CustomerNoText'];
//	 $_SESSION['DeliveryDateText'] = $_GET['DeliveryDateText'];
	 $_SESSION['DeliverText1'] = $_GET['DeliverText1'];
//	 $_SESSION['DeliverText1'] = $_GET['DeliverText1'];
	 $_SESSION['DeliverText2'] = $_GET['DeliverText2'];
	 $_SESSION['DeliverText3'] = $_GET['DeliverText3'];
	 $_SESSION['contactText'] = $_GET['contactText'];
	 $_SESSION['delColText'] = $_GET['delColText'];
     
	};
	
	if($s==2) {
		
		$i=0;
		
		While ($i<$_SESSION['orderNum']) { 
			    $_SESSION['DeliverCheck'.$i] = $_GET['no_del_checkbox'.$i];
				echo $_SESSION['DeliverCheck'.$i];
				if ($_SESSION['DeliverCheck'.$i]=='on') { 
					$_SESSION['QuantityText'.$i]='';  }
				else { 
				$_SESSION['ProductIdText'.$i] = $_GET['ProductIdText'.$i];
         		$_SESSION['ProductNameText'.$i] = $_GET['ProductNameText'.$i];
				$_SESSION['PriceText'.$i] = $_GET['PriceText'.$i];
				$_SESSION['QuantityText'.$i] = $_GET['QuantityText'.$i];
				}
				$type = "DOUBLE";
                $type2 = "SLATE";
                $pos = strpos($_SESSION['ProductNameText'.$i],$type);
  				$pos2 = strpos($_SESSION['ProductNameText'.$i],$type2);
   				if (($pos === false) AND ($pos2 === false) ) { } else { 
			    $_SESSION['BatchCode1Text'.$i] = $_GET['BatchCode1Text'.$i];
				$_SESSION['BatchCode2Text'.$i] = $_GET['BatchCode2Text'.$i];
				}
				$i++;
		}
		$_SESSION['no_pallets'] = $_GET['no_pallets_checkbox'];
		if ($_SESSION['no_pallets']=='on') {
					$_SESSION['PalletsText']='';  }
				else {
		$_SESSION['PalletsText'] = $_GET['pallets_text'];
				}
	};
	
	if($s==3) {
	 $_SESSION['delColText'] = $_GET['delCol_select'];	
     $_SESSION['DeliveryDateText'] = $_GET['DeliveryDateText'];		
	 $_SESSION['DeliverText2'] = $_GET['DeliverText2'];
	 $_SESSION['DeliverText3'] = $_GET['DeliverText3'];
	 $_SESSION['contactText'] = $_GET['contactText'];
	 $_SESSION['TransporterText'] = $_GET['TransporterText'];
	 $_SESSION['RegNoText'] = $_GET['RegNoText'];
	 $_SESSION['RemarksText'] = $_GET['RemarksText'];
	};
	
	if($s==8) {
	 //$_SESSION['line_no'] = $_GET['l'];
//	 $l = $_GET['l'];
//	 $_SESSION['ProductSelect'.$l] = $_GET['ProductSelect'];
//	 $_SESSION['QuantityText'.$l] = $_GET['QuantityText'];
//	 $_SESSION['line_no'] = $_SESSION['line_no'] + 1;
//	 
//	 $nameQuery = "SELECT  productName, price FROM nam_products WHERE category ='Tiles and Accessories' AND productId = ". $_SESSION['ProductSelect'.$l];
//	 $nameResult = execsql($nameQuery);
//	 $nameNum = mysql_num_rows($nameResult);
//	 $_SESSION['ProductText'.$l] =  mysql_result($nameResult, 0, "productName");
//	 $_SESSION['PriceText'.$l] =  mysql_result($nameResult, 0, "price");
//	 $_SESSION['TotalText'.$l] =  $_SESSION['QuantityText'.$l] * $_SESSION['PriceText'.$l];
	};
	
	if($s==4) {
	 //$_SESSION['RemarksText'] = $_GET['RemarksText'];
	}
	
	?>
<script language="JavaScript" src="gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script>
<!--form validation-->
<script type="text/javascript" src="../css/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="../css/wizard.css" />
<script language="javascript" type="text/javascript" >
<!--
function confirmRefresh() {
var okToRefresh = confirm("Do you really want to cancel this entry?");
var url='showAllProducts.php?cat=Tiles and Accessories&productSelect=All&colorSelect=All'
if (okToRefresh)
	{
			window.location=url;
	}
}
// -->
</script>

<table id="tableMain" width="595">
  <!--begin of tableMain-->
  <tr>
    <td ><div class="headerbox2">Delivery </div>
      <br />
      <p class="stepbar">
        <?php if ($_SESSION['p']==1) { echo "<label class=step>"; }  else { echo"<label class=stepd>"; } ?>
        Step 1<br />
        <font size="1">Order confirm</font>
        </label>
        <?php if ($_SESSION['p']==2) { echo "<label class=step>"; }  else { echo"<label class=stepd>"; } ?>
        Step 2<br />
        <font size="1">Products</font>
        </label>
        <?php if ($_SESSION['p']==3) { echo "<label class=step>"; }  else { echo"<label class=stepd>"; } ?>
        Step 3<br />
        <font size="1">Delivery</font>
        </label>
        <?php if ($_SESSION['p']==4) { echo "<label class=step>"; }  else { echo"<label class=stepd>"; } ?>
Step 4<br />
        <font size="1">Finish</font>
        </label>
        <label class="steptext">
          <?php if ($_SESSION['p']==0) { echo "Select order to deliver"; }; ?>
          <?php if ($_SESSION['p']==1) { echo "Entering delivery note number."; } ?>
        </label>
      </p>
    <br /></td>
    <!--center of tableMain-->
  </tr>
  <tr>
    <td><!--center of tableMain-->
      <?php
	if ($_SESSION['p']==0) { include("outWiz0.php"); }
	if ($_SESSION['p']==1) { include("outWiz1.php"); }
	if ($_SESSION['p']==2) { include("outWiz2.php"); }
	if ($_SESSION['p']==3) { include("outWiz3.php"); }
	if ($_SESSION['p']==4) { include("outWiz4.php"); }
	//if ($_SESSION['p']==5) { include("outWiz5.php"); }
    ?></td>
  </tr>
</table>
<?php

	}
	include("../footer.php");

?>
