Added data-bulk to the ajax modal to allow for bulk GET collection of selected ids that have a class of bulk-select, converted expense and client bulk modals to use the the new ajax-modal

This commit is contained in:
johnnyq
2025-11-06 11:26:08 -05:00
parent 293a2b800e
commit 0cf1e338c2
20 changed files with 985 additions and 773 deletions

View File

@@ -2,8 +2,7 @@
require_once '../../../includes/modal_header.php';
$ticket_id = intval($_GET['ticket_id'] ?? 0);
$client_id = intval(getFieldById('tickets', $ticket_id, 'ticket_client_id') ?? 0);
$ticket_id = intval($_GET['ticket_id']);
ob_start();
@@ -16,7 +15,6 @@ ob_start();
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="ticket_id" value="<?php echo $ticket_id; ?>">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<div class="modal-body">
<div class="form-group">

View File

@@ -2,11 +2,17 @@
require_once '../../../includes/modal_header.php';
$ticket_id = intval($_GET['ticket_id']);
$current_client_id = intval(getFieldById('tickets', $ticket_id, 'ticket_client_id'));
$ticket_prefix = nullable_htmlentities(getFieldById('tickets', $ticket_id, 'ticket_prefix'));
$ticket_number = nullable_htmlentities(getFieldById('tickets', $ticket_id, 'ticket_number'));
$sql = mysqli_query($mysqli, "SELECT * FROM tickets WHERE ticket_id = $ticket_id LIMIT 1");
$row = mysqli_fetch_array($sql);
$ticket_prefix = nullable_htmlentities($row['ticket_prefix']);
$ticket_number = intval($row['ticket_number']);
$client_id = intval($row['ticket_client_id']);
// Generate the HTML form content using output buffering.
ob_start();
?>
<div class="modal-header bg-dark">
@@ -34,7 +40,7 @@ ob_start();
$client_id_select = intval($row['client_id']);
$client_name = nullable_htmlentities($row['client_name']);
?>
<option value="<?= $client_id_select ?>" <?php if ($current_client_id == $client_id_select) echo 'selected'; ?>>
<option value="<?= $client_id_select ?>" <?php if ($client_id == $client_id_select) echo 'selected'; ?>>
<?= $client_name ?>
</option>
<?php } ?>

View File

@@ -1,17 +1,23 @@
<?php
require_once '../../../includes/modal_header.php';
$ticket_id = intval($_GET['ticket_id'] ?? 0);
$ticket_id = intval($_GET['ticket_id']);
$client_id = intval(getFieldById('tickets', $ticket_id, 'ticket_client_id') ?? 0);
$vendor_id = intval(getFieldById('tickets', $ticket_id, 'ticket_vendor_id') ?? 0);
$sql = mysqli_query($mysqli, "SELECT * FROM tickets WHERE ticket_id = $ticket_id LIMIT 1");
$row = mysqli_fetch_array($sql);
$ticket_prefix = nullable_htmlentities($row['ticket_prefix']);
$ticket_number = intval($row['ticket_number']);
$vendor_id = intval($row['ticket_vendor_id']);
$client_id = intval($row['ticket_client_id']);
// Generate the HTML form content using output buffering.
ob_start();
?>
<div class="modal-header bg-dark">
<h5 class="modal-title"><i class="fa fa-fw fa-building mr-2"></i>Editing ticket Vendor</h5>
<h5 class="modal-title"><i class="fa fa-fw fa-building mr-2"></i>Editing Vendor: <strong><?= "$ticket_prefix$ticket_number" ?></strong></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span>&times;</span>
</button>