-
Notifications
You must be signed in to change notification settings - Fork 0
/
file.html
409 lines (393 loc) · 22.7 KB
/
file.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
401
402
403
404
405
406
407
408
409
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSV File Upload</title>
<!-- Bootstrap 3 CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Bootstrap 3 JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<!-- Your custom CSS file -->
<link rel="stylesheet" href="./css/filehtml.css">
<link rel="stylesheet" href="./css/navbarstyle.css">
<style>
/* Any additional styles */
</style>
<script>
window.onload = function() {
function showMessage(param, bgColor) {
var message = getParameterByName(param);
if (message) {
var errorElement = document.getElementById('success');
errorElement.innerText = message;
errorElement.style.color = 'white';
errorElement.style.fontSize = '20px';
errorElement.style.backgroundColor = bgColor;
errorElement.style.margin = '10px';
errorElement.style.padding = '0.1em 1em 0.1em 1em';
errorElement.style.height = '20px'; // Adjust the height as needed
errorElement.style.width = '100px'; // Adjust the width as needed
errorElement.style.boxShadow = '0.1em 0.1em 0.2em 0.2em rgba(0, 0, 0, 1)'; // Adjust shadow values as needed
errorElement.style.transition = 'height 0.3s linear, opacity 0.';
setTimeout(function() {
errorElement.style.height = '0';
errorElement.style.opacity = '0';
setTimeout(function() {
errorElement.style.display = 'none';
}, 500)
}, 1500);
}
}
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
showMessage('success_message', 'green');
showMessage('errormsg', 'red');
showMessage('privio', 'red');
}
function showLoadingAnimation() {
document.getElementById('loading-spinner').style.display = 'block';
}
// Function to hide loading animation
function hideLoadingAnimation() {
document.getElementById('loading-spinner').style.display = 'none';
}
// Add an event listener for form submission
document.addEventListener('DOMContentLoaded', function () {
var forms = document.getElementsByClassName('needs-validation');
for (var i = 0; i < forms.length; i++) {
forms[i].addEventListener('submit', function (event) {
if (this.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
} else {
// Show loading animation when form is submitted
showLoadingAnimation();
}
this.classList.add('was-validated');
}, false);
}
}, false);
function showLoadingAnimation() {
$('#loadingModal').modal('show');
}
function hideLoadingAnimation() {
$('#loadingModal').modal('hide');
}
</script>
</head>
<body>
<div class="container">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Admin Panel</a>
</div>
<div class="navbar-right">
<a href="php/logout.php" class="btn btn-danger navbar-btn">Logout</a>
</div>
</div>
</nav>
<!-- <div id="loading-spinner" style="display: none;"> -->
<div id="loadingModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="row text-center">
<div class="col-lg-12">
<img src="images/animate.gif" alt="loading">
<h3>Uploading...</h3>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-3"></div>
<div class="col-lg-6 col-xs-12 text-center">
<h4 id="chagecolor"> <span id="success"> </span></h4>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-xs-12">
<div class="card">
<div class="card-body">
<div class="row text-center">
<img src="images/upload.png" style="width:47.50%; height:100%;" alt="">
</div>
<div class="row">
<h2 class="card-title ">Upload CSV File</h2>
</div>
<div class="row">
<form action="./php/upload.php" method="post" enctype="multipart/form-data" class="needs-validation" novalidate>
<div class="form-group">
<label for="file" class="custom-file-upload">Choose a CSV file</label>
<input type="file" name="file" id="file" accept=".csv" required onchange="displayFileName()">
<div class="help-block">Please choose a CSV file.</div>
</div>
<div id="file-label"></div>
<button type="submit" name="submit" id="btnsubmit" class="btn btn-primary btn-block">Upload</button>
</form>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-xs-12">
<div class="card">
<div class="card-body">
<div class="row" id="studentimg">
<div class="row text-center"><img src="images/studnt.png" alt=""></div>
</div>
<div class="row">
<h2 class="card-title">Upload Single Student Data</h2>
</div>
<div class="row">
<div class="form-group">
<div class="help-block">Please click Register to register a student.</div>
</div>
<button data-toggle="modal" data-target="#myModal3" id="btnsubmit" type="submit" name="submit" class="btn btn-primary btn-block">Upload</button>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-xs-12">
<div class="card">
<div class="card-body">
<div class="row" id="studentimg">
<div class="row text-center"><img style="width: 90%;" src="images/fees.jpg" alt=""></div>
</div>
<div class="row">
<h2 class="card-title">Upload Fees Structure</h2>
</div>
<div class="row">
<div class="form-group">
<div class="help-block">Please click to upload the fees structure.</div>
</div>
<div class="btn-grou dropup btn-block">
<button class="btn btn-primary btn-block dropdown-toggle" id="btnsubmit" type="submit" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Upload <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li class="form-control"><a data-toggle="modal" data-target="#adminFee" class="dropdown-item " href="#">Admission fee</a></li>
<li class="form-control"><a data-toggle="modal" data-target="#feesModal" class="dropdown-item " href="#">Fees Structure</a></li>
<li class="form-control"> <a href="php/updateyear.php">Update Years</a></li>
<!-- Add more dropdown items as needed -->
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal3" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title text-center">Student Login</h4>
</div>
<div class="modal-body">
<div>
<form action="./php/registered.php" method="post">
<div class="row">
<div class="col-lg-12 forum">
<div class="row">
<div class="col">
<section class="form-group">
<label id="ad" for="admissionNumber">Admission Number:</label>
<input type="text" name="admissionNumber" id="admissionNumber" class="form-control"
required>
</section>
<section><label for="scholorshipid">Scholorship Id:</label>
<input type="text" name="scholorshipid" id="scholorshipid" class="form-control">
</section>
<section class="form-group">
<label id="ad" for="name">Name:</label>
<input type="text" name="name" id="name" class="form-control" required>
</section>
<section class="form-group">
<label id="ad" name="jvd" for="jvd">Jvd/Non-Jvd:</label>
<label for="" class="radio-inline"><input type="radio" name="jvd" id="jvdYes" value="yes" required>Jvd</label>
<label for="" class="radio-inline"><input type="radio" name="jvd" id="jvdNo" value="no" required>Non-Jvd</label> <br>
</section>
</div>
</div>
<div class="row">
<div class="col form-group">
<label for="email" id="email">Email</label>
<input type="email" class="form-control" name="email" id="email">
</div>
</div>
<div class="row">
<div class="col form-group">
<label id="ad" for="year">Year:</label>
<select name="year" id="year" class="form-control form-group" required>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<label id="ad" for="branch">Branch:</label>
<select name="branch" id="branch" class="form-control form-group" required>
<option value="CSE">CSE</option>
<option value="ECE">ECE</option>
<option value="EEE">EEE</option>
<option value="FDT">FDT</option>
<option value="MECH">MECH</option>
<option value="CIVIL">CIVIL</option>
</select>
<section class="form-group">
<label for="Qualify" id="ad">Cet Qualified</label>
<select name="Qualify" id="quali" class="form-control form-group" required>
<option value="EAPCET">EAPCET</option>
<option value="ECET">ECET</option>
</select>
</section>
<section class="form-group">
<label id="ad" for="phoneNumber">Phone Number:</label>
<input type="tel" name="phoneNumber" id="phoneNumber" class="form-control" required>
</section>
<section class="form-group">
<label id="ad" for="phoneNumber">Acomidation:</label>
<select name="acomidation" id="quali" class="form-control form-group" required>
<option value="Hosteler">Hostle</option>
<option value="Day Scholar">Day Scholar</option>
</select>
</section>
</div>
</div>
</div>
</div>
<input type="submit" name="register" class="btn btn-success form-control" value="Register">
</form>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="adminFee" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title text-center">Fees Structure</h4>
</div>
<div class="modal-body">
<form action="./php/admin_fees.php" method="post">
<div class="row">
<div class="col-lg-12">
<label for="yearSelection">Select Year:</label>
<select id="yearSelection" name="yearSelection" class="form-control">
<option value="1"> 1 </option>
<option value="2"> 2 for Lateral Entries</option>
</select>
<div id="yearFees">
<div class="row">
<div class="col-lg-12">
<div class="row">
<div class="col-lg-12">
<div class="form-group">
<label for="AdmissionFee">Admission Fee:</label>
<input type="number" name="AdmissionFee" id="AdmissionFee" class="form-control" >
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<input type="submit" name="submitFees" class="btn btn-success form-control" value="Submit">
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="feesModal" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title text-center">Fees Structure</h4>
</div>
<div class="modal-body">
<form action="./php/process_fees.php" method="post">
<div class="row">
<div class="col-lg-12">
<label for="yearSelection">Select Year:</label>
<select id="yearSelection" name="yearSelection" class="form-control">
<option value="1"> 1 </option>
<option value="2"> 2 </option>
<option value="3"> 3 </option>
<option value="4"> 4 </option>
</select>
<div id="yearFees">
<div class="row">
<div class="col-lg-12">
<div class="row">
<div class="col-lg-12">
<div class="form-group">
<label for="TuitionFee">Tuition Fee:</label>
<input type="number" name="TuitionFee" id="TuitionFee" class="form-control" >
</div>
</div>
<div class="col-lg-12">
<div class="form-group">
<label for="SpecialFee">Special Fee:</label>
<input type="number" name="SpecialFee" id="SpecialFee" class="form-control" >
</div>
</div>
<div class="col-lg-12">
<div class="form-group">
<label for="UCSFees">UCS Fees:</label>
<input type="number" name="UCSFees" id="UCSFees" class="form-control">
</div>
</div>
</div>
</div>
</div
</div>
</div>
</div>
<input type="submit" name="submitFees" class="btn btn-success form-control" value="Submit">
</form>
</div>
</div>
</div>
</div>
<!-- Your Bootstrap 3 JavaScript and Custom Scripts -->
<script>
// Enable Bootstrap form validation
document.addEventListener('load', function () {
var forms = document.getElementsByClassName('needs-validation');
for (var i = 0; i < forms.length; i++) {
forms[i].addEventListener('submit', function (event) {
if (this.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
this.classList.add('was-validated');
}, false);
}
}, false);
// Display selected file name
function displayFileName() {
var input = document.getElementById('file');
var label = document.getElementById('file-label');
label.innerHTML = input.files[0] ? 'Selected file: ' + input.files[0].name : '';
}
</script>
</body>
</html>