Client Access: Allow to select Client Access Restrictions for existing users

This commit is contained in:
johnnyq
2024-05-10 14:01:20 -04:00
parent 85bf412f53
commit 9876c33d2e
4 changed files with 42 additions and 1 deletions

View File

@@ -84,6 +84,29 @@
</div>
</div>
<div class="form-group">
<label>Restrict Client Access</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-users"></i></span>
</div>
<select class="form-control select2" name="clients[]" data-placeholder="Restrict Client Access" multiple>
<?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_select = intval($row['client_id']);
$client_name_select = nullable_htmlentities($row['client_name']);
?>
<option <?php if (in_array($client_id_select, $client_access_array)) { echo "selected"; } ?> value="<?php echo $client_id_select; ?>"><?php echo $client_name_select; ?></option>
<?php } ?>
</select>
</div>
<small class="text-muted">Leave Blank for Full access to all clients, no affect on users with the admin role.</small>
</div>
<div class="form-group">
<label>Avatar</label>
<input type="file" class="form-control-file" accept="image/*;capture=camera" name="file">