当前位置: 首页>>代码示例>>PHP>>正文


PHP Paginator::paginate方法代码示例

本文整理汇总了PHP中Paginator::paginate方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::paginate方法的具体用法?PHP Paginator::paginate怎么用?PHP Paginator::paginate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Paginator的用法示例。


在下文中一共展示了Paginator::paginate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testPaginationOnlyPage

 public function testPaginationOnlyPage()
 {
     $paginator = new Paginator();
     $output = $paginator->paginate($this->baseUrl, 100, 1, 100);
     $this->assertFalse($this->didFindString($output, 'Older Tweets'));
     $this->assertFalse($this->didFindString($output, 'Newer Tweets'));
 }
开发者ID:mkody,项目名称:archive-my-tweets,代码行数:7,代码来源:paginatorTest.php

示例2: showAction

 public function showAction($offset = 0)
 {
     $this->_view->title = 'ActiveRecord Database MVC';
     $oContentCats = new ContentCats(2);
     $rsCat = $oContentCats->find();
     $oContents = new Contents();
     $items_per_page = 15;
     $offset = $offset % $items_per_page != 0 ? 0 : $offset;
     $rs = $oContents->find(NULL, 'sort ASC', NULL, "{$offset},{$items_per_page}");
     $pages = new Paginator();
     $pages->current_url = base_url() . 'active-record/active-record/show/%d';
     $pages->offset = $offset;
     $pages->items_per_page = $items_per_page;
     $pages->items_total = $oContents->getTotalRow();
     $pages->mid_range = 7;
     $pages->paginate();
     $this->_view->pages = $pages;
     $this->_view->rs = $rs;
     $this->_view->rsCat = $rsCat;
     $this->_view->filter_link = base_url() . 'active-record/active-record/show';
     $this->_view->add_link = base_url() . 'active-record/active-record/ar-add-model/';
     $this->_view->edit_link = base_url() . 'active-record/active-record/ar-edit-model/';
     $this->_view->delete_link = base_url() . 'active-record/active-record/ar-delete-model/';
     $this->renderView('active-record/active-record/show');
 }
开发者ID:ngukho,项目名称:mvc-cms,代码行数:25,代码来源:ActiveRecordController.php

示例3: while

    function select_all_vendedores()
    {
        include '../resources/paginator.class.php';
        $sql = "SELECT * FROM personal ;";
        $result = $this->database->query($sql);
        $result = $this->database->result;
        $quantity = mysql_num_rows($result);
        if ($quantity < 1) {
            echo '<div class="notify">
			<p>No hay personal en el sistema!</p>
		</div>';
        } else {
            $count = 0;
            while ($row = mysql_fetch_array($result)) {
                $count++;
            }
            $pages = new Paginator();
            $pages->items_total = $count;
            $pages->mid_range = 10;
            $pages->paginate();
            $pages->display_pages();
            $sql = "SELECT * FROM personal ";
            $result = $this->database->query($sql);
            $result = $this->database->result;
            while ($row = mysql_fetch_array($result)) {
                $id = $row['id'];
                $nombre = $row['nombre'];
                $apellido = $row['apellido'];
                $login = $row['login'];
                $role = $row['role'];
                $password = $row['password'];
                switch ($role) {
                    case 1:
                        $role_nombre = "Administrador";
                        break;
                    case 2:
                        $role_nombre = "Marketing";
                        break;
                    case 3:
                        $role_nombre = "Ventas";
                        break;
                }
                echo '<div class="item">

<div class="olive-bar"><h4>' . $nombre . ' ' . $apellido . '</h4></div>

</div>';
            }
            echo '<div class="navigate">';
            echo $pages->display_pages();
            // Optional call which will display the page numbers after the results.
            //$pages->display_jump_menu(); // Optional Ð displays the page jump menu
            //echo $pages->display_items_per_page(); //Optional Ð displays the items per
            //echo  $pages->current_page . ' of ' .$pages->num_pages.'';
            echo '</div>';
        }
    }
