-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtopics.php
More file actions
81 lines (63 loc) · 2.2 KB
/
topics.php
File metadata and controls
81 lines (63 loc) · 2.2 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
70
71
72
73
74
75
76
77
78
79
80
81
<?php
include( 'includes/database.php' );
include( 'includes/config.php' );
include( 'includes/functions.php' );
secure();
include( 'includes/header.php' );
if( isset( $_GET['delete'] ) )
{
$query = 'DELETE FROM topics
WHERE id = '.$_GET['delete'].'
LIMIT 1';
mysqli_query( $connect, $query );
set_message( 'Topic has been deleted' );
header( 'Location: topics.php' );
die();
}
$query = 'SELECT *
FROM topics
ORDER BY name';
$result = mysqli_query( $connect, $query );
include 'includes/wideimage/WideImage.php';
?>
<h2>Manage Topics</h2>
<table>
<tr>
<th></th>
<th></th>
<th align="center">ID</th>
<th align="left">Name</th>
<th align="left">URL</th>
<th align="center">Tag</th>
<th align="center">Teaching</th>
<th></th>
<th></th>
<th></th>
</tr>
<?php while( $record = mysqli_fetch_assoc( $result ) ): ?>
<tr>
<td align="center">
<img src="image.php?type=topics&id=<?php echo $record['id']; ?>&width=100&height=100&format=inside">
</td>
<td align="center">
<?php if($record['icon']): ?>
<i class="<?php echo $record['icon']; ?> fa-3x"></i>
<?php endif; ?>
</td>
<td align="center"><?php echo $record['id']; ?></td>
<td align="left"><?php echo htmlentities( $record['name'] ); ?></td>
<td align="left"><a href="<?php echo htmlentities( $record['url'] ); ?>"><?php echo htmlentities( $record['url'] ); ?></a></td>
<td align="center"><?php echo htmlentities( $record['tag'] ); ?></td>
<td align="center"><?php echo $record['teaching']; ?></td>
<td align="center"><a href="topics_photo.php?id=<?php echo $record['id']; ?>"><i class="fas fa-camera"></i></a></td>
<td align="center"><a href="topics_edit.php?id=<?php echo $record['id']; ?>"><i class="fas fa-edit"></i></a></td>
<td align="center">
<a href="topics.php?delete=<?php echo $record['id']; ?>" onclick="javascript:confirm('Are you sure you want to delete this topic?');"><i class="fas fa-trash-alt"></i></a>
</td>
</tr>
<?php endwhile; ?>
</table>
<p><a href="topics_add.php"><i class="fas fa-plus-square"></i> Add Topic</a></p>
<?php
include( 'includes/footer.php' );
?>