-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.html
296 lines (275 loc) · 13.4 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>certificate generator</title>
<link rel="stylesheet" media="all" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" />
<link rel="stylesheet" media="all" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css" />
<link rel="stylesheet" media="all" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css" />
<link rel="stylesheet" href="./js/pickadate.js/themes/default.css">
<link rel="stylesheet" href="./js/pickadate.js/themes/default.date.css">
<link rel="stylesheet" href="css/main.css">
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/prashantchaudhary/ddslick/master/jquery.ddslick.min.js">
</script>
<script type="text/javascript" src="./js/pickadate.js/picker.js"></script>
<script type="text/javascript" src="./js/pickadate.js/picker.date.js"></script>
<script type="text/javascript">
window.onload = function() {
// Date picker
$('#date').pickadate({
max: new Date()
});
}
// Dropdown plugin data
var ddData = [{
text: "Template 1",
value: "template_1.jpg",
selected: true,
description: "Template description",
imageSrc: "template/template_1.jpg"
}, {
text: "Template 2",
value: "template_2.jpg",
selected: false,
description: "Template description",
imageSrc: "template/template_2.jpg"
}, {
text: "Template 3",
value: "template_3.jpg",
selected: false,
description: "Description with LinkedIn",
imageSrc: "template/template_3.jpg"
}, {
text: "Template 4",
value: "template_4.jpg",
selected: false,
description: "Description with Foursquare",
imageSrc: "template/template_4.jpg"
}, {
text: "Template 5",
value: "template_5.jpg",
selected: false,
description: "Template description",
imageSrc: "template/template_5.jpg"
}];
</script>
</head>
<body>
<div class="header">
<!--Content before waves-->
<div class="inner-header flex">
<h1>Certificate Generator</h1>
</div>
<!--Waves Container-->
<div>
<svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto">
<defs>
<path id="gentle-wave"
d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z" />
</defs>
<g class="parallax">
<use xlink:href="#gentle-wave" x="48" y="0" fill="rgba(255,255,255,0.7" />
<use xlink:href="#gentle-wave" x="48" y="3" fill="rgba(255,255,255,0.5)" />
<use xlink:href="#gentle-wave" x="48" y="5" fill="rgba(255,255,255,0.3)" />
<use xlink:href="#gentle-wave" x="48" y="7" fill="#fff" />
</g>
</svg>
</div>
<!--Waves end-->
</div>
<!--Header ends-->
<div class="container">
<div style="text-align:center">
<h2>Certificate generator</h2>
<p>Create certificate anytime</p>
</div>
<div class="row">
<div class="column">
<form action="./apis/index.php" method="POST" enctype="multipart/form-data">
<label for="fname">Person Name</label>
<input type="text" id="fname" name="name" placeholder="Name of person">
<label for="event">Event Name</label>
<input type="text" id="event" name="event" placeholder="Name of Event">
<label for="date">Date of issue of certificate:</label><br>
<input type="date" id="date" name="date" placeholder="Issue Date"><br><br>
<label for="signature">Upload Signature:</label><br>
<input type="file" name="Signature" id="Signature" placeholder="Upload Signature">
<br><br>
<label>Select Template</label>
<div id="myDropdown">
</div>
<br><br>
<button type="submit" class="btn btn-success" id="generate-btn" name="submit">Generate
Certificate</button>
<button id="view-btn" class="btn btn-success">click here to view certificate</button>
</form>
</div>
<div class="column">
<img src="template/template_1.jpg" alt="image " id="template-img" style="width:100%">
</div>
</div>
</div>
<!-- footer begins -->
<footer class="new_footer_area bg_color">
<div class="new_footer_top">
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-6">
<div class="f_widget company_widget wow fadeInLeft" data-wow-delay="0.2s" style="visibility: visible; animation-delay: 0.2s; animation-name: fadeInLeft;">
<h3 class="f-title f_600 t_color f_size_18">Get in Touch</h3>
<p>Don’t miss any updates of our new templates and extensions.!</p>
<form action="#" class="f_subscribe_two mailchimp" method="post" novalidate="true" _lpchecked="1">
<input type="text" name="EMAIL" class="form-control memail" placeholder="Email">
<button class="btn btn_get btn_get_two" type="submit">Subscribe</button>
<p class="mchimp-errmessage" style="display: none;"></p>
<p class="mchimp-sucmessage" style="display: none;"></p>
</form>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="f_widget about-widget pl_70 wow fadeInLeft" data-wow-delay="0.4s" style="visibility: visible; animation-delay: 0.4s; animation-name: fadeInLeft;">
<h3 class="f-title f_600 t_color f_size_18">Download</h3>
<ul class="list-unstyled f_list">
<li><a href="#">Company</a></li>
<li><a href="#">Android App</a></li>
<li><a href="#">ios App</a></li>
<li><a href="#">Desktop</a></li>
<li><a href="#">Projects</a></li>
<li><a href="#">My tasks</a></li>
</ul>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="f_widget about-widget pl_70 wow fadeInLeft" data-wow-delay="0.6s" style="visibility: visible; animation-delay: 0.6s; animation-name: fadeInLeft;">
<h3 class="f-title f_600 t_color f_size_18">Help</h3>
<ul class="list-unstyled f_list">
<li><a href="#">FAQ</a></li>
<li><a href="#">Term & conditions</a></li>
<li><a href="#">Reporting</a></li>
<li><a href="#">Documentation</a></li>
<li><a href="#">Support Policy</a></li>
<li><a href="#">Privacy</a></li>
</ul>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="f_widget social-widget pl_70 wow fadeInLeft" data-wow-delay="0.8s" style="visibility: visible; animation-delay: 0.8s; animation-name: fadeInLeft;">
<h3 class="f-title f_600 t_color f_size_18">Team Solutions</h3>
<div class="f_social_icon">
<a href="#" class="fab fa-facebook"></a>
<a href="#" class="fab fa-twitter"></a>
<a href="#" class="fab fa-linkedin"></a>
<a href="#" class="fab fa-pinterest"></a>
</div>
</div>
</div>
</div>
</div>
<div class="footer_bg">
<div class="footer_bg_one"></div>
<div class="footer_bg_two"></div>
</div>
</div>
<div class="footer_bottom">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-6 col-sm-7">
<p class="mb-0 f_400">
<a class="fa fa-copyright"></a> Project-celadon. 2020 All rights reserved.
</p>
</div>
<div class="col-lg-6 col-sm-5 text-right">
<div>Made with
<a class="fa fa-heart" style="color:#e60606"></a> in <strong>India</strong></div>
</div>
</div>
</div>
</div>
</footer>
<!-- footer end -->
</body>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script>
//template preview
var template, fname, event, date, sign;
$('#myDropdown').ddslick({
data: ddData,
width: 400,
selectText: "Select your template",
imagePosition: "right",
onSelected: function(data) {
//callback function: do something with selectedData;
// console.log(data.selectedData);
template = data.selectedData.value;
$('#template-img').attr('src', "template/" + template);
}
});
// console.log(template);
$('#view-btn').hide();
//checks whether form is filled and then uploads
$("#generate-btn").click(function(e) {
e.preventDefault();
var fname = document.getElementById('fname').value;
var event = document.getElementById('event').value;
var date = document.getElementById('date').value;
console.log(template + " " + event + " " + name + " " + date);
var fd = new FormData();
var files = $('#Signature')[0].files[0];
fd.append('file', files);
console.log(fd);
$.ajax({
url: 'apis/signature_upload.php',
data: fd,
type: "POST",
contentType: false,
processData: false,
success: function(response) {
console.log((response));
var res = JSON.parse(response);
if (res.status == "success") {
swal('signature uploaded', '', 'success').then((
value) => {
sign = res.result;
$.ajax({
url: 'apis/index.php',
data: {
event: event,
name: fname,
date: date,
template: template,
sign: sign
},
type: 'POST',
success: function(response) {
console.log((response));
var res = JSON.parse(response);
if (res.status == "success") {
var location = res.message;
swal('Certificate generated', '', 'success')
.then((
value) => {
window.location =
"./certificates/" +
location +
".jpg";
});
} else {
swal(res.message, '', 'error');
}
}
});
});
} else {
swal(res.result, '', 'error');
}
}
});
});
</script>
</html>