-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
742 lines (690 loc) · 34.9 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
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
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
<?php
# Initialize the session
session_start();
# If user is not logged in then redirect him to login page
if (!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== TRUE) {
echo "<script>" . "window.location.href='login/login.php';" . "</script>";
exit;
}
?>
<?php
// Assuming 'conn.php' is your connection file
include 'conn.php';
$sql = "SELECT COUNT(*) AS total_students FROM student_detail"; // Make sure the table name matches your database
$result = $conn->query($sql);
$total_students = 0;
if ($result->num_rows > 0) {
// Fetch the result row
$row = $result->fetch_assoc();
$total_students = $row['total_students'];
}
// Initialize variables
$total_trainers = $total_hours = $total_sections = 0;
// SQL query to count the number of trainers
$sql_trainers = "SELECT COUNT(*) AS total_trainers FROM trainer_details";
$result_trainers = $conn->query($sql_trainers);
if ($result_trainers->num_rows > 0) {
$row = $result_trainers->fetch_assoc();
$total_trainers = $row['total_trainers'];
}
// SQL query to sum the durations
$sql_hours = "SELECT SUM(duration) AS total_hours FROM course_details";
$result_hours = $conn->query($sql_hours);
if ($result_hours->num_rows > 0) {
$row = $result_hours->fetch_assoc();
$total_hours = $row['total_hours'];
}
// SQL query to count the number of sections
$sql_sections = "SELECT COUNT(*) AS total_sections FROM ections ";
$result_sections = $conn->query($sql_sections);
if ($result_sections->num_rows > 0) {
$row = $result_sections->fetch_assoc();
$total_sections = $row['total_sections'];
}
// Always close the connection
$conn->close();
?>
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Enbott Dashboard</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Favicon -->
<link rel="shortcut icon" type="image/x-icon" href="img/logo.png">
<!-- Normalize CSS -->
<link rel="stylesheet" href="css/normalize.css">
<!-- Main CSS -->
<link rel="stylesheet" href="css/main.css">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Fontawesome CSS -->
<link rel="stylesheet" href="css/all.min.css">
<!-- Flaticon CSS -->
<link rel="stylesheet" href="fonts/flaticon.css">
<!-- Full Calender CSS -->
<link rel="stylesheet" href="css/fullcalendar.min.css">
<!-- Animate CSS -->
<link rel="stylesheet" href="css/animate.min.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="style.css">
<!-- Modernize js -->
<script src="js/modernizr-3.6.0.min.js"></script>
<style>
.footer-wrap-layout1 {
background-color: white; /* Set background color to black */
color: white; /* Change text color to white for contrast */
width: 120%; /* Ensure it covers the full width */
padding: 10px 0; /* Add some padding for spacing */
margin: 0; /* Remove any default margin */
position: fixed; /* Fix position to the bottom */
left: 0; /* Align to the left edge */
bottom: 0; /* Align to the bottom edge */
text-align: center; /* Center the text */
}
.footer-wrap-layout1 a {
color: black; /* Ensure links are also white */
text-decoration: none; /* Optional: removes underline from links */
}
.footer-wrap-layout1 a:hover {
text-decoration: underline; /* Optional: adds underline on hover for links */
}
.sidebar-menu-content {
min-height: 100vh; /* Minimum height to take full viewport height */
overflow-y: auto; /* Allows scrolling within the sidebar if content overflows */
position: fixed; /* Keeps the sidebar in place while scrolling the main content */
width: 250px; /* Adjust the width as necessary */
left: 0; /* Align to the left side of the viewport */
top: 0; /* Align to the top of the viewport */
bottom: 0; /* Extends to the bottom of the viewport */
background-color: #yourSidebarBackgroundColor; /* Your sidebar background color */
z-index: 1000; /* Ensures sidebar stays above other content (adjust as necessary) */
}
/* Additional styles to ensure the rest of the content doesn't overlap with the fixed sidebar */
</style>
</head>
<body>
<!-- Preloader Start Here -->
<div id="preloader"></div>
<!-- Preloader End Here -->
<div id="wrapper" class="wrapper bg">
<!-- Header Menu Area Start Here -->
<div class="navbar navbar-expand-md header-menu-one bg-light">
<div class="nav-bar-header-one"
style="background: green; border-right: 2px solid black; text-align: center; padding-left:35px">
<div class="header-logo">
<a href="index.php">
<img src="img/logo.png" alt="logo">
</a>
</div>
<div class="toggle-button sidebar-toggle">
<button type="button" class="item-link">
<span class="btn-icon-wrap">
<span></span>
<span></span>
<span></span>
</span>
</button>
</div>
</div>
<div class="d-md-none mobile-nav-bar">
<button class="navbar-toggler pulse-animation" type="button" data-toggle="collapse"
data-target="#mobile-navbar" aria-expanded="false">
<i class="far fa-arrow-alt-circle-down"></i>
</button>
<button type="button" class="navbar-toggler sidebar-toggle-mobile">
<i class="fas fa-bars"></i>
</button>
</div>
<div class="header-main-menu collapse navbar-collapse" id="mobile-navbar">
<ul class="navbar-nav">
<li class="navbar-item header-search-bar">
<div class="input-group stylish-input-group">
<span class="input-group-addon">
<button type="submit">
<span class="flaticon-search" aria-hidden="true"></span>
</button>
</span>
<input type="text" class="form-control" placeholder="Find Something . . .">
</div>
</li>
</ul>
<ul class="navbar-nav">
<li class="navbar-item dropdown header-admin">
<a class="navbar-nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown"
aria-expanded="false">
<div class="admin-title">
<span>
<?= strtoupper(htmlspecialchars($_SESSION["username"])); ?>
</span>
</div>
<div>
<img src="img/klu.png" alt="Admin" style="width: 150px; height: auto;">
</div>
</a>
<div class="dropdown-menu dropdown-menu-right">
<div class="item-content">
<ul class="settings-list">
<li><a href="login/logout.php"><i class="flaticon-turn-off"></i>Log Out</a></li>
</ul>
</div>
</div>
</li>
<!-- <li class="navbar-item dropdown header-message">
<a class="navbar-nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown"
aria-expanded="false">
<i class="far fa-envelope"></i>
<div class="item-title d-md-none text-16 mg-l-10">Message</div>
<span>5</span>
</a>
<div class="dropdown-menu dropdown-menu-right">
<div class="item-header">
<h6 class="item-title">05 Message</h6>
</div>
<div class="item-content">
<div class="media">
<div class="item-img bg-skyblue author-online">
<img src="img/figure/student11.png" alt="img">
</div>
<div class="media-body space-sm">
<div class="item-title">
<a href="#">
<span class="item-name">Maria Zaman</span>
<span class="item-time">18:30</span>
</a>
</div>
<p>What is the reason of buy this item.
Is it usefull for me.....</p>
</div>
</div>
<div class="media">
<div class="item-img bg-yellow author-online">
<img src="img/figure/student12.png" alt="img">
</div>
<div class="media-body space-sm">
<div class="item-title">
<a href="#">
<span class="item-name">Benny Roy</span>
<span class="item-time">10:35</span>
</a>
</div>
<p>What is the reason of buy this item.
Is it usefull for me.....</p>
</div>
</div>
<div class="media">
<div class="item-img bg-pink">
<img src="img/figure/student13.png" alt="img">
</div>
<div class="media-body space-sm">
<div class="item-title">
<a href="#">
<span class="item-name">Steven</span>
<span class="item-time">02:35</span>
</a>
</div>
<p>What is the reason of buy this item.
Is it usefull for me.....</p>
</div>
</div>
<div class="media">
<div class="item-img bg-violet-blue">
<img src="img/figure/student11.png" alt="img">
</div>
<div class="media-body space-sm">
<div class="item-title">
<a href="#">
<span class="item-name">Joshep Joe</span>
<span class="item-time">12:35</span>
</a>
</div>
<p>What is the reason of buy this item.
Is it usefull for me.....</p>
</div>
</div>
</div>
</div>
</li>
<li class="navbar-item dropdown header-notification">
<a class="navbar-nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown"
aria-expanded="false">
<i class="far fa-bell"></i>
<div class="item-title d-md-none text-16 mg-l-10">Notification</div>
<span>8</span>
</a>
<div class="dropdown-menu dropdown-menu-right">
<div class="item-header">
<h6 class="item-title">03 Notifications</h6>
</div>
<div class="item-content">
<div class="media">
<div class="item-icon bg-skyblue">
<i class="fas fa-check"></i>
</div>
<div class="media-body space-sm">
<div class="post-title">Complete Today Task</div>
<span>1 Mins ago</span>
</div>
</div>
<div class="media">
<div class="item-icon bg-orange">
<i class="fas fa-calendar-alt"></i>
</div>
<div class="media-body space-sm">
<div class="post-title">Director Metting</div>
<span>20 Mins ago</span>
</div>
</div>
<div class="media">
<div class="item-icon bg-violet-blue">
<i class="fas fa-cogs"></i>
</div>
<div class="media-body space-sm">
<div class="post-title">Update Password</div>
<span>45 Mins ago</span>
</div>
</div>
</div>
</div>
</li> -->
<!-- <li class="navbar-item dropdown header-language">
<a class="navbar-nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown"
aria-expanded="false"><i class="fas fa-globe-americas"></i>EN</a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="#">English</a>
<a class="dropdown-item" href="#">Spanish</a>
<a class="dropdown-item" href="#">French</a>
<a class="dropdown-item" href="#">Chinese</a>
</div>
</li> -->
</ul>
</div>
</div>
<!-- Header Menu Area End Here -->
<!-- Page Area Start Here -->
<div class="dashboard-page-one">
<!-- Sidebar Area Start Here -->
<div class="sidebar-main sidebar-menu-one sidebar-expand-md sidebar-color">
<div class="mobile-sidebar-header d-md-none">
<div class="header-logo">
<a href="index.php"><img src="img/logo.png" alt="logo"></a>
</div>
</div>
<div class="sidebar-menu-content">
<ul class="nav nav-sidebar-menu sidebar-toggle-view">
<li class="nav-item sidebar-nav-item">
<a href="index.php" class="nav-link"><i class="flaticon-dashboard"></i><span>Progress
Dashboard</span></a>
<ul class="nav sub-group-menu">
<!-- <li class="nav-item">
<a href="index.php" class="nav-link"><i class="fas fa-angle-right"></i>Admin</a>
</li> -->
<li class="nav-item">
<a href="student.php" class="nav-link"><i class="fas fa-angle-right"></i>Student
details</a>
</li>
<li class="nav-item">
<a href="trainer.php" class="nav-link"><i class="fas fa-angle-right"></i>Trainer
Details</a>
</li>
<li class="nav-item">
<a href="coverage.php" class="nav-link"><i class="fas fa-angle-right"></i>Coverage
Status</a>
</li>
<li class="nav-item">
<a href="section.php" class="nav-link"><i class="fas fa-angle-right"></i>Section
Details</a>
</li>
</ul>
</li>
</ul>
<ul class="nav nav-sidebar-menu sidebar-toggle-view">
<li class="nav-item sidebar-nav-item">
<a href="index.php" class="nav-link"><i class="flaticon-dashboard"></i><span>Performance
Dashboard</span></a>
<ul class="nav sub-group-menu">
<!-- <li class="nav-item">
<a href="index.php" class="nav-link"><i class="fas fa-angle-right"></i>Admin</a>
</li> -->
<li class="nav-item">
<a href="aptitude.php" class="nav-link"><i class="fas fa-angle-right"></i>Aptitude
Details</a>
</li>
<li class="nav-item">
<a href="communication.php" class="nav-link"><i
class="fas fa-angle-right"></i>Communication Details</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- Sidebar Area End Here -->
<div class="dashboard-content-one">
<!-- Breadcubs Area Start Here -->
<div class="breadcrumbs-area">
<h3>Enbott Admin dashboard</h3>
<ul>
<li>
<a href="index.php">Home</a>
</li>
<li>Admin</li>
</ul>
</div>
<!-- Breadcubs Area End Here -->
<!-- Dashboard summery Start Here -->
<div class="row gutters-20">
<div class="col-xl-3 col-sm-6 col-12">
<div class="dashboard-summery-one mg-b-20">
<div class="row align-items-center">
<div class="col-6">
<div class="item-icon bg-light-green ">
<i class="flaticon-classmates text-green"></i>
</div>
</div>
<div class="col-6">
<div class="item-content">
<a href="">
<div class="item-title">Students enrolled</div>
</a>
<div class="item-number"><span class="counter"
data-num="<?= $total_students; ?>">
<?= number_format($total_students); ?>
</span></div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-sm-6 col-12">
<div class="dashboard-summery-one mg-b-20">
<div class="row align-items-center">
<div class="col-6">
<div class="item-icon bg-light-blue">
<i class="flaticon-multiple-users-silhouette text-blue"></i>
</div>
</div>
<div class="col-6">
<div class="item-content">
<a href="">
<div class="item-title">Training Resources</div>
</a>
<div class="item-number"><span class="counter"
data-num="<?= $total_trainers; ?>">
<?= number_format($total_trainers); ?>
</span></div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-sm-6 col-12">
<div class="dashboard-summery-one mg-b-20">
<div class="row align-items-center">
<div class="col-6">
<div class="item-icon bg-light-yellow">
<i class="flaticon-couple text-orange"></i>
</div>
</div>
<div class="col-6">
<div class="item-content">
<a href="">
<div class="item-title">No.Of.hours Trained</div>
</a>
<div class="item-number"><span class="counter" data-num="<?= $total_hours; ?>">
<?= number_format($total_hours); ?>
</span></div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-3 col-sm-6 col-12">
<div class="dashboard-summery-one mg-b-20">
<div class="row align-items-center">
<div class="col-6">
<div class="item-icon bg-light-red">
<i class="flaticon-classmates text-red"></i>
</div>
</div>
<div class="col-6">
<div class="item-content">
<a href="">
<div class="item-title">No. of sections</div>
</a>
<div class="item-number"><span class="counter"
data-num="<?= $total_sections; ?>">
<?= number_format($total_sections); ?>
</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Dashboard summery End Here -->
<!-- Dashboard Content Start Here -->
<div class="row gutters-20">
<div class="col-12 col-xl-8 col-6-xxxl">
<div class="card dashboard-card-one pd-b-20">
<div class="card-body">
<div class="heading-layout1">
<div class="item-title">
<h3>Department-wise Break-Down</h3>
</div>
<div class="dropdown">
<a class="dropdown-toggle" href="#" role="button" data-toggle="dropdown"
aria-expanded="false">...</a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="#"><i
class="fas fa-times text-orange-red"></i>Close</a>
<a class="dropdown-item" href="#"><i
class="fas fa-cogs text-dark-pastel-green"></i>Edit</a>
<a class="dropdown-item" href="#"><i
class="fas fa-redo-alt text-orange-peel"></i>Refresh</a>
</div>
</div>
</div>
<div style="width:100%;">
<canvas id="departmentLineChart"></canvas>
</div>
</div>
</div>
</div>
<?php
// Include your database connection file
include 'conn.php';
// Initialize variables
$total_hours_aptitude = $total_hours_communication = 0;
// Query to get the total hours for Aptitude (topic = 0)
$sql_aptitude = "SELECT SUM(duration) AS total_hours FROM course_details WHERE topic = 0";
$result_aptitude = $conn->query($sql_aptitude);
if ($result_aptitude->num_rows > 0) {
$row = $result_aptitude->fetch_assoc();
$total_hours_aptitude = $row['total_hours'];
}
// Query to get the total hours for Communication (topic = 1)
$sql_communication = "SELECT SUM(duration) AS total_hours FROM course_details WHERE topic = 1";
$result_communication = $conn->query($sql_communication);
if ($result_communication->num_rows > 0) {
$row = $result_communication->fetch_assoc();
$total_hours_communication = $row['total_hours'];
}
// Close the database connection
$conn->close();
?>
<div class="col-12 col-xl-8 col-6-xxxl">
<div class="card dashboard-card-one pd-b-20">
<div class="card-body">
<div class="heading-layout1">
<div class="item-title">
<h3>Training Coverage Progress</h3>
</div>
<div class="dropdown">
<a class="dropdown-toggle" href="#" role="button" data-toggle="dropdown"
aria-expanded="false">...</a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="#"><i
class="fas fa-times text-orange-red"></i>Close</a>
<a class="dropdown-item" href="#"><i
class="fas fa-cogs text-dark-pastel-green"></i>Edit</a>
<a class="dropdown-item" href="#"><i
class="fas fa-redo-alt text-orange-peel"></i>Refresh</a>
</div>
</div>
</div>
<div class="doughnut-chart-wrap">
<canvas id="student-doughnut-chart" width="100" height="300"></canvas>
</div>
</div>
</div>
</div>
<iframe title="enbott_dashboard" width="1224" height="612" src="https://app.powerbi.com/view?r=eyJrIjoiNjQ0ZTA5MzMtYTQ3Ny00NGE4LWE4MzUtMmMwYWFiNjBhNTIwIiwidCI6IjAzYmM3MDhkLWMwNjktNDRmOC04MmRkLTllMjk2OGViYjZkNCIsImMiOjEwfQ%3D%3D" frameborder="0" allowFullScreen="true"></iframe>
<iframe src="inner.php" width="100%" height="140%" style="border:none;"></iframe>
</body>
<!-- Dashboard Content End Here -->
<footer class="footer-wrap-layout1">
<div class="copyright">
© Copyrights <a href="#">Enbott.com</a> 2024. All rights reserved.</a>
</div>
</footer>
</div>
</div>
<!-- Page Area End Here -->
</div>
<!-- jquery-->
<script src="js/jquery-3.3.1.min.js"></script>
<!-- Plugins js -->
<script src="js/plugins.js"></script>
<!-- Popper js -->
<script src="js/popper.min.js"></script>
<!-- Bootstrap js -->
<script src="js/bootstrap.min.js"></script>
<!-- Counterup Js -->
<script src="js/jquery.counterup.min.js"></script>
<!-- Moment Js -->
<script src="js/moment.min.js"></script>
<!-- Waypoints Js -->
<script src="js/jquery.waypoints.min.js"></script>
<!-- Scroll Up Js -->
<script src="js/jquery.scrollUp.min.js"></script>
<!-- Full Calender Js -->
<script src="js/fullcalendar.min.js"></script>
<!-- Chart Js -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<!-- Custom Js -->
<script src="js/main.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
var ctx = document.getElementById('departmentLineChart').getContext('2d');
var chart = new Chart(ctx, {
type: 'bar', // Keep as 'bar' for a horizontal bar chart
data: {
labels: ["CSE", "ECE", "IT", "BIO TECH", "FOOD TECH", "MECH", "AGRI", "BIOMEDICAL", "EEE", "AERO", "CIVIL", "Auto", "CHEMICAL"],
datasets: [{
label: 'Student Count',
backgroundColor: [
'rgba(267, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)',
'rgba(199, 199, 199, 0.2)',
'rgba(83, 102, 255, 0.2)',
'rgba(40, 159, 64, 0.2)',
'rgba(215, 99, 132, 0.2)',
'rgba(20, 162, 235, 0.2)',
'rgba(40, 206, 86, 0.2)',
'rgba(75, 192, 132, 0.2)'
],
borderColor: [
'rgba(111,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)',
'rgba(199, 199, 199, 1)',
'rgba(83, 102, 255, 1)',
'rgba(40, 159, 64, 1)',
'rgba(215, 99, 132, 1)',
'rgba(20, 162, 235, 1)',
'rgba(40, 206, 86, 1)',
'rgba(75, 192, 132, 1)'
],
borderWidth: 1,
data: [2022, 315, 152, 69, 54, 49, 30, 22, 21, 15, 13, 6, 6]
}]
},
options: {
indexAxis: 'y', // Add this line to change the index axis to y for a horizontal bar chart
responsive: true,
legend: {
display: true,
},
title: {
display: true,
text: 'Department-wise Student Count'
},
scales: {
yAxes: [{ // This now becomes the vertical axis and should be configured for the departments
display: true,
scaleLabel: {
display: true,
labelString: 'Department'
}
}],
xAxes: [{ // This now becomes the horizontal axis and should be configured for the counts
display: true,
ticks: {
beginAtZero: true
},
scaleLabel: {
display: true,
labelString: 'Student Count'
}
}]
}
}
});
});
</script>
<script>
if ($("#student-doughnut-chart").length) {
var doughnutChartData = {
labels: ["Communication", "Apptitude"],
datasets: [{
backgroundColor: ["#304ffe", "#ffa601"],
// Use PHP variables to pass the total hours data
data: [<?= $total_hours_aptitude; ?>, <?= $total_hours_communication; ?>],
label: "Total Hours"
}]
};
var doughnutChartOptions = {
responsive: true,
maintainAspectRatio: false,
cutoutPercentage: 65,
rotation: -9.4,
animation: {
duration: 2000
},
legend: {
display: false
},
tooltips: {
enabled: true
},
};
var studentCanvas = $("#student-doughnut-chart").get(0).getContext("2d");
var studentChart = new Chart(studentCanvas, {
type: 'doughnut',
data: doughnutChartData,
options: doughnutChartOptions
});
}
</script>
</body>
</html>