function espresso_charts() { global $wpdb, $org_options, $espresso_premium; $event_id = $_REQUEST['event_id']; ?> <div class="metabox-holder"> <div class="postbox"> <h3> <?php echo espresso_event_list_attendee_title($_REQUEST['event_id']); ?> </h3> <div class="inside"> <?php if ($espresso_premium != true) { echo '<p><strong>' . __('Graphical reporting charts are now available in the premium versions.', 'event_espresso') . '</strong> <a href="http://eventespresso.com/download/" target="_blank">' . __('Upgrade Now!', 'event_espresso') . '</a></p>'; } else { echo espresso_chart_display($event_id, 'total_reg'); echo espresso_chart_display($event_id, 'total_completed'); echo espresso_chart_display($event_id, 'total_pending'); echo espresso_chart_display($event_id, 'total_incomplete'); } ?> <div style="clear:both"></div> </div> </div> </div> <?php event_list_attendees(); }
function event_espresso_manage_events() { global $wpdb, $org_options; ?> <div id="configure_organization_form" class="wrap meta-box-sortables ui-sortable"> <div id="event_reg_theme" class="wrap"> <div id="icon-options-event" class="icon32"></div> <h2> <?php if ($_REQUEST['page'] == 'events' && isset($_REQUEST['event_admin_reports'])) { switch ($_REQUEST['event_admin_reports']) { case 'charts': _e('Attendee Reports', 'event_espresso'); break; case 'event_list_attendees': case 'resend_email': case 'list_attendee_payments': _e('Attendee Reports', 'event_espresso'); if (!empty($_REQUEST['event_id']) && $_REQUEST['event_admin_reports'] != 'add_new_attendee') { echo '<a href="admin.php?page=events&event_admin_reports=add_new_attendee&event_id=' . $_REQUEST['event_id'] . '" class="button add-new-h2" style="margin-left: 20px;">' . __('Add New Attendee', 'event_espresso') . '</a>'; } break; case 'edit_attendee_record': _e('Edit Attendee Data', 'event_espresso'); break; case 'enter_attendee_payments': _e('Edit Attendee Payment Record', 'event_espresso'); break; case 'add_new_attendee': _e('Add New Attendee', 'event_espresso'); break; case 'event_newsletter': _e('Email Event Attendees', 'event_espresso'); break; } } else { _e('Event Overview', 'event_espresso'); if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'edit' || $_REQUEST['action'] == 'add_new_event')) { } else { echo '<a href="admin.php?page=events&action=add_new_event" class="button add-new-h2" style="margin-left: 20px;">' . __('Add New Event', 'event_espresso') . '</a>'; } } ?> </h2> <?php if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'copy_event') { require_once "copy_event.php"; copy_event(); } if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete') { event_espresso_delete_event(); } //Delete recurrence series of events if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete_recurrence_series') { $r = $wpdb->get_results("SELECT id FROM " . EVENTS_DETAIL_TABLE . " ed WHERE recurrence_id = " . $_REQUEST['recurrence_id']); if ($wpdb->num_rows > 0) { foreach ($r as $row) { event_espresso_delete_event($row->id); } } } if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'csv_import') { require_once 'csv_import.php'; csv_import(); } if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'add') { require_once "insert_event.php"; add_event_to_db(); } //Update the event if (isset($_REQUEST['edit_action']) && $_REQUEST['edit_action'] == 'update') { require_once "update_event.php"; update_event(); } //If we need to add or edit a new event then we show the add or edit forms if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'add_new_event' || $_REQUEST['action'] == 'edit')) { ?> <form id="espresso_event_editor" name="form" method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?> "> <?php if ($_REQUEST['action'] == 'edit') { //show the edit form require_once "edit_event.php"; edit_event($_REQUEST['event_id']); } else { //Show the add new event form require_once "add_new_event.php"; add_new_event(); } ?> <br class="clear" /> </form> <!-- /event_reg_theme --> <?php } else { //If we are not adding or editing an event then show the list of events if (isset($_REQUEST['event_admin_reports'])) { switch ($_REQUEST['event_admin_reports']) { case 'charts': require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/event_list_attendees.php"; require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/charts.php"; espresso_charts(); break; case 'list_attendee_payments': require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/event_list_attendees.php"; event_list_attendees(); break; case 'event_list_attendees': require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/event_list_attendees.php"; event_list_attendees(); break; case 'edit_attendee_record': require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/event_list_attendees.php"; require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/edit_attendee_record.php"; edit_attendee_record(); break; case 'enter_attendee_payments': require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/event_list_attendees.php"; require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/enter_attendee_payments.php"; enter_attendee_payments(); break; case 'add_new_attendee': require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/event_list_attendees.php"; require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/add_new_attendee.php"; add_new_attendee($_REQUEST['event_id']); break; case 'event_newsletter': if (file_exists(EVENT_ESPRESSO_INCLUDES_DIR . "admin-files/event_newsletter.php")) { require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-files/event_newsletter.php"; event_newsletter($_REQUEST['event_id']); } else { require_once "event_newsletter.php"; } break; case 'resend_email': require_once EVENT_ESPRESSO_INCLUDES_DIR . "/admin-reports/event_list_attendees.php"; echo '<div id="message" class="updated fade"><p><strong>Resending email to attendee.</strong></p></div>'; event_espresso_email_confirmations(array('registration_id' => $_REQUEST['registration_id'], 'send_admin_email' => 'false', 'send_attendee_email' => 'true')); event_list_attendees(); break; default: event_espresso_edit_list(); break; } } else { event_espresso_edit_list(); } } //Do not remove anything below this line. These are the color box popups. ?> </div> </div> <div id="email_manager_info" style="display:none"> <h2><?php _e('Pre-existing Emails', 'event_espresso'); ?> </h2> <p><?php _e('These emails will override the custom email if a pre-existing email is selected. You must select "Yes" in the "Send custom confirmation emails for this event?" above.', 'event_espresso'); ?> </p> </div> <div id="coupon_code_info" style="display:none"> <h2><?php _e('Coupon/Promo Code', 'event_espresso'); ?> </h2><p><?php _e('This is used to apply discounts to events.', 'event_espresso'); ?> </p><p><?php _e('A coupon or promo code could can be anything you want. For example: Say you have an event that costs', 'event_espresso'); ?> <?php echo $org_options['currency_symbol']; ?> 200. <?php _e('If you supplied a promo like "PROMO50" and entered 50.00 into the "Discount w/Promo Code" field your event will be discounted', 'event_espresso'); ?> <?php echo $org_options['currency_symbol']; ?> 50.00, <?php _e('Bringing the cost of the event to', 'event_espresso'); ?> <?php echo $org_options['currency_symbol']; ?> 150. </p> <p><?php _e("Note: Promo Codes which are marked to 'apply to all events', although not explicitly enumerated, can also be used for this event, provided it allows promo codes.", "event_espresso"); ?> </p> </div> <div id="unique_id_info" style="display:none"> <h2><?php _e('Event Identifier', 'event_espresso'); ?> </h2><p><?php _e('This should be a unique identifier for the event. Example: "Event1" (without quotes.)</p><p>The unique ID can also be used in individual pages using the', 'event_espresso'); ?> [SINGLEEVENT single_event_id="<?php _e('Unique Event ID', 'event_espresso'); ?> "] <?php _e('shortcode', 'event_espresso'); ?> .</p> </div> <div id="secondary_info" style="display:none"> <h2><?php _e('Waitlist Events', 'event_espresso'); ?> </h2> <p><?php _e('These types of events can be used as a overflow or waiting list events.', 'event_espresso'); ?> </p> <p><?php _e('If an event is set up as an "Waitlist Event," it can be set to not appear in your event listings template. You may need to customize your event_listing.php file to make this work. For more information, please', 'event_espresso'); ?> <a href="http://eventespresso.com/forums/?p=512" target="_blank"><?php _e('visit the forums', 'event_espresso'); ?> </a>.</p> </div> <div id="external_URL_info" style="display:none"> <h2><?php _e('Off-site Registration Page', 'event_espresso'); ?> </h2> <p><?php _e('If an off-site registration page is entered, it will override your registration page and send attendees to the URL that is entered.', 'event_espresso'); ?> </p> </div> <div id="alt_email_info" style="display:none"> <h2><?php _e('Alternate Email Address', 'event_espresso'); ?> </h2> <p><?php _e('If an alternate email address is entered. Admin email notifications wil be sent to this address instead.', 'event_espresso'); ?> </p> </div> <div id="status_types_info" style="display:none;"> <h2><?php _e('Event Status Types', 'event_espresso'); ?> </h2> <ul> <li><strong><?php _e('Public', 'event_espresso'); ?> </strong><br /><?php _e('This type if event will appear in the event listings. It is a live event (not deleted, ongoing or secondary.)', 'event_espresso'); ?> </li> <li><strong><?php _e('Waitlist', 'event_espresso'); ?> </strong><br /><?php _e('This type of event can be hidden and used as a waiting list for a primary event. Template customizations may be required. For more information, please', 'event_espresso'); ?> <a href="http://eventespresso.com/forums/?p=512" target="_blank"><?php _e('visit the forums', 'event_espresso'); ?> </a></li> <li><strong><?php _e('Ongoing', 'event_espresso'); ?> </strong><br /><?php _e('This type of an event can be set to appear in your event listings and display a registration page. Template customizations are required. For more information, please', 'event_espresso'); ?> <a href="http://eventespresso.com/forums/?p=518" target="_blank"><?php _e('visit the forums', 'event_espresso'); ?> </a></li> <li><strong><?php _e('Deleted', 'event_espresso'); ?> </strong><br /><?php _e('This is event type will not appear in the event listings and will not dispaly a registrations page. Deleted events can still be accessed in the', 'event_espresso'); ?> <a href="admin.php?page=events"><?php _e('Attendee Reports', 'event_espresso'); ?> </a> <?php _e('page', 'event_espresso'); ?> .</li> </ul> </div> <?php echo event_espresso_custom_email_info(); }
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"> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?> " onsubmit="return validateForm(this)" id="registration_form" class="espresso_form"> <?php wp_nonce_field('reg_nonce', 'reg_form_nonce'); ?> <h3 class="h3_event_title" id="h3_event_title-<?php echo $event_id; ?> "><?php echo $event_name; ?> </h3> <div class="padding"> <div class="inside"> <fieldset> <h4 class="reg-quest-title section-title"><?php _e('Event Dates and Times', 'event_espresso'); ?> </h4> <p class="start_date"> <span class="span_event_date_label"><?php _e('Start Date:', 'event_espresso'); ?> </span><span class="span_event_date_value"><?php echo event_date_display($start_date); ?> </span> </p> <p class="event_time"> <?php $time_selected = ''; //This block of code is used to display the times of an event in either a dropdown or text format. if (!empty($time_selected) && $time_selected == true) { //If the customer is coming from a page where the time was preselected. echo event_espresso_display_selected_time($time_id); //Optional parameters start, end, default } else { if ($time_selected == false) { echo event_espresso_time_dropdown($event_id); } } //End time selected ?> </p> <?php // Added for seating chart addon do_action('ee_seating_chart_css'); do_action('ee_seating_chart_js'); do_action('ee_seating_chart_flush_expired_seats'); do_action('espresso_seating_chart_select', $event_id); ?> </fieldset> <?php echo event_espresso_add_question_groups($question_groups, '', null, 0, array('admin_only' => true), 'inline'); //Coupons if (function_exists('event_espresso_coupon_registration_page')) { echo event_espresso_coupon_registration_page($use_coupon_code, $event_id); } //End coupons display //Groupons if (function_exists('event_espresso_groupon_registration_page')) { echo event_espresso_groupon_registration_page($use_groupon_code, $event_id); } //End groupons display ?> <p class="event_form_field"> <label for="event_cost" class="inline"> <?php _e('Amount Paid:', 'event_espresso'); ?> </label> <input tabindex="9" type="text" maxlength="10" size="15" name="event_cost" id="event_cost-<?php echo $event_id; ?> " <?php echo $event_cost ? 'value="' . $event_cost . '"' : ""; ?> /> <input type="hidden" name="regevent_action_admin" id="regevent_action-<?php echo $event_id; ?> " value="post_attendee" /> <input type="hidden" name="event_id" id="event_id-<?php echo $event_id; ?> " value="<?php echo $event_id; ?> " /> <input type="hidden" name="admin" value="true" /> </p> <?php echo event_espresso_additional_attendees($event_id, $additional_limit, $number_available_spaces, __('Number of Tickets', 'event_espresso'), true, 'admin', 'inline'); ?> <p class="event_form_submit" id="event_form_submit-<?php echo $event_id; ?> "> <input class="btn_event_form_submit button-primary" id="event_form_field-<?php echo $event_id; ?> " type="submit" name="Submit" value="<?php _e('Submit', 'event_espresso'); ?> " /> </p> </div> </div> </form> </div> </div> </div> <?php event_list_attendees(); } //End Build the registration page }
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 echo event_date_display($start_date); ?> </p> <p class="event_time"> <?php $time_selected = ''; //This block of code is used to display the times of an event in either a dropdown or text format. if (!empty($time_selected) && $time_selected == true) { //If the customer is coming from a page where the time was preselected. echo event_espresso_display_selected_time($time_id); //Optional parameters start, end, default } else { if ($time_selected == false) { echo event_espresso_time_dropdown($event_id); } } //End time selected ?> </p> <?php /* * Added for seating chart addon */ if (defined('ESPRESSO_SEATING_CHART')) { $seating_chart_id = seating_chart::check_event_has_seating_chart($event_id); if ($seating_chart_id !== false) { ?> <p class="event_form_field"> <label>Select a Seat:</label> <input type="text" name="seat_id" value="" class="ee_s_select_seat required" title="Please select a seat." event_id="<?php echo $event_id; ?> " readonly="readonly" /> <?php $seating_chart = $wpdb->get_row("select * from " . EVENTS_SEATING_CHART_TABLE . " where id = {$seating_chart_id}"); if (trim($seating_chart->image_name) != "" && file_exists(EVENT_ESPRESSO_UPLOAD_DIR . 'seatingchart/images/' . $seating_chart->image_name)) { ?> <br/> <a href="<?php echo EVENT_ESPRESSO_UPLOAD_URL . 'seatingchart/images/' . $seating_chart->image_name; ?> " target="_blank">Seating chart image</a> <?php } ?> </p> <?php } } /* * End */ ?> <?php echo event_espresso_add_question_groups($question_groups); //Coupons if (function_exists('event_espresso_coupon_registration_page')) { echo event_espresso_coupon_registration_page($use_coupon_code, $event_id); } //End coupons display //Groupons if (function_exists('event_espresso_groupon_registration_page')) { echo event_espresso_groupon_registration_page($use_groupon_code, $event_id); } //End groupons display ?> <p class="event_form_field"> <label for="event_cost"> <?php _e('Amount Paid:', 'event_espresso'); ?> </label> <input tabindex="9" type="text" maxlength="10" size="15" name="event_cost" id="event_cost-<?php echo $event_id; ?> " <?php echo $event_cost ? 'value="' . $event_cost . '"' : ""; ?> /> <input type="hidden" name="regevent_action_admin" id="regevent_action-<?php echo $event_id; ?> " value="post_attendee" /> <input type="hidden" name="event_id" id="event_id-<?php echo $event_id; ?> " value="<?php echo $event_id; ?> " /> <input type="hidden" name="admin" value="true" /> </p> <p class="event_form_submit" id="event_form_submit-<?php echo $event_id; ?> "> <input class="btn_event_form_submit" id="event_form_field-<?php echo $event_id; ?> " type="submit" name="Submit" value="<?php _e('Submit', 'event_espresso'); ?> " /> </p> <?php echo event_espresso_additional_attendees($event_id, $additional_limit, $number_available_spaces, __('Number of Tickets', 'event_espresso'), true, $event_meta); ?> </form> </div> </div> </div> <?php event_list_attendees(); } //End Build the registration page }