diff --git a/admin/modals/tag/tag_edit.php b/admin/modals/tag/tag_edit.php index bfd49962..312244b4 100644 --- a/admin/modals/tag/tag_edit.php +++ b/admin/modals/tag/tag_edit.php @@ -12,11 +12,24 @@ $tag_type = intval($row['tag_type']); $tag_color = nullable_htmlentities($row['tag_color']); $tag_icon = nullable_htmlentities($row['tag_icon']); -// Generate the HTML form content using output buffering. +if ($tag_type == 1) { + $tag_type_display = "Client"; +} elseif ( $tag_type == 2) { + $tag_type_display = "Location"; +} elseif ( $tag_type == 3) { + $tag_type_display = "Contact"; +} elseif ( $tag_type == 4) { + $tag_type_display = "Credential"; + } elseif ( $tag_type == 5) { + $tag_type_display = "Asset"; +} else { + $tag_type_display = "Unknown"; +} + ob_start(); ?> -
- -
-
- -
- -
-
-
diff --git a/admin/post/tag.php b/admin/post/tag.php index 4911b57e..815a614c 100644 --- a/admin/post/tag.php +++ b/admin/post/tag.php @@ -28,7 +28,7 @@ if (isset($_POST['edit_tag'])) { $tag_id = intval($_POST['tag_id']); - mysqli_query($mysqli,"UPDATE tags SET tag_name = '$name', tag_type = $type, tag_color = '$color', tag_icon = '$icon' WHERE tag_id = $tag_id"); + mysqli_query($mysqli,"UPDATE tags SET tag_name = '$name', tag_color = '$color', tag_icon = '$icon' WHERE tag_id = $tag_id"); logAction("Tag", "Edit", "$session_name edited tag $name", 0, $tag_id); diff --git a/admin/tag.php b/admin/tag.php index 773a9db6..bce8559c 100644 --- a/admin/tag.php +++ b/admin/tag.php @@ -12,6 +12,20 @@ if (isset($_GET['type'])) { $type_filter = 1; } +if ($type_filter == 1) { + $tag_type_display = "Client"; +} elseif ( $type_filter == 2) { + $tag_type_display = "Location"; +} elseif ( $type_filter == 3) { + $tag_type_display = "Contact"; +} elseif ( $type_filter == 4) { + $tag_type_display = "Credential"; + } elseif ( $type_filter == 5) { + $tag_type_display = "Asset"; +} else { + $tag_type_display = "Unknown"; +} + $sql = mysqli_query( $mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM tags @@ -26,9 +40,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-

Tags

+

Tags

- +
@@ -37,7 +51,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
- +
@@ -76,7 +90,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); } else { echo 'btn-default'; } ?>">Asset - - - - Type - - Action @@ -111,20 +120,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); while ($row = mysqli_fetch_array($sql)) { $tag_id = intval($row['tag_id']); $tag_name = nullable_htmlentities($row['tag_name']); - $tag_type = intval($row['tag_type']); - if ( $tag_type == 1) { - $tag_type_display = "Client Tag"; - } elseif ( $tag_type == 2) { - $tag_type_display = "Location Tag"; - } elseif ( $tag_type == 3) { - $tag_type_display = "Contact Tag"; - } elseif ( $tag_type == 4) { - $tag_type_display = "Credential Tag"; - } elseif ( $tag_type == 5) { - $tag_type_display = "Asset Tag"; - } else { - $tag_type_display = "Unknown Tag"; - } $tag_color = nullable_htmlentities($row['tag_color']); $tag_icon = nullable_htmlentities($row['tag_icon']); @@ -136,7 +131,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); - - +