-
Notifications
You must be signed in to change notification settings - Fork 0
/
view.php
71 lines (70 loc) · 2.12 KB
/
view.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>File Upload</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/addNewItem.css" rel="stylesheet">
<link href="css/common.css" rel="stylesheet">
</head>
<body>
<?php
include_once('navbar.php');
?>
<div class="headerAddNewItem" align="center">
<h2>Collection of Items</h2>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<a class="marginLink btn btn-success" href="/thaisuWeb/index.php"><span class="glyphicon glyphicon-plus"></span> Add New Item</a>
<table class="table table-inverse" >
<thead class="theadd-inverse">
<tr class="card">
<td>Image</td>
<td>Title Name</td>
<td>Category</td>
<td>Edit/Delete</td>
</tr>
</thead>
<?php
include 'session.php';
$sql = "SELECT * FROM output_images
WHERE category <> 'aboutus'
AND category <> 'service'
AND category <> 'caurosal1'
AND category <> 'caurosal2'
AND category <> 'caurosal3'
AND category <> 'news1'
AND category <> 'news2'
AND category <> 'news3'
ORDER BY imageId DESC";
$result_set = $db->query($sql);
$counts = ($result_set->rowCount() >0 ) ? true : false;
if($counts){
while($row = $result_set->fetch(PDO::FETCH_ASSOC))
{
?>
<tr class="card">
<td><img src="imageView.php?image_id=<?php echo $row["imageId"]; ?>" width="100" height="100" /></td>
<td><?php echo $row["name"]; ?></td>
<td><?php echo $row["category"]; ?></td>
<td>
<a class="btn btn-primary" href="editProducts.php?id=<?php echo $row["imageId"]; ?>" >Edit</a>
<a class="btn btn-danger" href="delete.php?id=<?php echo $row["imageId"]; ?>" onclick="return confirm('Are you sure?')" >Delete</a>
</td>
</tr>
<?php
}
}
?>
</table>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>