Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions DatabaseAdministration.php
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
<?php
// Connecting to mySQL Server
$conn = new mysqli("localhost:3310", "root", "0413", "schoolenrollment");
if($conn -> connect_error) {
die ("Connect Error (".$conn->connect_Errorno.") ".$conn->connect_error);
}
// Select schoolenrollment.Students table
$sql = "SELECT * FROM schoolenrollment.Students";
$result = $conn -> query($sql);
// Close the database connection
$conn -> close();
?>

<!-- HTML -->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Metadata, dimension and scaling -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Admin Dashboard -->
<title>Admin Dashboard</title>
<!-- Link to external style sheet -->
<link rel="stylesheet" href="styles.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;800&display=swap" rel="stylesheet">
</head>
<body>
<!-- Navigation section -->
<div class="navsection">
<div class="logo-container">
<!-- Embedded the image ustseal.png -->
<img src="images/ustseal.png" width="50px">
</div>
<ul>
<li>Notifications</li>
<li>Messages</li>
<!-- Log out -->
<li><a href="Landing.html">Logout</a></li>
</ul>
</div>
<!-- Main section -->
<div class="mainsection">
<h1>School Enrollment System</h1>
</div>
Expand Down
37 changes: 26 additions & 11 deletions Enroll.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?php
$conn = new mysqli("localhost:3310", "root", "mysql", "school");
if($conn -> connect_error) {
die ("Connect Error (".$conn->connect_Errorno.") ".$conn->connect_error);
}
$sql = "SELECT * FROM school.course";
$result = $conn -> query($sql);
// Connecting to mySQL Server
$conn = new mysqli("localhost:3310", "root", "mysql", "school");
if($conn -> connect_error) {
die ("Connect Error (".$conn->connect_Errorno.") ".$conn->connect_error);
}
// Select school.course table
$sql = "SELECT * FROM school.course";
$result = $conn -> query($sql);

// ID Automatically Generated in SQL
// Variable Instantiation | ID Automatically Generated in SQL
$STU_FNAME = $_REQUEST["FNAME"];
$STU_MI = $_REQUEST["MI"];
$STU_LNAME = $_REQUEST["LNAME"];
Expand All @@ -15,21 +17,20 @@
$DEPT_ID = $_REQUEST['DEPT_ID'];
$CRS_IDs = $_POST['Courses'];

// TO FIX: Hardcoded values
$STU_ID = 106;
$ENRL_YEAR = 2022;

$CLASS_SEC = "A"; // kailangan ata makuha specialization
$CLASS_LOCATION = "Laboratory"; // ito specific lng for prog and info man.
$CLASS_LOCATION = "Laboratory";

$INSTR_ID = 500; // ito kapag 2 or more prof per course ex. prog maam. sideno at maam. alberto. rand func nlng
$EMPL_YEAR = 2010;

//Query: Insert student information values into the student table
$add_student_query = "INSERT INTO student(ENRL_YEAR, STU_FNAME, STU_MI, STU_LNAME, STU_BDAY, STU_GENDER, DEPT_ID)
VALUES ($ENRL_YEAR, '$STU_FNAME', '$STU_MI', '$STU_LNAME', '$STU_BDAY', '$STU_GENDER', $DEPT_ID)";



// if true | print "Data fetched successfully", and insert values into enrollment and class table
if (mysqli_query($conn, $sql) ) {
echo "Data fetched successfully";
mysqli_query($conn, $add_student_query);
Expand All @@ -42,10 +43,12 @@
// echo $add_enrollment_query . "<br><br><br>" . $add_class_query . "<br><hr>";
}
}
// else false | print "Data fetch failed"
else {
echo "Data fetch failed";
}

// Query: Select course informartion from student table (INNER JOIN)
$enrollement_info_query = "SELECT CRS_LEVEL ,d.DEPT_NAME ,CLASS_SEC, CLASS_LOC, CRS_NAME, CRS_DESC, CRS_UNIT, INSTR_FNAME
FROM student AS s
INNER JOIN enrollment AS e
Expand All @@ -62,36 +65,46 @@

