-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstudent-enroll.html
400 lines (352 loc) · 20.7 KB
/
student-enroll.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
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
<!--
This is the student enroll page. This page will allow the student to enroll into SOAP. The student will be able to select the course they want to enroll in and then click the enroll button. The student will then be enrolled in the course and will be able to view the course in their dashboard. The system generates a Registration number in the format of SOAP-ST-0001; where 0001 is the registration number. The student will be able to view the registration number in their dashboard. The student will also receive an email with the registration number and the course details. These will be submitted to the google sheets. The Registration number will be generated by the system and will be unique for each student. The student will not be able to enroll in the same course twice.
This form will use google sheets as backend (You know what I mean).
The form will have the following fields:
- course(dropdown) [NOT REQUIRED]
- Student first name
- Student last name
- Student email
- student phone number
- student gender
- student address(county, Hometown)
- Course name (dropdown)
- Enroll button
The form will have the following validation:
- All fields are required except course
- Student email must be a valid email
- Student phone number must be a valid phone number -->
<!-- The School of Advanced Programming (SOAP) is a platform that provides a wide range of courses for students to learn and enhance their skills. The platform offers military grade courses in various ICT fields such as Web Development, Software Engineering Software Applications and Graphics Design. SOAP aims to provide high-quality education to students and help them achieve their career goals.
It also povides training services to colleges on select ICT courses and also provides consultancy services to colleges on ICT related issues.
It also provides a platform for lecturers to request for assignment and thei students to access and submit them. -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SOAP - Course</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="School of Advanced Programming (SOAP) is a platform that provides a wide range of courses for students to learn and enhance their skills." name="description">
<meta content="School of Advanced Programming, SOAP, School of Advanced Programming (SOAP), SOAP Kenya, Programming , SOAP Online, SOAP Courses, Computer Science, SOAP Colleges, SOAP Instructors, SOAP Team, SOAP Testimonials, Quickbooks instructor, SOAP 404, Web Development, Graphics Design" name="keywords">
<!-- Favicon -->
<link href="img/favicon.png" rel="icon">
<!-- Google Web Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600&family=Nunito:wght@600;700;800&display=swap" rel="stylesheet">
<!-- Icon Font Stylesheet -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" rel="stylesheet">
<!-- Libraries Stylesheet -->
<link href="lib/animate/animate.min.css" rel="stylesheet">
<link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<!-- Customized Bootstrap Stylesheet -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Template Stylesheet -->
<link href="css/style.css" rel="stylesheet">
<script src="data.js" defer></script>
<script src="student-enroll.js" defer></script>
<!-- emailJS -->
</head>
<body>
<!-- Spinner Start -->
<div id="spinner" class="show bg-white position-fixed translate-middle w-100 vh-100 top-50 start-50 d-flex align-items-center justify-content-center">
<div class="spinner-border text-primary" style="width: 3rem; height: 3rem;" role="status">
<span class="sr-only">S.0.A.P</span>
</div>
</div>
<!-- Spinner End -->
<!-- Navbar Start -->
<nav class="navbar navbar-expand-lg bg-white navbar-light shadow sticky-top p-0">
<a href="index.html" class="navbar-brand d-flex align-items-center px-4 px-lg-5">
<h2 class="m-0 text-primary">
<!-- code icon -->
<i class="bi bi-code-slash"></i>
SOAP</h2>
</a>
<button type="button" class="navbar-toggler me-4" data-bs-toggle="collapse" data-bs-target="#navbarCollapse">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<div class="navbar-nav ms-auto p-4 p-lg-0">
<a href="index.html" class="nav-item nav-link">Home</a>
<a href="courses.html" class="nav-item nav-link active">Courses</a>
<a href="students.html" class="nav-item nav-link">Students</a>
<a href="courses.html" class="nav-item nav-link">Colleges</a>
<div class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">About</a>
<div class="dropdown-menu fade-down m-0">
<a href="team.html" class="dropdown-item">Our Team</a>
<a href="testimonial.html" class="dropdown-item">Testimonial</a>
<a href="contact.html" class="dropdown-item">Contact</a>
</div>
</div>
</div>
<a href="student-enroll.html" class="btn btn-primary py-4 px-lg-5 d-none d-lg-block">Join Now<i class="fa fa-arrow-right ms-3"></i></a>
</div>
</nav>
<!-- Navbar End -->
<!-- Page Header Start -->
<div class="page-header bg-light py-5">
<div class="container">
<div class="row">
<div class="col-lg-6" style="display: flex; flex-direction: column; justify-content: center;">
<h1 class="text-light">Enroll to School of Advanced Programming</h1>
<p class="text-light
">Enroll and start learning today.</p>
</div>
<div class="col-lg-6">
<img src="img/course-1.jpg" alt="" class="img-fluid">
</div>
</div>
</div>
</div>
<!-- Page Header End -->
<!-- Ask the student if they already have a registration number. Select yes or no -->
<div class="container py-5">
<div class="row">
<div class="col-lg-8">
<h4 class="mb-4">Do you have a registration number?</h4>
<select name="has-registration-number" id="has-registration-number" class="form-select" required>
<option value="" disabled selected>Select an option</option>
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
</div>
</div>
</div>
<!-- Enroll Start -->
<div class="container py-5">
<div class="row">
<div class="col-lg-8">
<h4 class="mb-4">Enroll in a Course</h4>
<form id="enroll-form" class="row g-3">
<div class="col-md-6">
<label for="first-name" class="form-label">First Name</label>
<input type="text" class="form-control" id="first-name" name="first-name" placeholder="Enter your first name" required>
<div class="invalid-feedback"></div>
</div>
<div class="col-md-6">
<label for="last-name" class="form-label">Last Name</label>
<input type="text" class="form-control" id="last-name" name="last-name" placeholder="Enter your last name" required>
<div class="invalid-feedback"></div>
</div>
<div class="col-md-6">
<label for="email" class="form-label">Email</label>
<input type="email" class="form-control" id="email" name="email" placeholder="Enter your email" required>
<div class="invalid-feedback"></div>
</div>
<div class="col-md-6">
<label for="phone" class="form-label">Phone Number</label>
<input type="tel" class="form-control" id="phone" name="phone" placeholder="Enter your phone number" required>
<div class="invalid-feedback"></div>
</div>
<div class="col-md-6">
<label for="gender" class="form-label">Gender</label>
<select class="form-control" id="gender" name="gender" required>
<option value="" disabled selected>Select your gender</option>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select>
<div class="invalid-feedback"></div>
</div>
<div class="col-md-6">
<label for="address" class="form-label">Address</label>
<input type="text" class="form-control" id="address" name="address" placeholder="Enter your address (County, Hometown)" required>
<div class="invalid-feedback"></div>
</div>
<div class="col-md-6">
<label for="course" class="form-label">Preferred course</label>
<select class="form-control" id="course" name="course" required>
<option value="" disabled selected>Select a course</option>
</select>
<div class="invalid-feedback"></div>
</div>
<div class="col-md-6"></div>
<div class="col-md-6 d-none" id="registration-number-div">
<label for="registration-number" class="form-label">Registration Number</label>
<input type="text" class="form-control" id="registration-number" name="registration-number" placeholder="Enter your registration number">
<div class="invalid-feedback"></div>
</div>
<div class="col-12">
<div class="alert alert-success d-none" role="alert"></div>
<div class="alert alert-danger d-none" role="alert"></div>
</div>
<div class="col-12">
<button type="submit" class="btn btn-primary">Enroll</button>
</div>
</form>
</div>
<div class="col-lg-4">
<div class="p-5 bg-light rounded">
<h4 class="mb-4">When Enrolling, please note:</h4>
<ul class="list-unstyled mb-0">
<li class="mb-2"><i class="fa fa-check text-primary me-2"></i>You will fill the form, and get contacted later with your details</li>
<li class="mb-2"><i class="fa fa-check text-primary me-2"></i>SOAP will contact you from <b>[email protected]</b> only</li>
<li class="mb-2"><i class="fa fa-check text-primary me-2"></i>Select the course category, it's optional</li>
<li class="mb-2"><i class="fa fa-check text-primary me-2"></i>As of today, all courses are online</li>
<li class="mb-2"><i class="fa fa-check text-primary me-2"></i>For colleges visit <a href="college-request.html">Colleges portal</a> </li>
</ul>
</div>
</div>
</div>
</div>
<!-- Enroll End -->
<script>
document.getElementById('has-registration-number').onchange = function() {
const registrationNumberDiv = document.getElementById('registration-number-div');
if (this.value === 'yes') {
registrationNumberDiv.classList.remove('d-none');
} else {
registrationNumberDiv.classList.add('d-none');
}
};
document.getElementById('enroll-form').onsubmit = function(e) {
e.preventDefault();
const formData = new FormData(this);
const data = {};
formData.forEach((value, key) => (data[key] = value));
// Check whether the registration number is provided. If not, generate one
if (!data['registration-number']){
data['registration-number'] = 'SOAP-ST' + Math.floor(Math.random() * 10000);
}
const regNumber = data['registration-number'];
// Show spinner while form is being submitted
const spinner = document.createElement('div');
spinner.classList.add('spinner-border', 'text-primary');
spinner.setAttribute('role', 'status');
spinner.innerHTML = '<span class="visually-hidden">Loading...</span>';
document.querySelector('.col-12').appendChild(spinner);
fetch('https://script.google.com/macros/s/AKfycbzCzu0zod2zO8hCtqA4dtLBCKPLQgObBYT6gAy6VgaZmUdVunMH0fcwO5Fu6IYuvxL3tg/exec', {
method: 'POST',
mode: 'no-cors',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams(data)
}).then(response => {
document.querySelector('.alert-success').classList.remove('d-none');
document.querySelector('.alert-success').textContent = 'You have enrolled successfully! You will be contacted with details soon. Your registration number is ' + regNumber;
// Send email using EmailJS
const templateParams = {
firstName: data['first-name'],
lastName: data['last-name'],
courseName: data['course'],
registrationNumber: regNumber,
email: data['email']
};
emailjs.send('service_lgsceer', 'template_tsu8n1l', templateParams, 'IehseaNhUpJYF6_RQ')
.then(function(response) {
console.log('Email sent successfully!', response.status, response.text);
}, function(error) {
console.error('Error sending email:', error);
});
}).catch(error => {
document.querySelector('.alert-danger').classList.remove('d-none');
document.querySelector('.alert-danger').textContent = 'There was an error submitting the form.';
}).finally(() => {
// Remove spinner after form submission
spinner.remove();
});
};
</script>
<!-- Footer Start -->
<div class="container-fluid bg-dark text-light footer pt-5 mt-5 wow fadeIn" data-wow-delay="0.1s">
<div class="container py-5">
<div class="row g-5">
<div class="col-lg-3 col-md-6">
<h4 class="text-white mb-3">Quick Link</h4>
<a class="btn btn-link" href="">About Us</a>
<a class="btn btn-link" href="">Contact Us</a>
<a class="btn btn-link" href="">Privacy Policy</a>
<a class="btn btn-link" href="">Terms & Condition</a>
<a class="btn btn-link" href="">FAQs & Help</a>
</div>
<div class="col-lg-3 col-md-6">
<h4 class="text-white mb-3">Contact</h4>
<p class="mb-2"><i class="fa fa-map-marker-alt me-3"></i>Tumaini, Ongata Rongai, Kenya</p>
<p class="mb-2"><i class="fa fa-phone-alt me-3"></i>+254762303141</p>
<p class="mb-2"><i class="fa fa-envelope me-3"></i>[email protected]</p>
<div class="d-flex pt-2">
<a class="btn btn-outline-light btn-social" href=""><i class="fab fa-twitter"></i></a>
<a class="btn btn-outline-light btn-social" href=""><i class="fab fa-facebook-f"></i></a>
<a class="btn btn-outline-light btn-social" href=""><i class="fab fa-youtube"></i></a>
<a class="btn btn-outline-light btn-social" href=""><i class="fab fa-linkedin-in"></i></a>
</div>
</div>
<div class="col-lg-3 col-md-6">
<h4 class="text-white mb-3">Advanced</h4>
<div class="row g-2 pt-2">
<div class="col-4">
<img class="img-fluid bg-light p-1" src="img/course-artificial-intelligence.jpg" alt="">
</div>
<div class="col-4">
<img class="img-fluid bg-light p-1" src="img/course-databases.jpg" alt="">
</div>
<div class="col-4">
<img class="img-fluid bg-light p-1" src="img/course-backend.jpg" alt="">
</div>
<div class="col-4">
<img class="img-fluid bg-light p-1" src="img/course-cyber-security.jpg" alt="">
</div>
<div class="col-4">
<img class="img-fluid bg-light p-1" src="img/course-graphics-design.jpg" alt="">
</div>
<div class="col-4">
<img class="img-fluid bg-light p-1" src="img/course-gis.jpg" alt="">
</div>
</div>
</div>
<div class="col-lg-3 col-md-6">
<h4 class="text-white mb-3">Newsletter</h4>
<p>Get notified about offers, new courses and more.</p>
<div class="position-relative mx-auto" style="max-width: 400px;">
<input class="form-control border-0 w-100 py-3 ps-4 pe-5" type="text" placeholder="Your email">
<button type="button" class="btn btn-primary py-2 position-absolute top-0 end-0 mt-2 me-2">SignUp</button>
</div>
</div>
</div>
</div>
<div class="container">
<div class="copyright">
<div class="row">
<div class="col-md-6 text-center text-md-start mb-3 mb-md-0">
© <a class="border-bottom" href="#">School of Advanced Programming</a>, All Right Reserved.
<!--/*** This template is free as long as you keep the footer author’s credit link/attribution link/backlink. If you'd like to use the template without the footer author’s credit link/attribution link/backlink, you can purchase the Credit Removal License from "https://htmlcodex.com/credit-removal". Thank you for your support. ***/-->
More like this <a class="border-bottom" href="https://htmlcodex.com">HTML Codex</a><br><br>
</div>
<div class="col-md-6 text-center text-md-end">
<div class="footer-menu">
<a href="">Home</a>
<a href="">Cookies</a>
<a href="">Help</a>
<a href="">FQAs</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Footer End -->
<!-- Back to Top -->
<a href="#" class="btn btn-lg btn-primary btn-lg-square back-to-top"><i class="bi bi-arrow-up"></i></a>
<!-- JavaScript Libraries -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="lib/wow/wow.min.js"></script>
<script src="lib/easing/easing.min.js"></script>
<script src="lib/waypoints/waypoints.min.js"></script>
<script src="lib/owlcarousel/owl.carousel.min.js"></script>
<script type="text/javascript"
src="https://cdn.jsdelivr.net/npm/@emailjs/browser@4/dist/email.min.js">
</script>
<script type="text/javascript">
(function(){
emailjs.init({
publicKey: "YOUR_PUBLIC_KEY",
});
})();
</script>
<!-- Template Javascript -->
<script src="js/main.js"></script>
</body>
</html>