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.
- */
- global $EM_Event;
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <title><?php echo sprintf(__('Bookings for %s','dbem'), $EM_Event->name); ?></title>
- <link rel="stylesheet" href="<?php echo bloginfo('wpurl') ?>/wp-content/plugins/events-manager/includes/css/events_manager.css" type="text/css" media="screen" />
- <link rel="stylesheet" href="<?php echo bloginfo('wpurl') ?>/wp-content/themes/v3/assets/css/plugin-tweaks.css" type="text/css" media="screen" />
- </head>
- <body id="printable">
- <div id="container">
- <h1><?php echo sprintf(__('Bookings for %s','dbem'), $EM_Event->name); ?></h1>
- <p><?php echo $EM_Event->output("#j #F #Y"); ?> @ <?php echo $EM_Event->output("#_LOCATION, #_ADDRESS, #_TOWN (#_LOCATIONCOUNTRY)"); ?></p>
- <h3 class='hide'><?php _e('Bookings', 'dbem');?></h3>
- <table id="bookings-table">
- <tr>
- <th scope='col'><?php _e('Name', 'dbem')?></th>
- <th scope='col'><?php _e('Spaces', 'dbem')?></th>
- <th scope='col'><?php _e('Total', 'dbem')?></th>
- <th scope='col'><?php _e('Status', 'dbem')?></th>
- </tr>
- <?php $pending = 0; ?>
- <?php foreach($EM_Event->get_bookings()->bookings as $EM_Booking) {
- // if ( $EM_Booking->status != 1) {
- ?>
- <tr>
- <td class=''><?php echo $EM_Booking->person->get_name(); ?></td>
- <td class=''><?php echo $EM_Booking->get_spaces(); ?></td>
- <td class=''><?php echo $EM_Booking->get_price(true); ?></td>
- <?php
- if ( $EM_Booking->get_status() != 'Approved' ) {
- if ( $EM_Booking->get_spaces() == 1 ) {
- $pending++;
- } else if ( $EM_Booking->get_spaces() > 1 ) {
- $pending = $pending + $EM_Booking->get_spaces();
- }
- }
- ?>
- <td class='payment-status'><?php echo $EM_Booking->get_status(); ?></td>
- </tr>
- <?php
- // }
- }
- ?>
- <tr id='booked-spaces'>
- <td class='xtotal-label' class=''><?php _e('Approved registrations', 'dbem')?>:</td>
- <td colspan='2' class=''> </td>
- <?php
- echo "<td class='spaces-number' class=''>";
- echo $EM_Event->get_bookings()->get_booked_spaces();
- echo "</td>";
- ?>
- </tr>
- <tr id='available-spaces'>
- <td class='xtotal-label' class=''><?php _e('Pending registrations', 'dbem')?>:</td>
- <td colspan='2' class=''> </td>
- <?php
- echo "<td class='spaces-number' class=''>";
- echo $pending;
- echo "</td>";
- ?>
- </tr>
- <tr id='available-spaces'>
- <td class='xtotal-label' class=''><?php _e('Available places', 'dbem')?>:</td>
- <td colspan='2' class=''> </td>
- <?php
- $booked_places = $EM_Event->get_bookings()->get_booked_spaces(); // confirmed bookings
- $booked_places += $pending;
- $available = $EM_Event->get_spaces() - $booked_places;
- ?>
- <td class='spaces-number' class=''><?php echo $available; ?></td>
- </tr>
- <tr id='total-price'>
- <td class='xtotal-label' class=''><?php _e('Total approved registrations', 'dbem')?>:</td>
- <td colspan='2' class=''> </td>
- <?php
- $approvedtotal = $EM_Booking->get_price() * $EM_Event->get_bookings()->get_booked_spaces();
- $total = 0;
- foreach($EM_Event->get_bookings()->bookings as $EM_Booking) {
- if ($EM_Event->get_bookings()->get_booked_spaces() > 1 ) {
- $a = $EM_Booking->get_price();
- } else {
- $a = $EM_Booking->get_price() * $EM_Event->get_bookings()->get_spaces();
- }
- $total += $a;
- }
- ?>
- <td class='spaces-number' class=''><?php echo $EM_Booking->format_price($approvedtotal); ?></td>
- </tr>
- </table>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement