-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtopics_list.php
More file actions
157 lines (138 loc) · 5.07 KB
/
topics_list.php
File metadata and controls
157 lines (138 loc) · 5.07 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php
require 'bin/functions.php';
require 'db_configuration.php';
$query = "SELECT * FROM topics";
$GLOBALS['data'] = mysqli_query($db, $query);
// $GLOBALS['topic'] = mysqli_query($db, $query);
// $GLOBALS['image_name'] = mysqli_query($db, $query);
?>
<?php $page_title = 'Topic List'; ?>
<?php include('header.php'); ?>
<style>
#title {
text-align: center;
color: darkgoldenrod;
}
thead input {
width: 100%;
}
.thumbnailSize{
height: 100px;
width: 100px;
transition:transform 0.25s ease;
}
.thumbnailSize:hover {
-webkit-transform:scale(3.5);
transform:scale(3.5);
}
</style>
<!-- Page Content -->
<br><br>
<div class="container-fluid">
<?php
if(isset($_GET['createQuestion'])){
if($_GET["createQuestion"] == "Success"){
echo '<br><h3>Success! Your question has been added!</h3>';
}
}
if(isset($_GET['questionUpdated'])){
if($_GET["questionUpdated"] == "Success"){
echo '<br><h3>Success! Your question has been modified!</h3>';
}
}
if(isset($_GET['questionDeleted'])){
if($_GET["questionDeleted"] == "Success"){
echo '<br><h3>Success! Your question has been deleted!</h3>';
}
}
if(isset($_GET['createTopic'])){
if($_GET["createTopic"] == "Success"){
echo '<br><h3>Success! Your topic has been added!</h3>';
}
}
?>
<!-- Page Heading -->
<h1 class="my-4">
<?php
//Display Admin view if an admin is logged in.
//This gives full access to all CRUD functions
?>
</h1>
<div id="customerTableView">
<button><a class="btn btn-sm" href="createTopic.php">Create a Topic</a></button>
<table class="table table-striped" id="ceremoniesTable">
<div class="table responsive">
<thead>
<tr>
<th>ID</th>
<th>Topic</th>
<th>Image Name</th>
<th>Modify Topic</th>
<th>Delete Topic</th>
</tr>
</thead>
<tbody>
<?php
if ($data->num_rows > 0) {
// output data of each row
while($row = $data->fetch_assoc()) {
echo '<tr>
<td>'.$row["order"].' </td>
<td>'.$row["topic"].' </span> </td>
<td><img class="thumbnailSize" src="'.'Images/index_images/'.$row["image_name"].'" alt="'.$row["image_name"].'"></td>
<td><a class="btn btn-warning btn-sm" href="modifyTopic.php?topic='.$row["topic"].'">Modify</a></td>
<td><a class="btn btn-danger btn-sm" href="deleteTopic.php?topic='.$row["topic"].'">Delete</a></td>
</tr>';
}//end while
}//end if
else {
echo "0 results";
}//end else
?>
</tbody>
</div>
</table>
</div>
</div>
<!-- /.container -->
<!-- Footer -->
<footer class="page-footer text-center">
<p>Created for ICS 499 Summer Project "Team Bears"</p>
</footer>
<!--JQuery-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!--Data Table-->
<script type="text/javascript" charset="utf8"
src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf8"
src="https://cdn.datatables.net/buttons/1.5.2/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" charset="utf8"
src="https://cdn.datatables.net/buttons/1.5.2/js/buttons.flash.min.js"></script>
<script type="text/javascript" charset="utf8"
src="https://cdn.datatables.net/buttons/1.5.2/js/buttons.html5.min.js"></script>
<script type="text/javascript" charset="utf8"
src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script type="text/javascript" charset="utf8"
src="https://cdn.datatables.net/buttons/1.5.2/js/buttons.flash.min.js"></script>
<script type="text/javascript" charset="utf8"
src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js"></script>
<script type="text/javascript" charset="utf8"
src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready( function () {
$('#tableResults').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy', 'excel', 'csv' , 'pdf'
] }
);
$('#ceremoniesTable').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy', 'excel', 'csv', 'pdf'
] }
);
} );
</script>
</body>
</html>