<?php
	$PageSecurity = 11;
 	include('includes/SQL_CommonFunctions.inc');
 	include('includes/session.inc');
   	include('includes/function_lib.php');
	include('includes/Class_Client.php');
$data='';
$data1='';
$data11='';
$data2='';
$data21='';
$data3='';
$data31='';
$data4='';
$data41='';
$data5='';
$data51='';
$data6='';
$data61='';
$data7='';
$data8='';
$data9='';
$ttDetails = DB_query("SELECT * FROM trouble_ticket_creation WHERE id='".$_REQUEST['ttid']."'",$db);
$ttdetails = DB_fetch_array($ttDetails);
$ttassDetails = DB_query("SELECT * FROM trouble_ticket_creation_assignment WHERE ttid='".$ttdetails['id']."'",$db);
$ttassdetails = DB_fetch_array($ttassDetails);
$data1 .= $ttdetails['part_name'];
$data11 .= $s->GetFieldValue('clientmaster', 'id = "'.$ttdetails['part_name'].'"', 'c_name');
$data2 .= $ttdetails['product_name'];
$data21 .= $s->GetFieldValue('item_master', 'id = "'.$ttdetails['product_name'].'"', 'item_name');
$data3 .= $ttassdetails['technician_id'];
$data31 .= $s->GetFieldValue('technicians', 'id = "'.$ttassdetails['technician_id'].'"', 'technician');
$data4 .= $ttdetails['scope_compaint'];
	if($ttdetails['scope_compaint']=='1'){$ttscope="Complaint";}
	else if($ttdetails['scope_compaint']=='2'){$ttscope="Installation";}
	else if($ttdetails['scope_compaint']=='3'){$ttscope="De-Installation";}
	else if($ttdetails['scope_compaint']=='4'){$ttscope="Re-Installation";}
	else if($ttdetails['scope_compaint']=='5'){$ttscope="Preventive";}
	else if($ttdetails['scope_compaint']=='6'){$ttscope="Service";}
	else if($ttdetails['scope_compaint']=='7'){$ttscope="Site Survey";}
	else {$ttscope="";}
$data41 .= $ttscope;
$data5 .= $ttdetails['mode_compaint'];
	if($ttdetails['mode_compaint']==1){$ttmode="By Call";}
	else if($ttdetails['mode_compaint']==2){$ttmode="By Mail";}
	else if($ttdetails['mode_compaint']==3){$ttmode="Internal Mail Request";}
	else if($ttdetails['mode_compaint']==4){$ttmode="Internal Request";}
	else {$ttmode="";}
$data51 .= $ttmode;	
$data6 .= $ttdetails['mode_contract'];
	if($ttdetails['mode_contract']==1){$ttcontract="Lease";}
	else if($ttdetails['mode_contract']==2){$ttcontract="NA";}
	else if($ttdetails['mode_contract']==3){$ttcontract="Sold";}
	else {$ttcontract="";}
$data61 .= $ttcontract;
$data7 .= $ttdetails['closer_date'];
$data8 .= $ttdetails['prob_desc'];
$data9 .= $s->GetFieldValue('item_master', 'id = "'.$ttdetails['product_name'].'"', 'serial_no');

echo $data=$data1."__".$data11."__".$data2."__".$data21."__".$data3."__".$data31."__".$data4."__".$data41."__".$data5."__".$data51."__".$data6."__".$data61."__".$data7."__".$data8."__".$data9;



?>








		
	 	




		
	 	