<?php
     include('../include/session.php');
     
    
	 $_SESSION['job_no']="";
	 $_SESSION['screen']=0;
	 $_SESSION['start2']=0;
	 $_SESSION['start5']=0;
	 $_SESSION['cat']='';
	 $_SESSION['name']='';
	 
	 	 
	 $_SESSION['job_no']=$_GET['job_no'];
	 $_SESSION['set']="no";
	 
	 
	
	 $i=0;
	 while ($i<25) {
		 $_SESSION['length_'.$i]="";
		 $_SESSION['length2_'.$i]="";
		 $_SESSION['type'.$i]="";
		 $_SESSION['type2'.$i]="";
		 $_SESSION['quantity_'.$i]="";
		 $_SESSION['mitek_line'.$i]="";
		 $i++;
	 }
	
	$n=10;
	while ($n<25) {
	$m=10;
	while ($m<30) {
		$_SESSION['check'.$n.$m] = 'no';
		$_SESSION['check2_'.$n.$m] = 'no';
		$_SESSION['bracing_qty'.$n.$m]='';
		$_SESSION['sundries_qty'.$n.$m]='';
		$_SESSION['item_id'.$n.$m]='';
		$_SESSION['item2_id'.$n.$m]='';
		$_SESSION['sundries_name'.$n.$m]='';
		
		//echo '<br>check'.$n.$m;
		//echo '<br>sundries'.$n.$m;
		//echo '<br>'.$_SESSION['check'.$n.$m];		
		$m++;
	}
	$n++;
	}

	 $m=0;
	 while ($m<25) {
		 $_SESSION['additional_item_id'.$m]="";
		 $_SESSION['additional_quantity_'.$m]="";
		 $_SESSION['additional_line'.$m]="";
		 $m++;
	 } 
	 
	$table_name = $_SESSION['db_prefix']."_captured_timber";
	$delete_query = "DELETE FROM $table_name WHERE cap_timber_length = 0 ";
	execsql($delete_query);	 
	 
	$table_name = $_SESSION['db_prefix']."_authorised_timber_temp";
	$delete_query = "DELETE FROM $table_name WHERE user =  '".$_SESSION['username']."'"; 
	execsql($delete_query);	
	
	$table_name = $_SESSION['db_prefix']."_captured_sundries_temp";
	$delete_query = "DELETE FROM $table_name WHERE  user =  '".$_SESSION['username']."'";  
	execsql($delete_query);	 
	
	$table_name = $_SESSION['db_prefix']."_captured_mitek_temp";
	$delete_query = "DELETE FROM $table_name WHERE  user =  '".$_SESSION['username']."'";  
	execsql($delete_query);	
	
	 
	
	$_SESSION['list_5a']=0;
	$_SESSION['list_5b']=0;
	$_SESSION['list_6a']=0;
	$_SESSION['list_6b']=0;
	   
	 $_SESSION['p'] = 1;
	 $_SESSION['error']=0;
	 $_SESSION['error_2']=0;
	 $_SESSION['error_3']=0;
	 $_SESSION['error_5']=0;
	 
	
     
?>
<script language="javascript" type="text/javascript">
        <!--
		 window.location="authorisationWizbase.php?error=0&p=1&s=0";
        -->
       </script>