-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprint.php
More file actions
53 lines (37 loc) · 1022 Bytes
/
print.php
File metadata and controls
53 lines (37 loc) · 1022 Bytes
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
<?php
require('tcpdf/tcpdf.php');
include('connection.php');
$val = $_GET['val'];
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'PDF_FORMAT', true, 'UTF-8',false);
$pdf->SetAutoPageBreak(true,15);
$pdf->AddPage();
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$htmlheader = "OME | Occasion Made easy ™<br>";
$pdf->WriteHTML($htmlheader);
$result = mysqli_query($conn,"SELECT * from tasking WHERE N = '$val'");
$pdf->SetFont('','B',10);
$htmlContent = '<br/>
<h2>'.$val.' </h2>
<table class="table" border="1">
<tr>
<th>Program</th>
<th>Details</th>
<th>Assignment</th>
<th>Coordinator in-charge</th></tr><br>
<hr>';
while($row = mysqli_fetch_array($result)) {
$temp1 = $row["FIRST"];
$temp2 = $row["SECOND"];
$temp3 = $row["THIRD"];
$temp4 = $row["FOURTH"];
$htmlContent .='
<tr>
<td>'.$temp1.' </td>
<td>'.$temp2.' </td>
<td>'.$temp3.' </td>
<td>'.$temp4.' </td></tr>
<hr/>' ;
};
$pdf->WriteHTML($htmlContent);
$pdf->Output();
?>