Exemplo n.º 1
0
 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'));
 }
Exemplo n.º 2
0
 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');
 }
Exemplo n.º 3
0
    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>';
        }
    }
Exemplo n.º 4
0
    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>';
        }
    }
Exemplo n.º 5
0
    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>';
        }
    }
Exemplo n.º 6
0
    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>';
        }
    }
Exemplo n.º 7
0
 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}";
     }
 }
Exemplo n.º 8
0
 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');
 }
Exemplo n.º 9
0
 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');
 }
Exemplo n.º 10
0
 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');
 }
 /**
  * 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;
 }
Exemplo n.º 12
0
    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: '******'</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>';
        }
    }
Exemplo n.º 13
0
    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>';
        }
    }
Exemplo n.º 14
0
    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'];
                $fthCompra = $row['fthCompra'];
                $intTipoPago = $row['intTipoPago'];
                $dblTotal = $row['dblTotal'];
                $idCredito = $row['idCredito'];
                $caracteristicas = $row['caracteristicas'];
                $monto = $row['monto'];
                $aprobado = $row['aprobado'];
                $leido = $row['leido'];
                $detalle = $row['detalle'];
                $estado = $row['estado'];
                include_once '../usuarios/classes/class.usuarios.php';
                $usr = new usuarios();
                $usr->select($idUsuario);
                $nombre_usr = $usr->getstrNombre();
                $apellido_usr = $usr->getstrApellido();
                $email_usr = $usr->getstrEmail();
                $monto_usuario = $usr->getdblCredito();
                $vendedor_usuario = $usr->getvendedor();
                ////////////////////////////////////////////OPCIONES ESTADO PEDIDO
                $opciones .= '
			<option value="1" ';
                if ($estado == 1) {
                    $opciones .= "selected=\"selected\" ";
                }
                $opciones .= '>Pendiente</option>';
                $opciones .= '
			<option value="2" ';
                if ($estado == 2) {
                    $opciones .= "selected=\"selected\" ";
                }
                $opciones .= '>Finalizado</option>';
                ////////////////////////////////////////// PRODUCTOS CANJEADOS ITEM PEDIDO - TOTAL
                $item .= '<div class="item">
			<!-- Compra: ' . $idCompra . ' pertenece a vendedor : ' . $vendedor_usuario . '-->
			<div class="olive-bar_new2"><span class="tit_pedido"><span class="bold">Usuario: ' . utf8_decode($nombre_usr) . ' ' . utf8_decode($apellido_usr) . '</span> / ' . $email_usr . '</span> <span class="fecha_tit_admin">' . $fthCompra . '</span></div>
			<form name="listado_productos" id="estform" action="update_proceso.php" method="post">
			';
                //ARRANCA EL FORM------------------------------->
                ////////////////////////////////////////// SELECT ESTADO PEDIDO
                if ($_SESSION['logged_role'] == 1) {
                    $item .= '
				<div class="estadopedido_box">

					<input type="hidden" name="id_compra" value="' . $idCompra . '" />
					<select name="estado_compra" id="estado1">
					' . $opciones . '
					</select>
					<button type="sybmit" class="button mainbtn">GUARDAR</button>

				</div>
				';
                } else {
                    $item .= '

				<div class="estadopedido_box">
				<input type="hidden" name="id_compra" value="' . $idCompra . '" />
				<select name="estado_compra" id="estado1">
				' . $opciones . '
				</select>
				</div>
				</div>
				';
                }
                /////////////////////////////////////////////////// TABLA PRODUCTOS CANJEADOS ///ADMIN ///TOTALES///
                $item .= '

			' . $this->bring_detalle_compra($idCompra) . '
			<p>
			<!--
			<a href="d_compra.php?id=' . $idCompra . '">Borrar</a>
			-->
			</p>

			<div class="total_prod_comprado">

			<div>
			<p>
			<!-- TOTAL DE PUNTOS COMENTADO
			<span class="precio_producto_compra green_style">$' . $dblTotal . '</span>
			<span class="valor_total">VALOR TOTAL</span> </p>
			-->
			</div>

			<div class="box_1_4" >
			<div class="fth-c"><!--' . $fthCompra . '--></div>
			</div>

			</div>

			</div>';
                if ($_SESSION['logged_role'] == 1) {
                    echo $item;
                } elseif ($_SESSION['logged_role'] == 2) {
                    echo $item;
                } else {
                    //chequear si el cliente pertenece a ese vendedor
                    if ($_SESSION['logged_id'] == $vendedor_usuario) {
                        echo $item;
                    }
                }
                $item = "";
                $opciones = "";
            }
            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>';
        }
        //////////////////PODUCTOS DEL PEDIDO - NOMBRE - DETALLE - CANTIDAD - PRECIO
    }
Exemplo n.º 15
0
    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>
			              </div>
			           </div>
	                  </td>
	                </tr>

	           </tbody>
	</table>
';
                    // <div class="item">
                    // 	<div class="divideritemuno" >
                    // 		<img id="preview5" src="../../images-clientes/'.$logo.'" alt="" width="100"/>
                    // 	</div>
                    // 	<div class="divideritemdos" >
                    // 		<h5>'.$strEmpresa.' </h5><br>
                    // 		<span>'.$strEmail.'</span><br>
                    // 		<span>'.$strApellido.' '.$strNombre.' </span><br>
                    // 		<span> '.$direccion.' - '.$telefono.' </span><br>
                    // 	</div>
                    // 	<div class="divideritemtres" >
                    // 		<span>Credito disponible: <br /><span class="bold big">$ '.$dblCredito.'  </span></span>
                    // 	</div>
                    // 	<p class="boton">
                    // <a href="e_usuario.php?id='.$idUsuario.'&activo=2&sub=e">Ver</a>
                    // <a href="d_usuario.php?id='.$idUsuario.'&activo=2&sub=e">Borrar</a>
                    // </p>
                    // </div>
                } else {
                    $usuarioitem .= '

	<table>
	           <tbody>
	                <tr class=" tablaClientes">
	                  <td class="colA" align="center">
				<img id="preview5" src="../../images_productos/default.png" 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>
			              </div>
			           </div>
	                  </td>
	                </tr>

	           </tbody>
	</table>
';
                }
                echo $usuarioitem;
            }
            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>';
        }
    }
        }
    }
    if (isset($price) && $price[0] != "" && $price[1] != "") {
        if ($first) {
            $whereCondition .= 'price between ' . $price[0] . ' and ' . $price[1];
            $first = false;
        } else {
            $whereCondition .= ' and price between ' . $price[0] . ' and ' . $price[1];
        }
    }
    if (isset($page)) {
        $carPages->current_page = $page;
    }
}
$invOrderBy = explode('~', $invSort);
$carPages->default_ipp = $invPageLimit;
$carPages->pageUrl = 'products.php';
if (!isset($search)) {
    $carPages->pageUrl = 'notre_inventaire';
}
$eu = $invPageLimit * ($invCurPage - 1);
$inventoryTotalRows = $common->numberOfRows('car_flat', $whereCondition);
//number of rows in pages table
$addCarToQuery = '';
$carPages->items_total = $inventoryTotalRows;
$carPages->paginate();
$all_cars = $common->read('car_flat', $whereCondition, $invOrderBy[0] . " " . $invOrderBy[1] . " LIMIT 0, " . $invPageLimit);
$all_car = array();
while ($row = mysql_fetch_array($all_cars)) {
    $all_car[] = $row;
}
Exemplo n.º 17
0
                               	<th>Otro</th>
                                <th style="text-align:center">Acciones</th>
							</tr>
							</thead>
                            
							<tbody>
							<?php 
$sql = "SELECT * FROM sample_data";
$database->query($sql);
$rows = $database->resultset();
$count = $database->rowCount();
$pages = new Paginator();
$pages->items_total = $count;
$pages->items_per_page = 2;
$pages->mid_range = 5;
$pages->paginate();
$sql = $sql . $pages->limit;
$database->query($sql);
$rows = $database->resultset();
foreach ($rows as &$row) {
    echo '<tr>
										<td>
											<a>' . $row['sample_data_name'] . '</a>
										</td>
										<td>' . $row['sample_data_email'] . '</a></td>									
										<td style="text-align:center">
											<a href="posts_edit.php?id=' . $row['ID'] . '"><img src="images/icons/view.png" title="Mira tus predicciones" /></a>
										</td>                        
									</tr>';
}
?>
 /**
  * Get parameters from $_POST and $_GET, build SQL statements, including sort
  * and order parameters, retrieve the count, retrieve the records.
  *
  * @return void
  */
 private function build_sql()
 {
     if (!$this->base_url) {
         error('$this->base_url must be set. See $this->set_base_url()');
     }
     if ($this->base_url[strlen($this->base_url) - 1] != '/') {
         $this->base_url .= '/';
         // add a trailing '/' if it isn;t there... needed for the str_replace() function
     }
     // what page are we on?
     // we expect base_url/page_no/items_per_page/sort-FNAME-asc or desc - all items optional
     $current_url = (!empty($_SERVER['HTTPS']) ? "https://" : "http://") . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] . '/';
     // lose the base url part - we don;t want it...
     $page_and_per_page = str_replace($this->base_url, '', $current_url);
     $page_and_per_page = explode('/', $page_and_per_page);
     $no_of_params = count($page_and_per_page);
     if ($no_of_params >= 1) {
         $current_page = intval($page_and_per_page[0]);
     } else {
         $current_page = 1;
     }
     if ($no_of_params >= 2) {
         if (strtolower($page_and_per_page[1]) == 'all') {
             $items_per_page = 'all';
         } elseif (strpos($page_and_per_page[1], 'sort-') !== FALSE) {
             // we have a sort parameter...
             $this->get_sort_params_from_url($page_and_per_page[1]);
         } else {
             $items_per_page = intval($page_and_per_page[1]);
         }
     } else {
         $items_per_page = FALSE;
     }
     if ($no_of_params >= 3) {
         // we have a sort parameter...
         $this->get_sort_params_from_url($page_and_per_page[2]);
     }
     $this->tina_items_per_page = $items_per_page;
     $this->tina_page_no = $current_page;
     // now for some SQL...
     //tmprd( $_POST );
     // are we filtering?
     $filter_where_clause = FALSE;
     //default
     $this->filter_post_var = $this->get_name() . '_filter_terms';
     $search_term = $this->wpdb->escape($this->get_search_term());
     // are we clearing?
     if (get_Post("{$this->filter_post_var}_clear")) {
         $search_term = '';
     }
     $this->list_of_filter_fields = '';
     if (!empty($this->filter->fields)) {
         foreach ($this->filter->fields as $display_name => $mysql_field) {
             // the mysql field may have a period in it... e.g. table.column1
             $_field = explode('.', $mysql_field);
             $backticked_field = '';
             foreach ($_field as $item) {
                 if ($backticked_field) {
                     $backticked_field .= '.';
                 }
                 $backticked_field .= "`{$item}`";
             }
             $this->list_of_filter_fields .= $this->list_of_filter_fields ? ', ' : '';
             $this->list_of_filter_fields .= esc_html_recursive($display_name);
             if ($search_term) {
                 if ($filter_where_clause) {
                     $filter_where_clause .= ' OR ';
                 }
                 $filter_where_clause .= "{$backticked_field} LIKE '%{$search_term}%'";
             }
         }
     }
     if ($filter_where_clause) {
         // we might already have a WHERE clause... if so we append...
         // this is a bit Q&D... will fail if WHERE appears within a SUB SELECT for example...
         if (stripos($this->base_sql, 'WHERE') === FALSE) {
             $filter_where_clause = " WHERE ({$filter_where_clause}) ";
         } else {
             $filter_where_clause = " AND ({$filter_where_clause}) ";
         }
     }
     // have we an order set?
     if ($this->sort_by) {
         $order_clause = ' ORDER BY `' . $this->wpdb->escape($this->sort_by) . '` ' . strtoupper($this->sort_ord) . ' ';
     } elseif (!empty($this->default_sort_by)) {
         $order_clause = ' ORDER BY `' . $this->wpdb->escape($this->default_sort_by) . '` ';
         if (!empty($this->default_sort_ord)) {
             $order_clause .= strtoupper($this->sort_ord) . ' ';
         }
     } else {
         $order_clause = ' ';
         // default
     }
     // get the count of total items
     $res = $this->wpdb->get_var($this->count_sql . $filter_where_clause);
     if ($res === FALSE) {
         ob_start();
         $this->wpdb->print_error();
         $err = ob_get_clean();
         error('SQL Error: ' . $err);
     }
     $this->items_total = $res;
     /**
      * get the paged links
      *
      * This also sets $this->limit for the following query
      */
     parent::paginate();
     $sql = $this->base_sql . $filter_where_clause . $order_clause;
     if ($this->items_total) {
         // no limit if no results is zero
         $sql .= $this->limit;
     }
     $this->sql_results = $this->wpdb->get_results($sql);
     global $EZSQL_ERROR;
     // tmprd( $EZSQL_ERROR );
     if ($EZSQL_ERROR) {
         $msg = $EZSQL_ERROR[0]['error_str'] . " // " . 'Query: ' . $EZSQL_ERROR[0]['query'];
         error($msg);
     }
 }
