diff --git a/db.sql b/db.sql
index c8cbfb6d..4fdfaddd 100644
--- a/db.sql
+++ b/db.sql
@@ -903,6 +903,7 @@ DROP TABLE IF EXISTS `tags`;
CREATE TABLE `tags` (
`tag_id` int(11) NOT NULL AUTO_INCREMENT,
`tag_name` varchar(200) NOT NULL,
+ `tag_type` int(11) NOT NULL,
`tag_color` varchar(200) DEFAULT NULL,
`tag_icon` varchar(200) DEFAULT NULL,
`tag_created_at` datetime NOT NULL,
@@ -1152,4 +1153,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2021-12-27 11:38:55
+-- Dump completed on 2021-12-27 12:04:12
diff --git a/edit_client_modal.php b/edit_client_modal.php
index 6cd52045..200c7543 100644
--- a/edit_client_modal.php
+++ b/edit_client_modal.php
@@ -259,7 +259,7 @@
Name *
+
+
diff --git a/post.php b/post.php
index d6567110..d900d882 100644
--- a/post.php
+++ b/post.php
@@ -893,6 +893,9 @@ if(isset($_GET['update_db'])){
mysqli_query($mysqli,"ALTER TABLE clients DROP client_support");
mysqli_query($mysqli,"ALTER TABLE tags DROP tag_archived_at");
+ //Update 2
+ mysqli_query($mysqli,"ALTER TABLE tags ADD tag_type INT(11) AFTER tag_name");
+
$_SESSION['alert_message'] = "Update Successful Database Structure Update Successful!";
header("Location: " . $_SERVER["HTTP_REFERER"]);
@@ -1800,10 +1803,11 @@ if(isset($_GET['delete_category'])){
if(isset($_POST['add_tag'])){
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
+ $type = intval($_POST['type']);
$color = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['color'])));
$icon = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['icon'])));
- mysqli_query($mysqli,"INSERT INTO tags SET tag_name = '$name', tag_color = '$color', tag_icon = '$icon', tag_created_at = NOW(), company_id = $session_company_id");
+ mysqli_query($mysqli,"INSERT INTO tags SET tag_name = '$name', tag_type = $type, tag_color = '$color', tag_icon = '$icon', tag_created_at = NOW(), company_id = $session_company_id");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Tag', log_action = 'Created', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, log_user_id = $session_user_id");
@@ -1818,10 +1822,11 @@ if(isset($_POST['edit_tag'])){
$tag_id = intval($_POST['tag_id']);
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
+ $type = intval($_POST['type']);
$color = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['color'])));
$icon = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['icon'])));
- mysqli_query($mysqli,"UPDATE tags SET tag_name = '$name', tag_color = '$color', tag_icon = '$icon', tag_updated_at = NOW() WHERE tag_id = $tag_id AND company_id = $session_company_id");
+ mysqli_query($mysqli,"UPDATE tags SET tag_name = '$name', tag_type = $type, tag_color = '$color', tag_icon = '$icon', tag_updated_at = NOW() WHERE tag_id = $tag_id AND company_id = $session_company_id");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Tag', log_action = 'Modified', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, log_user_id = $session_user_id");
diff --git a/tags.php b/tags.php
index 46423eac..8cdc404f 100644
--- a/tags.php
+++ b/tags.php
@@ -96,6 +96,7 @@ $colors_diff = array_diff($colors_array,$colors_used_array);
">
| Name |
+ Type |
Color |
Action |
@@ -106,12 +107,14 @@ $colors_diff = array_diff($colors_array,$colors_used_array);
while($row = mysqli_fetch_array($sql)){
$tag_id = $row['tag_id'];
$tag_name = $row['tag_name'];
+ $tag_type = $row['tag_type'];
$tag_color = $row['tag_color'];
$tag_icon = $row['tag_icon'];
?>
| "; ?> |
+ |
|
|