Advertisement
Guest User

registration_page_display.php

a guest
Feb 6th, 2013
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 13.41 KB | None | 0 0
  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">
  7.   <div class="event_espresso_form_wrapper event-data-display">
  8.         <h2 class="event_title" 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>' : ''; ?> </h2>
  9.  
  10. <!--        <?php
  11.         echo apply_filters('filter_hook_espresso_display_add_to_calendar_by_event_id', $event_id);
  12.         /* Venue details. Un-comment first and last lines & any venue details you wish to display or use the provided shortcodes. */ ?>
  13.         <?php // echo '<div id="venue-details-display">'; ?>
  14.         <?php // echo '<p class="section-title">' . __('Venue Details', 'event_espresso') . '</p>'; ?>
  15.         <?php // echo $venue_title != ''?'<p id="event_venue_name-'.$event_id.'" class="event_venue_name">'.stripslashes_deep($venue_title).'</p>':''?>
  16.         <?php // echo $venue_address != ''?'<p id="event_venue_address-'.$event_id.'" class="event_venue_address">'.stripslashes_deep($venue_address).'</p>':''?>
  17.         <?php // echo $venue_address2 != ''?'<p id="event_venue_address2-'.$event_id.'" class="event_venue_address2">'.stripslashes_deep($venue_address2).'</p>':''?>
  18.         <?php // echo $venue_city != ''?'<p id="event_venue_city-'.$event_id.'" class="event_venue_city">'.stripslashes_deep($venue_city).'</p>':''?>
  19.         <?php // echo $venue_state != ''?'<p id="event_venue_state-'.$event_id.'" class="event_venue_state">'.stripslashes_deep($venue_state).'</p>':''?>
  20.         <?php // echo $venue_zip != ''?'<p id="event_venue_zip-'.$event_id.'" class="event_venue_zip">'.stripslashes_deep($venue_zip).'</p>':''?>
  21.         <?php // echo $venue_country != ''?'<p id="event_venue_country-'.$event_id.'" class="event_venue_country">'.stripslashes_deep($venue_country).'</p>':''?>
  22.         <?php // echo '</div>'; ?>
  23.         <?php /* end venue details block */ ?> -->
  24.  
  25.         <?php if ($display_desc == "Y") {//Show the description or not ?>
  26. <!--            <p class="section-title">
  27.                 <?php _e('Description:', 'event_espresso') ?>
  28.             </p> -->
  29.             <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>
  30.             <?php
  31.         }//End display description
  32.  
  33.  
  34.  
  35.         switch ($is_active['status']) {
  36.             case 'EXPIRED': //only show the event description.
  37.                 _e('<h3 class="expired_event">This event has passed.</h3>', 'event_espresso');
  38.                 break;
  39.  
  40.             case 'REGISTRATION_CLOSED': //only show the event description.
  41.                 // if todays date is after $reg_end_date
  42.                 ?>
  43.                 <div class="event-registration-closed event-messages">
  44.  
  45.                     <p class="event_full">
  46.                         <strong>
  47.                             <?php _e('We are sorry but registration for this event is now closed.', 'event_espresso'); ?>
  48.                         </strong>
  49.                     </p>
  50.                     <p class="event_full">
  51.                         <strong>
  52.                             <?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'); ?>
  53.                         </strong>
  54.                     </p>
  55.                 </div>
  56.                 <?php
  57.                 break;
  58.  
  59.             case 'REGISTRATION_NOT_OPEN': //only show the event description.
  60.                 // if todays date is after $reg_end_date
  61.                 // if todays date is prior to $reg_start_date
  62.                 ?>
  63.                 <div class="event-registration-pending event-messages">
  64.                     <p class="event_full">
  65.                         <strong>
  66.                             <?php _e('We are sorry but this event is not yet open for registration.', 'event_espresso'); ?>
  67.                         </strong>
  68.                     </p>
  69.                     <p class="event_full">
  70.                         <strong>
  71.                             <?php _e('You will be able to register starting ', 'event_espresso');
  72.                             echo event_espresso_no_format_date($reg_start_date, 'F d, Y'); ?>
  73.                         </strong>
  74.                     </p>
  75.                 </div>
  76.                 <?php
  77.                 break;
  78.  
  79.             default: //This will display the registration form
  80.                 ?>
  81.                 <form method="post" action="<?php echo home_url() ?>/?page_id=<?php echo $event_page_id ?>" id="registration_form">
  82.                
  83.                
  84.                     <?php
  85.                     /* Display the address and google map link if available */
  86.                     if ($location != '' && (empty($org_options['display_address_in_regform']) || $org_options['display_address_in_regform'] != 'N')) {
  87.                         ?>
  88.                        
  89.                        
  90. <!--                <p class="event_address" id="event_address-<?php echo $event_id ?>"><span class="section-title"><?php echo __('Address:', 'event_espresso'); ?></span> <br />
  91.                             <span class="address-block"> <?php echo stripslashes_deep($location); ?><br />
  92.                                 <span class="google-map-link"><?php echo $google_map_link; ?></span></span> </p> -->
  93.                         <?php
  94.                     }
  95.                     do_action('action_hook_espresso_social_display_buttons', $event_id);
  96.                     ?>
  97.                    
  98. <div class="dtwrapper">
  99. <div class="leftt">
  100. <table align="left" width="30%">
  101.     <tr>
  102.         <td><b><?php _e('Start: ', 'event_espresso'); ?></b></td>
  103.         <td><?php echo do_shortcode('[EVENT_TIME event_id="'.$event_id.'" type="start_date" format="d/m/Y g:iA"]'); ?></td>
  104.     </tr>
  105.     <tr>
  106.         <td><b><?php _e('End: ', 'event_espresso'); ?></b></td>
  107.         <td><?php echo do_shortcode('[EVENT_TIME event_id="'.$event_id.'" type="end_date" format="d/m/Y g:iA"]'); ?></td>
  108.     </tr>
  109.     <tr>
  110.         <td><b><?php _e('Price: ', 'event_espresso'); ?></b></td>
  111.         <td>&#36;<?php echo do_shortcode('[EVENT_PRICE event_id="'.$event_id.'" number="0"]');?></td>
  112.     </tr>
  113. </table>
  114. </div> <!-- end leftt -->
  115.  
  116. <div class="rightt">
  117. <table align="left" width="70%">
  118.     <tr>
  119.         <td><b><?php echo __('Venue:', 'event_espresso'); ?></b></td>
  120.         <td><?php echo $venue_title; ?></td>
  121.     </tr>
  122.         <td><b><?php echo __('Address:', 'event_espresso'); ?></b></td>
  123.         <td><?php echo stripslashes_deep($location); ?><br /><span class="google-map-link"><?php echo $google_map_link; ?></span></td>
  124.     </tr>
  125. </table>
  126. </div> <!-- end rightt -->
  127. </div> <!-- end dtwrapper -->
  128. <div class="google_map_eembed">
  129. <?php echo '<iframe width="100%" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com.au/maps?q=', str_replace("<br />", " ", "$location"), '&output=embed"></iframe>' ?>
  130. <br /><small><?php echo '<a href="https://maps.google.com.au/maps?q=', str_replace("<br />", " ", "$location"), ';source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>' ?>
  131. </div>
  132.  
  133. <!--    old info display
  134.                             <p class="start_date">
  135.                             <?php if ($end_date !== $start_date) { ?>
  136.                             <span class="section-title">
  137.                             <?php _e('Start Date: ', 'event_espresso'); ?>
  138.                             </span>
  139.                             <?php } else { ?>
  140.                             <span class="section-title">
  141.                             <?php _e('Date: ', 'event_espresso'); ?>
  142.                             </span>
  143.                             <?php
  144.                         }
  145.                         echo event_date_display($start_date, get_option('date_format'));
  146.                         if ($end_date !== $start_date) {
  147.                             echo '<br />';
  148.                             ?>
  149.                             <span class="section-title">
  150.                             <?php _e('End Date: ', 'event_espresso'); ?>
  151.                             </span> <?php echo event_date_display($end_date, get_option('date_format'));
  152.                         } ?>
  153.                     </p> -->
  154.  
  155.  
  156.  
  157.  
  158.                     <?php
  159.                     /*
  160.                      * * This section shows the registration form if it is an active event * *
  161.                      */
  162.  
  163.                     if ($display_reg_form == 'Y') {
  164.                         ?>
  165. <!--                        <p class="event_time">
  166.                             <?php
  167.                             //This block of code is used to display the times of an event in either a dropdown or text format.
  168.                             if (isset($time_selected) && $time_selected == true) {//If the customer is coming from a page where the time was preselected.
  169.                                 echo event_espresso_display_selected_time($time_id); //Optional parameters start, end, default
  170.                             } else {
  171.                                 echo event_espresso_time_dropdown($event_id);
  172.                             }//End time selected
  173.                             ?>
  174.                         </p> -->
  175.                         <?php
  176.                         /*
  177.                          * Added for seating chart addon
  178.                          */
  179.                         $display_price_dropdown = true;
  180.                         if (defined('ESPRESSO_SEATING_CHART')) {
  181.                             $seating_chart_id = seating_chart::check_event_has_seating_chart($event_id);
  182.                             if ($seating_chart_id !== false) {
  183.                                 $display_price_dropdown = false;
  184.                             }
  185.                         }
  186.  
  187.                         if ($display_price_dropdown == true) {
  188.                             ?>
  189.                             <p class="event_prices"><?php echo event_espresso_price_dropdown($event_id); //Show pricing in a dropdown or text ?></p>
  190.                             <?php
  191.                         } else {
  192.                             $price_range = seating_chart::get_price_range($event_id);
  193.                             $price = "";
  194.                             if ($price_range['min'] != $price_range['max']) {
  195.                                 $price = $org_options['currency_symbol'] . number_format($price_range['min'], 2) . ' - ' . $org_options['currency_symbol'] . number_format($price_range['max'], 2);
  196.                             } else {
  197.                                 $price = $org_options['currency_symbol'] . number_format($price_range['min'], 2);
  198.                             }
  199.                             ?>
  200.                             <p class="event_prices"><?php echo __('Price: ', 'event_espresso') . $price; ?></p>
  201.                             <?php
  202.                         }
  203.                         /*
  204.                          * End
  205.                          */
  206.                         ?>
  207.                         <?php
  208.                         /*
  209.                          * Added for seating chart addon
  210.                          */
  211.                         if (defined('ESPRESSO_SEATING_CHART')) {
  212.                             $seating_chart_id = seating_chart::check_event_has_seating_chart($event_id);
  213.                             if ($seating_chart_id !== false) {
  214.                                 ?>
  215.                                 <div class="event_questions" id="event_seating_chart">
  216.                                     <h3 style="clear:both"><?php _e('Seating chart', 'event_espresso'); ?></h3>
  217.                                     <p></p>
  218.                                     <p class="event_form_field">
  219.                                         <label style="height:60px;">Select a Seat:</label>
  220.                                         <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"  />
  221.                                         <?php
  222.                                         $seating_chart = $wpdb->get_row("select * from " . EVENTS_SEATING_CHART_TABLE . " where id = $seating_chart_id");
  223.                                         if (trim($seating_chart->image_name) != "" && file_exists(EVENT_ESPRESSO_UPLOAD_DIR . 'seatingchart/images/' . $seating_chart->image_name)) {
  224.                                             ?>
  225.                                             <br/>
  226.                                             <a href="<?php echo EVENT_ESPRESSO_UPLOAD_URL . 'seatingchart/images/' . $seating_chart->image_name; ?>" target="_blank">Seating chart image</a>
  227.                                             <?php
  228.                                         }
  229.                                         ?>
  230.  
  231.                                     </p>
  232.                                 </div>
  233.                                 <?php
  234.                             }
  235.                         }
  236.                         /*
  237.                          * End
  238.                          */
  239.                         ?>
  240.                         <?php
  241.                         //Coupons
  242.                         if (function_exists('event_espresso_coupon_registration_page')) {
  243.                             echo event_espresso_coupon_registration_page($use_coupon_code, $event_id);
  244.                         }//End coupons display
  245.                         //Groupons
  246.                         if (function_exists('event_espresso_groupon_registration_page')) {
  247.                             echo event_espresso_groupon_registration_page($use_groupon_code, $event_id);
  248.                         }//End groupons display
  249.                         ?>
  250.  
  251.                         <fieldset id="event-reg-form-groups">
  252.                             <h3 class="section-heading">
  253.                             <?php _e('Registration Details', 'event_espresso'); ?>
  254.                             </h3>
  255.                             <?php
  256.                             //Outputs the custom form questions. This function can be overridden using the custom files addon
  257.                             echo event_espresso_add_question_groups($question_groups, '', null, 0, array('attendee_number' => 1));
  258.                             ?>
  259.                         </fieldset>
  260.                         <?php
  261.                         //Multiple Attendees
  262.                         if ($allow_multiple == "Y" && $number_available_spaces > 1) {
  263.  
  264.                             //This returns the additional attendee form fields. Can be overridden in the custom files addon.
  265.                             echo event_espresso_additional_attendees($event_id, $additional_limit, $number_available_spaces, __('Number of Tickets', 'event_espresso'), true, $event_meta);
  266.                         } else {
  267.                             ?>
  268.                             <input type="hidden" name="num_people" id="num_people-<?php echo $event_id; ?>" value="1">
  269.                             <?php
  270.                         }//End allow multiple
  271.                         ?>
  272.                         <input type="hidden" name="regevent_action" id="regevent_action-<?php echo $event_id; ?>" value="post_attendee">
  273.                         <input type="hidden" name="event_id" id="event_id-<?php echo $event_id; ?>" value="<?php echo $event_id; ?>">
  274.                         <?php
  275.                         //Recaptcha portion
  276.                         if ($org_options['use_captcha'] == 'Y' && $_REQUEST['edit_details'] != 'true') {
  277.                             if (!function_exists('recaptcha_get_html')) {
  278.                                 require_once(EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/recaptchalib.php');
  279.                             }//End require captcha library
  280.                             # the response from reCAPTCHA
  281.                             $resp = null;
  282.                             # the error code from reCAPTCHA, if any
  283.                             $error = null;
  284.                             ?>
  285.                             <p class="event_form_field" id="captcha-<?php echo $event_id; ?>">
  286.                                 <?php _e('Anti-Spam Measure: Please enter the following phrase', 'event_espresso'); ?>
  287.                             <?php echo recaptcha_get_html($org_options['recaptcha_publickey'], $error, is_ssl() ? true : false); ?> </p>
  288.             <?php } //End use captcha  ?>
  289.                         <p class="event_form_submit" id="event_form_submit-<?php echo $event_id; ?>">
  290.                             <input class="btn_event_form_submit" id="event_form_field-<?php echo $event_id; ?>" type="submit" name="Submit" value="<?php _e('Submit', 'event_espresso'); ?>">
  291.                         </p>
  292.                         <?php
  293.                     }
  294.                     break;
  295.             }//End Switch statement to check the status of the event
  296.             ?>
  297.     </form>
  298.         <?php if (isset($ee_style['event_espresso_form_wrapper_close']))
  299.             echo $ee_style['event_espresso_form_wrapper_close']; ?>
  300. <?php echo '<p class="register-link-footer">' . espresso_edit_this($event_id) . '</p>' ?> </div>
  301. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement