Example #1
0
//$op = Request::get("op");
//$r = Request::get("r");
$filtro = Request::get("filtro");
if ($filtro === null) {
    $params = array();
    $condicion = "1=1";
} else {
    $params["filtro"] == $filtro . "%";
    $condicion = "Name like :filtro";
}
$order = Request::get("order");
$orderby = "Name, CountryCode, ID";
if ($order !== null) {
    $orderby = "{$order}, {$orderby}";
}
$registros = $gestor->count($condicion, $params);
$paginacion = new Pager($registros, Request::get("rpp"), Request::get("pagina"));
$parametros = new QueryString();
$op = null;
$ciudades = $gestor->getList($paginacion->getPaginaActual(), $order, $paginacion->getRpp(), $condicion, $parametros);
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>City</title>
        <style>
            body{
                width: 100%;
                margin: 0 auto;
            }
Example #2
0
<?php

require '../clases/AutoCarga.php';
header('Contet-Type: application/json');
$sesion = new Session();
$no = json_encode(array('login' => false));
$pagina = Request::req("pagina");
if ($pagina === null) {
    $pagina = 1;
}
if ($sesion->isLogged()) {
    $bd = new DataBase();
    $gestor = new ManageCity($bd);
    $pager = new Pager($gestor->count());
    $paginas = $pager->getPaginas();
    $ciudades = $gestor->getListJson($pagina);
    echo '{"ciudades":' . $ciudades . ', "paginas": ' . $paginas . '}';
    $bd->close();
} else {
    echo $no;
}