Exemple #1
0
 function select()
 {
     $this->myLogger->enter();
     //needed to properly handle multisort requests from datagrid
     $sort = getOrderString(http_request("sort", "s", ""), http_request("order", "s", ""), "ID ASC");
     // evaluate if any search criteria
     $search = http_Request("where", "s", "");
     // evaluate offset and row count for query
     $page = http_request("page", "i", 1);
     $rows = http_request("rows", "i", 25);
     $limit = "";
     if ($page != 0 && $rows != 0) {
         $offset = ($page - 1) * $rows;
         $limit = "" . $offset . "," . $rows;
     }
     $where = "(Equipos.Prueba={$this->pruebaID}) AND (Equipos.Jornada={$this->jornadaID})";
     if ($search !== '') {
         $where = $where . " AND ( (Equipos.Nombre LIKE '%{$search}%') OR ( Equipos.Observaciones LIKE '%{$search}%') ) ";
     }
     $result = $this->__select("*", "Equipos", $where, $sort, $limit);
     $this->myLogger->leave();
     return $result;
 }
Exemple #2
0
 function select()
 {
     $this->myLogger->enter();
     $sort = getOrderString(http_request("sort", "s", ""), http_request("order", "s", ""), "Nombre ASC");
     $search = http_Request("where", "s", "");
     $page = http_request("page", "i", 1);
     $rows = http_request("rows", "i", 50);
     $limit = "";
     if ($page != 0 && $rows != 0) {
         $offset = ($page - 1) * $rows;
         $limit = "" . $offset . "," . $rows;
     }
     $federation = http_request("Federation", "i", -1);
     $fed = "1";
     if ($federation >= 0) {
         $fed = "( Federation = {$federation} )";
     }
     $where = "(Guias.Club=Clubes.ID)";
     if ($search !== '') {
         $where = "(Guias.Club=Clubes.ID) AND ( (Guias.Nombre LIKE '%{$search}%') OR ( Clubes.Nombre LIKE '%{$search}%') ) ";
     }
     $result = $this->__select("Guias.ID, Guias.Federation, Guias.Nombre, Telefono, Guias.Email, Club, Clubes.Nombre AS NombreClub, Guias.Observaciones", "Guias,Clubes", "{$fed} AND {$where}", $sort, $limit);
     $this->myLogger->leave();
     return $result;
 }
Exemple #3
0
 /**
  * Lista pruebas ordenando por los parametros especificados y con criterios de busqueda
  * @return null on error, else array in jquery expected format
  */
 function select()
 {
     $this->myLogger->enter();
     $sort = getOrderString(http_request("sort", "s", ""), http_request("order", "s", ""), "Nombre ASC");
     $search = http_Request("where", "s", "");
     $closed = http_request("closed", "i", 0);
     // si esta declarada, se incluyen las pruebas cerradas
     $page = http_request("page", "i", 1);
     $rows = http_request("rows", "i", 50);
     $limit = "";
     $where = "";
     if ($page != 0 && $rows != 0) {
         $offset = ($page - 1) * $rows;
         $limit = "" . $offset . "," . $rows;
     }
     if ($search !== "" && $closed == 0) {
         $where = "( (Pruebas.Club=Clubes.ID) && ( Pruebas.Cerrada=0 ) && \t( (Pruebas.Nombre LIKE '%{$search}%') OR ( Clubes.Nombre LIKE '%{$search}%') OR ( Ubicacion LIKE '%{$search}%' ) ) ) ";
     }
     if ($search !== "" && $closed != 0) {
         $where = "( (Pruebas.Club=Clubes.ID) && ( (Pruebas.Nombre LIKE '%{$search}%') OR ( Clubes.Nombre LIKE '%{$search}%') OR ( Ubicacion LIKE '%{$search}%' ) ) )";
     }
     if ($search === "" && $closed == 0) {
         $where = "( (Pruebas.Club=Clubes.ID) && ( Pruebas.Cerrada=0 ) )";
     }
     if ($search === "" && $closed != 0) {
         $where = "(Pruebas.Club=Clubes.ID)";
     }
     // execute query to retrieve $rows starting at $offset
     $result = $this->__select("Pruebas.ID AS ID, Pruebas.Nombre AS Nombre, Pruebas.Club AS Club,Clubes.Nombre AS NombreClub,\n\t\t\t\t\t\t\tPruebas.Ubicacion AS Ubicacion,Pruebas.Triptico AS Triptico, Pruebas.Cartel AS Cartel,\n\t\t\t\t\t\t\tPruebas.RSCE AS RSCE, Pruebas.Selectiva AS Selectiva,\n\t\t\t\t\t\t\tPruebas.Cerrada AS Cerrada, Pruebas.Observaciones AS Observaciones", "Pruebas,Clubes", $where, $sort, $limit);
     $this->myLogger->leave();
     return $result;
 }
Exemple #4
0
 /**
  * retrieve all clubes from table, according sort, search and limit requested
  * Also use current federation flag to filter national/international clubes
  */
 function select()
 {
     $this->myLogger->enter();
     // evaluate offset and row count for query
     $sort = getOrderString(http_request("sort", "s", ""), http_request("order", "s", ""), "Nombre ASC");
     $search = http_Request("where", "s", "");
     $page = http_request("page", "i", 1);
     $rows = http_request("rows", "i", 50);
     // evaluate federation for club/country search according intl status
     $fedstr = "1";
     if ($this->curFederation != null) {
         $fed = intval($this->curFederation->get('ID'));
         $intlmask = Federations::getInternationalMask();
         // select non-international fedmask
         $natmask = ~$intlmask;
         $fedstr = $this->curFederation->isInternational() ? "((Federations & {$intlmask})!=0)" : "((Federations & {$natmask})!=0)";
     }
     $limit = "";
     if ($page != 0 && $rows != 0) {
         $offset = ($page - 1) * $rows;
         $limit = "" . $offset . "," . $rows;
     }
     $where = "1";
     if ($search !== '') {
         $where = "( (Nombre LIKE '%{$search}%') OR (Provincia LIKE '%{$search}%') OR (Pais LIKE '%{$search}%') ) ";
     }
     $result = $this->__select("*, Logo AS LogoClub", "Clubes", "{$fedstr} AND {$where}", $sort, $limit);
     $this->myLogger->leave();
     return $result;
 }