开发者ID:EzequielDot175,项目名称:mknet,代码行数:57,代码来源:class.compras2.php

示例4: while

    function select_all($pagina, $orden)
    {
        include '../resources/paginator.class.php';
        $sql = "SELECT * FROM colores ;";
        $result = $this->database->query($sql);
        $result = $this->database->result;
        $quantity = mysql_num_rows($result);
        if ($quantity < 1) {
            echo '<div class="notify">
			<p>No hay colores en el sistema!</p>
		</div>';
        } else {
            $count = 0;
            while ($row = mysql_fetch_array($result)) {
                $count++;
            }
            $pages = new Paginator();
            $pages->items_total = $count;
            $pages->mid_range = 10;
            $pages->paginate();
            $pages->display_pages();
            $sql = "SELECT * FROM colores ORDER BY {$orden} {$pages->limit};";
            $result = $this->database->query($sql);
            $result = $this->database->result;
            while ($row = mysql_fetch_array($result)) {
                $id_color = $row['id_color'];
                $nombre_color = $row['nombre_color'];
                echo '<div class="item-box-talles">

<div class="box-t">
<div class="box-dt"></div>
<span>' . $nombre_color . '</span>
</div>



<a class="BtnTalle" href="e_color.php?id=' . $id_color . '">ADMINISTRAR</a>
<a class="BtnTalle" href="d_color.php?id=' . $id_color . '">ELIMINAR</a>

</div>
';
            }
            echo '<div class="navigate">';
            echo $pages->display_pages();
            // Optional call which will display the page numbers after the results.
            //$pages->display_jump_menu(); // Optional Ð displays the page jump menu
            //echo $pages->display_items_per_page(); //Optional Ð displays the items per
            //echo  $pages->current_page . ' of ' .$pages->num_pages.'';
            echo '</div>';
        }
    }
开发者ID:EzequielDot175,项目名称:mknet,代码行数:51,代码来源:class.colores.php

示例5: while

    function select_all($pagina, $orden)
    {
        include '../resources/paginator.class.php';
        $sql = "SELECT * FROM categorias ;";
        $result = $this->database->query($sql);
        $result = $this->database->result;
        $quantity = mysql_num_rows($result);
        if ($quantity < 1) {
            echo '<div class="notify">
			<p>No hay categoria en el sistema!</p>
		</div>';
        } else {
            $count = 0;
            while ($row = mysql_fetch_array($result)) {
                $count++;
            }
            $pages = new Paginator();
            $pages->items_total = $count;
            $pages->mid_range = 10;
            $pages->paginate();
            $pages->display_pages();
            $sql = "SELECT * FROM categorias ORDER BY {$orden} {$pages->limit};";
            $result = $this->database->query($sql);
            $result = $this->database->result;
            while ($row = mysql_fetch_array($result)) {
                $idCategorias = $row['idCategorias'];
                $strDescripcion = $row['strDescripcion'];
                $talles = $row['talles'];
                echo '<div class="item-box-cat">

<h4>' . $strDescripcion . '</h4>

<div class="box-btn-cat">

<a  class="cat" href="e_categoria.php?id=' . $idCategorias . '&activo=2&sub=d">ADMINISTRAR</a>
<div style="width:100%;height:10px;float:left;display:block"></div>
<a  class="cat" href="d_categoria.php?id=' . $idCategorias . '&activo=2&sub=d">ELIMINAR</a>

</div>
</div>
';
            }
            echo '<div class="navigate">';
            echo $pages->display_pages();
            // Optional call which will display the page numbers after the results.
            //$pages->display_jump_menu(); // Optional Ð displays the page jump menu
            //echo $pages->display_items_per_page(); //Optional Ð displays the items per
            //echo  $pages->current_page . ' of ' .$pages->num_pages.'';
            echo '</div>';
        }
    }
