Removed session functionality and Updated page heading
This commit is contained in:
@@ -25,7 +25,7 @@ class GuardPatrolEntryDashboard extends Page
|
|||||||
|
|
||||||
public function mount(): void
|
public function mount(): void
|
||||||
{
|
{
|
||||||
session()->forget(['select_guard_plant', 'select_guard_date']);
|
// session()->forget(['select_guard_plant', 'select_guard_date']);
|
||||||
$this->filtersForm->fill([
|
$this->filtersForm->fill([
|
||||||
'plant' => null,
|
'plant' => null,
|
||||||
'date' => null,
|
'date' => null,
|
||||||
@@ -47,18 +47,19 @@ class GuardPatrolEntryDashboard extends Page
|
|||||||
if(!$state)
|
if(!$state)
|
||||||
{
|
{
|
||||||
$set('date', now()->format('Y-m-d')); // H:i:s
|
$set('date', now()->format('Y-m-d')); // H:i:s
|
||||||
session(['select_guard_plant' => $state]);
|
// session(['select_guard_plant' => $state]);
|
||||||
session(['select_guard_date' => $get('date')]);
|
// session(['select_guard_date' => $get('date')]);
|
||||||
} else {
|
} else {
|
||||||
if(!$get('date'))
|
if(!$get('date'))
|
||||||
{
|
{
|
||||||
$set('date', now()->format('Y-m-d'));
|
$set('date', now()->format('Y-m-d'));
|
||||||
session(['select_guard_plant' => $state]);
|
// session(['select_guard_plant' => $state]);
|
||||||
session(['select_guard_date' => $get('date')]);
|
// session(['select_guard_date' => $get('date')]);
|
||||||
} else {
|
|
||||||
session(['select_guard_plant' => $state]);
|
|
||||||
session(['select_guard_date' => $get('date')]);
|
|
||||||
}
|
}
|
||||||
|
// else {
|
||||||
|
// session(['select_guard_plant' => $state]);
|
||||||
|
// session(['select_guard_date' => $get('date')]);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
$this->dispatch('loadGuardData', $state, $get('date')); //->format('Y-m-d')
|
$this->dispatch('loadGuardData', $state, $get('date')); //->format('Y-m-d')
|
||||||
}),
|
}),
|
||||||
@@ -73,20 +74,21 @@ class GuardPatrolEntryDashboard extends Page
|
|||||||
if(!$get('plant'))
|
if(!$get('plant'))
|
||||||
{
|
{
|
||||||
$set('date', now()->format('Y-m-d'));
|
$set('date', now()->format('Y-m-d'));
|
||||||
session(['select_guard_plant' => $get('plant')]);
|
// session(['select_guard_plant' => $get('plant')]);
|
||||||
session(['select_guard_date' => $state]);
|
// session(['select_guard_date' => $state]);
|
||||||
} else {
|
} else {
|
||||||
if(!$get('date'))
|
if(!$get('date'))
|
||||||
{
|
{
|
||||||
$set('date', now()->format('Y-m-d'));
|
$set('date', now()->format('Y-m-d'));
|
||||||
session(['select_guard_plant' => $get('plant')]);
|
// session(['select_guard_plant' => $get('plant')]);
|
||||||
session(['select_guard_date' => $state]);
|
// session(['select_guard_date' => $state]);
|
||||||
} else {
|
|
||||||
$records = GuardPatrolEntry::whereDate('patrol_time', $state)->where('plant_id', $get('plant'))->orderBy('patrol_time', 'asc')->first(); //desc
|
|
||||||
//dd($get('plant'), $state, $records->patrol_time);//->toTimeString()
|
|
||||||
session(['select_guard_plant' => $get('plant')]);
|
|
||||||
session(['select_guard_date' => $state]);
|
|
||||||
}
|
}
|
||||||
|
// else {
|
||||||
|
// $records = GuardPatrolEntry::whereDate('patrol_time', $state)->where('plant_id', $get('plant'))->orderBy('patrol_time', 'asc')->first(); //desc
|
||||||
|
// //dd($get('plant'), $state, $records->patrol_time);//->toTimeString()
|
||||||
|
// session(['select_guard_plant' => $get('plant')]);
|
||||||
|
// session(['select_guard_date' => $state]);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
// $this->dispatch('invoiceChart');
|
// $this->dispatch('invoiceChart');
|
||||||
$this->dispatch('loadGuardData', $get('plant'), $state);//->format('Y-m-d')
|
$this->dispatch('loadGuardData', $get('plant'), $state);//->format('Y-m-d')
|
||||||
@@ -98,7 +100,12 @@ class GuardPatrolEntryDashboard extends Page
|
|||||||
|
|
||||||
public static function getNavigationLabel(): string
|
public static function getNavigationLabel(): string
|
||||||
{
|
{
|
||||||
return 'Guard Patrol Entry';
|
return 'Guard Patrol Status Table';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getHeading(): string
|
||||||
|
{
|
||||||
|
return 'Guard Patrol Entry Status';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function canAccess(): bool
|
public static function canAccess(): bool
|
||||||
|
|||||||
Reference in New Issue
Block a user