Exemplo n.º 19
0
     break;
 case 'departement':
     if (!ls_get_access("leads_all", $lsuser->getVar("permissions"), LS_SUPERADMINACCESS)) {
         $sqlw = ' AND operatorid = "' . LS_USERID_RHINO . '"';
     }
     $total = $lsdb->query('SELECT COUNT(*) as totalAll FROM ' . $lstable . ' WHERE department = ' . $page2 . $sqlw);
     $rowt = $total->fetch_assoc();
     if ($rowt['totalAll'] != 0) {
         // Paginator
         $leads = new Paginator();
         $leads->items_total = $rowt['totalAll'];
         $leads->mid_range = 10;
         $leads->items_per_page = 20;
         $leads->jak_get_page = $page4;
         $leads->jak_where = 'index.php?p=leads&sp=sort&ssp=' . $page2 . '&sssp=' . $page3;
         $leads->paginate();
         $JAK_PAGINATE = $leads->display_pages();
     }
     $result = $lsdb->query('SELECT t1.id, t1.name, t1.email, t1.department, t1.operatorid, t1.initiated, t1.ip, t1.notes, t1.countrycode, t1.country, t1.city, t2.username, t3.title FROM ' . $lstable . ' AS t1 LEFT JOIN ' . DB_PREFIX . 'user AS t2 ON (t1.operatorid = t2.id) LEFT JOIN ' . DB_PREFIX . 'departments AS t3 ON (t1.department = t3.id) WHERE department = ' . $page2 . $sqlw . ' ' . $leads->limit);
     while ($row = $result->fetch_assoc()) {
         $allLeads[] = $row;
     }
     // Ouput all leads, well with paginate of course
     $LEADS_ALL = $allLeads;
     // Call the template
     $template = 'leads.php';
     break;
 case 'sort':
     // Leads
     $sqlw = '';
     $rowts['total_support'] = 0;
 /**
  * Users::getUsers()
  * 
  * @param bool $from
  * @return
  */
 public function getUsers($from = false)
 {
     global $db, $pager, $core;
     require_once BASEPATH . "lib/class_paginate.php";
     $pager = new Paginator();
     $counter = countEntries($this->uTable);
     $pager->items_total = $counter;
     $pager->default_ipp = $core->perpage;
     $pager->paginate();
     if ($counter == 0) {
         $pager->limit = null;
     }
     if (isset($_GET['sort'])) {
         list($sort, $order) = explode("-", $_GET['sort']);
         $sort = sanitize($sort);
         $order = sanitize($order);
         if (in_array($sort, array("username", "fname", "lname", "email", "created"))) {
             $ord = $order == 'DESC' ? " DESC" : " ASC";
             $sorting = " u." . $sort . $ord;
         } else {
             $sorting = " u.created DESC";
         }
     } else {
         $sorting = " u.created DESC";
     }
     $clause = isset($clause) ? $clause : null;
     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 u.created BETWEEN '" . trim($fromdate) . "' AND '" . trim($enddate) . " 23:59:59'";
     }
     $sql = "SELECT u.*, CONCAT(u.fname,' ',u.lname) as name, m.title, m.id as mid," . "\n DATE_FORMAT(u.created, '%d. %b. %Y.') as cdate," . "\n DATE_FORMAT(u.lastlogin, '%d. %b. %Y.') as adate" . "\n FROM " . $this->uTable . " as u" . "\n LEFT JOIN memberships as m ON m.id = u.membership_id" . "\n " . $clause . "\n ORDER BY " . $sorting . $pager->limit;
     $row = $db->fetch_all($sql);
     return $row ? $row : 0;
 }
