Allow linking of asset to a ticket via edit modal

This commit is contained in:
Marcus Hill
2022-01-04 20:22:27 +00:00
parent 57517f5122
commit f6900ae993
3 changed files with 40 additions and 2 deletions

View File

@@ -94,6 +94,30 @@
</div>
</div>
<div class="form-group">
<label>Asset</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
</div>
<select class="form-control select2" name="asset">
<option value="0">- None -</option>
<?php
$sql_assets = mysqli_query($mysqli,"SELECT * FROM assets WHERE asset_client_id = $client_id ORDER BY asset_name ASC");
while($row = mysqli_fetch_array($sql_assets)){
$asset_id_select = $row['asset_id'];
$asset_name_select = $row['asset_name'];
?>
<option <?php if(!empty($ticket_asset_id) && $ticket_asset_id == $asset_id_select){ echo "selected"; } ?> value="<?php echo $asset_id_select; ?>"><?php echo $asset_name_select; ?></option>
<?php
}
?>
</select>
</div>
</div>
<div class="form-group">
<textarea class="form-control summernote" rows="8" name="details" required><?php echo $ticket_details; ?></textarea>
</div>