<?php
require_once("dbcontroller.php");

/* 
A domain Class to demonstrate RESTful web services
*/
Class Mobile {
	private $mobiles = array();
public function getUsuario(){
	    if (isset($_REQUEST['usuario'])){$usuario=$_REQUEST['usuario'];}else{$usuario="";}
		if (isset($_REQUEST['api'])){$api=$_REQUEST['api'];}else{$api="";}
		if (isset($_REQUEST['apikey'])){$apikey=$_REQUEST['apikey'];}else{$apikey="";}
		if (isset($_REQUEST['tipo'])){$tipo=$_REQUEST['tipo'];}else{$tipo="";}
		if (isset($_REQUEST['referido'])){$referido=$_REQUEST['referido'];}else{$referido="";}

		$query = "";
		if ($usuario!="" and $api!=""){
			$query = "SELECT * FROM usrweb where nomusu='".$usuario."' and conusu='".$api."'" ;
		}
		if ($tipo==1){
			$query = "SELECT nomusu,conusu FROM usrweb where nomusu='".$usuario."'" ;
		}
		

		$dbcontroller = new DBController();
		$this->mobiles = $dbcontroller->executeSelectQuery($query);
		return $this->mobiles;
	}
}
?>