<?php
     include('../include/session.php');
         
	 $_SESSION['job_card_no']="";
	 	 
	 $_SESSION['job_card_no']=$_GET['job_card_no'];
	 $_SESSION['name']="";
	 $_SESSION['invoice_date']=date("Y-m-d");
	 $_SESSION['invoice_no']='';
	 $_SESSION['cust_id']='';
	 
	 $_SESSION['labour']='0';
	 $_SESSION['travel']='0';
	 $_SESSION['accomodation']='0';
	 $_SESSION['mworks_charge']='0';
	
		
$table_name = $_SESSION['db_prefix']."_compiled_jobs";
$charges_query = "SELECT forman, labour_charge, labour_charge_final, travel_expense, travel_expense_final, accomodation_expense, accomodation_expense_final, mworks_charge, mworks_charge_final, captured, compiled, invoiced FROM $table_name WHERE job_card_no =  '".$_SESSION['job_card_no']."' ";
$charges_result = mySQL_query($charges_query);
$charges_num = mysql_num_rows($charges_result);
$_SESSION['labour_adjust'] = mysql_result($charges_result, 0, "labour_charge");
$_SESSION['travel_adjust'] = mysql_result($charges_result, 0, "travel_expense");
$_SESSION['accomodation_adjust'] = mysql_result($charges_result, 0, "accomodation_expense");
$_SESSION['mworks_charge_adjust'] = mysql_result($charges_result, 0, "mworks_charge");
$_SESSION['adjustment_text']= '';	
$_SESSION['adjustment']	= '0.00';
$_SESSION['adjustment_dif']	= '0.00';
$_SESSION['total_dif']	= '0.00';

$_SESSION['a4tot']	= '0.00';
$_SESSION['a8tot']	= '0.00';
$_SESSION['a10tot']	= '0.00';
$_SESSION['estimated_total'] = '0.00';
$_SESSION['invoiced_total']	= '0.00';

$_SESSION['kpi_points']='';

$_SESSION['forman'] = mysql_result($charges_result, 0, "forman");
$table_name2 = $_SESSION['db_prefix']."_employee";
	$employee_query = "SELECT emp_first_name, emp_last_name FROM $table_name2 WHERE emp_id ='".$_SESSION['forman']."' ";
	$employee_result = mySQL_query($employee_query);
	$employee_num = mysql_num_rows($employee_result);	
$_SESSION['forman_name']  = mysql_result($employee_result, 0, "emp_first_name").' '.mysql_result($employee_result, 0, "emp_last_name"); 	
			 
$_SESSION['error']=0;
     
?>
<script language="javascript" type="text/javascript">
        <!--
		  window.location="completeJobWizbase.php?error=0&p=1&s=0";
        -->
       </script>