Exemplo n.º 21
0
/**
* displayEvents - Displays the events database table in
* a nicely formatted html table.
*/
function displayPastEvents()
{
    global $sql;
    global $text;
    global $time;
    $pages = new Paginator();
    $array = array('latest' => array(EB_EVENTS_L4, 'EventID'), 'name' => array(EB_EVENTS_L5, TBL_EVENTS . '.Name'), 'game' => array(EB_EVENTS_L6, TBL_GAMES . '.Name'), 'type' => array(EB_EVENTS_L7, TBL_EVENTS . '.Type'), 'start' => array(EB_EVENTS_L8, TBL_EVENTS . '.StartDateTime'));
    if (!isset($_GET['gameid'])) {
        $_GET['gameid'] = "All";
    }
    $gameid = eb_sanitize($_GET['gameid']);
    if (!isset($_GET['matchtype'])) {
        $_GET['matchtype'] = "All";
    }
    $matchtype = eb_sanitize($_GET['matchtype']);
    if (!isset($_GET['orderby'])) {
        $_GET['orderby'] = 'game';
    }
    $orderby = eb_sanitize($_GET['orderby']);
    $sort = "ASC";
    if (isset($_GET["sort"]) && !empty($_GET["sort"])) {
        $sort = $_GET["sort"] == "ASC" ? "DESC" : "ASC";
    }
    $game_string = $gameid == "All" ? "" : "   AND (" . TBL_EVENTS . ".Game = '{$gameid}')";
    $matchtype_string = $matchtype == "All" ? "" : "   AND (" . TBL_GAMES . ".MatchTypes LIKE '%{$matchtype}%')";
    // Drop down list to select Games to display
    $q_Games = "SELECT DISTINCT " . TBL_GAMES . ".*" . " FROM " . TBL_GAMES . ", " . TBL_EVENTS . " WHERE (" . TBL_EVENTS . ".Game = " . TBL_GAMES . ".GameID)" . $matchtype_string . " ORDER BY Name";
    $result_Games = $sql->db_Query($q_Games);
    $numGames = mysql_numrows($result_Games);
    // Drop down list to select Match type to display
    $q_mt = "SELECT " . TBL_GAMES . ".*" . " FROM " . TBL_GAMES . ", " . TBL_EVENTS . " WHERE (" . TBL_EVENTS . ".Game = " . TBL_GAMES . ".GameID)" . $game_string;
    $result_mt = $sql->db_Query($q_mt);
    $num_mt = mysql_numrows($result_mt);
    $gmatchtypes = '';
    for ($i = 0; $i < $num_mt; $i++) {
        $gmatchtypes .= ',' . mysql_result($result_mt, $i, TBL_GAMES . ".MatchTypes");
    }
    $text .= '<form id="submitform" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="get">';
    $text .= '<div>';
    $text .= '<table class="table_left">';
    $text .= '<tr>';
    // Games drop down
    $text .= '<td>' . EB_EVENTS_L9 . '<br />';
    $text .= '<select class="tbox" name="gameid" onchange="this.form.submit()">';
    $text .= '<option value="All" ' . ($gameid == "All" ? 'selected="selected"' : '') . '>' . EB_EVENTS_L10 . '</option>';
    for ($i = 0; $i < $numGames; $i++) {
        $gName = mysql_result($result_Games, $i, TBL_GAMES . ".Name");
        $gid = mysql_result($result_Games, $i, TBL_GAMES . ".GameID");
        $text .= '<option value="' . $gid . '" ' . ($gameid == $gid ? 'selected="selected"' : '') . '>' . htmlspecialchars($gName) . '</option>';
    }
    $text .= '</select>';
    $text .= '</td>';
    // Match Types drop down
    $text .= '<td>' . EB_EVENTS_L32 . '<br />';
    $text .= '<select class="tbox" name="matchtype" onchange="this.form.submit()">';
    $text .= '<option value="All" ' . ($matchtype == "All" ? 'selected="selected"' : '') . '>' . EB_EVENTS_L10 . '</option>';
    $gmatchtypes = explode(",", $gmatchtypes);
    $gmatchtypes = array_unique($gmatchtypes);
    sort($gmatchtypes);
    foreach ($gmatchtypes as $gmatchtype) {
        if ($gmatchtype != '') {
            $text .= '<option value="' . $gmatchtype . '" ' . ($gmatchtype == $matchtype ? 'selected="selected"' : '') . '>' . htmlspecialchars($gmatchtype) . '</option>';
        }
    }
    $text .= '</select>';
    $text .= '</td>';
    $text .= '</tr>';
    $text .= '</table>';
    $game_string = $gameid == "All" ? "" : "   AND (" . TBL_EVENTS . ".Game = '{$gameid}')";
    $matchtype_string = $matchtype == "All" ? "" : "   AND (" . TBL_EVENTS . ".MatchType = '{$matchtype}')";
    $q = "SELECT count(*) " . " FROM " . TBL_EVENTS . " WHERE (" . TBL_EVENTS . ".Status = 'finished')" . $game_string . $matchtype_string;
    $result = $sql->db_Query($q);
    $totalItems = mysql_result($result, 0);
    $pages->items_total = $totalItems;
    $pages->mid_range = eb_PAGINATION_MIDRANGE;
    $pages->paginate();
    $orderby_array = $array["{$orderby}"];
    $q = "SELECT " . TBL_EVENTS . ".*, " . TBL_GAMES . ".*" . " FROM " . TBL_EVENTS . ", " . TBL_GAMES . " WHERE (" . TBL_EVENTS . ".Status = 'finished')" . "   AND (" . TBL_EVENTS . ".Game = " . TBL_GAMES . ".GameID)" . $game_string . $matchtype_string . " ORDER BY {$orderby_array['1']} {$sort}, EventID DESC" . " {$pages->limit}";
    $result = $sql->db_Query($q);
    $numEvents = mysql_numrows($result);
    if (!$result || $numEvents < 0) {
        /* Error occurred, return given name by default */
        $text .= EB_EVENTS_L11 . '</div>';
        $text .= '</form><br/>';
    } else {
        if ($numEvents == 0) {
            $text .= EB_EVENTS_L12 . '</div>';
            $text .= '</form><br/>';
        } else {
            // Paginate & Sorting
            $items = '';
            foreach ($array as $opt => $opt_array) {
                $items .= $opt == $orderby ? '<option selected="selected" value="' . $opt . '">' . $opt_array[0] . '</option>' : '<option value="' . $opt . '">' . $opt_array[0] . '</option>';
            }
            // Paginate
            $text .= '<span class="paginate" style="float:left;">' . $pages->display_pages() . '</span>';
            $text .= '<span style="float:right">';
            // Sort By
            $text .= EB_PGN_L6;
            $text .= '<select class="tbox" name="orderby" onchange="this.form.submit()">';
            $text .= $items;
            $text .= '</select>';
            // Up/Down arrow
            $text .= '<input type="hidden" id="sort" name="sort" value=""/>';
            if ($sort == "ASC") {
                $text .= '<a href="javascript:buttonval(\'ASC\');" title="Ascending"><img src="' . e_PLUGIN . 'ebattles/images/sort_asc.gif" alt="Asc" style="vertical-align:middle; border:0"/></a>';
            } else {
                $text .= '<a href="javascript:buttonval(\'DESC\');" title="Descending"><img src="' . e_PLUGIN . 'ebattles/images/sort_desc.gif" alt="Desc" style="vertical-align:middle; border:0"/></a>';
            }
            $text .= '&nbsp;&nbsp;&nbsp;';
            // Go To Page
            $text .= $pages->display_jump_menu();
            $text .= '&nbsp;&nbsp;&nbsp;';
            // Items per page
            $text .= $pages->display_items_per_page();
            $text .= '</span>';
            $text .= '</div>';
            $text .= '</form><br/><br/>';
            /* Display table contents */
            $text .= '<table class="eb_table" style="width:95%"><tbody>';
            $text .= '<tr>
		<th class="eb_th2">' . EB_EVENTS_L13 . '</th>
		<th colspan="2" class="eb_th2">' . EB_EVENTS_L14 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L15 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L16 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L17 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L18 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L19 . '</th>
		<th class="eb_th2">' . EB_EVENTS_L34 . '</th>
		</tr>';
            for ($i = 0; $i < $numEvents; $i++) {
                $gName = mysql_result($result, $i, TBL_GAMES . ".Name");
                $gIcon = mysql_result($result, $i, TBL_GAMES . ".Icon");
                $event_id = mysql_result($result, $i, TBL_EVENTS . ".EventID");
                $event = new Event($event_id);
                if ($event->getField('StartDateTime') != 0) {
                    $startdatetime_local = $event->getField('StartDateTime') + TIMEOFFSET;
                    $date_start = date("d M Y", $startdatetime_local);
                } else {
                    $date_start = "-";
                }
                if ($event->getField('EndDateTime') != 0) {
                    $enddatetime_local = $event->getField('EndDateTime') + TIMEOFFSET;
                    $date_end = date("d M Y", $enddatetime_local);
                } else {
                    $date_end = "-";
                }
                /* Nbr players */
                $q_2 = "SELECT COUNT(*) as NbrPlayers" . " FROM " . TBL_PLAYERS . " WHERE (Event = '{$event_id}')";
                $result_2 = $sql->db_Query($q_2);
                $row = mysql_fetch_array($result_2);
                $nbrplayers = $row['NbrPlayers'];
                /* Nbr Teams */
                $q_2 = "SELECT COUNT(*) as NbrTeams" . " FROM " . TBL_TEAMS . " WHERE (" . TBL_TEAMS . ".Event = '{$event_id}')";
                $result_2 = $sql->db_Query($q_2);
                $row = mysql_fetch_array($result_2);
                $nbrTeams = $row['NbrTeams'];
                /* Nbr matches */
                $q_2 = "SELECT COUNT(DISTINCT " . TBL_MATCHS . ".MatchID) as NbrMatches" . " FROM " . TBL_MATCHS . ", " . TBL_SCORES . " WHERE (Event = '{$event_id}')" . " AND (" . TBL_MATCHS . ".Status = 'active')" . " AND (" . TBL_SCORES . ".MatchID = " . TBL_MATCHS . ".MatchID)";
                $result_2 = $sql->db_Query($q_2);
                $row = mysql_fetch_array($result_2);
                $nbrmatches = $row['NbrMatches'];
                switch ($event->getField('Type')) {
                    case "One Player Ladder":
                    case "One Player Tournament":
                        $nbrTeamPlayers = $nbrplayers;
                        break;
                    case "Team Ladder":
                        $nbrTeamPlayers = $nbrTeams . '/' . $nbrplayers;
                        break;
                    case "Clan Ladder":
                    case "Clan Tournament":
                        $nbrTeamPlayers = $nbrTeams;
                        break;
                    default:
                }
                $text .= '<tr>
			<td class="eb_td"><a href="' . e_PLUGIN . 'ebattles/eventinfo.php?eventid=' . $event_id . '">' . $event->getField('Name') . '</a></td>
			<td class="eb_td"><img ' . getGameIconResize($gIcon) . '/></td>
			<td class="eb_td">' . $gName . '</td>
			<td class="eb_td">' . ($event->getField('MatchType') != '' ? $event->getField('MatchType') . ' - ' : '') . $event->eventTypeToString() . '</td>
			<td class="eb_td">' . $date_start . '</td>
			<td class="eb_td">' . $date_end . '</td>
			<td class="eb_td">' . $nbrTeamPlayers . '</td>
			<td class="eb_td">' . $nbrmatches . '</td>
			<td class="eb_td">' . $event->eventStatusToString() . '</td>
			</tr>';
            }
            $text .= '</tbody></table><br />';
            $text .= '<div>';
            $text .= ebImageLink('back_to_events', '', e_PLUGIN . 'ebattles/events.php', '', 'action_back.gif', EB_EVENTP_L3 . ' ' . EB_EVENTP_L4, 'jq-button');
            $text .= '</div>';
        }
    }
}
Exemplo n.º 22
0
foreach ($tweets as $tweet) {
    $tweet->tagify();
    $cleantext = $tweet->message;
    //$tweet->clean();
    echo "<li id=\"tweet-" . $tweet->id . "\" class=\"tweet" . ($i % 2 == 0 ? " altrow" : "") . "\">\n";
    echo "<div class=\"userpic\"><a href=\"http://twitter.com/" . $tweet->screen_name . "\"><img src=\"" . $tweet->userpic . "\" alt=\"\" /></a></div>\n";
    echo "<div class=\"tweet-meta\"><a href=\"http://twitter.com/" . $tweet->screen_name . "\">" . $tweet->name . "</a> " . relativeTime(strtotime($tweet->published)) . "</div>";
    echo "<div class=\"tweet-body\">" . linkify($cleantext) . ' <a href="' . $tweet->permalink() . '" class="permalink">&infin;</a></div>';
    echo "</li>\n";
    $i++;
}
?>
				</ul>
				<?php 
if ($tweets) {
    echo Paginator::paginate($offset, Tweet::count($tag), PAGE_LIMIT, "index.php?" . ($tag ? 'tag=' . urlencode($tag) . '&' : '') . "offset=");
} else {
    echo "<div class=\"tweetless\">\n";
    echo "No tweets.\n";
    echo "</div>\n";
}
?>
	    	</div>
		</div>
		<div id="footer">
			<p>Powered by <a href="http://plasticmind.com/twitster/?referral=1">Twitster</a></p>
		</div>
	</div>

</body>
</html>
Exemplo n.º 23
0
$category_var_name = $id;
$category = get_category_by_var_name($category_var_name);
$category_id = $category['id'];
$type_var_name = $extra;
$type_id = get_type_id_by_varname($type_var_name);
$jobsCount = 0;
if ($type_id) {
    $jobsCount = $job->CountJobs($id, $type_id);
} else {
    $jobsCount = $job->CountJobs($id);
}
$paginatorLink = BASE_URL . URL_JOBS . "/{$category_var_name}";
if (isset($type_var_name)) {
    $paginatorLink .= "/{$type_var_name}";
}
$paginator = new Paginator($jobsCount, JOBS_PER_PAGE, @$_REQUEST['p']);
$paginator->setLink($paginatorLink);
$paginator->paginate();
$firstLimit = $paginator->getFirstLimit();
$lastLimit = $paginator->getLastLimit();
$the_jobs = $job->GetPaginatedJobsForCategory($category_id, $firstLimit, JOBS_PER_PAGE, $type_id);
$smarty->assign("pages", $paginator->pages_link);
$smarty->assign('jobs', $the_jobs);
$smarty->assign('jobs_count', $jobsCount);
$smarty->assign('types', get_types());
$smarty->assign('current_category', $category_var_name);
$smarty->assign('current_category_name', $category['name']);
$smarty->assign('seo_title', $category['title']);
$smarty->assign('seo_desc', $category['description']);
$smarty->assign('seo_keys', $category['keywords']);
$template = 'category.tpl';
Exemplo n.º 24
0
              <?php 
