<?php
include("../include/session.php");
if( !$session->isAdmin() && !$session->isRadstoneReceptionUser() && !$session->isRadstoneStoreUser()){
	//header("Location: ../Store/storeMenu.php");?>
<script language="javascript" type="text/javascript">
        <!--
		  window.location="denied.php";
        -->
       </script>
<?php 
}else{
	
	include("../storeHeader.php");
	
	
	$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) {
		$_SESSION['category'] = $_GET['category_group'];
		
		If ($_SESSION['category']=="orders") { ?>
			<script language="javascript" type="text/javascript">
          	   window.location="editWizbase.php?p=3&s=";
            </script>
		<?php
		}
		If ($_SESSION['category']=="cancel") { ?>
			<script language="javascript" type="text/javascript">
          	   window.location="editWizbase.php?p=39&s=";
            </script>
		<?php
		}
		If ($_SESSION['category']=="date") { ?>
			<script language="javascript" type="text/javascript">
          	   window.location="editWizbase.php?p=35&s=";
            </script>
		<?php
		}
		If ($_SESSION['category']=="store") { ?>
			<script language="javascript" type="text/javascript">
          	   window.location="editWizbase.php?p=20&s=";
            </script>
		<?php
		}
		If ($_SESSION['category']=="accounts") { ?>
			<script language="javascript" type="text/javascript">
          	   window.location="editWizbase.php?p=2&s=";
            </script>
		<?php
		}
	}
	
	
	if ($s==2) {  
	    $_SESSION['account'] = $_GET['account_group'];
		If ($_SESSION['account']=="customer") { ?>
			<script language="javascript" type="text/javascript">
          	   window.location="editWizbase.php?p=30&s=";
            </script>
		<?php
		}
		
		If ($_SESSION['account']=="suppliers") { ?>
			<script language="javascript" type="text/javascript">
          	   window.location="editWizbase.php?p=31&s=";
            </script>
		<?php
		}
		
		If ($_SESSION['account']=="inter") { ?>
			<script language="javascript" type="text/javascript">
          	   window.location="editWizbase.php?p=32&s=";
            </script>
		<?php
		}
		
		If ($_SESSION['account']=="rep") { ?>
			<script language="javascript" type="text/javascript">
          	   window.location="editWizbase.php?p=33&s=";
            </script>
		<?php
		}
		
		If ($_SESSION['account']=="fleet") { ?>
			<script language="javascript" type="text/javascript">
          	   window.location="editWizbase.php?p=34&s=";
            </script>
		<?php
		}
	}
	
	if ($s==20) {  
	    $_SESSION['cat'] = $_GET['cat_group'];
		If ($_SESSION['cat']=="Tiles and Accessories") { ?>
			<script language="javascript" type="text/javascript">
          	   window.location="editWizbase.php?p=36&s=";
            </script>
		<?php
		}
		
		If ($_SESSION['cat']=="Direct Materials") { ?>
			<script language="javascript" type="text/javascript">
          	   window.location="editWizbase.php?p=37&s=";
            </script>
		<?php
		}
		echo "cat=".$_SESSION['cat'];
		If ($_SESSION['cat']=="Store Item") { ?>
			<script language="javascript" type="text/javascript">
          	   window.location="editWizbase.php?p=38&s=";
            </script>
		<?php
		}
	}
	
		
	if ($s==3) { 
			$_SESSION['order_no'] = $_GET['order_no_text'];
			?>
		    <script language="javascript" type="text/javascript">
          	   window.location="edit_order_check.php";
            </script>
	<?php	
	
	};
	
	if ($s==39) { 
			$_SESSION['order_no'] = $_GET['order_no_text'];
			?>
		    <script language="javascript" type="text/javascript">
          	   window.location="cancel_order_check.php";
            </script>
	<?php	
	
	};

	
	if ($s==30) { 
			$_SESSION['cust_name'] = $_GET['cust_name_text'];
			?>
		    <script language="javascript" type="text/javascript">
          	   window.location="edit_customer_check.php";
            </script>
	<?php	
	
	};
	
	if ($s==31) { 
			$_SESSION['supp_name'] = $_GET['supp_name_text'];
			?>
		    <script language="javascript" type="text/javascript">
          	   window.location="edit_supplier_check.php";
            </script>
	<?php	
	
	};
	
	if ($s==32) { 
			$_SESSION['inter_name'] = $_GET['inter_name_text'];
			?>
		    <script language="javascript" type="text/javascript">
          	   window.location="edit_inter_check.php";
            </script>
	<?php	
	
	};
	
	if ($s==33) { 
			$_SESSION['rep_name'] = $_GET['rep_name_text'];
			?>
		    <script language="javascript" type="text/javascript">
          	   window.location="edit_rep_check.php";
            </script>
	<?php	
	
	};
	
	if ($s==34) { 
			$_SESSION['fleet_name'] = $_GET['fleet_name_text'];
			?>
		    <script language="javascript" type="text/javascript">
          	   window.location="edit_fleet_check.php";
            </script>
	<?php	
	
	};
	
	if ($s==35) { 
			$_SESSION['order_no'] = $_GET['order_no_text'];
			?>
		    <script language="javascript" type="text/javascript">
          	   window.location="edit_order_date_check.php";
            </script>
	<?php	
	
	};
	
	if ($s==36) { 
			$_SESSION['item_name'] = $_GET['item_name_text'];
			?>
		    <script language="javascript" type="text/javascript">
          	   window.location="edit_item_check.php";
            </script>
	<?php	
	
	};
	
	if ($s==37) { 
			$_SESSION['item_name'] = $_GET['item_name_text'];
			?>
		    <script language="javascript" type="text/javascript">
          	   window.location="edit_item2_check.php";
            </script>
	<?php	
	
	};
	
	if ($s==38) { 
			$_SESSION['item_name'] = $_GET['item_name_text'];
			?>
		    <script language="javascript" type="text/javascript">
          	   window.location="edit_item3_check.php";
            </script>
	<?php	
	
	};
	
	
		$_SESSION['category'] = "";
	
	
	
	
	
	?>
