-
Notifications
You must be signed in to change notification settings - Fork 6
/
MFHS-Student-Data.php
125 lines (108 loc) · 3.65 KB
/
MFHS-Student-Data.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
<?php
/**
* Template Name: Template 2 PDF
* Version: 1.1.3
* Description: Developed By WebIT.pk
* Author: Fahad Yosuaf Mahar
* Author URI: https://webIT.pk
* License: GPLv2
* Required PDF Version: 4.0
* Tags: WebIT.pk
*/
/* Prevent direct access to the template (always good to include this) */
if ( ! class_exists( 'GFForms' ) ) {
return;
}
?>
<!-- Any PDF CSS styles can be placed in the style tag below -->
<style>
h1 {
text-align: center;
text-transform: uppercase;
color: #a62828;
border-bottom: 1px solid #999;
border-top: 1px solid #999;
}
footer{
text-align: center;
text-transform: uppercase;
color: #a62828;
border-top: 1px double #999;
}
.sep{
border-right: 1px solid grey;
border-left: 1px solid grey;
}
.center{
text-align: right;
float: right;
}
table {
width: 100%;
}
th {
height: 5px;
}
.powered{
text-align: right;
vertical-align: bottom;
font-size: 9px;
color: grey;
}
</style>
<!-- The PDF content should be placed in here -->
<watermarkimage src="<?php echo PDF_TEMPLATE_LOCATION; ?>images/background.jpg" alpha="0.2" />
<?php
$dob=$form_data['field']['Date of Birth'];
$dateArr=explode("/",$dob);
//Converting DD/MM/YYYY to MM/DD/YYYY
$d=$dateArr[0];
$m=$dateArr[1];
$dateArr[0]=$m;
$dateArr[1]=$d;
// Getting Time Stamps
$dobt=implode('/', $dateArr);
$dobt = preg_replace('/\s+/', '', $dobt);
$dobTs=strtotime($dobt);
$today=strtotime('Today');
$days=floor(($today-$dobTs)/86400);
$years=floor($days/365);
?>
<table>
<tr><td class="center">
<img height="150px" src="<?php echo PDF_TEMPLATE_LOCATION; ?>images/logo.jpg">
</td><td><center><h2>Your Organization</h2></center>
</td></tr></table>
<h1>MFHS {Registration Type:2} DATASHEET</h1>
<h3>REGISTRATION #: MFHS-<?php echo date('mdY',strtotime($form_data['date_created_usa'])); ?>{entry_id}</h3>
<table>
<tr><td>
<p>Name</p>
<p>Father Name:</p>
<p>CNIC #:</p>
<p>Date of Birth:</p>
<p>Age:</p>
<p>Blood Group:</p>
<p>Email:</p>
<p>Phone NO:</p>
</td>
<td>
<p><?php echo $form_data['field']['Name']['first']." ".$form_data['field']['Name']['last']; ?></p>
<p><?php echo $form_data['field']['Father Name']['first']." ".$form_data['field']['Father Name']['last']; ?></p>
<p><?php echo $form_data['field']['CNIC']; ?></p>
<p><?php echo $form_data['field']['Date of Birth']; ?></p>
<p><?php echo $years." Years"; ?></p>
<p><?php echo $form_data['field']['Blood Group']; ?></p>
<p><?php echo $form_data['field']['Email']; ?></p>
<p><?php echo $form_data['field']['Phone Number']; ?></p>
</td><td class="center"><img width="150px" src="<?php echo $form_data['field']['Picture']['url']; ?>">
</td></tr></table>
<h3>Address: <?php foreach($form_data['field']['Address'] as $address){if ($address != ''){ echo $address.", ";}}?></h3>
<p>Degree: <?php echo $form_data['field']['Degree']." ".$form_data['field']['Degree Name']; ?></p>
<p>Institution: <?php echo $form_data['field']['Institution']; ?></p>
<p>Session: <?php echo $form_data['field']['Session']; ?></p>
<p><strong>What is your Aim in Life ?</strong><br><?php echo $form_data['field']['What is your Aim in Life ?']; ?></p>
<p><strong>Why you want to be a part of Organization ?</strong><br><?php echo $form_data['field']['Why you want to be a part of MFHS ?']; ?></p>
<footer>
<h3>Copyright © <?php echo date('Y'); ?> - Your Organization </h3>
<p><a href="#">Your Organization</a></p></footer><p class="powered">Thanks to Fahad Yousaf</p>