<?php 
$PageSecurity = 4;
include('includes/session.inc');
include('includes/DefineSuppTransClass.php');
   	$store_sql = "SELECT * FROM tpl_breakdown_mgmt where site = '".$_GET['site']."'";
   
	  $store_sql2 = "Select tpl_breakdown_mgmt_machine.asset_id, tpl_breakdown_mgmt.id,tpl_breakdown_mgmt.site as main_id from tpl_breakdown_mgmt join tpl_breakdown_mgmt_machine on (tpl_breakdown_mgmt.id=tpl_breakdown_mgmt_machine.master_id) where site='".$_GET['site']."' and tpl_breakdown_mgmt.CompanyId='".$_SESSION['ACGCompanyId']."' GROUP BY tpl_breakdown_mgmt_machine.asset_id";
	
		$data2='';
		$data2.="<select name='asset_name' id='asset_name' onchange  = 'showJobCardNo2(this.value)'>
              <option value=''>---Select---</option>
			   <option value='0'".($_REQUEST['asset_name']=='0'?'selected':'').">All</option>";
								
 			$store_result2 = DB_query($store_sql2,$db);
			while($store_row2 = DB_fetch_array($store_result2))
			{
				$y='';
				if($store_row2['site'] == $_GET['site'])
				//echo $store_row2['site'];
				echo  $_GET['site'];
				$y="selected";
			
			$display = DB_query("select * from tpl_fixed_asset_definition where id='".$store_row2['asset_id']."' ",$db);
			$displayRe = DB_fetch_array($display);
		$data2.="<option value=".$store_row2['asset_id']." ".$y.">".$displayRe['asset_name']."</option>";
			 }
			
			$data2.="</select>";
			
			
			
	$data1='';
	
		$data1.="<select name='job_card_no' id='job_card_no'>
              <option value=''>---Select---</option>
			   <option value='0'".($_REQUEST['job_card_no']=='0'?'selected':'').">All</option>";
								
 			$store_result = DB_query($store_sql,$db);
			while($store_row = DB_fetch_array($store_result))
			{
				$p='';
				if($store_row['site'] == $_GET['site'])
				$p="selected";
			
			
		$data1.="<option value=".$store_row['id']." ".$p.">".$store_row['tt_no']."</option>";
			 }
			
			$data1.="</select>";
	
	
	
	
	
	
	echo $data=$data1."__".$data2;


?>
