Updated UI for Restrict Client Access

This commit is contained in:
johnnyq
2024-06-04 15:11:13 -04:00
parent 254715ddc6
commit e5cab12633
2 changed files with 34 additions and 22 deletions

View File

@@ -110,24 +110,30 @@
<div class="tab-pane fade" id="pills-user-access"> <div class="tab-pane fade" id="pills-user-access">
<h5>Restrict Client Access</h5> <div class="alert alert-info">
<small class="text-muted">Leave Blank for Full access to all clients, no affect on users with the admin role.</small> Leave Blank for Full access to all clients, no affect on users with the admin role.
<?php
$sql_client_select = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_archived_at IS NULL ORDER BY client_name ASC");
while ($row = mysqli_fetch_array($sql_client_select)) {
$client_id = intval($row['client_id']);
$client_name = nullable_htmlentities($row['client_name']);
?>
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="clients[]" value="<?php echo $client_id; ?>">
<label class="form-check-label ml-2"><?php echo $client_name; ?></label>
</div> </div>
<?php } ?> <ul class="list-group">
<?php
$sql_client_select = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_archived_at IS NULL ORDER BY client_name ASC");
while ($row = mysqli_fetch_array($sql_client_select)) {
$client_id = intval($row['client_id']);
$client_name = nullable_htmlentities($row['client_name']);
?>
<li class="list-group-item">
<div class="form-check">
<input type="checkbox" class="form-check-input" name="clients[]" value="<?php echo $client_id; ?>">
<label class="form-check-label ml-2"><?php echo $client_name; ?></label>
</div>
</li>
<?php } ?>
</ul>
</div> </div>

View File

@@ -130,9 +130,11 @@
<div class="tab-pane fade" id="pills-user-access<?php echo $user_id; ?>"> <div class="tab-pane fade" id="pills-user-access<?php echo $user_id; ?>">
<h6>Restrict Client Access To<br><small class="text-muted">Leave Blank for Full access to all clients, no affect on users with the admin role.</small></h6> <div class="alert alert-info">
Leave Blank for Full access to all clients, no affect on users with the admin role.
</div>
<hr> <ul class="list-group">
<?php <?php
@@ -143,13 +145,17 @@
?> ?>
<div class="form-group form-check"> <li class="list-group-item">
<input type="checkbox" class="form-check-input" name="clients[]" value="<?php echo $client_id_select; ?>" <?php if (in_array($client_id_select, $client_access_array)) { echo "checked"; } ?>> <div class="form-check">
<label class="form-check-label ml-2"><?php echo $client_name_select; ?></label> <input type="checkbox" class="form-check-input" name="clients[]" value="<?php echo $client_id_select; ?>" <?php if (in_array($client_id_select, $client_access_array)) { echo "checked"; } ?>>
</div> <label class="form-check-label ml-2"><?php echo $client_name_select; ?></label>
</div>
</li>
<?php } ?> <?php } ?>
</ul>
</div> </div>
</div> </div>