本文整理汇总了PHP中get_number_of_attendees_reg_limit函数的典型用法代码示例。如果您正苦于以下问题:PHP get_number_of_attendees_reg_limit函数的具体用法?PHP get_number_of_attendees_reg_limit怎么用?PHP get_number_of_attendees_reg_limit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_number_of_attendees_reg_limit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: espresso_verify_sufficient_remaining_tickets
/**
* Checks if the specified event still has $tickets_requested available, and returns true or false.
* Takes into account INCOMPLETE registrations for a few minutes (specified by admin by the "Ticket Reservation Time".
* @param int $event_id
* @param array $data_source like $_POST
* @return boolean
*/
function espresso_verify_sufficient_remaining_tickets($event_id, $data_source)
{
//query for availables spaces, counting INCOMPLETE tickets being purchased by OTHERS within the last X
//minutes as being 'reserved'
$available_spaces = get_number_of_attendees_reg_limit($event_id, 'number_available_spaces');
$tickets_requested = espresso_count_tickets_requested($data_source);
if ($available_spaces >= $tickets_requested) {
return true;
} else {
//the global $only_show_event_full_message_once_for is ONLY used here.
//it is used to make sure that for MER, we only show this message once per event
//because code will pass through this function once for EACH attendee
global $wpdb, $only_show_event_full_message_once_for;
$event_name = $wpdb->get_var($wpdb->prepare("SELECT event_name FROM " . EVENTS_DETAIL_TABLE . " WHERE id=%d", $event_id));
if ($only_show_event_full_message_once_for[$event_id]) {
echo '<div class="attention-icon"><p class="event_espresso_attention"><strong>' . sprintf(__('Sorry, you have requested %1$d ticket(s) for \'%2$s\', but only %3$d remains(s). ', 'event_espresso'), $tickets_requested, $event_name, $available_spaces) . __("All other tickets for this event have been sold, or are being purchased. You may want to try registering later, in case someone doesn't finish registering or cancels", "event_espresso") . '</strong></p></div>';
}
$only_show_event_full_message_once_for[$event_id] = true;
return false;
}
}
示例2: espresso_get_table
function espresso_get_table($sql)
{
global $wpdb, $org_options;
//echo 'This page is located in ' . get_option( 'upload_path' );
$event_page_id = $org_options['event_page_id'];
$currency_symbol = $org_options['currency_symbol'];
$events = $wpdb->get_results($sql);
$category_name = $wpdb->last_result[0]->category_name;
$category_desc = $wpdb->last_result[0]->category_desc;
$display_desc = $wpdb->last_result[0]->display_desc;
if ($display_desc == 'Y') {
echo '<p>' . stripslashes_deep($category_name) . '</p>';
echo '<p>' . stripslashes_deep($category_desc) . '</p>';
}
?>
<table class="espresso-table" width="100%">
<thead class="espresso-table-header-row">
<tr>
<th class="th-group"><?php
_e('Course', 'event_espresso');
?>
</th>
<th class="th-group"><?php
_e('Location', 'event_espresso');
?>
</th>
<th class="th-group"><?php
_e('City', 'event_espresso');
?>
</th>
<th class="th-group"><?php
_e('State', 'event_espresso');
?>
</th>
<th class="th-group"><?php
_e('Date', 'event_espresso');
?>
</th>
<th class="th-group"><?php
_e('Time', 'event_espresso');
?>
</th>
<th class="th-group"><?php
_e('', 'event_espresso');
?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach ($events as $event) {
$reg_limit = $event->reg_limit;
$event_desc = wpautop($event->event_desc);
$register_button = '<a id="a_register_link-' . $event->id . '" href="' . get_option('siteurl') . '/?page_id=' . $event_page_id . '®event_action=register&event_id=' . $event->id . '&name_of_event=' . stripslashes_deep($event->event_name) . '">Register</a>';
//Check to see how many open spots are available
$open_spots = get_number_of_attendees_reg_limit($event->id, 'available_spaces') == 'Unlimited' ? 999 : get_number_of_attendees_reg_limit($event->id, 'available_spaces');
//echo $open_spots;
if ($open_spots < 1) {
$live_button = 'Closed';
}
?>
<tr class="espresso-table-row">
<td class="td-group">
<?php
echo $event->event_name;
?>
</td>
<td class="td-group">
<?php
echo $event->address;
?>
</td>
<td class="td-group">
<?php
echo $event->city;
?>
</td>
<td class="td-group">
<?php
echo $event->state;
?>
</td>
<td class="td-group">
<?php
echo event_date_display($event->start_date, $format = 'l, M d, Y');
?>
</td>
<td class="td-group">
<?php
echo espresso_event_time($event->id, 'start_time', get_option('time_format'));
?>
</td>
<td class="td-group">
<?php
echo $register_button;
?>
</td>
//.........这里部分代码省略.........
示例3: add_new_attendee
function add_new_attendee($event_id)
{
if (isset($_REQUEST['regevent_action_admin']) && $_REQUEST['regevent_action_admin'] == 'post_attendee') {
require_once EVENT_ESPRESSO_PLUGINFULLPATH . "includes/functions/attendee_functions.php";
require_once EVENT_ESPRESSO_PLUGINFULLPATH . "includes/process-registration/add_attendees_to_db.php";
$attendee_id = event_espresso_add_attendees_to_db();
if ($attendee_id) {
// SEND CONFIRMATION EMAIL MESSAGES
event_espresso_email_confirmations(array('attendee_id' => $attendee_id, 'send_admin_email' => 'true', 'send_attendee_email' => 'true'));
//echo $attendee_id;
?>
<div id="message" class="updated fade">
<p><strong>
<?php
_e('Added Attendee to Database', 'event_espresso');
?>
</strong></p>
</div>
<?php
} else {
global $notifications;
$error_msg = implode($notifications['error'], '<br />');
?>
<div id="message" class="error">
<p>
<strong><?php
echo $error_msg;
?>
</strong>
</p>
</div>
<?php
}
}
wp_register_script('reCopy', EVENT_ESPRESSO_PLUGINFULLURL . "scripts/reCopy.js", false, '1.1.0');
wp_print_scripts('reCopy');
global $wpdb;
$sql = "SELECT * FROM " . EVENTS_DETAIL_TABLE . " WHERE is_active='Y' AND event_status != 'D' AND id = '" . $event_id . "' LIMIT 0,1";
//Build the registration page
if ($wpdb->get_results($sql)) {
$events = $wpdb->get_results($sql);
//These are the variables that can be used throughout the regsitration page
foreach ($events as $event) {
$event_id = $event->id;
$event_name = stripslashes($event->event_name);
$event_desc = stripslashes($event->event_desc);
$display_desc = $event->display_desc;
$event_address = $event->address;
$event_city = $event->city;
$event_state = $event->state;
$event_zip = $event->zip;
$event_description = stripslashes($event->event_desc);
$event_identifier = $event->event_identifier;
$event_cost = isset($event->event_cost) ? $event->event_cost : '';
$member_only = isset($event->member_only) ? $event->member_only : '';
$reg_limit = isset($event->reg_limit) ? $event->reg_limit : '';
$allow_multiple = $event->allow_multiple;
$start_date = $event->start_date;
$end_date = $event->end_date;
$reg_limit = $event->reg_limit;
$additional_limit = $event->additional_limit;
$is_active = array();
$question_groups = unserialize($event->question_groups);
//This function gets the status of the event.
$is_active = event_espresso_get_is_active($event_id);
//If the coupon code system is intalled then use it
if (function_exists('event_espresso_coupon_registration_page')) {
$use_coupon_code = $event->use_coupon_code;
}
//If the groupon code addon is installed, then use it
if (function_exists('event_espresso_groupon_payment_page')) {
$use_groupon_code = $event->use_groupon_code;
}
//Set a default value for additional limit
if ($additional_limit == '') {
$additional_limit = '5';
}
}
//End foreach ($events as $event)
//This is the start of the registration form. This is where you can start editing your display.
$num_attendees = get_number_of_attendees_reg_limit($event_id, 'num_attendees');
//Get the number of attendees
$available_spaces = get_number_of_attendees_reg_limit($event_id, 'available_spaces');
//Gets a count of the available spaces
$number_available_spaces = get_number_of_attendees_reg_limit($event_id, 'number_available_spaces');
//Gets the number of available spaces
?>
<script>$jaer = jQuery.noConflict();
jQuery(document).ready(function($jaer) {
jQuery(function(){
//Registration form validation
jQuery('#espresso-admin-add-new-attendee-frm').validate();
});
});
</script>
<div class="metabox-holder">
<div class="postbox">
<div id="espresso-admin-add-new-attendee-dv">
//.........这里部分代码省略.........
示例4: add_new_attendee
function add_new_attendee($event_id)
{
if (isset($_REQUEST['regevent_action_admin']) && $_REQUEST['regevent_action_admin'] == 'post_attendee') {
$attendee_id = event_espresso_add_attendees_to_db();
// SEND CONFIRMATION EMAIL MESSAGES
event_espresso_email_confirmations(array('attendee_id' => $attendee_id, 'send_admin_email' => 'true', 'send_attendee_email' => 'true'));
//echo $attendee_id;
?>
<div id="message" class="updated fade">
<p><strong>
<?php
_e('Added Attendee to Database', 'event_espresso');
?>
</strong></p>
</div>
<?php
}
wp_register_script('reCopy', EVENT_ESPRESSO_PLUGINFULLURL . "scripts/reCopy.js", false, '1.1.0');
wp_print_scripts('reCopy');
global $wpdb;
$sql = "SELECT * FROM " . EVENTS_DETAIL_TABLE . " WHERE is_active='Y' AND event_status != 'D' AND id = '" . $event_id . "' LIMIT 0,1";
//Build the registration page
if ($wpdb->get_results($sql)) {
$events = $wpdb->get_results($sql);
//These are the variables that can be used throughout the regsitration page
foreach ($events as $event) {
$event_id = $event->id;
$event_name = stripslashes($event->event_name);
$event_desc = stripslashes($event->event_desc);
$display_desc = $event->display_desc;
$event_address = $event->address;
$event_city = $event->city;
$event_state = $event->state;
$event_zip = $event->zip;
$event_description = stripslashes($event->event_desc);
$event_identifier = $event->event_identifier;
$event_cost = isset($event->event_cost) ? $event->event_cost : '';
$member_only = isset($event->member_only) ? $event->member_only : '';
$reg_limit = isset($event->reg_limit) ? $event->reg_limit : '';
$allow_multiple = $event->allow_multiple;
$start_date = $event->start_date;
$end_date = $event->end_date;
$reg_limit = $event->reg_limit;
$additional_limit = $event->additional_limit;
$is_active = array();
$question_groups = unserialize($event->question_groups);
//This function gets the status of the event.
$is_active = event_espresso_get_is_active($event_id);
//If the coupon code system is intalled then use it
if (function_exists('event_espresso_coupon_registration_page')) {
$use_coupon_code = $event->use_coupon_code;
}
//If the groupon code addon is installed, then use it
if (function_exists('event_espresso_groupon_payment_page')) {
$use_groupon_code = $event->use_groupon_code;
}
//Set a default value for additional limit
if ($additional_limit == '') {
$additional_limit = '5';
}
}
//End foreach ($events as $event)
//This is the start of the registration form. This is where you can start editing your display.
$num_attendees = get_number_of_attendees_reg_limit($event_id, 'num_attendees');
//Get the number of attendees
$available_spaces = get_number_of_attendees_reg_limit($event_id, 'available_spaces');
//Gets a count of the available spaces
$number_available_spaces = get_number_of_attendees_reg_limit($event_id, 'number_available_spaces');
//Gets the number of available spaces
?>
<script>$jaer = jQuery.noConflict();
jQuery(document).ready(function($jaer) {
jQuery(function(){
//Registration form validation
jQuery('#registration_form').validate();
});
});
</script>
<div class="metabox-holder">
<div class="postbox">
<div id="event_espressotration_form">
<form method="post" action="<?php
echo $_SERVER['REQUEST_URI'];
?>
" onsubmit="return validateForm(this)" id="registration_form">
<h3 class="h3_event_title" id="h3_event_title-<?php
echo $event_id;
?>
"><?php
echo $event_name;
?>
</h3>
<div class="padding">
<p class="start_date">
<?php
_e('Start Date:', 'event_espresso');
?>
<?php
//.........这里部分代码省略.........
示例5: event_espresso_edit_list
//.........这里部分代码省略.........
?>
<br />
<?php
echo $registration_startT;
?>
</td>
<td class="date"><?php
echo $status['display'];
?>
</td>
<?php
if (function_exists('espresso_is_admin') && espresso_is_admin() == true && $espresso_premium == true) {
$user_company = espresso_user_meta($wp_user, 'company') != '' ? espresso_user_meta($wp_user, 'company') : '';
$user_organization = espresso_user_meta($wp_user, 'organization') != '' ? espresso_user_meta($wp_user, 'organization') : '';
$user_co_org = $user_company != '' ? $user_company : $user_organization;
?>
<td class="date"><?php
echo espresso_user_meta($wp_user, 'user_firstname') != '' ? espresso_user_meta($wp_user, 'user_firstname') . ' ' . espresso_user_meta($wp_user, 'user_lastname') . ' (<a href="user-edit.php?user_id=' . $wp_user . '">' . espresso_user_meta($wp_user, 'user_nicename') . '</a>)' : espresso_user_meta($wp_user, 'display_name') . ' (<a href="user-edit.php?user_id=' . $wp_user . '">' . espresso_user_meta($wp_user, 'user_nicename') . '</a>)';
?>
<?php
echo $user_co_org != '' ? '<br />[' . espresso_user_meta($wp_user, 'company') . ']' : '';
?>
</td>
<?php
}
?>
<td class="author"><a href="admin.php?page=events&event_admin_reports=list_attendee_payments&event_id=<?php
echo $event_id;
?>
"><?php
echo get_number_of_attendees_reg_limit($event_id, 'num_attendees_slash_reg_limit');
?>
</a></td>
<td class="date"><div style="width:180px;"><a href="<?php
echo espresso_reg_url($event_id);
?>
" title="<?php
_e('View Event', 'event_espresso');
?>
" target="_blank"><div class="view_btn"></div></a>
<a href="admin.php?page=events&action=edit&event_id=<?php
echo $event_id;
?>
" title="<?php
_e('Edit Event', 'event_espresso');
?>
"><div class="edit_btn"></div></a>
<a href="admin.php?page=events&event_id=<?php
echo $event_id;
?>
&event_admin_reports=list_attendee_payments" title="<?php
_e('View Attendees', 'event_espresso');
?>
"><div class="complete_btn"></div></a>
<a href="admin.php?page=events&event_admin_reports=charts&event_id=<?php
echo $event_id;
?>
" title="<?php
_e('View Report', 'event_espresso');
?>
"><div class="reports_btn"></div></a>
示例6: espresso_event_export
//.........这里部分代码省略.........
}
if (isset($_REQUEST['today']) && $_REQUEST['today'] == 'true') {
$sql .= " AND start_date = '" . $curdate . "' ";
}
if (isset($_REQUEST['this_month']) && $_REQUEST['this_month'] == 'true') {
$sql .= " AND start_date BETWEEN '" . date('Y-m-d', strtotime($this_year_r . '-' . $this_month_r . '-01')) . "' AND '" . date('Y-m-d', strtotime($this_year_r . '-' . $this_month_r . '-' . $days_this_month)) . "' ";
}
if (function_exists('espresso_member_data') && (espresso_member_data('role') == 'espresso_event_manager' || espresso_member_data('role') == 'espresso_group_admin')) {
$sql .= " AND wp_user = '" . espresso_member_data('id') . "' ";
}
$sql .= ") ORDER BY start_date = '0000-00-00' ASC, start_date ASC, event_name ASC";
ob_start();
//echo $sql;
$today = date("Y-m-d-Hi", time());
$filename = $_REQUEST['all_events'] == "true" ? __('all-events', 'event_espresso') : sanitize_title_with_dashes($event_name);
$filename = $filename . "-" . $today;
switch ($_REQUEST['type']) {
case "csv":
$st = "";
$et = ",";
$s = $et . $st;
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=" . $filename . ".csv");
header("Pragma: no-cache");
header("Expires: 0");
echo implode($s, $htables) . "\r\n";
break;
default:
$st = "";
$et = "\t";
$s = $et . $st;
header("Content-Disposition: attachment; filename=" . $filename . ".xls");
header("Content-Type: application/vnd.ms-excel");
header("Pragma: no-cache");
header("Expires: 0");
echo implode($s, $htables) . $et . "\r\n";
break;
}
$events = $wpdb->get_results($sql);
foreach ($events as $event) {
$event_id = $event->event_id;
$event_name = stripslashes_deep($event->event_name);
$event_identifier = stripslashes_deep($event->event_identifier);
$reg_limit = $event->reg_limit;
$registration_start = $event->registration_start;
$start_date = event_date_display($event->start_date, 'Y-m-d');
$end_date = event_date_display($event->end_date, 'Y-m-d');
$is_active = $event->is_active;
$status = array();
$status = event_espresso_get_is_active($event_id);
$recurrence_id = $event->recurrence_id;
$registration_startT = $event->registration_startT;
//Venue variables
if (isset($org_options['use_venue_manager']) && $org_options['use_venue_manager'] == 'Y') {
//$data = new stdClass;
//$data->event->venue_meta = unserialize($event->venue_meta);
//Debug
//echo "<pre>".print_r($data->event->venue_meta,true)."</pre>";
$venue_title = $event->venue_name;
/*$data->event->venue_url = $data->event->venue_meta['website'];
$data->event->venue_phone = $data->event->venue_meta['phone'];
$data->event->venue_image = '<img src="'.$data->event->venue_meta['image'].'" />';
$data->event->address = $data->event->venue_address;
$data->event->address2 = $data->event->venue_address2;
$data->event->city = $data->event->venue_city;
$data->event->state = $data->event->venue_state;
$data->event->zip = $data->event->venue_zip;
$data->event->country = $data->event->venue_country;*/
} else {
$venue_title = $event->venue_title;
/*$event_address = $event->address;
$event_address2 = $event->address2;
$event_city = $event->city;
$event_state = $event->state;
$event_zip = $event->zip;
$event_country = $event->country;
$event_phone = $event->phone;*/
}
$wp_user = $event->wp_user;
//$location = ($event_address != '' ? $event_address :'') . ($event_address2 != '' ? '<br />' . $event_address2 :'') . ($event_city != '' ? '<br />' . $event_city :'') . ($event_state != '' ? ', ' . $event_state :'') . ($event_zip != '' ? '<br />' . $event_zip :'') . ($event_country != '' ? '<br />' . $event_country :'');
$dow = date("D", strtotime($start_date));
echo $event_id . $s . $event_name . $s . $venue_title . $s . $start_date . $s . event_espresso_get_time($event_id, 'start_time') . $s . $dow . $s . str_replace(',', ' ', event_date_display($registration_start, get_option('date_format')));
// ticket 570
if (function_exists('espresso_is_admin') && espresso_is_admin() == true && (isset($espresso_premium) && $espresso_premium == true)) {
$user_company = espresso_user_meta($wp_user, 'company') != '' ? espresso_user_meta($wp_user, 'company') : '';
$user_organization = espresso_user_meta($wp_user, 'organization') != '' ? espresso_user_meta($wp_user, 'organization') : '';
$user_co_org = $user_company != '' ? $user_company : $user_organization;
echo $s . (espresso_user_meta($wp_user, 'user_firstname') != '' ? espresso_user_meta($wp_user, 'user_firstname') . ' ' . espresso_user_meta($wp_user, 'user_lastname') : espresso_user_meta($wp_user, 'display_name'));
}
echo $s . strip_tags($status['display']) . $s . str_replace('/', ' of ', get_number_of_attendees_reg_limit($event_id, 'num_attendees_slash_reg_limit'));
switch ($_REQUEST['type']) {
case "csv":
echo "\r\n";
break;
default:
echo $et . "\r\n";
break;
}
}
}
示例7: _e
_e('Join Waiting List', 'event_espresso');
?>
</a></p>
<?php
}
} else {
if ($display_reg_form == 'Y' && $externalURL == '') {
?>
<p id="available_spaces-<?php
echo $event_id;
?>
" class="spaces-available"><span class="section-title"><?php
_e('Available Spaces:', 'event_espresso');
?>
</span> <?php
echo get_number_of_attendees_reg_limit($event_id, 'available_spaces');
?>
</p>
<?php
}
/**
* Load the multi event link.
* */
//Un-comment these next lines to check if the event is active
//echo event_espresso_get_status($event_id);
//print_r( event_espresso_get_is_active($event_id));
if ($multi_reg && event_espresso_get_status($event_id) == 'ACTIVE') {
$params = array('event_id' => $event_id, 'anchor' => __("Add to Cart", 'event_espresso'), 'event_name' => $event_name, 'separator' => __(" or ", 'event_espresso'));
$cart_link = event_espresso_cart_link($params);
}
if ($display_reg_form == 'Y') {
示例8: multi_register_attendees
//.........这里部分代码省略.........
$item_groups = unserialize($event->item_groups);
$event_meta = maybe_unserialize($event->event_meta);
//printr( $event_meta, '$event_meta <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
//This function gets the status of the event.
//$is_active = event_espresso_get_status($event_id, $event_meta);
$is_active = event_espresso_get_is_active($event_id, $event_meta);
//If the coupon code system is intalled then use it
$use_coupon_code = function_exists('event_espresso_coupon_registration_page') ? $event->use_coupon_code : FALSE;
//If the groupon code addon is installed, then use it
$use_groupon_code = function_exists('event_espresso_groupon_payment_page') ? $event->use_groupon_code : FALSE;
//Set a default value for additional limit
if ($additional_limit == '') {
$additional_limit = '5';
}
$add_attendee_question_groups = $event_meta['add_attendee_question_groups'];
if ($org_options['use_captcha'] == 'Y' && isset($_REQUEST['edit_details']) && $_REQUEST['edit_details'] != 'true') {
?>
<script type="text/javascript">
var RecaptchaOptions = {
theme : '<?php
echo $org_options['recaptcha_theme'] == '' ? 'red' : $org_options['recaptcha_theme'];
?>
',
lang : '<?php
echo $org_options['recaptcha_language'] == '' ? 'en' : $org_options['recaptcha_language'];
?>
'
};
</script>
<?php
}
//************* This is the start of the registration form. This is where you can start editing your display. *************
//Get the number of attendees
$num_attendees = get_number_of_attendees_reg_limit($event_id, 'num_attendees');
//Gets a count of the available spaces
$available_spaces = get_number_of_attendees_reg_limit($event_id, 'available_spaces');
//Gets the number of available spaces
$number_available_spaces = get_number_of_attendees_reg_limit($event_id, 'number_available_spaces');
//Please visit http://eventespresso.com/forums/?p=247 for available parameters for the get_number_of_attendees_reg_limit() function.
if ($available_spaces == "Unlimited" || $available_spaces >= $number_available_spaces) {
//(Shows the regsitration form if enough spaces exist)
// SOLD OUT !!!
if ($num_attendees >= $reg_limit) {
?>
<div class="espresso_event_full event-display-boxes" id="espresso_event_full-<?php
echo $event_id;
?>
">
<h3 class="event_title"><?php
echo stripslashes_deep($event_name);
?>
</h3>
<p class="event_full"><strong><?php
_e('We are sorry but this event has reached the maximum number of attendees!', 'event_espresso');
?>
</strong></p>
<p class="event_full"><strong><?php
_e('Please check back in the event someone cancels.', 'event_espresso');
?>
</strong></p>
<p class="num_attendees"><?php
_e('Current Number of Attendees:', 'event_espresso');
?>
<?php
echo $num_attendees;
?>
示例9: espresso_calendar_do_stuff
//.........这里部分代码省略.........
break;
}
} else {
switch ($espresso_calendar['espresso_page_post']) {
case 'P':
$registration_url = get_home_url() . '/?p=' . $event->post_id;
break;
case 'R':
default:
$registration_url = get_home_url() . '/?page_id=' . $org_options['event_page_id'] . '®event_action=register&event_id=' . $event->id;
break;
}
}
}
//Checkthe status of the event. If the event is expired, the link to the registration page will be deactivated.
$eventArray['url'] = '';
$status = '';
//Changed 8-30-2011 by Seth
/* switch (event_espresso_get_status($event->id)){
case 'NOT_ACTIVE':
$status = ' - ' . __('Expired','event_espresso');
break;
case 'ACTIVE':
$status = '';
break;
} */
//End Seth
// Build calendar array from $event data
//Gets the URL of the event and links the event to the registration form.
$eventArray['url'] = $event->externalURL != '' ? htmlspecialchars_decode($event->externalURL) : $registration_url;
//Id of the event
$eventArray['id'] = $event->id;
if (isset($espresso_calendar['show_attendee_limit']) && $espresso_calendar['show_attendee_limit'] == true) {
$orig_attendee_limit = get_number_of_attendees_reg_limit($event->id, $type = 'num_attendees_slash_reg_limit');
$parse_limits = explode('/', $orig_attendee_limit, 2);
$num_completed = $parse_limits[0];
$reg_limit = $parse_limits[1];
if ($reg_limit >= 999999) {
$eventArray['attendee_limit'] = __('UNL', 'event_espresso');
} else {
$eventArray['attendee_limit'] = $num_completed . '/' . $reg_limit;
}
}
//Get the title of the event
$ee_event_title = htmlspecialchars_decode(stripslashes_deep($event->event_name . $status), ENT_QUOTES);
$eventArray['title'] = $ee_event_title;
//Gets the description of the event. This can be used for hover effects such as jQuery Tooltips or QTip
if (isset($espresso_calendar['show_tooltips']) && $espresso_calendar['show_tooltips'] == true) {
$eventArray['description'] = espresso_format_content($event->event_desc);
}
//Supports 3.2 short descriptions
if (isset($org_options['template_settings']['display_short_description_in_event_list']) && $org_options['template_settings']['display_short_description_in_event_list'] == true) {
$eventArray['description'] = array_shift(explode('<!--more-->', $eventArray['description']));
}
//Supports 3.1 short descriptions
if (isset($org_options['display_short_description_in_event_list']) && $org_options['display_short_description_in_event_list'] == 'Y') {
$eventArray['description'] = array_shift(explode('<!--more-->', $eventArray['description']));
}
$eventArray['display_reg_form'] = $event->display_reg_form;
//Get the start and end times for each event
//important! time must be in iso8601 format 2010-05-10T08:30!!
$eventArray['start'] = date("c", strtotime($event->start_date . ' ' . event_date_display($event->start_time, get_option('time_format'))));
$eventArray['end'] = date("c", strtotime($event->end_date . ' ' . event_date_display($event->end_time, get_option('time_format'))));
$eventArray['day'] = date("j", strtotime($event->end_date));
$eventArray['month'] = date("n", strtotime($event->end_date));
if ($eventArray['end'] < date('Y-m-d')) {
示例10: event_espresso_group_price_dropdown
function event_espresso_group_price_dropdown($event_id, $label = 1, $multi_reg = 0, $value = '')
{
global $wpdb, $org_options;
do_action('action_hook_espresso_log', __FILE__, __FUNCTION__, '');
/*
* find out pricing type.
* - If multiple price options, for each one
* -- Create a row in a table with a name
* -- qty dropdown
*
*/
//Will make the name an array and put the time id as a key so we
//know which event this belongs to
$multi_name_adjust = $multi_reg == 1 ? "[{$event_id}]" : '';
$SQL = "SELECT ept.id, ept.event_cost, ept.surcharge, ept.surcharge_type, ept.price_type, edt.allow_multiple, edt.additional_limit ";
$SQL .= "FROM " . EVENTS_PRICES_TABLE . " ept ";
$SQL .= "JOIN " . EVENTS_DETAIL_TABLE . " edt ON ept.event_id = edt.id ";
$SQL .= "WHERE event_id=%d ORDER BY ept.id ASC";
// filter SQL statement
$SQL = apply_filters('filter_hook_espresso_group_price_dropdown_sql', $SQL);
// get results
$results = $wpdb->get_results($wpdb->prepare($SQL, $event_id));
if ($wpdb->num_rows > 0) {
$attendee_limit = 1;
//echo $label==1?'<label for="event_cost">' . __('Choose an Option: ','event_espresso') . '</label>':'';
//echo '<input type="radio" name="price_option' . $multi_name_adjust . '" id="price_option-' . $event_id . '">';
?>
<table class="price_list">
<?php
$available_spaces = get_number_of_attendees_reg_limit($event_id, 'number_available_spaces');
foreach ($results as $result) {
//Setting this field for use on the registration form
$_SESSION['espresso_session']['events_in_session'][$event_id]['price_id'][$result->id]['price_type'] = stripslashes_deep($result->price_type);
// Addition for Early Registration discount
if ($early_price_data = early_discount_amount($event_id, $result->event_cost)) {
$result->event_cost = $early_price_data['event_price'];
$message = __(' Early Pricing', 'event_espresso');
}
$surcharge = '';
if ($result->surcharge > 0 && $result->event_cost > 0.0) {
$surcharge = " + {$org_options['currency_symbol']}{$result->surcharge} " . $org_options['surcharge_text'];
if ($result->surcharge_type == 'pct') {
$surcharge = " + {$result->surcharge}% " . $org_options['surcharge_text'];
}
}
?>
<tr>
<td class="price_type"><?php
echo $result->price_type;
?>
</td>
<td class="price"><?php
if (!isset($message)) {
$message = '';
}
echo $org_options['currency_symbol'] . number_format($result->event_cost, 2) . $message . ' ' . $surcharge;
?>
</td>
<td class="selection">
<?php
$attendee_limit = 1;
$att_qty = empty($_SESSION['espresso_session']['events_in_session'][$event_id]['price_id'][$result->id]['attendee_quantity']) ? '' : $_SESSION['espresso_session']['events_in_session'][$event_id]['price_id'][$result->id]['attendee_quantity'];
if ($result->allow_multiple == 'Y') {
$attendee_limit = $result->additional_limit;
if ($available_spaces != 'Unlimited') {
$attendee_limit = $attendee_limit <= $available_spaces ? $attendee_limit : $available_spaces;
}
}
event_espresso_multi_qty_dd($event_id, $result->id, $attendee_limit, $att_qty);
?>
</td>
</tr>
<?php
}
?>
<tr>
<td colspan="3" class="reg-allowed-limit">
<?php
printf(__("You can register a maximum of %d attendees for this event.", 'event_espresso'), $attendee_limit);
?>
</td>
</tr>
</table>
<input type="hidden" id="max_attendees-<?php
echo $event_id;
?>
" class="max_attendees" value= "<?php
echo $attendee_limit;
?>
" />
<?php
} else {
if ($wpdb->num_rows == 0) {
echo '<span class="free_event">' . __('Free Event', 'event_espresso') . '</span>';
echo '<input type="hidden" name="payment' . $multi_name_adjust . '" id="payment-' . $event_id . '" value="' . __('free event', 'event_espresso') . '">';
}
}
}
示例11: event_espresso_shopping_cart
function event_espresso_shopping_cart()
{
global $wpdb, $org_options;
//session_destroy();
//echo "<pre>", print_r( $_SESSION ), "</pre>";
$events_in_session = isset($_SESSION['espresso_session']['events_in_session']) ? $_SESSION['espresso_session']['events_in_session'] : event_espresso_clear_session(TRUE);
if (event_espresso_invoke_cart_error($events_in_session)) {
return false;
}
if (count($events_in_session) > 0) {
foreach ($events_in_session as $event) {
// echo $event['id'];
if (is_numeric($event['id'])) {
$events_IN[] = $event['id'];
}
}
$events_IN = implode(',', $events_IN);
$sql = "SELECT e.* FROM " . EVENTS_DETAIL_TABLE . " e ";
$sql = apply_filters('filter_hook_espresso_shopping_cart_SQL_select', $sql);
$sql .= " WHERE e.id in ({$events_IN}) ";
$sql .= " AND e.event_status != 'D' ";
$sql .= " ORDER BY e.start_date ";
//echo '<h4>$sql : ' . $sql . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
$result = $wpdb->get_results($sql);
?>
<form action='?page_id=<?php
echo $org_options['event_page_id'];
?>
®event_action=load_checkout_page' method='post' id="event_espresso_shopping_cart">
<?php
$counter = 1;
//Counter that will keep track of the first events
foreach ($result as $r) {
//Check to see if the Members plugin is installed.
if (function_exists('espresso_members_installed') && espresso_members_installed() == true && !is_user_logged_in()) {
$member_options = get_option('events_member_settings');
if ($r->member_only == 'Y' || $member_options['member_only_all'] == 'Y') {
event_espresso_user_login();
return;
}
}
//If the event is still active, then show it.
if (event_espresso_get_status($r->id) == 'ACTIVE') {
$num_attendees = get_number_of_attendees_reg_limit($r->id, 'num_attendees');
//Get the number of attendees
$available_spaces = get_number_of_attendees_reg_limit($r->id, 'available_spaces');
//Gets a count of the available spaces
$number_available_spaces = get_number_of_attendees_reg_limit($r->id, 'number_available_spaces');
//Gets the number of available spaces
//echo "<pre>$r->id, $num_attendees,$available_spaces,$number_available_spaces</pre>";
?>
<div class="multi_reg_cart_block event-display-boxes ui-widget" id ="multi_reg_cart_block-<?php
echo $r->id;
?>
">
<h3 class="event_title ui-widget-header ui-corner-top"><?php
echo stripslashes_deep($r->event_name);
?>
<span class="remove-cart-item"> <img class="ee_delete_item_from_cart" id="cart_link_<?php
echo $r->id;
?>
" alt="Remove this item from your cart" src="<?php
echo EVENT_ESPRESSO_PLUGINFULLURL;
?>
images/icons/remove.gif" /> </span> </h3>
<div class="event-data-display ui-widget-content ui-corner-bottom">
<table id="cart-reg-details" class="event-display-tables">
<thead>
<tr>
<th><?php
_e('Date', 'event_espresso');
?>
</th>
<th><?php
_e('Time', 'event_espresso');
?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<?php
echo event_date_display($r->start_date, get_option('date_format'));
?>
<?php
/*_e( ' to ', 'event_espresso' ); ?> <?php echo event_date_display( $r->end_date, get_option( 'date_format' ) )*/
?>
</td>
<td>
<?php
echo event_espresso_time_dropdown($r->id, 0, 1, $_SESSION['espresso_session']['events_in_session'][$r->id]['start_time_id']);
?>
</td>
</tr>
<tr>
<td colspan="2">
//.........这里部分代码省略.........
示例12: event_espresso_get_event_details
//.........这里部分代码省略.........
<div id="div_event_data-<?php
echo $event_id;
?>
" class="event_data">
<h3 id="h3_event_title-<?php
echo $event_id;
?>
" class="event_title"><a id="a_event_title-<?php
echo $event_id;
?>
" class="a_event_title" href="<?php
echo get_option('siteurl');
?>
/?page_id=<?php
echo $event_page_id;
?>
®event_action=register&event_id=<?php
echo $event_id;
?>
&name_of_event=<?php
echo stripslashes_deep($event_name);
?>
"><?php
echo stripslashes_deep($event_name);
?>
</a></h3>
<p id="p_event_price-<?php
echo $event_id;
?>
" class="event_price">
<?php
echo __('Price: ', 'event_espresso') . event_espresso_get_price($event_id);
?>
</p>
<p id="p_event_date-<?php
echo $event_id;
?>
" class="event_date"><?php
_e('Date:', 'event_espresso');
?>
<?php
echo event_date_display($start_date);
?>
</p>
<p id="p_event_address-<?php
echo $event_id;
?>
" class="event_address"><?php
_e('Address:', 'event_espresso');
?>
<?php
echo $event_address;
?>
</p>
<p id="p_available_spaces-<?php
echo $event_id;
?>
" class="available_spaces"><?php
_e('Available Spaces:', 'event_espresso');
?>
<?php
echo get_number_of_attendees_reg_limit($event_id, 'available_spaces');
?>
</p>
<p id="p_register_link-<?php
echo $event_id;
?>
" class="register_link">
<a id="a_register_link-<?php
echo $event_id;
?>
" class="a_register_link" href="<?php
echo get_option('siteurl');
?>
/?page_id=<?php
echo $event_page_id;
?>
®event_action=register&event_id=<?php
echo $event_id;
?>
&name_of_event=<?php
echo stripslashes_deep($event_name);
?>
"><?php
_e('Register Online', 'event_espresso');
?>
</a>
</p>
</div>
<?php
}
}
}
//Check to see how many database queries were performed
//echo '<p>Database Queries: ' . get_num_queries() .'</p>';
}
示例13: event_espresso_edit_list_widget
//.........这里部分代码省略.........
$event_identifier = stripslashes_deep($result->event_identifier);
$reg_limit = $result->reg_limit;
$registration_start = $result->registration_start;
$start_date = $result->start_date;
$end_date = $result->end_date;
$is_active = $result->is_active;
$status = array();
$status = event_espresso_get_is_active($event_id);
$recurrence_id = $result->recurrence_id;
$registration_startT = $result->registration_startT;
?>
<tr>
<td class="post-title page-title column-title"><strong><a class="row-title" href="admin.php?page=events&action=edit&event_id=<?php
echo $event_id;
?>
"><?php
echo $event_name;
?>
</a></strong>
<div class="row-actions"><span><a href="#">View</a> | </span><span class='edit'><a href="admin.php?page=events&action=edit&event_id=<?php
echo $event_id;
?>
"><?php
_e('Edit', 'event_espresso');
?>
</a> | </span><span class='delete'><a onclick="return confirmDelete();" href='admin.php?page=events&action=delete&event_id=<?php
echo $event_id;
?>
'><?php
_e('Delete', 'event_espresso');
?>
</a></span> | <span><a href="admin.php?page=events&event_admin_reports=list_attendee_payments&event_id=<?php
echo $event_id;
?>
"><?php
_e('Attendees', 'event_espresso');
?>
</a> | </span><span><a href="#"><?php
_e('Export', 'event_espresso');
?>
</a></span></div></td>
<td class="author column-author"><?php
echo event_date_display($start_date, get_option('date_format'));
?>
<br />
<?php
echo event_espresso_get_time($event_id, 'start_time');
?>
</td>
<td class="date column-date"><?php
echo $status['display'];
?>
</td>
<td align="center" class="author column-attendees"><a href="admin.php?page=events&event_admin_reports=list_attendee_payments&event_id=<?php
echo $event_id;
?>
"><?php
echo get_number_of_attendees_reg_limit($event_id, 'num_attendees');
?>
</a></td>
</tr>
<?php
}
}
?>
</tbody>
</table><p> </p>
<div style="clear:both"></div>
<script>
jQuery(document).ready(function($) {
var mytable = $('#table').dataTable( {
"bStateSave": true,
"sPaginationType": "full_numbers",
"oLanguage": { "sSearch": "<strong><?php
_e('Live Search Filter', 'event_espresso');
?>
:</strong>",
"sZeroRecords": "<?php
_e('No Records Found!', 'event_espresso');
?>
" },
"aoColumns": [
null,
null,
null,
null
]
} );
} );
</script>
<div style="clear:both"></div>
<?php
}
示例14: stripslashes_deep
echo $venue_title;
?>
<br />
<?php
echo stripslashes_deep($location);
?>
<span class="google-map-link"><?php
echo $google_map_link;
?>
</span></span>
</p>
<?php
}
//Social media buttons
do_action('espresso_social_display_buttons', $event_id);
$num_attendees = get_number_of_attendees_reg_limit($event_id, 'num_attendees');
//Get the number of attendees. Please visit http://eventespresso.com/forums/?p=247 for available parameters for the get_number_of_attendees_reg_limit() function.
if ($num_attendees >= $reg_limit) {
?>
<!--<p id="available_spaces-<?php
/* echo $event_id */
?>
"><span class="section-title"><?php
/* _e('<strong>Available Spaces:</strong>', 'event_espresso') */
?>
</span><?php
/* echo get_number_of_attendees_reg_limit($event_id, 'available_spaces', 'All Seats Reserved') */
?>
</p> -->
<?php
if ($overflow_event_id != '0' && $allow_overflow == 'Y') {
示例15: espresso_attendees_data_sc
function espresso_attendees_data_sc($atts)
{
global $wpdb, $org_options;
extract(shortcode_atts(array('event_id' => '0', 'type' => ''), $atts));
$event_id = "{$event_id}";
$type = "{$type}";
$data = get_number_of_attendees_reg_limit($event_id, $type);
return $data;
}