Advertisement
eventsmanager

#_ATTENDEESLIST template with booked tickets

Oct 16th, 2020
475
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /* @var $EM_Event EM_Event */
  3. $people = array();
  4. $EM_Bookings = $EM_Event->get_bookings();
  5. if( count($EM_Bookings->bookings) > 0 ){
  6. ?>
  7. <ul class="event-attendees">
  8. <?php
  9. foreach( $EM_Bookings as $EM_Booking){ /* @var $EM_Booking EM_Booking */
  10. if($EM_Booking->booking_status == 1 && !in_array($EM_Booking->get_person()->ID, $people) ){
  11. $people[] = $EM_Booking->get_person()->ID;
  12. echo '<li>';
  13. echo $EM_Booking->get_person()->get_name();
  14. ?>
  15. <ul>
  16. <?php
  17. $EM_Tickets_Bookings = $EM_Booking->get_tickets_bookings();
  18. foreach( $EM_Tickets_Bookings->tickets_bookings as $EM_Ticket_Booking ){
  19. echo "<li>".$EM_Ticket_Booking->get_ticket()->ticket_name.' - Booked '.$EM_Booking->get_spaces() . ' space(s)'."</li>";
  20. }
  21.  
  22. ?>
  23. </ul>
  24. <?php
  25.  
  26. }elseif($EM_Booking->booking_status == 1 && $EM_Booking->is_no_user() ){
  27. echo '<li>';
  28. echo $EM_Booking->get_person()->get_name();
  29. ?>
  30. <ul>
  31. <?php
  32. $EM_Tickets_Bookings = $EM_Booking->get_tickets_bookings();
  33. foreach( $EM_Tickets_Bookings->tickets_bookings as $EM_Ticket_Booking ){
  34. echo "<li>".$EM_Ticket_Booking->get_ticket()->ticket_name.' - Booked '.$EM_Booking->get_spaces() . ' space(s)' ."</li>";
  35. }
  36. ?>
  37. </ul>
  38. <?php
  39.  
  40. }
  41.  
  42.  
  43.  
  44.  
  45.  
  46. }
  47. ?>
  48. </ul>
  49. <?php
  50. }
Advertisement
RAW Paste Data Copied
Advertisement