if ($isMod) {
    echo '<th> </th>';
}
?>
            </tr>
          </thead>
          <tbody>
            <?php 
foreach ($values['deleteResult'] as $res) {
    echo '<tr>';
    echo '<td>' . $res['id'] . '</td>';
    echo '<td class="hidden-phone">' . htmlspecialchars($res['username']) . '</td>';
    echo '<td class="breakable">' . htmlspecialchars($res['question']) . '</td>';
    echo '<td class="hidden-phone">' . $res['line_num'] . '</td>';
    echo '<td class="breakable">' . htmlspecialchars($res['reason']) . '</td>';
    if ($isMod) {
        echo '<td><a href="' . $container->router->generate('accept-delete', array("id" => $res['id'])) . '" class="btn btn-mini"><i class="icon-ok"></i></a> <a href="' . $container->router->generate('remove-delete', array("id" => $res['id'])) . '" class="btn btn-mini"><i class="icon-ban-circle"></i></a></td>';
    }
    echo '</tr>';
}
?>
          </tbody>
        </table>
        <?php 
$pagination = new Paginator($values['deletePage'], $values['deleteResultCount'], $values['maxResults'], 'dp');
$pagination->paginate();
?>
      </div>
    </div>
Exemplo n.º 25
0
                        $userid = $_SESSION['userid'];
                        $queryString = "SELECT c.coupon_enddate,(\n\t\t\n\t\tSELECT count( p.coupon_purchaseid )\n\t\tFROM coupons_purchase p\n\t\tWHERE p.couponid = c.coupon_id  and p.Coupon_amount_Status='T'\n\t\t) AS pcounts, u.firstname, u.lastname, c.coupon_id, c.coupon_name,c.deal_url, DATE_FORMAT( c.coupon_startdate, '%d %M %Y' ) AS startdate, DATE_FORMAT( c.coupon_enddate, '%d %M %Y' ) AS enddate, c.coupon_createdby,(\n\t\tif( LENGTH( concat( u.firstname, u.lastname ) ) =0, u.username, concat( u.firstname, u.lastname ) )\n\t\t) AS name,c.coupon_status,c.coupon_minuserlimit as minuserlimit,c.coupon_maxuserlimit as maxuserlimit\n\t\t,c.coupon_realvalue,c.coupon_value,c.coupon_image,force_coupon_closed FROM coupons_coupons c left join coupons_users u  on u.userid=c.coupon_createdby where c.coupon_createdby =(select userid from coupons_users where created_by = '{$userid}' and user_role = 3)  order by c.coupon_id desc";
                    }
                }
            }
        }
    }
}
/*$pagination = new pagination();
		$pagination->createPaging($queryString,20);
		$resultSet = $pagination->resultpage;
                */
