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


if ($_SERVER['REQUEST_METHOD'] === 'GET') {
	$accion=$_GET['accion'];
	if($accion=='conse'){  $mobile->getUsuario(); }
Class Mobile {
private $mobiles = array();

	public function getConse(){	

		$codemp=$_GET['codemp'];
		$fuente=$_GET['fuente'];
		$tipo=$_GET['tipo'];
		$sede=$_GET['sede'];
		
		if($codemp!=''){$DBclase="DBC".$codemp;}else{$DBclase="DBController";}
		
		$query="select * from actids where namdbf='".$fuente."' and codsed='".$sede."'";
		echo $query;
		$dbcontroller = new $DBclase();
		$this->mobiles = $dbcontroller->executeSelectQuery($query);
		
		echo $this->mobiles;
		
		return $this->mobiles;
		
		
		
		$nr=sizeof($Resp);
		if ($nr>=1){
			while($row=mysqli_fetch_assoc($Resp)) {
            	$prefijo =  $row["presed"];
				if($tipo==0){//aqui debe actualizar consecutivo en actids
					return 0;
				}else{//solo devuelve consecutivo
					$numero=uniqid($prefijo);
					$array = array($numero);
					$this->mobiles = $array ;
					return $this->mobiles;
				}
			}
		}else{
			echo $Resp;
		}
	}

}
}
?>