mirror of
https://github.com/Hizenberg469/BPIT-ATTENDANCE.git
synced 2026-04-20 02:02:25 +03:00
initial commit
This commit is contained in:
8
vansh/Stud_Dashboard/db.php
Normal file
8
vansh/Stud_Dashboard/db.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
$servername="localhost";
|
||||
$username="usr";
|
||||
$password="admin@1224";
|
||||
$dbname="main_bpitattendance_db";
|
||||
|
||||
$con = mysqli_connect($servername,$username,$password,$dbname) or die(myslq_error());
|
||||
?>
|
||||
60
vansh/Stud_Dashboard/fetch_data.php
Normal file
60
vansh/Stud_Dashboard/fetch_data.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
include("db.php");
|
||||
include("../../junet/html/encrypt_password.inc.php");
|
||||
include ("../../junet/html/hash_gen.inc.php");
|
||||
include ("../../junet/html/decrypt_password.inc.php");
|
||||
|
||||
// Check if the connection is successful
|
||||
if ($con === false) {
|
||||
echo "Connection failed"; // Display message if connection fails
|
||||
} else {
|
||||
// Check if enrollment number is provided in the GET request
|
||||
//if (isset($_GET['enrollment_no'])) {
|
||||
// $enrollment_no = $_GET['enrollment_no']; // Get enrollment number from GET request
|
||||
// Prepare the SQL SELECT query
|
||||
$enrollment_no="14320802721";//to be commented out. for testing.
|
||||
|
||||
$sem1_query = "SELECT enrollment_no,course_id,curr_attendance,total_session FROM sem_1_crs_attend_recd where enrollment_no = $enrollment_no";
|
||||
// Execute the query
|
||||
$result = mysqli_query($con, $sem1_query);
|
||||
|
||||
// Check if any records were returned
|
||||
if (mysqli_num_rows($result) > 0) {
|
||||
// Output table header with CSS styles
|
||||
echo "<table border='1' style='margin: 0 auto; text-align: center;'>";
|
||||
echo "<tr><th colspan='5'>Attendance for: $enrollment_no</th></tr>";
|
||||
echo "<tr><th>Course ID</th><th>Current Attendance</th><th>Total Sessions</th><th>Progress</th></tr>";
|
||||
|
||||
echo "<h2>Subject-wise Attendance</h2>";
|
||||
//Attendance Trends & Attendance Alerts
|
||||
// Loop through each row of the result set
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
// Calculate progress ratio
|
||||
$progress_ratio = ($row['curr_attendance'] / $row['total_session']) * 100;
|
||||
|
||||
// Output table row
|
||||
echo "<tr>";
|
||||
echo "<td>" . $row['course_id'] . "</td>";
|
||||
echo "<td>" . $row['curr_attendance'] . "</td>";
|
||||
echo "<td>" . $row['total_session'] . "</td>";
|
||||
// Output progress bar with padding
|
||||
echo "<td style='padding: 5px;'><progress value='$progress_ratio' max='100'></progress></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
} else {
|
||||
// No records found
|
||||
echo "No records found";
|
||||
}
|
||||
|
||||
|
||||
// Free result set
|
||||
mysqli_free_result($result);
|
||||
/*} else {
|
||||
echo "Enrollment number not provided"; // Output message if enrollment number is not provided in the GET request
|
||||
}*/
|
||||
|
||||
// Close connection
|
||||
mysqli_close($con);
|
||||
}
|
||||
?>
|
||||
35
vansh/Stud_Dashboard/fetch_name.php
Normal file
35
vansh/Stud_Dashboard/fetch_name.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
include("db.php");
|
||||
|
||||
// Check if the connection is successful
|
||||
if ($con === false) {
|
||||
echo "Connection failed"; // Display message if connection fails
|
||||
} else {
|
||||
// Check if enrollment number is provided in the GET request
|
||||
//if (isset($_GET['enrollment_no'])) {
|
||||
// $enrollment_no = $_GET['enrollment_no']; // Get enrollment number from GET request
|
||||
|
||||
$enrollment_no="14320802721";//to be commented out. for testing.
|
||||
// Prepare the SQL SELECT query
|
||||
$name_query = "SELECT stud_first_name FROM student_record WHERE enrollment_no = $enrollment_no";
|
||||
$name_result = mysqli_query($con, $name_query);
|
||||
|
||||
if ($name_result) {
|
||||
if (mysqli_num_rows($name_result) > 0) {
|
||||
// Student found, fetch and display the name
|
||||
$name_row = mysqli_fetch_assoc($name_result);
|
||||
$student_name = $name_row['stud_first_name'];
|
||||
} else {
|
||||
echo "No student found with the given enrollment number.";
|
||||
}
|
||||
} else {
|
||||
echo "Error: " . mysqli_error($con);
|
||||
}
|
||||
} /*else {
|
||||
echo "Enrollment number not provided.";
|
||||
}*/
|
||||
|
||||
// Close connection
|
||||
mysqli_close($con);
|
||||
//}
|
||||
?>
|
||||
64
vansh/Stud_Dashboard/index.php
Normal file
64
vansh/Stud_Dashboard/index.php
Normal file
@@ -0,0 +1,64 @@
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="./styles.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="Navbar">
|
||||
<?php
|
||||
include("fetch_name.php");
|
||||
?>
|
||||
<ul>
|
||||
<li><a href="#Login/Logout">Login/Logout</a></li>
|
||||
<li>
|
||||
<a href="#" class="notification">
|
||||
<span>Notifications </span>
|
||||
<span class="badge">3</span>
|
||||
</a>
|
||||
</li>
|
||||
<li><a href="#Register">Register</a></li>
|
||||
<li><a href="#Aboutus">About us</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="content-header">
|
||||
<div class="clearfix">
|
||||
<div class="float-left">
|
||||
<div class="mini-nav">
|
||||
<span class="user-img"><img src="link_to_user_IMAGE"></span><span class="user-name"><?php echo $student_name; ?></span><i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
<a><i class="fa fa-navicon" aria-hidden="true"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="banner blue">
|
||||
<div class="clearfix">
|
||||
<div class="float-left">
|
||||
<h4>Welcome, <?php echo $student_name; ?></h4>
|
||||
<h5>Let's take a look at your progress.</h5>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
</div>
|
||||
<div class="donut instalment1" style="float: right; margin-right: 5px">
|
||||
<div style="float: right; margin-right: 200px" style="display: inline;">Attendance Percentage:</div>
|
||||
<div class="donut-default"></div>
|
||||
<div class="donut-line"></div>
|
||||
<div class="donut-text">
|
||||
<span>check</span>
|
||||
</div>
|
||||
<div class="donut-case"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include("fetch_data.php");
|
||||
?>
|
||||
|
||||
</body>
|
||||
305
vansh/Stud_Dashboard/styles.css
Normal file
305
vansh/Stud_Dashboard/styles.css
Normal file
@@ -0,0 +1,305 @@
|
||||
@import url('https://fonts.googleapis.com/css?family=PT+Sans:400,700');
|
||||
@import url('https://fonts.googleapis.com/css?family=Roboto:300,400,500,700');
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-size: 16px;
|
||||
}
|
||||
.logo {
|
||||
text-align: center;
|
||||
}
|
||||
.logo a {
|
||||
font-family: 'PT Sans', sans-serif;
|
||||
padding: 20px 30px;
|
||||
display: block;
|
||||
font-weight: 16px;
|
||||
}
|
||||
/* #sidebar {
|
||||
z-index: 2001;
|
||||
position: fixed;
|
||||
width: 220px;
|
||||
background-color: #2F2E33;
|
||||
border-color: #2f4050;
|
||||
-webkit-transition: all 0.4s;
|
||||
-moz-transition: all 0.4s;
|
||||
-o-transition: all 0.4s;
|
||||
transition: all 0.4s;
|
||||
height: 100%;
|
||||
} */
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.attendance-box {
|
||||
width: 300px; /* Adjust width as per your requirement */
|
||||
box-sizing: border-box;
|
||||
margin-top: 20px;
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px;
|
||||
background-color: #ffffff; /* Set background color to pure white */
|
||||
|
||||
}
|
||||
|
||||
.attendance-bar {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.attendance-bar progress {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.attendance-bar .subject {
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.donut {
|
||||
position: relative;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.donut-default {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.donut-white {
|
||||
width: 70%;
|
||||
height: 70%;
|
||||
border-radius: 50%;
|
||||
background: #fff;
|
||||
top: 50%;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.donut-line {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.donut-text {
|
||||
top: 25px;
|
||||
left: 25px;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
background: #fff;
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.donut-text span {
|
||||
color: #48b2c1;
|
||||
}
|
||||
|
||||
.instalment1 .donut-case {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
background: #48b2c1;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-clip: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.instalment1 .donut-case::before {
|
||||
content: "";
|
||||
clip: rect(0 200px 100px 0);
|
||||
-webkit-transform: rotate(90deg);
|
||||
transform: rotate(180deg);
|
||||
background: #cbcb41;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.instalment1 .donut-case::after {
|
||||
content: "";
|
||||
clip: rect(0 100px 200px 0);
|
||||
-webkit-transform: rotate(327.6deg);
|
||||
transform: rotate(360deg);
|
||||
background: #cbcb41;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.instalment1 .donut-line::before {
|
||||
content: "";
|
||||
width: 1px;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: -25px;
|
||||
left: 50%;
|
||||
background: #fff;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.instalment1 .donut-line::after {
|
||||
content: "";
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 25px;
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.notification {
|
||||
background-color: #555;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
padding: 15px 26px;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.notification:hover {
|
||||
background: red;
|
||||
}
|
||||
|
||||
.notification .badge {
|
||||
position: absolute;
|
||||
top: -8px; /* Adjust the top position */
|
||||
right: -8px; /* Adjust the right position */
|
||||
padding: 6px 8px; /* Adjust the padding */
|
||||
border-radius: 50%;
|
||||
background: red;
|
||||
color: white;
|
||||
font-size: 12px; /* Adjust the font size */
|
||||
line-height: 1; /* Ensure the line height matches the font size */
|
||||
box-sizing: border-box; /* Include padding in the total width */
|
||||
width: 25px; /* Ensure the badge has enough width */
|
||||
text-align: center; /* Center the text horizontally */
|
||||
}
|
||||
|
||||
|
||||
.Navbar{
|
||||
ul {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 20px 0; /* Adjust the top and bottom padding */
|
||||
overflow: hidden;
|
||||
background-color: #333;
|
||||
}
|
||||
|
||||
li {
|
||||
float: right;
|
||||
}
|
||||
|
||||
li a {
|
||||
display: block;
|
||||
color: white;
|
||||
text-align: center;
|
||||
padding: 14px 16px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Change the link color to #111 (black) on hover */
|
||||
li a:hover {
|
||||
background-color: #111;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.sidebar-nav .menu>li>a {
|
||||
color: #9EA6AF;
|
||||
font-weight: 400;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
padding: 20px 10px 20px 40px;
|
||||
}
|
||||
.sidebar-nav li:hover a {
|
||||
background: #2A292E;
|
||||
color: #fff;
|
||||
}
|
||||
.sidebar-nav a i {
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
#content {
|
||||
|
||||
background: none repeat scroll 0 0 #eeeeee;
|
||||
position: relative;
|
||||
min-height: 100%;
|
||||
width: auto;
|
||||
-webkit-transition: all 0.4s;
|
||||
-moz-transition: all 0.4s;
|
||||
-o-transition: all 0.4s;
|
||||
transition: all 0.4s;
|
||||
}
|
||||
#content-header {
|
||||
background: #fff;
|
||||
padding: 10px;
|
||||
}
|
||||
.mini-nav {
|
||||
font-size: 24px;
|
||||
padding: 7px 10px;
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
|
||||
}
|
||||
.user-header .user-name {
|
||||
padding: 0 10px;
|
||||
list-style-type: none;
|
||||
}
|
||||
.user-header .user-img img {
|
||||
margin-top: 4px;
|
||||
border-radius: 5px;
|
||||
max-width: 45px;
|
||||
max-height: 45px;
|
||||
}
|
||||
.banner.blue {
|
||||
display: flex;
|
||||
justify-content:space-between;
|
||||
background: #04a1dc;
|
||||
background: -moz-linear-gradient(left, #04a1dc 1%, #0cb2ca 100%);
|
||||
background: -webkit-linear-gradient(left, #04a1dc 1%,#0cb2ca 100%);
|
||||
background: linear-gradient(to right, #04a1dc 1%,#0cb2ca 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#04a1dc', endColorstr='#0cb2ca',GradientType=1 );
|
||||
background: #0f4375;
|
||||
background: -moz-linear-gradient(left, #0f4375 0%, #2989d8 49%, #0f4375 100%);
|
||||
background: -webkit-linear-gradient(left, #0f4375 0%,#2989d8 49%,#0f4375 100%);
|
||||
background: linear-gradient(to right, #0f4375 0%,#2989d8 49%,#0f4375 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0f4375', endColorstr='#0f4375',GradientType=1 );
|
||||
padding: 40px;
|
||||
color: #fff;
|
||||
}
|
||||
.banner h4 {
|
||||
font-weight: 400;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
.banner h5 {
|
||||
font-weight: 300;
|
||||
font-size: 16px;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
.content-inner {
|
||||
padding: 15px 0;
|
||||
}
|
||||
Reference in New Issue
Block a user