PageRenderTime 48ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/event-espresso.3.1.23.P/templates/registration_page_display.php

https://bitbucket.org/anneivycat/ebcookhouse
PHP | 259 lines | 214 code | 14 blank | 31 comment | 46 complexity | 2b44586c5849c2aabc10d201274bfdb1 MD5 | raw file
  1. <?php
  2. //This is the registration form.
  3. //This is a template file for displaying a registration form for an event on a page.
  4. //There should be a copy of this file in your wp-content/uploads/espresso/ folder.
  5. ?>
  6. <div id="event_espresso_registration_form" class="event-display-boxes ui-widget">
  7. <h3 class="event_title ui-widget-header ui-corner-top" id="event_title-<?php echo $event_id; ?>"> <?php echo $event_name ?> <?php echo $is_active['status'] == 'EXPIRED' ? ' - <span class="expired_event">Event Expired</span>' : ''; ?> <?php echo $is_active['status'] == 'PENDING' ? ' - <span class="expired_event">Event is Pending</span>' : ''; ?> <?php echo $is_active['status'] == 'DRAFT' ? ' - <span class="expired_event">Event is a Draft</span>' : ''; ?> </h3>
  8. <div class="event_espresso_form_wrapper event-data-display ui-widget-content ui-corner-bottom">
  9. <?php
  10. echo apply_filters('filter_hook_espresso_display_add_to_calendar_by_event_id', $event_id);
  11. /* Venue details. Un-comment first and last lines & any venue details you wish to display or use the provided shortcodes. */ ?>
  12. <?php // echo '<div id="venue-details-display">'; ?>
  13. <?php // echo '<p class="section-title">' . __('Venue Details', 'event_espresso') . '</p>'; ?>
  14. <?php // echo $venue_title != ''?'<p id="event_venue_name-'.$event_id.'" class="event_venue_name">'.stripslashes_deep($venue_title).'</p>':''?>
  15. <?php // echo $venue_address != ''?'<p id="event_venue_address-'.$event_id.'" class="event_venue_address">'.stripslashes_deep($venue_address).'</p>':''?>
  16. <?php // echo $venue_address2 != ''?'<p id="event_venue_address2-'.$event_id.'" class="event_venue_address2">'.stripslashes_deep($venue_address2).'</p>':''?>
  17. <?php // echo $venue_city != ''?'<p id="event_venue_city-'.$event_id.'" class="event_venue_city">'.stripslashes_deep($venue_city).'</p>':''?>
  18. <?php // echo $venue_state != ''?'<p id="event_venue_state-'.$event_id.'" class="event_venue_state">'.stripslashes_deep($venue_state).'</p>':''?>
  19. <?php // echo $venue_zip != ''?'<p id="event_venue_zip-'.$event_id.'" class="event_venue_zip">'.stripslashes_deep($venue_zip).'</p>':''?>
  20. <?php // echo $venue_country != ''?'<p id="event_venue_country-'.$event_id.'" class="event_venue_country">'.stripslashes_deep($venue_country).'</p>':''?>
  21. <?php // echo '</div>'; ?>
  22. <?php /* end venue details block */ ?>
  23. <?php if ($display_desc == "Y") {//Show the description or not ?>
  24. <p class="section-title">
  25. <?php _e('Description:', 'event_espresso') ?>
  26. </p>
  27. <div class="event_description clearfix"><?php echo espresso_format_content($event_desc); //Code to show the actual description. The Wordpress function "wpautop" adds formatting to your description. ?></div>
  28. <?php
  29. }//End display description
  30. switch ($is_active['status']) {
  31. case 'EXPIRED': //only show the event description.
  32. _e('<h3 class="expired_event">This event has passed.</h3>', 'event_espresso');
  33. break;
  34. case 'REGISTRATION_CLOSED': //only show the event description.
  35. // if todays date is after $reg_end_date
  36. ?>
  37. <div class="event-registration-closed event-messages ui-corner-all ui-state-highlight">
  38. <span class="ui-icon ui-icon-alert"></span>
  39. <p class="event_full">
  40. <strong>
  41. <?php _e('We are sorry but registration for this event is now closed.', 'event_espresso'); ?>
  42. </strong>
  43. </p>
  44. <p class="event_full">
  45. <strong>
  46. <?php _e('Please <a href="contact" title="contact us">contact us</a> if you would like to know if spaces are still available.', 'event_espresso'); ?>
  47. </strong>
  48. </p>
  49. </div>
  50. <?php
  51. break;
  52. case 'REGISTRATION_NOT_OPEN': //only show the event description.
  53. // if todays date is after $reg_end_date
  54. // if todays date is prior to $reg_start_date
  55. ?>
  56. <div class="event-registration-pending event-messages ui-corner-all ui-state-highlight">
  57. <span class="ui-icon ui-icon-alert"></span>
  58. <p class="event_full">
  59. <strong>
  60. <?php _e('We are sorry but this event is not yet open for registration.', 'event_espresso'); ?>
  61. </strong>
  62. </p>
  63. <p class="event_full">
  64. <strong>
  65. <?php _e('You will be able to register starting ', 'event_espresso');
  66. echo event_espresso_no_format_date($reg_start_date, 'F d, Y'); ?>
  67. </strong>
  68. </p>
  69. </div>
  70. <?php
  71. break;
  72. default: //This will display the registration form
  73. ?>
  74. <form method="post" action="<?php echo home_url() ?>/?page_id=<?php echo $event_page_id ?>" id="registration_form">
  75. <?php
  76. /* Display the address and google map link if available */
  77. if ($location != '' && (empty($org_options['display_address_in_regform']) || $org_options['display_address_in_regform'] != 'N')) {
  78. ?>
  79. <p class="event_address" id="event_address-<?php echo $event_id ?>"><span class="section-title"><?php echo __('Address:', 'event_espresso'); ?></span> <br />
  80. <span class="address-block"> <?php echo stripslashes_deep($location); ?><br />
  81. <span class="google-map-link"><?php echo $google_map_link; ?></span></span> </p>
  82. <?php
  83. }
  84. do_action('action_hook_espresso_social_display_buttons', $event_id);
  85. ?>
  86. <p class="start_date">
  87. <?php if ($end_date !== $start_date) { ?>
  88. <span class="section-title">
  89. <?php _e('Start Date: ', 'event_espresso'); ?>
  90. </span>
  91. <?php } else { ?>
  92. <span class="section-title">
  93. <?php _e('Date: ', 'event_espresso'); ?>
  94. </span>
  95. <?php
  96. }
  97. echo event_date_display($start_date, get_option('date_format'));
  98. if ($end_date !== $start_date) {
  99. echo '<br />';
  100. ?>
  101. <span class="section-title">
  102. <?php _e('End Date: ', 'event_espresso'); ?>
  103. </span> <?php echo event_date_display($end_date, get_option('date_format'));
  104. } ?>
  105. </p>
  106. <?php
  107. /*
  108. * * This section shows the registration form if it is an active event * *
  109. */
  110. if ($display_reg_form == 'Y') {
  111. ?>
  112. <p class="event_time">
  113. <?php
  114. //This block of code is used to display the times of an event in either a dropdown or text format.
  115. if (isset($time_selected) && $time_selected == true) {//If the customer is coming from a page where the time was preselected.
  116. echo event_espresso_display_selected_time($time_id); //Optional parameters start, end, default
  117. } else {
  118. echo event_espresso_time_dropdown($event_id);
  119. }//End time selected
  120. ?>
  121. </p>
  122. <?php
  123. /*
  124. * Added for seating chart addon
  125. */
  126. $display_price_dropdown = true;
  127. if (defined('ESPRESSO_SEATING_CHART')) {
  128. $seating_chart_id = seating_chart::check_event_has_seating_chart($event_id);
  129. if ($seating_chart_id !== false) {
  130. $display_price_dropdown = false;
  131. }
  132. }
  133. if ($display_price_dropdown == true) {
  134. ?>
  135. <p class="event_prices"><?php echo event_espresso_price_dropdown($event_id); //Show pricing in a dropdown or text ?></p>
  136. <?php
  137. } else {
  138. $price_range = seating_chart::get_price_range($event_id);
  139. $price = "";
  140. if ($price_range['min'] != $price_range['max']) {
  141. $price = $org_options['currency_symbol'] . number_format($price_range['min'], 2) . ' - ' . $org_options['currency_symbol'] . number_format($price_range['max'], 2);
  142. } else {
  143. $price = $org_options['currency_symbol'] . number_format($price_range['min'], 2);
  144. }
  145. ?>
  146. <p class="event_prices"><?php echo __('Price: ', 'event_espresso') . $price; ?></p>
  147. <?php
  148. }
  149. /*
  150. * End
  151. */
  152. ?>
  153. <?php
  154. /*
  155. * Added for seating chart addon
  156. */
  157. if (defined('ESPRESSO_SEATING_CHART')) {
  158. $seating_chart_id = seating_chart::check_event_has_seating_chart($event_id);
  159. if ($seating_chart_id !== false) {
  160. ?>
  161. <div class="event_questions" id="event_seating_chart">
  162. <h3 style="clear:both"><?php _e('Seating chart', 'event_espresso'); ?></h3>
  163. <p></p>
  164. <p class="event_form_field">
  165. <label style="height:60px;"><?php _e('Select a Seat:', 'event_espresso'); ?></label>
  166. <input type="text" name="seat_id" value="" class="ee_s_select_seat required" title="<?php _e('Please select a seat.', 'event_espresso'); ?>" event_id="<?php echo $event_id; ?>" readonly="readonly" />
  167. <?php
  168. $seating_chart = $wpdb->get_row("select * from " . EVENTS_SEATING_CHART_TABLE . " where id = $seating_chart_id");
  169. if (trim($seating_chart->image_name) != "" && file_exists(EVENT_ESPRESSO_UPLOAD_DIR . 'seatingchart/images/' . $seating_chart->image_name)) {
  170. ?>
  171. <br/>
  172. <a href="<?php echo EVENT_ESPRESSO_UPLOAD_URL . 'seatingchart/images/' . $seating_chart->image_name; ?>" target="_blank"><?php _e('Seating Chart Image', 'event_espresso'); ?></a>
  173. <?php
  174. }
  175. ?>
  176. </p>
  177. </div>
  178. <?php
  179. }
  180. }
  181. /*
  182. * End
  183. */
  184. ?>
  185. <?php
  186. //Coupons
  187. if (function_exists('event_espresso_coupon_registration_page')) {
  188. echo event_espresso_coupon_registration_page($use_coupon_code, $event_id);
  189. }//End coupons display
  190. //Groupons
  191. if (function_exists('event_espresso_groupon_registration_page')) {
  192. echo event_espresso_groupon_registration_page($use_groupon_code, $event_id);
  193. }//End groupons display
  194. ?>
  195. <fieldset id="event-reg-form-groups">
  196. <h3 class="section-heading">
  197. <?php _e('Registration Details', 'event_espresso'); ?>
  198. </h3>
  199. <?php
  200. //Outputs the custom form questions. This function can be overridden using the custom files addon
  201. echo event_espresso_add_question_groups($question_groups, '', null, 0, array('attendee_number' => 1));
  202. ?>
  203. </fieldset>
  204. <?php
  205. //Multiple Attendees
  206. if ($allow_multiple == "Y" && $number_available_spaces > 1) {
  207. //This returns the additional attendee form fields. Can be overridden in the custom files addon.
  208. echo event_espresso_additional_attendees($event_id, $additional_limit, $number_available_spaces, __('Number of Tickets', 'event_espresso'), true, $event_meta);
  209. } else {
  210. ?>
  211. <input type="hidden" name="num_people" id="num_people-<?php echo $event_id; ?>" value="1">
  212. <?php
  213. }//End allow multiple
  214. ?>
  215. <input type="hidden" name="regevent_action" id="regevent_action-<?php echo $event_id; ?>" value="post_attendee">
  216. <input type="hidden" name="event_id" id="event_id-<?php echo $event_id; ?>" value="<?php echo $event_id; ?>">
  217. <?php
  218. wp_nonce_field('reg_nonce', 'reg_form_nonce');
  219. //Recaptcha portion
  220. if ($org_options['use_captcha'] == 'Y' && $_REQUEST['edit_details'] != 'true' && !is_user_logged_in()) {
  221. if (!function_exists('recaptcha_get_html')) {
  222. require_once(EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/recaptchalib.php');
  223. }//End require captcha library
  224. # the response from reCAPTCHA
  225. $resp = null;
  226. # the error code from reCAPTCHA, if any
  227. $error = null;
  228. ?>
  229. <p class="event_form_field" id="captcha-<?php echo $event_id; ?>">
  230. <?php _e('Anti-Spam Measure: Please enter the following phrase', 'event_espresso'); ?>
  231. <?php echo recaptcha_get_html($org_options['recaptcha_publickey'], $error, is_ssl() ? true : false); ?> </p>
  232. <?php } //End use captcha ?>
  233. <p class="event_form_submit" id="event_form_submit-<?php echo $event_id; ?>">
  234. <input class="btn_event_form_submit ui-button ui-button-big ui-priority-primary ui-state-default ui-state-hover ui-state-focus ui-corner-all" id="event_form_field-<?php echo $event_id; ?>" type="submit" name="Submit" value="<?php _e('Submit', 'event_espresso'); ?>">
  235. </p>
  236. <?php
  237. }
  238. break;
  239. }//End Switch statement to check the status of the event
  240. ?>
  241. </form>
  242. <?php if (isset($ee_style['event_espresso_form_wrapper_close']))
  243. echo $ee_style['event_espresso_form_wrapper_close']; ?>
  244. <?php echo '<p class="register-link-footer">' . espresso_edit_this($event_id) . '</p>' ?> </div>
  245. </div>