Warning: Cannot modify header information - headers already sent by (output started at /var/www/jonas-eriksen.dk/pic/private/index.php:1) in /var/www/jonas-eriksen.dk/pic/private/index.php on line 215
var/www/jonas-eriksen.dk/export/export-user.php 0000644 00000013302 15233473430 0015657 0 ustar 00 getUser($userId);
$a = $admin->getAdmin($adminId);
$e = $event->getAllForUserForPrint($userId);
$skv = $user->getSKV($userId, 'report');
$name = $u[3];
$address = $u[4];
$email = $u[6];
$cpr = decrypt($u[2], $encryptKey);
$phone = $u[9];
$shooterId = $u[1];
$birthday = $u[5];
$class = $u[17];
$pdf = new PDF();
$pdf->AliasNbPages();
// First page
$pdf->AddPage();
$pdf->SetFont('Times', 'B', 20);
// Move to the right
$pdf->Cell(80);
// Title
$pdf->Cell(30, 10, 'EKSPORT AF BRUGER', 0, 0, 'C');
// Line break
$pdf->Ln(10);
// Move to the right
$pdf->Cell(80);
$pdf->SetTextColor(0, 0, 255);
// Title
$pdf->Cell(30, 10, '--- ' . $name . ' ---', 0, 0, 'C');
$pdf->Image('../static/' . $logoName, 85, 40, 40, 0, '');
$pdf->SetFont('Times', '', 10);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY(10, 100);
$pdf->Write(5, utf8_decode("Eksport dato: " . date("d-m-Y")));
$pdf->SetXY(10, 110);
$pdf->Write(5, utf8_decode("Eksport af: " . $a[1] . " (" . $a[0] . ")"));
$pdf->SetXY(10, 120);
$pdf->Write(5, utf8_decode("Dokument indeholder"));
$pdf->SetXY(20, 130);
$pdf->Write(5, utf8_decode(" - Information om brugeren"));
$pdf->SetXY(20, 140);
$pdf->Write(5, utf8_decode(" - Skydninger udført af brugeren"));
$pdf->SetXY(20, 150);
$pdf->Write(5, utf8_decode(" - SKV informationer"));
// ---- next page
$pdf->AddPage();
$pdf->SetFont('Times', 'B', 15);
// Move to the right
$pdf->Cell(80);
// Title
$pdf->Cell(30, 10, utf8_decode('Information på bruger'), 0, 0, 'C');
// Line break
$pdf->Ln(10);
$pdf->SetFont('Times', 'B', 10);
$pdf->SetXY(10, 30);
$pdf->Write(5, utf8_decode("CPR"));
$pdf->SetFont('Times', 'U', 10);
$pdf->SetXY(35, 30);
$pdf->Write(5, $cpr);
$pdf->SetFont('Times', 'B', 10);
$pdf->SetXY(10, 40);
$pdf->Write(5, utf8_decode("Skyttenummer"));
$pdf->SetFont('Times', 'U', 10);
$pdf->SetXY(35, 40);
$pdf->Write(5, utf8_decode($shooterId));
$pdf->SetFont('Times', 'B', 10);
$pdf->SetXY(10, 50);
$pdf->Write(5, utf8_decode("Navn"));
$pdf->SetFont('Times', 'U', 10);
$pdf->SetXY(35, 50);
$pdf->Write(5, utf8_decode($name));
$pdf->SetFont('Times', 'B', 10);
$pdf->SetXY(10, 60);
$pdf->Write(5, utf8_decode("Skytteklasse"));
$pdf->SetFont('Times', 'U', 10);
$pdf->SetXY(35, 60);
$pdf->Write(5, utf8_decode($class));
$pdf->SetFont('Times', 'B', 10);
$pdf->SetXY(10, 70);
$pdf->Write(5, utf8_decode("Adresse"));
$pdf->SetFont('Times', 'U', 10);
$pdf->SetXY(35, 70);
$pdf->Write(5, utf8_decode($address));
$pdf->SetFont('Times', 'B', 10);
$pdf->SetXY(10, 80);
$pdf->Write(5, utf8_decode("Fødselsdag"));
$pdf->SetFont('Times', 'U', 10);
$pdf->SetXY(35, 80);
$pdf->Write(5, utf8_decode($birthday));
$pdf->SetFont('Times', 'B', 10);
$pdf->SetXY(10, 90);
$pdf->Write(5, utf8_decode("Telefon"));
$pdf->SetFont('Times', 'U', 10);
$pdf->SetXY(35, 90);
$pdf->Write(5, utf8_decode($phone));
$pdf->SetFont('Times', 'B', 10);
$pdf->SetXY(10, 100);
$pdf->Write(5, utf8_decode("Email"));
$pdf->SetFont('Times', 'U', 10);
$pdf->SetXY(35, 100);
$pdf->Write(5, utf8_decode($email));
$pdf->SetFont('Times', 'B', 10);
$pdf->SetXY(150, 25);
$pdf->Write(5, utf8_decode("Profilbillede"));
if (is_file('../static/profile-picture/' . $userId . '.jpg') && file_exists('../static/profile-picture/' . $userId . '.jpg')) {
$pdf->Image('../static/profile-picture/' . $userId . '.jpg', 150, 30, 40, 0, '');
} else {
$pdf->Image('../static/' . $logoName, 150, 30, 40, 0, '');
}
// ---- next page
$pdf->AddPage();
$pdf->SetFont('Times', 'B', 15);
// Move to the right
$pdf->Cell(80);
// Title
$pdf->Cell(30, 10, utf8_decode('Events'), 0, 0, 'C');
// Line break
$pdf->Ln(10);
// Column headings
$pdf->SetFont('Times', 'B', 10);
$pdf->Cell(20, 5, utf8_decode('År'), 1, 0, 'C', 0);
$pdf->Cell(20, 5, 'Point', 1, 0, 'C', 0);
$pdf->Cell(20, 5, 'Krydsti', 1, 0, 'C', 0);
$pdf->Cell(20, 5, 'Type', 1, 0, 'C', 0);
$pdf->Cell(20, 5, 'Dato', 1, 1, 'C', 0);
$pdf->SetFont('Times', '', 10);
$yearArray = array();
foreach ($e as $ev) {
if (!in_array($ev[8], $yearArray)) {
array_push($yearArray, $ev[8]);
$pdf->Cell(20, 5, $ev[8], 1, 0, 'C', 0);
} else {
$pdf->Cell(20, 5, "", 1, 0, 'C', 0);
}
$pdf->Cell(20, 5, $ev[1], 1, 0, 'C', 0);
$pdf->Cell(20, 5, $ev[2], 1, 0, 'C', 0);
$pdf->Cell(20, 5, $ev[3], 1, 0, 'C', 0);
$date = new DateTime($ev[9]);
$pdf->Cell(20, 5, date_format($date, 'd-m-Y'), 1, 1, 'C', 0);
}
// ---- next page
$pdf->AddPage();
$pdf->SetFont('Times', 'B', 15);
// Move to the right
$pdf->Cell(80);
// Title
$pdf->Cell(30, 10, utf8_decode('Skytteforeningernes Våbenregistrering (SKV)'), 0, 0, 'C');
// Line break
$pdf->Ln(10);
// Column headings
$pdf->SetFont('Times', 'B', 10);
$pdf->Cell(25, 5, 'SKV nummer', 1, 0, 'C', 0);
$pdf->Cell(20, 5, 'Acceptdato', 1, 0, 'C', 0);
$pdf->Cell(20, 5, utf8_decode('Udløbsdato'), 1, 1, 'C', 0);
$pdf->SetFont('Times', '', 10);
foreach ($skv as $s) {
$date = new DateTime($s[3]);
$pdf->Cell(25, 5, $s[2], 1, 0, 'C', 0);
$pdf->Cell(20, 5, date_format($date, 'd-m-Y'), 1, 0, 'C', 0);
date_add($date, date_interval_create_from_date_string('5 years'));
$pdf->Cell(20, 5, date_format($date, 'd-m-Y'), 1, 1, 'C', 0);
}
$pdf->Output();
}