-
Notifications
You must be signed in to change notification settings - Fork 2
/
pdf_generator.php
486 lines (428 loc) · 14.9 KB
/
pdf_generator.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
<?php
include_once('libs/fpdf.php');
require 'server.php';
session_start();
$firstname=$_SESSION['name'];
$lastname=$_SESSION['lastname'];
$department=$_SESSION['department'];
$post=$_SESSION['post'];
$img_url="images/".$_SESSION['id'].".jpg";
if(!file_exists($img_url))
{
$img_url = "images/generic.jpg";
}
if(isset($_GET['description']))
{
$sql="DELETE FROM `add_details` WHERE id='".$_SESSION['id']."';";
$conn->query($sql);
$description = $_GET['description'];
$stmt = $conn->prepare("INSERT INTO add_details (id,description) VALUES (?,?)");
$stmt->bind_param("ss", $_SESSION['id'], $description);
$stmt->execute();
}
class PDF extends FPDF
{
function Footer()
{
// Position at 1.5 cm from bottom
$this->SetY(-15);
// Arial italic 8
$this->SetFont('Arial','I',8);
// Page number
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
}
$display_heading1 = array('ID', 'placeofbirth', 'marital_status','Nationality','handicapped','religion','blood','mark');
$sql1 ="SELECT * FROM `personaldetails` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf = new PDF();
//header
$pdf->AddPage();
//foter page
$pdf->AliasNbPages();
$pdf->SetFont('Arial','B',13);
$pdf->Cell(70);
$pdf->Cell(50,10,'Personal Details',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('ID', 'emergency_phone_number', 'alternate_email');
$sql1 ="SELECT * FROM `contact` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Contacts',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('ID', 'AddressLine1','AddressLine2', 'City','Pincode','District','State');
$sql1 ="SELECT * FROM `paddress` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Parmanent Address',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('ID', 'AddressLine1','AddressLine2', 'City','Pincode','District','State');
$sql1 ="SELECT * FROM `caddress` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(55);
$pdf->Cell(60,10,'Correspondance Address',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('ID', 'Exam Name','Discipline/Major', 'Institution','Board','Year Passed','Result Date','Score');
$sql1 ="SELECT * FROM `secondary` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Secondary Eduction',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('ID', 'Exam Name','Discipline/Major', 'Institution','Board','Year Passed','Result Date','Score');
$sql1 ="SELECT * FROM `hsecondary` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(50);
$pdf->Cell(70,10,'Senior Secondary Eduction',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('ID', 'Degree/Programme','Discipline/Major', 'Institution','Board','Year Passed','Result Date','Score');
$sql1 ="SELECT * FROM `bachelor` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Bachelor\'s Degree',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('ID', 'Degree/Programme','Discipline/Major', 'Institution','Board','Year Passed','Result Date','Score');
$sql1 ="SELECT * FROM `masters` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Master\'s Degree',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('ID', 'Thesis Title','Research Area', 'Institution','University','Enrollment Date','Date of Defence','Score');
$sql1 ="SELECT * FROM `phd` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Phd Programme',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('I','ID','Degree/Programme','Discipline/Major', 'Institution','University','Year Passed','Result Date','Score');
$sql1 ="SELECT * FROM `other` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Other Degree/Diploma',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('ID', 'No. of Non-SCI Journals','No. of SCI Journals', 'No. of Non-SCI Journals after PhD','No. of Conference Paper','No.of Book Chapters','No.of Books','No. of Invited Talks');
$sql1 ="SELECT * FROM `psummary` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Publication Summary',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(80,12,$display_head,1,0);
$pdf->MultiCell(100,12,$column,1,1);
}
}
$display_heading1 = array('ID', 'Experience after Phd','Experience after M.Tech', 'Experience after PhD in University','No. of ongoing Sponsored Products','No. of completed Sponsored Products','No. of Experiments', 'No. of Academic Outreach Activity');
$sql1 ="SELECT * FROM `expsummary` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Experience Summary',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(80,12,$display_head,1,0);
$pdf->MultiCell(100,12,$column,1,1);
}
}
$display_heading1 = array('I','ID', 'Employer','Address', 'Designation','Employment Type','In Government Sector','In IIIT Nagpur','Joining Date','Leaving Date','Nature of Work','Last Salary Drawn','Basic Pay','GP','Level');
$sql1 ="SELECT * FROM `workexperience` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Work Experience',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
$pdf->Ln(0);
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('I','ID', 'Title','Funding Agency', 'Role','Other Investigators','Currency','Cost','Start Date','Completion Date','Outcome of the Project');
$sql1 ="SELECT * FROM `sponsored` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Sponsored Projects',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
$pdf->Ln(0);
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('I','ID', 'Award Title','Issuing Agency', 'Date');
$sql1 ="SELECT * FROM `awards` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Awards',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
$pdf->Ln(0);
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('I','ID', 'Scolarship Name','Issuing Agency', 'Date');
$sql1 ="SELECT * FROM `scholarships` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Scolarships',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
$pdf->Ln(0);
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('I','ID','Recognition Title','Issuing Agency', 'Date');
$sql1 ="SELECT * FROM `Recognition` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Recognition',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
$pdf->Ln(0);
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('I','ID', 'Invention','Short Discription', 'Inventors','Country','Patent Number','Patent Issuing Date','Application Number','Application Date','Status');
$sql1 ="SELECT * FROM `patents` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Patents',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
$pdf->Ln(0);
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('I','ID', 'Name','Membership Category', 'Membership Start Date','Membership End Date');
$sql1 ="SELECT * FROM `members` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(50);
$pdf->Cell(70,10,'Member of Professional Bodies',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
$pdf->Ln(0);
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('ID', 'Bachelor students Supervised','Masters students Supervised', 'PhD students Supervised-Total','PhD students Supervised-Sole','PhD students Supervised-Principal','PhD students Supervised-Continuing');
$sql1 ="SELECT * FROM `supervised` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Students Supervised',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
$pdf->Ln(0);
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(80,12,$display_head,1,0);
$pdf->MultiCell(100,12,$column,1,1);
}
}
$display_heading1 = array('I','ID', 'Title','Short Discription', 'URL');
$sql1 ="SELECT * FROM `elearning` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Elearning Material',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
$pdf->Ln(0);
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('I','ID', 'Name','Phone Number', 'Email-ID','Address');
$sql1 ="SELECT * FROM `references` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Reference',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
$pdf->Ln(0);
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('I','ID', 'Name of Course','Short Description', 'Start Date','End Date');
$sql1 ="SELECT * FROM `stcourses` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Short Term Courses',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
$pdf->Ln(0);
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('I','ID', 'Name of Course','Short Description', 'Start Date','End Date');
$sql1 ="SELECT * FROM `outreach` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Outreach Activity',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
$pdf->Ln(0);
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$display_heading1 = array('ID', 'Description');
$sql1 ="SELECT * FROM `add_details` WHERE id='".$_SESSION['id']."';";
$result1 = $conn->query($sql1);
$pdf->Ln(20);
$pdf->SetFont('Arial','B',13);
$pdf->Cell(60);
$pdf->Cell(50,10,'Addirional Details',1,0,'C');
$pdf->SetFont('Arial','B',12);
$pdf->Ln(20);
foreach($result1 as $row) {
$pdf->Ln(0);
foreach(array_combine($display_heading1,$row) as $display_head=>$column){
$pdf->Cell(60,12,$display_head,1,0);
$pdf->MultiCell(120,12,$column,1,1);
}
}
$pdf->Output();
?>