-
Notifications
You must be signed in to change notification settings - Fork 152
/
Copy pathcreate-category.php
89 lines (73 loc) · 3.67 KB
/
create-category.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
session_start();
define('TITLE',"Create Category | KLiK");
if(!isset($_SESSION['userId']))
{
header("Location: login.php");
exit();
}
include 'includes/HTML-head.php';
?>
<link rel="stylesheet" type="text/css" href="css/comp-creation.css">
</head>
<body>
<?php include 'includes/navbar.php'; ?>
<div class="bg-contact2" style="background-image: url('img/black-bg.jpg');">
<div class="container-contact2">
<div class="wrap-contact2">
<form class="contact2-form" method="post" action="includes/create-category.inc.php">
<span class="contact2-form-title">
Create Category
</span>
<span class="text-center">
<?php
if(isset($_GET['error']))
{
if($_GET['error'] == 'emptyfields')
{
echo '<h5 class="text-danger">*Fill In All The Fields</h5>';
}
else if ($_GET['error'] == 'catnametaken')
{
echo '<h5 class="text-danger">*A category with the given name already exists</h5>';
}
else if ($_GET['error'] == 'sqlerror')
{
echo '<h5 class="text-danger">*Website Error: Contact admin to have the issue fixed</h5>';
}
}
else if (isset($_GET['catcreation']) == 'success')
{
echo '<h5 class="text-success">*Category successfully created</h5>';
}
?>
</span>
<div class="wrap-input2 validate-input" data-validate="Name is required">
<input class="input2" type="text" name="cat_name">
<span class="focus-input2" data-placeholder="Category Name"></span>
</div>
<div class="wrap-input2 validate-input" data-validate = "Description is required">
<textarea class="input2" name="cat_description"></textarea>
<span class="focus-input2" data-placeholder="Category Description"></span>
</div>
<div class="container-contact2-form-btn">
<div class="wrap-contact2-form-btn">
<div class="contact2-form-bgbtn"></div>
<button class="contact2-form-btn" type="submit" name="create-cat">
Add Category
</button>
</div>
</div>
<div class="text-center">
<br><br><a class="btn btn-light btn-lg btn-block" href="categories.php">
View Categories</a>
</div>
</form>
</div>
</div>
</div>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/creation-main.js"></script>
</body>
</html>