<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 wizard?");
var url='showAllProducts.php?cat=Tiles and Accessories&productSelect=All&colorSelect=All'
if (okToRefresh)
	{
			window.location=url;
	}
}
// -->
</script>
<script language="JavaScript">
  var needToConfirm = true;
  window.onbeforeunload = confirmExit;
  function confirmExit()
  {
    if (needToConfirm)
      return "You did not finish the wizard./nIf you leave now your data will not be saved.";
  }
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
</script>
<table id="tableMain" width="595">
  <!--begin of tableMain-->
  <tr>
    <td ><div class="headerbox2">Edit</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">Select edit</font>
        </label>
        <?php if ($_SESSION['p']==2) { echo "<label class=step>"; }  else { echo"<label class=stepd>"; } ?>
        Step 2<br />
        <font size="1">Select account</font>
        </label>
        <?php if ($_SESSION['p']>=3) { echo "<label class=step>"; }  else { echo"<label class=stepd>"; } ?>
        Step 3<br />
        <font size="1">Enter edit info</font>
        </label>
      </p>
      <br /></td>
    <!--center of tableMain-->
  </tr>
  <tr>
    <td><!--center of tableMain-->
      <?php 
	if ($_SESSION['p']==1) { include("editWiz1.php"); }
	if ($_SESSION['p']==2) { include("editWiz2.php"); }
	if ($_SESSION['p']==20) { include("editWiz20.php"); }
	if ($_SESSION['p']==3) { include("editWiz3.php"); }
	if ($_SESSION['p']==39) { include("editWiz39.php"); }
	if ($_SESSION['p']==30) { include("editWiz30.php"); }
	if ($_SESSION['p']==31) { include("editWiz31.php"); }
	if ($_SESSION['p']==32) { include("editWiz32.php"); }
	if ($_SESSION['p']==33) { include("editWiz33.php"); }
	if ($_SESSION['p']==34) { include("editWiz34.php"); }
	if ($_SESSION['p']==35) { include("editWiz35.php"); }
	if ($_SESSION['p']==36) { include("editWiz36.php"); }
	if ($_SESSION['p']==37) { include("editWiz37.php"); }
	if ($_SESSION['p']==38) { include("editWiz38.php"); }
	    ?></td>
  </tr>
</table>
<?php

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


?>
