fix: login page changes
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||||
|
|
||||||
class NetworkOps extends Model
|
class NetworkOps extends Model
|
||||||
{
|
{
|
||||||
@@ -12,4 +13,17 @@ class NetworkOps extends Model
|
|||||||
public function account_manager_info(){
|
public function account_manager_info(){
|
||||||
return $this->hasOne('App\Models\StaffMember', 'id', 'account_manager_id');
|
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)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
id="email"
|
id="email"
|
||||||
name="email"
|
name="email"
|
||||||
value="{{ old('email') }}"
|
value="{{ old('email') }}"
|
||||||
placeholder="staff@luspa.gov.gh"
|
placeholder="staff@click-mobile.com"
|
||||||
required
|
required
|
||||||
autofocus>
|
autofocus>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -105,7 +105,6 @@
|
|||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
<!-- MODAL HTML REMAINS THE SAME AS BEFORE -->
|
|
||||||
@push('modals')
|
@push('modals')
|
||||||
@include('clients.partials.create')
|
@include('clients.partials.create')
|
||||||
@endpush
|
@endpush
|
||||||
@@ -135,6 +134,44 @@
|
|||||||
let page = $(this).data('page');
|
let page = $(this).data('page');
|
||||||
if (page) fetchClients(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
|
// AJAX Fetch Function
|
||||||
function fetchClients(page = 1) {
|
function fetchClients(page = 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user