<?php

require_once "models/get.model.php";
require_once "controllers/get.controller.php";

$select = $_GET['select'] ?? "*";
$filterTo = $_GET['filterTo'] ?? null;
$inTo = $_GET['inTo'] ?? null;

$response = new GetController();

if(isset($_GET["linkTo"]) && isset($_GET["equalTo"]) && isset($_GET["filterTo"]) && isset($_GET['inTo'])){

	$response -> getDataRange($table,$select,$_GET["linkTo"],$_GET["equalTo"],$filterTo,$inTo);

}
else if(isset($_GET["linkTo"]) && isset($_GET["equalTo"])){

	$response -> getDataFilter($table,$select,$_GET["linkTo"],$_GET["equalTo"]);

}else if(isset($_GET["token"]))
{
    
  $res = GetModel::getDataFilter("clientes_app","*","Token",$_GET["token"]); 
  $idCliente = $res[0]->{"IdCliente"};
  $response -> getDataFilterStatus("etiquetas",$select,"IdCliente",$idCliente);
    
}
else{

	$response ->getData($table,$select);
}



?>