开发者ID:EzequielDot175,项目名称:mknet,代码行数:51,代码来源:class.categorias.php

示例6: while

    function select_all($pagina, $orden)
    {
        include '../resources/paginator.class.php';
        $sql = "SELECT * FROM creditos ;";
        $result = $this->database->query($sql);
        $result = $this->database->result;
        $quantity = mysql_num_rows($result);
        if ($quantity < 1) {
            echo '<div class="notify">
			<p>No hay credito en el sistema!</p>
		</div>';
        } else {
            $count = 0;
            while ($row = mysql_fetch_array($result)) {
                $count++;
            }
            $pages = new Paginator();
            $pages->items_total = $count;
            $pages->mid_range = 10;
            $pages->paginate();
            $pages->display_pages();
            $sql = "SELECT * FROM creditos ORDER BY {$orden} {$pages->limit};";
            $result = $this->database->query($sql);
            $result = $this->database->result;
            while ($row = mysql_fetch_array($result)) {
                $idCredito = $row['idCredito'];
                $idUsuario = $row['idUsuario'];
                $idProducto = $row['idProducto'];
                echo '<div class="item">

<h4>[ Poner aca titulo o nombre ]</h4>
<p><strong>Descripcion: </strong><p></p>[ poner aca descripcion u otro campo ]</p>

<p>
<a href="e_credito.php?id=' . $idCredito . '">Editar</a>
<a href="d_credito.php?id=' . $idCredito . '">Borrar</a>
</p>

</div>';
            }
            echo '<div class="navigate">';
            echo $pages->display_pages();
            // Optional call which will display the page numbers after the results.
            //$pages->display_jump_menu(); // Optional Ð displays the page jump menu
            //echo $pages->display_items_per_page(); //Optional Ð displays the items per
            //echo  $pages->current_page . ' of ' .$pages->num_pages.'';
            echo '</div>';
        }
    }
开发者ID:EzequielDot175,项目名称:mknet,代码行数:49,代码来源:class.creditos.php

示例7: paginador

 function paginador()
 {
     if ($this->con->conectar() == true) {
         $num_rows = mysql_query("SELECT COUNT(*) FROM noticias");
         $pages = new Paginator();
         $pages->items_total = $num_rows[0];
         $pages->mid_range = 3;
         $pages->paginate();
         $result = mysql_query("SELECT * FROM noticias ORDER BY id ASC '" . $pages->limit . "'");
         while ($rows = mysql_fetch_array($result)) {
             echo "<td><?php echo (\$result[\\'id\\']) ?></td>";
         }
         echo "<li>" . $pages->display_jump_menu() . $pages->display_items_per_page() . "</li>";
         echo "Page {$pages->current_page} of {$pages->num_pages}";
     }
 }
开发者ID:JonasHub,项目名称:CvPortfolio,代码行数:16,代码来源:cliente.class.php

示例8: showModelAction

 public function showModelAction($offset = 0)
 {
     $this->_view->title = 'Active Record Database MVC';
     $users = new Peoples();
     $items_per_page = 15;
     $offset = $offset % $items_per_page != 0 ? 0 : $offset;
     $rs = $users->find(NULL, 'user_id DESC', NULL, "{$offset},{$items_per_page}");
     $pages = new Paginator();
     $pages->current_url = base_url() . 'active-record/user-model/show-model/%d';
     $pages->offset = $offset;
     $pages->items_per_page = $items_per_page;
     $pages->items_total = $users->getTotalRow();
     $pages->mid_range = 7;
     $pages->paginate();
     $this->_view->pages = $pages;
     $this->_view->rs = $rs;
     $this->_view->add_link = base_url() . 'active-record/user-model/add-model/';
     $this->_view->edit_link = base_url() . 'active-record/user-model/edit-model/';
     $this->_view->delete_link = base_url() . 'active-record/user-model/delete-model/';
     $this->renderView('active-record/user-model/index');
 }
开发者ID:ngukho,项目名称:mvc-cms,代码行数:21,代码来源:UserModelController.php

示例9: pdoModelAction

 public function pdoModelAction($offset = 0)
 {
     $this->_view->title = 'PDO Model Database MVC';
     $users = new Users();
     $items_per_page = 15;
     $offset = $offset % $items_per_page != 0 ? 0 : $offset;
     $rs = $users->getRowSet(NULL, array(), 'user_id DESC', $offset, $items_per_page);
     $pages = new Paginator();
     $pages->current_url = base_url() . 'pdo-database/pdo-model/pdo-model/%d';
     $pages->offset = $offset;
     $pages->items_per_page = $items_per_page;
     $pages->items_total = $users->getTotalRow();
     $pages->mid_range = 7;
     $pages->paginate();
     $this->_view->pages = $pages;
     $this->_view->rs = $rs;
     $this->_view->add_link = base_url() . 'pdo-database/pdo-model/pdo-add-model/';
     $this->_view->edit_link = base_url() . 'pdo-database/pdo-model/pdo-edit-model/';
     $this->_view->delete_link = base_url() . 'pdo-database/pdo-model/pdo-delete-model/';
     $this->renderView('pdo-database/pdo-model/index');
 }
开发者ID:ngukho,项目名称:mvc-cms,代码行数:21,代码来源:PdoModelController.php

示例10: paginatorAction

 public function paginatorAction($offset = 0)
 {
     $this->_view->title = 'Welcome to Paginator MVC';
     //	    $pages = new Paginator();
     //	    $pages->current_url = base_url() . 'paging/index';
     //	    $pages->current_page = isset($_GET['page']) ? $_GET['page'] : 1;
     //
     //		$pages->items_total = 1202;
     //		$pages->mid_range = 7;
     //		$pages->paginate();
     //
     //		$this->_temp->pages = $pages;
     $items_per_page = 25;
     $offset = $offset % $items_per_page != 0 ? 0 : $offset;
     $pages = new Paginator();
     $pages->current_url = base_url() . 'paging/page/paginator/%d';
     $pages->offset = $offset;
     $pages->items_per_page = $items_per_page;
     $pages->items_total = 1252;
     $pages->mid_range = 10;
     $pages->paginate();
     $this->_view->pages = $pages;
     $this->renderView('paging/page/paginator');
 }
开发者ID:ngukho,项目名称:mvc-cms,代码行数:24,代码来源:PageController.php

示例11: getPayments

 /**
  * Membership::getPayments()
  * 
  * @param bool $where
  * @param bool $from
  * @return
  */
 public function getPayments($where = false, $from = false)
 {
     global $db, $core, $pager;
     require_once BASEPATH . "lib/class_paginate.php";
     $pager = new Paginator();
     $counter = countEntries($this->pTable);
     $pager->items_total = $counter;
     $pager->default_ipp = $core->perpage;
     $pager->paginate();
     if ($counter == 0) {
         $pager->limit = null;
     }
     $clause = $where ? " WHERE p.rate_amount LIKE '%" . intval($where) . "%'" : "";
     if (isset($_GET['sort'])) {
         list($sort, $order) = explode("-", $_GET['sort']);
         $sort = sanitize($sort);
         $order = sanitize($order);
         if (in_array($sort, array("user_id", "rate_amount", "pp", "date"))) {
             $ord = $order == 'DESC' ? " DESC" : " ASC";
             $sorting = " p." . $sort . $ord;
         } else {
             $sorting = " p.date DESC";
         }
     } else {
         $sorting = " p.date DESC";
     }
     if (isset($_POST['fromdate']) && $_POST['fromdate'] != "" || isset($from) && $from != '') {
         $enddate = date("Y-m-d");
         $fromdate = empty($from) ? $_POST['fromdate'] : $from;
         if (isset($_POST['enddate']) && $_POST['enddate'] != "") {
             $enddate = $_POST['enddate'];
         }
         $clause .= " WHERE p.date BETWEEN '" . trim($fromdate) . "' AND '" . trim($enddate) . " 23:59:59'";
     }
     $sql = "SELECT p.*, p.id as id, u.username, m.title," . "\n DATE_FORMAT(p.date, '%d. %b. %Y.') as created" . "\n FROM " . $this->pTable . " as p" . "\n LEFT JOIN users as u ON u.id = p.user_id" . "\n LEFT JOIN " . $this->mTable . " as m ON m.id = p.membership_id" . "\n " . $clause . " ORDER BY " . $sorting . $pager->limit;
     $row = $db->fetch_all($sql);
     return $row ? $row : 0;
 }
