This repository has been archived by the owner on Mar 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pdf.php
111 lines (76 loc) · 2.5 KB
/
pdf.php
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
<?php
require_once('fpdf/fpdf.php');
require_once('fpdi/fpdi.php');
include 'connect.php';
//
$member_id = $_GET['id'];
$member_id_tickets = mysql_query("select * from tickets_entry where id = $member_id");
//
$row1 = mysql_fetch_array($member_id_tickets);
$Engineer_ID = $row1['Engineer_ID'];
//echo $Engineer_ID;
$eng_badge = mysql_query("select Badge from users where Real_Name = '". $row1['Engineer_Name'] ."'");
$row2 = mysql_fetch_array($eng_badge);
$Engineer_IDLIST = $row2['Badge'];
//echo $Engineer_IDLIST;
//
$Report_No = $row1['Report_No'];
$Ticket_Create_Date = $row1['Ticket_Create_Date'];
$Ticket_Create_Time = $row1['Ticket_Create_Time'];
//$Ticket_title = $row1['Ticket_title'];
$Location_Building = $row1['Location_Building'];
$Location_Room_No = $row1['Location_Room_No'];
$Location_Floor = $row1['Location_Floor'];
$Service_Description = $row1['Service_Description'];
$Engineer_Name = $row1['Engineer_Name'];
//$Ticket_Category = $row1['Ticket_Category'];
// initiate FPDI
$pdf = new FPDI();
// add a page
$pdf->AddPage();
// set the sourcefile
$pdf->setSourceFile('temp.pdf');
// import page 1
$tplIdx = $pdf->importPage(1);
// use the imported page and place it at point 10,10 with a width of 200 mm (This is the image of the included pdf)
$pdf->useTemplate($tplIdx, 5, 5, 200);
// now write some text above the imported page
$pdf->SetTextColor(0,0,0);
//
$pdf->SetFont('Arial','',10);
$pdf->SetXY(114, 90);
$pdf->Write(0, $Ticket_title);
$pdf->SetFont('Arial','',10);
$pdf->SetXY(44, 67.5);
$pdf->Write(0, $Report_No);
$pdf->SetFont('Arial','',10);
$pdf->SetXY(88, 67.5);
$pdf->Write(0, $Ticket_Create_Date);
$pdf->SetFont('Arial','',10);
$pdf->SetXY(140, 67.5);
$pdf->Write(0, $Ticket_Create_Time);
//
$pdf->SetFont('Arial','',10);
$pdf->SetXY(42, 79);
$pdf->Write(0, $Location_Building);
$pdf->SetFont('Arial','',10);
$pdf->SetXY(94, 79);
$pdf->Write(0, $Location_Room_No);
$pdf->SetFont('Arial','',10);
$pdf->SetXY(140, 79);
$pdf->Write(0, $Location_Floor);
//
$pdf->SetFont('Arial','',10);
$pdf->SetXY(30,86.5);
$pdf->MultiCell(152, 5, $Service_Description, 0, 'L');
$pdf->SetFont('Arial','',10);
$pdf->SetXY(53, 125.5);
$pdf->Write(0, $Engineer_Name);
$pdf->SetFont('Arial','',10);
$pdf->SetXY(135, 125.5);
$pdf->Write(0, $Engineer_IDLIST);
$pdf->SetFont('Arial','',10);
$pdf->SetXY(66, 125.5);
$pdf->Write(0, $Ticket_Category);
$pdf->Output('1.pdf', 'I');
?>