function dbem_bookings_compact_table($event_id) { $bookings = dbem_get_bookings_for($event_id); $destination = get_bloginfo('url') . "/wp-admin/edit.php"; $available_seats = dbem_get_available_seats($event_id); $booked_seats = dbem_get_booked_seats($event_id); $printable_address = get_bloginfo('url') . "/wp-admin/admin.php?page=people&action=printable&event_id={$event_id}"; if (count($bookings) > 0) { $table = "<div class='wrap'>\n\t\t\t\t<h4>{$booked_seats} " . __('responses so far') . ":</h4>\n \n\t\t\t \n\t\t\t\t<table id='dbem-bookings-table-{$event_id}' class='widefat post fixed'>\n\n\t\t\t\t\t<thead>\n\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th class='manage-column column-cb check-column' scope='col'> </th>\n\n\t\t\t\t\t\t\t<th class='manage-column ' scope='col'>" . __('Responder', 'dbem') . "</th>\n\n\t\t\t\t\t\t\t<th scope='col'>" . __('Spaces', 'dbem') . "</th>\n\n\t\t\t\t\t \t</tr>\n\n\t\t\t\t\t\t</thead>\n\n\t\t\t\t\t\t<tfoot>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th scope='row' colspan='2'>" . __('Booked spaces', 'dbem') . ":</th><td class='booking-result' id='booked-seats'>{$booked_seats}</td></tr> \n\t\t\t\t\t \t\t\t<tr><th scope='row' colspan='2'>" . __('Available spaces', 'dbem') . ":</th><td class='booking-result' id='available-seats'>{$available_seats}</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tfoot>\n\t\t\t\t\t\t<tbody>"; foreach ($bookings as $booking) { $table .= "<tr id='booking-" . $booking['booking_id'] . "'> \n\t\t\t\t\t<td><a id='booking-check-" . $booking['booking_id'] . "' class='bookingdelbutton'>X</a></td>\n\t\t\t\t\t<td><a title='" . $booking['person_email'] . " - " . $booking['person_phone'] . "'>" . $booking['person_name'] . "</a></td>\n\t\t\t\t\t<td>" . $booking['booking_seats'] . "</td>\n\t\t\t\t </tr>"; } $table .= "</tbody>\n\n\t\t\t\t\t\t\t\t\t\n\t\t \t\t\t</table>\n\t\t \t\t</div>\n\t\t \t\t\n\t\t \t <br class='clear'/>\n\t\t \t\t \t<div id='major-publishing-actions'> \n\t\t\t\t\t<div id='publishing-action'> \n\t\t\t\t\t<a id='printable' target='' href='{$printable_address}'>" . __('Printable view', 'dbem') . "</a>\n\t\t\t\t\t<br class='clear'/> \n\t \n\t\t\t\t\t \n\t\t \t\t\t</div>\n\t\t<br class='clear'/> \n\t\t </div> "; } else { $table .= "<p><em>" . __('No responses yet!') . "</em></p>"; } echo $table; }
function dbem_printable_booking_report($event_id) { $event = dbem_get_event($event_id); $bookings = dbem_get_bookings_for($event_id); $available_seats = dbem_get_available_seats($event_id); $booked_seats = dbem_get_booked_seats($event_id); $stylesheet = get_bloginfo('url') . "/wp-content/plugins/events-manager/events_manager.css"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <title>Bookings for <?php echo $event['event_name']; ?> </title> <link rel="stylesheet" href="<?php echo $stylesheet; ?> " type="text/css" media="screen" /> </head> <body id="printable"> <div id="container"> <h1>Bookings for <?php echo $event['event_name']; ?> </h1> <p><?php echo dbem_replace_placeholders("#d #M #Y", $event); ?> </p> <p><?php echo dbem_replace_placeholders("#_LOCATION, #_ADDRESS, #_TOWN", $event); ?> </p> <h2><?php _e('Bookings data', 'dbem'); ?> </h2> <table id="bookings-table"> <tr> <th scope='col'><?php _e('Name', 'dbem'); ?> </th> <th scope='col'><?php _e('E-mail', 'dbem'); ?> </th> <th scope='col'><?php _e('Phone number', 'dbem'); ?> </th> <th scope='col'><?php _e('Seats', 'dbem'); ?> </th> <?php foreach ($bookings as $booking) { ?> <tr> <td><?php echo $booking['person_name']; ?> </td> <td><?php echo $booking['person_email']; ?> </td> <td><?php echo $booking['person_phone']; ?> </td> <td class='seats-number'><?php echo $booking['booking_seats']; ?> </td> </tr> <?php } ?> <tr id='booked-seats'> <td colspan='2'> </td> <td class='total-label'><?php _e('Booked', 'dbem'); ?> :</td> <td class='seats-number'><?php echo $booked_seats; ?> </td> </tr> <tr id='available-seats'> <td colspan='2'> </td> <td class='total-label'><?php _e('Available', 'dbem'); ?> :</td> <td class='seats-number'><?php echo $available_seats; ?> </td> </tr> </table> </div> </body> </html> <?php die; }