开发者ID:ExtraProgrammers,项目名称:PrivateGSIASorteios,代码行数:45,代码来源:class_membership.php

示例12: while

    function select_all($pagina, $orden)
    {
        $filtro_personal = $_GET['filtro_personal'];
        include '../resources/paginator.class.php';
        if ($filtro_personal) {
            $sql = "SELECT * FROM personal WHERE role='{$filtro_personal}'";
        } else {
            $sql = "SELECT * FROM personal";
        }
        $result = $this->database->query($sql);
        $result = $this->database->result;
        $quantity = mysql_num_rows($result);
        if ($quantity < 1) {
            echo '<div class="notify">
			<p>No hay personal en el sistema!</p>
		</div>';
        } else {
            $count = 0;
            while ($row = mysql_fetch_array($result)) {
                $count++;
            }
            $pages = new Paginator();
            $pages->items_total = $count;
            $pages->mid_range = 10;
            $pages->paginate();
            $pages->display_pages();
            if ($filtro_personal) {
                $sql = "SELECT * FROM personal WHERE role='{$filtro_personal}' ORDER BY {$orden} {$pages->limit};";
            } else {
                $sql = "SELECT * FROM personal ORDER BY {$orden} {$pages->limit};";
            }
            $result = $this->database->query($sql);
            $result = $this->database->result;
            while ($row = mysql_fetch_array($result)) {
                $id = $row['id'];
                $nombre = $row['nombre'];
                $apellido = $row['apellido'];
                $login = $row['login'];
                $role = $row['role'];
                $password = $row['password'];
                switch ($role) {
                    case 1:
                        $role_nombre = "Administrador";
                        break;
                    case 2:
                        $role_nombre = "Marketing";
                        break;
                    case 3:
                        $role_nombre = "Ventas";
                        break;
                }
                echo '

<table>
           <tbody>
                <tr class=" tablaPersonal ">
                  <td class="colA" align="center">
			<div class="imagen-personal"></div>
                  </td>
                  <td class="colB tdBackground" align="center">
                    <span>' . $nombre . ' ' . $apellido . '</span>
                  </td>
                  <td class="colC tdBackground" align="center">
                     <span>Login: ' . $login . '</span>
                  </td>
                  <td class="colD tdBackground" align="center">
                    <span>' . $role_nombre . '</span>
                  </td>
                  <td class="colE ">
                     		<div class="botones">
		              <div class="item editar">
		                <a href="e_personal.php?id=' . $id . '&activo=2&sub=h">
		                  <img class="imagen" src="../layout/editar.png" alt="">
		                </a>
		              </div>
		              <div class="item borrar">
		                <a href="d_personal.php?id=' . $id . '&activo=2&sub=h">
		                  <img class="imagen" src="../layout/borrar.png" alt="">
		                </a>
		              </div>
		           </div>
                  </td>
                </tr>

           </tbody>
</table>

';
            }
            echo '<div class="navigate">';
            echo $pages->display_pages();
            // Optional call which will display the page numbers after the results.
            //$pages->display_jump_menu(); // Optional Ð displays the page jump menu
            //echo $pages->display_items_per_page(); //Optional Ð displays the items per
            //echo  $pages->current_page . ' of ' .$pages->num_pages.'';
            echo '</div>';
        }
    }
