<?php

     include('../include/session.php');
	 $_SESSION['receipt_no'] = '';
	 $_SESSION['sale_date'] = '';
	 $_SESSION['cust_name'] = '';
	 $_SESSION['phone_no'] = '';
	 $_SESSION['cust_address'] = '';
	 $_SESSION['cust_place'] = '';
	 $_SESSION['cust_vat_number'] = '';
	 $_SESSION['pallets'] = '0';
	 $_SESSION['additional_info'] = '';
	 
	 $table_name = $_SESSION['db_prefix']."_cash_deliver_product";
	 $cash_no_query = "SELECT cash_sale_no FROM $table_name ORDER BY cash_sale_no DESC LIMIT 1 ";
	 $cash_no_result = $con->query($cash_no_query);
	 $cash_no_num = mysqli_num_rows($cash_no_result);
	 if ($cash_no_num>0) {
	 $row = mysqli_fetch_assoc($cash_no_result);
	 $_SESSION['cash_sale_no'] = $row['cash_sale_no'] + 1;
	 }
	 else {
	 $_SESSION['cash_sale_no'] = 1000;
	 }
	 
	 $_SESSION['list_product_item_id_A'] = '';
	 $_SESSION['list_product_item_id_B'] = '';
	 $_SESSION['list_product_item_id_C'] = '';
	 $_SESSION['list_product_item_id_D'] = '';
	 $_SESSION['list_product_item_id_E'] = '';
	 	  
	 $_SESSION['p'] = 1;
	 $_SESSION['error']=0;
	 
	$table_name = $_SESSION['db_prefix']."_cash_deliver_product_lines_temp";
	$delete_query = "DELETE FROM $table_name WHERE  user_name  = '".$_SESSION['username']."' "; 
	$delete_result = $con->query($delete_query);

     
?>
<script language="javascript" type="text/javascript">
        <!--
		  window.location="newCashWizbase.php?error=0&p=2&s=0&e=";
        -->
       </script>