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


PHP pagination::target方法代码示例

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


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

示例1: pagination

 function pagination()
 {
     $string = $_SERVER['REQUEST_URI'];
     $pattern = '/(&page=[0-9]+)/i';
     $replacement = '';
     $target = preg_replace('/([&?]+page=[0-9]+)/i', '', $_SERVER['REQUEST_URI']);
     $this->load->library('pagination');
     $page = new pagination();
     $page->target($target);
     $page->limit($this->paged->page_size);
     @$page->currentPage($this->paged->current_page);
     $page->Items($this->paged->total_rows);
     return $page->show();
 }
开发者ID:unisexx,项目名称:thaigcd2015,代码行数:14,代码来源:ORM.php

示例2: pagination

 public function pagination()
 {
     $string = $_SERVER["REQUEST_URI"];
     $pattern = "/(&page=[0-9]+)/i";
     $replacement = "";
     $target = preg_replace("/([&?]+page=[0-9]+)/i", "", $_SERVER["REQUEST_URI"]);
     $this->load->library("pagination");
     $page = new pagination();
     $page->target($target);
     @$page->limit($this->paged->page_size);
     @$page->currentPage($this->paged->current_page);
     @$page->Items($this->paged->total_rows);
     return $page->show();
 }
开发者ID:ultraauchz,项目名称:asean_cultural_mapping,代码行数:14,代码来源:ORM.php

示例3: showTestimonial

function showTestimonial()
{
    $x = 0;
    $data = get_option('testimonials_manager');
    $testimonialboxcount = count($data['data']);
    switch ($data['dorder']) {
        case 'random':
            shuffle($data['data']);
            break;
        case 'desc':
            $data['data'] = array_reverse($data['data']);
            ksort($data['data']);
            break;
        default:
    }
    echo <<<EOF
<style>
.clearfloat {
clear: both;
}
</style>
EOF;
    $p = new pagination();
    $p->items($testimonialboxcount);
    $p->limit($data['items']);
    if (empty($_GET['pg'])) {
        $page = 1;
    } else {
        $page = $_GET['pg'];
    }
    $p->currentPage($page);
    $p->target(get_permalink());
    $result = $p->getOutput();
    // print_r($data);
    if ($testimonialboxcount > $data['items']) {
        $testimonialboxcount = $data['items'];
        // now to make the array smaller
        $newarray = array_slice($data['data'], ($page - 1) * $data['items'], $data['items']);
        $data['data'] = $newarray;
        $testimonialboxcount = count($newarray);
    }
    if ($testimonialboxcount == 0) {
        $result .= '<div class="testimonial" style="text-align:center;">';
        $result .= '<strong>There are no testimonial yet</strong>';
        $result .= '</div>';
    } else {
        while ($x < $testimonialboxcount) {
            $url = $data['data'][$x]['url'];
            if (substr($url, 0, 7) != 'http://') {
                $url = 'http://' . $url;
            }
            $result .= '<div class="testimonial">';
            if ($data['data'][$x]['avatar']) {
                if ($data['data'][$x]['avatar'] == "gravatar") {
                    $result .= get_avatar($data['data'][$x]['email'], $size = $data['imagex']);
                } else {
                    $result .= '<img src="' . $data['data'][$x]['own_avatar'] . '" class="avatar" alt="avatar" width="' . $data['imagex'] . '" height="' . $data['imagey'] . '" />';
                }
            }
            $result .= stripslashes(nl2br($data['data'][$x]['text']));
            $result .= '<cite>' . stripslashes($data['data'][$x]['name']);
            if ($data['data'][$x]['title']) {
                $result .= ', ' . stripslashes($data['data'][$x]['title']);
            }
            if ($data['data'][$x]['company_name']) {
                $result .= '<em>' . stripslashes($data['data'][$x]['company_name']) . '</em>';
            }
            $result .= '</cite>';
            if ($data['data'][$x]['url']) {
                $result .= '<a href="' . stripslashes($url) . '">';
            }
            if ($data['data'][$x]['company']) {
                $result .= stripslashes($data['data'][$x]['company']);
            }
            if ($data['data'][$x]['url']) {
                $result .= '</a>';
            }
            $result .= '<div class="clearfloat"></div></div>';
            $x++;
        }
    }
    /*
        $s=  <<<EOF
    <style>
    .copyyy,.copyyy a {
    font-size: 10px !important;
    font-family; veranda !important;
    color: #666666 !important;
    }
    </style>
    EOF;
    * 
    */
    $result .= $p->getOutput();
    $result .= '<div class="testimonial" style="background: transparent; border:none; margin:0 0 20px 0; text-align:right;size:10px">Powered by the <a href="http://www.profitplugs.com/testimonials-manager-wordpress/" title="Testimonial Manager">Testimonial Manager Plugin for Wordpress.</a></div>';
    return $result;
}
开发者ID:pnomolos,项目名称:Testimonials-Manager,代码行数:97,代码来源:index.php

