forked from hung1605/student_manager
-
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
Showing
18 changed files
with
602 additions
and
311 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<!-- Add Bootstrap CSS --> | ||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> | ||
</head> | ||
|
||
<body> | ||
|
||
<!-- Button with primary color --> | ||
<button type="button" class="btn btn-primary">Primary Button</button> | ||
|
||
<!-- Button with secondary color --> | ||
<button type="button" class="btn btn-secondary">Secondary Button</button> | ||
|
||
<!-- Button with success color --> | ||
<button type="button" class="btn btn-success">Success Button</button> | ||
|
||
<!-- Button with danger color --> | ||
<button type="button" class="btn btn-danger">Danger Button</button> | ||
|
||
<!-- Button with warning color --> | ||
<button type="button" class="btn btn-warning">Warning Button</button> | ||
|
||
<!-- Button with info color --> | ||
<button type="button" class="btn btn-info">Info Button</button> | ||
|
||
<!-- Button with light color --> | ||
<button type="button" class="btn btn-light">Light Button</button> | ||
|
||
<!-- Button with dark color --> | ||
<button type="button" class="btn btn-dark">Dark Button</button> | ||
|
||
</body> | ||
|
||
</html> |
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
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 |
---|---|---|
@@ -1,29 +1,64 @@ | ||
<?php | ||
include_once 'db/config.php'; | ||
|
||
if (isset($_GET['classId'])) { | ||
$classId = $_GET['classId']; | ||
|
||
$sql = "SELECT MaSV, HoTen, NgaySinh, DiaChi FROM sinhvien WHERE MaLop = ?"; | ||
$stmt = $conn->prepare($sql); | ||
$stmt->bind_param("s", $classId); | ||
$stmt->execute(); | ||
$result = $stmt->get_result(); | ||
|
||
if ($result->num_rows > 0) { | ||
echo "<table><tr><th>ID</th><th>Name</th><th>DOB</th><th>Address</th></tr>"; | ||
while ($row = $result->fetch_assoc()) { | ||
echo "<tr> | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<title>Student List</title> | ||
<style> | ||
table { | ||
width: 100%; | ||
border-collapse: collapse; | ||
} | ||
|
||
th, | ||
td { | ||
padding: 8px; | ||
text-align: left; | ||
border-bottom: 1px solid #ddd; | ||
} | ||
|
||
th { | ||
background-color: #f2f2f2; | ||
} | ||
|
||
tr:hover { | ||
background-color: #f5f5f5; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
|
||
<?php | ||
include_once 'db/config.php'; | ||
|
||
if (isset($_GET['classId'])) { | ||
$classId = $_GET['classId']; | ||
|
||
$sql = "SELECT MaSV, HoTen, NgaySinh, DiaChi FROM sinhvien WHERE MaLop = ?"; | ||
$stmt = $conn->prepare($sql); | ||
$stmt->bind_param("s", $classId); | ||
$stmt->execute(); | ||
$result = $stmt->get_result(); | ||
|
||
if ($result->num_rows > 0) { | ||
echo "<table id=\"classSelectionContainer\"><tr><th>ID</th><th>Name</th><th>DOB</th><th>Address</th></tr>"; | ||
while ($row = $result->fetch_assoc()) { | ||
echo "<tr> | ||
<td>{$row['MaSV']}</td> | ||
<td>{$row['HoTen']}</td> | ||
<td>{$row['NgaySinh']}</td> | ||
<td>{$row['DiaChi']}</td> | ||
</tr>"; | ||
} | ||
echo "</table>"; | ||
} else { | ||
echo "No students found for the selected class."; | ||
} | ||
echo "</table>"; | ||
} else { | ||
echo "No students found for the selected class."; | ||
|
||
$stmt->close(); | ||
} | ||
?> | ||
|
||
</body> | ||
|
||
$stmt->close(); | ||
} | ||
</html> |
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 |
---|---|---|
@@ -1,61 +0,0 @@ | ||
<?php | ||
session_start(); | ||
if (!isset($_SESSION['loggedin'])) { | ||
header("Location: login.php"); | ||
exit(); | ||
} | ||
|
||
include 'templates/header.php'; | ||
include 'functions/student_functions.php'; | ||
include 'functions/gpa_functions.php'; | ||
?> | ||
|
||
<!-- Include JavaScript for dynamic search suggestions --> | ||
<script> | ||
document.addEventListener("DOMContentLoaded", function () { | ||
var suggestionBox = document.getElementById("suggestionBox"); | ||
|
||
// Fetch all students when the page finishes loading | ||
fetchSuggestions("") | ||
|
||
var searchInput = document.getElementById("searchInput"); | ||
var timeout = null; | ||
|
||
searchInput.addEventListener("input", function () { | ||
clearTimeout(timeout); | ||
var searchQuery = searchInput.value.trim(); | ||
if (searchQuery.length >= 0) { | ||
// Fetch suggestions after a short delay to avoid excessive requests | ||
timeout = setTimeout(function () { | ||
fetchSuggestions(searchQuery); | ||
}, 300); | ||
} | ||
}); | ||
|
||
function fetchSuggestions(query) { | ||
fetch("search_gpa.php?search=" + query) | ||
.then(response => response.text()) | ||
.then(data => { | ||
suggestionBox.innerHTML = data; | ||
}); | ||
} | ||
}); | ||
</script> | ||
|
||
|
||
<!-- HTML for search input and suggestion box --> | ||
<h2>Student Subjects Point</h2> | ||
|
||
<div> | ||
<input type="text" id="searchInput" placeholder="Search by Name" class="d-inline"> | ||
<button onclick="window.location.href='add_student.php'">Add Student</button> | ||
<div id="suggestionBox"></div> | ||
</div> | ||
|
||
<script> | ||
function openPopup(url) { | ||
window.open(url, '_self', 'width=600,height=400'); | ||
} | ||
</script> | ||
|
||
<?php include 'templates/footer.php'; ?> | ||
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
Oops, something went wrong.