<?php
     include('../include/session.php');
         
	 $_SESSION['job_card_no']="";
	 	 
	 $_SESSION['job_card_no']=$_GET['job_card_no'];
	 $_SESSION['name']="";
	 $_SESSION['deliver_date']=date("Y-m-d");
	 $_SESSION['cust_id']='';
	 
	 	$table_name = $_SESSION['db_prefix']."_compiled_jobs";
	 	$job_query = "SELECT * FROM $table_name WHERE job_card_no = '".$_SESSION['job_card_no']."' ";
	 	$job_result = mySQL_query($job_query);
	 	$_SESSION['quote_note'] = mysql_result($job_result, 0, "quote_note");
		
		$_SESSION['cust_id']='';
		$_SESSION['order_date']='';
		$_SESSION['project_description'] = mysql_result($job_result, 0, "project_description");
		$_SESSION['project_no'] = mysql_result($job_result, 0, "project_no");
		$_SESSION['project_place'] = mysql_result($job_result, 0, "project_place");
		$_SESSION['project_area'] = mysql_result($job_result, 0, "project_area");
		$_SESSION['deliver_date'] = mysql_result($job_result, 0, "del_date");
		$_SESSION['work_days'] = mysql_result($job_result, 0, "work_days");
		$_SESSION['value'] = mysql_result($job_result, 0, "value");
		if ($_SESSION['deliver_date']=='') {$_SESSION['deliver_date']= date("Y-m-d");}

        $_SESSION['forman']='';
		$_SESSION['forman_name']='';
	 	$_SESSION['labour']='';
	 	$_SESSION['travel']='';
	 	$_SESSION['accomodation']='';
		$_SESSION['mworks_charge']='';
		$_SESSION['mworks']=mysql_result($job_result, 0, "mworks");
		
		$_SESSION['all_total'] = '';
		
		$_SESSION['stock_error']=0;
		
		$table_name = $_SESSION['db_prefix']."_order_job_lines_supply_temp";
		$delete2_query = "DELETE FROM $table_name WHERE  user_name =  '".$_SESSION['username']."' "; 
		execsql($delete2_query);
		
		$table_name = $_SESSION['db_prefix']."_mworks_job_components_temp";
		$delete_query = "DELETE FROM $table_name WHERE  user_name =  '".$_SESSION['username']."' "; 
		execsql($delete_query);
	 
$_SESSION['error']=0;
     
?>
<script language="javascript" type="text/javascript">
        <!--
		  window.location="supplyJobWizbase.php?error=0&p=1&s=0";
        -->
       </script>