-
Notifications
You must be signed in to change notification settings - Fork 0
/
assignment(1).php
71 lines (63 loc) · 2.28 KB
/
assignment(1).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
<?php
include 'header.php';
include 'sidebar.php';
include 'subheader.php';
if(isset($_POST['file_name'])){
$file = $_POST['file_name'];//add your own validation here.
header("Content-Type: images/png; ");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ". filesize($filename).";");
header("Content-disposition: attachment; filename=" . $filename);
readfile($filename);
exit();
}
$assignmentRecord = $connect->prepare("SELECT * From assignments_record ");
$assignmentRecord->execute();
$assignments = $assignmentRecord->fetchAll();
?>
<div id="page-wrapper">
<div class="main-page">
<div class="tables">
<h2 class="title1">Assignment Records</h2>
<div class="panel-body widget-shadow">
<h4>Year: <?php echo '2018' ?> </h4>
<table class="table">
<thead>
<tr>
<th>ID</th>
<th>Module Code</th>
<th>Title</th>
<th>File</th>
<th>Document Name</th>
<th>Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
if(count($assignments) > 0){
foreach ($assignments as $assignment) {
echo '<tr>';
echo '<th scope="row">'.$assignment['id'].'</th>';
echo '<th>'.$assignment['module_code'].'</th>';
echo '<th>'.$assignment['title'].'</th>';
echo '<th>'."<a href='assignment.php?id=".$assignment['file']."'>Download</a>".'</th>';
echo '<th>'.$assignment['document_name'].'</th>';
echo '<th>'.$assignment['date'].'</th>';
echo '<th>'."<a href='editassignment.php?id=".$assignment['id']."'>Edit</a>".'</th>';
echo '<th>'."<a href='deleteassignment.php?id=".$assignment['id']."'>Delete</a>".'</th>';
echo'</tr>';
}
}
else{
echo ' No Assignments Found';
}
?>
</tbody>
</table>
</div>
<a href="addassignment.php"><button style="margin: 25px;height: 50px;width: 170px">Add More Assignment</button></a>
</div>
</div>
</div>
<?php include 'footer.php'; ?>