Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * This page displays a printable view of bookings for a single event.
- * You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
- * Here you can assume that $EM_Event is globally available with the right EM_Event object.
- */
- global $EM_Event;
- $email_stack=array();
- <div id="container">
- <h1><?php echo sprintf(__('%s','dbem'), $EM_Event->event_name); ?></h1>
- <?php echo $EM_Event->output("#d #M #Y"); ?>
- <table id="bookings-table">
- <tr>
- <th scope='col'><?php _e('Name', 'dbem')?></th>
- <th scope='col'><?php _e('Contact', 'dbem')?></th>
- <th scope='col'><?php _e('Tickets', 'dbem')?></th>
- <th scope='col'><?php _e('Total', 'dbem')?></th>
- <th scope='col'><?php _e('Purchase Date', 'dbem')?></th>
- <th scope='col'><?php _e('Ref', 'dbem')?></th>
- </tr>
- <?php
- $bookings = array();
- // print_r($EM_Event->get_bookings()->bookings);
- foreach($EM_Event->get_bookings()->bookings as $EM_Booking){
- if ($EM_Booking->booking_status == 1){
- /*
- * you can replace "first_name" and "last_name" with your custom booking form first and last name Field ID
- */
- if( !empty($EM_Booking->booking_meta['registration']['first_name']) ){
- $first_name = trim($EM_Booking->booking_meta['registration']['first_name']);
- }
- if( !empty($EM_Booking->booking_meta['registration']['last_name']) ){
- $last_name = trim($EM_Booking->booking_meta['registration']['last_name']);
- }
- $name = $first_name.' '.$last_name;
- array_push($bookings,
- array(
- 'lastname'=>ucwords($last_name),
- 'firstname'=>ucwords($first_name),
- 'person_name'=>$name,
- 'person_email'=>$EM_Booking->person->user_email,
- 'person_phone'=>$EM_Booking->person->phone,
- 'booking_space'=>$EM_Booking->get_spaces(),
- 'booking_price'=>number_format ( $EM_Booking->get_price_pre_taxes(), 2 ),
- 'booking_date'=>date("d-m-y",$EM_Booking->timestamp),
- 'booking_id'=>$EM_Booking->booking_id
- )
- );
- $email_stack[]=$EM_Booking->person->user_email;
- }
- }
- asort($bookings);
- ?>
- <?php
- foreach($bookings as $EM_Booking) {
- ?>
- <tr>
- <td><?php echo $EM_Booking['person_name'] ?></td>
- <td>Email: <?php echo $EM_Booking['person_email'];?> Tel: <?php echo $EM_Booking['person_phone'] ?></td>
- <td class='spaces-number'><?php echo $EM_Booking['booking_space'] ?></td>
- <td class="booking-total">£<?php echo $EM_Booking['booking_price'] ?></td>
- <td><?php echo $EM_Booking['booking_date'] ?></td>
- <td><?php echo $EM_Booking['booking_id'] ?></td>
- </tr>
- <?php } ?>
- </table>
- <div id="booking-summary">
- <?php _e('Total Sold', 'dbem')?>: <?php echo $EM_Event->get_bookings()->get_booked_spaces(); ?>
- <?php _e('Tickets Remaining', 'dbem')?>:<?php echo $EM_Event->get_bookings()->get_available_spaces(); ?>
- </div>
- <h2>Email list</h2>
- <p style="margin:10px 30px">
- <?php echo implode('; ',$email_stack);?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement