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


PHP em_admin_paginate函数代码示例

本文整理汇总了PHP中em_admin_paginate函数的典型用法代码示例。如果您正苦于以下问题:PHP em_admin_paginate函数的具体用法?PHP em_admin_paginate怎么用?PHP em_admin_paginate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: em_bookings_person_table

/**
 * Generates a "widget" table of confirmed bookings for a specific event.
 * 
 * @param int $event_id
 */
function em_bookings_person_table()
{
    global $wpdb, $current_user, $EM_Person;
    if (!is_object($EM_Person)) {
        return false;
    }
    $action_scope = !empty($_REQUEST['em_obj']) && $_REQUEST['em_obj'] == 'em_bookings_confirmed_table';
    $action = $action_scope && !empty($_GET['action']) ? $_GET['action'] : '';
    $order = $action_scope && !empty($_GET['order']) ? $_GET['order'] : 'ASC';
    $limit = $action_scope && !empty($_GET['limit']) ? $_GET['limit'] : 20;
    //Default limit
    $page = $action_scope && !empty($_GET['pno']) ? $_GET['pno'] : 1;
    $offset = $action_scope && $page > 1 ? ($page - 1) * $limit : 0;
    $bookings = $EM_Person->get_bookings();
    $bookings_count = count($bookings);
    if ($bookings_count > 0) {
        //Get events here in one query to speed things up
        foreach ($bookings as $EM_Booking) {
            $event_ids[] = $EM_Booking->event_id;
        }
        $events = EM_Events::get($event_ids);
    }
    ?>
		<div class='wrap em_bookings_pending_table em_obj'>
			<form id='bookings-filter' method='get' action='<?php 
    bloginfo('wpurl');
    ?>
/wp-admin/edit.php'>
				<input type="hidden" name="em_obj" value="em_bookings_pending_table" />
				<!--
				<ul class="subsubsub">
					<li>
						<a href='edit.php?post_type=post' class="current">All <span class="count">(1)</span></a> |
					</li>
				</ul>
				<p class="search-box">
					<label class="screen-reader-text" for="post-search-input"><?php 
    _e('Search');
    ?>
:</label>
					<input type="text" id="post-search-input" name="em_search" value="<?php 
    echo !empty($_GET['em_search']) ? $_GET['em_search'] : '';
    ?>
" />
					<input type="submit" value="<?php 
    _e('Search');
    ?>
" class="button" />
				</p>
				-->
				<?php 
    if ($bookings_count >= $limit) {
        ?>
				<div class='tablenav'>
					<!--
					<div class="alignleft actions">
						<select name="action">
							<option value="-1" selected="selected">
								<?php 
        _e('Bulk Actions');
        ?>
							</option>
							<option value="approve">
								<?php 
        _e('Approve', 'dbem');
        ?>
							</option>
							<option value="decline">
								<?php 
        _e('Decline', 'dbem');
        ?>
							</option>
						</select> 
						<input type="submit" id="post-query-submit" value="Filter" class="button-secondary" />
					</div>
					-->
					<!--
					<div class="view-switch">
						<a href="/wp-admin/edit.php?mode=list"><img class="current" id="view-switch-list" src="http://wordpress.lan/wp-includes/images/blank.gif" width="20" height="20" title="List View" alt="List View" name="view-switch-list" /></a> <a href="/wp-admin/edit.php?mode=excerpt"><img id="view-switch-excerpt" src="http://wordpress.lan/wp-includes/images/blank.gif" width="20" height="20" title="Excerpt View" alt="Excerpt View" name="view-switch-excerpt" /></a>
					</div>
					-->
					<?php 
        if ($bookings_count >= $limit) {
            $bookings_nav = em_admin_paginate($bookings_count, $limit, $page, array('em_ajax' => 0, 'em_obj' => 'em_bookings_confirmed_table'));
            echo $bookings_nav;
        }
        ?>
					<div class="clear"></div>
				</div>
				<?php 
    }
    ?>
				<div class="clear"></div>
				<?php 
    if ($bookings_count > 0) {
//.........这里部分代码省略.........
开发者ID:hypenotic,项目名称:slowfood,代码行数:101,代码来源:em-person.php

示例2: em_bookings_rejected_table

/**
 * Generates a "widget" table of confirmed bookings for a specific event.
 * 
 * @param int $event_id
 */
function em_bookings_rejected_table()
{
    global $EM_Event, $EM_Ticket, $wpdb, $current_user;
    $action_scope = !empty($_REQUEST['em_obj']) && $_REQUEST['em_obj'] == 'em_bookings_confirmed_table';
    $action = $action_scope && !empty($_GET['action']) ? $_GET['action'] : '';
    $order = $action_scope && !empty($_GET['order']) ? $_GET['order'] : 'ASC';
    $limit = $action_scope && !empty($_GET['limit']) ? $_GET['limit'] : 20;
    //Default limit
    $page = $action_scope && !empty($_GET['pno']) ? $_GET['pno'] : 1;
    $offset = $action_scope && $page > 1 ? ($page - 1) * $limit : 0;
    if (is_object($EM_Ticket)) {
        $EM_Bookings = $EM_Ticket->get_bookings()->get_rejected_bookings();
    } else {
        if (is_object($EM_Event)) {
            $EM_Bookings = $EM_Event->get_bookings()->get_rejected_bookings();
        } else {
            return false;
        }
    }
    $bookings_count = is_array($EM_Bookings->bookings) ? count($EM_Bookings->bookings) : 0;
    ?>
		<div class='wrap em_bookings_pending_table em_obj'>
			<form id='bookings-filter' method='get' action='<?php 
    bloginfo('wpurl');
    ?>
/wp-admin/edit.php'>
				<input type="hidden" name="em_obj" value="em_bookings_pending_table" />
				<!--
				<ul class="subsubsub">
					<li>
						<a href='edit.php?post_type=post' class="current">All <span class="count">(1)</span></a> |
					</li>
				</ul>
				<p class="search-box">
					<label class="screen-reader-text" for="post-search-input"><?php 
    _e('Search', 'events-manager');
    ?>
:</label>
					<input type="text" id="post-search-input" name="em_search" value="<?php 
    echo !empty($_GET['em_search']) ? esc_attr($_GET['em_search']) : '';
    ?>
" />
					<input type="submit" value="<?php 
    _e('Search', 'events-manager');
    ?>
" class="button" />
				</p>
				-->
				<?php 
    if ($bookings_count >= $limit) {
        ?>
				<div class='tablenav'>
					<!--
					<div class="alignleft actions">
						<select name="action">
							<option value="-1" selected="selected">
								<?php 
        _e('Bulk Actions', 'events-manager');
        ?>
							</option>
							<option value="approve">
								<?php 
        _e('Approve', 'events-manager');
        ?>
							</option>
							<option value="decline">
								<?php 
        _e('Decline', 'events-manager');
        ?>
							</option>
						</select> 
						<input type="submit" id="post-query-submit" value="Filter" class="button-secondary" />
					</div>
					-->
					<!--
					<div class="view-switch">
						<a href="/wp-admin/edit.php?mode=list"><img class="current" id="view-switch-list" src="http://wordpress.lan/wp-includes/images/blank.gif" width="20" height="20" title="List View" alt="List View" name="view-switch-list" /></a> <a href="/wp-admin/edit.php?mode=excerpt"><img id="view-switch-excerpt" src="http://wordpress.lan/wp-includes/images/blank.gif" width="20" height="20" title="Excerpt View" alt="Excerpt View" name="view-switch-excerpt" /></a>
					</div>
					-->
					<?php 
        if ($bookings_count >= $limit) {
            $bookings_nav = em_admin_paginate($bookings_count, $limit, $page, array('em_ajax' => 0, 'em_obj' => 'em_bookings_confirmed_table'));
            echo $bookings_nav;
        }
        ?>
					<div class="clear"></div>
				</div>
				<?php 
    }
    ?>
				<div class="clear"></div>
				<?php 
    if ($bookings_count > 0) {
        ?>
				<div class='table-wrap'>
//.........这里部分代码省略.........
开发者ID:mjrobison,项目名称:FirstCareCPR,代码行数:101,代码来源:em-rejected.php

示例3: em_admin_paginate

    ?>
		<div class='em-my-bookings'>
				<!--
				<ul class="subsubsub">
					<li>
						<a href='edit.php?post_type=post' class="current">All <span class="count">(1)</span></a> |
					</li>
				</ul>
				-->
				<?php 
    if ($bookings_count >= $limit) {
        ?>
				<div class='tablenav'>
					<?php 
        if ($bookings_count >= $limit) {
            $bookings_nav = em_admin_paginate($bookings_count, $limit, $page, array('em_ajax' => 0, 'em_obj' => 'em_bookings_confirmed_table'));
            echo $bookings_nav;
        }
        ?>
					<div class="clear"></div>
				</div>
				<?php 
    }
    ?>
				<div class="clear"></div>
				<?php 
    if ($bookings_count > 0) {
        ?>
				<div class='table-wrap'>
				<table id='dbem-bookings-table' class='widefat post fixed'>
					<thead>
开发者ID:hypenotic,项目名称:slowfood,代码行数:31,代码来源:my-bookings.php

示例4: output_table


//.........这里部分代码省略.........
            if ($key == $this->status) {
                $selected = "selected='selected'";
            }
            echo "<option value='{$key}' {$selected}>{$value['label']}</option>  ";
        }
        ?>
						</select>
						<input id="post-query-submit" class="button-secondary" type="submit" value="<?php 
        _e('Filter');
        ?>
" />
						<?php 
        if ($EM_Event !== false) {
            ?>
						<?php 
            _e('Displaying Event', 'dbem');
            ?>
 : <?php 
            echo $EM_Event->name;
            ?>
						<?php 
        } elseif ($EM_Person !== false) {
            ?>
						<?php 
            _e('Displaying User', 'dbem');
            echo ' : ' . $EM_Person->get_name();
            ?>
						<?php 
        }
        ?>
					</div>
					<?php 
        if ($this->bookings_count >= $this->limit) {
            $bookings_nav = em_admin_paginate($this->bookings_count, $this->limit, $this->page, array(), '#%#%', '#');
            echo $bookings_nav;
        }
        ?>
				</div>
				<div class="clear"></div>
				<div class='table-wrap'>
				<table id='dbem-bookings-table' class='widefat post '>
					<thead>
						<tr>
							<?php 
        /*						
        <th class='manage-column column-cb check-column' scope='col'>
        	<input class='select-all' type="checkbox" value='1' />
        </th>
        */
        ?>
							<th class='manage-column' scope='col'><?php 
        echo implode("</th><th class='manage-column' scope='col'>", $this->get_headers());
        ?>
</th>
						</tr>
					</thead>
					<?php 
        if ($this->bookings_count > 0) {
            ?>
					<tbody>
						<?php 
            $rowno = 0;
            $event_count = !empty($event_count) ? $event_count : 0;
            foreach ($this->bookings->bookings as $EM_Booking) {
                ?>
							<tr>
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:67,代码来源:em-bookings-table.php

示例5: esc_attr

    echo esc_attr($_REQUEST['view']);
    ?>
" />
				<?php 
}
?>

				<input type="submit" value="<?php 
_e('Search Events', 'dbem');
?>
" class="button" />
			</p>
			<div class="tablenav">
				<?php 
if ($events_count >= $limit) {
    $events_nav = em_admin_paginate($events_count, $limit, $page);
    echo $events_nav;
}
?>

				<br class="clear" />
			</div>
				
			<?php 
if (empty($EM_Events)) {
    echo get_option('dbem_no_events_message');
} else {
    ?>

					
			<table class="widefat events-table">
开发者ID:pcco,项目名称:portal-redesign,代码行数:31,代码来源:events.php

示例6: em_bookings_pending_table

/**
 * Generates a "widget" table of pending bookings with some quick admin operation options. 
 * If event id supplied then only pending bookings for that event will show.
 * 
 * @param int $event_id
 */
function em_bookings_pending_table($event_id = false)
{
    global $EM_Event, $wpdb, $current_user;
    if (get_option('dbem_bookings_approval') == 0) {
        return false;
    }
    $action_scope = !empty($_REQUEST['em_obj']) && $_REQUEST['em_obj'] == 'em_bookings_pending_table';
    $action = $action_scope && !empty($_GET['action']) ? $_GET['action'] : '';
    $order = $action_scope && !empty($_GET['order']) ? $_GET['order'] : 'ASC';
    $limit = $action_scope && !empty($_GET['limit']) ? $_GET['limit'] : 20;
    //Default limit
    $page = $action_scope && !empty($_GET['pno']) ? $_GET['pno'] : 1;
    $offset = $action_scope && $page > 1 ? ($page - 1) * $limit : 0;
    if (is_object($EM_Event)) {
        $bookings = $EM_Event->get_bookings()->get_pending();
    } else {
        //To optimize performance, we can do one query here for all pending bookings to show.
        $bookings = EM_Bookings::get(array('status' => 0));
        $events = array();
        //Now let's create events and bookings for this:
        foreach ($bookings as $EM_Booking) {
            //create event
            if (!array_key_exists($EM_Booking->event_id, $events)) {
                $events[$EM_Booking->event_id] = new EM_Event($EM_Booking->event_id);
            }
        }
    }
    $bookings_count = is_array($bookings) ? count($bookings) : 0;
    ?>
		<div class='wrap em_bookings_pending_table em_obj'>
			<form id='bookings-filter' method='get' action='<?php 
    bloginfo('wpurl');
    ?>
/wp-admin/edit.php'>
				<input type="hidden" name="em_obj" value="em_bookings_pending_table" />
				<!--
				<ul class="subsubsub">
					<li>
						<a href='edit.php?post_type=post' class="current">All <span class="count">(1)</span></a> |
					</li>
				</ul>
				<p class="search-box">
					<label class="screen-reader-text" for="post-search-input"><?php 
    _e('Search');
    ?>
:</label>
					<input type="text" id="post-search-input" name="em_search" value="<?php 
    echo !empty($_GET['em_search']) ? $_GET['em_search'] : '';
    ?>
" />
					<input type="submit" value="<?php 
    _e('Search');
    ?>
" class="button" />
				</p>
				-->
				<?php 
    if ($bookings_count >= $limit) {
        ?>
				<div class='tablenav'>
					<!--
					<div class="alignleft actions">
						<select name="action">
							<option value="-1" selected="selected">
								<?php 
        _e('Bulk Actions');
        ?>
							</option>
							<option value="approve">
								<?php 
        _e('Approve', 'dbem');
        ?>
							</option>
							<option value="decline">
								<?php 
        _e('Decline', 'dbem');
        ?>
							</option>
						</select> 
						<input type="submit" id="post-query-submit" value="Filter" class="button-secondary" />
					</div>
					-->
					<!--
					<div class="view-switch">
						<a href="/wp-admin/edit.php?mode=list"><img class="current" id="view-switch-list" src="http://wordpress.lan/wp-includes/images/blank.gif" width="20" height="20" title="List View" alt="List View" name="view-switch-list" /></a> <a href="/wp-admin/edit.php?mode=excerpt"><img id="view-switch-excerpt" src="http://wordpress.lan/wp-includes/images/blank.gif" width="20" height="20" title="Excerpt View" alt="Excerpt View" name="view-switch-excerpt" /></a>
					</div>
					-->
					<?php 
        if ($bookings_count >= $limit) {
            $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno' => '%PAGE%', 'em_ajax' => 0, 'em_obj' => 'em_bookings_pending_table'));
            $bookings_nav = em_admin_paginate($page_link_template, $bookings_count, $limit, $page, 5);
            echo $bookings_nav;
        }
        ?>
//.........这里部分代码省略.........
开发者ID:hypenotic,项目名称:slowfood,代码行数:101,代码来源:em-pending.php

示例7: em_bookings_events_table

/**
 * Determines whether to show event page or events page, and saves any updates to the event or events
 * @return null
 */
function em_bookings_events_table()
{
    //TODO Simplify panel for events, use form flags to detect certain actions (e.g. submitted, etc)
    global $wpdb;
    global $EM_Event;
    $scope_names = array('past' => __('Past events', 'dbem'), 'all' => __('All events', 'dbem'), 'future' => __('Future events', 'dbem'));
    $action_scope = !empty($_REQUEST['em_obj']) && $_REQUEST['em_obj'] == 'em_bookings_events_table';
    $action = $action_scope && !empty($_GET['action']) ? $_GET['action'] : '';
    $order = $action_scope && !empty($_GET['order']) ? $_GET['order'] : 'ASC';
    $limit = $action_scope && !empty($_GET['limit']) ? $_GET['limit'] : 20;
    //Default limit
    $page = $action_scope && !empty($_GET['pno']) ? $_GET['pno'] : 1;
    $offset = $action_scope && $page > 1 ? ($page - 1) * $limit : 0;
    $scope = $action_scope && !empty($_GET['scope']) && array_key_exists($_GET['scope'], $scope_names) ? $_GET['scope'] : 'future';
    // No action, only showing the events list
    switch ($scope) {
        case "past":
            $title = __('Past Events', 'dbem');
            break;
        case "all":
            $title = __('All Events', 'dbem');
            break;
        default:
            $title = __('Future Events', 'dbem');
            $scope = "future";
    }
    $events = EM_Events::get(array('scope' => $scope, 'limit' => 0, 'order' => $order, 'rsvp' => true));
    $events_count = count($events);
    $use_events_end = get_option('dbem_use_event_end');
    ?>
	<div class="wrap em_bookings_events_table em_obj">
		<form id="posts-filter" action="<?php 
    echo $_SERVER['REQUEST_URI'];
    ?>
" method="get">
			<input type="hidden" name="em_obj" value="em_bookings_events_table" />
			<?php 
    if (!empty($_GET['page'])) {
        ?>
			<input type='hidden' name='page' value='events-manager-bookings' />
			<?php 
    }
    ?>
			<ul class="subsubsub">
				<li><a href='#' class="current"><?php 
    _e('Total', 'dbem');
    ?>
 <span class="count">(<?php 
    echo count($events);
    ?>
)</span></a></li>
			</ul>			
			<div class="tablenav">			
				<div class="alignleft actions">
					<!--
					<select name="action">
						<option value="-1" selected="selected"><?php 
    _e('Bulk Actions');
    ?>
</option>
						<option value="deleteEvents"><?php 
    _e('Delete selected', 'dbem');
    ?>
</option>
					</select> 
					<input type="submit" value="<?php 
    _e('Apply');
    ?>
" name="doaction2" id="doaction2" class="button-secondary action" />
					 --> 
					<select name="scope">
						<?php 
    foreach ($scope_names as $key => $value) {
        $selected = "";
        if ($key == $scope) {
            $selected = "selected='selected'";
        }
        echo "<option value='{$key}' {$selected}>{$value}</option>  ";
    }
    ?>
					</select>
					<input id="post-query-submit" class="button-secondary" type="submit" value="<?php 
    _e('Filter');
    ?>
" />
				</div>
				<!--
				<div class="view-switch">
					<a href="/wp-admin/edit.php?mode=list"><img class="current" id="view-switch-list" src="http://wordpress.lan/wp-includes/images/blank.gif" width="20" height="20" title="List View" alt="List View" name="view-switch-list" /></a> <a href="/wp-admin/edit.php?mode=excerpt"><img id="view-switch-excerpt" src="http://wordpress.lan/wp-includes/images/blank.gif" width="20" height="20" title="Excerpt View" alt="Excerpt View" name="view-switch-excerpt" /></a>
				</div>
				-->
				<?php 
    if ($events_count >= $limit) {
        $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno' => '%PAGE%', 'em_ajax' => 0, 'em_obj' => 'em_bookings_events_table'));
        $events_nav = em_admin_paginate($page_link_template, $events_count, $limit, $page, 5);
        echo $events_nav;
//.........这里部分代码省略.........
开发者ID:hypenotic,项目名称:slowfood,代码行数:101,代码来源:em-events.php

示例8: em_bookings_events_table

/**
 * Determines whether to show event page or events page, and saves any updates to the event or events
 * @return null
 */
function em_bookings_events_table()
{
    //TODO Simplify panel for events, use form flags to detect certain actions (e.g. submitted, etc)
    global $wpdb;
    global $EM_Event;
    $scope_names = array('past' => __('Past events', 'dbem'), 'all' => __('All events', 'dbem'), 'future' => __('Future events', 'dbem'));
    $action_scope = !empty($_REQUEST['em_obj']) && $_REQUEST['em_obj'] == 'em_bookings_events_table';
    $action = $action_scope && !empty($_GET['action']) ? $_GET['action'] : '';
    $order = $action_scope && !empty($_GET['order']) ? $_GET['order'] : 'ASC';
    $limit = $action_scope && !empty($_GET['limit']) ? $_GET['limit'] : 20;
    //Default limit
    $page = $action_scope && !empty($_GET['pno']) ? $_GET['pno'] : 1;
    $offset = $action_scope && $page > 1 ? ($page - 1) * $limit : 0;
    $scope = $action_scope && !empty($_GET['scope']) && array_key_exists($_GET['scope'], $scope_names) ? $_GET['scope'] : 'future';
    // No action, only showing the events list
    switch ($scope) {
        case "past":
            $title = __('Past Events', 'dbem');
            break;
        case "all":
            $title = __('All Events', 'dbem');
            break;
        default:
            $title = __('Future Events', 'dbem');
            $scope = "future";
    }
    $owner = !current_user_can('manage_others_bookings') ? get_current_user_id() : false;
    $events = EM_Events::get(array('scope' => $scope, 'limit' => $limit, 'offset' => $offset, 'order' => $order, 'bookings' => true, 'owner' => $owner));
    $events_count = EM_Events::count(array('scope' => $scope, 'limit' => 0, 'order' => $order, 'bookings' => true, 'owner' => $owner));
    $use_events_end = get_option('dbem_use_event_end');
    ?>

	<div class="wrap em_bookings_events_table em_obj">
		<form id="posts-filter" action="" method="get">
			<input type="hidden" name="em_obj" value="em_bookings_events_table" />
			<?php 
    if (!empty($_GET['page'])) {
        ?>

			<input type='hidden' name='page' value='events-manager-bookings' />
			<?php 
    }
    ?>
		
			<div class="tablenav">			
				<div class="alignleft actions">
					<!--
					<select name="action">
						<option value="-1" selected="selected"><?php 
    esc_html_e('Bulk Actions');
    ?>
</option>
						<option value="deleteEvents"><?php 
    esc_html_e('Delete selected', 'dbem');
    ?>
</option>
					</select> 
					<input type="submit" value="<?php 
    esc_html_e('Apply');
    ?>
" name="doaction2" id="doaction2" class="button-secondary action" />
					 --> 
					<select name="scope">
						<?php 
    foreach ($scope_names as $key => $value) {
        $selected = "";
        if ($key == $scope) {
            $selected = "selected='selected'";
        }
        echo "<option value='{$key}' {$selected}>{$value}</option>  ";
    }
    ?>

					</select>
					<input id="post-query-submit" class="button-secondary" type="submit" value="<?php 
    esc_html_e('Filter');
    ?>
" />
				</div>
				<!--
				<div class="view-switch">
					<a href="/wp-admin/edit.php?mode=list"><img class="current" id="view-switch-list" src="http://wordpress.lan/wp-includes/images/blank.gif" width="20" height="20" title="List View" alt="List View" name="view-switch-list" /></a> <a href="/wp-admin/edit.php?mode=excerpt"><img id="view-switch-excerpt" src="http://wordpress.lan/wp-includes/images/blank.gif" width="20" height="20" title="Excerpt View" alt="Excerpt View" name="view-switch-excerpt" /></a>
				</div>
				-->
				<?php 
    if ($events_count >= $limit) {
        $events_nav = em_admin_paginate($events_count, $limit, $page, array('em_ajax' => 0, 'em_obj' => 'em_bookings_events_table'));
        echo $events_nav;
    }
    ?>

			</div>
				
			<?php 
    if (empty($events)) {
        // TODO localize
//.........这里部分代码省略.........
开发者ID:pcco,项目名称:portal-redesign,代码行数:101,代码来源:em-events.php

示例9: _e

			<input type="submit" value="<?php 
        _e('Apply');
        ?>
" id="doaction2" class="button-secondary action" /> 
		</div>
		<?php 
    } else {
        $hide_checkboxes = true;
        /* @todo this and the first condition of this if statement will need to change when other bulk actions are added */
        ?>
		<?php 
    }
    ?>
		<?php 
    if ($locations_count >= $limit) {
        $locations_nav = em_admin_paginate($locations_count, $limit, $page);
        echo $locations_nav;
    }
    ?>
	</div>
	<table class='widefat'>
		<thead>
			<tr>
				<?php 
    if (empty($hide_checkboxes)) {
        ?>
				<th class='manage-column column-cb check-column' scope='col'><input type='checkbox' class='select-all' value='1'/></th>
				<?php 
    }
    ?>
				<th><?php 
开发者ID:javipaur,项目名称:TiendaVirtual,代码行数:31,代码来源:locations.php

示例10: view_page

    static function view_page()
    {
        global $EM_Notices, $EM_Coupon, $wpdb;
        //check that user can access this page
        if (is_object($EM_Coupon) && !$EM_Coupon->can_manage('manage_bookings', 'manage_others_bookings')) {
            ?>
			<div class="wrap"><h2><?php 
            esc_html_e_emp('Unauthorized Access', 'dbem');
            ?>
</h2><p><?php 
            echo sprintf(esc_html__emp('You do not have the rights to manage this %s.', 'dbem'), __('coupon', 'em-pro'));
            ?>
</p></div>
			<?php 
            return false;
        } elseif (!is_object($EM_Coupon)) {
            $EM_Coupon = new EM_Coupon();
        }
        $limit = !empty($_GET['limit']) ? $_GET['limit'] : 20;
        //Default limit
        $page = !empty($_GET['pno']) ? $_GET['pno'] : 1;
        $offset = $page > 1 ? ($page - 1) * $limit : 0;
        //a bit hacky, but this is the only way at least for now
        $coupon_search = str_replace('a:1:{', '', serialize(array('coupon_code' => $EM_Coupon->coupon_code)));
        $coupon_search = substr($coupon_search, 0, strlen($coupon_search) - 1);
        $bookings = $wpdb->get_col('SELECT booking_id FROM ' . EM_BOOKINGS_TABLE . " WHERE booking_meta LIKE '%{$coupon_search}%' LIMIT {$limit} OFFSET {$offset}");
        //FIXME : coupon count not syncing correctly, using this as a fallback
        $coupons_count = $wpdb->get_var('SELECT COUNT(*) FROM ' . EM_BOOKINGS_TABLE . " WHERE booking_meta LIKE '%{$coupon_search}%'");
        $bookings_count = 0;
        $EM_Bookings = array();
        foreach ($bookings as $booking_id) {
            $EM_Booking = em_get_booking($booking_id);
            if (!empty($EM_Booking->booking_meta['coupon'])) {
                $coupon = new EM_Coupon($EM_Booking->booking_meta['coupon']);
                if ($EM_Coupon->coupon_code == $coupon->coupon_code && $EM_Coupon->coupon_id == $coupon->coupon_id) {
                    $bookings_count++;
                    $EM_Bookings[] = $EM_Booking;
                }
            }
        }
        ?>
		<div class='wrap nosubsub'>
			<div class="icon32" id="icon-bookings"><br></div>
			<h2><?php 
        _e('Coupon Usage History', 'em-pro');
        ?>
</h2>
			<?php 
        echo $EM_Notices;
        ?>
			<p><?php 
        echo sprintf(__('You are viewing the details of coupon %s - <a href="%s">edit</a>', 'em-pro'), '<code>' . $EM_Coupon->coupon_code . '</code>', add_query_arg(array('action' => 'edit')));
        ?>
</p>
			<p>
				<strong><?php 
        echo __('Uses', 'em-pro');
        ?>
:</strong> 
				<?php 
        if (!empty($EM_Coupon->coupon_max)) {
            echo esc_html($coupons_count . ' / ' . $EM_Coupon->coupon_max);
        } else {
            echo esc_html($coupons_count . '/' . __('Unlimited', 'em-pro'));
        }
        ?>
			</p>
			<?php 
        if ($coupons_count >= $limit) {
            ?>
			<div class='tablenav'>
				<?php 
            $bookings_nav = em_admin_paginate($coupons_count, $limit, $page, array());
            echo $bookings_nav;
            ?>
				<div class="clear"></div>
			</div>
			<?php 
        }
        ?>
			<div class="clear"></div>
			<?php 
        if ($bookings_count > 0) {
            ?>
			<div class='table-wrap'>
				<table id='dbem-bookings-table' class='widefat post '>
					<thead>
						<tr>
							<th class='manage-column' scope='col'><?php 
            esc_html_e_emp('Event', 'dbem');
            ?>
</th>
							<th class='manage-column' scope='col'><?php 
            esc_html_e_emp('Booker', 'dbem');
            ?>
</th>
							<th class='manage-column' scope='col'><?php 
            esc_html_e_emp('Spaces', 'dbem');
            ?>
</th>
//.........这里部分代码省略.........
开发者ID:shieldsdesignstudio,项目名称:trilogic,代码行数:101,代码来源:coupons-admin.php

示例11: em_admin_locations

function em_admin_locations($message = '', $fill_fields = false)
{
    global $EM_Notices;
    $limit = !empty($_REQUEST['limit']) ? $_REQUEST['limit'] : 20;
    //Default limit
    $page = !empty($_REQUEST['pno']) ? $_REQUEST['pno'] : 1;
    $offset = $page > 1 ? ($page - 1) * $limit : 0;
    if (!empty($_REQUEST['owner']) && current_user_can('read_others_locations')) {
        $locations = EM_Locations::get(array('owner' => false));
        $locations_mine_count = EM_Locations::count(array('owner' => get_current_user_id()));
        $locations_all_count = count($locations);
    } else {
        $locations = EM_Locations::get(array('owner' => get_current_user_id(), 'blog' => false));
        $locations_mine_count = count($locations);
        $locations_all_count = current_user_can('read_others_locations') ? EM_Locations::count(array('blog' => false)) : 0;
    }
    $locations_count = count($locations);
    ?>
		<div class='wrap'>
			<div id='icon-edit' class='icon32'>
				<br/>
			</div>
 	 		<h2>
 	 			<?php 
    _e('Locations', 'dbem');
    ?>
 	 			<a href="admin.php?page=events-manager-locations&action=add" class="button add-new-h2"><?php 
    _e('Add New', 'dbem');
    ?>
</a>
 	 		</h2>  

			<?php 
    echo $EM_Notices;
    ?>
  
			  
		 	 <form id='locations-filter' method='post' action=''>
				<input type='hidden' name='page' value='locations'/>
				<input type='hidden' name='limit' value='<?php 
    echo $limit;
    ?>
' />	
				<input type='hidden' name='p' value='<?php 
    echo $page;
    ?>
' />	
				<div class="subsubsub">
					<a href='admin.php?page=events-manager-locations' <?php 
    echo empty($_REQUEST['owner']) ? 'class="current"' : '';
    ?>
><?php 
    echo sprintf(__('My %s', 'dbem'), __('Locations', 'dbem'));
    ?>
 <span class="count">(<?php 
    echo $locations_mine_count;
    ?>
)</span></a>
					<?php 
    if (current_user_can('read_others_locations')) {
        ?>
					&nbsp;|&nbsp;
					<a href='admin.php?page=events-manager-locations&amp;owner=all' <?php 
        echo !empty($_REQUEST['owner']) ? 'class="current"' : '';
        ?>
><?php 
        echo sprintf(__('All %s', 'dbem'), __('Locations', 'dbem'));
        ?>
 <span class="count">(<?php 
        echo $locations_all_count;
        ?>
)</span></a>
					<?php 
    }
    ?>
				</div>										
				<?php 
    if ($locations_count > 0) {
        ?>
				<div class='tablenav'>					
					<div class="alignleft actions">
						<select name="action">
							<option value="" selected="selected"><?php 
        _e('Bulk Actions');
        ?>
</option>
							<option value="location_delete"><?php 
        _e('Delete selected', 'dbem');
        ?>
</option>
						</select> 
						<input type="submit" value="<?php 
        _e('Apply');
        ?>
" id="doaction2" class="button-secondary action" /> 
					</div>
						<?php 
        if ($locations_count >= $limit) {
            $locations_nav = em_admin_paginate($locations_count, $limit, $page);
            echo $locations_nav;
//.........这里部分代码省略.........
开发者ID:hypenotic,项目名称:slowfood,代码行数:101,代码来源:em-locations.php

示例12: em_admin_events_page


//.........这里部分代码省略.........
</option>
						<option value="event_delete"><?php 
    _e('Delete selected', 'dbem');
    ?>
</option>
					</select> 
					<input type="submit" value="<?php 
    _e('Apply');
    ?>
" name="doaction2" id="doaction2" class="button-secondary action" /> 
					<select name="scope">
						<?php 
    foreach ($scope_names as $key => $value) {
        $selected = "";
        if ($key == $scope) {
            $selected = "selected='selected'";
        }
        echo "<option value='{$key}' {$selected}>{$value}</option>  ";
    }
    ?>
					</select> 
					<input id="post-query-submit" class="button-secondary" type="submit" value="<?php 
    _e('Filter');
    ?>
" />
				</div>
				<!--
				<div class="view-switch">
					<a href="/wp-admin/edit.php?mode=list"><img class="current" id="view-switch-list" src="http://wordpress.lan/wp-includes/images/blank.gif" width="20" height="20" title="List View" alt="List View" name="view-switch-list" /></a> <a href="/wp-admin/edit.php?mode=excerpt"><img id="view-switch-excerpt" src="http://wordpress.lan/wp-includes/images/blank.gif" width="20" height="20" title="Excerpt View" alt="Excerpt View" name="view-switch-excerpt" /></a>
				</div>
				-->
				<?php 
    if ($events_count >= $limit) {
        $events_nav = em_admin_paginate($events_count, $limit, $page);
        echo $events_nav;
    }
    ?>
				<br class="clear" />
			</div>
				
			<?php 
    if (empty($events)) {
        // TODO localize
        _e('no events', 'dbem');
    } else {
        ?>
					
			<table class="widefat events-table">
				<thead>
					<tr>
						<th class='manage-column column-cb check-column' scope='col'>
							<input class='select-all' type="checkbox" value='1' />
						</th>
						<th><?php 
        _e('Name', 'dbem');
        ?>
</th>
						<th>&nbsp;</th>
						<th><?php 
        _e('Location', 'dbem');
        ?>
</th>
						<th colspan="2"><?php 
        _e('Date and time', 'dbem');
        ?>
</th>
开发者ID:hypenotic,项目名称:slowfood,代码行数:67,代码来源:em-events.php

示例13: mytransactions


//.........这里部分代码省略.........
' <?php 
                if ($EM_Gateway->gateway == $this->gateway) {
                    echo "selected='selected'";
                }
                ?>
><?php 
                echo $EM_Gateway->title;
                ?>
</option><?php 
            }
            ?>
					</select>
					<input id="post-query-submit" class="button-secondary" type="submit" value="<?php 
            _e('Filter');
            ?>
" />
					<?php 
            if (is_object($context) && get_class($context) == "EM_Event") {
                ?>
					<?php 
                esc_html_e_emp('Displaying Event', 'dbem');
                ?>
 : <?php 
                echo $context->event_name;
                ?>
					<?php 
            } elseif (is_object($context) && get_class($context) == "EM_Person") {
                ?>
					<?php 
                esc_html_e_emp('Displaying User', 'dbem');
                echo ' : ' . $context->get_name();
                ?>
					<?php 
            }
            ?>
				</div>
				<?php 
            if ($this->total_transactions >= $this->limit) {
                echo em_admin_paginate($this->total_transactions, $this->limit, $this->page, array(), '#%#%', '#');
            }
            ?>
			</div>

			<div class="table-wrap">
			<table cellspacing="0" class="widefat">
				<thead>
				<tr>
				<?php 
            foreach ($columns as $key => $col) {
                ?>
						<th style="" class="manage-column column-<?php 
                echo $key;
                ?>
" id="<?php 
                echo $key;
                ?>
" scope="col"><?php 
                echo $col;
                ?>
</th>
						<?php 
            }
            ?>
				</tr>
				</thead>

				<tfoot>
				<tr>
					<?php 
            reset($columns);
            foreach ($columns as $key => $col) {
                ?>
							<th style="" class="manage-column column-<?php 
                echo $key;
                ?>
" id="<?php 
                echo $key;
                ?>
" scope="col"><?php 
                echo $col;
                ?>
</th>
							<?php 
            }
            ?>
				</tr>
				</tfoot>

				<tbody>
					<?php 
            echo $this->print_transactions($transactions);
            ?>

				</tbody>
			</table>
			</div>
		</form>
		</div>
		<?php 
        }
开发者ID:shieldsdesignstudio,项目名称:trilogic,代码行数:101,代码来源:gateways.transactions.php

示例14: em_admin_events_page


//.........这里部分代码省略.........
						<option value="deleteEvents"><?php 
    _e('Delete selected', 'dbem');
    ?>
</option>
					</select> 
					<input type="submit" value="<?php 
    _e('Apply');
    ?>
" name="doaction2" id="doaction2" class="button-secondary action" /> 
					<select name="scope">
						<?php 
    foreach ($scope_names as $key => $value) {
        $selected = "";
        if ($key == $scope) {
            $selected = "selected='selected'";
        }
        echo "<option value='{$key}' {$selected}>{$value}</option>  ";
    }
    ?>
					</select> 
					<input id="post-query-submit" class="button-secondary" type="submit" value="<?php 
    _e('Filter');
    ?>
" />
				</div>
				<!--
				<div class="view-switch">
					<a href="/wp-admin/edit.php?mode=list"><img class="current" id="view-switch-list" src="http://wordpress.lan/wp-includes/images/blank.gif" width="20" height="20" title="List View" alt="List View" name="view-switch-list" /></a> <a href="/wp-admin/edit.php?mode=excerpt"><img id="view-switch-excerpt" src="http://wordpress.lan/wp-includes/images/blank.gif" width="20" height="20" title="Excerpt View" alt="Excerpt View" name="view-switch-excerpt" /></a>
				</div>
				-->
				<?php 
    if ($events_count >= $limit) {
        $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno' => '%PAGE%'));
        $events_nav = em_admin_paginate($page_link_template, $events_count, $limit, $page, 5);
        echo $events_nav;
    }
    ?>
				<br class="clear" />
			</div>
				
			<?php 
    if (empty($events)) {
        // TODO localize
        _e('no events', 'dbem');
    } else {
        ?>
					
			<table class="widefat">
				<thead>
					<tr>
						<th class='manage-column column-cb check-column' scope='col'>
							<input class='select-all' type="checkbox" value='1' />
						</th>
						<th><?php 
        _e('Name', 'dbem');
        ?>
</th>
						<th>&nbsp;</th>
						<th><?php 
        _e('Location', 'dbem');
        ?>
</th>
						<th colspan="2"><?php 
        _e('Date and time', 'dbem');
        ?>
</th>
开发者ID:hypenotic,项目名称:slowfood,代码行数:67,代码来源:em-events.php


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