Add logic for showing quote attachments in the admin/tech side

This commit is contained in:
wrongecho 2025-02-03 22:19:06 +00:00
parent 75e002a054
commit b50c2295a6
1 changed files with 55 additions and 0 deletions

View File

@ -108,6 +108,13 @@ if (isset($_GET['quote_id'])) {
$json_products = json_encode($products);
}
// Attachments
// Get Ticket Attachments
$sql_quote_attachments = mysqli_query(
$mysqli,
"SELECT * FROM quote_attachments WHERE quote_attachments.quote_attachment_quote_id = $quote_id"
);
?>
<ol class="breadcrumb d-print-none">
@ -483,6 +490,54 @@ if (isset($_GET['quote_id'])) {
</div>
</div>
<?php if (mysqli_num_rows($sql_quote_attachments) > 0) { ?>
<div class="row mb-3">
<div class="col-sm d-print-none">
<div class="card">
<div class="card-header text-bold">
<i class="fa fa-paperclip mr-2"></i>Attachments
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse">
<i class="fas fa-minus"></i>
</button>
<button type="button" class="btn btn-tool" data-card-widget="remove">
<i class="fas fa-times"></i>
</button>
</div>
</div>
<div class="card-body">
<table class="table">
<thead>
<tr>
<th>File Name</th>
<th>Upload date</th>
</tr>
</thead>
<tbody>
<?php
while ($quote_attachment = mysqli_fetch_array($sql_quote_attachments)) {
$name = nullable_htmlentities($quote_attachment['quote_attachment_name']);
$ref_name = nullable_htmlentities($quote_attachment['quote_attachment_reference_name']);
$created = nullable_htmlentities($quote_attachment['quote_attachment_created_at']);
?>
<tr>
<td><a href="/uploads/quotes/<?php echo $quote_id ?>/<?php echo $ref_name ?>"><?php echo $name; ?></a></td>
<td><?php echo $created; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php } ?>
<div class="row mb-3">
<div class="col-sm d-print-none">
<div class="card">