开发者ID:EzequielDot175,项目名称:mknet,代码行数:98,代码来源:class.personal.php

示例13: while

    function select_all($pagina, $orden)
    {
        include '../resources/paginator.class.php';
        $sql = "SELECT * FROM historiales ;";
        $result = $this->database->query($sql);
        $result = $this->database->result;
        $quantity = mysql_num_rows($result);
        if ($quantity < 1) {
            echo '<div class="notify">
			<p>No hay historiales en el sistema!</p>
		</div>';
        } else {
            $count = 0;
            while ($row = mysql_fetch_array($result)) {
                $count++;
            }
            $pages = new Paginator();
            $pages->items_total = $count;
            $pages->mid_range = 10;
            $pages->paginate();
            $pages->display_pages();
            $sql = "SELECT * FROM historiales ORDER BY {$orden} {$pages->limit};";
            $result = $this->database->query($sql);
            $result = $this->database->result;
            while ($row = mysql_fetch_array($result)) {
                $id_usuario = $row['id_usuario'];
                $fecha = $row['fecha'];
                $realizado_por = $row['realizado_por'];
                $tipo_modificacion = $row['tipo_modificacion'];
                $monto_modificado = $row['monto_modificado'];
            }
            echo '<div class="navigate">';
            echo $pages->display_pages();
            // Optional call which will display the page numbers after the results.
            //$pages->display_jump_menu(); // Optional – displays the page jump menu
            //echo $pages->display_items_per_page(); //Optional – displays the items per
            //echo  $pages->current_page . ' of ' .$pages->num_pages.'';
            echo '</div>';
        }
    }
开发者ID:EzequielDot175,项目名称:mknet,代码行数:40,代码来源:class.historiales-.php

