-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrating_notice.php
More file actions
124 lines (110 loc) · 4.26 KB
/
rating_notice.php
File metadata and controls
124 lines (110 loc) · 4.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
require_once 'vendor/autoload.php';
include 'db.php';
use Mpdf\Mpdf;
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$id = intval($_POST['applicant_id']);
$stmt = $conn->prepare("
SELECT a.*, h.education, h.experience, h.training, h.eligibility,
h.experience_in, h.spec_training
FROM applicants a
JOIN hiring_schedule h ON h.id = a.hiring_schedule_id
WHERE a.id = ?
");
$stmt->bind_param("i", $id);
$stmt->execute();
$row = $stmt->get_result()->fetch_assoc();
function qualifyText($v) {
return $v == 1 ? 'Qualified' : 'Not Qualified';
}
// -------------------------
// Prepare mPDF
// -------------------------
$mpdf = new Mpdf([
'format' => 'A4',
'margin_top' => 50, // leave space for header
'margin_bottom' => 50, // leave space for footer
]);
// -------------------------
// Header and Footer
// -------------------------
$mpdf->SetHTMLHeader('
<div style="text-align:center;">
<img src="images/header.png" style="width:20cm;height:3.80cm;" />
</div>
');
$mpdf->SetHTMLFooter('
<div style="text-align:center;">
<img src="images/footer.png" style="width:16cm;height:2cm;" />
</div>
');
// -------------------------
// Body content (HTML)
// -------------------------
$bodyHtml = '
<div style="font-family: "Bookman Old Style", "Bookman", Georgia, serif; font-size:12pt; line-height:1; padding:20px;">
<br>
<p>'.date('F d, Y').'</p>
<p>
<strong>'.$row['full_name'].'</strong><br>
'.$row['address'].'
</p>
<p><strong>Congratulations!</strong></p>
<p>
We are pleased to inform you that based on the initial evaluation, we have found your
qualifications to be substantial vis-à-vis the Civil Service Commission (CSC) approved
Qualification Standards (QS) for the <strong>'.$row['position_applying'].'</strong> position
under SDO San Pedro City. Below are the results of the initial evaluation conducted by the
undersigned dated '.date('F d, Y').'.
</p>
<table border="1" cellpadding="6" cellspacing="0" width="100%">
<tr style="font-weight:bold; text-align:center;">
<td>Position Applied For</td>
<td>CSC-Approved QS</td>
<td>Your Qualification</td>
<td>Remarks</td>
</tr>
<tr>
<td rowspan="4" style="text-align:center;">'.$row['position_applying'].'</td>
<td>Education <br>'.$row['education'].'</td>
<td>'.$row['ur_education'].'</td>
<td>'.qualifyText($row['education_points']).'</td>
</tr>
<tr>
<td>Experience <br>'.$row['experience'].' '.$row['experience_in'].'</td>
<td>'.$row['ur_experience'].'</td>
<td>'.qualifyText($row['experience_points']).'</td>
</tr>
<tr>
<td>Training <br>'.$row['training'].' '.$row['spec_training'].'</td>
<td>'.$row['ur_training'].'</td>
<td>'.qualifyText($row['training_points']).'</td>
</tr>
<tr>
<td>Eligibility <br>'.$row['eligibility'].'</td>
<td>'.$row['ur_eligibility'].'</td>
<td>'.qualifyText($row['eligibility_points']).'</td>
</tr>
</table>
<p>
Please be advised of your assigned application code
<strong>'.$row['application_code'].'</strong> which shall be used as you proceed with the next
stage of the selection process. You may refer to the official issuances of the SDO San Pedro
City for additional announcements in this regard.For inquiries, you may communicate with (02) 8242-2817 and personnel.sanpedro@deped.gov.ph.
</p>
<br>
<p>
<strong>LORINA B. JURADA</strong><br>
Administrative Officer IV
</p>
</div>
';
// -------------------------
// Generate PDF
// -------------------------
$mpdf->WriteHTML($bodyHtml);
header("Content-Type: application/pdf");
header("Content-Disposition: inline; filename=Rating_Notice_{$row['full_name']}.pdf");
$mpdf->Output();
exit;
}