 
 <?php 
 
     include("../include/session.php");
	 
	 
	 $_SESSION['delivery_address']='';
	 $_SESSION['driver']='';
	 $_SESSION['vehicle']='';
	 $_SESSION['hour']='';
	 $_SESSION['min']='';
	 
	 $_SESSION['deliver_date'] = date("Y-m-d");
 
     $_SESSION['order_no'] = $_GET['order_no'];
	 $_SESSION['branch'] = $_SESSION['userbranch'];
	 
	 $_SESSION['store_item_id'] = '';
	 $_SESSION['store_item_name'] = '';
	 
	 
	 $table_name = $_SESSION['db_prefix']."_quotations";
	 $address_query = "SELECT project_no, project_place FROM $table_name WHERE quote_no = '".$_SESSION['order_no']."'";
	 $address_result = mySQL_query($address_query);
	 $_SESSION['delivery_address'] = mysql_result($address_result, 0, "project_no").' '.mysql_result($address_result, 0, "project_place");
	 
	 
	$table_name = $_SESSION['db_prefix']."_tile_orders";
	$quote_query = "SELECT cust_id, receive_date, direct  FROM $table_name WHERE order_no = '".$_SESSION['order_no']."'";
	$quote_result = mySQL_query($quote_query);
	$_SESSION['cust_id']=mysql_result($quote_result, 0, "cust_id");
	$_SESSION['receive_date']=mysql_result($quote_result, 0, "receive_date");
	$_SESSION['direct']=mysql_result($quote_result, 0, "direct");
		
	$table_name2 = $_SESSION['db_prefix']."_customer";
	$customer_query = "SELECT account_type, title, name_2, comp_name FROM $table_name2 WHERE cust_id ='".$_SESSION['cust_id']."' ";
	$customer_result = mySQL_query($customer_query);
	$customer_num = mysql_num_rows($customer_result);	
	$account_type = mysql_result($customer_result, 0, "account_type");
				if ($account_type=="corporate") { 
					$_SESSION['cust_name'] = mysql_result($customer_result, 0, "comp_name"); 
				} 
				else {
					$_SESSION['cust_name'] = mysql_result($customer_result, 0, "title")." ".mysql_result($customer_result, 0, "name_2")." ".mysql_result($customer_result, 0, "comp_name");
 				} 
		 
	
	$table_name = $_SESSION['db_prefix']."_tile_deliver_lines_temp";
	$delete2_query = "DELETE FROM $table_name WHERE  user_name =  '".$_SESSION['username']."'"; 
	execsql($delete2_query);
	
	 
?>


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

