fix: login page changes

This commit is contained in:
Kwesi Banson Jnr
2026-07-21 19:04:42 +00:00
parent b827b985e5
commit 7b29bb278c
3 changed files with 53 additions and 2 deletions

View File

@@ -105,7 +105,6 @@
</div>
@endsection
<!-- MODAL HTML REMAINS THE SAME AS BEFORE -->
@push('modals')
@include('clients.partials.create')
@endpush
@@ -135,6 +134,44 @@
let page = $(this).data('page');
if (page) fetchClients(page);
});
// ---------------------------------------------------------
// 1. CREATE BUTTON (Open Modal)
// ---------------------------------------------------------
$('#btnOpenClientModal').on('click', function(e) {
e.preventDefault();
// Replace '#createClientModal' with the actual ID of the modal in your clients.partials.create file
$('#createClientModal').modal('show');
});
// ---------------------------------------------------------
// 2. VIEW BUTTON (Event Delegation for AJAX buttons)
// ---------------------------------------------------------
$(document).on('click', '.btn-view-client', function(e) {
e.preventDefault();
let clientId = $(this).data('id');
// OPTION A: Redirect to a view page
window.location.href = base_url + "/clients/" + clientId;
// OPTION B: If you are using a View Modal instead, uncomment this:
// fetchClientDetailsForView(clientId);
// $('#viewClientModal').modal('show');
});
// ---------------------------------------------------------
// 3. EDIT BUTTON (Event Delegation for AJAX buttons)
// ---------------------------------------------------------
$(document).on('click', '.btn-edit-client', function(e) {
e.preventDefault();
let clientId = $(this).data('id');
// OPTION A: Redirect to an edit page
window.location.href = base_url + "/clients/" + clientId + "/edit";
// OPTION B: If you are using an Edit Modal instead, uncomment this:
// fetchClientDetailsForEdit(clientId);
// $('#editClientModal').modal('show');
});
// AJAX Fetch Function
function fetchClients(page = 1) {