<?php
require_once("SimpleRest.php");
require_once("Mobile.php");
		
class MobileRestHandler extends SimpleRest {
	function getAgendameds() {	
		$mobile = new Mobile();
		$rawData = $mobile->getAgendamed();
		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;
		}
	}
	function getUsuarios() {	
		$mobile = new Mobile();
		$rawData = $mobile->getUsuario();
		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;
		}
	}
	function getEditsecciones() {	
		$mobile = new Mobile();
		$rawData = $mobile->getEditseccion();
		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;
		}
	}
	function getEditdetalles() {	
		$mobile = new Mobile();
		$rawData = $mobile->getEditdetalle();
		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;
		}
	}
	function getFiltrardetalles() {	
		$mobile = new Mobile();
		$rawData = $mobile->getFiltrardetalle();
		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;
		}
	}
	function getEliminadetalles() {	
		$mobile = new Mobile();
		$rawData = $mobile->getEliminadetalle();
		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;
		}
	}
	function getAdicionales() {	
		$mobile = new Mobile();
		$rawData = $mobile->getAdicional();
		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;
		}
	}
	function getUpersonas() {	
		$mobile = new Mobile();
		$rawData = $mobile->getUpersona();
		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;
		}
	}
	function getHorarios() {	
		$mobile = new Mobile();
		$rawData = $mobile->getHorario();
		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;
		}
	}
	
	function getLicencias() {	
		$mobile = new Mobile();
		$rawData = $mobile->getLicencia();
		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;
		}
	}
	
	function geConsecutivos() {	
		$mobile = new Mobile();
		$rawData = $mobile->getConsecutivo();
		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;
		}
	}
	
	function getActividades() {	
		$mobile = new Mobile();
		$rawData = $mobile->getActividad();
		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;
		}
	}
	
	function getEspecialidades() {	
		$mobile = new Mobile();
		$rawData = $mobile->getEspecialidad();
		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;
		}
	}
	
	function getProcesos() {	
		$mobile = new Mobile();
		$rawData = $mobile->getProceso();
		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;
		}
	}
	
	function getModulos() {	
		$mobile = new Mobile();
		$rawData = $mobile->getModulo();
		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;
		}
	}
	
	function getRegistros() {	
		$mobile = new Mobile();
		$rawData = $mobile->getRegistro();
		if(empty($rawData)) {
			//$statusCode = 200;
			$rawData = $rawData;		
		} 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;
		}
	}
	function getFes() {	
		$mobile = new Mobile();
		$rawData = $mobile->getFe();
		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;
		}
	}
	
	function getMenus() {	
		$mobile = new Mobile();
		$rawData = $mobile->getMenu();
		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;
		}
	}
	
	function getAliaddofes() {	
		$mobile = new Mobile();
		$rawData = $mobile->getAliaddofe();
		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;
		}
	}
	
	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;
		}
	}
	
	function getUpdatedes() {	
		$mobile = new Mobile();
		$rawData = $mobile->getUpdatede();
		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;		
	}
	
}
?>