-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f7d191
commit 69dbc69
Showing
38 changed files
with
2,471 additions
and
1,172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
include '../controls/connection.php'; | ||
if (isset($_POST['change'])) { | ||
$admission_no = $_GET['admission_no']; | ||
|
||
$sql1 = "SELECT std_id FROM student_tbl WHERE admission_no='$admission_no'"; | ||
$result1 = mysqli_query($con, $sql1); | ||
$row = mysqli_fetch_assoc($result1); | ||
$std_id = $row['std_id']; | ||
|
||
$sql2 = "UPDATE student_marks_watched_tbl SET is_watched='1' WHERE std_id='$std_id'"; | ||
if (mysqli_query($con, $sql2)) { | ||
$sm = "Updated!"; | ||
header("Location: ../pages/students/show-marks.php?success=$sm"); | ||
exit; | ||
} else { | ||
$em = "Unknown error occurred"; | ||
header("Location: ../pages/students/show-marks.php?success=$em"); | ||
exit; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
if (isset($_POST['change_pwd'])) { | ||
require_once '../controls/connection.php'; | ||
$old_pwd = $_POST['old_pwd']; | ||
$new_pwd = $_POST['new_pwd']; | ||
$c_new_pwd = $_POST['c_new_pwd']; | ||
$std_id = $_GET['id']; | ||
$admission_no = $_GET['admission']; | ||
|
||
$sql1 = "SELECT password, admission_no FROM user_tbl WHERE username='$admission_no'"; | ||
$result1 = mysqli_query($con, $sql1); | ||
if (mysqli_num_rows($result1) < 2) { | ||
$data = mysqli_fetch_assoc($result1); | ||
$o_pwd = $data['password']; | ||
if (password_verify($old_pwd, $o_pwd)) { | ||
if ($new_pwd == $c_new_pwd) { | ||
$sql2 = "UPDATE user_tbl SET password='" . password_hash($new_pwd, PASSWORD_DEFAULT) . "' WHERE admission_no='$admission_no'"; | ||
if (mysqli_query($con, $sql2)) { | ||
$sm = "The password has been changed successfully!"; | ||
header("Location: ../pages/students/settings.php?success=$sm"); | ||
exit; | ||
} | ||
} else { | ||
$em = "Enter the New Password Correctly!"; | ||
header("Location: ../pages/admin/settings.php?error=$em"); | ||
exit; | ||
} | ||
} else { | ||
$em = "Incorrect Old Passowrd"; | ||
header("Location: ../pages/admin/settings.php?error=$em"); | ||
exit; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
if (isset($_POST['change_pwd'])) { | ||
require_once '../controls/connection.php'; | ||
$old_pwd = $_POST['old_pwd']; | ||
$new_pwd = $_POST['new_pwd']; | ||
$c_new_pwd = $_POST['c_new_pwd']; | ||
// $staff_id = $_GET['id']; | ||
$nic = $_GET['nic']; | ||
|
||
$sql1 = "SELECT password, nic FROM user_tbl WHERE username='$nic'"; | ||
$result1 = mysqli_query($con, $sql1); | ||
if (mysqli_num_rows($result1) < 2) { | ||
$data = mysqli_fetch_assoc($result1); | ||
$o_pwd = $data['password']; | ||
if (password_verify($old_pwd, $o_pwd)) { | ||
if ($new_pwd == $c_new_pwd) { | ||
$sql2 = "UPDATE user_tbl SET password='" . password_hash($new_pwd, PASSWORD_DEFAULT) . "' WHERE nic='$nic'"; | ||
if (mysqli_query($con, $sql2)) { | ||
$sm = "The password has been changed successfully!"; | ||
header("Location: ../pages/teachers/settings.php?success=$sm"); | ||
exit; | ||
} | ||
} else { | ||
$em = "Enter the New Password Correctly!"; | ||
header("Location: ../pages/teachers/settings.php?error=$em"); | ||
exit; | ||
} | ||
} else { | ||
$em = "Incorrect Old Passowrd"; | ||
header("Location: ../pages/teachers/settings.php?error=$em"); | ||
exit; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
<?php | ||
session_start(); | ||
if (isset($_SESSION['username']) && isset($_SESSION['admin_role'])) { | ||
?> | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> | ||
<link rel="shortcut icon" href="../../Media/Richmond Colleg LOGO.png" type="image/x-icon"> | ||
<meta name="description" content="" /> | ||
<meta name="author" content="" /> | ||
<title>Marks Analytics - Admin</title> | ||
<link href="../css/styles.css" rel="stylesheet" /> | ||
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script> | ||
<!-- <script src="../../js/jquery-3.6.3.min.js"></script> --> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script> | ||
</head> | ||
|
||
<body class="sb-nav-fixed"> | ||
|
||
<?php include '../top-navbar.php'; ?> | ||
<?php include 'left-side-bar.php'; ?> | ||
|
||
<div id="layoutSidenav_content"> | ||
|
||
<!-- content goes here. do not remove any code --> | ||
<div class="container-fluid"> | ||
<h1 class="mt-4">Marks Analytics</h1> | ||
<ol class="breadcrumb mb-4"></ol> | ||
|
||
<div class="container mt-5"> | ||
<div class="shadow p-3 mt-5 form-w"> | ||
<div class="row"> | ||
<div class="col-md-4"> | ||
<div class="mb-3"> | ||
<label class="form-label">Search by Admission No.</label> | ||
<input type="text" id="admission_no" class="form-control"> | ||
</div> | ||
</div> | ||
<div class="col-md-4"> | ||
<div class="mb-3"> | ||
<label class="form-label">Year</label> | ||
<select name="year" class="form-select yearSelect" required></select> | ||
</div> | ||
</div> | ||
<!-- <div class="col-md-4"> | ||
<div class="mb-3"> | ||
<label class="form-label">Term</label> | ||
<select name="term" class="form-select termSelect" required></select> | ||
</div> | ||
</div> --> | ||
<!-- <div class="col-md-5"> --> | ||
<div class="mb-3"> | ||
<button class="btn btn-success" id="search">Search</button> | ||
</div> | ||
<!-- </div> --> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="container mt-5"> | ||
<h3>Filtered Results</h3> | ||
<hr> | ||
<div id="data" class=""></div> | ||
</div> | ||
|
||
|
||
</div> | ||
|
||
<!-- footer --> | ||
<?php include '../footer.php'; ?> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
$(document).ready(function() { | ||
// get-years.php | ||
$('#admission_no').keyup(function() { | ||
var query = $(this).val(); | ||
if (query != '') { | ||
$.ajax({ | ||
url: 'get-years.php', | ||
method: 'POST', | ||
data: { | ||
query: query | ||
}, | ||
success: function(data) { | ||
$('.yearSelect').html(data); | ||
} | ||
}); | ||
} | ||
}); | ||
// $('#admission_no').keyup(function() { | ||
// var query = $(this).val(); | ||
// if (query != '') { | ||
// $.ajax({ | ||
// url: 'get-terms.php', | ||
// method: 'POST', | ||
// data: { | ||
// query: query | ||
// }, | ||
// success: function(data) { | ||
// $('.termSelect').html(data); | ||
// } | ||
// }); | ||
// } | ||
// }); | ||
$("#search").click(function(event) { | ||
event.preventDefault(); | ||
$.ajax({ | ||
url: "load-charts.php", | ||
type: "POST", | ||
data: { | ||
res_year: $(".yearSelect option:selected").val(), | ||
// term: $(".termSelect option:selected").val(), | ||
query: $("#admission_no").val() | ||
}, | ||
success: function(data) { | ||
$("#data").html(data); | ||
}, | ||
error: function(jqXHR, textStatus, errorThrown) { | ||
console.log("Error: " + textStatus + " - " + errorThrown); | ||
} | ||
}); | ||
}); | ||
}); | ||
</script> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script> | ||
<script src="../js/scripts.js"></script> | ||
|
||
</body> | ||
|
||
</html> | ||
|
||
<?php } else { | ||
header("Location:../../login.php"); | ||
exit; | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
// get-terms.php | ||
include '../../controls/connection.php'; | ||
|
||
$query = $_POST['query']; | ||
|
||
$sql1 = "SELECT std_id FROM student_tbl WHERE admission_no='$query'"; | ||
$result1 = mysqli_query($con, $sql1); | ||
if (mysqli_num_rows($result1) == 1) { | ||
$row1 = mysqli_fetch_assoc($result1); | ||
$std_id = $row1['std_id']; | ||
|
||
$sql2 = "SELECT DISTINCT term FROM al_marks_tbl WHERE std_id='$std_id'"; | ||
$result2 = mysqli_query($con, $sql2); | ||
if (mysqli_num_rows($result2) > 0) { | ||
while ($row2 = mysqli_fetch_assoc($result2)) { | ||
$term = $row2['term']; | ||
echo "<option value='$term'>$term</option>"; | ||
} | ||
} else { | ||
} | ||
} else { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
include '../../controls/connection.php'; | ||
|
||
$query = $_POST['query']; | ||
|
||
$sql1 = "SELECT std_id FROM student_tbl WHERE admission_no='$query'"; | ||
$result1 = mysqli_query($con, $sql1); | ||
if (mysqli_num_rows($result1) == 1) { | ||
$row1 = mysqli_fetch_assoc($result1); | ||
$std_id = $row1['std_id']; | ||
|
||
$sql2 = "SELECT DISTINCT year FROM al_marks_tbl WHERE std_id='$std_id'"; | ||
$result2 = mysqli_query($con, $sql2); | ||
if (mysqli_num_rows($result2) > 0) { | ||
while ($row2 = mysqli_fetch_assoc($result2)) { | ||
$year = $row2['year']; | ||
echo "<option value='$year'>$year</option>"; | ||
} | ||
} else { | ||
} | ||
} else { | ||
} |
Oops, something went wrong.