-
Notifications
You must be signed in to change notification settings - Fork 35
/
index.php
executable file
·294 lines (268 loc) · 7.07 KB
/
index.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
<?php session_start(); ?>
<?php
require_once('library/odf.php');
$sel = $_GET["cert"]; //Represents Selection
$odf = new odf("odt/design/$sel.odt");
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
// storing data from html form to php variables
$insName = $_POST["in"];
$aidedStatus = $_POST["as"];
$insTagline = $_POST["it"];
$affilliation = $_POST["a"];
$event = $_POST["e"];
$topic = $_POST["t"];
$sign1 = $_POST["s1"];
$sign2 = $_POST["s2"];
$sign3 = $_POST["s3"];
$des1 = $_POST["d1"];
$des2 = $_POST["d2"];
$des3 = $_POST["d3"];
//Setting the tags in odt file to be replaced by user filled data
$odf -> setvars('College',$insName);
$odf -> setvars('status',$aidedStatus);
$odf -> setvars('tagline',$insTagline);
$odf -> setvars('other',$affilliation);
$odf -> setvars('event',$event);
$odf -> setvars('topic',$topic);
$odf -> setvars('sign1',$sign1);
$odf -> setvars('sign2',$sign2);
$odf -> setvars('sign3',$sign3);
$odf -> setvars('d1',$des1);
$odf -> setvars('d2',$des2);
$odf -> setvars('d3',$des3);
$base = uniqid("base");
$_SESSION["base"] = $base;
$odf -> saveToDisk("odt/base/$base.odt"); //saving to Directory to be used in further steps
echo '
<html>
<head>
<link href="style/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="style/style.css" rel="stylesheet" media="screen">
</head>
<body>
<center>
<h2>Institute Details Saved Succesfully!</h2>
<h3>Please Select Next Option</h3>
<form action = "option.php?var=manual" method = "GET">
<input type=hidden name=var value=manual>
<input class = "btn btn-primary" type="submit" value = "Fill Candidate Details Manually">
</form>
<form action="option.php?var=csv" method ="GET">
<input type=hidden name=var value=csv>
<input class = "btn btn-primary" type="submit" value="Upload CSV file">
</form>
</center>
<p><h4>Note:</h4>
<li><strong>Manual:</strong> Generates Certificate for One Candidate by manually filling Candidate Details.</li>
<li><strong>UPload CSV:</strong> This feature allow you to generate Batch certificates by simply taking csv file (for Candidate Details) & a compressed file containing images.
</body>';
exit;
}
?>
<html>
<head>
<title>Academic Certificate</title>
<link href="style/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="style/style.css" rel="stylesheet" media="screen">
<script>
function validateForm()
{
var check1=document.forms["new"]["in"].value;
if (check1==null || check1=="")
{
alert("Institute Name must be filled out");
return false;
}
if (!check1.match(/^[A-Za-z]/))
{
alert("Invalid Characters Entered in Institute Name");
return false;
}
var check2=document.forms["new"]["as"].value;
if (check2==null || check2=="")
{
alert("Aided Status must be filled out");
return false;
}
if (!check2.match(/^[A-Za-z]/))
{
alert("Invalid Characters Entered in Aided Status");
return false;
}
var check3 =document.forms["new"]["it"].value;
if (check3==null || check3=="")
{
alert("Institute Tagline must be filled out");
return false;
}
if (!check3.match(/^[A-Za-z0-9]/))
{
alert("Invalid Characters Entered in Institute Tagline");
return false;
}
var check4=document.forms["new"]["a"].value;
if (check4==null || check4=="")
{
alert("Affiliation must be filled out");
return false;
}
if (!check4.match(/^[A-Za-z0-9]/))
{
alert("Invalid Characters Entered in Affiliation");
return false;
}
var check5=document.forms["new"]["e"].value;
if (check5==null || check5=="")
{
alert("Event must be filled out");
return false;
}
if (!check5.match(/^[A-Za-z0-9]/))
{
alert("Invalid Characters Entered in Event");
return false;
}var check6=document.forms["new"]["t"].value;
if (check6==null || check6=="")
{
alert("Topic must be filled out");
return false;
}
if (!check6.match(/^[A-Za-z0-9]/))
{
alert("Invalid Characters Entered in Topic");
return false;
}
var check7=document.forms["new"]["s1"].value;
if (check7==null || check7=="")
{
alert("Signature(Left) must be filled out");
return false;
}
if (!check7.match(/^[A-Za-z]/))
{
alert("Invalid Characters Entered in Signature(Left)");
return false;
}
var check8=document.forms["new"]["d1"].value;
if (check8==null || check8=="")
{
alert("Designation must be filled out");
return false;
}
if (!check8.match(/^[A-Za-z]/))
{
alert("Invalid Characters Entered in Designation");
return false;
}
var check9=document.forms["new"]["s2"].value;
if (check9==null || check9=="")
{
alert("Signature(Middle) must be filled out");
return false;
}
if (!check9.match(/^[A-Za-z]/))
{
alert("Invalid Characters Entered in Signature(Middle)");
return false;
}
var check10=document.forms["new"]["d2"].value;
if (check10==null || check10=="")
{
alert("Designation must be filled out");
return false;
}
if (!check10.match(/^[A-Za-z]/))
{
alert("Invalid Characters Entered in Designation");
return false;
}
var check11=document.forms["new"]["s3"].value;
if (check11==null || check11=="")
{
alert("Signature(Right) must be filled out");
return false;
}
if (!check11.match(/^[A-Za-z]/))
{
alert("Invalid Characters Entered in Signature(Right)");
return false;
}
var check12=document.forms["new"]["d3"].value;
if (check12==null || check12=="")
{
alert("Designation must be filled out");
return false;
}
if (!check12.match(/^[A-Za-z]/))
{
alert("Invalid Characters Entered in Designation");
return false;
}
}
</script>
</head>
<body>
<center>
<header><h1 style="font-family:verdana;">Institute Details</h1></header>
<p class="bottom-one">
<center>
<p class="bottom-one">
<table>
<form name=new id=myform method=POST onSubmit ="return validateForm();">
<tr>
<td>Institution Name:</td>
<td><input type=text name=in title="For e.g. Guru Nanak Dev Engineering College"></td>
</tr>
<tr>
<td>Aided Status:</td>
<td><input type=text name=as title="For e.g. Punjab Govt. Aided Status"></td>
</tr>
<tr>
<td>Institute Tagline:</td>
<td><input type=text name=it title="For e.g. An Autonomous College u/s 2(f) and 12(B) of UGC Act 1956"></td>
</tr>
<tr>
<td>Affiliation:</td>
<td><input type=text name=a title="For e.g. AICTE Approved, NBA Accreditted, Affiliated to PTU, Jalandhar"></td>
</tr>
<tr>
<td>Event:</td>
<td><input type=text name=e title="For e.g. Six Week Training"></td>
</tr>
<tr>
<td>Topic:</td>
<td><input type=text name=t title="For e.g. Computing Technology"></td>
</tr>
<tr>
<td>Signature(Left):</td>
<td><input type=text name=s1 title="For e.g. Dr M S Saini"></td>
</tr>
<tr>
<td>Designation:</td>
<td><input type=text name=d1 title="For e.g. Director"></td>
</tr>
<tr>
<td>Signature(Middle):</td>
<td><input type=text name=s2 ></td>
</tr>
<tr>
<td>Designtion:</td>
<td><input type=text name=d2 ></td>
</tr>
<tr>
<td>Signature(Right):</td>
<td><input type=text name=s3 ></td>
</tr>
<tr>
<td>Desigantion:</td>
<td><input type=text name=d3 ></td>
</tr>
</table>
<input class="btn btn-primary" type=submit name=Submit value=Submit>
</center>
</p>
</form>
</br>
</body>
</html>