-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_categories.php
47 lines (42 loc) · 1.25 KB
/
view_categories.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
<?php
$title = "Categories";
include 'config/config.php';
include 'templates/header.php';
require 'classes/GetCategories.php';
?>
<div class="container">
<?php
if (isset($_GET['id'])) {
$id = $_GET['id'];
?>
<h2>You just added a new Category - ID: <?php echo $id; ?></h2>
<button type="button" class="btn btn-success btn-lg" onclick="window.location.href = 'add_categories.php';">Add more categories</button>
<button type="button" class="btn btn-info btn-lg" onclick="window.location.href = 'view_categories.php';">View all category</button>
<div class="row">
<div class="col">
<?php
$init = new GetCategories;
$init->individual($id);
?>
</div>
</div>
<?php
} else {
?>
<h2>Categories - ALL</h2>
<button type="button" class="btn btn-success btn-lg" onclick="window.location.href = 'add_categories.php';">Add Category</button>
<div class="row">
<div class="col">
<?php
$init = new GetCategories;
$init->all();
?>
</div>
</div>
<?php
}
?>
</div>
<?php
include 'templates/footer.php';
?>