<?php
     include('../include/session.php');
       
    
	 $_SESSION['job_no']="";
	 
	 $_SESSION['error1']="";
	 	 	 
	 $_SESSION['job_no']=$_GET['job_no'];
	 $_SESSION['name']="";
	 
	 $_SESSION['delivery_date']  = date('Y-m-d');
	 $_SESSION['delivery_note_no']="";
	 $_SESSION['delivery_address']="";
	 $_SESSION['driver']="";
	 $_SESSION['vehicle']="";
	 $_SESSION['hour']="";
	 $_SESSION['min']="";
	 
	 	$table_name = $_SESSION['db_prefix']."_permissions";
		$variations_permission_query = "SELECT access_id  FROM  $table_name  WHERE access_id ='". $_SESSION['access_id']."' AND page_name = 'Stores-variations' ";
		$variations_permission_result = mySQL_query($variations_permission_query);
		$variations_permission_num = mysql_num_rows($variations_permission_result);
		if ($variations_permission_num==1) {
				$_SESSION['variations_permission'] = 'yes';
		}
		else {
				$_SESSION['variations_permission'] = 'no';
		}
	 
	 $i=0;
	 while ($i<100) {
		 $_SESSION['truss_no'.$i]='';
		 $i++;
	 }
	 
	 $_SESSION['line_no2']=0; 
	 
	 $_SESSION['line_no3']=0;
	 $_SESSION['line_no3a']=0;
	 $i=0;
	 while ($i<50) {
	     $_SESSION['sub_line3'.$i]=0;
		 $_SESSION['message3'.$i]='';
		 $i++;
	 }
	 
	 $_SESSION['line_no4']=0;
	 $_SESSION['line_no4a']=0;
	 $i=0;
	 while ($i<50) {
	     $_SESSION['sub_line4'.$i]=0;
		 $_SESSION['message4'.$i]='';
		 $i++;
	 }
	 
	 $j=0;
	 while ($j<50) {
		 	$_SESSION['bracing_length_select'.$j] = 0;
			$_SESSION['bracing_length_select_index'.$j] = 0;
			$_SESSION['bracing_reason_text'.$j] = '.';
			$_SESSION['sundries_length_select'.$j] = 0;
			$_SESSION['sundries_length_select_index'.$j] = 0;
			$_SESSION['sundries_reason_text'.$j] = '.';
			$_SESSION['additional_reason_text'.$j] = '.';
		 	$_SESSION['bracing_timber_type_select'.$j]=0;
			$_SESSION['sundries_timber_type_select'.$j]=0;
		 	$_SESSION['bracing_length_select'.$j]=0;
	     	$_SESSION['bracing_timber_type'.$j]='';
		 	$_SESSION['sundries_timber_type'.$j]='';
		 	$_SESSION['bracing_productName'.$j]='';
		 	$_SESSION['sundries_productName'.$j]='';
		 	$_SESSION['truss_type'.$j]='';
		 	$_SESSION['message'.$j]='';
			$_SESSION['bracing_error'.$j]='no';
			$_SESSION['sundries_error'.$j]='no';
			$_SESSION['mitek_error'.$j]='no';
			$_SESSION['mitek2_error'.$j]='no';
			$_SESSION['additional_error'.$j]='no';
			$_SESSION['additional2_error'.$j]='no';
		 	$j++;
			
	 }
	 
	 $j=0;
	 while ($j<50) {
		 $_SESSION['timber2_type'.$j]='';
		 $j++;
	 }
	 
	 $_SESSION['line_no3']=0;
	 $_SESSION['line_no3c']=1;
	 $_SESSION['line_no4']=0;
	 $_SESSION['line_no4c']=1;
	 $_SESSION['line_no5']=0;
	 $_SESSION['line_no5a']=0;
	 $_SESSION['line_no6']=0;
	 $_SESSION['line_no6a']=0;
	 
	 $table_name = $_SESSION['db_prefix']."_supply_customer_temp";
	 $delete_query = "DELETE FROM $table_name WHERE user =  '".$_SESSION['username']."'  "; 
	 execsql($delete_query);
	 
	 $table_name = $_SESSION['db_prefix']."_variations_temp";
	 $delete_query = "DELETE FROM $table_name WHERE job_no = '".$_SESSION['job_no']."' AND user =  '".$_SESSION['username']."'  "; 
	 execsql($delete_query);
	 
	 $j=0;
	 while ($j<50) {
		 $i=0;
		 while ($i<50) {
			 $_SESSION['timber_error'.$j.$i]='no';
			 $_SESSION['timber3_error'.$j.$i]='no';
			 $_SESSION['timber4_error'.$j.$i]='no';
			 
			 $i++;
		 }
		 $j++;
	 }
		 
	 
	 $_SESSION['print_option']=0;  
	 $_SESSION['p'] = 1;
	 $_SESSION['error']=0;
	 $_SESSION['error3']='no';
	 $_SESSION['error4']='no';
	 $_SESSION['error5']='no';
	 $_SESSION['error6']='no';
	 
	 	
	 
     
?>

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