<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


<?php
include ("../navigation/header.php");
include ("../navigation/store_sidebar.php");

	$d="";
	$s = $_GET['s'];
	$p = $_GET['p'];
	if ($_SESSION['p'] >= 4) {$d=1;}
	$error = $_SESSION['error'];
	$_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==2) {
	$_SESSION['receipt_no'] = $_GET['receipt_no_text'];
	$_SESSION['sale_date'] = $_GET['sale_date'];
	$_SESSION['cust_name'] = $_GET['cust_name_text'];
	$_SESSION['phone_no'] = $_GET['phone_no_text'];
	$_SESSION['cust_address'] = $_GET["cust_address_text"];
	$_SESSION['cust_place'] = $_GET["cust_place_select"];
	$_SESSION['cust_vat_number'] = $_GET["cust_vat_number_text"];
	$_SESSION['additional_info'] = $_GET["additional_info_text"];
	
	}
	
if($s==3) {
	
	$table_name = $_SESSION['db_prefix']."_cash_deliver_product_lines_temp";
	$delete_line_query = "DELETE FROM $table_name WHERE user_name = '".$_SESSION['username']."' "; 
	$delete_line_result = $con->query($delete_line_query);	

	$item_name = '';
	
	//$pallets = $_GET['pallets_text'];
//	echo '<br>*****'.$pallets;
//	
//	$table_name = $_SESSION['db_prefix']."_store_items";
//	$pallet_price_query = "SELECT  price FROM $table_name WHERE store_item_id = '10000'  ";
//	$pallet_price_result = $con->query($pallet_price_query);
//	$row = mysqli_fetch_assoc($pallet_price_result);
//	$pallet_price = $row['price'];
//		
//	$table_name = $_SESSION['db_prefix']."_cash_deliver_product_lines_temp";
//	$deliver_query = "INSERT INTO $table_name ( order_reference, pallets, price, user_name) VALUES ('".$_SESSION['cash_sale_no']."', '".$pallets."', '".$pallet_price."', '".$_SESSION['username']."' ) ";
//	$deliver_result = $con->query($deliver_query);
//	
//	$_SESSION['pallets'] = $pallets;
	};
	
	if($s==4) {
	 
		 
	}
				
	?>

<!--style sheets-->
<link rel="stylesheet" type="text/css" href="../css/wizard.css" />
<link href="../css/wait.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="../window/dhtmlwindow.css" type="text/css" />
<link rel="stylesheet" href="../window/modal.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../css/tooltip.css" />

<!--jscript-->
<script type="text/javascript" src="../jscript/jquery.1.4.2.js"></script>
<script type="text/javascript" src="../window/dhtmlwindow.js"></script>
<script type="text/javascript" src="../window/modal.js"></script>
<script language="JavaScript" src="../jscript/gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script>
<script language="JavaScript" src="../jscript/cancel_confirmation.js"  type="text/javascript"></script>
<script language="JavaScript" src="../jscript/confirm_exit.js"  type="text/javascript"></script>
<script language="JavaScript" src="../jscript/show_hide_layers.js"  type="text/javascript"></script>
<script language="JavaScript" src="../jscript/numbers_only.js"  type="text/javascript"></script>  
<script language="JavaScript" src="../jscript/numbers_only_decimal.js"  type="text/javascript"></script>
<script language="JavaScript" src="../jscript/alert_message.js"  type="text/javascript"></script>

<script language="JavaScript" src="../jscript/upper_case.js"  type="text/javascript"></script>
<script language="JavaScript" src="../jscript/tooltip.js"  type="text/javascript"></script> 

</head>


<body>


<div class="main_frame" style="height:auto; min-height:550px;">

<div class="page_head_frame">
  
<table width="678" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="547"><label class="label_page_head">Cash sale 
              <?php  echo $_SESSION['cust_name'] ?>
          </label>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
          <td width="131" align="center"><b>&nbsp;</b></td>
        </tr>
    </table>
 </div>     
      <div class='wizard_paging_frame'>
       <table align="left">
      <tr>
      <td>
      <?php if ($_SESSION['p']==2) { ?>
      <div class="active_step_frame"><div class="active_step_head_label">&nbsp;1</div>
      <div class="active_step_label"><br /><br /><br />
        Customer details</div></div>
      <?php } else { ?>
      <div class="de_active_step_frame"><div class="de_active_step_head_label">&nbsp;1</div>
      <div class="de_active_step_label"><br /><br /><br />
      Customer details</div></div>
      <?php } ?>
      
      </td>
      <td>
      <?php if ($_SESSION['p']==3) { ?>
      <div class="active_step_frame"><div class="active_step_head_label">&nbsp;2</div>
      <div class="active_step_label"><br /><br /><br />
      Details</div></div>
      <?php } else { ?>
      <div class="de_active_step_frame"><div class="de_active_step_head_label">&nbsp;2</div>
      <div class="de_active_step_label"><br /><br /><br />
      Details</div></div>
      <?php } ?>
     </td>
     <td>
      <?php if ($_SESSION['p']==4) { ?>
      <div class="active_step_frame"><div class="active_step_head_label">&nbsp;3</div>
      <div class="active_step_label"><br /><br /><br />
      Products</div></div>
      <?php } else { ?>
      <div class="de_active_step_frame"><div class="de_active_step_head_label">&nbsp;3</div>
      <div class="de_active_step_label"><br /><br /><br />
      Products</div></div>
      <?php } ?>
     </td>
     <td>
      <?php if ($_SESSION['p']==5) { ?>
      <div class="active_step_frame"><div class="active_step_head_label">&nbsp;4</div>
      <div class="active_step_label"><br /><br /><br />
      Finish</div></div>
      <?php } else { ?>
      <div class="de_active_step_frame"><div class="de_active_step_head_label">&nbsp;4</div>
      <div class="de_active_step_label"><br /><br /><br />
      Finish</div></div>
      <?php } ?>
     </td>
        </tr>
      </table>
      </div>
      </td>
      </tr>
      <tr>
      <td><?php 
	if ($_SESSION['p']==1) { include("newCashWiz1.php"); }
	if ($_SESSION['p']==2) { include("newCashWiz2.php"); }
	if ($_SESSION['p']==3) { include("newCashWiz3.php"); }
	if ($_SESSION['p']==4) { include("newCashWiz5.php"); }
	
    ?></td>
    </tr>
    </table>
    </div>

</div>

</body>
<?php include ('../navigation/side_bar.php'); ?>