Advertisement
Beee

tickets-list.php

Feb 28th, 2015
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.45 KB | None | 0 0
  1. <?php // template for ticket list in /placeholders/bookingform.php
  2. /*
  3.  * This file generates a tabular list of tickets for the event booking forms with input values for choosing ticket spaces.
  4.  * If you want to add to this form this, you'd be better off hooking into the actions below.
  5.  */
  6. /* @var $EM_Event EM_Event */
  7. global $allowedposttags;
  8. $EM_Tickets = $EM_Event->get_bookings()->get_tickets(); // already instantiated, so should be a quick retrieval.
  9. /*
  10.  * This variable can be overriden, by hooking into the em_booking_form_tickets_cols filter and adding your collumns into this array.
  11.  * Then, you should create a em_booking_form_tickets_col_arraykey action for your collumn data, which will pass a ticket and event object.
  12.  */
  13. $collumns = $EM_Tickets->get_ticket_collumns(); // array of collumn type => title
  14. ?>
  15. <p class="notice">
  16.     <strong>Please note</strong><br />
  17.     To be able to register, your profile info must be up to date. Check it <a href="<?php echo home_url(); ?>/your-profile">here</a>.<br />
  18.     I.C.E. = In Case of Emergency, please enter a phone number here.
  19. </p>
  20. <table class="em-tickets" cellspacing="0" cellpadding="0">
  21.     <tr>
  22.         <?php foreach($collumns as $type => $name): ?>
  23.         <th class="em-bookings-ticket-table-<?php echo $type; ?>"><?php echo $name; ?></th>
  24.         <?php /* if ( $type == 'price' ) { ?>
  25.         <th class="em-bookings-ticket-table-available-spaces"><?php echo __('Available','dbem'); ?></th>
  26.         <?php } */ ?>
  27.         <?php endforeach; ?>
  28.     </tr>
  29.     <?php foreach( $EM_Tickets->tickets as $EM_Ticket ): /* @var $EM_Ticket EM_Ticket */ ?>
  30.         <?php if( $EM_Ticket->is_displayable() ): ?>
  31.             <?php do_action('em_booking_form_tickets_loop_header', $EM_Ticket); //do not delete ?>
  32.             <tr class="em-ticket" id="em-ticket-<?php echo $EM_Ticket->ticket_id; ?>">
  33.                 <?php foreach( $collumns as $type => $name ): ?>
  34.                     <?php
  35.                     // output collumn by type, or call a custom action
  36.                     switch($type){
  37.                         case 'type':
  38.                             ?>
  39.                             <td class="em-bookings-ticket-table-type"><?php echo wp_kses_data($EM_Ticket->ticket_name); ?><?php if(!empty($EM_Ticket->ticket_description)) :?><br><span class="ticket-desc"><?php echo wp_kses($EM_Ticket->ticket_description,$allowedposttags); ?></span><?php endif; ?></td>
  40.                             <?php
  41.                             break;
  42.                         case 'price':
  43.                             ?>
  44.                             <td class="em-bookings-ticket-table-price"><?php echo $EM_Ticket->get_price(true); ?></td>
  45.                             <? /*
  46.                             <td class="em-bookings-ticket-table-available-spaces"><?php echo $EM_Ticket->get_available_spaces()."/".$EM_Ticket->ticket_spaces; ?></td>
  47.                             <td class="em-bookings-ticket-table-available-spaces"><?php echo $EM_Ticket->get_available_spaces(); ?></td>
  48.                             */ ?>
  49.                             <?php
  50.                             break;
  51.                         case 'spaces':
  52.                             ?>
  53.                             <td class="em-bookings-ticket-table-spaces">
  54.                                 <?php
  55.                                     $default = !empty($_REQUEST['em_tickets'][$EM_Ticket->ticket_id]['spaces']) ? $_REQUEST['em_tickets'][$EM_Ticket->ticket_id]['spaces']:0;
  56.                                     $spaces_options = $EM_Ticket->get_spaces_options(true,$default);
  57.                                     echo ( $spaces_options ) ? $spaces_options:"<strong>".__('N/A','dbem')."</strong>";
  58.                                 ?>
  59.                             </td>
  60.                             <?php
  61.                             break;
  62.                         default:
  63.                             do_action('em_booking_form_tickets_col_'.$type, $EM_Ticket, $EM_Event);
  64.                             break;
  65.                     }
  66.                     ?>
  67.                 <?php endforeach; ?>
  68.             </tr>      
  69.             <?php do_action('em_booking_form_tickets_loop_footer', $EM_Ticket); // do not delete ?>
  70.         <?php endif; ?>
  71.     <?php endforeach; ?>
  72. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement