public function getProductsByIdShop($records_per_page = null) { $pagination = new Zebra_Pagination(); // set position of the next/previous page links $pagination->navigation_position(isset($_GET['navigation_position']) && in_array($_GET['navigation_position'], array('left', 'right')) ? $_GET['navigation_position'] : 'outside'); $records_per_page = $records_per_page == null ? 25 : $records_per_page; $db = PDOQuery::getInstance(); $db->connect(); $sql = 'SELECT SQL_CALC_FOUND_ROWS DISTINCT product_lang.product, product.id_product, stock_available.stock_available, stock_available.price, product.reference FROM product_lang RIGHT JOIN product ON product.id_product = product_lang.id_product RIGHT JOIN stock_available ON product.id_product = stock_available.id_product WHERE stock_available.id_shop = :id_shop1 AND product_lang.id_lang=' . _ID_LANG_ . $_SESSION['adminQuery'] . ' UNION SELECT DISTINCT product_lang.product, product.id_product, stock_available.stock_available, stock_available.price, product.reference FROM product_lang RIGHT JOIN product ON product.id_product = product_lang.id_product RIGHT JOIN stock_available ON product.id_product = stock_available.id_product RIGHT JOIN product_tag ON product_tag.id_product = product.id_product RIGHT JOIN tags ON tags.id_tag = product_tag.id_tag WHERE stock_available.id_shop = :id_shop2 AND product_lang.id_lang=' . _ID_LANG_ . ' AND tags.tag = :tagQuery ORDER BY id_product asc LIMIT ' . ($pagination->get_page() - 1) * $records_per_page . ', ' . $records_per_page; $stmt = $db->prepareQuery($sql); $stmt->bindParam(':id_shop1', $_SESSION['id_shop'], PDO::PARAM_INT); $stmt->bindParam(':id_shop2', $_SESSION['id_shop'], PDO::PARAM_INT); $stmt->bindParam(':tagQuery', $_SESSION['tagQuery'], PDO::PARAM_STR); $stmt->execute(); $rows = $db->query('SELECT FOUND_ROWS();')->fetch(PDO::FETCH_COLUMN); // pass the total number of records to the pagination class $pagination->records($rows); // records per page $pagination->records_per_page($records_per_page); $this->pagination_render = $pagination->render(); $db->close(); return $stmt; }
<?php include_once $fsConfig->getPath() . 'view/partial/head.php'; include_once $fsConfig->getPath() . 'libs/Zebra_Pagination.php'; ?> <?php $paginacion = new Zebra_Pagination(); $paginacion->records($objRespuesta[0]); $paginacion->records_per_page(7); ?> <div class="container container-fluid"> <h1>Lista </h1> <p> <a href="<?php echo $fsConfig->getUrl(); ?> index.php/detalleEntradaSalidaBodega/nuevo" class="btn btn-warning glyphicon glyphicon-plus" >Nuevo</a> </p> <div> <a href="<?php echo $fsConfig->getUrl(); ?> index.php/detalleEntradaSalidaBodega/reporte" target="_blank" class="btn btn-primary btn-xs">Ver Reporte</a> </div> <form id="form1" action="<?php echo $fsConfig->getUrl(); ?> index.php/detalleEntradaSalidaBodega/filtro" method="post">
<?php session_start(); require_once '../model/products/Products.php'; require_once '../lib/Zebra_Pagination.php'; $indicatorCategory = $_GET["indicator"]; $product = new Products(); $zebraPage = new Zebra_Pagination(); $productsPerPage = 12; $limit = ($zebraPage->get_page() - 1) * $productsPerPage; $regProducts = $product->loadProducts($limit, $productsPerPage, $indicatorCategory); $totalProducts = $product->totalRows($indicatorCategory); $zebraPage->records($totalProducts); $zebraPage->records_per_page($productsPerPage); $b = $_SESSION["user"][0]; ?> <!DOCTYPE html> <html lang="es"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <title>Shop | Masessa</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/prettyPhoto.css" rel="stylesheet"> <link href="css/price-range.css" rel="stylesheet"> <link href="css/animate.css" rel="stylesheet"> <link href="css/main.css" rel="stylesheet"> <link href="css/responsive.css" rel="stylesheet">
<tr> <th>File</th> <th data-hide="phone">Size</th> <th>Type</th> <th data-hide="phone,tablet">Date</th> <th>Action</th> </tr> </thead> <tbody> <?php $ignored_childs = array('expimp'); $dir_files = getDirFiles(LEUPLOAD_STORE, 1, 2, $ignored_childs); $records_per_page = $LEUPLOAD_PERPAGE_LIST; $pagination = new Zebra_Pagination(); $pagination->records(count($dir_files)); $pagination->records_per_page($records_per_page); $pagination->labels('<span class="glyphicon glyphicon-chevron-left"></span>', '<span class="glyphicon glyphicon-chevron-right"></span>'); $dir_files = array_slice($dir_files, ($pagination->get_page() - 1) * $records_per_page, $records_per_page); foreach ($dir_files as $k => $v) { ?> <tr> <td><a href="javascript:;" class="leupload_link" data-leupload-form="<?php echo $pf; ?> " data-leupload-link-model="<?php echo $pm; ?> " data-leupload-link="<?php echo set_org_resource_url . '/' . $v['file_name']; ?> " data-leupload-file-type="<?php
<a href="paginacionzebra.php"><img src="../imagenes/Actualizar.jpg" width="20" height="20"></a><br><br> <link rel="stylesheet" href="../public/css/zebra_pagination.css" type="text/css"> <?php require 'Zebra_Pagination.php'; $conexion = mysqli_connect('localhost', 'root', '', 'deportes') or die("Error al conectarse a la base de datosclientes"); $query = "Select * from estadisticas"; $consulta = mysqli_query($conexion, $query); $total_paginas = mysqli_num_rows($consulta); $resultados = 10; $paginacion = new Zebra_Pagination(); $paginacion->records($total_paginas); $paginacion->records_per_page($resultados); //quita los ceros al principio de los vinculos $paginacion->padding(false); $query2 = "Select jugadores.codigo, estadisticas.temporada, jugadores.Nombre, estadisticas.Puntos_por_partido as PpP, estadisticas.Rebotes_por_partido as RpP, estadisticas.Tapones_por_partido as TpP from estadisticas,jugadores limit " . ($paginacion->get_page() - 1) * $resultados . "," . $resultados . ""; echo "\n<div class='tabla'>\n\t<div class='titulo'>\n\t\t<p>Resultado consulta temporada</p>\t\t\n\t</div>\n\t<div class='fila'>\n\t\t<div class='columna'><b>Codigo</b></div>\n\t\t<div class='columna'><b>Temporada</b></div>\n\t\t<div class='columna'><b>Nombre</b></div>\n\t\t<div class='columna'><b>PpP</b></div>\n\t\t<div class='columna'><b>RpP</b></div>\n\t\t<div class='columna'><b>TpP</b></div>\n\t</div>\n"; $resultado2 = mysqli_query($conexion, $query2); while ($fila = mysqli_fetch_array($resultado2)) { echo "\n\t<div class='fila'>\n\t\t<div class='columna'>" . $fila['codigo'] . "</div>\n\t\t<div class='columna'>" . $fila['temporada'] . "</div>\n\t\t<div class='columna'>" . $fila['Nombre'] . "</div>\n\t\t<div class='columna'>" . $fila['PpP'] . "</div>\n\t\t<div class='columna'>" . $fila['RpP'] . "</div>\n\t\t<div class='columna'>" . $fila['TpP'] . "</div>\n\t</div>\n"; } echo '</div>'; $paginacion->render(); ?> <style type="text/css"> .tabla { background-color: #1168A8; border-radius: 5px; border: 2px solid #000; display: table; margin: 0px; margin-left: 20px;
$tag = sha1($tag); include_once '../php/mysql.class/mysql.class.php'; include_once '../php/clases/clsUsuario.php'; $OBJ = new Usuario(); include_once '../js/zebra/Zebra_Pagination.php'; $zebra = new Zebra_Pagination(); $id = 0; if ($_GET["id"] != '') { $id = $_GET["id"]; } $estado = ''; $total = 0; $total = $OBJ->get_count_detalle_inventario($id); $result = 10; $zebra->records($total); $zebra->records_per_page($result); #limit $limite = ' LIMIT ' . ($zebra->get_page() - 1) * $result . ',' . $result; if ($id != '') { $data_Inventarios = array(); $data_detalle = array(); $data_Inventarios = $OBJ->get_Inventarios(' WHERE int_IdAuto = ' . $id); if (is_array($data_Inventarios["data"])) { # foreach ($data_Inventarios["data"] as $key => $rs) { $nombre = $rs->var_Nombre; $fecha = $rs->fecha; $estado = $rs->chr_Estado; $Usuario = $rs->int_IdUsuario; $Tipo = $rs->var_Tipo; $Valor = $rs->int_ValorTipo;
<?php include_once $fsConfig->getPath() . 'view/partial/head.php'; include_once $fsConfig->getPath() . 'libs/Zebra_Pagination.php'; $pagina = new Zebra_Pagination(); $pagina->records($objRespuesta[0]); $pagina->records_per_page(5); ?> <div class="container container-fluid"> <h1>CRUD de la tabla Cargo</h1> <p> <a href="<?php echo $fsConfig->getUrl(); ?> index.php/cargo/nuevo" class="btn btn-success glyphicon glyphicon-plus"> Nuevo </a> </p> <?php if ($objcargo != NULL) { ?> <table class="table table-bordered table-striped"> <thead> <tr> <th>Descripción</th> <th>Acción</th> </tr> </thead> <tbody> <?php foreach ($objcargo as $cargo) { ?>
<?php include_once $fsConfig->getPath() . 'view/partial/head.php'; include_once $fsConfig->getPath() . 'libs/Zebra_Pagination.php'; ?> <?php $pagina = new Zebra_Pagination(); $pagina->records($objRespuesta[0]); $pagina->records_per_page(2); ?> <div class="container container-fluid"> <h1>Tipo Mantenimiento</h1> <p> <a href="<?php echo $fsConfig->getUrl(); ?> index.php/tipoMantenimiento/nuevo" class="btn btn-warning glyphicon glyphicon-plus" >Nuevo</a> </p> <div> <a href="<?php echo $fsConfig->getUrl(); ?> index.php/tipoMantenimiento/reporteConsulta" target="_blank" class="btn btn-primary btn-xs">Ver Reporte</a> </div>
function getListData($qs = "", $where = "") { // how many records should be displayed on a page? $records_per_page = 10; // include the pagination class require 'Zebra_Pagination.php'; // instantiate the pagination object $pagination = new Zebra_Pagination(); // the MySQL statement to fetch the rows // note how we build the LIMIT // also, note the "SQL_CALC_FOUND_ROWS" // this is to get the number of rows that would've been returned if there was no LIMIT // see http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_found-rows //if($qs!=""){$limit='' . (($pagination->get_page() - 1) * $records_per_page) . ', ' . $records_per_page . '';}else{$limit="";} $limit = 'LIMIT ' . ($pagination->get_page() - 1) * $records_per_page . ', ' . $records_per_page . ''; if ($where != "") { $where = "WHERE " . $where . ""; } else { $where = ""; } $data = $this->db->query("SELECT * FROM table_information " . $where . " " . $limit . ""); // pass the total number of records to the pagination class $pagination->records(11); // records per page $pagination->records_per_page($records_per_page); $out['data'] = $data->result_array(); $out['page'] = $pagination->render(); //echo $pagination->render(true); die(); return $out; }
public function getTotalSaleList($id_order_by = null, $records_per_page = null) { $pagination = new Zebra_Pagination(); // set position of the next/previous page links $pagination->navigation_position(isset($_GET['navigation_position']) && in_array($_GET['navigation_position'], array('left', 'right')) ? $_GET['navigation_position'] : 'outside'); $records_per_page = $records_per_page == null ? 15 : $records_per_page; $db = PDOQuery::getInstance(); $db->connect(); $order_by = $this->orderBySwitcher($id_order_by); $asc = $this->getOrderDirection(); $sql = "SELECT SQL_CALC_FOUND_ROWS DISTINCT \n\t\t\t\t\tSUM(sales.amount) as total,\n\t\t\t\t\tsales.id_shop_session,\n\t\t\t\t\tshop_session.date\n\t\t\t\tFROM \tsales\n\t\t\t\t\tINNER JOIN shop_session ON shop_session.id_shop_session = sales.id_shop_session\n\t\t\t\tWHERE \tshop_session.id_shop = " . $_SESSION['id_shop'] . "\n\t\t\t\tAND \tshop_session.is_active = 0\n\t\t\t\tGROUP BY shop_session.id_shop_session\n\t\t\t\tORDER BY {$order_by} {$asc}\n\t\t\t\tLIMIT\n \t\t\t\t" . ($pagination->get_page() - 1) * $records_per_page . ", " . $records_per_page; $stmt = $db->prepareQuery($sql); $stmt->bindParam(':id_shop', $_SESSION['id_shop'], PDO::PARAM_INT); $stmt->execute(); $rows = $db->query('SELECT FOUND_ROWS();')->fetch(PDO::FETCH_COLUMN); // pass the total number of records to the pagination class $pagination->records($rows); // records per page $pagination->records_per_page($records_per_page); $this->pagination_render = $pagination->render(); $db->close(); return $stmt; }