<?php 
    require_once 'session.php';	
	
	$out =  new stdClass();
	if(!isset($_GET['c']) || $_GET['c'] == "")
	{
		$out->status = "Not Found";
	}
	else{
		
		$RomsId = mysqli_real_escape_string($con, $_GET['r']);
		$customerID = mysqli_real_escape_string($con, $_GET['c']);
		$orders_dues = mysqli_query($con,"select * from assets 
		left join asset_rooms on asset_rooms.rom_id=assets.rooms
		WHERE assets.rooms=$RomsId and assets.ast_cat = '$customerID' ");
		
		if(mysqli_num_rows($orders_dues) < 1)
		{
			$out->status = "Not Found";
		}
		else{
			$orders_dues = mysqli_fetch_assoc($orders_dues);
			$out->status = 'Found';
			$out->RomNam = $orders_dues['room_name'];
			$out->Room = $orders_dues['rooms'];
			$out->Detail = $orders_dues['details'];
			$out->Qty = $orders_dues['quantity'];
			$out->Cost = $orders_dues['price']; 
		}
	}

	echo json_encode($out);
?>