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

@@ -3,6 +3,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Casts\Attribute;
class NetworkOps extends Model
{
@@ -12,4 +13,17 @@ class NetworkOps extends Model
public function account_manager_info(){
return $this->hasOne('App\Models\StaffMember', 'id', 'account_manager_id');
}
/*
public function setBuyingRateAttribute($value)
{
$cleanValue = filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
$this->attributes['buying_rate'] = $cleanValue;
}
*/
protected function buyingRate(): Attribute
{
return Attribute::make(
set: fn (string $value) => filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION)
);
}
}

View File

@@ -94,7 +94,7 @@
id="email"
name="email"
value="{{ old('email') }}"
placeholder="staff@luspa.gov.gh"
placeholder="staff@click-mobile.com"
required
autofocus>
</div>

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) {