$enrollment_info_result = $conn -> query($enrollement_info_query);

// Close the database connection
$conn -> close();
?>

<!-- HTML -->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Metadata, dimension and scaling -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Enrollment -->
<title>Enrollment</title>
<!-- Link to external style sheet -->
<link rel="stylesheet" href="styles.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;800&display=swap" rel="stylesheet">
</head>
<body>
<!-- Navigation section -->
<div class="navsection">
<div class="logo-container">
<!-- Embedded the image ustseal/png -->
<img src="images/ustseal.png" width="50px">
</div>
<ul>
<li>Notifications</li>
<li>Messages</li>
<!-- Log out -->
<li><a href="Landing.html">Logout</a></li>
</ul>
</div>
<!-- Main section-->
<div class="mainsection">
<h1>You have successfully enrolled!</h1>
<h2><?php echo $STU_FNAME ?></h2>
<table>
<!-- Prints the column attributes -->
<tr>
<!-- TODO CONCAT TO SECTION -->
<th>Course Level</th>
Expand All @@ -105,6 +118,7 @@
</tr>

<?php while($row = $enrollment_info_result -> fetch_assoc()) { ?>
<!-- Prints the course information from table -->
<tr>
<td><?php echo $row["CRS_LEVEL"];?></td>
<td><?php echo $row["DEPT_NAME"];?></td>
Expand All @@ -118,6 +132,7 @@
<?php } ?>

</table>
<!-- Return | Redirects the user to StudentEnrollment.php -->
<a href="StudentEnrollment.php" class="btn">Return</a>
</div>
</body>
Expand Down
24 changes: 21 additions & 3 deletions Landing.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Metadata, dimension and scaling -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Welcome -->
<title>Welcome</title>
<!-- Link to external style sheet -->
<link rel="stylesheet" href="styles.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;800&display=swap" rel="stylesheet">
</head>
<script>
<!-- Functions to open/closeStudentForm() and open/closeStaffForm() -->
function openStudentForm() {
document.getElementById("stuform").style.display = "flex";
}
Expand All @@ -25,42 +29,56 @@
}
</script>
<body>
<!-- Navigation section -->
<div class="navsection">
<div class="logo-container">
<!-- Embedded the image ustseal.png -->
<img src="images/ustseal.png" width="50px">
</div>
<ul>
<li>Notifications</li>
<li>Messages</li>
<!-- Student login button -->
<li><button onclick="openStudentForm()" class="loginbtn">Student Login</button></li>
<!-- Staff login button -->
<li><button onclick="openStaffForm()" class="loginbtn">Staff Login</button></li>
</ul>
</div>
<div class="mainsection">

<!-- Hyperlink to StudentAccountCreation.php -->
<a href="StudentAccountCreation.php" class="enroll-btn">Enroll_Now</a>
<!-- Hyperlink to StaffAccountCreation.php -->
<p class="staffcrt-btn">Staff member? Click <a href="StaffAccountCreation.php">here</a> for the staff portal.</p>

<!-- Student login form (Popup function) -->
<form method="POST" name="myForm" id="stuform" class="loginform">
<h2>Student Login</h2>
<!-- Student username -->
<label>Username: <input type="number" id="userName" name="userName" required></label>
<!-- Student password -->
<label>Password: <input type="password" id="passWord" name="passWord" required></label>
<div class="formBtns">
<!-- Cancel button | closeStudentForm() function -->
<button onClick="closeStudentForm()">Cancel</button>
<!-- Redirects the user to StudentHomePage.php, if the Student username and password is correct -->
<input formaction="StudentHomepage.php" type="submit">
</div>
</form>


