-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetProjects4std.php
112 lines (91 loc) · 3.67 KB
/
getProjects4std.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php session_start(); ?>
<link rel="stylesheet" href="css/style.css" type="text/css" />
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<div class="admin_listTitle"></div>
<div class="scroll">
<center><?php include("includes/connection.php");
include("includes/functions.php");
?>
<?php
if(isset($_POST['where'])){
?>
<table cellpadding="8" cellspacing="5" border="1" id="tbl_adminlist" width="98%">
<tr>
<th width="5%">S/N</th><th width="10%">Matric No.</th><th width="50%">Project Tittle</th><th width="18%">Supervisor</th>
<th width="8%"> </th>
</tr>
<?php
$qr = "SELECT * FROM projects";
$sql = mysql_query($qr);
Confirm_query($sql,"fail to get list of projects", "");
while ($projectList = mysql_fetch_assoc($sql)){
$sn += 1;
?>
<tr>
<td align="center"><?php echo $sn; ?></td>
<td align="center"><?php echo $projectList['MatricNo'];?></td>
<td align="center"><?php echo $projectList['ProjectTittle'];?></td>
<td align="center"><?php echo $projectList['ProjectSupervisor']; ?></td>
<td><a href="student.php/projects/<?php echo $projectList['ProjectMain']; ?>" data-page="" class="details">Download</a></td>
</tr>
<?php } ?>
</table>
<?php
}
elseif (isset($_POST['title']))
{
?>
<table cellpadding="8" cellspacing="5" border="1" id="tbl_adminlist" width="98%">
<tr>
<th width="5%">S/N</th><th width="10%">Matric No.</th><th width="50%">Project Tittle</th><th width="18%">Supervisor</th>
<th width="8%"> </th>
</tr>
<?php
$titl = $_POST['title'];
$qr = "SELECT * FROM projects WHERE ProjectTittle LIKE '%$titl%'";
$sql = mysql_query($qr);
Confirm_query($sql,"fail to get list of projects", "");
while ($projectList = mysql_fetch_assoc($sql)){
$sn += 1;
?>
<tr>
<td align="center"><?php echo $sn; ?></td>
<td align="center"><?php echo $projectList['MatricNo'];?></td>
<td align="center"><?php echo $projectList['ProjectTittle'];?></td>
<td align="center"><?php echo $projectList['ProjectSupervisor']; ?></td>
<td><a href="student.php/projects/<?php echo $projectList['ProjectMain']; ?>" data-page="" class="details">Download</a></td>
</tr>
<?php } ?>
</table>
<?php
}
elseif (isset($_POST['obj']))
{
?>
<table cellpadding="8" cellspacing="5" border="1" id="tbl_adminlist" width="98%">
<tr>
<th width="5%">S/N</th><th width="10%">Matric No.</th><th width="50%">Project Tittle</th><th width="18%">Supervisor</th>
<th width="8%"> </th>
</tr>
<?php
$department = $_POST['obj'];
$qr = "SELECT * FROM projects WHERE Department = '$department'";
$sql = mysql_query($qr);
Confirm_query($sql,"fail to get list of projects", "");
while ($projectList = mysql_fetch_assoc($sql)){
$sn += 1;
?>
<tr>
<td align="center"><?php echo $sn; ?></td>
<td align="center"><?php echo $projectList['MatricNo'];?></td>
<td align="center"><?php echo $projectList['ProjectTittle'];?></td>
<td align="center"><?php echo $projectList['ProjectSupervisor']; ?></td>
<td><a href="student.php/projects/<?php echo $projectList['ProjectMain']; ?>" data-page="" class="details">Download</a></td>
</tr>
<?php } ?>
</table>
<?php
}
?>
</center></div>