-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtable_output.inc.php
More file actions
69 lines (67 loc) · 2.24 KB
/
table_output.inc.php
File metadata and controls
69 lines (67 loc) · 2.24 KB
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
<table class="screenFile">
<tr>
<th>Date</th>
<th>Number</th>
<th>Name</th>
<th>References</th>
<th>Notes</th>
<th colspan="3">Modify</th>
</tr>
<?php foreach ($conn->query($getDetails)as $row) { //retrieve screen data from db in tables?>
<?php
//variables allow user to edit and delete if logged in as admin
if (isset($_SESSION['userok']) && isset($_SESSION['passwdok'])) {
$editlink ="<a href='update_pdo.php?screen_id=".$row['screen_id'].";'>EDIT</a>";
$deletelink="<a href='delete_pdo.php?screen_id=".$row['screen_id'].";'>DELETE</a>";
}
else {
$editlink = "<span class='na'>EDIT</span>";
$deletelink = "<span class='na'>DELETE</span>";
}
?>
<tr>
<td><?php echo $row['screen_date']; ?></td>
<td><?php echo $row['screen_number']; ?></td>
<td><?php echo $row['screen_name']; ?></td>
<td><?php echo $row['screen_refs']; ?></td>
<td><?php echo $row['screen_notes']; ?></td>
<td><?php echo $editlink; ?></td>
<td><?php echo $deletelink; ?></td>
<td><a href="renew_pdo.php?screen_id=<?php echo $row['screen_id']; ?>">RENEW</a></td>
</tr>
<?php } ?>
<!-- Navigation link here -->
<tr class = "navlink">
<td class = "navlink"><?php
// create a back link if current page greater than 0
if ($curPage > 0) {
echo '<a href="'.$_SERVER['PHP_SELF'].'?curPage='.($curPage-1).'">< Prev</a>';
}
// otherwise leave the cell empty
else {
echo ' ';
}
?>
</td>
<?php
// pad the final row with empty cells if more than 2 columns
if (COLS-2 > 0) {
for ($i = 0; $i < COLS-2; $i++) {
echo '<td> </td>';
}
}
?>
<td class = "navlink">
<?php
// create a forwards link if more records exist
if ($startRow+SHOWMAX < $totalResults) {
echo '<a href="'.$_SERVER['PHP_SELF'].'?curPage='.($curPage+1).'">Next ></a>';
}
// otherwise leave the cell empty
else {
echo ' ';
}
?>
</td>
</tr>
</table>