Added data-toggle='ajax-modal' to trigger the ajax modal instead, also added an ajax header and and footer to dedup code

This commit is contained in:
johnnyq
2025-02-15 14:50:48 -05:00
parent 298a584377
commit 9458c1cc7a
6 changed files with 29 additions and 23 deletions

View File

@@ -1,14 +1,6 @@
<?php
require_once '../includes/inc_all_ajax.php';
// ajax_contact_edit.php
// Check for the 'id' parameter
if (!isset($_GET['id'])) {
echo json_encode(['error' => 'Contact ID missing.']);
exit;
}
require_once '../includes/ajax_header.php';
$contact_id = intval($_GET['id']);
@@ -332,12 +324,6 @@ ob_start();
</div>
</form>
<script>// Initialize Select2 Elements
$('.select2').select2({
theme: 'bootstrap4',
});
</script>
<!-- JavaScript to Show/Hide Password Form Group -->
<script>
@@ -376,9 +362,8 @@ $(document).ready(function() {
</script>
<?php
$content = ob_get_clean();
// Return the title and content as a JSON response
echo json_encode(['title' => $title, 'content' => $content]);
require_once "../includes/ajax_footer.php";
?>