chore[views]: view pages added

This commit is contained in:
erishBRBS 2025-06-06 15:42:49 +08:00
parent dc0402215c
commit d96f0ea525
28 changed files with 380 additions and 48 deletions

View File

@ -0,0 +1,13 @@
<?php
namespace App\Livewire\Buttons;
use Livewire\Component;
class ViewCardMember extends Component
{
public function render()
{
return view('livewire.buttons.view-card-member');
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Livewire\Buttons;
use Livewire\Component;
class ViewCardType extends Component
{
public function render()
{
return view('livewire.buttons.view-card-type');
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Livewire\Buttons;
use Livewire\Component;
class ViewLockedAccount extends Component
{
public function render()
{
return view('livewire.buttons.view-locked-account');
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Livewire\Buttons;
use Livewire\Component;
class ViewPhotoSlider extends Component
{
public function render()
{
return view('livewire.buttons.view-photo-slider');
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Livewire\Buttons;
use Livewire\Component;
class ViewPromotion extends Component
{
public function render()
{
return view('livewire.buttons.view-promotion');
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Livewire\Buttons;
use Livewire\Component;
class ViewTermsAndPrivacy extends Component
{
public function render()
{
return view('livewire.buttons.view-terms-and-privacy');
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Livewire\Buttons;
use Livewire\Component;
class ViewTopUp extends Component
{
public function render()
{
return view('livewire.buttons.view-top-up');
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Livewire\Buttons;
use Livewire\Component;
class ViewUser extends Component
{
public function render()
{
return view('livewire.buttons.view-user');
}
}

View File

@ -50,6 +50,7 @@ class Table extends Component
public $confirmingDeleteId = null;
public $updateRoute = null;
public $viewRoute = null;
/**
@ -73,9 +74,10 @@ class Table extends Component
//VIEW
public function viewRow($id)
{
$this->modalData = collect($this->rows)->firstWhere($this->rowKey, $id) ?? [];
$this->modalMode = 'view';
$this->showModal = true;
// $this->modalData = collect($this->rows)->firstWhere($this->rowKey, $id) ?? [];
// $this->modalMode = 'view';
// $this->showModal = true;
return redirect()->to($this->viewRoute . '?uuid=' . $id);
}
//UPDATE || EDIT

View File

@ -23,6 +23,7 @@
:addRoute="route('card-type-create')"
:rowKey="'cardtype_uuid'"
:updateRoute="'/main/about-us/card-type-update'"
:viewRoute="'/main/about-us/card-type-view'"
:deleteEndpoint="'api/cms/cardType'"
:deleteAllEndpoint="'api/cms/cardTypeBatchDelete'"

View File

@ -24,6 +24,7 @@
:isViewPage="false"
:addRoute="route('terms-and-privacy-create')"
:updateRoute="'/main/about-us/terms-and-privacy-update'"
:viewRoute="'/main/about-us/terms-and-privacy-view'"
:rowKey="'tp_uuid'"
:deleteEndpoint="'api/cms/TermsAndPrivacy'"
:deleteAllEndpoint="'api/cms/TermsAndPrivacyBatchDelete'"

View File

@ -0,0 +1,24 @@
<div>
<!-- anchor tag horizontally -->
<div class="flex items-center gap-2 text-xs text-gray-600">
<!-- Home link -->
<a href="/main/profile" class="flex items-center hover:text-orange-600">
<x-heroicon-o-home class="w-3 h-3 mr-1" />
<span class="leading-none">Home</span>
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<a href="/main/member-management/card-member" class="hover:text-orange-600">
Card Members
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<span>
View Card Member
</span>
</div>
<!-- Page Title -->
<h3 class="text-5xl font-semibold text-gray-800 mt-4">View Card Member</h3>
<!-- Bottom border -->
<div class="border-b border-gray-300 mt-5"></div>
</div>

View File

@ -0,0 +1,24 @@
<div>
<!-- anchor tag horizontally -->
<div class="flex items-center gap-2 text-xs text-gray-600">
<!-- Home link -->
<a href="/main/profile" class="flex items-center hover:text-orange-600">
<x-heroicon-o-home class="w-3 h-3 mr-1" />
<span class="leading-none">Home</span>
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<a href="/main/about-us/card-type" class="hover:text-orange-600">
Card Types
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<span>
View Card Type
</span>
</div>
<!-- Page Title -->
<h3 class="text-5xl font-semibold text-gray-800 mt-4">View Card Type</h3>
<!-- Bottom border -->
<div class="border-b border-gray-300 mt-5"></div>
</div>

View File

@ -0,0 +1,24 @@
<div>
<!-- anchor tag horizontally -->
<div class="flex items-center gap-2 text-xs text-gray-600">
<!-- Home link -->
<a href="/main/profile" class="flex items-center hover:text-orange-600">
<x-heroicon-o-home class="w-3 h-3 mr-1" />
<span class="leading-none">Home</span>
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<a href="/main/member-management/locked-account" class="hover:text-orange-600">
Locked Accounts
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<span>
View Locked Account
</span>
</div>
<!-- Page Title -->
<h3 class="text-5xl font-semibold text-gray-800 mt-4">View Locked Account</h3>
<!-- Bottom border -->
<div class="border-b border-gray-300 mt-5"></div>
</div>

View File

@ -0,0 +1,24 @@
<div>
<!-- anchor tag horizontally -->
<div class="flex items-center gap-2 text-xs text-gray-600">
<!-- Home link -->
<a href="/main/profile" class="flex items-center hover:text-orange-600">
<x-heroicon-o-home class="w-3 h-3 mr-1" />
<span class="leading-none">Home</span>
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<a href="/main/home-page/photo-slider" class="hover:text-orange-600">
Photo Sliders
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<span>
View Photo Slider
</span>
</div>
<!-- Page Title -->
<h3 class="text-5xl font-semibold text-gray-800 mt-4">View Photo Slider</h3>
<!-- Bottom border -->
<div class="border-b border-gray-300 mt-5"></div>
</div>

View File

@ -0,0 +1,24 @@
<div>
<!-- anchor tag horizontally -->
<div class="flex items-center gap-2 text-xs text-gray-600">
<!-- Home link -->
<a href="/main/profile" class="flex items-center hover:text-orange-600">
<x-heroicon-o-home class="w-3 h-3 mr-1" />
<span class="leading-none">Home</span>
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<a href="/main/promotion" class="hover:text-orange-600">
Promotions
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<span>
View Promotion
</span>
</div>
<!-- Page Title -->
<h3 class="text-5xl font-semibold text-gray-800 mt-4">View Promotion</h3>
<!-- Bottom border -->
<div class="border-b border-gray-300 mt-5"></div>
</div>

View File

@ -0,0 +1,24 @@
<div>
<!-- anchor tag horizontally -->
<div class="flex items-center gap-2 text-xs text-gray-600">
<!-- Home link -->
<a href="/main/profile" class="flex items-center hover:text-orange-600">
<x-heroicon-o-home class="w-3 h-3 mr-1" />
<span class="leading-none">Home</span>
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<a href="/main/about-us/terms-and-privacy" class="hover:text-orange-600">
Terms and Privacy
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<span>
View Terms and Privacy
</span>
</div>
<!-- Page Title -->
<h3 class="text-5xl font-semibold text-gray-800 mt-4">View Terms and Privacy</h3>
<!-- Bottom border -->
<div class="border-b border-gray-300 mt-5"></div>
</div>

View File

@ -0,0 +1,24 @@
<div>
<!-- anchor tag horizontally -->
<div class="flex items-center gap-2 text-xs text-gray-600">
<!-- Home link -->
<a href="/main/profile" class="flex items-center hover:text-orange-600">
<x-heroicon-o-home class="w-3 h-3 mr-1" />
<span class="leading-none">Home</span>
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<a href="/main/top-up" class="hover:text-orange-600">
Top Up
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<span>
View Top Up
</span>
</div>
<!-- Page Title -->
<h3 class="text-5xl font-semibold text-gray-800 mt-4">View Top Up</h3>
<!-- Bottom border -->
<div class="border-b border-gray-300 mt-5"></div>
</div>

View File

@ -0,0 +1,24 @@
<div>
<!-- anchor tag horizontally -->
<div class="flex items-center gap-2 text-xs text-gray-600">
<!-- Home link -->
<a href="/main/profile" class="flex items-center hover:text-orange-600">
<x-heroicon-o-home class="w-3 h-3 mr-1" />
<span class="leading-none">Home</span>
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<a href="/main/user-management" class="hover:text-orange-600">
User Management
</a>
<x-heroicon-o-chevron-right class="w-3 h-3" />
<span>
View User
</span>
</div>
<!-- Page Title -->
<h3 class="text-5xl font-semibold text-gray-800 mt-4">View User</h3>
<!-- Bottom border -->
<div class="border-b border-gray-300 mt-5"></div>
</div>

View File

@ -177,50 +177,6 @@
</div>
</div>
@if ($showModal)
<div class="fixed inset-0 bg-gray-900 bg-opacity-50 flex items-center justify-center z-50">
<div class="bg-white p-6 rounded-lg shadow-lg w-1/2 max-w-xl">
<!-- Modal Header -->
<div class="flex justify-between items-center mb-4">
<h2 class="text-lg font-semibold">
{{ $modalMode === 'view' ? 'View Details' : 'Edit Details' }}
</h2>
<button wire:click="closeModal" class="text-gray-600 hover:text-gray-800">×</button>
</div>
<!-- Modal Body -->
<div class="space-y-4">
@foreach ($columns as $column)
<div>
<label class="block text-sm font-medium text-gray-700">
{{ $column['label'] }}
</label>
@if ($modalMode === 'edit')
@if ($column['type'] === 'select')
<select wire:model.defer="modalData.{{ $column['field'] }}"
class="mt-1 p-2 border border-gray-300 rounded w-full">
@foreach ($column['options'] as $key => $label)
<option value="{{ $key }}">{{ $label }}</option>
@endforeach
</select>
@else
<input type="{{ $column['type'] }}" wire:model.defer="modalData.{{ $column['field'] }}"
class="mt-1 p-2 border border-gray-300 rounded w-full" />
@endif
@else
<div class="mt-1 p-2 bg-gray-100 rounded">
{{ $modalData[$column['field']] ?? '' }}
</div>
@endif
</div>
@endforeach
</div>
</div>
</div>
@endif
<!-- Confirmation Modal for Deletion -->
@if ($confirmingDeleteId)
<div class="fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50">

View File

@ -26,6 +26,7 @@
:addRoute="route('photo-slider-create')"
:rowKey="'photoslider_uuid'"
:updateRoute="'/main/home-page-mobile/photo-slider-update'"
:viewRoute="'/main/home-page-mobile/photo-slider-view'"
:deleteEndpoint="'api/cms/photoSlider'"
:deleteAllEndpoint="'api/cms/photoSliderBatchDelete'"

View File

@ -166,6 +166,44 @@
<livewire:buttons.update-terms-and-privacy :uuid="request()->get('uuid')" />
@break
<!-- View Routes -->
@case('user-view')
<livewire:buttons.view-user :uuid="request()->get('uuid')" />
@break
@case('card-member-view')
<livewire:buttons.view-card-member :uuid="request()->get('uuid')" />
@break
@case('locked-account-view')
<livewire:buttons.view-locked-account :uuid="request()->get('uuid')" />
@break
@case('photo-slider-view')
<livewire:buttons.view-photo-slider :uuid="request()->get('uuid')" />
@break
@case('promotion-view')
<livewire:buttons.view-promotion :uuid="request()->get('uuid')" />
@break
@case('top-up-view')
<livewire:buttons.view-top-up :uuid="request()->get('uuid')" />
@break
@case('card-type-view')
<livewire:buttons.view-card-type :uuid="request()->get('uuid')" />
@break
@case('terms-and-privacy-view')
<livewire:buttons.view-terms-and-privacy :uuid="request()->get('uuid')" />
@break
@default
<livewire: profile />
@endswitch

View File

@ -17,6 +17,7 @@
:hasDelete="false"
:hasAddButton="false"
:hasExportButton="false"
:viewRoute="'/main/member-management/card-member-view'"
:rowKey="'lcard_uuid'"
/>
</div>

View File

@ -17,6 +17,7 @@
:hasDelete="false"
:hasAddButton="false"
:hasExportButton="false"
:viewRoute="'/main/member-management/locked-account-view'"
:rowKey="'lcard_uuid'"
/>
</div>

View File

@ -33,6 +33,7 @@
:addRoute="route('promotion-create')"
:rowKey="'promotion_uuid'"
:updateRoute="'/main/promotion/promotion-update'"
:viewRoute="'/main/promotion/promotion-view'"
:deleteEndpoint="'api/cms/promotion'"
:deleteAllEndpoint="'api/cms/promotionBatchDelete'"
/>

View File

@ -14,6 +14,7 @@
:addRoute="route('top-up-create')"
:rowKey="'topup_uuid'"
:updateRoute="'/main/top-up/top-up-update'"
:viewRoute="'/main/top-up/top-up-view'"
:deleteEndpoint="'api/cms/topUp'"
:deleteAllEndpoint="'api/cms/topUpBatchDelete'"
/>

View File

@ -37,7 +37,9 @@
:isViewPage="false"
:rowKey="'admin_uuid'"
:updateRoute="'/main/user-management/user-update'"
:viewRoute="'/main/user-management/user-view'"
:deleteEndpoint="'api/cms/admin'"
:deleteAllEndpoint="'api/cms/adminBatchDelete'"
/>
</div>

View File

@ -68,7 +68,6 @@ Route::get('/main/{page?}', function () {
return view('main.dashboard');
})->where('page', '.*');
//CREATE PAGES
Route::get('/main/user-management/user-create', function () {
return view('main.dashboard', ['activePage' => 'user-create']);
@ -137,3 +136,35 @@ Route::get('/main/about-us/terms-and-privacy-update', function () {
})->name('terms-and-privacy-update');
//VIEW PAGES
Route::get('/main/user-management/user-view', function () {
return view('main.dashboard', ['activePage' => 'user-view']);
})->name('user-view');
Route::get('/main/member-management/card-member-view', function () {
return view('main.dashboard', ['activePage' => 'card-member-view']);
})->name('card-member-view');
Route::get('/main/member-management/locked-account-view', function () {
return view('main.dashboard', ['activePage' => 'locked-account-view']);
})->name('locked-account-view');
Route::get('/main/home-page-mobile/photo-slider-view', function () {
return view('main.dashboard', ['activePage' => 'photo-slider-view']);
})->name('photo-slider-view');
Route::get('/main/promotion/promotion-view', function () {
return view('main.dashboard', ['activePage' => 'promotion-view']);
})->name('promotion-view');
Route::get('/main/top-up/top-up-view', function () {
return view('main.dashboard', ['activePage' => 'top-up-view']);
})->name('top-up-view');
Route::get('/main/about-us/card-type-view', function () {
return view('main.dashboard', ['activePage' => 'card-type-view']);
})->name('card-type-view');
Route::get('/main/about-us/terms-and-privacy-view', function () {
return view('main.dashboard', ['activePage' => 'terms-and-privacy-view']);
})->name('terms-and-privacy-view');