-
Notifications
You must be signed in to change notification settings - Fork 0
/
assignments.php
84 lines (72 loc) · 2.68 KB
/
assignments.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html>
<head>
<title>Students Space</title>
<?php include 'head.php'; ?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
<body>
<?php include 'header.php'; ?>
<div class="container">
<div class="row justify-content-center mb-4 mt-4">
<div class="col-md-6">
<form method="post">
<div class="input-group">
<select name="sclassname" class="form-control">
<?php
$q = mysqli_query($con, "select * from tblassignments");
$i = 0;
while ($r = mysqli_fetch_array($q)) {
$i++;
?>
<option value="<?php echo $r["solutionsid"]; ?>" <?php if ($i == 1) {
echo "selected";
} ?>><?php echo $r["sclassname"]; ?> : <?php echo $r["ssubname"]; ?></option>
<?php
}
?>
</select>
<div class="input-group-append">
<button class="btn btn-success" type="submit" name="btnsearchbycategory">Search By Assignments</button>
</div>
</div>
</form>
</div>
</div>
</div>
<?php
$query = "select * from tblassignments LIMIT 1";
if (isset($_POST["btnsearchbycategory"])) {
extract($_POST);
if ($sclassname != 0) {
$query = "select * from tblassignments where solutionsid = '" . $sclassname . "'";
}
}
?>
<div class="container-lg">
<div class="row">
<?php
$result = mysqli_query($con, $query);
while ($row = mysqli_fetch_assoc($result)) {
$filepath = $row['solutions'];
?>
<div class="col-md-12 mt-3">
<div class="card mb-4">
<div class="card-body">
<h5 class="card-title" style="text-align: center;"><?php echo $row['sclassname']; ?></h5>
<h6 class="card-subtitle mb-2 text-muted" style="text-align: center;"><?php echo $row['ssubname']; ?></h6>
<div class="embed-responsive embed-responsive-16by9">
<embed class="embed-responsive-item" src="admin/<?php echo $row['solutions']; ?>" type="application/pdf" style="object-fit: contain; width: 100%; height: 100%;" />
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
<?php include 'footer.php'; ?>
</body>
</html>