function event_espresso_edit_list() { global $wpdb, $org_options; define('EVT_ADMIN_URL', admin_url('admin.php?page=events')); $max_rows = isset($_REQUEST['max_rows']) & !empty($_REQUEST['max_rows']) ? absint($_REQUEST['max_rows']) : 50; $start_rec = isset($_REQUEST['start_rec']) && !empty($_REQUEST['start_rec']) ? absint($_REQUEST['start_rec']) : 0; $records_to_show = " LIMIT {$max_rows} OFFSET {$start_rec} "; //Dates $curdate = date('Y-m-d'); $this_year_r = date('Y'); $this_month_r = date('m'); $days_this_month = date('t', strtotime($curdate)); $month_range = isset($_REQUEST['month_range']) && !empty($_REQUEST['month_range']) ? sanitize_text_field($_REQUEST['month_range']) : FALSE; $category_id = isset($_REQUEST['category_id']) && !empty($_REQUEST['category_id']) ? sanitize_text_field($_REQUEST['category_id']) : FALSE; $today_filter = isset($_REQUEST['today']) && $_REQUEST['today'] == 'true' ? TRUE : FALSE; $this_month_filter = isset($_REQUEST['this_month']) && $_REQUEST['this_month'] == 'true' ? TRUE : FALSE; $event_status = isset($_POST['event_status']) && !empty($_POST['event_status']) ? sanitize_text_field($_REQUEST['event_status']) : FALSE; if (isset($_POST['delete_event'])) { if (is_array($_POST['checkbox'])) { while (list($key, $value) = each($_POST['checkbox'])) { $del_id = $key; event_espresso_delete_event($del_id); } } ?> <div id="message" class="updated fade"> <p><strong> <?php _e('Event(s) have been permanently deleted.', 'event_espresso'); ?> </strong></p> </div> <?php } if (isset($_POST['perm_delete_event'])) { if (is_array($_POST['checkbox'])) { while (list($key, $value) = each($_POST['checkbox'])) { $del_id = $key; event_espresso_empty_event_trash($del_id); } } ?> <div id="message" class="updated fade"> <p><strong> <?php _e('Event(s) have been permanently deleted.', 'event_espresso'); ?> </strong></p> </div> <?php } $recurrence_icon = ''; if (defined('EVENT_ESPRESSO_RECURRENCE_MODULE_ACTIVE')) { $recurrence_icon = '<img src="' . EVENT_ESPRESSO_PLUGINFULLURL . 'images/arrow_rotate_clockwise.png" alt="Recurring Event" title="Recurring Event" class="re_fr" />'; } require_once 'queries.php'; if (file_exists(EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/admin_reports_filters.php')) { require_once EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/admin_reports_filters.php'; } else { echo '<p><strong>' . __('Advanced filters are now available in the premium versions.', 'event_espresso') . '</strong> <a href="http://eventespresso.com/download/" target="_blank">' . __('Upgrade Now!', 'event_espresso') . '</a></p>'; //$total_events = espresso_total_events(); } if ($month_range !== FALSE) { $pieces = explode('-', $month_range, 3); $year_r = $pieces[0]; $month_r = $pieces[1]; } $group = ''; $sql = ''; //Check if the venue manager is turned on $use_venue_manager = isset($org_options['use_venue_manager']) && $org_options['use_venue_manager'] == 'Y' ? TRUE : FALSE; $is_regional_manager = FALSE; //This checks to see if the user is a regional manager and creates a union to join the events that are in the users region based on the venue/locale combination if (function_exists('espresso_member_data') && espresso_member_data('role') == 'espresso_group_admin') { $is_regional_manager = TRUE; $group = get_user_meta(espresso_member_data('id'), "espresso_group", TRUE); if ($group != '0' && !empty($group)) { $sql = "(SELECT e.id event_id, e.event_name, e.event_identifier, e.reg_limit, e.registration_start, "; $sql .= " e.start_date, e.is_active, e.recurrence_id, e.registration_startT, e.wp_user "; //Get the venue information if ($use_venue_manager) { $sql .= ", v.name AS venue_title, v.address AS venue_address, v.address2 AS venue_address2, v.city AS venue_city, v.state AS venue_state, v.zip AS venue_zip, v.country AS venue_country "; } else { $sql .= ", e.venue_title, e.phone, e.address, e.address2, e.city, e.state, e.zip, e.country "; } //Get the locale fields if ($use_venue_manager) { $sql .= ", lc.name AS locale_name, e.wp_user "; } $sql .= " FROM " . EVENTS_DETAIL_TABLE . " e "; //Join the categories if ($today_filter) { $sql .= " JOIN " . EVENTS_CATEGORY_REL_TABLE . " cr ON cr.event_id = e.id "; $sql .= " JOIN " . EVENTS_CATEGORY_TABLE . " c ON c.id = cr.cat_id "; } //Join the venues and locales if (!empty($group) && $use_venue_manager) { $sql .= " LEFT JOIN " . EVENTS_VENUE_REL_TABLE . " vr ON vr.event_id = e.id "; $sql .= " LEFT JOIN " . EVENTS_VENUE_TABLE . " v ON v.id = vr.venue_id "; $sql .= " LEFT JOIN " . EVENTS_LOCALE_REL_TABLE . " l ON l.venue_id = vr.venue_id "; $sql .= " LEFT JOIN " . EVENTS_LOCALE_TABLE . " lc ON lc.id = l.locale_id "; } //Event status filter $sql .= $event_status !== FALSE && $event_status != 'IA' ? " WHERE e.event_status = '" . $event_status . "' " : " WHERE e.event_status != 'D' "; //Category filter $sql .= $category_id !== FALSE ? " AND c.id = '" . $category_id . "' " : ''; //Find events in the locale $sql .= !empty($group) && $use_venue_manager == true ? " AND l.locale_id IN (" . implode(",", $group) . ") " : ''; //Month filter if ($month_range !== FALSE) { $sql .= " AND e.start_date BETWEEN '" . date('Y-m-d', strtotime($year_r . '-' . $month_r . '-01')) . "' AND '" . date('Y-m-d', strtotime($year_r . '-' . $month_r . '-31')) . "' "; } //Todays events filter if ($today_filter) { $sql .= " AND e.start_date = '" . $curdate . "' "; } //This months events filter if ($this_month_filter) { $sql .= " AND e.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)) . "' "; } $sql .= ") UNION "; } } //This is the standard query to retrieve the events $sql .= "(SELECT e.id event_id, e.event_name, e.event_identifier, e.reg_limit, e.registration_start, "; $sql .= " e.start_date, e.is_active, e.recurrence_id, e.registration_startT, e.wp_user "; //Get the venue information if ($use_venue_manager) { //If using the venue manager, we need to get those fields $sql .= ", v.name AS venue_title, v.address AS venue_address, v.address2 AS venue_address2, v.city AS venue_city, v.state AS venue_state, v.zip AS venue_zip, v.country AS venue_country "; } else { //Otherwise we need to get the address fields from the individual events $sql .= ", e.venue_title, e.phone, e.address, e.address2, e.city, e.state, e.zip, e.country "; } //get the locale fields if ($is_regional_manager && $use_venue_manager) { $sql .= ", lc.name AS locale_name, e.wp_user "; } $sql .= " FROM " . EVENTS_DETAIL_TABLE . " e "; //Join the categories if ($category_id != FALSE) { $sql .= " JOIN " . EVENTS_CATEGORY_REL_TABLE . " cr ON cr.event_id = e.id "; $sql .= " JOIN " . EVENTS_CATEGORY_TABLE . " c ON c.id = cr.cat_id "; } //Join the venues if ($use_venue_manager == true) { $sql .= " LEFT JOIN " . EVENTS_VENUE_REL_TABLE . " vr ON vr.event_id = e.id "; $sql .= " LEFT JOIN " . EVENTS_VENUE_TABLE . " v ON v.id = vr.venue_id "; } //Join the locales if (isset($is_regional_manager) && $is_regional_manager == true && $use_venue_manager == true) { $sql .= " LEFT JOIN " . EVENTS_LOCALE_REL_TABLE . " l ON l.venue_id = vr.venue_id "; $sql .= " LEFT JOIN " . EVENTS_LOCALE_TABLE . " lc ON lc.id = l.locale_id "; } //Event status filter $sql .= isset($_POST['event_status']) && ($_POST['event_status'] != '' && $_POST['event_status'] != 'IA') ? " WHERE e.event_status = '" . $_POST['event_status'] . "' " : " WHERE e.event_status != 'D' "; //Category filter $sql .= $category_id !== FALSE ? " AND c.id = '" . $category_id . "' " : ''; //Month filter if ($_POST['month_range'] != '') { $sql .= " AND e.start_date BETWEEN '" . date('Y-m-d', strtotime($year_r . '-' . $month_r . '-01')) . "' AND '" . date('Y-m-d', strtotime($year_r . '-' . $month_r . '-31')) . "' "; } //Todays events filter if (isset($_REQUEST['today']) && $_REQUEST['today'] == 'true') { $sql .= " AND e.start_date = '" . $curdate . "' "; } //This months events filter if (isset($_REQUEST['this_month']) && $_REQUEST['this_month'] == 'true') { $sql .= " AND e.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 user is an event manager, then show only their events if (function_exists('espresso_member_data') && (espresso_member_data('role') == 'espresso_event_manager' || espresso_member_data('role') == 'espresso_group_admin')) { $sql .= " AND e.wp_user = '******'id') . "' "; } $sql .= ") ORDER BY start_date DESC "; $sql .= $records_to_show; $events = $wpdb->get_results($sql); $total_events = $wpdb->num_rows; ?> <form id="event-admin-list-page-select-frm" name="event_admin_list_page_select_frm" method="post" action="<?php echo EVT_ADMIN_URL; ?> "> <div id="event-admin-list-page-select-dv" class="admin-list-page-select-dv"> <input name="navig" value="<?php _e('Retrieve', 'event_espresso'); ?> " type="submit" class="button-secondary"> <?php $rows = array(50 => 50, 100 => 100, 250 => 250, 500 => 500, 100000 => 'all'); ?> <select name="max_rows" size="1"> <?php foreach ($rows as $key => $value) { ?> <?php $selected = $key == $max_rows ? ' selected="selected"' : ''; ?> <option value="<?php echo $key; ?> "<?php echo $selected; ?> ><?php echo $value; ?> </option> <?php } ?> </select> <?php _e('rows from the db at a time', 'event_espresso'); ?> <input name="start_rec" value="<?php echo $start_rec; ?> " class="textfield" type="hidden"> <?php if ($start_rec > 0 && $max_rows < 100000) { $prev_rows = $start_rec > $max_rows ? $start_rec - $max_rows - 1 : 0; $prev_rows_url = add_query_arg(array('max_rows' => $max_rows, 'start_rec' => $prev_rows), EVT_ADMIN_URL); ?> <a id="event-admin-load-prev-rows-btn" href="<?php echo $prev_rows_url; ?> " title="load prev rows" class="button-secondary"> <?php echo __('Previous', 'event_espresso') . ' ' . $max_rows . ' ' . __('rows', 'event_espresso'); ?> </a> <?php } ?> <?php if ($total_events >= $max_rows && $max_rows < 100000) { $next_rows = $start_rec + $max_rows + 1; $next_rows_url = add_query_arg(array('max_rows' => $max_rows, 'start_rec' => $next_rows), EVT_ADMIN_URL); ?> <a id="event-admin-load-next-rows-btn" href="<?php echo $next_rows_url; ?> " title="load next rows" class="button-secondary"> <?php echo __('Next', 'event_espresso') . ' ' . $max_rows . ' ' . __('rows', 'event_espresso'); ?> </a> <?php } ?> </div> </form> <form id="form1" name="form1" method="post" action="admin.php?page=events<?php //echo $_SERVER["REQUEST_URI"] ?> "> <table id="table" class="widefat event-list" width="100%"> <thead> <tr> <th class="manage-column column-cb check-column" id="cb" scope="col" style="width:28px;"><input type="checkbox"></th> <th class="manage-column column-comments num" id="id" style="padding-top:7px; width:3%;" scope="col" title="Click to Sort"> <span><?php _e('ID', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-title" id="name" scope="col" title="Click to Sort" style="width:26%;"> <span><?php _e('Name', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-title" id="name" scope="col" title="Click to Sort" style="width:12%;"> <span><?php _e('Venue', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-author" id="start" scope="col" title="Click to Sort" style="width:12%;"> <span><?php _e('Start Date', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-author" id="start" scope="col" title="Click to Sort" style="width:10%;"> <span><?php _e('Start Time', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-date" id="dow" scope="col" title="Click to Sort" style="width:6%;";> <span><?php _e('DoW', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-date" id="begins" scope="col" title="Click to Sort" style="width:12%;"> <span><?php _e('Reg Begins', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-date" id="status" scope="col" title="Click to Sort" style="width:10%;"> <span><?php _e('Status', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <?php if (function_exists('espresso_is_admin') && espresso_is_admin() == true && $espresso_premium == true) { ?> <th class="manage-column column-date" id="status" scope="col" title="Click to Sort" style="width:10%;"> <span><?php _e('Creator', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <?php } ?> <th class="manage-column column-date" id="attendees" scope="col" title="Click to Sort" style="width:9%;"> <span><?php _e('Attendees', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-author" id="actions" scope="col" style="width:25%;"> <?php _e('Actions', 'event_espresso'); ?> </th> </tr> </thead> <tbody> <?php if ($total_events > 0) { foreach ($events as $event) { //print_r ($event); $event_id = $event->event_id; $event_name = stripslashes_deep($event->event_name); $event_identifier = stripslashes_deep($event->event_identifier); $reg_limit = isset($event->reg_limit) ? $event->reg_limit : ''; $registration_start = isset($event->registration_start) ? $event->registration_start : ''; $start_date = isset($event->start_date) ? $event->start_date : ''; $end_date = isset($event->end_date) ? $event->end_date : ''; $is_active = isset($event->is_active) ? $event->is_active : ''; $status = array(); $status = event_espresso_get_is_active($event_id); $recurrence_id = isset($event->recurrence_id) ? $event->recurrence_id : ''; $registration_startT = isset($event->registration_startT) ? $event->registration_startT : ''; $event_address = isset($event->address) ? $event->address : ''; $event_address2 = isset($event->address2) ? $event->address2 : ''; $event_city = isset($event->city) ? $event->city : ''; $event_state = isset($event->state) ? $event->state : ''; $event_zip = isset($event->zip) ? $event->zip : ''; $event_country = isset($event->country) ? $event->country : ''; //added new $venue_title = isset($event->venue_title) ? $event->venue_title : ''; $venue_locale = isset($event->locale_name) ? $event->locale_name : ''; $wp_user = isset($event->wp_user) ? $event->wp_user : ''; $location = (!empty($event_address) ? $event_address : '') . (!empty($event_address2) ? '<br />' . $event_address2 : '') . (!empty($event_city) ? '<br />' . $event_city : '') . (!empty($event_state) ? ', ' . $event_state : '') . (!empty($event_zip) ? '<br />' . $event_zip : '') . (!empty($event_country) ? '<br />' . $event_country : ''); $dow = date("D", strtotime($start_date)); ob_start(); ?> <tr> <td class="check-column" style="padding:7px 0 22px 7px; vertical-align:top;"><!--Delete Events--> <?php echo '<input name="checkbox[' . $event_id . ']" type="checkbox" title="Delete Event ' . $event_name . '" />'; ?> </td> <td class="column-comments" style="padding-top:3px;"><?php echo $event_id; ?> </td> <td class="post-title page-title"><strong><a class="row-title" href="admin.php?page=events&action=edit&event_id=<?php echo $event_id; ?> "><?php echo $event_name; ?> </a> <?php echo $recurrence_id > 0 ? $recurrence_icon : ''; ?> </strong> <div class="row-actions"><span><a href="<?php echo espresso_reg_url($event_id); ?> " target="_blank"><?php _e('View', 'event_espresso'); ?> </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="#" onclick="window.location='<?php echo get_bloginfo('wpurl') . "/wp-admin/admin.php?event_espresso&event_id=" . $event_id . "&export=report&action=payment&type=excel"; ?> '" title="<?php _e('Export to Excel', 'event_espresso'); ?> "><?php _e('Export', 'event_espresso'); ?> </a></span></div></td> <td class="author"><?php echo $venue_title != '' ? $venue_title : ''; echo $venue_locale != '' ? '<br />[' . $venue_locale . ']' : ''; ?> </td> <td class="author"><?php echo event_date_display($start_date, get_option('date_format')); ?> </td> <td class="author"><?php echo event_espresso_get_time($event_id, 'start_time'); ?> </td> <td class="date"><?php echo $dow; ?> </td> <td class="date"><?php echo event_date_display($registration_start, get_option('date_format')); ?> <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> <a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=unique_id_info_<?php echo $event_id; ?> " title="<?php _e('Get Short URL/Shortcode', 'event_espresso'); ?> "><div class="shortcode_btn"></div></a> <a href="#" onclick="window.location='<?php echo get_bloginfo('wpurl') . "/wp-admin/admin.php?event_espresso&event_id=" . $event_id . "&export=report&action=payment&type=excel"; ?> '" title="<?php _e('Export to Excel', 'event_espresso'); ?> "><div class="excel_exp_btn"></div></a> <a href="#" onclick="window.location='<?php echo get_bloginfo('wpurl') . "/wp-admin/admin.php?event_espresso&event_id=" . $event_id . "&export=report&action=payment&type=csv"; ?> '" title="<?php _e('Export to CSV', 'event_espresso'); ?> "><div class="csv_exp_btn"></div></a> <a href="admin.php?page=events&event_admin_reports=event_newsletter&event_id=<?php echo $event_id; ?> " title="<?php _e('Email Attendees', 'event_espresso'); ?> "><div class="newsletter_btn"></div></a></div> <div id="unique_id_info_<?php echo $event_id; ?> " style="display:none"> <?php _e('<h2>Short URL/Shortcode</h2><p>This is the short URL to this event:</p><p><span class="updated fade">' . espresso_reg_url($event_id) . '</span></p><p>This will show the registration form for this event just about anywhere. Copy and paste the following shortcode into any page or post.</p><p><span class="updated fade">[SINGLEEVENT single_event_id="' . $event_identifier . '"]</span></p> <p class="red_text"> Do not use in place of the main events page that is set in the Organization Settings page.', 'event_espresso'); ?> </div></td> </tr> <?php //echo $_REQUEST['event_status']; if (!empty($_REQUEST['event_status'])) { $content = ob_get_contents(); ob_end_clean(); switch ($_REQUEST['event_status']) { case 'A': switch (event_espresso_get_status($event_id, empty($event_meta) ? '' : $event_meta)) { case 'NOT_ACTIVE': //Don't show the event if any of the above are true break; default: echo $content; break; } break; case 'IA': switch (event_espresso_get_status($event_id)) { case 'NOT_ACTIVE': echo $content; break; default: //Don't show the event if any of the above are true break; } break; default: echo $content; break; } } } //End foreach ($events as $event){ } ?> </tbody> </table> <div style="clear:both; margin-bottom:30px;"> <input type="checkbox" name="sAll" onclick="selectAll(this)" /> <strong> <?php _e('Check All', 'event_espresso'); ?> </strong><?php if (isset($_POST['event_status']) && $_POST['event_status'] == 'D') { ?> <input name="perm_delete_event" type="submit" class="button-secondary" id="perm_delete_event" value="<?php _e('Permanently Delete Events(s)', 'event_espresso'); ?> " style="margin:10px 0 0 10px;" onclick="return confirmDelete();" /> <?php } else { ?> <input name="delete_event" type="submit" class="button-secondary" id="delete_event" value="<?php _e('Delete Events(s)', 'event_espresso'); ?> " style="margin:10px 0 0 10px;" onclick="return confirmDelete();" /> <a style="margin-left:5px"class="button-secondary" href="admin.php?page=events&action=csv_import"><?php _e('Import Events', 'event_espresso'); ?> </a> <?php if (function_exists('espresso_attendee_import') && $espresso_premium == true) { ?> <a style="margin-left:5px" class="button-secondary" href="admin.php?page=espresso_attendee_import"><?php _e('Import Attendees', 'event_espresso'); ?> </a><?php } ?> <a style="margin-left:5px" class="button-secondary" href="#" onclick="window.location='<?php echo get_bloginfo('wpurl') . "/wp-admin/admin.php?event_espresso&id=" . $event_id . "&export=report&action=payment&type=excel&all_events=true"; ?> '" title="<?php _e('Export to Excel', 'event_espresso'); ?> "><?php _e('Export All Attendee Data', 'event_espresso'); ?> </a> <a class="button-secondary" href="#" onclick="window.location='<?php echo get_bloginfo('wpurl') . "/wp-admin/admin.php?event_espresso&id=" . $event_id . "&export=report&action=event&type=excel&all_events=true"; ?> '" title="<?php _e('Export to Excel', 'event_espresso'); ?> "><?php _e('Export All Event Data', 'event_espresso'); ?> </a> <a style="margin-left:5px" class="button-primary" href="admin.php?page=events&action=add_new_event"><?php _e('Add New Event', 'event_espresso'); ?> </a> <?php } ?> </div> </form> <h4 style="clear:both"><?php _e('Legend', 'event_espresso'); ?> </h4> <dl style="float:left; margin-left:10px; width:200px"> <?php echo defined('EVENT_ESPRESSO_RECURRENCE_MODULE_ACTIVE') ? '<dt><img src="' . EVENT_ESPRESSO_PLUGINFULLURL . 'images/arrow_rotate_clockwise.png" alt="Recurring Event" title="Recurring Event" /> - ' . __('Recurring Event', 'event_espresso') . '</dt>' : ''; ?> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/magnifier.png" width="16" height="16" alt="<?php _e('View Event', 'event_espresso'); ?> " /> - <?php _e('View Event', 'event_espresso'); ?> </dt> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/calendar_edit.png" width="16" height="16" alt="<?php _e('Edit Event', 'event_espresso'); ?> " /> - <?php _e('Edit Event', 'event_espresso'); ?> </dt> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/group.png" width="16" height="16" alt="<?php _e('Event Attendees', 'event_espresso'); ?> " /> - <?php _e('Event Attendees', 'event_espresso'); ?> </dt> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/chart_bar.png" width="16" height="16" alt="<?php _e('Send Event Email', 'event_espresso'); ?> " /> - <?php _e('View Report', 'event_espresso'); ?> </dt> </dl> <dl style="float:left; margin-left:10px;"> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/tag.png" width="16" height="16" alt="<?php _e('Short Code', 'event_espresso'); ?> " /> - <?php _e('Short Code', 'event_espresso'); ?> </dt> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/excel_icon.png" width="16" height="16" alt="<?php _e('Excel Spreadsheet', 'event_espresso'); ?> " /> - <?php _e('Excel Export', 'event_espresso'); ?> </dt> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/csv_icon_sm.gif" width="16" height="16" alt="<?php _e('CSV Spreadsheet', 'event_espresso'); ?> " /> - <?php _e('CSV Export', 'event_espresso'); ?> </dt> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/email_go.png" width="16" height="16" alt="<?php _e('View Report', 'event_espresso'); ?> " /> - <?php _e('Event Newsletter', 'event_espresso'); ?> </dt> </dl> <script> jQuery(document).ready(function($) { /* show the table data */ var mytable = $('#table').dataTable( { "sDom": 'Clfrtip', "aoColumns": [ { "bSortable": false }, null, null, null, null, null, null, null, null, <?php echo function_exists('espresso_is_admin') && espresso_is_admin() == true ? 'null,' : ''; ?> null, { "bSortable": false } ], "aoColumnDefs": [ { "bVisible": false, "aTargets": [ <?php echo $org_options['use_venue_manager'] == 'Y' ? '' : '3,'; ?> 6 ] } ], "oColVis": { "aiExclude": [ 0, 1, 2 ], "buttonText": "Filter: Show / Hide Columns", "bRestore": true }, "bAutoWidth": false, "bStateSave": true, "sPaginationType": "full_numbers", "oLanguage": { "sSearch": "<strong><?php _e('Live Search Filter', 'event_espresso'); ?> :</strong>", "sZeroRecords": "<?php _e('No Records Found!', 'event_espresso'); ?> " } }); }); </script> <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> </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 qoutes.)</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> <?php echo event_espresso_custom_email_info(); }
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 event_espresso_edit_list() { global $wpdb, $org_options; require_once EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/event-management/queries.php'; if (!defined('EVT_ADMIN_URL')) { define('EVT_ADMIN_URL', admin_url('admin.php?page=events')); } // DELETE EVENT if (isset($_POST['delete_event'])) { if (is_array($_POST['checkbox'])) { while (list($key, $value) = each($_POST['checkbox'])) { $del_id = $key; event_espresso_delete_event($del_id); } } ?> <div id="message" class="updated fade"> <p><strong> <?php _e('Event(s) have been permanently deleted.', 'event_espresso'); ?> </strong></p> </div> <?php } // REALLY REALLY DELETE EVENT THIS TIME !!! if (isset($_POST['perm_delete_event'])) { if (is_array($_POST['checkbox'])) { while (list($key, $value) = each($_POST['checkbox'])) { $del_id = $key; event_espresso_empty_event_trash($del_id); } } ?> <div id="message" class="updated fade"> <p><strong> <?php _e('Event(s) have been permanently deleted.', 'event_espresso'); ?> </strong></p> </div> <?php } // dejavu ? $recurrence_icon = ''; if (defined('EVENT_ESPRESSO_RECURRENCE_MODULE_ACTIVE')) { $recurrence_icon = '<img src="' . EVENT_ESPRESSO_PLUGINFULLURL . 'images/arrow_rotate_clockwise.png" alt="Recurring Event" title="Recurring Event" class="re_fr" />'; } // get SQL for query $SQL = espresso_generate_events_page_list_table_sql(); $events = $wpdb->get_results($SQL, OBJECT_K); $total_events = $wpdb->num_rows; //echo '<h4>' . $wpdb->last_query . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>'; //printr( $events, '$events <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); if (file_exists(EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/admin_reports_filters.php')) { require_once EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/admin_reports_filters.php'; espresso_display_admin_reports_filters($total_events); } else { ?> <p> <strong><?php _e('Advanced filters are available in the premium versions.', 'event_espresso'); ?> </strong> <a href="http://eventespresso.com/pricing/?utm_source=ee_plugin_admin&utm_medium=link&utm_content=Advanced+filters+are+available+in+the+premium+versions<?php echo '+ee_version_' . EVENT_ESPRESSO_VERSION; ?> &utm_campaign=event_overview_tab" target="_blank"> <?php _e('Upgrade Now!', 'event_espresso'); ?> </a> </p> <?php } ?> <form id="form1" name="form1" method="post" action="admin.php?page=events<?php //echo $_SERVER["REQUEST_URI"] ?> "> <table id="table" class="widefat event-list" width="100%"> <thead> <tr> <th class="manage-column column-cb check-column" id="cb" scope="col" style="width:28px;"><input type="checkbox"></th> <th class="manage-column column-comments num" id="id" style="padding-top:7px; width:3%;" scope="col" title="Click to Sort"> <span><?php _e('ID', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-title" id="name" scope="col" title="Click to Sort" style="width:26%;"> <span><?php _e('Name', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-title" id="name" scope="col" title="Click to Sort" style="width:12%;"> <span><?php _e('Venue', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-date" id="dow" scope="col" title="Click to Sort" style="width:4%;";> <span><?php _e('DoW', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-author" id="start" scope="col" title="Click to Sort" style="width:12%;"> <span><?php _e('Start Date', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-author" id="start" scope="col" title="Click to Sort" style="width:7%;"> <span><?php _e('Start Time', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-date" id="begins" scope="col" title="Click to Sort" style="width:16%;"> <span><?php _e('Reg Begins', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-date" id="status" scope="col" title="Click to Sort" style="width:8%;"> <span><?php _e('Status', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <?php if (function_exists('espresso_is_admin') && espresso_is_admin() == true && $espresso_premium == true) { ?> <th class="manage-column column-date" id="status" scope="col" title="Click to Sort" style="width:10%;"> <span><?php _e('Creator', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <?php } ?> <th class="manage-column column-date" id="attendees" scope="col" title="Click to Sort" style="width:7%;"> <span><?php _e('Attendees', 'event_espresso'); ?> </span> <span class="sorting-indicator"></span> </th> <th class="manage-column column-author" id="actions" scope="col" style="width:25%;"> <?php _e('Actions', 'event_espresso'); ?> </th> </tr> </thead> <tbody> <?php if ($total_events > 0) { // instead of doing queries for each event while looping through them, we're going to grab a list of event IDs and consolidate our queries outside the loop $event_ids = implode(',', array_keys($events)); // first let's grab attendee counts in one BIG query instead of individual queries for each event $SQL = "SELECT event_id, SUM(quantity) AS quantity FROM " . EVENTS_ATTENDEE_TABLE . " "; $SQL .= "WHERE (payment_status='Completed' OR payment_status='Pending' OR payment_status='Refund') "; $SQL .= "GROUP BY event_id HAVING event_id IN ( {$event_ids} )"; $attendees = $wpdb->get_results($SQL, OBJECT_K); // echo '<h4>' . $wpdb->last_query . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>'; // printr( $attendees, '$attendees <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); // now let's grab start times for each event $SQL = "SELECT event_id, start_time FROM " . EVENTS_START_END_TABLE . " "; $SQL .= "WHERE event_id IN ( {$event_ids} ) "; $SQL .= 'ORDER BY start_time ASC'; $start_times = $wpdb->get_results($SQL, OBJECT_K); // echo '<h4>' . $wpdb->last_query . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>'; // printr( $start_times, '$start_times <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); foreach ($events as $event) { //printr( $event, '$event <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); $event_id = $event->event_id; $event_name = stripslashes_deep($event->event_name); $event_identifier = stripslashes_deep($event->event_identifier); $reg_limit = isset($event->reg_limit) ? $event->reg_limit : ''; $start_date = isset($event->start_date) ? $event->start_date : ''; $start_time = isset($start_times[$event_id]) ? $start_times[$event_id]->start_time : ''; $end_date = isset($event->end_date) ? $event->end_date : ''; $is_active = isset($event->is_active) ? $event->is_active : ''; $status = array(); $recurrence_id = isset($event->recurrence_id) ? $event->recurrence_id : ''; $registration_start = isset($event->registration_start) ? $event->registration_start : ''; $registration_startT = isset($event->registration_startT) ? $event->registration_startT : ''; $event_address = isset($event->address) ? $event->address : ''; $event_address2 = isset($event->address2) ? $event->address2 : ''; $event_city = isset($event->city) ? $event->city : ''; $event_state = isset($event->state) ? $event->state : ''; $event_zip = isset($event->zip) ? $event->zip : ''; $event_country = isset($event->country) ? $event->country : ''; //added new $venue_title = isset($event->venue_title) ? stripslashes_deep($event->venue_title) : ''; $venue_locale = isset($event->locale_name) ? $event->locale_name : ''; $wp_user = isset($event->wp_user) ? $event->wp_user : ''; $event_meta = array(); $event_meta['is_active'] = $is_active; $event_meta['event_status'] = $event->event_status; $event_meta['start_time'] = $start_time; $event_meta['start_date'] = $start_date; $event_meta['registration_start'] = $registration_start; $event_meta['registration_startT'] = $registration_startT; $registration_end = $event_meta['registration_end'] = $event->registration_end; $registration_endT = $event_meta['registration_endT'] = $event->registration_endT; $status = event_espresso_get_is_active($event_id, $event_meta); //Get number of attendees $num_attendees = isset($attendees[$event_id]) ? $attendees[$event_id]->quantity : 0; $location = (!empty($event_address) ? $event_address : '') . (!empty($event_address2) ? '<br />' . $event_address2 : '') . (!empty($event_city) ? '<br />' . $event_city : '') . (!empty($event_state) ? ', ' . $event_state : '') . (!empty($event_zip) ? '<br />' . $event_zip : '') . (!empty($event_country) ? '<br />' . $event_country : ''); $dow = date("D", strtotime($start_date)); ob_start(); ?> <tr> <td class="check-column" style="padding:7px 0 22px 7px; vertical-align:top;"><!--Delete Events--> <?php echo '<input name="checkbox[' . $event_id . ']" type="checkbox" title="Delete Event ' . $event_name . '" />'; ?> </td> <td class="column-comments" style="padding-top:3px;"><?php echo $event_id; ?> </td> <td class="post-title page-title"> <strong><a class="row-title" href="admin.php?page=events&action=edit&event_id=<?php echo $event_id; ?> "><?php echo $event_name; ?> </a> <?php echo $recurrence_id > 0 ? $recurrence_icon : ''; ?> </strong> <div class="row-actions"><span><a href="<?php echo espresso_reg_url($event_id); ?> " target="_blank"><?php _e('View', 'event_espresso'); ?> </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="#" onclick="window.location='<?php echo get_bloginfo('wpurl') . "/wp-admin/admin.php?event_espresso&event_id=" . $event_id . "&export=report&action=payment&type=excel"; ?> '" title="<?php _e('Export to Excel', 'event_espresso'); ?> "><?php _e('Export', 'event_espresso'); ?> </a></span></div> </td> <td class="author"> <?php echo $venue_title != '' ? $venue_title : ''; echo $venue_locale != '' ? '<br />[' . $venue_locale . ']' : ''; ?> </td> <td class="date"><?php echo $dow; ?> </td> <td class="author"><?php echo event_date_display($start_date, get_option('date_format')); ?> </td> <td class="author"><?php echo date(get_option('time_format'), strtotime($start_time)); ?> </td> <td class="date"><?php echo event_date_display($registration_start, get_option('date_format')); ?> @ <?php echo date(get_option('time_format'), strtotime($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"> <?php $attendees_url = add_query_arg(array('event_admin_reports' => 'list_attendee_payments', 'event_id' => $event_id, 'event_status' => $event->event_status), EVT_ADMIN_URL); ?> <a href="<?php echo $attendees_url; ?> "><?php echo $num_attendees . '/' . $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> <a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=unique_id_info_<?php echo $event_id; ?> " title="<?php _e('Get Short URL/Shortcode', 'event_espresso'); ?> "> <div class="shortcode_btn"></div> </a> <a href="#" onclick="window.location='<?php echo get_bloginfo('wpurl') . "/wp-admin/admin.php?event_espresso&event_id=" . $event_id . "&export=report&action=payment&type=excel"; ?> '" title="<?php _e('Export to Excel', 'event_espresso'); ?> "> <div class="excel_exp_btn"></div> </a> <a href="#" onclick="window.location='<?php echo get_bloginfo('wpurl') . "/wp-admin/admin.php?event_espresso&event_id=" . $event_id . "&export=report&action=payment&type=csv"; ?> '" title="<?php _e('Export to CSV', 'event_espresso'); ?> "> <div class="csv_exp_btn"></div> </a> <a href="admin.php?page=events&event_admin_reports=event_newsletter&event_id=<?php echo $event_id; ?> " title="<?php _e('Email Attendees', 'event_espresso'); ?> "> <div class="newsletter_btn"></div> </a> </div> <div id="unique_id_info_<?php echo $event_id; ?> " style="display:none"> <?php _e('<h2>Short URL/Shortcode</h2><p>This is the short URL to this event:</p><p><span class="updated fade">' . espresso_reg_url($event_id) . '</span></p><p>This will show the registration form for this event just about anywhere. Copy and paste the following shortcode into any page or post.</p><p><span class="updated fade">[SINGLEEVENT single_event_id="' . $event_identifier . '"]</span></p> <p class="red_text"> Do not use in place of the main events page that is set in the Organization Settings page.', 'event_espresso'); ?> </div> </td> </tr> <?php $content = ob_get_contents(); ob_end_clean(); echo $content; } //End foreach ($events as $event){ } ?> </tbody> </table> <div style="clear:both; margin-bottom:30px;"> <input type="checkbox" name="sAll" onclick="selectAll(this)" /> <strong> <?php _e('Check All', 'event_espresso'); ?> </strong><?php if (isset($_REQUEST['event_status']) && $_REQUEST['event_status'] == 'D') { ?> <input name="perm_delete_event" type="submit" class="button-secondary" id="perm_delete_event" value="<?php _e('Permanently Delete Events(s)', 'event_espresso'); ?> " style="margin:10px 0 0 10px;" onclick="return confirmDelete();" /> <?php } else { ?> <input name="delete_event" type="submit" class="button-secondary" id="delete_event" value="<?php _e('Delete Events(s)', 'event_espresso'); ?> " style="margin:10px 0 0 10px;" onclick="return confirmDelete();" /> <a style="margin-left:5px"class="button-secondary" href="admin.php?page=events&action=csv_import"><?php _e('Import Events', 'event_espresso'); ?> </a> <?php if (function_exists('espresso_attendee_import') && $espresso_premium == true) { ?> <a style="margin-left:5px" class="button-secondary" href="admin.php?page=espresso_attendee_import"><?php _e('Import Attendees', 'event_espresso'); ?> </a><?php } ?> <a style="margin-left:5px" class="button-secondary" href="#" onclick="window.location='<?php echo get_bloginfo('wpurl') . "/wp-admin/admin.php?event_espresso&export=report&action=payment&type=excel&all_events=true"; ?> '" title="<?php _e('Export to Excel', 'event_espresso'); ?> "><?php _e('Export All Attendee Data', 'event_espresso'); ?> </a> <a class="button-secondary" href="#" onclick="window.location='<?php echo get_bloginfo('wpurl') . "/wp-admin/admin.php?event_espresso&export=report&action=event&type=excel&all_events=true"; ?> '" title="<?php _e('Export to Excel', 'event_espresso'); ?> "><?php _e('Export All Event Data', 'event_espresso'); ?> </a> <a style="margin-left:5px" class="button-primary" href="admin.php?page=events&action=add_new_event"><?php _e('Add New Event', 'event_espresso'); ?> </a> <?php } ?> </div> </form> <h4 style="clear:both"><?php _e('Legend', 'event_espresso'); ?> </h4> <dl style="float:left; margin-left:10px; width:200px"> <?php echo defined('EVENT_ESPRESSO_RECURRENCE_MODULE_ACTIVE') ? '<dt><img src="' . EVENT_ESPRESSO_PLUGINFULLURL . 'images/arrow_rotate_clockwise.png" alt="Recurring Event" title="Recurring Event" /> - ' . __('Recurring Event', 'event_espresso') . '</dt>' : ''; ?> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/magnifier.png" width="16" height="16" alt="<?php _e('View Event', 'event_espresso'); ?> " /> - <?php _e('View Event', 'event_espresso'); ?> </dt> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/calendar_edit.png" width="16" height="16" alt="<?php _e('Edit Event', 'event_espresso'); ?> " /> - <?php _e('Edit Event', 'event_espresso'); ?> </dt> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/group.png" width="16" height="16" alt="<?php _e('Event Attendees', 'event_espresso'); ?> " /> - <?php _e('Event Attendees', 'event_espresso'); ?> </dt> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/chart_bar.png" width="16" height="16" alt="<?php _e('Send Event Email', 'event_espresso'); ?> " /> - <?php _e('View Report', 'event_espresso'); ?> </dt> </dl> <dl style="float:left; margin-left:10px;"> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/tag.png" width="16" height="16" alt="<?php _e('Short Code', 'event_espresso'); ?> " /> - <?php _e('Short Code', 'event_espresso'); ?> </dt> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/excel_icon.png" width="16" height="16" alt="<?php _e('Excel Spreadsheet', 'event_espresso'); ?> " /> - <?php _e('Excel Export', 'event_espresso'); ?> </dt> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/csv_icon_sm.gif" width="16" height="16" alt="<?php _e('CSV Spreadsheet', 'event_espresso'); ?> " /> - <?php _e('CSV Export', 'event_espresso'); ?> </dt> <dt><img src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?> images/icons/email_go.png" width="16" height="16" alt="<?php _e('View Report', 'event_espresso'); ?> " /> - <?php _e('Event Newsletter', 'event_espresso'); ?> </dt> </dl> <script> jQuery(document).ready(function($) { // show the table data var mytable = $('#table').dataTable( { "sDom": 'Clfrtip', "aoColumns": [ { "bSortable": false }, null, null, null, null, null, null, null, null, <?php echo function_exists('espresso_is_admin') && espresso_is_admin() == true ? 'null,' : ''; ?> null, { "bSortable": false } ], "aoColumnDefs": [ { "bVisible": false, "aTargets": [ <?php echo $org_options['use_venue_manager'] == 'Y' ? '' : '3,'; ?> 4 ] } ], "oColVis": { "aiExclude": [ 0, 1, 2 ], "buttonText": "Filter: Show / Hide Columns", "bRestore": true }, "bAutoWidth": false, "bStateSave": true, "sPaginationType": "full_numbers", "oLanguage": { "sSearch": "<strong><?php _e('Live Search Filter', 'event_espresso'); ?> :</strong>", "sZeroRecords": "<?php _e('No Records Found!', 'event_espresso'); ?> " } }); }); </script> <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> <?php echo event_espresso_custom_email_info(); }
function event_espresso_edit_list_widget() { global $wpdb, $org_options; if ($_POST['delete_event']) { if (is_array($_POST['checkbox'])) { while (list($key, $value) = each($_POST['checkbox'])) { $del_id = $key; event_espresso_delete_event($del_id); } } ?> <div id="message" class="updated fade"> <p><strong> <?php _e('Event(s) have been permanently deleted.', 'event_espresso'); ?> </strong></p> </div> <?php } ?> <form id="form1" name="form1" method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?> "> <table id="table" class="widefat fixed" width="100%"> <thead> <tr> <th class="manage-column column-title" id="title" scope="col" title="Click to Sort" style="width: 30%;"><?php _e('Name', 'event_espresso'); ?> </th> <th class="manage-column column-date" id="start" scope="col" title="Click to Sort" style="width: 30%;"><?php _e('Date', 'event_espresso'); ?> </th> <th class="manage-column column-date" id="status" scope="col" title="Click to Sort" style="width: 20%;"><?php _e('Status', 'event_espresso'); ?> </th> <th class="manage-column column-date" id="attendees" scope="col" title="Click to Sort" style="width: 15%;"><?php _e('Attendees', 'event_espresso'); ?> </th> </tr> </thead> <tbody> <?php /* Events */ //Get number of total events $wpdb->query("SELECT id FROM " . EVENTS_DETAIL_TABLE . " WHERE event_status != 'D'"); $total_events = $wpdb->num_rows; //Get total events today $wpdb->query("SELECT id FROM " . EVENTS_DETAIL_TABLE . " WHERE event_status != 'D' AND start_date = '" . $curdate . "' "); $total_events_today = $wpdb->num_rows; if ($total_events > 0) { $curdate = date("Y-m-d"); /*$pieces = explode('-',$curdate, 3); $this_year_r = $pieces[0]; $this_month_r = $pieces[1]; //echo $this_year_r; $days_this_month = date('t', strtotime($curdate));*/ $days_in_dasboard = $org_options['events_in_dasboard'] == '' ? '30' : stripslashes_deep($org_options['events_in_dasboard']); $sql = "SELECT e.id event_id, e.event_name, e.event_identifier, e.reg_limit, e.registration_start, "; $sql .= " e.start_date, e.is_active, e.recurrence_id, e.registration_startT FROM " . EVENTS_DETAIL_TABLE . " e "; $sql .= " WHERE event_status != 'D' "; if ($total_events_today > 0) { $sql .= " AND start_date = '" . $curdate . "' "; global $how_many_events; $how_many_events = __('todays\' events', 'event_espresso'); } else { $sql .= " AND ADDDATE('" . date('Y-m-d') . "', INTERVAL " . $days_in_dasboard . " DAY) >= start_date AND start_date >= '" . date('Y-m-d', strtotime($curdate)) . "' "; global $how_many_events; $how_many_events = __("the next {$days_in_dasboard} days of events", 'event_espresso'); } //$sql .= " WHERE event_status != 'D' 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))."' "; $sql .= " ORDER BY e.start_date ASC "; //echo $sql; $results = $wpdb->get_results($sql); foreach ($results as $result) { $event_id = $result->event_id; $event_name = stripslashes_deep($result->event_name); $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 }