-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewassgn.php
44 lines (44 loc) · 1.64 KB
/
newassgn.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
$title = "New Assignments";
require_once './includes/header.php';
require_once './db/conn.php';
require_once './includes/admin_check.php';
if (isset($_POST['submit'])) {
$course = $_POST['Course'];
$maxmarks = $_POST['mm'];
$lastdate = $_POST['lastdate'];
$sub_res = $crud->insertAssgn($course,$lastdate,$maxmarks);
if ($sub_res) {
include './includes/successmessage.php';
}
else {
include './includes/errormessage.php';
}
}
$results = $crud->getCourses();
?>
<h1 class="text-center">Create Assignment</h1>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" enctype="multipart/form-data" autocomplete="off">
<div class="mb-3">
<label for="Course" class="form-label">Select Course</label>
<select id="Course" name="Course" class="form-select">
<?php while($r = $results->fetch(PDO::FETCH_ASSOC)) {?>
<option value="<?php echo $r['course_id'] ?>"><?php echo $r['name']; ?></option>
<?php }?>
</select>
</div>
<div class="mb-3">
<label for="mm" class="form-label">Max Marks</label>
<input required type="number" class="form-control" id="mm" name="mm">
</div>
<div class="mb-3">
<label for="lastdate" class="form-label">Last Date to Submit</label>
<input required type="text" class="form-control" id="lastdate" name="lastdate">
</div>
<div class="py-3">
<button type="submit" name="submit" class="btn btn-primary">Submit</button>
</div>
</form>
<?php
require './includes/footer.php'
?>