本文整理汇总了PHP中pagination::parameterName方法的典型用法代码示例。如果您正苦于以下问题:PHP pagination::parameterName方法的具体用法?PHP pagination::parameterName怎么用?PHP pagination::parameterName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pagination
的用法示例。
在下文中一共展示了pagination::parameterName方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pagination
return;
}
$output = $ctlView->renderRows($products, $cv_config['tpl']);
$pagination = '';
if ($cv_config['paginate'] && !$cv_config['randomize'] && $cv_config['display'] > 0) {
//pagination
require_once MODX_BASE_PATH . "assets/snippets/catalogView/classes/pagination.class.php";
$p = new pagination();
$p->nextT = $langTxt['next'];
//' <a href="[+link+]">'.$langTxt['next'].'</a> ';
$p->prevT = $langTxt['prev'];
//' <a href="[+link+]">'.$langTxt['prev'].'</a> ';
$p->numberT = ' <a href="[+link+]" class="' . $cv_config['pageClass'] . '">[+num+]</a> ';
$p->currentT = ' <b class="' . $cv_config['currentPageClass'] . '">[+num+]</b> ';
$p->prevI = '';
$p->Items($total);
$p->limit($ctlView->config['display']);
$p->target($cv_config['thisPageUrl'] . $pagesQueryString);
$p->currentPage($qs_page);
$p->parameterName($cv_config['id_prefix'] . 'page');
$p->changeClass($cv_config['pageParentClass']);
$pagination .= $p->getOutput();
$totalPages = ceil($total / $qs_display);
$ctlView->setMODxPlaceholders(array("pages" => $pagination, "totalPages" => $totalPages));
}
$ctlView->setMODxPlaceholders(array("sortBy" => $qs_sortBy, "sortDir" => $qs_sortDir, "qs_start" => $qs_start, "total" => $total, "currentPage" => $qs_page, "display" => $qs_display, "sortDirOther" => $sortDirOther, "filter" => $qs_filter, "pagesQueryString" => $pagesQueryString, "thisPageUrl" => $cv_config['thisPageUrl']));
if ($cv_config['toPlaceholder']) {
$ctlView->setMODxPlaceholders(array($cv_config['toPlaceholder'] => $output));
$output = '';
}
}
示例2: Iscritti
function Iscritti()
{
require 'pagination.class.php';
global $_POST;
global $wpdb;
$table_email = $wpdb->prefix . "nl_email";
//cancellazione provamoce
if ($_POST['delete'] && $_POST['id_email']) {
$delete = $wpdb->query("delete from {$table_email} where id_email = '{$_POST['id_email']}'");
echo '<div id="message" class="updated fade"><p><strong>' . __("Email deleted succesfully!", "sendit") . '</strong></p></div>';
//print_r($_POST);
}
//modifica provamoce
if ($_POST['update']) {
//$code = md5(uniqid(rand(), true));
$update = $wpdb->query("update {$table_email} set email = '{$_POST['email']}', magic_string='{$_POST['code']}', accepted = '{$_POST['status']}' where id_email = '{$_POST['id_email']}'");
echo '<div id="message" class="updated fade"><p><strong>' . sprintf(__('email %s edited succesfully', 'sendit'), $_POST[email]) . '</p></div>';
//print_r($_POST);
}
//aggiunta indirizzo o indirizzi email dalla textarea
if ($_POST['emails_add'] != "") {
//ver 1.1 multiaddress support
$email_add = explode("\n", $_POST['emails_add']);
foreach ($email_add as $key => $value) {
//echo $value."<br />";
//validation fix 1.5.6 (also there!) {2,4}
if (!ereg("^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})\$", trim($value))) {
echo '<div id="message" class="error"><p><strong>indirizzo email ' . $value . ' non valido!</strong></p></div>';
} else {
$user_count = $wpdb->get_var("SELECT COUNT(*) FROM {$table_email} where email ='{$value}' and id_lista = '{$_GET['lista']}' order by email;");
if ($user_count > 0) {
echo "<div class=\"error\"><p><strong>" . sprintf(__('email %s already present', 'sendit'), $value) . "</strong></p></div>";
} else {
//genero stringa univoca x conferme e cancellazioni sicure
$code = md5(uniqid(rand(), true));
$wpdb->query("INSERT INTO {$table_email} (email,id_lista, magic_string, accepted) VALUES ('{$value}', '{$_POST['id_lista']}', '{$code}', 'y')");
echo '<div class="updated fade"><p><strong>' . sprintf(__('email %s added succesfully!', 'sendit'), $value) . '</strong></p></div>';
}
}
}
//fine ciclo for
}
$email_items = $wpdb->get_var("SELECT count(*) FROM {$table_email} where id_lista= '{$_GET['lista']}'");
// number of total rows in the database
if ($email_items > 0) {
$p = new pagination();
$p->items($email_items);
$p->limit(20);
// Limit entries per page
$p->target("admin.php?page=lista-iscritti&lista=" . $_GET['lista']);
$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";
}
$emails = $wpdb->get_results("SELECT id_email, id_lista, email, subscriber_info, magic_string, accepted FROM {$table_email} where id_lista= '{$_GET['lista']}' order by email {$limit}");
//email confermat
$emails_confirmed = $wpdb->get_results("SELECT id_email, id_lista, email, subscriber_info, magic_string, accepted FROM {$table_email} where id_lista= '{$_GET['lista']}' and accepted='y'");
echo "<div class=\"wrap\"><h2>" . __('Subscribers', 'sendit') . "</h2>";
//estraggo le liste
$table_liste = $wpdb->prefix . "nl_liste";
$liste = $wpdb->get_results("SELECT id_lista, nomelista FROM {$table_liste} ");
// print_r($_POST);
echo "<div class=\"table\">\n\t\t\t<table class=\"widefat fixed\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>" . __('id', 'sendit') . "</th>\n\t\t\t\t\t\t<th class=" . $css_list . ">" . __('mailing list', 'sendit') . "</th>\n\t\t\t\t\t\t<th>" . __('actions', 'sendit') . "</th>\n\n\t\t\t\t\t</tr>\n\t\t\t\t</thead><tbody>";
foreach ($liste as $lista) {
if ($_GET['lista'] == $lista->id_lista) {
$selected = " class=\"updated fade\"";
} else {
$selected = "";
}
echo "<tr >\n \t\t<td>" . $lista->id_lista . "</td>\n \t\t<td " . $selected . "><a class=\"\" href=\"admin.php?page=lista-iscritti&lista=" . $lista->id_lista . "\">" . $lista->nomelista . "</a></td>\n \t\t<td></td><tr>";
}
echo "</tbody></table>\n </div><br clear=\"all\\ />";
/*miglioro facendo comparire la form x aggiungere solo se selezionata una lista*/
if ($_GET['lista']) {
echo "<h3>" . __('Manual Subscribe mailing list ', 'sendit') . " " . $_POST['lista'] . "</h3>\n\n <label for=\"email_add\">" . __('email address (one or more: default separator= line break)', 'sendit') . "<br />\n <div id=\"dashboard-widgets\" class=\"metabox-holder\">\n <div class='postbox-container' style='width:49%;'>\n\t\t\t\t<div id=\"normal-sortables\" class=\"meta-box-sortables\">\n\t\t\t\t<div id=\"dashboard_right_now\" class=\"postbox \" >\n\t\t\t\t\t<div class=\"handlediv\" title=\"Fare clic per cambiare.\"><br /></div>\n\t\t\t\t<h3 class='hndle'><span>" . __('Subscription', 'sendit') . "</span></h3>\n\t\t\t\t<div class=\"inside\">\n\t\t\t\t <p>" . __('Copy here one or more email address', 'sendit') . "</p>\n\n\t\t\t\t\t <form id=\"add\" name=\"add\" method=\"post\" action=\"admin.php?page=lista-iscritti&lista=" . $_GET[lista] . "\">\n\n \n <textarea id=\"emails_add\" type=\"text\" value=\"\" name=\"emails_add\" rows=\"10\" cols=\"50\"/></textarea></label>\n <input type=\"hidden\" name=\"id_lista\" value=\"" . $_GET[lista] . "\" /> \n\n <input class=\"button\" type=\"submit\" value=\"" . __('Add', 'sendit') . "\"/>\n </p>\n </form>\n </div>\n </div>\n </div>\n </div>\n </div>\n <br clear=\"all\" />";
//posiziono la paginazione
echo "<h3>" . __('Subscribers', 'sendit') . " n." . $email_items . " (" . __('Subscriptions confirmed', 'sendit') . ": " . count($emails_confirmed) . ")</h3>";
if ($p) {
echo $p->show();
}
echo "\n <br clear=\"all\" />\n\t\t\t<table class=\"widefat post fixed\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>";
if (get_option('sendit_gravatar') == 'yes') {
echo "<th style=\"width:30px !important;\"></th>";
}
echo "<th>" . __('email', 'sendit') . "</th>\n\t\t\t\t\t\t<th>" . __('status', 'sendit') . "</th>\n\t\t\t\t\t\t<th>" . __('Additional info', 'sendit') . "</th>\n\t\t\t\t\t\t<th>" . __('actions', 'sendit') . "</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n \t\n ";
foreach ($emails as $email) {
//coloro le input per distinguere tra chi ha confermato e chi no
//.........这里部分代码省略.........
示例3: pagination
$filtrar_por = false;
}
if ($ordenar_por) {
$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}";
示例4: url
//.........这里部分代码省略.........
" />
</p>
</form>
</div>
<?php
} elseif ($action == 'listcart' || $action == '') {
?>
<p> <?php
_e('The list below shows all Abandoned Carts which have remained in cart for a time higher than the "Cart abandoned cut-off time" setting.', 'woocommerce-ac');
?>
</p>
<?php
//echo plugins_url();
include_once "pagination.class.php";
/* Find the number of rows returned from a query; Note: Do NOT use a LIMIT clause in this query */
$wpdb->get_results("SELECT wpac . * , wpu.user_login, wpu.user_email \n\t\t\t\t\t FROM `" . $wpdb->prefix . "ac_abandoned_cart_history` AS wpac \n\t\t\t\t\t LEFT JOIN " . $wpdb->prefix . "users AS wpu ON wpac.user_id = wpu.id\n\t\t\t\t\t WHERE recovered_cart='0' AND unsubscribe_link='0' ");
$count = $wpdb->num_rows;
if ($count > 0) {
$p = new pagination();
$p->items($count);
$p->limit(10);
// Limit entries per page
$p->target("admin.php?page=woocommerce_ac_page&action=listcart");
if (isset($p->paging)) {
if (isset($_GET[$p->paging])) {
$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
$p->showCounter(true);
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 {
$limit = "";
}
?>
<div class="tablenav">
<div class='tablenav-pages'>
<?php
if ($count > 0) {
echo $p->show();
}
// Echo out the list of paging.
?>
</div>
</div>
<?php
$order = "";
if (isset($_GET['order'])) {
$order = $_GET['order'];
}
if ($order == "") {
示例5: wp_ulike_bbpress_likes_logs
/**
* Create WP ULike bbPress Logs page with separate pagination
*
* @author Alimir
* @since 2.2
* @return String
*/
function wp_ulike_bbpress_likes_logs()
{
global $wpdb;
$alternate = true;
$items = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "ulike_forums");
if ($items > 0) {
$p = new pagination();
$p->items($items);
$p->limit(wp_ulike_logs_return_per_page());
// Limit entries per page
$p->target("admin.php?page=wp-ulike-bbpress-logs");
$p->calculate();
// Calculates what to show
$p->parameterName('page_number');
$p->adjacents(1);
//No. of page away from the current page
if (!isset($_GET['page_number'])) {
$p->page = 1;
} else {
$p->page = $_GET['page_number'];
}
//Query for limit page_number
$limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
$get_ulike_logs = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "ulike_forums ORDER BY id DESC " . $limit . "");
?>
<div class="wrap">
<h2><?php
_e('WP ULike Logs', 'alimir');
?>
</h2>
<h3><?php
_e('Topics Likes Logs', 'alimir');
?>
</h3>
<div class="tablenav">
<div class='tablenav-pages'>
<span class="displaying-num"><?php
echo $items . ' ' . __('Logs', 'alimir');
?>
</span>
<?php
echo $p->show();
// Echo out the list of paging.
?>
</div>
</div>
<table class="widefat">
<thead>
<tr>
<th width="2%"><?php
_e('ID', 'alimir');
?>
</th>
<th width="10%"><?php
_e('Username', 'alimir');
?>
</th>
<th><?php
_e('Status', 'alimir');
?>
</th>
<th width="6%"><?php
_e('Topic ID', 'alimir');
?>
</th>
<th><?php
_e('Topic Title', 'alimir');
?>
</th>
<th width="20%"><?php
_e('Date / Time', 'alimir');
?>
</th>
<th><?php
_e('IP', 'alimir');
?>
</th>
<th><?php
_e('Actions', 'alimir');
?>
</th>
</tr>
</thead>
<tbody class="wp_ulike_logs">
<?php
foreach ($get_ulike_logs as $get_ulike_log) {
?>
<tr <?php
if ($alternate == true) {
echo 'class="alternate"';
}
?>
>
//.........这里部分代码省略.........
示例6: show_easy_gallery
function show_easy_gallery($atts, $content = null)
{
$order = 'desc';
$pagesql = '';
$limit = '';
$count = 8;
$page = true;
$page_st = true;
$theme = 'fancybox';
$view = 'album';
$album = '';
global $wpdb;
//echo "select * from easy_photos order by $order limit $limit offset $offset";
if (isset($atts['order'])) {
$order = $atts['order'];
}
if (isset($atts['theme'])) {
$theme = trim($atts['theme']);
if ($theme != 'fancybox' && $theme != 'swipebox') {
$theme = 'fancybox';
}
}
if (isset($atts['view'])) {
$view = trim($atts['view']);
if ($view != 'album' && $view != 'image') {
$view = 'album';
}
}
if (isset($atts['album'])) {
$album = trim($atts['album']);
}
if (isset($atts['limit'])) {
$count = trim($atts['limit']);
if ($count < 1) {
$count = 2;
}
}
$order = strtolower($order);
if ($order != 'asc' && $order != 'desc') {
$order = 'desc';
}
if (isset($atts['pagination'])) {
$page_st = trim($atts['pagination']);
if ($page_st != 'true' && $page_st != 'false') {
$page_st = 'true';
}
}
if ($page_st == 'true') {
$page = true;
$sql = " SELECT DISTINCT(a.album_id) FROM easy_album a,easy_photos b WHERE a.album_id=b.album_id AND a.disabled=0 AND b.disabled=0";
if ($album != '') {
$sql = $sql . " and a.album_id = {$album}";
}
if ($view == 'image') {
$sql = "select * from easy_photos where album_id not in(select album_id from easy_album b where b.disabled=1) and disabled=0";
if ($album != '') {
$sql = $sql . " and album_id = {$album}";
}
}
$rows = $wpdb->get_results($sql);
$items = count($rows);
if ($items > 0) {
$p = new pagination();
$p->items($items);
$p->limit($count);
// Limit entries per page
if ($album != '') {
$p->target(get_permalink() . '?album=' . $album);
} else {
$p->target(get_permalink());
}
//$p->urlFriendly();
if (isset($p->paging)) {
$p->currentPage($_GET[$p->paging]);
}
// Gets and validates the current page
$p->calculate();
// Calculates what to show
$p->parameterName('paging');
$p->nextLabel('');
//removing next text
$p->prevLabel('');
//removing previous text
$p->nextIcon('►');
//Changing the next icon
$p->prevIcon('◄');
//Changing the previous icon
$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 Images";
}
} else {
//.........这里部分代码省略.........
示例7: catch
} catch (PDOException $e) {
$log->logError($e . " - " . basename(__FILE__));
}
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.
*/
示例8: 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&" . $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;
示例9: count
do_action('wp_client_redirect', get_admin_url() . 'admin.php?page=wpclients' . $target_order . '&msg=d');
exit;
}
if (!class_exists('pagination')) {
include_once 'pagination.php';
}
//$items = count_users();
//$items = ( isset( $items['avail_roles']['wpc_client'] ) ) ? $items['avail_roles']['wpc_client'] : 0;
$sql = "SELECT count( a.ID ) FROM {$wpdb->users} a, {$wpdb->usermeta} b\r\n WHERE\r\n a.ID = b.user_id\r\n AND b.meta_key = '{$wpdb->prefix}capabilities'\r\n AND b.meta_value LIKE '%s:10:\"wpc_client\";%'\r\n AND a.ID NOT IN (SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = 'to_approve')\r\n {$search}\r\n {$sql_order}\r\n ";
$items = $wpdb->get_var($sql);
$p = new pagination();
$p->items($items);
$p->limit(25);
$p->target("admin.php?page=wpclients" . $target_order);
$p->calculate();
$p->parameterName('p');
$p->adjacents(2);
if (!isset($_GET['p'])) {
$p->page = 1;
} else {
$p->page = $_GET['p'];
}
$limit = " LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
$sql = "SELECT a.ID FROM {$wpdb->users} a, {$wpdb->usermeta} b\r\n WHERE\r\n a.ID = b.user_id\r\n AND b.meta_key = '{$wpdb->prefix}capabilities'\r\n AND b.meta_value LIKE '%s:10:\"wpc_client\";%'\r\n AND a.ID NOT IN (SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = 'to_approve')\r\n {$search}\r\n {$sql_order}\r\n {$limit}\r\n ";
$clients = $wpdb->get_results($sql, 'ARRAY_A');
$code = md5('wpc_client_' . get_current_user_id() . '_send_mess');
?>
<div style="" class='wrap'>
<?php
开发者ID:joffcrabtree,项目名称:wp-client-client-portals-file-upload-invoices-billing,代码行数:31,代码来源:clients.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>';
}
示例11: sc_render_manager_page
//.........这里部分代码省略.........
}
break;
case 'upload':
?>
<form action="" enctype="multipart/form-data" method="post" id ="add_track">
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="track_title">Track title:</label></th>
<td><input type="text" name="track_title" size="30" class="regular-text code"></td>
</tr>
<tr valign="top">
<th scope="row"><label for="track_file">Please specify a track:</label></th>
<td><input type="file" name="track_file" id="track_file" size="40" accept="audio/*" class="regular-text code"></td>
</tr>
<tr valign="top">
<th scope="row"><label for="track_art">Please specify track artwork:</label></th>
<td><input type="file" name="track_art" id="track_art" size="40" accept="image/*" class="regular-text code"></td>
</tr>
<tr valign="top">
<th scope="row"><label for="tag">Track tags:</label></th>
<td><input type="text" name="tag" id="tag" size="30"><input type="button" id="add_tag" name="add_tag" class="button" value="Add Tag" />
<br><ul id="tags"></ul></td>
</tr>
<tr valign="top">
<th scope="row"><label for="sharing">Track privacy:</label></th>
<td><select name="sharing">
<option value="public">Public</option>
<option value="private">Private</option>
</select></td>
</tr>
</table>
<p class="submit"><input type="submit" value="Upload" class="button-primary"></p>
</form>
<?php
try {
$tmp_file = '/tmp/' . stripslashes($_FILES['track_file']['name']);
$tmp_art_file = '/tmp/' . stripslashes($_FILES['track_art']['name']);
if (move_uploaded_file($_FILES['track_file']['tmp_name'], $tmp_file) && move_uploaded_file($_FILES['track_art']['tmp_name'], $tmp_art_file)) {
// upload audio file
$track = json_decode($client->post('tracks', array('track[title]' => $_POST['track_title'], 'track[asset_data]' => '@' . $tmp_file, 'track[artwork_data]' => '@' . $tmp_art_file, 'track[tags]' => strlen($_POST['tags']) ? $_POST['tags'] : null, 'track[sharing]' => $_POST['sharing'])));
unlink(realpath($tmp_file));
unlink(realpath($tmp_art_file));
}
} catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
var_dump($e->getMessage());
exit;
}
break;
case 'tracks':
try {
echo '</br>';
$page_size = 5;
// Pagination code
$p = new pagination();
$p->items($me['track_count']);
$p->limit($page_size);
// Limit entries per page
$p->target("admin.php?page=soundcloud-manager&tab=tracks");
$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'];
}
if ($p->page == 1) {
// get first page of tracks
$tracks = json_decode($client->get('users/' . $me['id'] . '/tracks', array('order' => 'created_at', 'limit' => $page_size)));
} else {
// get additional pages of tracks
$tracks = json_decode($client->get('users/' . $me['id'] . '/tracks', array('order' => 'created_at', 'limit' => $page_size, 'offset' => $page_size * $page)));
}
?>
<div class="tablenav">
<div class='tablenav-pages'>
<?php
echo $p->show();
?>
</div>
</div>
<?php
foreach ($tracks as $track) {
$client->setCurlOptions(array(CURLOPT_FOLLOWLOCATION => 1));
$embed_info = json_decode($client->get('oembed', array('url' => $track->permalink_url)));
// render the html for the player widget
echo $embed_info->html . '</br></br>';
}
} catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
var_dump($e->getMessage());
exit;
}
break;
}
}
示例12: array
$items = $wpdb->get_results($sql);
$items_count = $wpdb->get_results($sql_count);
$p->items($items_count[0]->count);
$p->limit($page_count);
// Limit entries per page
if (isset($_GET['s'])) {
$p->target("admin.php?page=order_details&" . $query_string);
} else {
$p->target("admin.php?page=order_details&" . $query_string);
}
if (isset($_GET['order_page'])) {
$cp = $_GET['order_page'];
} else {
$cp = 1;
}
$p->parameterName('order_page');
$p->currentPage($cp);
// Gets and validates the current page
$p->calculate();
// Calculates what to show
$p->adjacents(1);
//No. of page away from the current page
if ($items_count > 0) {
$prod_name_id_array = array();
foreach ($products as $product) {
$project = new ID_Project($product->id);
$post_id = $project->get_project_postid();
$prod_name_id_array[] = array('id' => $product->id, 'product_name' => get_the_title($post_id));
}
}
?>
开发者ID:christopherreay,项目名称:freeFreeCrowdfunding_ignitiondeck_crowdfunding,代码行数:31,代码来源:_orderDetails.php