fix table responsive

This commit is contained in:
Jagad R R
2024-12-27 13:03:19 +07:00
parent cc9e2d7214
commit c8c650761d
8 changed files with 830 additions and 694 deletions
+1
View File
@@ -19,6 +19,7 @@
"phpoffice/phpspreadsheet": "^3.5", "phpoffice/phpspreadsheet": "^3.5",
"singlequote/laravel-webdav": "^1.1", "singlequote/laravel-webdav": "^1.1",
"spatie/laravel-html": "^3.11", "spatie/laravel-html": "^3.11",
"spatie/laravel-image-optimizer": "^1.8",
"spatie/laravel-menu": "^4.2", "spatie/laravel-menu": "^4.2",
"spatie/laravel-permission": "^6.10", "spatie/laravel-permission": "^6.10",
"yajra/laravel-datatables-oracle": "11.0" "yajra/laravel-datatables-oracle": "11.0"
Generated
+124 -1
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "fc2177036b736100113a527777c8cbc8", "content-hash": "21b0b8595f584053b4b3e6a9267a2a47",
"packages": [ "packages": [
{ {
"name": "barryvdh/laravel-dompdf", "name": "barryvdh/laravel-dompdf",
@@ -4856,6 +4856,61 @@
}, },
"time": "2024-06-07T12:41:19+00:00" "time": "2024-06-07T12:41:19+00:00"
}, },
{
"name": "spatie/image-optimizer",
"version": "1.8.0",
"source": {
"type": "git",
"url": "https://github.com/spatie/image-optimizer.git",
"reference": "4fd22035e81d98fffced65a8c20d9ec4daa9671c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/image-optimizer/zipball/4fd22035e81d98fffced65a8c20d9ec4daa9671c",
"reference": "4fd22035e81d98fffced65a8c20d9ec4daa9671c",
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
"php": "^7.3|^8.0",
"psr/log": "^1.0 | ^2.0 | ^3.0",
"symfony/process": "^4.2|^5.0|^6.0|^7.0"
},
"require-dev": {
"pestphp/pest": "^1.21",
"phpunit/phpunit": "^8.5.21|^9.4.4",
"symfony/var-dumper": "^4.2|^5.0|^6.0|^7.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Spatie\\ImageOptimizer\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Freek Van der Herten",
"email": "freek@spatie.be",
"homepage": "https://spatie.be",
"role": "Developer"
}
],
"description": "Easily optimize images using PHP",
"homepage": "https://github.com/spatie/image-optimizer",
"keywords": [
"image-optimizer",
"spatie"
],
"support": {
"issues": "https://github.com/spatie/image-optimizer/issues",
"source": "https://github.com/spatie/image-optimizer/tree/1.8.0"
},
"time": "2024-11-04T08:24:54+00:00"
},
{ {
"name": "spatie/laravel-html", "name": "spatie/laravel-html",
"version": "3.11.1", "version": "3.11.1",
@@ -4934,6 +4989,74 @@
], ],
"time": "2024-10-18T14:37:21+00:00" "time": "2024-10-18T14:37:21+00:00"
}, },
{
"name": "spatie/laravel-image-optimizer",
"version": "1.8.0",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-image-optimizer.git",
"reference": "024752cba691fee3cd1800000b6aa3da3b8b2474"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-image-optimizer/zipball/024752cba691fee3cd1800000b6aa3da3b8b2474",
"reference": "024752cba691fee3cd1800000b6aa3da3b8b2474",
"shasum": ""
},
"require": {
"laravel/framework": "^8.0|^9.0|^10.0|^11.0",
"php": "^8.0",
"spatie/image-optimizer": "^1.2.0"
},
"require-dev": {
"orchestra/testbench": "^6.23|^7.0|^8.0|^9.0",
"phpunit/phpunit": "^9.4|^10.5"
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"ImageOptimizer": "Spatie\\LaravelImageOptimizer\\Facades\\ImageOptimizer"
},
"providers": [
"Spatie\\LaravelImageOptimizer\\ImageOptimizerServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Spatie\\LaravelImageOptimizer\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Freek Van der Herten",
"email": "freek@spatie.be",
"homepage": "https://spatie.be",
"role": "Developer"
}
],
"description": "Optimize images in your Laravel app",
"homepage": "https://github.com/spatie/laravel-image-optimizer",
"keywords": [
"laravel-image-optimizer",
"spatie"
],
"support": {
"source": "https://github.com/spatie/laravel-image-optimizer/tree/1.8.0"
},
"funding": [
{
"url": "https://spatie.be/open-source/support-us",
"type": "custom"
}
],
"time": "2024-02-29T10:55:08+00:00"
},
{ {
"name": "spatie/laravel-menu", "name": "spatie/laravel-menu",
"version": "4.2.0", "version": "4.2.0",
@@ -77,161 +77,163 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="dataTables_wrapper dt-bootstrap4 mt-2"> <div class="dataTables_wrapper dt-bootstrap4 mt-2">
@include('backend.layouts.partials.messages') @include('backend.layouts.partials.messages')
<table id="dataTable" <div class="table-responsive">
class="table table-bordered table-striped table-head-fixed table-responsive dataTable dtr-inline" <table id="dataTable"
style="width:100%"> class="table table-bordered table-striped table-head-fixed dataTable dtr-inline"
<thead class="bg-light text-capitalize"> style="width:100%">
<tr> <thead class="bg-light text-capitalize">
<th>#</th>
<th>Nama</th>
<th>Tanggal</th>
<th>Jenis</th>
<th>Keterangan</th>
<th>Total</th>
<th>Nama Penerima</th>
<th>Bukti 1</th>
<th>Bukti 2</th>
<th>Bukti 3</th>
<th>Account Number</th>
<th>Status</th>
@if (auth()->user()->can('approval.approve'))
<th>Approval</th>
@endif
@if (auth()->user()->can('final_approval.approve'))
<th>Final Approval</th>
@endif
<th>Aksi</th>
</tr>
</thead>
<tbody>
@php
use App\Helpers\NextCloudHelper;
@endphp
@foreach ($forms as $item)
<tr> <tr>
<td>{{ $loop->iteration }}</td> <th>#</th>
<td>{{ $item->user->name }}</td> <th>Nama</th>
<td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('D MMMM Y') }}</td> <th>Tanggal</th>
<td>{{ $item->jenis }}</td> <th>Jenis</th>
<td>{{ $item->keterangan }}</td> <th>Keterangan</th>
<td>{{ number_format($item->total, 0, ',', '.') }}</td> <th>Total</th>
<td>{{ $item->name }}</td> <th>Nama Penerima</th>
<td> <th>Bukti 1</th>
@if ($item->bukti1) <th>Bukti 2</th>
<a href="{{ NextCloudHelper::getFileUrl($item->bukti1) }}" target="_blank"> <th>Bukti 3</th>
Download <th>Account Number</th>
</a> <th>Status</th>
@else
-
@endif
</td>
<td>
@if ($item->bukti2)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti2) }}" target="_blank">
Download
</a>
@else
-
@endif
</td>
<td>
@if ($item->bukti3)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti3) }}" target="_blank">
Download
</a>
@else
-
@endif
</td>
<td>{{ $item->account_number }}</td>
<td>
@if ($item->status == 'On Progress')
<span class="badge badge-warning text-white">{{ $item->status }}</span>
@elseif ($item->status == 'Approved' || $item->status == 'Final Approved')
<span class="badge badge-success text-white">{{ $item->status }}</span>
@else
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
@if (auth()->user()->can('approval.approve')) @if (auth()->user()->can('approval.approve'))
<th>Approval</th>
@endif
@if (auth()->user()->can('final_approval.approve'))
<th>Final Approval</th>
@endif
<th>Aksi</th>
</tr>
</thead>
<tbody>
@php
use App\Helpers\NextCloudHelper;
@endphp
@foreach ($forms as $item)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $item->user->name }}</td>
<td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('D MMMM Y') }}</td>
<td>{{ $item->jenis }}</td>
<td>{{ $item->keterangan }}</td>
<td>{{ number_format($item->total, 0, ',', '.') }}</td>
<td>{{ $item->name }}</td>
<td> <td>
{{-- approve / reject button --}} @if ($item->bukti1)
@if ($item->status == 'On Progress') <a href="{{ NextCloudHelper::getFileUrl($item->bukti1) }}" target="_blank">
<form action="{{ route('forms.entertainment.approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> Download
@csrf </a>
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Approve
</button>
</form>
<form action="{{ route('forms.entertainment.reject', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to reject this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-danger btn-sm">
Reject
</button>
</form>
@else @else
@if ($item->approved_at) -
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif @endif
</td> </td>
@endif
@if(auth()->user()->can('final_approval.approve'))
<td> <td>
{{-- approve / reject button --}} @if ($item->bukti2)
@if ($item->status == 'Approved' && $item->approved_at && !$item->final_approved_at) <a href="{{ NextCloudHelper::getFileUrl($item->bukti2) }}" target="_blank">
<form action="{{ route('forms.entertainment.final-approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> Download
@csrf </a>
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Final Approve
</button>
</form>
@else @else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open')) -
<form action="{{ route('forms.entertainment.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> @endif
</td>
<td>
@if ($item->bukti3)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti3) }}" target="_blank">
Download
</a>
@else
-
@endif
</td>
<td>{{ $item->account_number }}</td>
<td>
@if ($item->status == 'On Progress')
<span class="badge badge-warning text-white">{{ $item->status }}</span>
@elseif ($item->status == 'Approved' || $item->status == 'Final Approved')
<span class="badge badge-success text-white">{{ $item->status }}</span>
@else
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
@if (auth()->user()->can('approval.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'On Progress')
<form action="{{ route('forms.entertainment.approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf @csrf
@method('PUT') @method('PUT')
<button type="submit" class="btn btn-success btn-sm"> <button type="submit" class="btn btn-success btn-sm">
Open Approve
</button>
</form>
<form action="{{ route('forms.entertainment.reject', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to reject this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-danger btn-sm">
Reject
</button> </button>
</form> </form>
@elseif ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@else @else
- @if ($item->approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif @endif
</td>
@endif
@if(auth()->user()->can('final_approval.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'Approved' && $item->approved_at && !$item->final_approved_at)
<form action="{{ route('forms.entertainment.final-approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Final Approve
</button>
</form>
@else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
<form action="{{ route('forms.entertainment.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Open
</button>
</form>
@elseif ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
</td>
@endif
<td>
@if (auth()->user()->can('forms.entertainment.edit'))
<a href="{{ route('forms.entertainment.edit', $item->id) }}" class="btn btn-warning btn-sm">
<i class="fas fa-edit text-white"></i>
</a>
@endif
@if (auth()->user()->can('forms.entertainment.delete'))
<form action="{{ route('forms.entertainment.destroy', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this item?');">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger btn-sm">
<i class="fas fa-trash"></i>
</button>
</form>
@endif @endif
</td> </td>
@endif </tr>
<td> @endforeach
@if (auth()->user()->can('forms.entertainment.edit')) </tbody>
<a href="{{ route('forms.entertainment.edit', $item->id) }}" class="btn btn-warning btn-sm"> </table>
<i class="fas fa-edit text-white"></i> </div>
</a>
@endif
@if (auth()->user()->can('forms.entertainment.delete'))
<form action="{{ route('forms.entertainment.destroy', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this item?');">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger btn-sm">
<i class="fas fa-trash"></i>
</button>
</form>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div> </div>
</div> </div>
</div> </div>
@@ -77,161 +77,163 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="dataTables_wrapper dt-bootstrap4 mt-2"> <div class="dataTables_wrapper dt-bootstrap4 mt-2">
@include('backend.layouts.partials.messages') @include('backend.layouts.partials.messages')
<table id="dataTable" <div class="table-responsive">
class="table table-bordered table-striped table-responsive table-head-fixed dataTable dtr-inline" <table id="dataTable"
style="width:100%"> class="table table-bordered table-striped table-head-fixed dataTable dtr-inline"
<thead class="bg-light text-capitalize"> style="width:100%">
<tr> <thead class="bg-light text-capitalize">
<th>#</th>
<th>Nama</th>
<th>Tanggal</th>
<th>Allowance</th>
<th>Transport Ankot</th>
<th>Hotel</th>
<th>Total</th>
<th>Bukti 1</th>
<th>Bukti 2</th>
<th>Bukti 3</th>
<th>Account Number</th>
<th>Status</th>
@if (auth()->user()->can('approval.approve'))
<th>Approval</th>
@endif
@if (auth()->user()->can('final_approval.approve'))
<th>Final Approval</th>
@endif
<th>Aksi</th>
</tr>
</thead>
<tbody>
@php
use App\Helpers\NextCloudHelper;
@endphp
@foreach ($forms as $item)
<tr> <tr>
<td>{{ $loop->iteration }}</td> <th>#</th>
<td>{{ $item->user->name }}</td> <th>Nama</th>
<td>{{ \Carbon\Carbon::parse($item->created_at)->locale('id')->isoFormat('D MMMM Y') }}</td> <th>Tanggal</th>
<td>{{ number_format($item->allowance, 0, ',', '.') }}</td> <th>Allowance</th>
<td>{{ number_format($item->transport_ankot, 0, ',', '.') }}</td> <th>Transport Ankot</th>
<td>{{ number_format($item->hotel, 0, ',', '.') }}</td> <th>Hotel</th>
<td>{{ number_format($item->total, 0, ',', '.') }}</td> <th>Total</th>
<td> <th>Bukti 1</th>
@if ($item->bukti1) <th>Bukti 2</th>
<a href="{{ NextCloudHelper::getFileUrl($item->bukti1) }}" target="_blank"> <th>Bukti 3</th>
Download <th>Account Number</th>
</a> <th>Status</th>
@else
-
@endif
</td>
<td>
@if ($item->bukti2)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti2) }}" target="_blank">
Download
</a>
@else
-
@endif
</td>
<td>
@if ($item->bukti3)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti3) }}" target="_blank">
Download
</a>
@else
-
@endif
</td>
<td>{{ $item->account_number }}</td>
<td>
@if ($item->status == 'On Progress')
<span class="badge badge-warning text-white">{{ $item->status }}</span>
@elseif ($item->status == 'Approved' || $item->status == 'Final Approved')
<span class="badge badge-success text-white">{{ $item->status }}</span>
@else
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
@if (auth()->user()->can('approval.approve')) @if (auth()->user()->can('approval.approve'))
<th>Approval</th>
@endif
@if (auth()->user()->can('final_approval.approve'))
<th>Final Approval</th>
@endif
<th>Aksi</th>
</tr>
</thead>
<tbody>
@php
use App\Helpers\NextCloudHelper;
@endphp
@foreach ($forms as $item)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $item->user->name }}</td>
<td>{{ \Carbon\Carbon::parse($item->created_at)->locale('id')->isoFormat('D MMMM Y') }}</td>
<td>{{ number_format($item->allowance, 0, ',', '.') }}</td>
<td>{{ number_format($item->transport_ankot, 0, ',', '.') }}</td>
<td>{{ number_format($item->hotel, 0, ',', '.') }}</td>
<td>{{ number_format($item->total, 0, ',', '.') }}</td>
<td> <td>
{{-- approve / reject button --}} @if ($item->bukti1)
@if ($item->status == 'On Progress') <a href="{{ NextCloudHelper::getFileUrl($item->bukti1) }}" target="_blank">
<form action="{{ route('forms.meeting.approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> Download
@csrf </a>
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Approve
</button>
</form>
<form action="{{ route('forms.meeting.reject', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to reject this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-danger btn-sm">
Reject
</button>
</form>
@else @else
@if ($item->approved_at) -
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif @endif
</td> </td>
@endif
@if(auth()->user()->can('final_approval.approve'))
<td> <td>
{{-- approve / reject button --}} @if ($item->bukti2)
@if ($item->status == 'Approved' && $item->approved_at && !$item->final_approved_at) <a href="{{ NextCloudHelper::getFileUrl($item->bukti2) }}" target="_blank">
<form action="{{ route('forms.meeting.final-approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> Download
@csrf </a>
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Final Approve
</button>
</form>
@else @else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open')) -
<form action="{{ route('forms.meeting.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> @endif
</td>
<td>
@if ($item->bukti3)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti3) }}" target="_blank">
Download
</a>
@else
-
@endif
</td>
<td>{{ $item->account_number }}</td>
<td>
@if ($item->status == 'On Progress')
<span class="badge badge-warning text-white">{{ $item->status }}</span>
@elseif ($item->status == 'Approved' || $item->status == 'Final Approved')
<span class="badge badge-success text-white">{{ $item->status }}</span>
@else
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
@if (auth()->user()->can('approval.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'On Progress')
<form action="{{ route('forms.meeting.approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf @csrf
@method('PUT') @method('PUT')
<button type="submit" class="btn btn-success btn-sm"> <button type="submit" class="btn btn-success btn-sm">
Open Approve
</button>
</form>
<form action="{{ route('forms.meeting.reject', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to reject this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-danger btn-sm">
Reject
</button> </button>
</form> </form>
@elseif ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@else @else
- @if ($item->approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif @endif
</td>
@endif
@if(auth()->user()->can('final_approval.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'Approved' && $item->approved_at && !$item->final_approved_at)
<form action="{{ route('forms.meeting.final-approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Final Approve
</button>
</form>
@else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
<form action="{{ route('forms.meeting.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Open
</button>
</form>
@elseif ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
</td>
@endif
<td>
@if (auth()->user()->can('forms.meeting.edit'))
<a href="{{ route('forms.meeting.edit', $item->id) }}" class="btn btn-warning btn-sm">
<i class="fas fa-edit text-white"></i>
</a>
@endif
@if (auth()->user()->can('forms.meeting.delete'))
<form action="{{ route('forms.meeting.destroy', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this item?');">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger btn-sm">
<i class="fas fa-trash"></i>
</button>
</form>
@endif @endif
</td> </td>
@endif </tr>
<td> @endforeach
@if (auth()->user()->can('forms.meeting.edit')) </tbody>
<a href="{{ route('forms.meeting.edit', $item->id) }}" class="btn btn-warning btn-sm"> </table>
<i class="fas fa-edit text-white"></i> </div>
</a>
@endif
@if (auth()->user()->can('forms.meeting.delete'))
<form action="{{ route('forms.meeting.destroy', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this item?');">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger btn-sm">
<i class="fas fa-trash"></i>
</button>
</form>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div> </div>
</div> </div>
</div> </div>
@@ -77,159 +77,161 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="dataTables_wrapper dt-bootstrap4 mt-2"> <div class="dataTables_wrapper dt-bootstrap4 mt-2">
@include('backend.layouts.partials.messages') @include('backend.layouts.partials.messages')
<table id="dataTable" <div class="table-responsive">
class="table table-bordered table-striped table-responsive table-head-fixed dataTable dtr-inline" <table id="dataTable"
style="width:100%"> class="table table-bordered table-striped w-100 dataTable dtr-inline"
<thead class="bg-light text-capitalize"> style="width:100%">
<tr> <thead class="bg-light text-capitalize" style="width: 100%">
<th>#</th>
<th>Nama</th>
<th>Tanggal</th>
<th>Jenis</th>
<th>Keterangan</th>
<th>Total</th>
<th>Bukti 1</th>
<th>Bukti 2</th>
<th>Bukti 3</th>
<th>Account Number</th>
<th>Status</th>
@if (auth()->user()->can('approval.approve'))
<th>Approval</th>
@endif
@if (auth()->user()->can('final_approval.approve'))
<th>Final Approval</th>
@endif
<th>Aksi</th>
</tr>
</thead>
<tbody>
@php
use App\Helpers\NextCloudHelper;
@endphp
@foreach ($forms as $item)
<tr> <tr>
<td>{{ $loop->iteration }}</td> <th>#</th>
<td>{{ $item->user->name }}</td> <th>Nama</th>
<td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('D MMMM Y') }}</td> <th>Tanggal</th>
<td>{{ $item->kategori->name }}</td> <th>Jenis</th>
<td>{{ $item->keterangan }}</td> <th>Keterangan</th>
<td>{{ number_format($item->total, 0, ',', '.') }}</td> <th>Total</th>
<td> <th>Bukti 1</th>
@if ($item->bukti1) <th>Bukti 2</th>
<a href="{{ NextCloudHelper::getFileUrl($item->bukti1) }}" target="_blank"> <th>Bukti 3</th>
Download <th>Account Number</th>
</a> <th>Status</th>
@else
-
@endif
</td>
<td>
@if ($item->bukti2)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti2) }}" target="_blank">
Download
</a>
@else
-
@endif
</td>
<td>
@if ($item->bukti3)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti3) }}" target="_blank">
Download
</a>
@else
-
@endif
</td>
<td>{{ $item->account_number }}</td>
<td>
@if ($item->status == 'On Progress')
<span class="badge badge-warning text-white">{{ $item->status }}</span>
@elseif ($item->status == 'Approved' || $item->status == 'Final Approved')
<span class="badge badge-success text-white">{{ $item->status }}</span>
@else
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
@if (auth()->user()->can('approval.approve')) @if (auth()->user()->can('approval.approve'))
<th>Approval</th>
@endif
@if (auth()->user()->can('final_approval.approve'))
<th>Final Approval</th>
@endif
<th>Aksi</th>
</tr>
</thead>
<tbody style="width: 100%">
@php
use App\Helpers\NextCloudHelper;
@endphp
@foreach ($forms as $item)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $item->user->name }}</td>
<td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('D MMMM Y') }}</td>
<td>{{ $item->kategori->name }}</td>
<td>{{ $item->keterangan }}</td>
<td>{{ number_format($item->total, 0, ',', '.') }}</td>
<td> <td>
{{-- approve / reject button --}} @if ($item->bukti1)
@if ($item->status == 'On Progress') <a href="{{ NextCloudHelper::getFileUrl($item->bukti1) }}" target="_blank">
<form action="{{ route('forms.other.approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> Download
@csrf </a>
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Approve
</button>
</form>
<form action="{{ route('forms.other.reject', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to reject this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-danger btn-sm">
Reject
</button>
</form>
@else @else
@if ($item->approved_at) -
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif @endif
</td> </td>
@endif
@if(auth()->user()->can('final_approval.approve'))
<td> <td>
{{-- approve / reject button --}} @if ($item->bukti2)
@if ($item->status == 'Approved' && $item->approved_at && !$item->final_approved_at) <a href="{{ NextCloudHelper::getFileUrl($item->bukti2) }}" target="_blank">
<form action="{{ route('forms.other.final-approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> Download
@csrf </a>
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Final Approve
</button>
</form>
@else @else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open')) -
<form action="{{ route('forms.other.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> @endif
</td>
<td>
@if ($item->bukti3)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti3) }}" target="_blank">
Download
</a>
@else
-
@endif
</td>
<td>{{ $item->account_number }}</td>
<td>
@if ($item->status == 'On Progress')
<span class="badge badge-warning text-white">{{ $item->status }}</span>
@elseif ($item->status == 'Approved' || $item->status == 'Final Approved')
<span class="badge badge-success text-white">{{ $item->status }}</span>
@else
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
@if (auth()->user()->can('approval.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'On Progress')
<form action="{{ route('forms.other.approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf @csrf
@method('PUT') @method('PUT')
<button type="submit" class="btn btn-success btn-sm"> <button type="submit" class="btn btn-success btn-sm">
Open Approve
</button>
</form>
<form action="{{ route('forms.other.reject', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to reject this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-danger btn-sm">
Reject
</button> </button>
</form> </form>
@elseif ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@else @else
- @if ($item->approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif @endif
</td>
@endif
@if(auth()->user()->can('final_approval.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'Approved' && $item->approved_at && !$item->final_approved_at)
<form action="{{ route('forms.other.final-approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Final Approve
</button>
</form>
@else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
<form action="{{ route('forms.other.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Open
</button>
</form>
@elseif ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
</td>
@endif
<td>
@if (auth()->user()->can('forms.other.edit'))
<a href="{{ route('forms.other.edit', $item->id) }}" class="btn btn-warning btn-sm">
<i class="fas fa-edit text-white"></i>
</a>
@endif
@if (auth()->user()->can('forms.other.delete'))
<form action="{{ route('forms.other.destroy', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this item?');">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger btn-sm">
<i class="fas fa-trash"></i>
</button>
</form>
@endif @endif
</td> </td>
@endif </tr>
<td> @endforeach
@if (auth()->user()->can('forms.other.edit')) </tbody>
<a href="{{ route('forms.other.edit', $item->id) }}" class="btn btn-warning btn-sm"> </table>
<i class="fas fa-edit text-white"></i> </div>
</a>
@endif
@if (auth()->user()->can('forms.other.delete'))
<form action="{{ route('forms.other.destroy', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this item?');">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger btn-sm">
<i class="fas fa-trash"></i>
</button>
</form>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div> </div>
</div> </div>
</div> </div>
@@ -77,161 +77,163 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="dataTables_wrapper dt-bootstrap4 mt-2"> <div class="dataTables_wrapper dt-bootstrap4 mt-2">
@include('backend.layouts.partials.messages') @include('backend.layouts.partials.messages')
<table id="dataTable" <div class="table-responsive">
class="table table-bordered table-striped table-responsive table-head-fixed dataTable dtr-inline" <table id="dataTable"
style="width:100%"> class="table table-bordered table-striped table-head-fixed dataTable dtr-inline"
<thead class="bg-light text-capitalize"> style="width:100%">
<tr> <thead class="bg-light text-capitalize">
<th>#</th>
<th>Nama</th>
<th>Rayon</th>
<th>Tanggal</th>
<th>Tujuan</th>
<th>Jarak</th>
<th>Total</th>
<th>Bukti 1</th>
<th>Bukti 2</th>
<th>Bukti 3</th>
<th>Account Number</th>
<th>Status</th>
@if (auth()->user()->can('approval.approve'))
<th>Approval</th>
@endif
@if (auth()->user()->can('final_approval.approve'))
<th>Final Approval</th>
@endif
<th>Aksi</th>
</tr>
</thead>
<tbody>
@php
use App\Helpers\NextCloudHelper;
@endphp
@foreach ($forms as $item)
<tr> <tr>
<td>{{ $loop->iteration }}</td> <th>#</th>
<td>{{ $item->user->name }}</td> <th>Nama</th>
<td>{{ $item->rayon->code }}</td> <th>Rayon</th>
<td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('D MMMM Y') }}</td> <th>Tanggal</th>
<td>{{ $item->tujuan }}</td> <th>Tujuan</th>
<td>{{ $item->jarak }} km</td> <th>Jarak</th>
<td>{{ number_format($item->total, 0, ',', '.') }}</td> <th>Total</th>
<td> <th>Bukti 1</th>
@if ($item->bukti1) <th>Bukti 2</th>
<a href="{{ NextCloudHelper::getNextcloudFile($item->bukti1) }}" target="_blank"> <th>Bukti 3</th>
Download <th>Account Number</th>
</a> <th>Status</th>
@else
-
@endif
</td>
<td>
@if ($item->bukti2)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti2) }}" target="_blank">
Download
</a>
@else
-
@endif
</td>
<td>
@if ($item->bukti3)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti3) }}" target="_blank">
Download
</a>
@else
-
@endif
</td>
<td>{{ $item->account_number }}</td>
<td>
@if ($item->status == 'On Progress')
<span class="badge badge-warning text-white">{{ $item->status }}</span>
@elseif ($item->status == 'Approved' || $item->status == 'Final Approved')
<span class="badge badge-success text-white">{{ $item->status }}</span>
@else
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
@if (auth()->user()->can('approval.approve')) @if (auth()->user()->can('approval.approve'))
<th>Approval</th>
@endif
@if (auth()->user()->can('final_approval.approve'))
<th>Final Approval</th>
@endif
<th>Aksi</th>
</tr>
</thead>
<tbody>
@php
use App\Helpers\NextCloudHelper;
@endphp
@foreach ($forms as $item)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $item->user->name }}</td>
<td>{{ $item->rayon->code }}</td>
<td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('D MMMM Y') }}</td>
<td>{{ $item->tujuan }}</td>
<td>{{ $item->jarak }} km</td>
<td>{{ number_format($item->total, 0, ',', '.') }}</td>
<td> <td>
{{-- approve / reject button --}} @if ($item->bukti1)
@if ($item->status == 'On Progress') <a href="{{ NextCloudHelper::getNextcloudFile($item->bukti1) }}" target="_blank">
<form action="{{ route('forms.up-country.approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> Download
@csrf </a>
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Approve
</button>
</form>
<form action="{{ route('forms.up-country.reject', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to reject this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-danger btn-sm">
Reject
</button>
</form>
@else @else
@if ($item->approved_at) -
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif @endif
</td> </td>
@endif
@if(auth()->user()->can('final_approval.approve'))
<td> <td>
{{-- approve / reject button --}} @if ($item->bukti2)
@if ($item->status == 'Approved' && $item->approved_at && !$item->final_approved_at) <a href="{{ NextCloudHelper::getFileUrl($item->bukti2) }}" target="_blank">
<form action="{{ route('forms.up-country.final-approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> Download
@csrf </a>
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Final Approve
</button>
</form>
@else @else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open')) -
<form action="{{ route('forms.up-country.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> @endif
</td>
<td>
@if ($item->bukti3)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti3) }}" target="_blank">
Download
</a>
@else
-
@endif
</td>
<td>{{ $item->account_number }}</td>
<td>
@if ($item->status == 'On Progress')
<span class="badge badge-warning text-white">{{ $item->status }}</span>
@elseif ($item->status == 'Approved' || $item->status == 'Final Approved')
<span class="badge badge-success text-white">{{ $item->status }}</span>
@else
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
@if (auth()->user()->can('approval.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'On Progress')
<form action="{{ route('forms.up-country.approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf @csrf
@method('PUT') @method('PUT')
<button type="submit" class="btn btn-success btn-sm"> <button type="submit" class="btn btn-success btn-sm">
Open Approve
</button>
</form>
<form action="{{ route('forms.up-country.reject', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to reject this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-danger btn-sm">
Reject
</button> </button>
</form> </form>
@elseif ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@else @else
- @if ($item->approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif @endif
</td>
@endif
@if(auth()->user()->can('final_approval.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'Approved' && $item->approved_at && !$item->final_approved_at)
<form action="{{ route('forms.up-country.final-approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Final Approve
</button>
</form>
@else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
<form action="{{ route('forms.up-country.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Open
</button>
</form>
@elseif ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
</td>
@endif
<td>
@if (auth()->user()->can('forms.country.edit'))
<a href="{{ route('forms.up-country.edit', $item->id) }}" class="btn btn-warning btn-sm">
<i class="fas fa-edit text-white"></i>
</a>
@endif
@if (auth()->user()->can('forms.country.delete'))
<form action="{{ route('forms.up-country.destroy', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this item?');">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger btn-sm">
<i class="fas fa-trash"></i>
</button>
</form>
@endif @endif
</td> </td>
@endif </tr>
<td> @endforeach
@if (auth()->user()->can('forms.country.edit')) </tbody>
<a href="{{ route('forms.up-country.edit', $item->id) }}" class="btn btn-warning btn-sm"> </table>
<i class="fas fa-edit text-white"></i> </div>
</a>
@endif
@if (auth()->user()->can('forms.country.delete'))
<form action="{{ route('forms.up-country.destroy', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this item?');">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger btn-sm">
<i class="fas fa-trash"></i>
</button>
</form>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div> </div>
</div> </div>
</div> </div>
@@ -77,163 +77,165 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="dataTables_wrapper dt-bootstrap4 mt-2"> <div class="dataTables_wrapper dt-bootstrap4 mt-2">
@include('backend.layouts.partials.messages') @include('backend.layouts.partials.messages')
<table id="dataTable" <div class="table-responsive">
class="table table-bordered table-striped table-responsive table-head-fixed dataTable dtr-inline" <table id="dataTable"
style="width:100%"> class="table table-bordered table-striped table-head-fixed dataTable dtr-inline"
<thead class="bg-light text-capitalize"> style="width:100%">
<tr> <thead class="bg-light text-capitalize">
<th>#</th>
<th>Nama</th>
<th>Tanggal</th>
<th>Liter</th>
<th>Total</th>
<th>Jarak</th>
<th>Tipe Bensin</th>
<th>Nomor Polisi</th>
<th>Bukti 1</th>
<th>Bukti 2</th>
<th>Bukti 3</th>
<th>Account Number</th>
<th>Status</th>
@if (auth()->user()->can('approval.approve'))
<th>Approval</th>
@endif
@if (auth()->user()->can('final_approval.approve'))
<th>Final Approval</th>
@endif
<th>Aksi</th>
</tr>
</thead>
<tbody>
@php
use App\Helpers\NextCloudHelper;
@endphp
@foreach ($forms as $item)
<tr> <tr>
<td>{{ $loop->iteration }}</td> <th>#</th>
<td>{{ $item->user->name }}</td> <th>Nama</th>
<td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('dddd, D MMMM Y HH:mm:ss') }}</td> <th>Tanggal</th>
<td>{{ $item->liter }}</td> <th>Liter</th>
<td>{{ number_format($item->total, 0, ',', '.') }}</td> <th>Total</th>
<td>{{ $item->jarak }}</td> <th>Jarak</th>
<td>{{ $item->tipe_bensin }}</td> <th>Tipe Bensin</th>
<td>{{ $item->nopol }}</td> <th>Nomor Polisi</th>
<td> <th>Bukti 1</th>
@if ($item->bukti1) <th>Bukti 2</th>
<a href="{{ NextCloudHelper::getFileUrl($item->bukti1) }}" target="_blank"> <th>Bukti 3</th>
Download <th>Account Number</th>
</a> <th>Status</th>
@else
-
@endif
</td>
<td>
@if ($item->bukti2)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti2) }}" target="_blank">
Download
</a>
@else
-
@endif
</td>
<td>
@if ($item->bukti3)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti3) }}" target="_blank">
Download
</a>
@else
-
@endif
</td>
<td>{{ $item->account_number }}</td>
<td>
@if ($item->status == 'On Progress')
<span class="badge badge-warning text-white">{{ $item->status }}</span>
@elseif ($item->status == 'Approved' || $item->status == 'Final Approved')
<span class="badge badge-success text-white">{{ $item->status }}</span>
@else
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
@if (auth()->user()->can('approval.approve')) @if (auth()->user()->can('approval.approve'))
<th>Approval</th>
@endif
@if (auth()->user()->can('final_approval.approve'))
<th>Final Approval</th>
@endif
<th>Aksi</th>
</tr>
</thead>
<tbody>
@php
use App\Helpers\NextCloudHelper;
@endphp
@foreach ($forms as $item)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $item->user->name }}</td>
<td>{{ \Carbon\Carbon::parse($item->tanggal)->locale('id')->isoFormat('dddd, D MMMM Y HH:mm:ss') }}</td>
<td>{{ $item->liter }}</td>
<td>{{ number_format($item->total, 0, ',', '.') }}</td>
<td>{{ $item->jarak }}</td>
<td>{{ $item->tipe_bensin }}</td>
<td>{{ $item->nopol }}</td>
<td> <td>
{{-- approve / reject button --}} @if ($item->bukti1)
@if ($item->status == 'On Progress') <a href="{{ NextCloudHelper::getFileUrl($item->bukti1) }}" target="_blank">
<form action="{{ route('forms.vehicle.approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> Download
@csrf </a>
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Approve
</button>
</form>
<form action="{{ route('forms.vehicle.reject', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to reject this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-danger btn-sm">
Reject
</button>
</form>
@else @else
@if ($item->approved_at) -
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif @endif
</td> </td>
@endif
@if(auth()->user()->can('final_approval.approve'))
<td> <td>
{{-- approve / reject button --}} @if ($item->bukti2)
@if ($item->status == 'Approved' && $item->approved_at && !$item->final_approved_at) <a href="{{ NextCloudHelper::getFileUrl($item->bukti2) }}" target="_blank">
<form action="{{ route('forms.vehicle.final-approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> Download
@csrf </a>
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Final Approve
</button>
</form>
@else @else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open')) -
<form action="{{ route('forms.vehicle.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');"> @endif
</td>
<td>
@if ($item->bukti3)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti3) }}" target="_blank">
Download
</a>
@else
-
@endif
</td>
<td>{{ $item->account_number }}</td>
<td>
@if ($item->status == 'On Progress')
<span class="badge badge-warning text-white">{{ $item->status }}</span>
@elseif ($item->status == 'Approved' || $item->status == 'Final Approved')
<span class="badge badge-success text-white">{{ $item->status }}</span>
@else
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
@if (auth()->user()->can('approval.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'On Progress')
<form action="{{ route('forms.vehicle.approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf @csrf
@method('PUT') @method('PUT')
<button type="submit" class="btn btn-success btn-sm"> <button type="submit" class="btn btn-success btn-sm">
Open Approve
</button>
</form>
<form action="{{ route('forms.vehicle.reject', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to reject this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-danger btn-sm">
Reject
</button> </button>
</form> </form>
@elseif ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@else @else
- @if ($item->approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif @endif
</td>
@endif
@if(auth()->user()->can('final_approval.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'Approved' && $item->approved_at && !$item->final_approved_at)
<form action="{{ route('forms.vehicle.final-approve', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Final Approve
</button>
</form>
@else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
<form action="{{ route('forms.vehicle.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Open
</button>
</form>
@elseif ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
</td>
@endif
<td>
@if (auth()->user()->can('forms.vehicle.edit'))
<a href="{{ route('forms.vehicle.edit', $item->id) }}" class="btn btn-warning btn-sm">
<i class="fas fa-edit text-white"></i>
</a>
@endif
@if (auth()->user()->can('forms.vehicle.delete'))
<form action="{{ route('forms.vehicle.destroy', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this item?');">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger btn-sm">
<i class="fas fa-trash"></i>
</button>
</form>
@endif @endif
</td> </td>
@endif </tr>
<td> @endforeach
@if (auth()->user()->can('forms.vehicle.edit')) </tbody>
<a href="{{ route('forms.vehicle.edit', $item->id) }}" class="btn btn-warning btn-sm"> </table>
<i class="fas fa-edit text-white"></i> </div>
</a>
@endif
@if (auth()->user()->can('forms.vehicle.delete'))
<form action="{{ route('forms.vehicle.destroy', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this item?');">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger btn-sm">
<i class="fas fa-trash"></i>
</button>
</form>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div> </div>
</div> </div>
</div> </div>
+4 -2
View File
@@ -68,14 +68,16 @@
<div class="os-padding"> <div class="os-padding">
<div class="os-viewport os-viewport-native-scrollbars-invisible" style="overflow-y: scroll;"> <div class="os-viewport os-viewport-native-scrollbars-invisible" style="overflow-y: scroll;">
<div class="os-content" style="padding: 0px 8px; height: 100%; width: 100%;"> <div class="os-content" style="padding: 0px 8px; height: 100%; width: 100%;">
<div class="user-panel mt-3 pb-3 mb-3 d-flex align-items-center">
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
<div class="image"> <div class="image">
<img src="{{ Avatar::create(Auth::guard('admin')->user()->name)->toBase64() }}" <img src="{{ Avatar::create(Auth::guard('admin')->user()->name)->toBase64() }}"
class="img-circle" alt="User Image"> class="img-circle" alt="User Image">
</div> </div>
<div class="info"> <div class="info">
<a class="d-block">{{ Auth::guard('admin')->user()->name }}</a> <a class="d-block">{{ Auth::guard('admin')->user()->name }}</a>
<a class="d-block font-weight-bold" style="font-size: 11px;">
{{ Auth::guard('admin')->user()->getRoleNames()[0] }}
</a>
</div> </div>
</div> </div>
@include('layouts.partials.sidebar') @include('layouts.partials.sidebar')