added crud for form meeting & seminar
This commit is contained in:
@@ -42,7 +42,7 @@ class FormEntertainmentPresentationController extends Controller
|
||||
'tanggal' => 'required',
|
||||
'jenis' => 'required|in:entertainment,presentation,sponsorship',
|
||||
'keterangan' => 'required',
|
||||
'total' => 'required|integer',
|
||||
'total' => 'required',
|
||||
'name' => 'required',
|
||||
'alamat' => 'required',
|
||||
'nik_or_npwp' => 'required',
|
||||
@@ -141,7 +141,7 @@ class FormEntertainmentPresentationController extends Controller
|
||||
'tanggal' => 'required',
|
||||
'jenis' => 'required|in:entertainment,presentation,sponsorship',
|
||||
'keterangan' => 'required',
|
||||
'total' => 'required|integer',
|
||||
'total' => 'required',
|
||||
'name' => 'required',
|
||||
'alamat' => 'required',
|
||||
'nik_or_npwp' => 'required',
|
||||
@@ -155,7 +155,7 @@ class FormEntertainmentPresentationController extends Controller
|
||||
$kategori = Kategori::where('name', 'Entertainment & Presentation')->first();
|
||||
|
||||
$filePaths = [];
|
||||
$folderPath = '/expense/' . $region->code . '/' . $cabang->code . '/entertainment/';
|
||||
$folderPath = '/expense/' . $region->code . '/' . $cabang->code . '/entertainment';
|
||||
|
||||
if ($request->hasFile('bukti1')) {
|
||||
$bukti1 = $request->file('bukti1');
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Forms;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\FormMeetingSeminar;
|
||||
use App\Models\Rayon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use App\Models\Region;
|
||||
use App\Models\Cabang;
|
||||
use App\Models\UserHasCabang;
|
||||
use App\Models\Kategori;
|
||||
use App\Helpers\NextCloudHelper;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class FormMeetingSeminarController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$this->checkAuthorization(auth()->user(), ['forms.meeting.view']);
|
||||
|
||||
$forms = FormMeetingSeminar::where('user_id', auth()->user()->id)->get();
|
||||
return view('backend.pages.forms.meeting.index', [
|
||||
'forms' => $forms
|
||||
]);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->checkAuthorization(auth()->user(), ['forms.meeting.create']);
|
||||
|
||||
return view('backend.pages.forms.meeting.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->checkAuthorization(auth()->user(), ['forms.meeting.create']);
|
||||
|
||||
$request->validate([
|
||||
'allowance' => 'required',
|
||||
'transport_ankot' => 'required',
|
||||
'hotel' => 'required',
|
||||
'total' => 'required',
|
||||
'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
|
||||
'bukti2' => 'nullable|file|mimes:xlsx,xls,csv',
|
||||
'bukti3' => 'nullable|file|mimes:pdf',
|
||||
]);
|
||||
|
||||
$cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang;
|
||||
$region = Region::where('id', $cabang->region_id)->first();
|
||||
$kategori = Kategori::where('name', 'Meeting & Seminar')->first();
|
||||
|
||||
$filePaths = [];
|
||||
$folderPath = '/expense/' . $region->code . '/' . $cabang->code . '/meeting';
|
||||
|
||||
if ($request->hasFile('bukti1')) {
|
||||
$bukti1 = $request->file('bukti1');
|
||||
$filename = Str::uuid() . '.' . $bukti1->extension();
|
||||
|
||||
$filePaths['bukti1'] = $folderPath . '/' . $filename;
|
||||
|
||||
NextCloudHelper::uploadFile(
|
||||
$folderPath,
|
||||
$bukti1->getContent(),
|
||||
$filename
|
||||
);
|
||||
|
||||
}
|
||||
if ($request->hasFile('bukti2')) {
|
||||
$bukti2 = $request->file('bukti2');
|
||||
$filename = Str::uuid() . '.' . $bukti2->extension();
|
||||
|
||||
$filePaths['bukti2'] = $folderPath . '/' . $filename;
|
||||
|
||||
NextCloudHelper::uploadFile(
|
||||
$folderPath,
|
||||
$bukti2->getContent(),
|
||||
$filename
|
||||
);
|
||||
}
|
||||
if ($request->hasFile('bukti3')) {
|
||||
$bukti3 = $request->file('bukti3');
|
||||
$filename = Str::uuid() . '.' . $bukti3->extension();
|
||||
|
||||
$filePaths['bukti3'] = $folderPath . '/' . $filename;
|
||||
|
||||
NextCloudHelper::uploadFile(
|
||||
$folderPath,
|
||||
$bukti3->getContent(),
|
||||
$filename
|
||||
);
|
||||
}
|
||||
|
||||
// Generate sequence number and expense number
|
||||
$sequence_number = FormMeetingSeminar::withTrashed()->where('expense_number', 'like', $region->code . '-' . $cabang->code . '-MTG-' . date('ym') . '%')->count() + 1;
|
||||
$formatted_sequence_number = str_pad($sequence_number, 4, '0', STR_PAD_LEFT);
|
||||
$expense_number = $region->code . '-' . $cabang->code . '-MTG-' . date('ym') . $formatted_sequence_number;
|
||||
|
||||
// Save the form data
|
||||
FormMeetingSeminar::create([
|
||||
'expense_number' => $expense_number,
|
||||
'user_id' => auth()->user()->id,
|
||||
'allowance' => $request->allowance,
|
||||
'transport_ankot' => $request->transport_ankot,
|
||||
'hotel' => $request->hotel,
|
||||
'total' => $request->total,
|
||||
'bukti1' => $filePaths['bukti1'] ?? null,
|
||||
'bukti2' => $filePaths['bukti2'] ?? null,
|
||||
'bukti3' => $filePaths['bukti3'] ?? null,
|
||||
'account_number' => $kategori->account_number,
|
||||
'status' => 'On Progress',
|
||||
]);
|
||||
|
||||
session()->flash('success', 'Form has been created.');
|
||||
return redirect()->route('forms.meeting');
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->checkAuthorization(auth()->user(), ['forms.meeting.edit']);
|
||||
|
||||
$form = FormMeetingSeminar::findOrfail($id);
|
||||
return view('backend.pages.forms.meeting.edit', [
|
||||
'form' => $form
|
||||
]);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->checkAuthorization(auth()->user(), ['forms.meeting.edit']);
|
||||
|
||||
$request->validate([
|
||||
'allowance' => 'required',
|
||||
'transport_ankot' => 'required',
|
||||
'hotel' => 'required',
|
||||
'total' => 'required',
|
||||
'bukti1' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
|
||||
'bukti2' => 'nullable|file|mimes:xlsx,xls,csv',
|
||||
'bukti3' => 'nullable|file|mimes:pdf',
|
||||
]);
|
||||
|
||||
$cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang;
|
||||
$region = Region::where('id', $cabang->region_id)->first();
|
||||
$kategori = Kategori::where('name', 'Meeting & Seminar')->first();
|
||||
|
||||
$filePaths = [];
|
||||
$folderPath = '/expense/' . $region->code . '/' . $cabang->code . '/meeting';
|
||||
|
||||
if ($request->hasFile('bukti1')) {
|
||||
$bukti1 = $request->file('bukti1');
|
||||
$filename = Str::uuid() . '.' . $bukti1->extension();
|
||||
|
||||
$filePaths['bukti1'] = $folderPath . '/' . $filename;
|
||||
|
||||
NextCloudHelper::uploadFile(
|
||||
$folderPath,
|
||||
$bukti1->getContent(),
|
||||
$filename
|
||||
);
|
||||
|
||||
}
|
||||
if ($request->hasFile('bukti2')) {
|
||||
$bukti2 = $request->file('bukti2');
|
||||
$filename = Str::uuid() . '.' . $bukti2->extension();
|
||||
|
||||
$filePaths['bukti2'] = $folderPath . '/' . $filename;
|
||||
|
||||
NextCloudHelper::uploadFile(
|
||||
$folderPath,
|
||||
$bukti2->getContent(),
|
||||
$filename
|
||||
);
|
||||
}
|
||||
if ($request->hasFile('bukti3')) {
|
||||
$bukti3 = $request->file('bukti3');
|
||||
$filename = Str::uuid() . '.' . $bukti3->extension();
|
||||
|
||||
$filePaths['bukti3'] = $folderPath . '/' . $filename;
|
||||
|
||||
NextCloudHelper::uploadFile(
|
||||
$folderPath,
|
||||
$bukti3->getContent(),
|
||||
$filename
|
||||
);
|
||||
}
|
||||
|
||||
// Save the form data
|
||||
$form = FormMeetingSeminar::findOrfail($id);
|
||||
$form->update([
|
||||
'allowance' => $request->allowance,
|
||||
'transport_ankot' => $request->transport_ankot,
|
||||
'hotel' => $request->hotel,
|
||||
'total' => $request->total,
|
||||
'bukti1' => $filePaths['bukti1'] ?? $form->bukti1,
|
||||
'bukti2' => $filePaths['bukti2'] ?? $form->bukti2,
|
||||
'bukti3' => $filePaths['bukti3'] ?? $form->bukti3,
|
||||
'account_number' => $kategori->account_number,
|
||||
'status' => 'On Progress',
|
||||
]);
|
||||
|
||||
session()->flash('success', 'Form has been updated.');
|
||||
return redirect()->route('forms.meeting');
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->checkAuthorization(auth()->user(), ['forms.meeting.delete']);
|
||||
|
||||
$form = FormMeetingSeminar::findOrfail($id);
|
||||
$form->delete();
|
||||
|
||||
session()->flash('success', 'Form has been deleted.');
|
||||
return redirect()->route('forms.meeting');
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ class FormUpCountryController extends Controller
|
||||
$kategori = Kategori::where('name', 'Up Country')->first();
|
||||
|
||||
$filePaths = [];
|
||||
$folderPath = '/expense/' . $region->code . '/' . $cabang->code . '/upcountry/';
|
||||
$folderPath = '/expense/' . $region->code . '/' . $cabang->code . '/upcountry';
|
||||
|
||||
if ($request->hasFile('bukti1')) {
|
||||
$bukti1 = $request->file('bukti1');
|
||||
@@ -164,7 +164,7 @@ class FormUpCountryController extends Controller
|
||||
$kategori = Kategori::where('name', 'Up Country')->first();
|
||||
|
||||
$filePaths = [];
|
||||
$folderPath = '/expense/' . $region->code . '/' . $cabang->code . '/upcountry/';
|
||||
$folderPath = '/expense/' . $region->code . '/' . $cabang->code . '/upcountry';
|
||||
|
||||
if ($request->hasFile('bukti1')) {
|
||||
$bukti1 = $request->file('bukti1');
|
||||
|
||||
@@ -56,7 +56,7 @@ class FormVehicleController extends Controller
|
||||
$kategori = Kategori::where('name', 'Vehicle Running Cost')->first();
|
||||
|
||||
$filePaths = [];
|
||||
$folderPath = '/expense/' . $region->code . '/' . $cabang->code . '/vehicle/';
|
||||
$folderPath = '/expense/' . $region->code . '/' . $cabang->code . '/vehicle';
|
||||
|
||||
if ($request->hasFile('bukti1')) {
|
||||
$bukti1 = $request->file('bukti1');
|
||||
@@ -155,7 +155,7 @@ class FormVehicleController extends Controller
|
||||
$kategori = Kategori::where('name', 'Vehicle Running Cost')->first();
|
||||
|
||||
$filePaths = [];
|
||||
$folderPath = '/expense/' . $region->code . '/' . $cabang->code . '/vehicle/';
|
||||
$folderPath = '/expense/' . $region->code . '/' . $cabang->code . '/vehicle';
|
||||
|
||||
if ($request->hasFile('bukti1')) {
|
||||
$bukti1 = $request->file('bukti1');
|
||||
|
||||
@@ -23,4 +23,9 @@ class FormMeetingSeminar extends Model
|
||||
'account_number',
|
||||
'status',
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(Admin::class, 'user_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title')
|
||||
Dashboard
|
||||
@endsection
|
||||
|
||||
@section('admin-content')
|
||||
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.6.0/dist/autoNumeric.min.js"></script>
|
||||
|
||||
<section class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1>Tambahkan Expense Meeting & Seminar Baru</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">
|
||||
<form method="POST" action="{{ route('forms.meeting.store') }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@include('backend.layouts.partials.messages')
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Allowance</label>
|
||||
<input type="text" class="form-control" name="allowance" id="allowance" required value="{{ old('allowance') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Transport Antar Kota</label>
|
||||
<input type="text" class="form-control" name="transport_ankot" id="transport_ankot" required value="{{ old('transport_ankot') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Hotel</label>
|
||||
<input type="text" class="form-control" name="hotel" id="hotel" required value="{{ old('hotel') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Total</label>
|
||||
<input type="text" class="form-control" name="total" id="total" required value="{{ old('total') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 1</label>
|
||||
<input type="file" class="form-control" name="bukti1" value="{{ old('bukti1') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 2</label>
|
||||
<input type="file" class="form-control" name="bukti2" value="{{ old('bukti2') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 3</label>
|
||||
<input type="file" class="form-control" name="bukti3" value="{{ old('bukti3') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary ml-2">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
new AutoNumeric('#allowance', {
|
||||
digitGroupSeparator: '.', // Pemisah ribuan
|
||||
decimalCharacter: ',', // Karakter desimal (tidak digunakan karena tanpa desimal)
|
||||
currencySymbol: 'Rp.', // Simbol mata uang
|
||||
decimalPlaces: 0, // Tidak ada angka desimal
|
||||
unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan
|
||||
});
|
||||
|
||||
new AutoNumeric('#transport_ankot', {
|
||||
digitGroupSeparator: '.', // Pemisah ribuan
|
||||
decimalCharacter: ',', // Karakter desimal (tidak digunakan karena tanpa desimal)
|
||||
currencySymbol: 'Rp.', // Simbol mata uang
|
||||
decimalPlaces: 0, // Tidak ada angka desimal
|
||||
unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan
|
||||
});
|
||||
|
||||
new AutoNumeric('#hotel', {
|
||||
digitGroupSeparator: '.', // Pemisah ribuan
|
||||
decimalCharacter: ',', // Karakter desimal (tidak digunakan karena tanpa desimal)
|
||||
currencySymbol: 'Rp.', // Simbol mata uang
|
||||
decimalPlaces: 0, // Tidak ada angka desimal
|
||||
unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
const allowance = document.getElementById('allowance');
|
||||
const transportAnkot = document.getElementById('transport_ankot');
|
||||
const hotel = document.getElementById('hotel');
|
||||
const total = document.getElementById('total');
|
||||
|
||||
// Function to calculate total
|
||||
function calculateTotal() {
|
||||
const allowanceValue = parseInt(allowance.value) || 0;
|
||||
const transportAnkotValue = parseInt(transportAnkot.value) || 0;
|
||||
const hotelValue = parseInt(hotel.value) || 0;
|
||||
|
||||
total.value = allowanceValue + transportAnkotValue + hotelValue;
|
||||
}
|
||||
|
||||
// Attach event listeners
|
||||
[allowance, transportAnkot, hotel].forEach(input => {
|
||||
input.addEventListener('input', calculateTotal);
|
||||
});
|
||||
|
||||
// Initial calculation on page load
|
||||
calculateTotal();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,125 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title')
|
||||
Dashboard
|
||||
@endsection
|
||||
|
||||
@section('admin-content')
|
||||
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.6.0/dist/autoNumeric.min.js"></script>
|
||||
|
||||
<section class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1>Edit Expense 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">
|
||||
<form method="POST" action="{{ route('forms.meeting.update', $form->id) }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('backend.layouts.partials.messages')
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Allowance</label>
|
||||
<input type="text" class="form-control" name="allowance" id="allowance" required value="{{ $form->allowance }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Transport Antar Kota</label>
|
||||
<input type="text" class="form-control" name="transport_ankot" id="transport_ankot" required value="{{ $form->transport_ankot }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Hotel</label>
|
||||
<input type="text" class="form-control" name="hotel" id="hotel" required value="{{ $form->hotel }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Total</label>
|
||||
<input type="text" class="form-control" name="total" id="total" required value="{{ $form->total }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 1</label>
|
||||
<input type="file" class="form-control" name="bukti1" value="{{ old('bukti1') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 2</label>
|
||||
<input type="file" class="form-control" name="bukti2" value="{{ old('bukti2') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Bukti 3</label>
|
||||
<input type="file" class="form-control" name="bukti3" value="{{ old('bukti3') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary ml-2">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
new AutoNumeric('#allowance', {
|
||||
digitGroupSeparator: '.', // Pemisah ribuan
|
||||
decimalCharacter: ',', // Karakter desimal (tidak digunakan karena tanpa desimal)
|
||||
currencySymbol: 'Rp.', // Simbol mata uang
|
||||
decimalPlaces: 0, // Tidak ada angka desimal
|
||||
unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan
|
||||
});
|
||||
|
||||
new AutoNumeric('#transport_ankot', {
|
||||
digitGroupSeparator: '.', // Pemisah ribuan
|
||||
decimalCharacter: ',', // Karakter desimal (tidak digunakan karena tanpa desimal)
|
||||
currencySymbol: 'Rp.', // Simbol mata uang
|
||||
decimalPlaces: 0, // Tidak ada angka desimal
|
||||
unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan
|
||||
});
|
||||
|
||||
new AutoNumeric('#hotel', {
|
||||
digitGroupSeparator: '.', // Pemisah ribuan
|
||||
decimalCharacter: ',', // Karakter desimal (tidak digunakan karena tanpa desimal)
|
||||
currencySymbol: 'Rp.', // Simbol mata uang
|
||||
decimalPlaces: 0, // Tidak ada angka desimal
|
||||
unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
const allowance = document.getElementById('allowance');
|
||||
const transportAnkot = document.getElementById('transport_ankot');
|
||||
const hotel = document.getElementById('hotel');
|
||||
const total = document.getElementById('total');
|
||||
|
||||
// Function to calculate total
|
||||
function calculateTotal() {
|
||||
const allowanceValue = parseInt(allowance.value) || 0;
|
||||
const transportAnkotValue = parseInt(transportAnkot.value) || 0;
|
||||
const hotelValue = parseInt(hotel.value) || 0;
|
||||
|
||||
total.value = allowanceValue + transportAnkotValue + hotelValue;
|
||||
}
|
||||
|
||||
// Attach event listeners
|
||||
[allowance, transportAnkot, hotel].forEach(input => {
|
||||
input.addEventListener('input', calculateTotal);
|
||||
});
|
||||
|
||||
// Initial calculation on page load
|
||||
calculateTotal();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -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
|
||||
@@ -15,6 +15,7 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/spin.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/ladda.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/fiqhpratama/upsense-cdn@main/adminlte-blue/plugins/waitme/waitMe.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.6.0/dist/autoNumeric.min.js"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -14,6 +14,7 @@ use App\Http\Controllers\Master\CostCentreController;
|
||||
use App\Http\Controllers\Master\CategoryController;
|
||||
use App\Http\Controllers\Forms\FormVehicleController;
|
||||
use App\Http\Controllers\Forms\FormEntertainmentPresentationController;
|
||||
use App\Http\Controllers\Forms\FormMeetingSeminarController;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use App\Helpers\NextCloudHelper;
|
||||
|
||||
@@ -90,6 +91,14 @@ Route::middleware(['auth:admin', 'menu'])->group(function () {
|
||||
Route::get('/entertainment-presentation/edit/{id}', [FormEntertainmentPresentationController::class, 'edit'])->name('forms.entertainment.edit');
|
||||
Route::put('/entertainment-presentation/update/{id}', [FormEntertainmentPresentationController::class, 'update'])->name('forms.entertainment.update');
|
||||
Route::delete('/entertainment-presentation/destroy/{id}', [FormEntertainmentPresentationController::class, 'destroy'])->name('forms.entertainment.destroy');
|
||||
|
||||
// Meeting & Seminar
|
||||
Route::get('/meeting-seminar', [FormMeetingSeminarController::class, 'index'])->name('forms.meeting');
|
||||
Route::get('/meeting-seminar/create', [FormMeetingSeminarController::class, 'create'])->name('forms.meeting.create');
|
||||
Route::post('/meeting-seminar/store', [FormMeetingSeminarController::class, 'store'])->name('forms.meeting.store');
|
||||
Route::get('/meeting-seminar/edit/{id}', [FormMeetingSeminarController::class, 'edit'])->name('forms.meeting.edit');
|
||||
Route::put('/meeting-seminar/update/{id}', [FormMeetingSeminarController::class, 'update'])->name('forms.meeting.update');
|
||||
Route::delete('/meeting-seminar/destroy/{id}', [FormMeetingSeminarController::class, 'destroy'])->name('forms.meeting.destroy');
|
||||
});
|
||||
|
||||
//Menu Role
|
||||
|
||||
Reference in New Issue
Block a user