diff --git a/app/Http/Controllers/Backend/AdminsController.php b/app/Http/Controllers/Backend/AdminsController.php index 9b4d577..c25a3c6 100644 --- a/app/Http/Controllers/Backend/AdminsController.php +++ b/app/Http/Controllers/Backend/AdminsController.php @@ -12,6 +12,11 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Support\Facades\Hash; use Spatie\Permission\Models\Role; use App\Helpers\NextcloudHelper; +use App\Models\FormUpCountry; +use App\Models\FormEntertaimentPresentation; +use App\Models\FormVehicleRunningCost; +use App\Models\FormOthers; +use App\Models\FormMeetingSeminar; class AdminsController extends Controller { @@ -121,6 +126,33 @@ class AdminsController extends Controller return redirect()->route('admin.admins.index'); } + public function expense($user_id) + { + $formUpCountry = FormUpCountry::where('user_id', $user_id)->get(); + $formEntertaimentPresentation = FormEntertaimentPresentation::where('user_id', $user_id)->get(); + $formVehicleRunningCost = FormVehicleRunningCost::where('user_id', $user_id)->get(); + $formOthers = FormOthers::where('user_id', $user_id)->get(); + $formMeetingSeminar = FormMeetingSeminar::where('user_id', $user_id)->get(); + + // Combine all forms into a single array with keys for each form type + $forms = [ + 'form_up_country' => $formUpCountry, + 'form_entertainment_presentation' => $formEntertaimentPresentation, + 'form_vehicle_running_cost' => $formVehicleRunningCost, + 'form_others' => $formOthers, + 'form_meeting_seminar' => $formMeetingSeminar, + ]; + + // Pass the forms and page information to the view + return view('backend.pages.admins.expense', [ + 'pageInfo' => [ + 'title' => 'Form Management', + ], + 'forms' => $forms, + ]); + } + + public function destroy(int $id): RedirectResponse { $this->checkAuthorization(auth()->user(), ['admin.delete']); diff --git a/app/Http/Controllers/Forms/FormEntertainmentPresentationController.php b/app/Http/Controllers/Forms/FormEntertainmentPresentationController.php index be84132..069c4fd 100644 --- a/app/Http/Controllers/Forms/FormEntertainmentPresentationController.php +++ b/app/Http/Controllers/Forms/FormEntertainmentPresentationController.php @@ -129,7 +129,7 @@ class FormEntertainmentPresentationController extends Controller ]); session()->flash('success', 'Form has been created.'); - return redirect()->route('forms.entertainment'); + return redirect()->back(); } public function edit($id) @@ -221,7 +221,7 @@ class FormEntertainmentPresentationController extends Controller ]); session()->flash('success', 'Form has been updated.'); - return redirect()->route('forms.entertainment'); + return redirect()->back(); } public function approve($id) @@ -236,7 +236,7 @@ class FormEntertainmentPresentationController extends Controller ]); session()->flash('success', 'Form has been approved.'); - return redirect()->route('forms.entertainment'); + return redirect()->back(); } public function finalApprove($id) @@ -246,7 +246,7 @@ class FormEntertainmentPresentationController extends Controller $form = FormEntertaimentPresentation::findOrfail($id); if($form->approved_at == null) { session()->flash('error', 'Form must be approved by MIS first.'); - return redirect()->route('forms.entertainment'); + return redirect()->back(); } $form->update([ @@ -256,7 +256,7 @@ class FormEntertainmentPresentationController extends Controller ]); session()->flash('success', 'Form has been final approved.'); - return redirect()->route('forms.entertainment'); + return redirect()->back(); } public function open($id) @@ -271,7 +271,7 @@ class FormEntertainmentPresentationController extends Controller ]); session()->flash('success', 'Form has been opened.'); - return redirect()->route('forms.entertainment'); + return redirect()->back(); } public function reject($id) @@ -284,7 +284,7 @@ class FormEntertainmentPresentationController extends Controller ]); session()->flash('success', 'Form has been rejected.'); - return redirect()->route('forms.entertainment'); + return redirect()->back(); } public function destroy($id) @@ -295,6 +295,6 @@ class FormEntertainmentPresentationController extends Controller $form->delete(); session()->flash('success', 'Form has been deleted.'); - return redirect()->route('forms.entertainment'); + return redirect()->back(); } } \ No newline at end of file diff --git a/app/Http/Controllers/Forms/FormMeetingSeminarController.php b/app/Http/Controllers/Forms/FormMeetingSeminarController.php index cc19469..ac83f05 100644 --- a/app/Http/Controllers/Forms/FormMeetingSeminarController.php +++ b/app/Http/Controllers/Forms/FormMeetingSeminarController.php @@ -122,7 +122,7 @@ class FormMeetingSeminarController extends Controller ]); session()->flash('success', 'Form has been created.'); - return redirect()->route('forms.meeting'); + return redirect()->back(); } public function edit($id) @@ -207,7 +207,7 @@ class FormMeetingSeminarController extends Controller ]); session()->flash('success', 'Form has been updated.'); - return redirect()->route('forms.meeting'); + return redirect()->back(); } public function approve($id) @@ -222,7 +222,7 @@ class FormMeetingSeminarController extends Controller ]); session()->flash('success', 'Form has been approved.'); - return redirect()->route('forms.meeting'); + return redirect()->back(); } public function finalApprove($id) @@ -232,7 +232,7 @@ class FormMeetingSeminarController extends Controller $form = FormMeetingSeminar::findOrfail($id); if($form->approved_at == null) { session()->flash('error', 'Form must be approved by MIS first.'); - return redirect()->route('forms.meeting'); + return redirect()->back(); } $form->update([ @@ -242,7 +242,7 @@ class FormMeetingSeminarController extends Controller ]); session()->flash('success', 'Form has been final approved.'); - return redirect()->route('forms.meeting'); + return redirect()->back(); } public function open($id) @@ -257,7 +257,7 @@ class FormMeetingSeminarController extends Controller ]); session()->flash('success', 'Form has been opened.'); - return redirect()->route('forms.meeting'); + return redirect()->back(); } public function reject($id) @@ -270,7 +270,7 @@ class FormMeetingSeminarController extends Controller ]); session()->flash('success', 'Form has been rejected.'); - return redirect()->route('forms.meeting'); + return redirect()->back(); } public function destroy($id) @@ -281,6 +281,6 @@ class FormMeetingSeminarController extends Controller $form->delete(); session()->flash('success', 'Form has been deleted.'); - return redirect()->route('forms.meeting'); + return redirect()->back(); } } \ No newline at end of file diff --git a/app/Http/Controllers/Forms/FormOtherController.php b/app/Http/Controllers/Forms/FormOtherController.php index b3c4513..8a9783a 100644 --- a/app/Http/Controllers/Forms/FormOtherController.php +++ b/app/Http/Controllers/Forms/FormOtherController.php @@ -125,7 +125,7 @@ class FormOtherController extends Controller ]); session()->flash('success', 'Form has been created.'); - return redirect()->route('forms.other'); + return redirect()->back(); } public function edit($id) @@ -212,7 +212,7 @@ class FormOtherController extends Controller ]); session()->flash('success', 'Form has been updated.'); - return redirect()->route('forms.other'); + return redirect()->back(); } public function approve($id) @@ -227,7 +227,7 @@ class FormOtherController extends Controller ]); session()->flash('success', 'Form has been approved.'); - return redirect()->route('forms.other'); + return redirect()->back(); } public function finalApprove($id) @@ -237,7 +237,7 @@ class FormOtherController extends Controller $form = FormOthers::findOrfail($id); if($form->approved_at == null) { session()->flash('error', 'Form must be approved by MIS first.'); - return redirect()->route('forms.other'); + return redirect()->back(); } $form->update([ @@ -247,7 +247,7 @@ class FormOtherController extends Controller ]); session()->flash('success', 'Form has been final approved.'); - return redirect()->route('forms.other'); + return redirect()->back(); } public function open($id) @@ -262,7 +262,7 @@ class FormOtherController extends Controller ]); session()->flash('success', 'Form has been opened.'); - return redirect()->route('forms.other'); + return redirect()->back(); } public function reject($id) @@ -275,7 +275,7 @@ class FormOtherController extends Controller ]); session()->flash('success', 'Form has been rejected.'); - return redirect()->route('forms.other'); + return redirect()->back(); } public function destroy($id) @@ -286,6 +286,6 @@ class FormOtherController extends Controller $form->delete(); session()->flash('success', 'Form has been deleted.'); - return redirect()->route('forms.other'); + return redirect()->back(); } } \ No newline at end of file diff --git a/app/Http/Controllers/Forms/FormUpCountryController.php b/app/Http/Controllers/Forms/FormUpCountryController.php index 752c3ce..e10e52b 100644 --- a/app/Http/Controllers/Forms/FormUpCountryController.php +++ b/app/Http/Controllers/Forms/FormUpCountryController.php @@ -133,7 +133,7 @@ class FormUpCountryController extends Controller ]); session()->flash('success', 'Form has been created.'); - return redirect()->route('forms.up-country'); + return redirect()->back(); } public function edit($id) @@ -229,7 +229,7 @@ class FormUpCountryController extends Controller ]); session()->flash('success', 'Form has been updated.'); - return redirect()->route('forms.up-country'); + return redirect()->back(); } public function approve($id) @@ -244,7 +244,7 @@ class FormUpCountryController extends Controller ]); session()->flash('success', 'Form has been approved.'); - return redirect()->route('forms.up-country'); + return redirect()->back(); } public function reject($id) @@ -257,7 +257,7 @@ class FormUpCountryController extends Controller ]); session()->flash('success', 'Form has been rejected.'); - return redirect()->route('forms.up-country'); + return redirect()->back(); } public function finalApprove($id) @@ -267,7 +267,7 @@ class FormUpCountryController extends Controller $form = FormUpCountry::findOrfail($id); if($form->approved_at == null) { session()->flash('error', 'Form must be approved by MIS first.'); - return redirect()->route('forms.up-country'); + return redirect()->back(); } $form->update([ @@ -277,7 +277,7 @@ class FormUpCountryController extends Controller ]); session()->flash('success', 'Form has been final approved.'); - return redirect()->route('forms.up-country'); + return redirect()->back(); } public function open($id) @@ -292,7 +292,7 @@ class FormUpCountryController extends Controller ]); session()->flash('success', 'Form has been opened.'); - return redirect()->route('forms.up-country'); + return redirect()->back(); } public function destroy($id) @@ -303,6 +303,6 @@ class FormUpCountryController extends Controller $form->delete(); session()->flash('success', 'Form has been deleted.'); - return redirect()->route('forms.up-country'); + return redirect()->back(); } } \ No newline at end of file diff --git a/app/Http/Controllers/Forms/FormVehicleController.php b/app/Http/Controllers/Forms/FormVehicleController.php index 5839a0e..a6da7b5 100644 --- a/app/Http/Controllers/Forms/FormVehicleController.php +++ b/app/Http/Controllers/Forms/FormVehicleController.php @@ -128,7 +128,7 @@ class FormVehicleController extends Controller ]); session()->flash('success', 'Form has been created.'); - return redirect()->route('forms.vehicle'); + return redirect()->back(); } public function edit($id) @@ -221,7 +221,7 @@ class FormVehicleController extends Controller ]); session()->flash('success', 'Form has been updated.'); - return redirect()->route('forms.vehicle'); + return redirect()->back(); } public function approve($id) @@ -236,7 +236,7 @@ class FormVehicleController extends Controller ]); session()->flash('success', 'Form has been approved.'); - return redirect()->route('forms.vehicle'); + return redirect()->back(); } public function finalApprove($id) @@ -246,7 +246,7 @@ class FormVehicleController extends Controller $form = FormVehicleRunningCost::findOrfail($id); if($form->approved_at == null) { session()->flash('error', 'Form must be approved by MIS first.'); - return redirect()->route('forms.vehicle'); + return redirect()->back(); } $form->update([ @@ -256,7 +256,7 @@ class FormVehicleController extends Controller ]); session()->flash('success', 'Form has been final approved.'); - return redirect()->route('forms.vehicle'); + return redirect()->back(); } public function open($id) @@ -271,7 +271,7 @@ class FormVehicleController extends Controller ]); session()->flash('success', 'Form has been opened.'); - return redirect()->route('forms.vehicle'); + return redirect()->back(); } public function reject($id) @@ -284,7 +284,7 @@ class FormVehicleController extends Controller ]); session()->flash('success', 'Form has been rejected.'); - return redirect()->route('forms.vehicle'); + return redirect()->back(); } public function destroy($id) @@ -295,6 +295,6 @@ class FormVehicleController extends Controller $form->delete(); session()->flash('success', 'Form has been deleted.'); - return redirect()->route('forms.vehicle'); + return redirect()->back(); } } \ No newline at end of file diff --git a/resources/views/backend/pages/admins/expense.blade.php b/resources/views/backend/pages/admins/expense.blade.php new file mode 100644 index 0000000..9dae772 --- /dev/null +++ b/resources/views/backend/pages/admins/expense.blade.php @@ -0,0 +1,838 @@ +@extends('layouts.app') + +@section('title') + {{ $pageInfo['title'] }} +@endsection + +@section('admin-content') +
+
+
+
+

{{ $pageInfo['title'] }}

+
+
+ +
+
+
+
+ + @php + use App\Helpers\NextCloudHelper; + @endphp + +
+
+ +
+
+
+
+

Form Up Country

+
+ @include('backend.layouts.partials.messages') + + + + + + + + + + + + + + + + @if (auth()->user()->can('approval.approve') || auth()->user()->can('final_approval.approve')) + + @endif + + + + + @foreach ($forms['form_up_country'] as $index => $form) + + + + + + + + + + + + + + @if (auth()->user()->can('approval.approve')) + + @elseif(auth()->user()->can('final_approval.approve')) + + @endif + + + @endforeach + +
#NamaRayonTanggalTujuanJarakTotalBukti 1Bukti 2Bukti 3Account NumberStatusApprovalAksi
{{ $loop->iteration }}{{ $form->user->name }}{{ $form->rayon->code }}{{ \Carbon\Carbon::parse($form->tanggal)->locale('id')->isoFormat('D MMMM Y') }}{{ $form->tujuan }}{{ $form->jarak }} km{{ number_format($form->total, 0, ',', '.') }} + @if ($form->bukti1) + + Download + + @else + - + @endif + + @if ($form->bukti2) + + Download + + @else + - + @endif + + @if ($form->bukti3) + + Download + + @else + - + @endif + {{ $form->account_number }} + @if ($form->status == 'On Progress') + {{ $form->status }} + @elseif ($form->status == 'Approved' || $form->status == 'Final Approved') + {{ $form->status }} + @else + {{ $form->status }} + @endif + + {{-- approve / reject button --}} + @if ($form->status == 'On Progress') +
+ @csrf + @method('PUT') + +
+ +
+ @csrf + @method('PUT') + +
+ @else + @if ($form->approved_at) + {{ \Carbon\Carbon::parse($form->approved_at)->locale('id')->isoFormat('D MMMM Y') }} + @elseif($form->rejected_at) + {{ \Carbon\Carbon::parse($form->rejected_at)->locale('id')->isoFormat('D MMMM Y') }} + @else + - + @endif + @endif +
+ {{-- approve / reject button --}} + @if ($form->status == 'Approved' && $form->approved_at && !$form->final_approved_at) +
+ @csrf + @method('PUT') + +
+ @else + @if ($form->final_approved_at) +
+ @csrf + @method('PUT') + +
+ @else + - + @endif + @endif +
+ @if (auth()->user()->can('forms.country.edit')) + + + + @endif + + @if (auth()->user()->can('forms.country.delete')) +
+ @csrf + @method('DELETE') + +
+ @endif +
+
+
+
+
+
+ + +
+
+
+
+

Form Vehicle Running Cost

+
+ + + + + + + + + + + + + + + + + @if (auth()->user()->can('approval.approve') || auth()->user()->can('final_approval.approve')) + + @endif + + + + + @foreach ($forms['form_vehicle_running_cost'] as $index => $form) + + + + + + + + + + + + + + + @if (auth()->user()->can('approval.approve')) + + @elseif(auth()->user()->can('final_approval.approve')) + + @endif + + + @endforeach + +
#NamaTanggalLiterHargaJarakTipe BensinNomor PolisiBukti 1Bukti 2Bukti 3Account NumberStatusApprovalAksi
{{ $loop->iteration }}{{ $form->user->name }}{{ \Carbon\Carbon::parse($form->tanggal)->locale('id')->isoFormat('dddd, D MMMM Y HH:mm:ss') }}{{ $form->liter }}{{ number_format($form->harga, 0, ',', '.') }}{{ $form->jarak }}{{ $form->tipe_bensin }}{{ $form->nopol }} + @if ($form->bukti1) + + Download + + @else + - + @endif + + @if ($form->bukti2) + + Download + + @else + - + @endif + + @if ($form->bukti3) + + Download + + @else + - + @endif + {{ $form->account_number }} + @if ($form->status == 'On Progress') + {{ $form->status }} + @elseif ($form->status == 'Approved' || $form->status == 'Final Approved') + {{ $form->status }} + @else + {{ $form->status }} + @endif + + {{-- approve / reject button --}} + @if ($form->status == 'On Progress') +
+ @csrf + @method('PUT') + +
+ +
+ @csrf + @method('PUT') + +
+ @else + @if ($form->approved_at) + {{ \Carbon\Carbon::parse($form->approved_at)->locale('id')->isoFormat('D MMMM Y') }} + @elseif($form->rejected_at) + {{ \Carbon\Carbon::parse($form->rejected_at)->locale('id')->isoFormat('D MMMM Y') }} + @else + - + @endif + @endif +
+ {{-- approve / reject button --}} + @if ($form->status == 'Approved' && $form->approved_at && !$form->final_approved_at) +
+ @csrf + @method('PUT') + +
+ @else + @if ($form->final_approved_at) +
+ @csrf + @method('PUT') + +
+ @else + - + @endif + @endif +
+ @if (auth()->user()->can('forms.vehicle.edit')) + + + + @endif + + @if (auth()->user()->can('forms.vehicle.delete')) +
+ @csrf + @method('DELETE') + +
+ @endif +
+
+
+
+
+
+ + +
+
+
+
+

Form Entertainment Presentation

+
+ + + + + + + + + + + + + + + + @if (auth()->user()->can('approval.approve') || auth()->user()->can('final_approval.approve')) + + @endif + + + + + @foreach ($forms['form_entertainment_presentation'] as $index => $form) + + + + + + + + + + + + + + @if (auth()->user()->can('approval.approve')) + + @elseif(auth()->user()->can('final_approval.approve')) + + @endif + + + @endforeach + +
#NamaTanggalJenisKeteranganTotalNama PenerimaBukti 1Bukti 2Bukti 3Account NumberStatusApprovalAksi
{{ $loop->iteration }}{{ $form->user->name }}{{ \Carbon\Carbon::parse($form->tanggal)->locale('id')->isoFormat('D MMMM Y') }}{{ $form->jenis }}{{ $form->keterangan }}{{ number_format($form->total, 0, ',', '.') }}{{ $form->name }} + @if ($form->bukti1) + + Download + + @else + - + @endif + + @if ($form->bukti2) + + Download + + @else + - + @endif + + @if ($form->bukti3) + + Download + + @else + - + @endif + {{ $form->account_number }} + @if ($form->status == 'On Progress') + {{ $form->status }} + @elseif ($form->status == 'Approved' || $form->status == 'Final Approved') + {{ $form->status }} + @else + {{ $form->status }} + @endif + + {{-- approve / reject button --}} + @if ($form->status == 'On Progress') +
+ @csrf + @method('PUT') + +
+ +
+ @csrf + @method('PUT') + +
+ @else + @if ($form->approved_at) + {{ \Carbon\Carbon::parse($form->approved_at)->locale('id')->isoFormat('D MMMM Y') }} + @elseif($form->rejected_at) + {{ \Carbon\Carbon::parse($form->rejected_at)->locale('id')->isoFormat('D MMMM Y') }} + @else + - + @endif + @endif +
+ {{-- approve / reject button --}} + @if ($form->status == 'Approved' && $form->approved_at && !$form->final_approved_at) +
+ @csrf + @method('PUT') + +
+ @else + @if ($form->final_approved_at) +
+ @csrf + @method('PUT') + +
+ @else + - + @endif + @endif +
+ @if (auth()->user()->can('forms.entertainment.edit')) + + + + @endif + + @if (auth()->user()->can('forms.entertainment.delete')) +
+ @csrf + @method('DELETE') + +
+ @endif +
+
+
+
+
+
+ + +
+
+
+
+

Form Meeting Seminar

+
+ + + + + + + + + + + + + + + + @if (auth()->user()->can('approval.approve') || auth()->user()->can('final_approval.approve')) + + @endif + + + + + @foreach ($forms['form_meeting_seminar'] as $index => $form) + + + + + + + + + + + + + + @if (auth()->user()->can('approval.approve')) + + @elseif(auth()->user()->can('final_approval.approve')) + + @endif + + + @endforeach + +
#NamaTanggalAllowanceTransport AnkotHotelTotalBukti 1Bukti 2Bukti 3Account NumberStatusApprovalAksi
{{ $loop->iteration }}{{ $form->user->name }}{{ \Carbon\Carbon::parse($form->created_at)->locale('id')->isoFormat('D MMMM Y') }}{{ number_format($form->allowance, 0, ',', '.') }}{{ number_format($form->transport_ankot, 0, ',', '.') }}{{ number_format($form->hotel, 0, ',', '.') }}{{ number_format($form->total, 0, ',', '.') }} + @if ($form->bukti1) + + Download + + @else + - + @endif + + @if ($form->bukti2) + + Download + + @else + - + @endif + + @if ($form->bukti3) + + Download + + @else + - + @endif + {{ $form->account_number }} + @if ($form->status == 'On Progress') + {{ $form->status }} + @elseif ($form->status == 'Approved' || $form->status == 'Final Approved') + {{ $form->status }} + @else + {{ $form->status }} + @endif + + {{-- approve / reject button --}} + @if ($form->status == 'On Progress') +
+ @csrf + @method('PUT') + +
+ +
+ @csrf + @method('PUT') + +
+ @else + @if ($form->approved_at) + {{ \Carbon\Carbon::parse($form->approved_at)->locale('id')->isoFormat('D MMMM Y') }} + @elseif($form->rejected_at) + {{ \Carbon\Carbon::parse($form->rejected_at)->locale('id')->isoFormat('D MMMM Y') }} + @else + - + @endif + @endif +
+ {{-- approve / reject button --}} + @if ($form->status == 'Approved' && $form->approved_at && !$form->final_approved_at) +
+ @csrf + @method('PUT') + +
+ @else + @if ($form->final_approved_at) +
+ @csrf + @method('PUT') + +
+ @else + - + @endif + @endif +
+ @if (auth()->user()->can('forms.meeting.edit')) + + + + @endif + + @if (auth()->user()->can('forms.meeting.delete')) +
+ @csrf + @method('DELETE') + +
+ @endif +
+
+
+
+
+
+ + +
+
+
+
+

Form Others

+
+ + + + + + + + + + + + + + + @if (auth()->user()->can('approval.approve') || auth()->user()->can('final_approval.approve')) + + @endif + + + + + @foreach ($forms['form_others'] as $index => $form) + + + + + + + + + + + + + @if (auth()->user()->can('approval.approve')) + + @elseif(auth()->user()->can('final_approval.approve')) + + @endif + + + @endforeach + +
#NamaTanggalJenisKeteranganTotalBukti 1Bukti 2Bukti 3Account NumberStatusApprovalAksi
{{ $loop->iteration }}{{ $form->user->name }}{{ \Carbon\Carbon::parse($form->tanggal)->locale('id')->isoFormat('D MMMM Y') }}{{ $form->kategori->name }}{{ $form->keterangan }}{{ number_format($form->total, 0, ',', '.') }} + @if ($form->bukti1) + + Download + + @else + - + @endif + + @if ($form->bukti2) + + Download + + @else + - + @endif + + @if ($form->bukti3) + + Download + + @else + - + @endif + {{ $form->account_number }} + @if ($form->status == 'On Progress') + {{ $form->status }} + @elseif ($form->status == 'Approved' || $form->status == 'Final Approved') + {{ $form->status }} + @else + {{ $form->status }} + @endif + + {{-- approve / reject button --}} + @if ($form->status == 'On Progress') +
+ @csrf + @method('PUT') + +
+ +
+ @csrf + @method('PUT') + +
+ @else + @if ($form->approved_at) + {{ \Carbon\Carbon::parse($form->approved_at)->locale('id')->isoFormat('D MMMM Y') }} + @elseif($form->rejected_at) + {{ \Carbon\Carbon::parse($form->rejected_at)->locale('id')->isoFormat('D MMMM Y') }} + @else + - + @endif + @endif +
+ {{-- approve / reject button --}} + @if ($form->status == 'Approved' && $form->approved_at && !$form->final_approved_at) +
+ @csrf + @method('PUT') + +
+ @else + @if ($form->final_approved_at) +
+ @csrf + @method('PUT') + +
+ @else + - + @endif + @endif +
+ @if (auth()->user()->can('forms.other.edit')) + + + + @endif + + @if (auth()->user()->can('forms.other.delete')) +
+ @csrf + @method('DELETE') + +
+ @endif +
+
+
+
+
+
+
+
+@endsection + +@section('scripts') + +@endsection diff --git a/resources/views/backend/pages/admins/index.blade.php b/resources/views/backend/pages/admins/index.blade.php index 071d03a..abb5663 100644 --- a/resources/views/backend/pages/admins/index.blade.php +++ b/resources/views/backend/pages/admins/index.blade.php @@ -64,6 +64,7 @@ @endforeach + View Expense @if (auth()->user()->can('admin.edit')) Edit diff --git a/routes/web.php b/routes/web.php index 842b8f5..cd0308a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -35,6 +35,7 @@ Route::group(['prefix' => 'admin', 'as' => 'admin.'], function () { */ Route::group(['prefix' => 'admin', 'as' => 'admin.', 'middleware' => ['auth:admin', 'menu']], function () { Route::resource('admins', AdminsController::class); + Route::get('/admins/expense/{user_id}', [AdminsController::class, 'expense'])->name('admins.expense'); Route::resource('roles', RolesController::class); Route::get('/admin', [DashboardController::class, 'index'])->name('dashboard');