$pages = new Paginator();
$pages->mid_range = 5;
// Number of pages to display. Must be odd and > 3
$pages->paginate($queryString);
$resultSet = $pages->rspaginate;
if (mysql_num_rows($resultSet) > 0) {
    ?>

			  <div class="fl p5 ml10">
			  <strong><?php 
    echo $admin_language['note'];
    ?>
</strong> <?php 
    echo $admin_language['a-active'];
    ?>
,  <?php 
    echo $admin_language['c-closed'];
    ?>
, <?php 
Exemplo n.º 26
0
    $dynatrace = false;
    $rows = array();
    while ($row = mysql_fetch_assoc($result)) {
        $rows[] = $row;
        if ($enabledMetrics['yslow'] && !$yslow && !is_null($row['o'])) {
            $yslow = true;
        }
        if ($enabledMetrics['pagespeed'] && !$pagespeed && !is_null($row['ps_o'])) {
            $pagespeed = true;
        }
        if ($enabledMetrics['dynatrace'] && !$dynatrace && !is_null($row['dt_o'])) {
            $dynatrace = true;
        }
    }
    if ($yslow || $pagespeed || $dynatrace) {
        $pages->paginate($showslow_base . 'all.php');
        if ($pages->num_pages > 1) {
            ?>
<div class="paginator"><?php 
            echo $pages->display_pages();
            ?>
</div><?php 
        }
        ?>
<table>
<tr><th>Timestamp</th>
<?php 
        if ($yslow) {
            ?>
<th colspan="2">YSlow grade</th><?php 
        }
    function select_all($pagina, $orden)
    {
        include '../resources/paginator.class.php';
        $sql = "SELECT * FROM productos ;";
        $result = $this->database->query($sql);
        $result = $this->database->result;
        $quantity = mysql_num_rows($result);
        if ($quantity < 1) {
            echo '<div class="notify">
			<p>No hay producto 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();
            include_once "../categorias/classes/class.categorias.php";
            $sql = "SELECT * FROM productos ORDER BY {$orden} {$pages->limit};";
            $result = $this->database->query($sql);
            $result = $this->database->result;
            while ($row = mysql_fetch_array($result)) {
                $idProducto = $row['idProducto'];
                $strNombre = $row['strNombre'];
                $strDetalle = $row['strDetalle'];
                $intCategoria = $row['intCategoria'];
                $dblPrecio = $row['dblPrecio'];
                $intStock = $row['intStock'];
                $strImagen = $row['strImagen'];
                $strImagen2 = $row['strImagen2'];
                $strImagen3 = $row['strImagen3'];
                $destacado = $row['destacado'];
                //veo si requiere talles
                $categorias = new categorias();
                $categorias->select($intCategoria);
                $talles = $categorias->gettalles();
                $stock = '<p>STOCK: ' . $intStock . '</p>';
                if ($talles == 1) {
                    include_once "../talles/classes/class.talles.php";
                    $tll = new talles();
                    $talles_disp = $tll->select_all_clean();
                    foreach ($talles_disp as $id_talle_m) {
                        $talle_n = new talles();
                        $talle_n->select($id_talle_m);
                        $nombre_talle = $talle_n->getnombre_talle();
                        $id_talle_tabla = $talle_n->getid_talle();
                        include_once "classes/class.talles_productos.php";
                        $tallprod = new talles_productos();
                        $tallprod->select_by_producto($idProducto, $id_talle_m);
                        $id_talle_producto = $tallprod->getid();
                        #echo $id_talle = $tallprod->getid_talle();
                        $id_producto = $tallprod->getid_producto();
                        $cantidad = $tallprod->getcantidad();
                        if ($cantidad == "" || $cantidad == 0) {
                            $cantidad = 0;
                        } else {
                            $talles_item .= '
		
		<div class="t-bg">
		<p>' . $nombre_talle . ': ' . $cantidad . '</p>
		</div>';
                            $id_talle_m = "";
                            $stock = '';
                        }
                    }
                } else {
                    if ($talles == 2) {
                        include_once "../colores/classes/class.colores.php";
                        $tll = new colores();
                        $colores_disp = $tll->select_all_clean();
                        foreach ($colores_disp as $id_color_m) {
                            $color_n = new colores();
                            $color_n->select($id_color_m);
                            $nombre_color = $color_n->getnombre_color();
                            $id_color_tabla = $color_n->getid_color();
                            include_once "class.colores_productos.php";
                            $colprod = new colores_productos();
                            $colprod->select_by_producto($idProducto, $id_color_m);
                            $id_color_producto = $colprod->getid();
                            #echo $id_talle = $tallprod->getid_talle();
                            $id_producto = $colprod->getid_producto();
                            $cantidad = $colprod->getcantidad();
                            if ($cantidad == "") {
                                $cantidad = 0;
                            } else {
                                $talles_item .= '
			<div class="box-talle-c">
			<div class="t-bg"><p>' . $nombre_color . ':' . $cantidad . '</p></div></div>
			';
                                $id_color_m = "";
                                $stock = '';
                            }
                        }
                    } else {
                        $talles_item .= "";
                    }
                }
                $item = "";
                if ($strImagen) {
                    //////////////////////////////////////////////////////////SI ES DESTACADO LE CAMBIO EL COLOR DEL CIRCULO
                    if ($destacado == 1 or $destacado == 2 or $destacado == 3) {
                        //CON IMAGEN DESTACADO
                        $item .= '

			<div class="item-content-prod">
					   
			<div class="box-image-prod-item">
			<img src="../../images_productos/' . $strImagen . '" alt="" />
			</div>


			<div class="box-prod-item-2">

			<div class="box-prod-item-1">
			<span>													
			$' . $dblPrecio . ' 
			</span>
			</div>

			<div class="nom-desc">
			<p style="color: #646363;text-transform: uppercase;font-weight: bold;">' . $strNombre . '</p>
			<p style="color:#7A7474">' . substr($strDetalle, 0, 25) . '...</p>
			</div>
			<div class="stock-detalle">' . $stock . '</div>
			<div class="box-detalle2">
			' . $talles_item . '
			</div>

			<div class="box-btn-prod-edit">
			<p>
			<a class="btn-prod-edit" href="e_producto.php?id=' . $idProducto . '&activo=2&sub=d"><span>ADMINISTRAR</span></a>

			<a class="btn-prod-edit" href="d_producto.php?id=' . $idProducto . '&activo=2&sub=d"><span>ELIMINAR</span></a>
			</p>
			</div>
			</div>
			</div>
			';
                    } else {
                        //CON IMAGEN SIN DESTACADO
                        $item .= '

			<div class="item-content-prod">
					   
			<div class="box-image-prod-item">
			<img src="../../images_productos/' . $strImagen . '" alt="" />
			</div>


			<div class="box-prod-item-2">

			<div class="box-prod-item-1 ">
			<span>													
			$' . $dblPrecio . ' 
			</span>
			</div>

			<div class="nom-desc">
			<p style="color: #646363;text-transform: uppercase;font-weight: bold;">' . $strNombre . '</p>
			<p style="color:#7A7474">' . substr($strDetalle, 0, 25) . '...</p>
			</div>
			<div class="stock-detalle">' . $stock . '</div>
			<div class="box-detalle2">
			' . $talles_item . '
			</div>

			<div class="box-btn-prod-edit">
			<p>
			<a class="btn-prod-edit" href="e_producto.php?id=' . $idProducto . '&activo=2&sub=d"><span>ADMINISTRAR</span></a>

			<a class="btn-prod-edit" href="d_producto.php?id=' . $idProducto . '&activo=2&sub=d"><span>ELIMINAR</span></a>
			</p>
			</div>
			</div>
			</div>
			';
                    }
                } else {
                    //SIN IMAGEN
                    $item .= '

			<div class="item-content-prod">
					   
			<div class="box-image-prod-item">
			<img src="../../images_productos/default.png" alt="" />
			</div>


			<div class="box-prod-item-2">

			<div class="box-prod-item-1 ">
			<span>													
			$' . $dblPrecio . ' 
			</span>
			</div>

			<div class="nom-desc">
			<p style="color: #646363;text-transform: uppercase;font-weight: bold;">' . $strNombre . '</p>
			<p style="color:#7A7474">' . substr($strDetalle, 0, 25) . '...</p>
			</div>
			<div class="stock-detalle">' . $stock . '</div>
			<div class="box-detalle2">
			' . $talles_item . '
			</div>

			<div class="box-btn-prod-edit">
			<p>
			<a class="btn-prod-edit" href="e_producto.php?id=' . $idProducto . '&activo=2&sub=d"><span>ADMINISTRAR</span></a>

			<a class="btn-prod-edit" href="d_producto.php?id=' . $idProducto . '&activo=2&sub=d"><span>ELIMINAR</span></a>
			</p>
			</div>
			</div>
			</div>
			';
                }
                echo $item;
                //'<p></p>';
                $talles_item = "";
            }
            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>';
        }
    }
Exemplo n.º 28
0
function manage($type = '')
{
    include 'docroot.php';
    if ($type == "country") {
        $queryString = "select * from coupons_country order by countryname";
        $pages = new Paginator();
        $pages->mid_range = 5;
        // Number of pages to display. Must be odd and > 3
        $pages->paginate($queryString);
        $resultSet = $pages->rspaginate;
        if (mysql_num_rows($resultSet) > 0) {
            echo '<table cellpadding="0" cellspacing="0" class="coupon_report">';
            echo '<tr class="fwb"><td>Country Name</td><td>Manage</td>';
            echo '</tr>';
            while ($noticia = mysql_fetch_array($resultSet)) {
                echo '<tr><td width="50%">' . ucfirst(html_entity_decode($noticia['countryname'], ENT_QUOTES)) . '</td><td width="50%">';
                echo '<a href="' . $docroot . 'edit/country/' . $noticia['countryid'] . '/" class="edit_but" title="Edit" style="margin:5px 0 0 145px;"></a>';
                if ($noticia["status"] == 'D') {
                    echo '<a href="javascript:;" onclick="updatecountry(\'A\',\'' . $noticia["countryid"] . '\');" class="unblock" title="Unblock"></a>';
                } else {
                    echo '<a href="javascript:;" onclick="updatecountry(\'D\',\'' . $noticia["countryid"] . '\');" class="block" title="Block"></a>';
                }
                echo '<a href="javascript:;" onclick="javascript:deletecountry(' . $noticia["countryid"] . ');" class="delete" title="Delete"></a>';
                echo '</td></tr>';
            }
            echo '</table>';
            //pagination
            if ($pages->rspaginateTotal > 20) {
                echo '<table border="0" width="650" align="center" cellpadding="10">';
                echo '<tr><td align="center"><div class="pagenation">';
                echo $pages->display_pages();
                echo '</div></td></tr>';
                echo '</table>';
            }
        } else {
            echo '<p class="nodata">No Country Available</p>';
        }
    } else {
        if ($type == "city") {
            $queryString = "select coupons_cities.cityid, coupons_cities.cityname, coupons_cities.countryid, coupons_cities.status, coupons_country.countryname  from coupons_cities left join coupons_country on coupons_cities.countryid = coupons_country.countryid order by coupons_cities.cityname";
            $pages = new Paginator();
            $pages->mid_range = 5;
            // Number of pages to display. Must be odd and > 3
            $pages->paginate($queryString);
            $resultSet = $pages->rspaginate;
            if (mysql_num_rows($resultSet) > 0) {
                echo '<table cellpadding="5" cellspacing="5" class="coupon_report">';
                echo '<tr class="fwb"><td>City Name</td><td>Country Name</td><td>Manage</td>';
                echo '</tr>';
                while ($noticia = mysql_fetch_array($resultSet)) {
                    echo '<tr><td width="33%">' . ucfirst(html_entity_decode($noticia['cityname'], ENT_QUOTES)) . '</td><td>' . ucfirst(html_entity_decode($noticia['countryname'], ENT_QUOTES)) . '</td>';
                    echo '<td width="33%"><a href="' . $docroot . 'edit/city/' . $noticia['cityid'] . '/" class="edit_but" title="Edit" style="margin:5px 0 0 80px;"></a>';
                    if ($noticia["status"] == 'D') {
                        echo '<a href="javascript:;" onclick="updatecity(\'A\',\'' . $noticia["cityid"] . '\');" class="unblock" title="Unblock"></a>';
                    } else {
                        echo '<a href="javascript:;" onclick="updatecity(\'D\',\'' . $noticia["cityid"] . '\');" class="block" title="Block"></a>';
                    }
                    echo '<a href="javascript:;" onclick="javascript:deletecity(' . $noticia["cityid"] . ');" class="delete" title="Delete"></a>';
                    echo '</td></tr>';
                }
                echo '</table>';
                //pagination
                if ($pages->rspaginateTotal > 20) {
                    echo '<table border="0" width="650" align="center" cellpadding="10">';
                    echo '<tr><td align="center"><div class="pagenation">';
                    echo $pages->display_pages();
                    echo '</div></td></tr>';
                    echo '</table>';
                }
            } else {
                echo '<p class="nodata">No City Available</p>';
            }
        } else {
            if ($type == "subscriber") {
                //manage subscriber list
                $queryString = "select * from newsletter_subscribers left join coupons_cities on newsletter_subscribers.city_id = coupons_cities.cityid order by newsletter_subscribers.id";
                $pages = new Paginator();
                $pages->mid_range = 5;
                // Number of pages to display. Must be odd and > 3
                $pages->paginate($queryString);
                $resultSet = $pages->rspaginate;
                if (mysql_num_rows($resultSet) > 0) {
                    echo '<div style="float:left;width:770px;clear:both;"><div  class="fr p5 mr-8">
										 <a href="' . DOCROOT . 'site-admin/pages/export.php?type=' . $type . '" title="Export All">Export All</a>
										 </div></div>';
                    echo '<table cellpadding="5" cellspacing="5" class="coupon_report">';
                    echo '<tr class="fwb"><td>Email</td><td>City</td><td>Manage</td>';
                    echo '</tr>';
                    while ($noticia = mysql_fetch_array($resultSet)) {
                        echo '<tr><td width="40%">' . ucfirst(html_entity_decode($noticia['email'], ENT_QUOTES)) . '</td><td width="40%">' . ucfirst(html_entity_decode($noticia['cityname'], ENT_QUOTES)) . '</td>';
                        echo '<td width="20%"><a href="javascript:;" onclick="javascript:delete_subscriber(' . $noticia["id"] . ');" class="delete" style="margin-left:60px !important;" ></a>';
                        echo '</td></tr>';
                    }
                    echo '</table>';
                    //pagination
                    if ($pages->rspaginateTotal > 20) {
                        echo '<table border="0" width="650" align="center" cellpadding="10">';
                        echo '<tr><td align="center"><div class="pagenation">';
                        echo $pages->display_pages();
                        echo '</div></td></tr>';
                        echo '</table>';
                    }
                } else {
                    echo '<p class="nodata">No Newsletter Subscribers Available</p>';
                }
            } else {
                if ($type == "mobile-subscriber") {
                    //manage subscriber list
                    $queryString = "select * from mobile_subscribers left join coupons_cities on mobile_subscribers.city_id = coupons_cities.cityid order by mobile_subscribers.id";
                    $pages = new Paginator();
                    $pages->mid_range = 5;
                    // Number of pages to display. Must be odd and > 3
                    $pages->paginate($queryString);
                    $resultSet = $pages->rspaginate;
                    if (mysql_num_rows($resultSet) > 0) {
                        echo '<div style="float:left;width:770px;clear:both;"><div class="fr p5 mr-8">
			                                 <a href="' . DOCROOT . 'site-admin/pages/export.php?type=' . $type . '" title="' . $admin_language['exportall'] . '">Export All</a>
			                                 </div></div>';
                        echo '<table cellpadding="5" cellspacing="5" class="coupon_report">';
                        echo '<tr class="fwb"><td>Mobile No</td><td>City</td><td>Manage</td>';
                        echo '</tr>';
                        while ($noticia = mysql_fetch_array($resultSet)) {
                            echo '<tr><td>' . ucfirst(html_entity_decode($noticia['mobileno'], ENT_QUOTES)) . '</td><td>' . ucfirst(html_entity_decode($noticia['cityname'], ENT_QUOTES)) . '</td>';
                            echo '<td  width="20%"><a href="javascript:;" onclick="javascript:delete_mobile_subscriber(' . $noticia["Id"] . ');" class="delete" style="margin-left:60px !important;"></a>';
                            echo '</td></tr>';
                        }
                        echo '</table>';
                        //pagination
                        if ($pages->rspaginateTotal > 20) {
                            echo '<table border="0" width="650" align="center" cellpadding="10">';
                            echo '<tr><td align="center"><div class="pagenation">';
                            echo $pages->display_pages();
                            echo '</div></td></tr>';
                            echo '</table>';
                        }
                    } else {
                        echo '<p class="nodata">No Mobile Subscriber Available</p>';
                    }
                } else {
                    if ($type == "category") {
                        $queryString = "select * from coupons_category order by category_name";
                        $pages = new Paginator();
                        $pages->mid_range = 5;
                        // Number of pages to display. Must be odd and > 3
                        $pages->paginate($queryString);
                        $resultSet = $pages->rspaginate;
                        if (mysql_num_rows($resultSet) > 0) {
                            echo '<table cellpadding="5" cellspacing="5" class="coupon_report">';
                            echo '<tr class="fwb"><td>Category Name</td><td>Manage</td>';
                            echo '</tr>';
                            while ($noticia = mysql_fetch_array($resultSet)) {
                                echo '<tr><td width="50%">' . ucfirst(html_entity_decode($noticia['category_name'], ENT_QUOTES)) . '</td>';
                                echo '<td width="50%"><a href="' . $docroot . 'edit/category/' . $noticia['category_id'] . '/" class="edit_but" title="Edit" style="margin:5px 0 0 145px;"></a>';
                                if ($noticia["status"] == 'D') {
                                    echo '<a href="javascript:;" onclick="updatecategory(\'A\',\'' . $noticia["category_id"] . '\');" class="unblock" title="Unblock"></a>';
                                } else {
                                    echo '<a href="javascript:;" onclick="updatecategory(\'D\',\'' . $noticia["category_id"] . '\');" class="block" title="Block"></a>';
                                }
                                echo '<a href="javascript:;" onclick="javascript:deletecategory(' . $noticia["category_id"] . ');" class="delete" title="Delete"></a>';
                                echo '</td></tr>';
                            }
                            echo '</table>';
                            //pagination
                            if ($pages->rspaginateTotal > 20) {
                                echo '<table border="0" width="650" align="center" cellpadding="10">';
                                echo '<tr><td align="center"><div class="pagenation">';
                                echo $pages->display_pages();
                                echo '</div></td></tr>';
                                echo '</table>';
                            }
                        } else {
                            echo '<p class="nodata">No Category Available</p>';
                        }
                    } else {
                        if ($type == "pages") {
                            $queryString = "select * from pages order by id desc";
                            $pages = new Paginator();
                            $pages->mid_range = 5;
                            // Number of pages to display. Must be odd and > 3
                            $pages->paginate($queryString);
                            $resultSet = $pages->rspaginate;
                            if (mysql_num_rows($resultSet) > 0) {
                                ?>
		          <table cellpadding="5" cellspacing="0" class="coupon_report" border="0">
			      <tr class="fwb"><td>Title</td><td>URL</td><td>Manage</td>
			      </tr>
				  <?php 
                                while ($noticia = mysql_fetch_array($resultSet)) {
                                    ?>
					<tr><td> <?php 
                                    echo ucfirst(html_entity_decode($noticia['title'], ENT_QUOTES));
                                    ?>
</td>
					<td>
					<?php 
                                    echo DOCROOT . "pages/" . $noticia["title_url"] . ".html";
                                    ?>
					</td>
		          
   					<td width="25%"><a href="<?php 
                                    echo $docroot;
                                    ?>
edit/page/<?php 
                                    echo $noticia['id'];
                                    ?>
/" class="edit_but" title="Edit"  style="margin:5px 0 0 70px;"></a>
		          
				    <a href="javascript:;" onclick="javascript:deletepage('<?php 
                                    echo $noticia["id"];
                                    ?>
');" class="delete" title="Delete"></a>
		          		          	
					</td></tr>
			      <?php 
                                }
                                ?>
					</table>
	    
					<div class="fr mr-20 mt-10 ">	
					    
					<?php 
                                if ($pages->rspaginateTotal > 20) {
                                    echo $pages->display_pages();
                                }
                                ?>
 
					</div>
		
		<?php 
                            } else {
                                echo '<p class="nodata">No Data Available</p>';
                                //echo '<p class="nodata">No Pages Available</p>';
                            }
                        }
                    }
                }
            }
        }
    }
}
Exemplo n.º 29
0
?>
" class=" button_c">
            </p>

          </fieldset>
        </form>
		</div>

<div class="fl">
<!-- list of fund -->
<?php 
$query = "select * from request_fund where bid = '{$uid}' ";
$pages = new Paginator();
$pages->mid_range = 5;
// Number of pages to display. Must be odd and > 3
$pages->paginate($query);
$resultSet = $pages->rspaginate;
if (mysql_num_rows($resultSet) > 0) {
    ?>
	
			 <table cellpadding="10" cellspacing="0" width="650" >
			 <tr style="border:1px solid #ccc;">
			 <th style="border:1px solid #ccc;"><?php 
    echo $language['req_on'];
    ?>
n</th>
			 <th style="border:1px solid #ccc;"><?php 
    echo $language['amt'];
    ?>
(<?php 
    echo CURRENCY;
Exemplo n.º 30
0
    function select_all($pagina, $orden)
    {
        include '../resources/paginator.class.php';
        $sql = "SELECT * FROM novedades ;";
        $result = $this->database->query($sql);
        $result = $this->database->result;
        $quantity = mysql_num_rows($result);
        if ($quantity < 1) {
            echo '<div class="notify">

			<p style="margin:10px 0 0 30px;font-family:"Open sans",sans-serif",text-transform:uppercase>No hay novedad 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 novedades ORDER BY {$orden} {$pages->limit};";
            $result = $this->database->query($sql);
            $result = $this->database->result;
            while ($row = mysql_fetch_array($result)) {
                $idNovedades = $row['idNovedades'];
                $titulo = $row['titulo'];
                $cuerpo = $row['cuerpo'];
                $imagen = $row['imagen'];
                $fecha = $row['fecha'];
                if ($imagen) {
                    $item .= '

<div class="item">
<div class="olive-bar"><h4>' . $titulo . '  </h4></div>
	<div class="divideritem" style="width:25%; float:left; padding:.5em">
	<div class="nov-img">
		<img style="margin-left: 15px" src="' . BASEURLRAIZ . '../images-novedades/' . $imagen . '" alt="" width="200"/></div>
	</div>
	
	<div class="divideritem" style="width:45%;float:left;padding:.5em;">
		<p style="margin-left: 25px">' . $cuerpo . '</p>
	</div>
	
	<div class="divideritem" style="width:20%;float:left;padding:.5em">
		
	</div>
	<div class="opcionesitem">
		<a class="btn-micuenta4" href="e_novedad.php?id=' . $idNovedades . '">Editar</a>
		<a class="btn-micuenta4" href="d_novedad.php?id=' . $idNovedades . '">Borrar</a>
	</div>
</div>

';
                    //'<p></p>';
                } else {
                    $item .= '

<div class="item">
<h4>' . $titulo . '  </h4>
	<div class="divideritem" style="width:25%; float:left; padding:.5em">
		<div style="width:120px; height:120px; float:left; margin:.5em; background:#ccc;"></div>
	</div>
	
	<div class="divideritem" style="width:45%;float:left;padding:.5em">
		<p>' . $cuerpo . '</p>
	</div>
	
	<div class="divideritem" style="width:20%;float:left;padding:.5em">
		
	</div>
	<p>
		<a class="btn-micuenta4" href="e_novedad.php?id=' . $idNovedades . '">Editar</a>
		<a class="btn-micuenta4" href="d_novedad.php?id=' . $idNovedades . '">Borrar</a>
	</p>
</div>

';
                }
                //
            }
            echo $item;
            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>';
        }
    }