示例14: while

    function select_all($pagina, $orden)
    {
        include '../resources/paginator.class.php';
        $vendedor_filtro = $_GET['vendedor'];
        $prod_state = $_GET['prod_state'];
        $vendedor_asignado = $_SESSION['logged_id'];
        if ($_SESSION['logged_role'] == 1) {
            if ($vendedor_filtro >= 1) {
                $sql = "SELECT * FROM usuarios  WHERE vendedor='{$vendedor_filtro}'  ";
                $result = $this->database->query($sql);
                $result = $this->database->result;
                while ($row = mysql_fetch_array($result)) {
                    $clientes[] = $row['idUsuario'];
                }
                $clientes_d = implode(',', $clientes);
                $sql = "SELECT * FROM compra WHERE idUsuario IN ({$clientes_d}); ";
            } else {
                $sql = "SELECT * FROM usuarios ";
                $result = $this->database->query($sql);
                $result = $this->database->result;
                while ($row = mysql_fetch_array($result)) {
                    $clientes[] = $row['idUsuario'];
                }
                $clientes_d = implode(',', $clientes);
                $sql = "SELECT * FROM compra WHERE idUsuario IN ({$clientes_d}); ";
            }
        } elseif ($_SESSION['logged_role'] == 2) {
            $sql = "SELECT * FROM usuarios WHERE vendedor='{$vendedor_asignado}' ";
            $result = $this->database->query($sql);
            $result = $this->database->result;
            while ($row = mysql_fetch_array($result)) {
                $clientes[] = $row['idUsuario'];
            }
            $clientes_d = implode(',', $clientes);
            $sql = "SELECT * FROM compra WHERE idUsuario IN ({$clientes_d}); ";
        } elseif ($_SESSION['logged_role'] == 3) {
            $sql = "SELECT * FROM usuarios WHERE vendedor='{$vendedor_asignado}' ";
            $result = $this->database->query($sql);
            $result = $this->database->result;
            while ($row = mysql_fetch_array($result)) {
                $clientes[] = $row['idUsuario'];
            }
            $clientes_d = implode(',', $clientes);
            $sql = "SELECT * FROM compra WHERE idUsuario IN ({$clientes_d}); ";
        }
        $result = $this->database->query($sql);
        $result = $this->database->result;
        $quantity = mysql_num_rows($result);
        if ($quantity < 1) {
            echo '<div class="notify">
	<p>No hay compra en el sistema!</p>
	</div>';
        } else {
            $count = 0;
            include_once '../usuarios/classes/class.usuarios.php';
            while ($row = mysql_fetch_array($result)) {
                $idCompra = $row['idCompra'];
                $idUsuario = $row['idUsuario'];
                $count++;
            }
            $pages = new Paginator();
            $pages->items_total = $count;
            $pages->mid_range = 10;
            $pages->paginate();
            $pages->display_pages();
            if ($_SESSION['logged_role'] == 1) {
                if ($vendedor_filtro >= 1) {
                    $sql = "SELECT * FROM compra AS com INNER JOIN usuarios AS usu ON com.idUsuario=usu.idUsuario WHERE vendedor='{$vendedor_filtro}' ORDER BY {$orden} {$pages->limit};";
                } elseif ($prod_state) {
                    $sql = "SELECT * FROM compra AS com INNER JOIN detalles_compras AS det ON com.idCompra=det.id_compra WHERE det.estado_producto = '{$prod_state}' GROUP BY det.id_compra ORDER BY {$orden} {$pages->limit};";
                } else {
                    $sql = "SELECT * FROM compra ORDER BY {$orden} {$pages->limit};";
                }
            } elseif ($_SESSION['logged_role'] == 2) {
                if ($vendedor_filtro >= 1) {
                    $sql = "SELECT * FROM compra AS com INNER JOIN usuarios AS usu ON com.idUsuario=usu.idUsuario WHERE vendedor='{$vendedor_filtro}' ORDER BY {$orden} {$pages->limit};";
                } elseif ($prod_state) {
                    $sql = "SELECT * FROM compra AS com INNER JOIN detalles_compras AS det ON com.idCompra=det.id_compra WHERE det.estado_producto = '{$prod_state}' GROUP BY det.id_compra ORDER BY {$orden} {$pages->limit};";
                } else {
                    $sql = "SELECT * FROM compra ORDER BY {$orden} {$pages->limit};";
                }
            } elseif ($_SESSION['logged_role'] == 3) {
                $sql = "SELECT * FROM usuarios WHERE vendedor='{$vendedor_asignado}' ";
                $result = $this->database->query($sql);
                $result = $this->database->result;
                while ($row = mysql_fetch_array($result)) {
                    $clientes[] = $row['idUsuario'];
                }
                $clientes_d = implode(',', $clientes);
                if ($prod_state) {
                    $sql = "SELECT * FROM compra AS com INNER JOIN detalles_compras AS det ON com.idCompra=det.id_compra WHERE  idUsuario IN ({$clientes_d}) AND det.estado_producto = '{$prod_state}' GROUP BY det.id_compra ORDER BY {$orden} {$pages->limit};";
                } else {
                    $sql = "SELECT * FROM compra WHERE  idUsuario IN ({$clientes_d}) ORDER BY {$orden} {$pages->limit};";
                }
            }
            $result = $this->database->query($sql);
            $result = $this->database->result;
            while ($row = mysql_fetch_array($result)) {
                $idCompra = $row['idCompra'];
                $idUsuario = $row['idUsuario'];
//.........这里部分代码省略.........
开发者ID:EzequielDot175,项目名称:mknet,代码行数:101,代码来源:class.compras.php

示例15: while

    function select_all($pagina, $orden)
    {
        include '../resources/paginator.class.php';
        $id_vendedor = $_GET['vendedor'];
        $role_login = $_SESSION['logged_role'];
        $id_login = $_SESSION['logged_id'];
        if ($role_login == 3) {
            $sql = "SELECT * FROM usuarios WHERE vendedor = '{$id_vendedor}' ;";
        } else {
            if ($id_vendedor) {
                $sql = "SELECT * FROM usuarios WHERE vendedor = '{$id_vendedor}';";
            } else {
                $sql = "SELECT * FROM usuarios";
            }
        }
        $result = $this->database->query($sql);
        $result = $this->database->result;
        $quantity = mysql_num_rows($result);
        if ($quantity < 1) {
            echo '
			<a href="#">No hay usuario en el sistema!</a>
';
        } else {
            $count = 0;
            while ($row = mysql_fetch_array($result)) {
                $count++;
            }
            $pages = new Paginator();
            $pages->items_total = $count;
            $pages->mid_range = 10;
            $pages->paginate();
            $pages->display_pages();
            include_once '../historiales/classes/class.historiales.php';
            if ($role_login == 3) {
                $sql = "SELECT * FROM usuarios WHERE vendedor = '{$id_login}' ORDER BY {$orden} {$pages->limit};";
            } else {
                if ($id_vendedor) {
                    $sql = "SELECT * FROM usuarios WHERE vendedor = '{$id_vendedor}' ORDER BY {$orden} {$pages->limit};";
                } else {
                    $sql = "SELECT * FROM usuarios ORDER BY {$orden} {$pages->limit};";
                }
            }
            $result = $this->database->query($sql);
            $result = $this->database->result;
            while ($row = mysql_fetch_array($result)) {
                $idUsuario = $row['idUsuario'];
                $strNombre = $row['strNombre'];
                $strApellido = $row['strApellido'];
                $strEmail = $row['strEmail'];
                $strEmpresa = $row['strEmpresa'];
                $strCargo = $row['strCargo'];
                $strPassword = $row['strPassword'];
                $dblCredito = $row['dblCredito'];
                $direccion = $row['direccion'];
                $telefono = $row['telefono'];
                $nombre_contacto1 = $row['nombre_contacto1'];
                $apellido_contacto1 = $row['apellido_contacto1'];
                $email_contacto1 = $row['email_contacto1'];
                $nombre_contacto2 = $row['nombre_contacto2'];
                $apellido_contacto2 = $row['apellido_contacto2'];
                $email_contacto2 = $row['email_contacto2'];
                $logo = $row['logo'];
                $vigencia_credito = $row['vigencia_credito'];
                $vendedor = $row['vendedor'];
                $usuarioitem = "";
                //si tiene imagen
                if (strlen($logo) > 2) {
                    $usuarioitem .= '



	<table>
	           <tbody>
	                <tr class=" tablaClientes">
	                  <td class="colA" align="center">
				<img class="imagen"  id="preview5" src="../../images-clientes/' . $logo . '" alt="" width="100"/>
	                  </td>
	                  <td class="colB tdBackground" align="center">
	                    <span>' . $strEmpresa . ' <span>
	                  </td>
	                  <td class="colC tdBackground" align="center">
	                    <span>' . $strApellido . ' ' . $strNombre . ' </span>
	                  </td>
	                  <td class="colD tdBackground" align="center">
	                    <span>' . $strEmail . '</span>
	                  </td>
	                   <td class="colE tdBackground" align="center">
	                    <span> ' . $dblCredito . ' </span>
	                  </td>
	                  <td class="colF ">
	                     		<div class="botones">
			              <div class="item editar">
			                <a href="e_usuario.php?id=' . $idUsuario . '&activo=2&sub=e">
			                  <img class="imagen" src="../layout/editar.png" alt="">
			                </a>
			              </div>
			              <div class="item borrar">
			                <a href="d_usuario.php?id=' . $idUsuario . '&activo=2&sub=e">
			                  <img class="imagen" src="../layout/borrar.png" alt="">
			                </a>
//.........这里部分代码省略.........
开发者ID:EzequielDot175,项目名称:mknet,代码行数:101,代码来源:class.usuarios.php


注:本文中的Paginator::paginate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。