示例4: pagination

 if ($total > 0) {
     //постраничная разбивка
     $page_href = $mod_page;
     if ($search_username) {
         $page_href .= "&amp;search_username=" . $search_username;
     }
     if ($search_status) {
         $page_href .= "&amp;search_status=" . $search_status;
     }
     if ($search_date) {
         $page_href .= "&amp;search_date=" . $search_date;
     }
     $pg = new pagination();
     $pg->Items($total);
     $pg->limit($pnum);
     $pg->target($page_href);
     $pg->currentPage($page);
     $pg->nextT = ' <a href="[+link+]">' . $langTxt['next'] . '</a> ';
     $pg->prevT = ' <a href="[+link+]">' . $langTxt['prev'] . '</a> ';
     $pager = $pg->getOutput();
     //Данные заказов
     $data_query = $modx->db->query("SELECT shk.id, shk.short_txt, shk.price, shk.currency, shk.note, shk.status, shk.userid, DATE_FORMAT(shk.date,'%d.%m.%Y %k:%i') AS date, DATE_FORMAT(shk.sentdate,'%d.%m.%Y %k:%i') AS sentdate " . $data_q . $orderby_q);
     //$data_query = $modx->db->select("id, short_txt, price, currency, note, status, userid, DATE_FORMAT(date,'%d.%m.%Y %k:%i') AS date, DATE_FORMAT(sentdate,'%d.%m.%Y %k:%i') AS sentdate", $shkm->mod_table, "", "id DESC", "$start,$pnum");
     //Данные пользователей
     $userData_query = $modx->db->select("DISTINCT wu.id, wu.username", $dbprefix . "web_users wu, {$shkm->mod_table} shk", "wu.id = shk.userid", "", "");
     $users_id_list = "0";
     while ($userData = mysql_fetch_row($userData_query)) {
         $userName[$userData[0]] = $userData[1];
         $users_id_list .= "," . $userData[0];
     }
     //Число заказов пользователя
开发者ID:radist,项目名称:Shopkeeper,代码行数:31,代码来源:shopkeeper_mod.inc.php

示例5: pagination

     $ordenar_query = "&ordenar_por=" . $ordenar_por;
 }
 if ($filtrar_por) {
     $filtrar_query = "&filtrar_por=" . $filtrar_por;
 }
 $p = new pagination();
 $p->items($items);
 $p->limit(30);
 // Limit entries per page
 $p->currentPage($_GET[$p->paging]);
 // Gets and validates the current page
 // Calculates what to show
 $p->parameterName('paging');
 $p->adjacents(1);
 //No. of page away from the current page
 $p->target("tools.php?page=" . plugin_basename(dirname(__FILE__)) . "/modulo-vendas.php" . $ordenar_query . $filtrar_query);
 if (!isset($_GET['paging'])) {
     $p->page = 1;
 } else {
     $p->page = $_GET['paging'];
 }
 $p->calculate();
 //Query for limit paging
 $limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
 if ($ordenar_por) {
     $obter_vendas = "SELECT * from {$table_name} order by {$ordenar_por} asc {$limit}";
 } else {
     $obter_vendas = "SELECT * from {$table_name} order by id asc {$limit}";
 }
 if ($filtrar_por) {
     $obter_vendas = "SELECT * from {$table_name} where status='{$filtrar_por}' order by id asc {$limit}";
开发者ID:alexanmtz,项目名称:M-dulo-de-pagamento-para-wordpress,代码行数:31,代码来源:modulo-vendas.php

示例6: COUNT

$sql = $wpdb->prepare("SELECT COUNT(tes.`id`) AS counter\n\t\tFROM `" . LTW_TES_TESTIMONIALS_TABLE . "` AS tes\n\t\tLEFT JOIN `" . LTW_TES_TESTIMONIAL_GROUPS_TABLE . "` AS g ON (g.`id` = tes.`group_id`)\n\t\t" . $ltw_group_sql, array($ltw_group_sql_id));
$ltw_testimonials_count = '';
$ltw_testimonials_count = $wpdb->get_results($sql, ARRAY_A);
/**
* Get all available groups
*
*/
$sql = "SELECT `id`, `group_name`, `page_id`\n\t\tFROM `" . LTW_TES_TESTIMONIAL_GROUPS_TABLE . "`\n\t\tORDER BY `group_name` ASC";
$ltw_tes_group_info = array();
$ltw_tes_group_info = $wpdb->get_results($sql, ARRAY_A);
if ($ltw_testimonials_count[0]['counter'] > 0) {
    $p = new pagination();
    $p->items($ltw_testimonials_count[0]['counter']);
    $p->limit(15);
    // Limit entries per page
    $p->target("admin.php?page=ltw_manage_testimonials" . $ltw_group_qs);
    $p->currentPage(isset($_GET['paging']) == TRUE ? $_GET['paging'] : 0);
    // Gets and validates the current page
    $p->calculate();
    // Calculates what to show
    $p->parameterName('paging');
    $p->adjacents(1);
    //No. of page away from the current page
    if (!isset($_GET['paging'])) {
        $p->page = 1;
    } else {
        $p->page = $_GET['paging'];
    }
    //Query for limit paging
    $ltw_limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
    if (get_option('ltw_tes_sort_testimonials') == '1') {
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:31,代码来源:testimonial_index.php

示例7: get

 function get($sql = FALSE, $noSplitPage = FALSE)
 {
     $sql = $sql ? $sql : 'select ' . $this->select . ' from ' . $this->table . ' ' . $this->join . ' ' . $this->where . ' ' . $this->sort . ' ' . $this->order;
     //$sql = iconv('UTF-8','TIS-620',$sql);
     if ($noSplitPage == FALSE) {
         $this->load->library('pagination');
         $page = new pagination();
         $page->target($this->target);
         $page->limit($this->limit);
         @$page->currentPage($this->current_page);
         $rs = $this->db->PageExecute($sql, $page->limit, $page->page);
         $page->Items($rs->_maxRecordCount);
         $this->pagination = $page->show();
     } else {
         $rs = $this->db->Execute($sql);
     }
     $this->free_result();
     $data = $rs->GetArray();
     ///array_walk($data,'dbConvert');
     return $data;
 }
开发者ID:ultraauchz,项目名称:asean_cultural_mapping,代码行数:21,代码来源:MY_Model.php

示例8: pagination

 }
 echo "<div class=\"page-header\"><h1>" . _("Access Logs") . "</h1></div>";
 echo "<h6>" . _("Options") . " : <a href=\"{$website}/" . ADMIN_DIRECTORY . "/settings#/misc\">" . _("Access Settings") . "</a></h6><br/>";
 echo "<ul class=\"breadcrumb\">\n\t\t<li><a href=\"{$website}/" . ADMIN_DIRECTORY . "/settings\">" . _("Home") . "</a> <span class=\"divider\">/</span></li>\n\t\t<li class=\"active\">" . _("Access Logs") . "</li>\n\t\t</ul>";
 if (!empty($number)) {
     /*
     initializing the ip2country class for converting ip address to country.
     */
     $ip2country = new ip2country($db);
     $p = new pagination();
     $p->items($number);
     $p->limit($max_show);
     $p->currentPage($page);
     $p->parameterName("p");
     $p->urlFriendly();
     $p->target("{$website}/" . ADMIN_DIRECTORY . "/access/%");
     $from2 = $page * $max_show;
     if ($from2 > $number) {
         $diff = $number % $max_show;
         $from2 = $number;
         $from1 = $from2 - $diff;
     } else {
         $from1 = $from2 - $max_show;
     }
     echo "<table class=\"table table-condensed\">";
     echo "<thead><tr>\n\t\t\t<th>" . _("ID") . "</th>\n\t\t\t<th>" . _("IP Address") . "</th>\n\t\t\t<th>" . _("Username") . "</th>\n\t\t\t<th>" . _("Country") . "</th>\n\t\t\t<th>" . _("Access") . "</th>\n\t\t\t</tr></thead>";
     /*
     loading all the tags data in arrays.
     */
     while ($row = $q_do->fetch(PDO::FETCH_ASSOC)) {
         $idarr[] = intval($row['id']);
开发者ID:Abysmal,项目名称:AuthManager,代码行数:31,代码来源:access.php

示例9: DataGrid

    $numRecords = $modx->db->getRecordCount($items_result);
    if ($numRecords) {
        $grd = new DataGrid('', $items_result);
        $grd->noRecordMsg = 'Нет заявок.';
        $grd->pageSize = $page_num;
        $grd->pagerLocation = 'bottom-left';
        $grd->cssClass = "grid";
        $grd->columnHeaderClass = "gridHeader";
        $grd->itemClass = "gridItem";
        $grd->altItemClass = "gridAltItem";
        $grd->columns = "ID,Наименование,Цена,Действия";
        $grd->colTypes = '
        ||template:<br /><a href="index.php?a=27&amp;update=[+id+]&amp;id=[+parent+]&amp;pid=[+parent+]&amp;to_shk=1" onclick="$.fn.colorbox.init();$.fn.colorbox($.extend(colorBoxOpt,{href:\'index.php?a=27&amp;update=[+id+]&amp;id=[+parent+]&amp;pid=[+parent+]&amp;to_shk=1\'})); return false;">[+pagetitle+]</a>
        ||template:<input type="hidden" name="prod_id[]" value="[+id+]" /> <input type="text" name="price[]" size="12" value="[+price+]" />
        ||template:<a href="#" title="' . $langTxt['delete'] . '" onclick="if(confirm(\'' . $langTxt['confirm'] . '\')){postForm(\'delete_item\',\'[+id+]\',null);}return false;"><img src="' . SHOPKEEPER_PATH . 'style/default/img/m_delete.gif" /></a>
        ';
        $grd->colWidths = "10%,50%,20%,20%";
        $grd->fields = "id,pagetitle,price";
        $data_table = $grd->render();
        //pagination
        $p = new pagination();
        $p->Items($total);
        $p->limit($page_num);
        $p->target($catalog_mod_page);
        $p->currentPage($curPage);
        $p->nextT = ' <a href="[+link+]">' . $langTxt['next'] . '</a> ';
        $p->prevT = ' <a href="[+link+]">' . $langTxt['prev'] . '</a> ';
        $pagination = $p->getOutput();
    }
}
include "templates/catalog.tpl.php";
开发者ID:radist,项目名称:Shopkeeper,代码行数:31,代码来源:catalog.inc.php

示例10: list_voucher_display_settings

function list_voucher_display_settings()
{
    global $wpdb;
    $sql = 'SELECT COUNT(*) FROM wp_voucher_post';
    $items = $wpdb->get_var($sql);
    //  $items = mysql_num_rows(mysql_query("SELECT * FROM wp_voucher_post")); // number of total rows in the database
    if ($items > 0) {
        $p = new pagination();
        $p->items($items);
        $p->limit(500);
        // Limit entries per page
        $p->target("admin.php?page=list_voucher_settings");
        $p->currentPage($_GET[$p->paging]);
        // Gets and validates the current page
        $p->calculate();
        // Calculates what to show
        $p->parameterName('paging');
        $p->adjacents(1);
        //No. of page away from the current page
        if (!isset($_GET['paging'])) {
            $p->page = 1;
        } else {
            $p->page = $_GET['paging'];
        }
        //Query for limit paging
        $limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
    } else {
        echo "No Record Found";
    }
    echo '<div class="wrap">
	<h2>List of Records</h2>
 
	<div class="tablenav">
		<div class="tablenav-pages">';
    echo $p->show();
    echo '</div>
	</div>
 
	<table class="widefat">
		<thead>
			 <tr>
				 <th><strong>ID</strong></th>
				 <th><strong>Người nhận</strong></th>
				 <th><strong>Email</strong></th>
                 <th><strong>Điện thoại</strong></th>
                 <th><strong>Tên voucher</strong></th>
                 <th><strong>Số lượng</strong></th>
			 </tr>
		</thead>
		<tbody>';
    $sql = "SELECT * FROM wp_voucher_post, wp_posts where wp_voucher_post.post_id = wp_posts.id ORDER BY wp_voucher_post.id DESC {$limit}";
    $result = $wpdb->get_results($sql) or die('Error, query failed');
    foreach ($result as $value) {
        echo '<tr>
				<td>' . $value->post_id . '</td>
				<td>' . $value->fullname . '</td>
				<td>' . $value->email . '</td>
                <td>' . $value->phone . '</td>
                <td>' . $value->post_title . '</td>
                <td>' . $value->total . '</td>
			</tr>';
    }
    echo '</tbody>
	</table>
</div>';
}
开发者ID:vanlong200880,项目名称:tmdt,代码行数:66,代码来源:voucher.php

示例11: ceil

/*echo "<pre>******";
print_r($row);
echo "*****</pre>";*/
if ($pagination_count > 0) {
    //get current page
    $this_page = $_GET['p'] && $_GET['p'] > 0 ? (int) $_GET['p'] : 1;
    //Records per page
    $per_page = 10;
    //Total Page
    $total_page = ceil($pagination_count / $per_page);
    //initiate the pagination variable
    $pag = new pagination();
    //Set the pagination variable values
    $pag->Items($pagination_count);
    $pag->limit($per_page);
    $pag->target("admin.php?page=withdraw-event-notification/withdraw-event-notification.php");
    $pag->currentPage($this_page);
    //Done with the pagination
    //Now get the entries
    //But before that a little anomaly checking
    $list_start = ($this_page - 1) * $per_page;
    if ($list_start >= $pagination_count) {
        //Start of the list should be less than pagination count
        $list_start = $pagination_count - $per_page;
    }
    if ($list_start < 0) {
        //list start cannot be negative
        $list_start = 0;
    }
    $list_end = $this_page * $per_page - 1;
    //Get the data from the database
开发者ID:nagyistoce,项目名称:krunalsojitra-wp-themes,代码行数:31,代码来源:withdraw-event-notification.php

示例12: strnatcasecmp

usort($students, create_function('$a, $b', 'return strnatcasecmp(Idp_Admin::getUserDisplayName($a), Idp_Admin::getUserDisplayName($b));'));
$pagination_count = Idp_Main::getBuildings(true, 0, 1844674407371, $statusFilter, $district_id_filter);
if ($pagination_count > 0) {
    //get current page
    $this_page = isset($_GET['p']) && $_GET['p'] > 0 ? (int) $_GET['p'] : 1;
    //Records per page
    $per_page = getPerPage();
    //Total Page
    $total_page = ceil($pagination_count / $per_page);
    //initiate the pagination variable
    $pag = new pagination();
    //Set the pagination variable values
    $pag->Items($pagination_count);
    $pag->limit($per_page);
    $admin_url = admin_url('admin.php?page=idp-plugin%2Fadmin%2Fidp-admin-manage-buildings.php', 'http');
    $pag->target($admin_url);
    $pag->currentPage($this_page);
    //Done with the pagination
    //Now get the entries
    //But before that a little anomaly checking
    $list_start = ($this_page - 1) * $per_page;
    if ($list_start >= $pagination_count) {
        //Start of the list should be less than pagination count
        $list_start = $pagination_count - $per_page;
    }
    if ($list_start < 0) {
        //list start cannot be negative
        $list_start = 0;
    }
    $list_end = $this_page * $per_page - 1;
    $buildings = Idp_Main::getBuildings(false, $list_start, $per_page, $statusFilter, $district_id_filter);
开发者ID:IDP-EUD,项目名称:idp-plugin,代码行数:31,代码来源:idp-admin-manage-buildings.php

示例13: pagination

 echo "<div class=\"page-header\"><h1>" . _("Manage Users") . "</h1></div>";
 echo "<h6>" . _("Options") . " : <a href=\"{$website}/" . ADMIN_DIRECTORY . "/add-user\">" . _("Add User") . "</a></h6><br/>";
 echo "<ul class=\"breadcrumb\">\n\t\t<li><a href=\"{$website}/" . ADMIN_DIRECTORY . "/settings\">" . _("Home") . "</a> <span class=\"divider\">/</span></li>\n\t\t<li class=\"active\">" . _("Users") . "</li>\n\t\t</ul>";
 /*
 this is the photo management panel offering different options.
 */
 echo "<form class=\"well form-inline\" method=\"POST\" action=\"{$current_address}\" name=\"modify-form\">\n\t\t<div>&nbsp;<input type=\"checkbox\" name=\"checkall\" onclick=\"checkUncheckAll(this);\" />&nbsp;&nbsp;<select name=\"content_selector_2\"><option value=\"select\">-- " . _("select") . " --</option>";
 echo "<option value=\"xx\">&rarr; " . _("Delete users") . "</option></select>&nbsp;&nbsp;<input type=\"submit\" name=\"modifyphotos\" class=\"btn\" value=\"" . _("Apply") . "\" /></div><br/>{$err}";
 if (!empty($number)) {
     $p = new pagination();
     $p->items($number);
     $p->limit($max_show);
     $p->currentPage($page);
     $p->parameterName("p");
     $p->urlFriendly();
     $p->target("{$website}/" . ADMIN_DIRECTORY . "/users/%");
     $from2 = $page * $max_show;
     if ($from2 > $number) {
         $diff = $number % $max_show;
         $from2 = $number;
         $from1 = $from2 - $diff;
     } else {
         $from1 = $from2 - $max_show;
     }
     echo "<table class=\"table table-condensed\">";
     echo "<thead><tr><th></th>\n\t\t\t<th>" . _("ID") . "</th>\n\t\t\t<th>" . _("Name") . "</th>\n\t\t\t<th>" . _("Verified") . "</th>\n\t\t\t<th>" . _("Email") . "</th>\n\t\t\t<th>" . _("Facebook ID") . "</th>\n\t\t\t<th>" . _("Last Access") . "</th>\n\t\t\t</tr></thead>";
     echo "<tbody>";
     /*
     loading all the tags data in arrays.
     */
     while ($row = $q_do->fetch(PDO::FETCH_ASSOC)) {
开发者ID:Abysmal,项目名称:AuthManager,代码行数:31,代码来源:users.php

示例14: elseif

    echo "{$aux['total']} Resultado" . ($aux['total'] > 1 ? 's' : '') . " que coinciden con tu b&uacute;squeda \"<strong>{$busqueda}</strong>\".";
} elseif ($aux['total'] and !isset($q)) {
    echo "Total de registros: {$aux['total']}";
} elseif (!$aux['total'] and isset($q)) {
    echo htmlentities($c) . "No hay registros que coincidan con tu b&uacute;squeda \"<strong>{$busqueda}</strong>\"";
}
?>
</p>

	<?php 
if ($aux['total'] > 0) {
    $p = new pagination();
    $p->Items($aux['total']);
    $p->limit($items);
    if (isset($q)) {
        $p->target("alumnoBusqueda.php?q=" . urlencode($q));
    } else {
        $p->target("alumnoBusqueda.php");
    }
    $p->currentPage($page);
    $p->show();
    $sql = $sqlStr . $limit;
    $rs_list = $cn->query($sql);
    $row_list = $rs_list->num_rows;
    echo '
        <table class="bordered">

        <tr>
            <th>IDalumno</th>
            <th>Nombre</th>
            <th>DNI</th>
开发者ID:chungote,项目名称:sistema-uni,代码行数:31,代码来源:alumnogetBuscar.php

示例15: in

            $output_list = '';
            $status_list = $upconf['action'] == 'archorders' ? '4,5' : '1,2,3,6';
            $total = $modx->db->getValue($modx->db->select("COUNT(*)", $mod_table, "userid = '{$userId}' AND status in({$status_list})"));
            //pagination
            $pages = '';
            $qs_page = !empty($_GET[$upconf['id_prefix'] . 'page']) && is_numeric($_GET[$upconf['id_prefix'] . 'page']) ? $modx->db->escape($_GET[$upconf['id_prefix'] . 'page']) : 1;
            $qs_start = !empty($_GET[$upconf['id_prefix'] . 'start']) && !is_array($_GET[$upconf['id_prefix'] . 'start']) ? $_GET[$upconf['id_prefix'] . 'start'] : $qs_page * $upconf['display'] - $upconf['display'];
            $p = new pagination();
            $p->nextT = ' <a href="[+link+]">' . $langTxt['next'] . '</a> ';
            $p->prevT = ' <a href="[+link+]">' . $langTxt['prev'] . '</a> ';
            $p->numberT = ' <a href="[+link+]">[+num+]</a> ';
            $p->currentT = ' <b>[+num+]</b> ';
            //' <a class="current" href="[+link+]">[+num+]</a> ';
            $p->prevI = '';
            $p->Items($total);
            $p->limit($upconf['display']);
            $p->target($upconf['thisPage'] . $upconf['qs'] . $upconf['id_prefix'] . "act=purchase&amp;" . $upconf['id_prefix'] . "sub=" . $upconf['action']);
            $p->currentPage($qs_page);
            $p->parameterName($upconf['id_prefix'] . 'page');
            $pages .= $p->getOutput();
            $totalPages = ceil($orders_total_count / $upconf['display']);
            //orders
            $output_list = $shk_uprofile->getOrderList($userId, $list_chunk, $qs_start, $status_list);
            $shk_uprofile->phx->placeholders = array();
            $shk_uprofile->setPlaceholders(array('notempty' => $total > 0 ? 'true' : '', 'title' => $title, 'list' => $output_list, 'pages' => $pages, 'totalPages' => $totalPages));
            $output .= $shk_uprofile->phx->Parse($chunk[0] . '[+list+]' . $chunk[2]);
            $output = $shk_uprofile->cleanPHx($output);
        }
        break;
}
return $output;
开发者ID:radist,项目名称:Shopkeeper,代码行数:31,代码来源:shk_userprofile.inc.php


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