-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-SQL commands are updated in Database Design folder.(Alpha1)
- Loading branch information
Showing
11 changed files
with
679 additions
and
134 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
Binary file modified
BIN
+0 Bytes
(100%)
assets/Database_Design/SQL Commands/3.SQL Commands for (Alpha 1).jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,25 @@ | ||
<?php | ||
|
||
function validationHelper() | ||
{ | ||
if (strlen($_POST['Course_Code']) < 1 || strlen($_POST['Course_Name']) < 1 || strlen($_POST['Title']) < 1 || | ||
strlen($_POST['Batch']) < 1 || strlen($_POST['Section']) < 1) { | ||
$_SESSION['status'] = "All fields are required"; | ||
return false; | ||
} | ||
|
||
for ($i = 1; $i <= 9; $i++) { | ||
|
||
if (!isset($_POST['Question' . $i])) { | ||
continue; | ||
} | ||
|
||
$Question = htmlentities($_POST['Question' . $i]); | ||
|
||
if (strlen($Question) < 1) { | ||
$_SESSION['status'] = "All fields are required"; | ||
return false; | ||
} | ||
} | ||
return true; | ||
} |
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,59 @@ | ||
<?php | ||
|
||
session_start(); | ||
require_once "assets/connect/pdo.php"; | ||
|
||
if (isset($_POST['Delete']) && isset($_POST['Question_Description_ID'])) { | ||
echo 23132; | ||
$sql = "DELETE FROM question_description WHERE Question_Description_ID = :zip"; | ||
$stmt = $pdo->prepare($sql); | ||
$stmt->execute(array(':zip' => $_POST['Question_Description_ID'])); | ||
$_SESSION['success'] = 'Record deleted'; | ||
header('Location: teacher_dashboard.php'); | ||
return; | ||
} | ||
|
||
// Guardian: Make sure that user_id is present | ||
if (!isset($_GET['Question_Description_ID'])) { | ||
$_SESSION['error'] = "Missing user_id"; | ||
header('Location: teacher_dashboard.php'); | ||
return; | ||
} | ||
|
||
$stmt = $pdo->prepare("SELECT Course_Code, Course_Name FROM question_description where Question_Description_ID = :xyz"); | ||
$stmt->execute(array(":xyz" => $_GET['Question_Description_ID'])); | ||
$row = $stmt->fetch(PDO::FETCH_ASSOC); | ||
if ($row === false) { | ||
$_SESSION['error'] = 'Bad value for Question Description ID'; | ||
header('Location: teacher_dashboard.php'); | ||
return; | ||
} | ||
?> | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<?php | ||
require_once 'assets/connect/head.php'; | ||
?> | ||
</head> | ||
<header> | ||
<nav class="navbar navbar-expand-lg navbar-light sticky-top"> | ||
<a class="navbar-brand" href="#">LU EXAM HIVE</a> | ||
<button type="button" class="btn btn-sm btn-dark rounded-0 ml-3"> | ||
<a href="teacher_dashboard.php" class="text-white text-decoration-none">Back</a> | ||
</nav> | ||
|
||
</header> | ||
<body> | ||
<div class="container"> | ||
<p>Course Code: <?php echo ($row['Course_Code']); ?></p> | ||
<p>Course Name: <?php echo ($row['Course_Name']); ?></p> | ||
<form method="post"><input type="hidden" name="Question_Description_ID" value="<?php echo $_GET['Question_Description_ID'] ?>"> | ||
<input type="submit" name="Delete" value="Delete"> | ||
</form> | ||
</div> | ||
<?php | ||
require_once 'assets/connect/footer.php'; | ||
?> | ||
</body> |
Oops, something went wrong.