本文整理汇总了PHP中Pagenate::getStart方法的典型用法代码示例。如果您正苦于以下问题:PHP Pagenate::getStart方法的具体用法?PHP Pagenate::getStart怎么用?PHP Pagenate::getStart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pagenate
的用法示例。
在下文中一共展示了Pagenate::getStart方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: strtolower
$order = $orderWays[strtoupper($_REQUEST['order'])];
}
$order = $order ? $order : 'ASC';
if ($order_column && strpos($order_column, ',')) {
$order_column = str_replace(',', " {$order},", $order_column);
}
$x = $sort . '_sort';
${$x} = ' class="' . strtolower($order) . '" ';
$order_by = "{$order_column} {$order} ";
$total = db_count('SELECT count(DISTINCT staff.staff_id) ' . $from . ' ' . $where);
$page = $_GET['p'] && is_numeric($_GET['p']) ? $_GET['p'] : 1;
$pageNav = new Pagenate($total, $page, PAGE_LIMIT);
$pageNav->setURL('staff.php', $qstr . '&sort=' . urlencode($_REQUEST['sort']) . '&order=' . urlencode($_REQUEST['order']));
//Ok..lets roll...create the actual query
$qstr .= '&order=' . ($order == 'DESC' ? 'ASC' : 'DESC');
$query = "{$select} {$from} {$where} GROUP BY staff.staff_id ORDER BY {$order_by} LIMIT " . $pageNav->getStart() . "," . $pageNav->getLimit();
//echo $query;
?>
<h2>Staff Members</h2>
<div style="width:700px; float:left;">
<form action="staff.php" method="GET" name="filter">
<input type="hidden" name="a" value="filter" >
<select name="did" id="did">
<option value="0">— All Departments —</option>
<?php
$sql = 'SELECT dept.dept_id, dept.dept_name,count(staff.staff_id) as users ' . 'FROM ' . DEPT_TABLE . ' dept ' . 'INNER JOIN ' . STAFF_TABLE . ' staff ON(staff.dept_id=dept.dept_id) ' . 'GROUP By dept.dept_id HAVING users>0 ORDER BY dept_name';
if (($res = db_query($sql)) && db_num_rows($res)) {
while (list($id, $name, $users) = db_fetch_row($res)) {
$sel = $_REQUEST['did'] && $_REQUEST['did'] == $id ? 'selected="selected"' : '';
echo sprintf('<option value="%d" %s>%s (%s)</option>', $id, $sel, $name, $users);
}
示例2: __
echo __('List Name');
?>
</th>
<th><?php
echo __('Created');
?>
</th>
<th><?php
echo __('Last Updated');
?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach (DynamicList::objects()->order_by('-type', 'name')->limit($pageNav->getLimit())->offset($pageNav->getStart()) as $list) {
$sel = false;
if ($ids && in_array($form->get('id'), $ids)) {
$sel = true;
}
?>
<tr>
<td>
<?php
if ($list->isDeleteable()) {
?>
<input width="7" type="checkbox" class="ckb" name="ids[]"
value="<?php
echo $list->getId();
?>
"
示例3: strtolower
if ($_REQUEST['order'] && $orderWays[strtoupper($_REQUEST['order'])]) {
$order = $orderWays[strtoupper($_REQUEST['order'])];
}
$order = $order ? $order : 'ASC';
if ($order_column && strpos($order_column, ',')) {
$order_column = str_replace(',', " {$order},", $order_column);
}
$x = $sort . '_sort';
${$x} = ' class="' . strtolower($order) . '" ';
$order_by = "{$order_column} {$order} ";
$total = db_count('SELECT count(DISTINCT rule.id) ' . $from . ' ' . $where);
$page = $_GET['p'] && is_numeric($_GET['p']) ? $_GET['p'] : 1;
$pageNav = new Pagenate($total, $page, PAGE_LIMIT);
$pageNav->setURL('banlist.php', $qstr . '&sort=' . urlencode($_REQUEST['sort']) . '&order=' . urlencode($_REQUEST['order']));
$qstr .= '&order=' . ($order == 'DESC' ? 'ASC' : 'DESC');
$query = "{$select} {$from} {$where} ORDER BY {$order_by} LIMIT " . $pageNav->getStart() . "," . $pageNav->getLimit();
//echo $query;
?>
<h2>Banned Email Addresses</h2>
<div style="width:600; float:left;padding-top:5px;">
<form action="banlist.php" method="GET" name="filter">
<input type="hidden" name="a" value="filter" >
<div>
Query: <input name="q" type="text" size="20" value="<?php
echo Format::htmlchars($_REQUEST['q']);
?>
">
<input type="submit" name="submit" value="Search"/>
</div>
</form>
示例4: strtolower
$order = $orderWays[strtoupper($_REQUEST['order'])];
}
$order = $order ? $order : 'ASC';
if ($order_column && strpos($order_column, ',')) {
$order_column = str_replace(',', " {$order},", $order_column);
}
$x = $sort . '_sort';
${$x} = ' class="' . strtolower($order) . '" ';
$order_by = "{$order_column} {$order} ";
$total = db_count('SELECT count(*) FROM ' . TOPIC_TABLE . ' topic ');
$page = $_GET['p'] && is_numeric($_GET['p']) ? $_GET['p'] : 1;
$pageNav = new Pagenate($total, $page, PAGE_LIMIT);
$pageNav->setURL('helptopics.php', $qstr . '&sort=' . urlencode($_REQUEST['sort']) . '&order=' . urlencode($_REQUEST['order']));
//Ok..lets roll...create the actual query
$qstr .= '&order=' . ($order == 'DESC' ? 'ASC' : 'DESC');
$query = "{$sql} GROUP BY topic.topic_id ORDER BY {$order_by} LIMIT " . $pageNav->getStart() . "," . $pageNav->getLimit();
$res = db_query($query);
if ($res && ($num = db_num_rows($res))) {
$showing = $pageNav->showing() . ' help topics';
} else {
$showing = 'No help topic found!';
}
?>
<div style="width:700px;padding-top:5px; float:left;">
<h2>Help Topics</h2>
</div>
<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;">
<b><a href="helptopics.php?a=add" class="Icon newHelpTopic">Add New Help Topic</a></b></div>
<div class="clear"></div>
<form action="helptopics.php" method="POST" name="topics">
<?php
示例5: count
$order=$order?$order:'ASC';
if($order_column && strpos($order_column,',')){
$order_column=str_replace(','," $order,",$order_column);
}
$x=$sort.'_sort';
$$x=' class="'.strtolower($order).'" ';
$order_by="$order_column $order ";
$total=db_count('SELECT count(*) FROM '.FAQ_CATEGORY_TABLE.' cat ');
$page=($_GET['p'] && is_numeric($_GET['p']))?$_GET['p']:1;
$pageNav=new Pagenate($total, $page, PAGE_LIMIT);
$qs += array('sort' => $_REQUEST['sort'], 'order' => $_REQUEST['order']);
$pageNav->setURL('categories.php', $qs);
$qstr = '&order='.($order=='DESC'?'ASC':'DESC');
$query="$sql GROUP BY cat.category_id ORDER BY $order_by LIMIT ".$pageNav->getStart().",".$pageNav->getLimit();
$res=db_query($query);
if($res && ($num=db_num_rows($res)))
$showing=$pageNav->showing().' '.__('categories');
else
$showing=__('No FAQ categories found!');
?>
<div class="pull-left" style="width:700px;padding-top:5px;">
<h2><?php echo __('FAQ Categories');?></h2>
</div>
<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;">
<b><a href="categories.php?a=add" class="Icon newCategory"><?php echo __('Add New Category');?></a></b></div>
<div class="clear"></div>
<form action="categories.php" method="POST" name="cat">
<?php csrf_token(); ?>
示例6: __
$order = $order ? $order : 'ASC';
if ($order_column && strpos($order_column, ',')) {
$order_column = str_replace(',', " {$order},", $order_column);
}
$x = $sort . '_sort';
${$x} = ' class="' . strtolower($order) . '" ';
$order_by = "{$order_column} {$order} ";
$total = db_count('SELECT count(*) FROM ' . CANNED_TABLE . ' canned ');
$page = $_GET['p'] && is_numeric($_GET['p']) ? $_GET['p'] : 1;
$pageNav = new Pagenate($total, $page, PAGE_LIMIT);
$qstr = '&' . Http::build_query($qs);
$qs += array('sort' => $_REQUEST['sort'], 'order' => $_REQUEST['order']);
$pageNav->setURL('canned.php', $qs);
//Ok..lets roll...create the actual query
$qstr .= '&order=' . ($order == 'DESC' ? 'ASC' : 'DESC');
$query = "{$sql} GROUP BY canned.canned_id ORDER BY {$order_by} LIMIT " . $pageNav->getStart() . "," . $pageNav->getLimit();
$res = db_query($query);
if ($res && ($num = db_num_rows($res))) {
$showing = $pageNav->showing() . ' ' . _N('premade response', 'premade responses', $total);
} else {
$showing = __('No premade responses found!');
}
?>
<div class="pull-left" style="width:700px;padding-top:5px;">
<h2><?php
echo __('Canned Responses');
?>
</h2>
</div>
<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;">
<b><a href="canned.php?a=add" class="Icon newReply"><?php
示例7: count
$order=$order?$order:'ASC';
if($order_column && strpos($order_column,',')){
$order_column=str_replace(','," $order,",$order_column);
}
$x=$sort.'_sort';
$$x=' class="'.strtolower($order).'" ';
$order_by="$order_column $order ";
$total=db_count('SELECT count(*) FROM '.PAGE_TABLE.' page '.$where);
$page=($_GET['p'] && is_numeric($_GET['p']))?$_GET['p']:1;
$pageNav=new Pagenate($total, $page, PAGE_LIMIT);
$pageNav->setURL('pages.php',$qstr.'&sort='.urlencode($_REQUEST['sort']).'&order='.urlencode($_REQUEST['order']));
//Ok..lets roll...create the actual query
$qstr.='&order='.($order=='DESC'?'ASC':'DESC');
$query="$sql $where GROUP BY page.id ORDER BY $order_by LIMIT ".$pageNav->getStart().",".$pageNav->getLimit();
$res=db_query($query);
if($res && ($num=db_num_rows($res)))
$showing=$pageNav->showing()._N('site page','site pages', $num);
else
$showing=__('No pages found!');
?>
<div class="pull-left" style="width:700px;padding-top:5px;">
<h2><?php echo __('Site Pages'); ?>
<i class="help-tip icon-question-sign" href="#site_pages"></i>
</h2>
</div>
<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;">
<b><a href="pages.php?a=add" class="Icon newPage"><?php echo __('Add New Page'); ?></a></b></div>
示例8: strtolower
if ($order_column && strpos($order_column, ',')) {
$order_column = str_replace(',', " {$order},", $order_column);
}
$x = $sort . '_sort';
${$x} = ' class="' . strtolower($order) . '" ';
$order_by = "{$order_column} {$order} ";
$total = db_count('SELECT count(*) FROM ' . EMAIL_TABLE . ' email ');
$pagelimit = $thisstaff->getPageLimit();
$pagelimit = $pagelimit ? $pagelimit : PAGE_LIMIT;
//true default...if all fails.
$page = $_GET['p'] && is_numeric($_GET['p']) ? $_GET['p'] : 1;
$pageNav = new Pagenate($total, $page, $pagelimit);
$pageNav->setURL('emails.php', $qstr . '&sort=' . urlencode($_REQUEST['sort']) . '&order=' . urlencode($_REQUEST['order']));
//Ok..lets roll...create the actual query
$qstr .= '&order=' . ($order == 'DESC' ? 'ASC' : 'DESC');
$query = "{$sql} GROUP BY email.email_id ORDER BY {$order_by} LIMIT " . $pageNav->getStart() . "," . $pageNav->getLimit();
$res = db_query($query);
if ($res && ($num = db_num_rows($res))) {
$showing = $pageNav->showing() . ' emails';
} else {
$showing = 'No emails found!';
}
?>
<div style="width:700;padding-top:5px; float:left;">
<h2>Email Addresses</h2>
</div>
<div style="float:right;text-align:right;padding-top:5px;padding-right:5px;">
<b><a href="emails.php?a=add" class="Icon newEmail">Add New Email</a></b></div>
<div class="clear"></div>
<form action="emails.php" method="POST" name="emails" onSubmit="return checkbox_checker(this,1,0);">
<input type="hidden" name="do" value="mass_process" >
示例9: count
$order=$order?$order:'ASC';
if($order_column && strpos($order_column,',')){
$order_column=str_replace(','," $order,",$order_column);
}
$x=$sort.'_sort';
$$x=' class="'.strtolower($order).'" ';
$order_by="$order_column $order ";
$total=db_count('SELECT count(*) FROM '.EMAIL_TABLE.' email ');
$page=($_GET['p'] && is_numeric($_GET['p']))?$_GET['p']:1;
$pageNav=new Pagenate($total, $page, PAGE_LIMIT);
$qs += array('sort' => $_REQUEST['sort'], 'order' => $_REQUEST['order']);
$pageNav->setURL('emails.php', $qs);
$qstr = '&order='.($order=='DESC' ? 'ASC' : 'DESC');
$query="$sql GROUP BY email.email_id ORDER BY $order_by LIMIT ".$pageNav->getStart().",".$pageNav->getLimit();
$res=db_query($query);
if($res && ($num=db_num_rows($res)))
$showing=$pageNav->showing().' '.__('emails');
else
$showing=__('No emails found!');
$def_dept_id = $cfg->getDefaultDeptId();
$def_dept_name = $cfg->getDefaultDept()->getName();
$def_priority = $cfg->getDefaultPriority()->getDesc();
?>
<div class="pull-left" style="width:700px;padding-top:5px;">
<h2><?php echo __('Email Addresses');?></h2>
</div>
<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;">
示例10: __
}
$order = $order ? $order : 'ASC';
if ($order_column && strpos($order_column, ',')) {
$order_column = str_replace(',', " {$order},", $order_column);
}
$x = $sort . '_sort';
${$x} = ' class="' . strtolower($order) . '" ';
$order_by = "{$order_column} {$order} ";
$total = db_count('SELECT count(*) FROM ' . PAGE_TABLE . ' page ' . $where);
$page = $_GET['p'] && is_numeric($_GET['p']) ? $_GET['p'] : 1;
$pageNav = new Pagenate($total, $page, PAGE_LIMIT);
$qstr = '&' . Http::build_query($qs);
$qs += array('sort' => $_REQUEST['sort'], 'order' => $_REQUEST['order']);
$pageNav->setURL('pages.php', $qs);
$qstr .= '&order=' . ($order == 'DESC' ? 'ASC' : 'DESC');
$query = "{$sql} {$where} GROUP BY page.id ORDER BY {$order_by} LIMIT " . $pageNav->getStart() . "," . $pageNav->getLimit();
$res = db_query($query);
if ($res && ($num = db_num_rows($res))) {
$showing = $pageNav->showing() . _N('site page', 'site pages', $num);
} else {
$showing = __('No pages found!');
}
?>
<div class="pull-left" style="width:700px;padding-top:5px;">
<h2><?php
echo __('Site Pages');
?>
<i class="help-tip icon-question-sign" href="#site_pages"></i>
</h2>
</div>
示例11: __
<thead>
<tr>
<th width="7"> </th>
<th><?php
echo __('Custom Forms');
?>
</th>
<th><?php
echo __('Last Updated');
?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach (DynamicForm::objects()->filter(array('type' => 'G'))->order_by('title')->limit($pageNav->getLimit())->offset($pageNav->getStart()) as $form) {
$sel = false;
if ($ids && in_array($form->get('id'), $ids)) {
$sel = true;
}
?>
<tr>
<td><?php
if ($form->isDeletable()) {
?>
<input type="checkbox" class="ckb" name="ids[]" value="<?php
echo $form->get('id');
?>
"
<?php
echo $sel ? 'checked="checked"' : '';
示例12: urlencode
}
if ($endTime) {
$qwhere .= ' AND created<=FROM_UNIXTIME(' . $endTime . ')';
$qstr .= '&endDate=' . urlencode($_REQUEST['endDate']);
}
}
$qselect = 'SELECT log.* ';
$qfrom = ' FROM ' . SYSLOG_TABLE . ' log ';
//get log count based on the query so far..
$total = db_count("SELECT count(*) {$qfrom} {$qwhere}");
$pagelimit = 30;
$page = $_GET['p'] && is_numeric($_GET['p']) ? $_GET['p'] : 1;
//pagenate
$pageNav = new Pagenate($total, $page, $pagelimit, $trl);
$pageNav->setURL('admin.php', $qstr);
$query = "{$qselect} {$qfrom} {$qwhere} ORDER BY log.created DESC LIMIT " . $pageNav->getStart() . "," . $pageNav->getLimit();
//echo $query;
$result = db_query($query);
$showing = db_num_rows($resp) ? $pageNav->showing() : "";
?>
<div class="msg">System Logs</div>
<div id='filter' >
<form action="admin.php?t=syslog" method="get">
<input type="hidden" name="t" value="syslog" />
<div style="padding-left:15px;">
Date Span:
From <input id="sd" size=15 name="startDate" value="<?php
echo Format::htmlchars($_REQUEST['startDate']);
?>
"
onclick="event.cancelBubble=true;calendar(this);" autocomplete=OFF>
示例13: count
$order_column=str_replace(','," $order,",$order_column);
}
$x=$sort.'_sort';
$$x=' class="'.strtolower($order).'" ';
$order_by="$order_column $order ";
$total=db_count('SELECT count(*) FROM '.SLA_TABLE.' sla ');
$page=($_GET['p'] && is_numeric($_GET['p']))?$_GET['p']:1;
$pageNav=new Pagenate($total, $page, PAGE_LIMIT);
$qstr = '&'. Http::build_query($qs);
$qs += array('sort' => $_REQUEST['sort'], 'order' => $_REQUEST['order']);
$pageNav->setURL('slas.php', $qs);
//Ok..lets roll...create the actual query
$qstr .= '&order='.($order=='DESC' ? 'ASC' : 'DESC');
$query="$sql ORDER BY $order_by LIMIT ".$pageNav->getStart().",".$pageNav->getLimit();
$res=db_query($query);
if($res && ($num=db_num_rows($res)))
$showing=$pageNav->showing().' '._N('SLA plan',
'SLA plans' /* SLA is abbreviation for Service Level Agreement */,
$total);
else
$showing=__('No SLA plans found!' /* SLA is abbreviation for Service Level Agreement */);
?>
<div class="pull-left" style="width:700px;padding-top:5px;">
<h2><?php echo __('Service Level Agreements');?></h2>
</div>
<div class="pull-right flush-right" style="padding-top:5px;padding-right:5px;">
<b><a href="slas.php?a=add" class="Icon newsla"><?php echo __('Add New SLA Plan');?></a></b></div>
示例14: mysqli
<?php
require 'admin.inc.php';
require STAFFINC_DIR . 'header.inc.php';
$mysqli = new mysqli(DBHOST, DBUSER, DBPASS, DBNAME);
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit;
}
//Inicio Billy 22/02/2016 Query para traer la cantidad total de registros de la tabla de auditoriavy se creo el objeto de la clase Pagenate
$query = "\tSELECT *\n\t\t\t\tFROM ost_auditoria_limite_credito";
$result = $mysqli->query($query);
$rowcount = mysqli_num_rows($result);
$pageNav = new Pagenate($rowcount, $_GET['p'], PAGE_LIMIT);
//Fin Billy 23/02/2016 Query para traer la cantidad total de registros de la tabla de auditoriavy se creo el objeto de la clase Pagenate
$query = "\tSELECT CONCAT( firstname, ' ', lastname ) , c.name, a.total, a.disponible, a.date\n\t\t\t\tFROM ost_auditoria_limite_credito a\n\t\t\t\tINNER JOIN ost_staff b ON a.staff_id = b.staff_id\n\t\t\t\tINNER JOIN ost_organization c ON a.org_id = c.id \n\t\t\t\tORDER BY a.date DESC LIMIT " . $pageNav->getStart() . "," . $pageNav->getLimit();
//se agrego el limite para paginar los resultados
$result = $mysqli->query($query);
$rowcount = mysqli_num_rows($result);
//la variable $rowcount contiene el numero de registros obtenidos a partir de la sentencia sql
while ($row = $result->fetch_array()) {
$rows[] = $row;
}
?>
<script type="text/javascript">
$("#nav .inactive:eq(5) ul").remove();
$("#nav .inactive:eq(5)").addClass("active");
$("#nav .inactive:eq(5)").removeClass("inactive");
$("#sub_nav").append('<li><a class="users active" href="auditoria.php" title="" id="subnav0">Límite de Crédito</a></li>');
示例15: __
//Joins needed for search
$qfrom .= ' LEFT JOIN ' . TICKET_THREAD_TABLE . ' thread ON (' . 'ticket.ticket_id=thread.ticket_id AND thread.thread_type IN ("M","R"))';
}
}
TicketForm::ensureDynamicDataView();
$total = db_count('SELECT count(DISTINCT ticket.ticket_id) ' . $qfrom . ' ' . $qwhere);
$page = $_GET['p'] && is_numeric($_GET['p']) ? $_GET['p'] : 1;
$pageNav = new Pagenate($total, $page, PAGE_LIMIT);
$qstr = '&' . Http::build_query($qs);
$qs += array('sort' => $_REQUEST['sort'], 'order' => $_REQUEST['order']);
$pageNav->setURL('tickets.php', $qs);
//more stuff...
$qselect .= ' ,count(attach_id) as attachments ';
$qfrom .= ' LEFT JOIN ' . TICKET_ATTACHMENT_TABLE . ' attach ON ticket.ticket_id=attach.ticket_id ';
$qgroup = ' GROUP BY ticket.ticket_id';
$query = "{$qselect} {$qfrom} {$qwhere} {$qgroup} ORDER BY {$order_by} {$order} LIMIT " . $pageNav->getStart() . "," . $pageNav->getLimit();
//echo $query;
$res = db_query($query);
$showing = $res && db_num_rows($res) ? $pageNav->showing() : "";
if (!$results_type) {
$results_type = ucfirst($status) . ' Tickets';
}
$showing .= $status ? ' ' . $results_type : ' ' . __('All Tickets');
if ($search) {
$showing = __('Search Results') . ": {$showing}";
}
$negorder = $order == 'DESC' ? 'ASC' : 'DESC';
//Negate the sorting
?>
<h1><?php
echo __('Tickets');