added crud for form meeting & seminar

This commit is contained in:
Jagad R R
2024-12-19 10:51:27 +07:00
parent 24b9a82856
commit cd28280fb6
10 changed files with 622 additions and 7 deletions
@@ -0,0 +1,134 @@
@extends('layouts.app')
@section('title')
Dashboard
@endsection
@section('admin-content')
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Forms Meeting Seminar</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ route('dashboard.index') }}">Dashboard</a></li>
</li>
</ol>
</div>
</div>
</div>
</section>
<section class="content">
<div class="container-fluid">
<div class="card card-primary card-outline">
<div class="card-body">
<h4 class="header-title float-left">List Data Forms Meeting Seminar Anda</h4>
<p class="float-right mb-2">
@if (auth()->user()->can('forms.meeting.create'))
<a class="btn btn-primary text-white" href="{{ route('forms.meeting.create') }}">
Add New Expense Meeting Seminar
</a>
@endif
</p>
<div class="clearfix"></div>
<div class="dataTables_wrapper dt-bootstrap4 mt-2">
@include('backend.layouts.partials.messages')
<table id="dataTable"
class="table table-bordered table-striped table-head-fixed dataTable dtr-inline"
style="width:100%">
<thead class="bg-light text-capitalize">
<tr>
<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>
<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>
@if ($item->bukti1)
<a href="{{ NextCloudHelper::getFileUrl($item->bukti1) }}" target="_blank">
Download
</a>
@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 == 'Completed')
<span class="badge badge-success text-white">{{ $item->status }}</span>
@else
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
<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
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
@endsection