<?php
require_once("SimpleRest.php");
require_once("Mobile.php");
		
class MobileRestHandler extends SimpleRest {
	
	
	function getDataicos() {	
		$mobile = new Mobile();
		$rawData = $mobile->getDataico();
		if(empty($rawData)) {
			$statusCode = 200;
			$rawData = "ERROR";		
		} else {
			$statusCode = 200;
		}
		$requestContentType = 'application/json';//$_POST['HTTP_ACCEPT'];
		$this ->setHttpHeaders($requestContentType, $statusCode);
		$result["Datos"] =$rawData;
		if(strpos($requestContentType,'application/json') !== false){
			$response = $this->encodeJson($result);
			echo $response;
		}
	}
	
	
	public function encodeJson($responseData) {
		  $jsonResponse = json_encode($responseData);
		  return $jsonResponse;		
	}
	
}
?>