diff --git a/app/Filament/Pages/Dashboard.php b/app/Filament/Pages/Dashboard.php index c013a0c..4a3879d 100644 --- a/app/Filament/Pages/Dashboard.php +++ b/app/Filament/Pages/Dashboard.php @@ -2,6 +2,7 @@ namespace App\Filament\Pages; use App\Filament\Widgets\CumulativeChart; +use App\Filament\Widgets\ProductionQuantityStat; use Filament\Forms\Components\Select; use Filament\Forms\Components\TextInput; use Filament\Forms\Form; @@ -9,64 +10,117 @@ use Filament\Pages\Dashboard\Concerns\HasFiltersForm; use Filament\Tables\Filters\SelectFilter; use Illuminate\Support\Facades\DB; use App\Models\Plant; +use Filament\Facades\Filament; +use Filament\Forms\Components\DatePicker; use Filament\Widgets\Widget; use Illuminate\Support\Facades\Auth; class Dashboard extends \Filament\Pages\Dashboard { - use HasFiltersForm; + use HasFiltersForm; - protected static ?string $navigationGroup = 'Production DashBoard'; + protected static ?string $navigationIcon = 'heroicon-s-gift'; - public function mount(): void - { - session()->forget(['selected_plant']); - $this->filtersForm->fill([ - 'plant' => null - ]); - } + protected static string $view = 'filament.pages.dashboard'; - public function filtersForm(Form $form): Form - { - return $form - ->statePath('filters') // Store form state in 'filters' - ->schema([ - Select::make('plant') - ->options(Plant::pluck('name', 'id')) - ->label('Select Plant') - ->reactive() - ->afterStateUpdated(function ($state) { - session(['selected_plant' => $state]); // fixed typo - //$this->dispatch('cumulativeChart'); // custom Livewire event - }), - ]); +// public function mount(): void +// { +// session()->forget(['selected_plant']); +// session()->forget(['from_date']); +// session()->forget(['to_date']); +// $this->filtersForm->fill([ +// 'plant' => null, +// 'from_date' => null, +// 'to_date' => null, +// // 'success_status' => null +// ]); +// } - } +// public function filtersForm(Form $form): Form +// { +// return $form +// ->statePath('filters') // Store form state in 'filters' +// ->schema([ +// Select::make('plant') +// ->label('Select Plant') +// ->reactive() +// // ->options(Plant::pluck('name', 'id')) +// ->options(function (callable $get) { +// $userHas = Filament::auth()->user()->plant_id; +// return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray(); +// }) +// ->afterStateUpdated(function ($state,callable $set) { +// session(['selected_plant' => $state]); // fixed typo +// //$this->dispatch('cumulativeChart'); // custom Livewire event +// // Reset success_status whenever plant changes +// $set('success_status', null); +// session()->forget('success_status'); +// }), + +// // Select::make('success_status') +// // ->label('Select Status') +// // ->options([ +// // 'Ok' => 'Ok', +// // 'Not Ok' => 'Not Ok', +// // ]) +// // ->reactive() +// // ->afterStateUpdated(function ($state) { +// // session(['success_status' => $state]); +// // }), + +// DatePicker::make('created_from') +// ->label('Created From') +// ->reactive() +// ->afterStateUpdated(function ($state,callable $set) { +// session(['from_date' => $state]); +// }), + +// DatePicker::make('created_to') +// ->label('Created To') +// ->reactive() +// ->afterStateUpdated(function ($state,callable $set) { +// session(['to_date' => $state]); +// }), + +// ]); +// } - public static function getNavigationLabel(): string - { - return 'Production Line Count'; - } +// public static function getNavigationLabel(): string +// { +// return 'Production Line Count'; +// } + +// public function getHeading(): string +// { +// return 'Production Line Count'; +// } + +// public function getWidgets(): array +// { +// $widgets = []; + +// if (CumulativeChart::canView()) { +// $widgets[] = CumulativeChart::class; + +// } +// return $widgets; +// } + +// public static function canAccess(): bool +// { +// return Auth::check() && Auth::user()->can('view production line count dashboard'); +// } + public function getHeading(): string { - return 'Production Line Count'; + return ''; } - public function getWidgets(): array + public static function getNavigationLabel(): string { - $widgets = []; - - if (CumulativeChart::canView()) { - $widgets[] = CumulativeChart::class; - } - return $widgets; - } - - public static function canAccess(): bool - { - return Auth::check() && Auth::user()->can('view production line count dashboard'); + return 'Welcome'; } } diff --git a/app/Filament/Pages/Welcome.php b/app/Filament/Pages/Welcome.php index 89b5118..74cfabd 100644 --- a/app/Filament/Pages/Welcome.php +++ b/app/Filament/Pages/Welcome.php @@ -1,23 +1,124 @@ forget(['selected_plant']); + // session()->forget(['from_date']); + // session()->forget(['to_date']); + $this->filtersForm->fill([ + 'plant' => null, + // 'from_date' => null, + // 'to_date' => null, + // 'success_status' => null + ]); + } + + public function filtersForm(Form $form): Form + { + return $form + ->statePath('filters') + ->schema([ + Select::make('plant') + ->label('Select Plant') + ->reactive() + // ->options(Plant::pluck('name', 'id')) + ->options(function (callable $get) { + $userHas = Filament::auth()->user()->plant_id; + return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray(); + }) + ->afterStateUpdated(function ($state,callable $set) { + session(['selected_plant' => $state]); + //$this->dispatch('cumulativeChart'); // custom Livewire event + // Reset success_status whenever plant changes + // $set('success_status', null); + // session()->forget('success_status'); + }), + + // Select::make('success_status') + // ->label('Select Status') + // ->options([ + // 'Ok' => 'Ok', + // 'Not Ok' => 'Not Ok', + // ]) + // ->reactive() + // ->afterStateUpdated(function ($state) { + // session(['success_status' => $state]); + // }), + + // DatePicker::make('created_from') + // ->label('Created From') + // ->reactive() + // ->afterStateUpdated(function ($state,callable $set) { + // session(['from_date' => $state]); + // }), + + // DatePicker::make('created_to') + // ->label('Created To') + // ->reactive() + // ->afterStateUpdated(function ($state,callable $set) { + // session(['to_date' => $state]); + // }), + + ]); } - // public static function canAccess(): bool + + public static function getNavigationLabel(): string + { + return 'Production Line Count'; + } + + public function getHeading(): string + { + return 'Production Line Count'; + } + + // public function getWidgets(): array // { - // return Auth::check() && Auth::user()->can('view welcome page'); + // $widgets = []; + + // if (CumulativeChart::canView()) { + // $widgets[] = CumulativeChart::class; + + // } + // return $widgets; // } + + public static function canAccess(): bool + { + return Auth::check() && Auth::user()->can('view production line count dashboard'); + } + } diff --git a/resources/views/filament/pages/dashboard.blade.php b/resources/views/filament/pages/dashboard.blade.php new file mode 100644 index 0000000..e5ac5e2 --- /dev/null +++ b/resources/views/filament/pages/dashboard.blade.php @@ -0,0 +1,126 @@ + + + +
+

+ CRI Digital Manufacturing IIoT Platform +

+

+ Complete visibility, traceability, and control across your manufacturing operations. +

+
+ + + {{--
--}} +
+ CRI Digital Manufacturing IIoT +
+ + +
+

+ CRI Digital Manufacturing IIoT is built to deliver + end-to-end traceability, real-time insights, and operational transparency + across plants, lines, and production processes. +

+ +

+ The platform ensures right quality and on-time delivery by enabling + complete tracking of materials, production orders, and finished goodsβ€”helping teams + make faster, data-driven decisions with confidence. +

+
+ + +
+
+

πŸ” Traceability

+

+ Track materials, batches, and serials from input to dispatch. +

+
+ +
+

βœ… Quality Assurance

+

+ Validate process data and ensure first-time-right production. +

+
+ +
+

⏱ On-Time Delivery

+

+ Identify delays early and meet production commitments. +

+
+ +
+

πŸ“Š Real-Time Insights

+

+ Monitor performance and take quick corrective actions. +

+
+
+ + +
+

24Γ—7 Support

+

+ Our dedicated IIoT support team is available round-the-clock to ensure + uninterrupted operations and quick issue resolution. +

+

+ πŸ“ž Support Landline: 0422 711 7179 +

+ {{--

+ πŸ“ž Technical Support Contact: 9952468104 / 9100832269 +

--}} +
+ + {{--
+

24Γ—7 Support

+ +

+ Our support structure is designed to ensure quick resolution based on the type + of issue β€” whether it is on-site, application-related, or infrastructure-related. +

+ +
+ +

+ 🏭 Plant & On-Site Support
+ + For plant visits, industry-level issues, and on-ground validation +
+ πŸ“ž 8925899458 / 8925899459 +

+ +

+ πŸ’» Application & Logic Support
+ + For website errors, logic issues, and application-level problems +
+ πŸ“ž 9952468104 / 9100832269 +

+
+
--}} + + + + {{--
+

IIOT Team Members

+
+
πŸ‘€ Jothikumar
+
πŸ‘€ Jeithef Shibu
+
πŸ‘€ Dhanabalan
+
πŸ‘€ Ranjith
+
πŸ‘€ Srimathy
+
πŸ‘€ Gokul
+
+
--}} + + diff --git a/resources/views/filament/pages/welcome.blade.php b/resources/views/filament/pages/welcome.blade.php index e5ac5e2..492b127 100644 --- a/resources/views/filament/pages/welcome.blade.php +++ b/resources/views/filament/pages/welcome.blade.php @@ -1,126 +1,13 @@ - - -
-

- CRI Digital Manufacturing IIoT Platform -

-

- Complete visibility, traceability, and control across your manufacturing operations. -

-
- - - {{--
--}} -
- CRI Digital Manufacturing IIoT -
- - -
-

- CRI Digital Manufacturing IIoT is built to deliver - end-to-end traceability, real-time insights, and operational transparency - across plants, lines, and production processes. -

- -

- The platform ensures right quality and on-time delivery by enabling - complete tracking of materials, production orders, and finished goodsβ€”helping teams - make faster, data-driven decisions with confidence. -

-
- - -
-
-

πŸ” Traceability

-

- Track materials, batches, and serials from input to dispatch. -

+
+ {{-- Filters form --}} +
+ {{ $this->filtersForm($this->form) }}
-
-

βœ… Quality Assurance

-

- Validate process data and ensure first-time-right production. -

-
- -
-

⏱ On-Time Delivery

-

- Identify delays early and meet production commitments. -

-
- -
-

πŸ“Š Real-Time Insights

-

- Monitor performance and take quick corrective actions. -

+ {{-- Stat widget --}} +
+ @livewire(\App\Filament\Widgets\CumulativeChart::class)
- - -
-

24Γ—7 Support

-

- Our dedicated IIoT support team is available round-the-clock to ensure - uninterrupted operations and quick issue resolution. -

-

- πŸ“ž Support Landline: 0422 711 7179 -

- {{--

- πŸ“ž Technical Support Contact: 9952468104 / 9100832269 -

--}} -
- - {{--
-

24Γ—7 Support

- -

- Our support structure is designed to ensure quick resolution based on the type - of issue β€” whether it is on-site, application-related, or infrastructure-related. -

- -
- -

- 🏭 Plant & On-Site Support
- - For plant visits, industry-level issues, and on-ground validation -
- πŸ“ž 8925899458 / 8925899459 -

- -

- πŸ’» Application & Logic Support
- - For website errors, logic issues, and application-level problems -
- πŸ“ž 9952468104 / 9100832269 -

-
-
--}} - - - - {{--
-

IIOT Team Members

-
-
πŸ‘€ Jothikumar
-
πŸ‘€ Jeithef Shibu
-
πŸ‘€ Dhanabalan
-
πŸ‘€ Ranjith
-
πŸ‘€ Srimathy
-
πŸ‘€ Gokul
-
-
--}} -