This repository has been archived by the owner on Sep 4, 2021. It is now read-only.
/
raters.php
56 lines (51 loc) · 1.45 KB
/
raters.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
<?php
include_once 'dbh.php';
include_once 'header.php';
include_once 'controls.php';
$sqlget = "SELECT * FROM $project_name.rater";
$sqldata = pg_query($conn, $sqlget) or die('error getting data');
echo "
<table class='wrapper'>
<thead>
<tr>
<th>Username</th>
<th>First Name</th>
<th>Last Name</th>
<th>Email Address</th>
<th>User type</th>
<th>Reputation</th>
<th>Join-date</th>
<th>Controls</th>
</tr>
</thead>
<tbody>
";
while($row = pg_fetch_array($sqldata, NULL, PGSQL_ASSOC)){ // fetches the data row by row
echo "<tr><td>";
if (isset($_SESSION['u_id'])){
echo "<a href='profile.php?userid=".$row['userid']."&useridloggedin=".$_SESSION['u_id']."'>$row[username] </a>";
} else {
echo "<a href='profile.php?userid=".$row['userid']."&useridloggedin=0'>$row[username] </a>";
}
echo "</td><td>";
echo $row['firstname'];
echo "</td><td>";
echo $row['lastname'];
echo "</td><td>";
echo $row['emailaddress'];
echo "</td><td>";
echo $row['usertype'];
echo "</td><td>";
echo $row['reputation'];
echo "</td><td>";
echo $row['joindate'];
echo "</td><td>";
if (isset($_SESSION['u_id'])){
echo "<form action='includes/deleteUser.php' method=POST>";
echo "<input type=hidden name=hidden value='" . $row['userid'] . "' </td>";
echo "<input type=submit name=delete value=delete>";
echo "</form>";
}
echo "</td></tr>";
}
echo "</tbody></table>";