client tag cleanup in add and edit modal

This commit is contained in:
johnnyq 2023-08-16 13:56:35 -04:00
parent 514b5348cb
commit 86c36e08ab
3 changed files with 17 additions and 8 deletions

View File

@ -298,7 +298,13 @@
$tag_id_select = intval($row['tag_id']);
$tag_name_select = nullable_htmlentities($row['tag_name']);
$tag_color_select = nullable_htmlentities($row['tag_color']);
if (empty($tag_color_select)) {
$tag_color_select = "dark";
}
$tag_icon_select = nullable_htmlentities($row['tag_icon']);
if (empty($tag_icon_select)) {
$tag_icon_select = "tag";
}
?>
<li class="list-group-item">
@ -306,7 +312,7 @@
<input class="custom-control-input" type="checkbox" id="tagCheckbox<?php echo $tag_id_select; ?>" name="tags[]" value="<?php echo $tag_id_select; ?>">
<label for="tagCheckbox<?php echo $tag_id_select; ?>" class="custom-control-label">
<span class="badge bg-<?php echo $tag_color_select; ?>">
<?php echo "<i class='fa fw fa-$tag_icon_select'></i>"; ?> <?php echo $tag_name_select; ?>
<?php echo "<i class='fa fw fa-$tag_icon_select mr-2'></i>"; ?><?php echo $tag_name_select; ?>
</span>
</label>
</div>

View File

@ -164,7 +164,13 @@
$tag_id_select = intval($row['tag_id']);
$tag_name_select = nullable_htmlentities($row['tag_name']);
$tag_color_select = nullable_htmlentities($row['tag_color']);
if (empty($tag_color_select)) {
$tag_color_select = "dark";
}
$tag_icon_select = nullable_htmlentities($row['tag_icon']);
if (empty($tag_icon_select)) {
$tag_icon_select = "tag";
}
?>
<li class="list-group-item">
@ -172,7 +178,7 @@
<input class="custom-control-input" type="checkbox" id="tagCheckbox<?php echo "$tag_id_select$client_id"; ?>" name="tags[]" value="<?php echo $tag_id_select; ?>" <?php if (in_array($tag_id_select, $client_tag_id_array)) { echo "checked"; } ?>>
<label for="tagCheckbox<?php echo "$tag_id_select$client_id"; ?>" class="custom-control-label">
<span class="badge bg-<?php echo $tag_color_select; ?>">
<?php echo "<i class='fa fw fa-$tag_icon_select'></i>"; ?> <?php echo $tag_name_select; ?>
<?php echo "<i class='fa fw fa-$tag_icon_select mr-2'></i>"; ?><?php echo $tag_name_select; ?>
</span>
</label>
</div>

View File

@ -153,18 +153,15 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
$client_tag_id = intval($row['tag_id']);
$client_tag_name = nullable_htmlentities($row['tag_name']);
$client_tag_color = nullable_htmlentities($row['tag_color']);
if (empty($client_tag_color)) {
$client_tag_color = "dark";
}
$client_tag_icon = nullable_htmlentities($row['tag_icon']);
if (empty($client_tag_icon)) {
$client_tag_icon = "tag";
}
$client_tag_id_array[] = $client_tag_id;
if (empty($client_tag_color)) {
$client_tag_color = "dark";
}
if (empty($client_tag_icon)) {
$client_tag_icon = "tag";
}
$client_tag_name_display_array[] = "<a href='clients.php?q=$client_tag_name'><span class='badge bg-$client_tag_color'><i class='fa fa-fw fa-$client_tag_icon mr-2'></i>$client_tag_name</span></a> ";
}
$client_tags_display = implode('', $client_tag_name_display_array);