Exemplo n.º 1
0
 /**
  * retrieve list of stored sessions
  * @param {array} data received data query parameters
  * @param {boolean} ring: if true exclude "-- Sin asignar --" session 1
  * @return {array} session list in easyui json expected format, or error string
  */
 function select($data, $ring = false)
 {
     $this->myLogger->enter();
     //needed to properly handle multisort requests from datagrid
     $sort = getOrderString(http_request("sort", "s", ""), http_request("order", "s", ""), "Nombre ASC, Comentario ASC");
     // search string
     $search = isset($_GET['where']) ? strval($_GET['where']) : '';
     // evaluate offset and row count for query
     $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;
     }
     // if hidden==0 hide console related sessions
     $ringstr = " AND 1";
     if ($ring) {
         $ringstr = " AND (Sesiones.ID > 1)";
     }
     $searchstr = " AND 1";
     if ($search !== "") {
         $searchstr = "AND (Nombre LIKE '%{$search}%')  AND ( ( Comentario LIKE '%{$search}%' ) OR ( Operador LIKE '%{$search}%') ) ";
     }
     $hiddenstr = " AND 1";
     if ($data['Hidden'] == 0) {
         $hiddenstr = "AND (Nombre != 'Console')";
     }
     $result = $this->__select("Sesiones.ID AS ID,Nombre,Comentario,Operador,Prueba,Jornada,Manga,Tanda,Login,Background,LiveStream,LiveStream2,LiveStream3", "Sesiones,Usuarios", "( Sesiones.Operador = Usuarios.ID ) {$hiddenstr} {$searchstr} {$ringstr}", $sort, $limit);
     $this->myLogger->leave();
     return $result;
 }
Exemplo n.º 2
0
 function select()
 {
     $this->myLogger->enter();
     //needed to properly handle multisort requests from datagrid
     $sort = getOrderString(http_request("sort", "s", ""), http_request("order", "s", ""), "Login ASC");
     // search string
     $search = isset($_GET['where']) ? strval($_GET['where']) : '';
     // evaluate offset and row count for query
     $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;
     }
     $where = "(Login != 'root') ";
     // hide root user to app
     if ($search !== '') {
         $where = " AND ( (Login LIKE '%{$search}%') OR ( Gecos LIKE '%{$search}%' ) OR ( Email LIKE '%{$search}%') ) ";
     }
     $result = $this->__select("*", "Usuarios", $where, $sort, $limit);
     $this->myLogger->leave();
     return $result;
 }
Exemplo n.º 3
0
 /**
  * Enumerate all dogs that matches requested criteria and order
  * @return null on error, else requested data
  */
 function select()
 {
     $this->myLogger->enter();
     // evaluate offset and row count for query
     $sort = getOrderString(http_request("sort", "s", ""), http_request("order", "s", ""), "Nombre ASC");
     $this->myLogger->debug("Sort order is: {$sort}");
     $search = http_request("where", "s", "");
     $page = http_request("page", "i", 1);
     $rows = http_request("rows", "i", 50);
     $federation = http_request("Federation", "i", -1);
     $fed = "1";
     if ($federation >= 0) {
         $fed = "( Federation = {$federation} )";
     }
     $where = "1";
     $limit = "";
     if ($page != 0 && $rows != 0) {
         $offset = ($page - 1) * $rows;
         $limit = "" . $offset . "," . $rows;
     }
     if ($search !== "") {
         $where = "( (Nombre LIKE '%{$search}%') OR ( NombreGuia LIKE '%{$search}%') OR ( Licencia LIKE '%{$search}%') OR ( NombreClub LIKE '%{$search}%') )";
     }
     $result = $this->__select("*", "PerroGuiaClub", "{$fed} AND {$where}", $sort, $limit);
     $this->myLogger->leave();
     return $result;
 }
Exemplo n.º 4
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;
 }
Exemplo n.º 5
0
 function select()
 {
     $this->myLogger->enter();
     //needed to properly handle multisort requests from datagrid
     $sort = getOrderString(http_request("sort", "s", ""), http_request("order", "s", ""), "Nombre ASC");
     // search string
     $search = isset($_GET['where']) ? strval($_GET['where']) : '';
     // evaluate offset and row count for query
     $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;
     }
     $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() ? "((Internacional!=0) OR (Federations & {$intlmask})!=0)" : "((Federations & {$natmask})!=0)";
     }
     $where = "1";
     if ($search !== '') {
         $where = "( (Nombre LIKE '%{$search}%') OR ( Email LIKE '%{$search}%') ) ";
     }
     $result = $this->__select("*", "Jueces", "{$fedstr} AND {$where}", $sort, $limit);
     $this->myLogger->leave();
     return $result;
 }
Exemplo n.º 6
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;
 }
Exemplo n.º 7
0
 function inscritosByTeam($team)
 {
     $this->myLogger->enter();
     // obtenemos los datos del equipo
     $teamobj = $this->__getObject("Equipos", $team);
     if (!is_object($teamobj)) {
         return $this->error("No puedo obtener datos del equipo con ID: {$team}");
     }
     // vemos el numero de la jornada asociada
     $jornadaobj = $this->__getObject("Jornadas", $teamobj->Jornada);
     if (!is_object($jornadaobj)) {
         return $this->error("No puedo obtener datos de la jornada: {$teamobj->Jornada} asociada al equipo: {$team}");
     }
     $order = getOrderString(http_request("sort", "s", ""), http_request("order", "s", ""), "NombreClub ASC, Categoria ASC, Grado ASC, Nombre ASC");
     // extraemos la lista de inscritos
     $tname = escapeString($teamobj->Nombre);
     $lista = $this->__select("DISTINCT Resultados.Prueba,Resultados.Jornada, Resultados.Dorsal, Resultados.Perro,\n                            Resultados.Nombre, PerroGuiaClub.NombreLargo, PerroGuiaClub.Genero, Resultados.Raza, Resultados.Licencia, Resultados.Categoria, Resultados.Grado,\n                            Resultados.Celo,Resultados.NombreGuia,Resultados.NombreClub, Resultados.Equipo,\n                            PerroGuiaClub.Club AS Club, PerroGuiaClub.Guia AS Guia,PerroGuiaClub.LogoClub AS LogoClub,\n                            '{$tname}' AS NombreEquipo", "Resultados,PerroGuiaClub", "( PerroGuiaClub.ID = Resultados.Perro)\tAND ( Resultados.Jornada={$teamobj->Jornada} ) AND ( Resultados.Equipo={$team} )", $order, "");
     $this->myLogger->leave();
     return $lista;
 }
Exemplo n.º 8
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;
 }
Exemplo n.º 9
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;
 }