Advertisement
eventsmanager

bookings-event-printable.php - Sort by Name

Feb 27th, 2013 (edited)
554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. <?php
  2. /*
  3. * This page displays a printable view of bookings for a single event.
  4. * You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need.
  5. * Here you can assume that $EM_Event is globally available with the right EM_Event object.
  6. */
  7. global $EM_Event;
  8. ?>
  9. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  10. <html>
  11. <head>
  12. <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  13. <title><?php echo sprintf(__('Bookings for %s','dbem'), $EM_Event->name); ?></title>
  14. <link rel="stylesheet" href="<?php echo bloginfo('wpurl') ?>/wp-content/plugins/events-manager/includes/css/events_manager.css" type="text/css" media="screen" />
  15. </head>
  16. <body id="printable">
  17. <div id="container">
  18. <h1><?php echo sprintf(__('Bookings for %s','dbem'), $EM_Event->name); ?></h1>
  19. <p><?php echo $EM_Event->output("#d #M #Y"); ?></p>
  20. <p><?php echo $EM_Event->output("#_LOCATION, #_ADDRESS, #_TOWN"); ?></p>
  21. <h2><?php _e('Bookings data', 'dbem');?></h2>
  22. <table id="bookings-table">
  23. <tr>
  24. <th scope='col'><?php _e('Name', 'dbem')?></th>
  25. <th scope='col'><?php _e('E-mail', 'dbem')?></th>
  26. <th scope='col'><?php _e('Phone number', 'dbem')?></th>
  27. <th scope='col'><?php _e('Spaces', 'dbem')?></th>
  28. <th scope='col'><?php _e('Comment', 'dbem')?></th>
  29. </tr>
  30.  
  31. <?php
  32. $bookings = array();
  33. foreach($EM_Event->get_bookings()->bookings as $EM_Booking){
  34. if ($EM_Booking->booking_status == 1){
  35. array_push($bookings, array(
  36. 'person_name'=>$EM_Booking->person->get_name(),
  37. 'person_email'=>$EM_Booking->person->user_email,
  38. 'person_phone'=>$EM_Booking->person->phone,
  39. 'booking_space'=>$EM_Booking->get_spaces(),
  40. 'booking_comment'=>$EM_Booking->booking_comment
  41. )
  42. );
  43. }
  44. }
  45. krsort($bookings);
  46. ?>
  47. <?php
  48. foreach($bookings as $EM_Booking) {
  49. ?>
  50. <tr>
  51. <td><?php echo $EM_Booking['person_name'] ?></td>
  52. <td><?php echo $EM_Booking['person_email'] ?></td>
  53. <td><?php echo $EM_Booking['person_phone'] ?></td>
  54. <td class='spaces-number'><?php echo $EM_Booking['booking_space'] ?></td>
  55. <td><?php echo $EM_Booking['booking_comment'] ?></td>
  56. </tr>
  57. <?php
  58. }
  59. ?>
  60. <tr id='booked-spaces'>
  61. <td colspan='3'>&nbsp;</td>
  62. <td class='total-label'><?php _e('Booked', 'dbem')?>:</td>
  63. <td class='spaces-number'><?php echo $EM_Event->get_bookings()->get_booked_spaces(); ?></td>
  64. </tr>
  65. <tr id='available-spaces'>
  66. <td colspan='3'>&nbsp;</td>
  67. <td class='total-label'><?php _e('Available', 'dbem')?>:</td>
  68. <td class='spaces-number'><?php echo $EM_Event->get_bookings()->get_available_spaces(); ?></td>
  69. </tr>
  70. </table>
  71. </div>
  72. </body>
  73. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement