} ?> </tbody> </table> </form> <script> $("thead th").button().removeClass("ui-corner-all").css({ display: "table-cell" }); </script> <?php exit; } elseif (isset($_GET['id']) && isset($_GET['action']) && $_GET['action'] == 'contactsheet') { $activity = $ATC->get_activity((int) $_GET["id"]); $activity = $activity[0]; $attendees = $ATC->get_activity_attendance((int) $_GET['id']); foreach ($attendees as $attendee) { $attendee->nok = $ATC->get_nok((int) $attendee->personnel_id); } // We're going to output the contact sheet as a PDF. This means it can be printed easily, or downloaded // so that it can be accessed offline for use on the day. require './fpdf17/fpdf.php'; class PDF extends FPDF { // Page header function Header() { global $activity; $this->SetTextColor(0); $this->Image('49squadron.png', 265, 5, 25); $this->SetFont('Arial', 'B', 15); $this->Cell(0, 8, $activity->title . ' (' . date(ATC_SETTING_DATETIME_OUTPUT, strtotime($activity->startdate)) . '-' . date(ATC_SETTING_DATETIME_OUTPUT, strtotime($activity->enddate)) . ')', 0, 1, 'C'); $this->SetFont('Arial', '', 8);
$description = ''; foreach ($userids as $userid) { if (!$userid) { continue; } // Don't keep repulling the same user details for every event, if we find them once, store them for next time... if (!isset($users[$userid])) { $users[$userid] = $ATC->get_personnel($userid); } if (!$ATC->user_has_permission(ATC_PERMISSION_PERSONNEL_VIEW, $userid)) { echo 'ATTENDEE;ROLE=REQ-PARTICIPANT;' . vcalendaruserstring($users[$userid]->rank . ' ' . $users[$userid]->display_name, '', '') . $CRLF; $description .= ' o ' . $users[$userid]->rank . ' ' . $users[$userid]->display_name . $CRLF; } else { echo 'ATTENDEE;ROLE=REQ-PARTICIPANT;' . vcalendaruserstring($users[$userid]->rank . ' ' . $users[$userid]->display_name, $users[$userid]->email, $users[$userid]->mobile_phone) . $CRLF; $description .= ' o ' . vcalendarsafestring($users[$userid]->rank) . ' ' . vcalendarsafestring($users[$userid]->display_name) . ' ' . ($users[$userid]->mobile_phone ? '(' . vcalendarsafestring($users[$userid]->mobile_phone) . ')' : '') . $CRLF . ' <' . vcalendarsafestring($users[$userid]->email) . '>' . $CRLF; $noks = $ATC->get_nok($userid); foreach ($noks as $nok) { $description .= ' '; switch ($nok->relationship) { case ATC_NOK_TYPE_MOTHER: $description .= ' (Mother)'; break; case ATC_NOK_TYPE_FATHER: $description .= ' (Father)'; break; case ATC_NOK_TYPE_STEPMOTHER: $description .= ' (Step-Mother)'; break; case ATC_NOK_TYPE_STEPFATHER: $description .= ' (Step-Mother)'; break;