<!-- Staff login form (Popup function) -->
<form method="POST" name="myForm" id="stafform" class="loginform">
<h2>Staff Login</h2>
<!-- Staff username -->
<label>Username: <input type="number" id="userName" name="userName" required></label>
<!-- Staff password -->
<label>Password: <input type="password" id="passWord" name="passWord" required></label>
<div class="formBtns">
<!-- Cancel button | closeStaffForm() function -->
<button onClick="closeStaffForm()">Cancel</button>
<!-- Redirects the user to StaffManagement.php, if the Staff username and password is correct -->
<input formaction="StaffManagement.php" type="submit">
</div>
</form>

</div>
</body>
</html>
16 changes: 16 additions & 0 deletions StaffAccountCreation.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
<?php
// Connecting to mySQL Server
$conn = new mysqli("localhost:3310", "root", "0413", "school");
if($conn -> connect_error) {
die ("Connect Error (".$conn->connect_Errorno.") ".$conn->connect_error);
}
// Select school.course table
$sql = "SELECT * FROM school.course";
$result = $conn -> query($sql);
// Close the database connection
$conn -> close();
?>

<!-- HTML -->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Metadata, dimension and scaling-->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Sign up -->
<title>Sign up</title>
<link rel="stylesheet" href="styles.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;800&display=swap" rel="stylesheet">
</head>
<script>
<!-- Functions to showDiv(select) -->
function showDiv(select) {
if(select.value == "1") {
document.getElementById('CS-Tracks').style.display = "block";
Expand All @@ -42,15 +49,20 @@ function showDiv(select) {
}
</script>
<body>
<!-- Navigation section -->
<div class="navsection">
<div class="logo-container">
<!-- Embedded the image ustseal.png -->
<img src="images/ustseal.png" width="50px">
</div>
</div>
<!-- Main section -->
<div class="mainsection">
<h1>Join the thomasian team!</h1>
<!-- Form -->
<form action="StaffManagement.php" method="POST">
<fieldset>
<!-- Personal Information -->
<legend>Enter your personal information: </legend>
<label>Personal Email: <input type="email" name="EMAIL" required></label>
<label>First Name: <input type="text" name="FNAME" required></label>
Expand All @@ -63,6 +75,7 @@ function showDiv(select) {
<label>Date of Birth: <input type="date" name="BDAY" required></label>
</fieldset>
<fieldset>
<!-- Assigned department -->
<legend>Select your assigned department: </legend>
<label>Department of: <select type="number" name="DEPT_ID" onchange="showDiv(this)" required>
<option value="">--Choose--</option>
Expand All @@ -72,10 +85,13 @@ function showDiv(select) {
</select></label>
</fieldset>
<fieldset>
<!-- Desired password -->
<legend>Enter your desired password:</legend>
<label>Password: <input type="password" name="PASSWORD" required></label>
</fieldset>
<!-- Message -->
<p class="staff-notif">After registration, kindly wait for our system administrators to validate your account.</p>
<!-- Proceed -->
<input type="submit" value="Proceed &#8594" class="btn">
</form>
</div>
Expand Down
11 changes: 11 additions & 0 deletions StaffManagement.php
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
<?php
// Connecting to mySQL Server
$conn = new mysqli("localhost:3310", "root", "0413", "school");
if($conn -> connect_error) {
die ("Connect Error (".$conn->connect_Errorno.") ".$conn->connect_error);
}
// Select schoolenrollment.students table
$sql = "SELECT * FROM schoolenrollment.Students";
$result = $conn -> query($sql);
// Close database connection
$conn -> close();
?>

<!-- HTML -->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Metadata, dimension and scaling -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Dashboard -->
<title>Dashboard</title>
<!-- Link to external style sheet -->
<link rel="stylesheet" href="styles.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;800&display=swap" rel="stylesheet">
</head>
<body>
<!-- Navigation section -->
<div class="navsection">
<div class="logo-container">
<!-- Embedded the image ustseal.png -->
<img src="images/ustseal.png" width="50px">
</div>
<ul>
<li>Notifications</li>
<li>Messages</li>
<!-- Log out -->
<li><a href="Landing.html">Logout</a></li>
</ul>
</div>
<!-- Main section -->
<div class="mainsection">
<h1>System Dashboard</h1>

Expand Down
Loading