本文整理汇总了PHP中Paginator::display_items_per_page方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::display_items_per_page方法的具体用法?PHP Paginator::display_items_per_page怎么用?PHP Paginator::display_items_per_page使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paginator
的用法示例。
在下文中一共展示了Paginator::display_items_per_page方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: paginador
function paginador()
{
if ($this->con->conectar() == true) {
$num_rows = mysql_query("SELECT COUNT(*) FROM noticias");
$pages = new Paginator();
$pages->items_total = $num_rows[0];
$pages->mid_range = 3;
$pages->paginate();
$result = mysql_query("SELECT * FROM noticias ORDER BY id ASC '" . $pages->limit . "'");
while ($rows = mysql_fetch_array($result)) {
echo "<td><?php echo (\$result[\\'id\\']) ?></td>";
}
echo "<li>" . $pages->display_jump_menu() . $pages->display_items_per_page() . "</li>";
echo "Page {$pages->current_page} of {$pages->num_pages}";
}
}
示例2: die
<?
$pages = new Paginator;
$pages->items_total = mysql_num_rows($result);
$pages->mid_range = 7;
$pages->paginate();
$query = "SELECT * FROM mailinglist_messages ORDER BY created DESC $pages->limit";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
if(mysql_num_rows($result) > 0)
{
echo "<h3>Click to show/hide a message. <a href=\"javascript:void(0);\" onclick=\"do_divs(1)\">Show All</a>/<a href=\"javascript:void(0);\" onclick=\"do_divs(0)\">Hide All</a></h3>\n";
echo "<span class=\"paginate\">Page </span><span style=\"padding:8px;border:1px dotted #999;\">";
echo $pages->display_pages();
echo $pages->display_jump_menu();
echo $pages->display_items_per_page();
echo "</span>";
}
$counter = 0;
while ($row = mysql_fetch_assoc($result))
{
// query queue table and count addresses for this message id
// divide total messgaes sent (first query) by the count and round down
$queue_query = "SELECT COUNT(*) FROM mailinglist_queue WHERE message_id = '$row[id]'";
$queue_result = mysql_query($queue_query) or die("Query failed : " . mysql_error());
$queue_count = mysql_fetch_row($queue_result);
$percent = @floor((($row[count]-$queue_count[0])/$row[count])*100);
echo "<p><table width=\"100%\" border=\"0\" id=\"table2\" cellpadding=\"0\" cellspacing=\"2\">\n";
echo "<tr><td class=\"message\"><b>Created:</b> " . date("F j, Y @ g:i a",$row[created]) . "</td><td class=\"message\">";
示例3: getNumRows
<body>
<div id="wrapper">
<div class="main">
<?php
//$search="WHERE (MATCH(title,description) AGAINST ('school education parent grade' IN BOOLEAN MODE))";
//$search="WHERE (MATCH(title,description) AGAINST ('theory' IN BOOLEAN MODE))";
$search = "";
// get rows
$num_rows = getNumRows($search);
$pages = new Paginator();
$pages->items_total = $num_rows;
$pages->mid_range = 9;
echo "<div class=\"paginate\">";
$pages->paginate();
echo $pages->display_pages();
echo "<span style=\"margin-left:25px\"> " . $pages->display_jump_menu() . $pages->display_items_per_page() . "</span>";
echo "</div>\n";
// print the stories
printStoriesPaginator($pages, $search);
echo "<div class=\"paginate\">" . $pages->display_pages() . "</div>";
echo "<p>Page {$pages->current_page} of {$pages->num_pages} </p>";
include 'closedb.php';
?>
</div></div>
</body>
</html>
示例4:
</tbody>
</table>
<div class="form-actions">
<?php
if ($pagi == 1) {
?>
<div class="pagination pull-left">
<?php
echo $pages->display_pages();
?>
<span style="margin-left:25px"> <?php
echo $pages->display_jump_menu() . $pages->display_items_per_page();
?>
</span>
<?php
?>
</div>
<?php
}
$u = $url . "/forexcel.php?";
$r = $_SERVER['QUERY_STRING'];
$uri = $u . $r;
//echo $uri;
if ($level['level'] == 1) {
?>
<input type="hidden" name="uri" value="<?php
示例5: ebImageTextButton
if (!$result || $nbr_players < 0) {
$text .= EB_EVENTM_L51 . '<br />';
} else {
if ($nbr_players == 0) {
$text .= EB_EVENTM_L52 . '<br />';
} else {
if ($paginate == true) {
// Paginate
$text .= '<br />';
$text .= '<span class="paginate" style="float:left;">' . $pages->display_pages() . '</span>';
$text .= '<span style="float:right">';
// Go To Page
$text .= $pages->display_jump_menu();
$text .= ' ';
// Items per page
$text .= $pages->display_items_per_page();
$text .= '</span><br /><br />';
}
/* Display table contents */
if ($can_change_seeds_players == true) {
$text .= '<table class="table_left">';
$text .= '<tr>';
$text .= '<td>' . EB_EVENTM_L156 . '</td>';
$text .= '<td><form action="' . e_PLUGIN . 'ebattles/eventprocess.php?eventid=' . $event_id . '" method="post">';
$text .= ebImageTextButton('eventplayersshuffle', '', EB_EVENTM_L155);
$text .= '</form></td>';
$text .= '<td>
<div id="ajaxSpinnerContainer">
<img src="' . e_PLUGIN . 'ebattles/images/ajax-loader.gif" title="working..." alt="working..."/>
' . EB_EVENTM_L157 . '
</div>
示例6: Paginator
}
$tracks = $search["results"];
if ($tracks) {
$pages = new Paginator();
$pages->items_per_page = $limit;
$pages->querystring = $query;
$pages->index = implode(",", $index);
$pages->mid_range = 5;
$pages->items_total = $search["total"];
$pages->paginate();
$low = ($page - 1) * $limit + 1;
$high = $low + $limit - 1 > $search["total"] ? $search["total"] : $low + $limit - 1;
echo "<script>\r\n\t\t\$(function () {\r\n\t\t\t\$('.track-info').popover({\r\n\t\t\t\t'html': true, \r\n\t\t\t\t'trigger': 'hover',\r\n\t\t\t\t'title': function() { \r\n\t\t\t\t\treturn(\$(this).parent().parent().find('.title').html())\r\n\t\t\t\t},\r\n\t\t\t\t'content': function() {\r\n\t\t\t\t\treturn(\$(this).parent().find('.hover-info').html());\r\n\t\t\t\t}\r\n\t\t\t});\r\n" . (Session::is_group_user("Playlist Admin") ? "\r\n\t\tvar item;\r\n\t\t\$('.playlist-add').click(function() {\r\n\t\t\titem = \$(this).parent().parent();\r\n\t\t\tplaylists = \$(this).attr('data-playlists-in').split(',');\r\n\t\t\t\$('.playlist-select').parent().removeClass('active');\r\n\t\t\t\$('.playlist-select').find('span').removeClass('glyphicon-minus').addClass('glyphicon-plus');\r\n\t\t\t\$('.playlist-select').each(function() {\r\n\t\t\t\tif(\$.inArray(\$(this).attr('data-playlist-id'),playlists) > -1) {\r\n\t\t\t\t\t\$(this).find('span').removeClass('icon-plus').addClass('glyphicon-minus');\r\n\t\t\t\t\t\$(this).parent().addClass('active');\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t});\r\n\r\n\t\t\$('.playlist-select').click(function() {\r\n\t\t\tobj = \$(this);\r\n\t\t\tif(\$(this).parent().hasClass('active')) {\r\n\t\t\t\t\$(this).find('span').removeClass('glyphicon-minus').addClass('glyphicon-refresh');\r\n\t\t\t\t\$.ajax({\r\n\t\t\t\t\turl: '" . LINK_ABS . "ajax/track-playlist-update.php',\r\n\t\t\t\t\tdata: 'trackid='+item.attr('id')+'&playlistid='+obj.attr('data-playlist-id')+'&action=del',\r\n\t\t\t\t\ttype: 'POST',\r\n\t\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-minus');\r\n\t\t\t\t\t\talert(value.error);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\t\tvalues = \$.parseJSON(data);\r\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-plus');\r\n\t\t\t\t\t\tobj.parent().removeClass('active');\r\n\t\t\t\t\t\titem.find('.playlist-add').attr('data-playlists-in',values.playlists.join(','));\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\t\$(this).find('span').removeClass('glyphicon-plus').addClass('glyphicon-refresh');\r\n\t\t\t\t\$.ajax({\r\n\t\t\t\t\turl: '" . LINK_ABS . "ajax/track-playlist-update.php',\r\n\t\t\t\t\tdata: 'trackid='+item.attr('id')+'&playlistid='+obj.attr('data-playlist-id')+'&action=add',\r\n\t\t\t\t\ttype: 'POST',\r\n\t\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-plus');\r\n\t\t\t\t\t\talert(value.error);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\t\tvalues = \$.parseJSON(data);\r\n\t\t\t\t\t\tobj.find('span').removeClass('glyphicon-refresh').addClass('glyphicon-minus');\r\n\t\t\t\t\t\tobj.parent().addClass('active');\r\n\t\t\t\t\t\titem.find('.playlist-add').attr('data-playlists-in',values.playlists.join(','));\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\$(this).parent().addClass('active');\r\n\t\t\t\t\$(this).find('span').removeClass('glyphicon-plus').addClass('glyphicon-minus');\r\n\t\t\t}\r\n\t\t});\t\t\r\n" : "") . (Session::is_group_user("Music Admin") ? "\r\n\t\tvar trackid;\r\n\t\t\$('.track-delete').click(function() {\r\n\t\t\t\$('.delete-track-title').html(\$(this).parent().parent().find('.title').html());\r\n\t\t\ttrackid = \$(this).attr('data-dps-id');\r\n\t\t});\r\n\r\n\t\t\$('.yes-definitely-delete').click(function() {\r\n\t\t\t\$.ajax({\r\n\t\t\t\turl: '" . LINK_ABS . "ajax/delete-track.php',\r\n\t\t\t\tdata: 'id='+trackid,\r\n\t\t\t\ttype: 'POST',\r\n\t\t\t\terror: function(xhr,text,error) {\r\n\t\t\t\t\tvalue = \$.parseJSON(xhr.responseText);\r\n\t\t\t\t\talert(value.error);\r\n\t\t\t\t},\r\n\t\t\t\tsuccess: function(data,text,xhr) {\r\n\t\t\t\t\twindow.location.reload(true); \r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n" : "") . "\t\t});\r\n\t</script>";
$indexes = implode(", ", $index);
echo "<h3>" . $search["total"] . " results for " . $query . "<small> searching in " . $indexes . "</small></h3>";
echo "<div class=\"row\"><div class=\"col-lg-5\"><h5>Showing results " . $low . " to " . $high . "</h5></div><div class=\"pull-right\">" . $pages->display_jump_menu() . $pages->display_items_per_page() . "</div></div>";
echo "<table class=\"table table-striped\" cellspacing=\"0\">\r\n\t<thead>\r\n\t\t<tr>\r\n\t\t\t<th class=\"icon\"> </th>\r\n\t\t\t<th class=\"artist\">Artist</th>\r\n\t\t\t<th class=\"title\">Title</th>\r\n\t\t\t<th class=\"album\">Album</th>\r\n\t\t\t<th class=\"length nowrap\">Length</th> \r\n\t\t\t" . (Session::is_group_user("Playlist Admin") ? "<th class=\"icon\"></th>" : "") . "\r\n\t\t\t" . (Session::is_group_user("Music Admin") ? "<th class=\"icon\"></th>" : "") . "\r\n\t\t</tr>\r\n\t</thead>";
foreach ($tracks as $track_id) {
$track = Tracks::get($track_id);
echo "\r\n\t\t<tr id=\"" . $track->get_id() . "\">\r\n\t\t\t<td class=\"icon\">\r\n\t\t\t\t<a href=\"" . LINK_ABS . "music/detail/" . $track->get_id() . "\" class=\"track-info\">\r\n\t\t\t\t\t" . Bootstrap::glyphicon("info-sign") . "\r\n\t\t\t\t</a>\r\n\t\t\t\t<div class=\"hover-info\">\r\n\t\t\t\t\t<strong>Artist:</strong> " . $track->get_artists_str() . "<br />\r\n\t\t\t\t\t<strong>Album:</strong> " . $track->get_album()->get_name() . "<br />\r\n\t\t\t\t\t<strong>Year:</strong> " . $track->get_year() . "<br />\r\n\t\t\t\t\t<strong>Length:</strong> " . Time::format_succinct($track->get_length()) . "<br />\r\n\t\t\t\t\t<strong>Origin:</strong> " . $track->get_origin() . "<br />\r\n\t\t\t\t\t" . ($track->get_reclibid() ? "<strong>Reclib ID:</strong> " . $track->get_reclibid() . "<br />" : "") . "\r\n\t\t\t\t\t<strong>Censored:</strong> " . ($track->is_censored() ? "Yes" : "No") . "<br /> \r\n\t\t\t\t</div>\r\n\t\t\t</td>\r\n\t\t\t<td class=\"artist\">" . $track->get_artists_str() . "</td>\r\n\t\t\t<td class=\"title\">" . $track->get_title() . "</td>\r\n\t\t\t<td class=\"album\">" . $track->get_album()->get_name() . "</td>\r\n\t\t\t<td class=\"length nowrap\">" . Time::format_succinct($track->get_length()) . "</td>";
if (Session::is_group_user("Playlist Admin")) {
$playlists = array();
foreach ($track->get_playlists_in() as $playlist) {
$playlists[] = $playlist->get_id();
}
echo "<td class=\"icon\"><a href=\"#\" data-toggle=\"modal\" data-target=\"#playlist-modal\" data-backdrop=\"true\" data-keyboard=\"true\" data-dps-id=\"" . $track->get_id() . "\" data-playlists-in=\"" . implode(",", $playlists) . "\" class=\"playlist-add\" title=\"Add to playlist\" rel=\"twipsy\">" . Bootstrap::glyphicon("plus-sign") . "</a></td>";
}
echo (Session::is_group_user("Music Admin") ? "<td class=\"icon\"><a href=\"#\" data-toggle=\"modal\" data-target=\"#delete-modal\" data-backdrop=\"true\" data-keyboard=\"true\" data-dps-id=\"" . $track->get_id() . "\" class=\"track-delete\" title=\"Delete this track\" rel=\"twipsy\">" . Bootstrap::glyphicon("remove-sign") . "</a></td>" : "") . "\r\n\t\t</tr>";
}
echo "</table>";
echo $pages->return;
示例7: db
require_once "../classes/db.class.php";
include_once '../classes/paginator.class.php';
/* Instantiate DB Class */
$db = new db();
/* Get Row count from nodes where NOT deleted*/
$rs = $db->q('SELECT COUNT(*) AS total FROM users WHERE status = 1');
$row = mysql_fetch_row($rs);
$result["total"] = $row[0];
/* Instantiate Paginator Class */
$pages = new Paginator();
$pages->items_total = $result['total'];
$pages->mid_range = 7;
// Number of pages to display. Must be odd and > 3
$pages->paginate();
echo $pages->display_pages();
echo "<span class=\"\">" . $pages->display_jump_menu() . $pages->display_items_per_page() . "</span>";
/* GET all nodes records from DB */
$q = $db->q("SELECT \n\t\tid,\n\t\tusername,\n\t\tuserlevel,\n\t\temail,\n\t\ttimestamp\n\tFROM users\n\tWHERE status = 1\n\t{$pages->limit}");
// push rows to $itesm array
$items = array();
while ($row = mysql_fetch_assoc($q)) {
array_push($items, $row);
}
/* Create Multidimensional array for use later */
$result["rows"] = $items;
$i = 0;
# row counter to enable alternate row coloring
?>
<table id="userAddTbl" class="tableSimple">
<thead>
示例8: count
<?php
$num = count($data['prods']);
$paginator = new Paginator($num);
$pagination = $paginator->display_pages();
$itemsPerPage = $paginator->display_items_per_page();
$sortOption = $paginator->display_sort(array("" => "Default", "name_a" => "Name (A - Z)", "name_d" => "Name (Z - A)", "price_a" => "Price (Low > High)", "price_d" => "Price (High > Low)"));
?>
<div class="col-md-9 col-sm-7">
<div class="row list-view-sorting clearfix">
<div class="col-md-2 col-sm-2 list-view">
<a href="#"><i class="fa fa-th-large"></i></a>
<a href="#"><i class="fa fa-th-list"></i></a>
</div>
<div class="col-md-10 col-sm-10">
<div class="pull-right">
<?php
echo $itemsPerPage;
?>
</div>
<div class="pull-right">
<?php
echo $sortOption;
?>
</div>
</div>
</div>
<div class="row product-list">
<?php
if ($num > 0) {
for ($i = 1; $i <= $num; $i++) {
示例9: manageBlog
public function manageBlog()
{
$content = '
<section id="content">
<div class="content-wrap">
<div class="container clearfix">
<div class="fancy-title title-border topmargin">
<h4>Admin Dashboard</h4>
</div>
<div class="table-toolbar">
<div class="btn-group">
<a href="?go=addBlog"> <button id="sample_editable_1_new" class="button button-3d button-rounded button-green">
Add New Blog Post <i class="icon-plus"></i>
</button></a>
</div>
</div>
<table class="table table-striped table-bordered table-hover" id="sample_1">
<thead>
<tr>
<th>ID</th>
<th >Photo</th>
<th >Title</th>
<th >Views</th>
<th >Quote</th>
<th >Category</th>
<th >Actions</th>
</tr>
</thead>
<tbody>';
$sub_sql = "SELECT COUNT(*) AS count FROM article WHERE trashed =0";
$result_pag_num = Database::performQuery($sub_sql);
$row = $result_pag_num->fetch_assoc();
$num_rows = $row['count'];
$pages = new Paginator($num_rows, 9, array(3, 5, 10, 12, 15, 20, 25, 30, 50, 100, 250, 'All'));
//$content .= $pages->display_pages();
$sql = "SELECT id,title,views,quote,media,articleCat_id,published FROM article WHERE trashed=0 ORDER BY id DESC LIMIT " . $pages->limit_start . "," . $pages->limit_end;
$result = Database::performQuery($sql);
while ($data = $result->fetch_assoc()) {
$catid = $data['articleCat_id'];
$sqlcat = "SELECT name FROM articlecat WHERE id LIKE '{$catid}'";
$resultcat = Database::performQuery($sqlcat);
$datacat = $resultcat->fetch_assoc();
$cat = $datacat['name'];
//published status set
$pub = $data['published'];
if ($pub) {
$actions = '<a href="./?go=editBlog&id=' . $data['id'] . '"><span class="badge badge-warning"><i class="icon-pencil"></i> Edit</span></a>
<a href="./?go=unpublish&id=' . $data['id'] . '"><span class="badge badge-primary"><i class="icon-thumbs-down"></i> Unpublish</span></a>
<a href="./?go=trash&id=' . $data['id'] . '"><span class="badge badge-danger"><i class="icon-trash"></i> </span></a>';
} else {
$actions = '<a href="./?go=editBlog&id=' . $data['id'] . '"><span class="badge badge-warning"><i class="icon-pencil"></i> Edit</span></a>
<a href="./?go=publish&id=' . $data['id'] . '"><span class="badge badge-success"><i class="icon-thumbs-up"></i> Publish</span></a>
<a href="./?go=trash&id=' . $data['id'] . '"><span class="badge badge-danger"><i class="icon-trash"></i></span></a>';
}
//Set actions
$content .= '<tr class="odd gradeX">
<td>' . $data['id'] . '</td>
<td ><img src="' . BASE_URL . '/img/' . $data['media'] . '" width="100"/></a></td>
<td >' . $data['title'] . '</td>
<td class="center">' . $data['views'] . '</td>
<td class="center">' . $data['quote'] . '</td>
<td >' . $cat . '</td>
<td >' . $actions . '</td>
</tr>';
}
$content .= '<tr><td colspan="5">' . $pages->display_pages() . '</td><td colspan="1">' . $pages->display_jump_menu() . '</td><td colspan="1">' . $pages->display_items_per_page() . '</td></tr>';
$content .= '
</tbody>
</table>
</div></div></section>
';
return $content;
}
示例10: displayPastEvents
//.........这里部分代码省略.........
/* 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 .= ' ';
// Go To Page
$text .= $pages->display_jump_menu();
$text .= ' ';
// 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 = "-";
}
示例11:
<?php
}
?>
</table>
<!-- Hiddend Field For Delete -->
<input type="hidden" id="id" name="id" value=" " />
<input type="hidden" id="method" name="method" value=" " />
</form><?php
echo "<span style='text-align:center;display:block;color:#fff;padding-top:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;'> " . $pages->display_jump_menu() . $pages->display_items_per_page() . "</span>";
?>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
示例12: displayGames
/**
* displayGames - Displays the games database table
*/
function displayGames()
{
global $pref;
global $sql;
global $text;
global $session;
$pages = new Paginator();
$array = array('id' => array(EB_GAMES_L3, TBL_GAMES . '.GameID'), 'icon' => array(EB_GAMES_L4, TBL_GAMES . '.Icon'), 'game' => array(EB_GAMES_L5, TBL_GAMES . '.Name'));
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";
}
$q = "SELECT count(*) " . " FROM " . TBL_GAMES;
$result = $sql->db_Query($q);
$numGames = mysql_result($result, 0);
$totalItems = $numGames;
$pages->items_total = $totalItems;
$pages->mid_range = eb_PAGINATION_MIDRANGE;
$pages->paginate();
$text .= '<div class="spacer">';
$text .= '<p>';
$text .= $numGames . ' ' . EB_GAMES_L6 . '<br />';
$text .= '</p>';
$text .= '</div>';
$orderby_array = $array["{$orderby}"];
$q = "SELECT " . TBL_GAMES . ".*" . " FROM " . TBL_GAMES . " ORDER BY {$orderby_array['1']} {$sort}" . " {$pages->limit}";
$result = $sql->db_Query($q);
$num_rows = mysql_numrows($result);
if (!$result || $num_rows < 0) {
$text .= EB_GAMES_L7;
return;
}
if ($num_rows == 0) {
$text .= EB_GAMES_L8;
} else {
// Paginate
$text .= '<br />';
$text .= '<span class="paginate" style="float:left;">' . $pages->display_pages() . '</span>';
$text .= '<span style="float:right">';
// Go To Page
$text .= $pages->display_jump_menu();
$text .= ' ';
// Items per page
$text .= $pages->display_items_per_page();
$text .= '</span><br /><br />';
/* Display table contents */
$text .= '<form id="gamesform" action="' . e_PLUGIN . 'ebattles/gameprocess.php" method="post">';
$text .= '<table class="fborder" style="width:95%"><tbody>';
$text .= '<tr>';
$text .= '<td class="eb_td2"><input class="tbox" type="checkbox" name="sAll" onclick="selectAll(this)" /> (' . EB_GAMES_L9 . ')</td>';
foreach ($array as $opt => $opt_array) {
$text .= '<td class="eb_td2"><a href="' . e_PLUGIN . 'ebattles/admin_config.php?eb_games&orderby=' . $opt . '&sort=' . $sort . '">' . $opt_array[0] . '</a></td>';
}
$text .= '<td class="eb_td2">' . EB_GAMES_L10;
$text .= '<input type="hidden" id="delete_game" name="delete_game" value=""/></td></tr>';
for ($i = 0; $i < $num_rows; $i++) {
$gid = mysql_result($result, $i, TBL_GAMES . ".GameID");
$gname = mysql_result($result, $i, TBL_GAMES . ".Name");
$gicon = mysql_result($result, $i, TBL_GAMES . ".Icon");
$text .= '<tr>';
$text .= '<td class="forumheader3"><input class="tbox" type="checkbox" name="game_sel[]" value="' . $gid . '" /></td>';
$text .= '<td class="forumheader3">' . $gid . '</td>';
$text .= '<td class="forumheader3"><img ' . getGameIconResize($gicon) . ' title="' . $gicon . '"/></td>';
$text .= '<td class="forumheader3"><a href="' . e_PLUGIN . 'ebattles/admin_config.php?eb_games&gameid=' . $gid . '">' . $gname . '</a></td>';
$text .= '<td class="forumheader3"><a href="' . e_PLUGIN . 'ebattles/admin_config.php?eb_games&gameid=' . $gid . '"><img src="' . e_PLUGIN . 'ebattles/images/page_white_edit.png" alt="' . EB_GAMES_L11 . '" title="' . EB_GAMES_L11 . '"/></a>';
$text .= '<a href="javascript:buttonval(\'' . $gid . '\');" title="' . EB_GAMES_L12 . '" onclick="return confirm(\'' . EB_GAMES_L13 . '\')"><img src="' . e_PLUGIN . 'ebattles/images/cross.png" alt="' . EB_GAMES_L12 . '"/></a>';
$text .= '</td>';
$text .= '</tr>';
}
$text .= '</tbody></table>';
$text .= '<table><tr>
<td>
<input class="eb_button" type="submit" name="delete_selected_games" value="' . EB_GAMES_L14 . '" onclick="return confirm(\'' . EB_GAMES_L15 . '\')"/>
</td>
<td>
<input class="eb_button" type="submit" name="delete_all_games" value="' . EB_GAMES_L16 . '" onclick="return confirm(\'' . EB_GAMES_L17 . '\')"/>
</td>
<td>
<input class="eb_button" type="submit" name="update_selected_games" value="' . EB_GAMES_L18 . '"/>
</td>
<td>
<input class="eb_button" type="submit" name="update_all_games" value="' . EB_GAMES_L19 . '"/>
</td>
<td>
<input class="eb_button" type="submit" name="add_games" value="' . EB_GAMES_L20 . '"/>
</td>
</tr>
</table>
';
$text .= '</form>';
}
}
示例13: manageRsvp
public function manageRsvp()
{
$content = '
<section id="content">
<div class="content-wrap">
<div class="container clearfix">
<div class="fancy-title title-border topmargin">
<h4>Manage RSVPs</h4>
</div>
<table class="table table-striped table-bordered table-hover" id="sample_1">
<thead>
<tr>
<th>ID</th>
<th >Parent Name</th>
<th >Telephone</th>
<th >Email</th>
<th >Number of Kids</th>
<th >Kids Details</th>
</tr>
</thead>
<tbody>';
$sub_sql = "SELECT COUNT(*) AS count FROM rsvp";
$result_pag_num = Database::performQuery($sub_sql);
$row = $result_pag_num->fetch_assoc();
$num_rows = $row['count'];
$pages = new Paginator($num_rows, 9, array(3, 5, 10, 12, 15, 20, 25, 30, 50, 100, 250, 'All'));
//$content .= $pages->display_pages();
$sql = "SELECT * FROM rsvp ORDER BY id DESC LIMIT " . $pages->limit_start . "," . $pages->limit_end;
$result = Database::performQuery($sql);
while ($data = $result->fetch_assoc()) {
$content .= '<tr class="odd gradeX">
<td>' . $data['id'] . '</td>
<td >' . $data['parent'] . '</td>
<td >' . $data['phone'] . '</td>
<td class="center">' . $data['email'] . '</td>
<td class="center">' . $data['numkids'] . '</td>
<td >' . $data['kids'] . '</td>
</tr>';
}
$content .= '<tr><td colspan="4">' . $pages->display_pages() . '</td><td colspan="1">' . $pages->display_jump_menu() . '</td><td colspan="1">' . $pages->display_items_per_page() . '</td></tr>';
$content .= '
</tbody>
</table>
</div></div></section>
';
return $content;
}
示例14: manageEvent
public function manageEvent()
{
$content = '
<section id="content">
<div class="content-wrap">
<div class="container clearfix">
<div class="fancy-title title-border topmargin">
<h4>Manage Events</h4>
</div>
<div class="table-toolbar">
<div class="btn-group">
<a href="?go=addEvent"> <button id="sample_editable_1_new" class="button button-3d button-rounded button-green">
Add New Event <i class="icon-plus"></i>
</button></a>
</div>
</div>
<table class="table table-striped table-bordered table-hover" id="sample_1">
<thead>
<tr>
<th>ID</th>
<th >Photo</th>
<th >Title</th>
<th >Target</th>
<th >Day&Time</th>
<th >Venue</th>
<th >Cost</th>
<th >Actions</th>
</tr>
</thead>
<tbody>';
$sub_sql = "SELECT COUNT(*) AS count FROM events WHERE trashed =0";
$result_pag_num = Database::performQuery($sub_sql);
$row = $result_pag_num->fetch_assoc();
$num_rows = $row['count'];
$pages = new Paginator($num_rows, 9, array(3, 5, 10, 12, 15, 20, 25, 30, 50, 100, 250, 'All'));
//$content .= $pages->display_pages();
$sql = "SELECT * FROM events WHERE trashed=0 ORDER BY id DESC LIMIT " . $pages->limit_start . "," . $pages->limit_end;
$result = Database::performQuery($sql);
while ($data = $result->fetch_assoc()) {
//published status set
$pub = $data['published'];
if ($pub) {
$actions = '<a href="./?go=editEvent&id=' . $data['id'] . '"><span class="badge badge-warning"><i class="icon-pencil"></i> Edit</span></a>
<a href="./?go=unpublishEvent&id=' . $data['id'] . '"><span class="badge badge-primary"><i class="icon-thumbs-down"></i> Unpublish</span></a>
<a href="./?go=trashEvent&id=' . $data['id'] . '"><span class="badge badge-danger"><i class="icon-trash"></i> </span></a>';
} else {
$actions = '<a href="./?go=editEvent&id=' . $data['id'] . '"><span class="badge badge-warning"><i class="icon-pencil"></i> Edit</span></a>
<a href="./?go=publishEvent&id=' . $data['id'] . '"><span class="badge badge-success"><i class="icon-thumbs-up"></i> Publish</span></a>
<a href="./?go=trashEvent&id=' . $data['id'] . '"><span class="badge badge-danger"><i class="icon-trash"></i></span></a>';
}
//Set actions
$content .= '<tr class="odd gradeX">
<td>' . $data['id'] . '</td>
<td ><img src="' . BASE_URL . '/img/' . $data['photo'] . '" width="100"/></a></td>
<td >' . $data['title'] . '</td>
<td class="center">' . $data['target'] . '</td>
<td class="center">' . $data['daytime'] . '</td>
<td class="center">' . $data['venue'] . '</td>
<td class="center">' . $data['cost'] . '</td>
<td >' . $actions . '</td>
</tr>';
}
$content .= '<tr><td colspan="6">' . $pages->display_pages() . '</td><td colspan="1">' . $pages->display_jump_menu() . '</td><td colspan="1">' . $pages->display_items_per_page() . '</td></tr>';
$content .= '
</tbody>
</table>
</div></div></section>
';
return $content;
}
示例15: displayClans
/**
* displayClans - Displays the Clans database table in
* a nicely formatted html table.
*/
function displayClans()
{
global $pref;
global $sql;
global $text;
$pages = new Paginator();
if (check_class($pref['eb_teams_create_class'])) {
$text .= '<form action="' . e_PLUGIN . 'ebattles/clancreate.php" method="post">';
$text .= '<div>';
$text .= '<input type="hidden" name="userid" value="' . USERID . '"/>';
$text .= '<input type="hidden" name="username" value="' . USERNAME . '"/>';
$text .= '</div>';
$text .= ebImageTextButton('createteam', 'add.png', EB_CLANS_L7);
$text .= '</form><br />';
} else {
//$text .= '<div>'..'</div>';
}
/* set pagination variables */
$q = "SELECT count(*) " . " FROM " . TBL_CLANS;
$result = $sql->db_Query($q);
$totalItems = mysql_result($result, 0);
$pages->items_total = $totalItems;
$pages->mid_range = eb_PAGINATION_MIDRANGE;
$pages->paginate();
$q = "SELECT " . TBL_CLANS . ".*" . " FROM " . TBL_CLANS . " ORDER BY Name" . " {$pages->limit}";
$result = $sql->db_Query($q);
/* Error occurred, return given name by default */
$num_rows = mysql_numrows($result);
if (!$result || $num_rows < 0) {
$text .= EB_CLANS_L3;
return;
}
if ($num_rows == 0) {
$text .= '<div>' . EB_CLANS_L4 . '</div>';
} else {
// Paginate
$text .= '<span class="paginate" style="float:left;">' . $pages->display_pages() . '</span>';
$text .= '<span style="float:right">';
// Go To Page
$text .= $pages->display_jump_menu();
$text .= ' ';
// Items per page
$text .= $pages->display_items_per_page();
$text .= '</span><br /><br />';
/* Display table contents */
$text .= '<table class="eb_table" style="width:95%"><tbody>';
$text .= '<tr>
<th class="eb_th2">' . EB_CLANS_L5 . '</th>
<th class="eb_th2">' . EB_CLANS_L6 . '</th>
</tr>';
for ($i = 0; $i < $num_rows; $i++) {
$clan_id = mysql_result($result, $i, TBL_CLANS . ".ClanID");
$clan = new Clan($clan_id);
$image = "";
if ($pref['eb_avatar_enable_teamslist'] == 1) {
if ($clan->getField('Image')) {
$image = '<img ' . getAvatarResize(getImagePath($clan->getField('Image'), 'team_avatars')) . '/>';
} else {
if ($pref['eb_avatar_default_team_image'] != '') {
$image = '<img ' . getAvatarResize(getImagePath($pref['eb_avatar_default_team_image'], 'team_avatars')) . '/>';
}
}
}
$text .= '<tr>
<td class="eb_td">' . $image . ' <a href="' . e_PLUGIN . 'ebattles/claninfo.php?clanid=' . $clan_id . '">' . $clan->getField('Name') . '</a></td>
<td class="eb_td">' . $clan->getField('Tag') . '</td></tr>';
}
$text .= '</tbody></table><br />';
}
}