@extends('layouts.app')
@section('content')
<h4 class="fw-bold py-3 mb-4"><span class="text-muted fw-light">Data Izin</span></h4>
<div class="card">
<h5 class="card-header">Data Izin</h5>
<div class="card-body">
<div class="row mb-4">
<div class="col-md-10">
<form class="form row" action="">
<div class="col-md-2 ">
<div class="form-group">
<label for="">Pencarian</label>
<input type="text" class="form-control" placeholder="Search..." aria-label="Search"
name="search" value="{{ request()->search }}">
</div>
</div>
<div class="col">
<div class="form-group">
<label for="periode_awal">Periode Awal</label>
<input type="date" class="form-control" placeholder="Periode Awal..."
aria-label="Periode Awal" name="periode_awal" id="periode_awal"
value="{{ request()->periode_awal }}">
</div>
</div>
<div class="col">
<div class="form-group">
<label for="periode_akhir">Periode Akhir</label>
<input type="date" class="form-control" placeholder="Periode Akhir..."
aria-label="Periode Akhir" name="periode_akhir" id="periode_akhir"
value="{{ request()->periode_akhir }}">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="">Perusahaan</label>
<select class="form-control" id="perusahaan_id" name="perusahaan_id">
<option value="0">Semua Perusahaan</option>
@foreach ($perusahaans as $item)
<option value="{{ $item->id }}"
@if (request()->perusahaan_id == $item->id) selected @endif>
{{ $item->nama_perusahaan }}</option>
@endforeach
</select>
</div>
</div>
<div class="col-md-3 ">
<div class="from-group">
<label for="">Departemen</label>
<select class="form-control" id="departemen_id" name="departemen_id">
<option value="0">Semua Departemen</option>
@foreach ($departemens as $item)
<option value="{{ $item->id }}"
@if (request()->departemen_id == $item->id) selected @endif>
{{ $item->nama_departemen }}</option>
@endforeach
</select>
</div>
</div>
<div class="col-md-2 my-4">
<button class="btn btn-secondary">Search</button>
</div>
</form>
</div>
<div class="col-md-2 text-end">
@if ($akses['tambah'])
<div class="btn-group float-md-right" role="group" aria-label="Button group with nested dropdown">
<a href="{{ route('izin.create') }}" class="btn btn-primary"><i class="bx bx-plus"></i>
Tambah</a>
</div>
@endif
</div>
</div>
<div class="table-responsive text-nowrap">
<table class="table table-striped">
<thead>
<tr>
<th>No</th>
<th>
NIK
</th>
<th>Karyawan</th>
<th>Departemen</th>
<th>Perusahaan</th>
<th>Jenis Izin</th>
<th>Tanggal Izin</th>
<th>Keterangan</th>
<th>Status</th>
<th>Foto Bukti</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@foreach ($datas as $data)
<tr>
<td>{{ $datas->firstItem() + $loop->index }}</td>
<td>{{ $data->karyawan->nik }}</td>
<td>{{ $data->karyawan->nama }}</td>
<td>
{{ $data->karyawan->departemen->nama_departemen }}
</td>
<td>
<ul>
@foreach ($data->karyawan->perusahaans as $item)
<li>{{ $item->nama_perusahaan }}</li>
@endforeach
</ul>
</td>
<td>{{ $data->jenis_izin_label }}</td>
<td>{{ $data->tanggal_izin }}</td>
<td>{{ $data->keterangan }}</td>
<td><span id="label-status-{{ $data->id }}"
class="badge @if ($data->status == 'pending') bg-warning @elseif($data->status == 'accept') bg-success @else bg-danger @endif">{{ $data->status }}</span>
</td>
<td><a target="_blank" href="{{ route('izin.lampiran', $data->id) }}"><i
class="bx bx-image"></i></a></td>
<td>
@if ($akses['ubah'])
<a href="{{ route('izin.edit', $data->id) }}" class="btn btn-warning btn-sm"><i
class="bx bx-edit"></i></a>
@endif
@if ($akses['hapus'])
<form action="{{ route('izin.destroy', $data->id) }}" method="POST"
class="d-inline">
@csrf
@method('DELETE')
<button class="btn btn-danger btn-sm"><i class="bx bx-trash"></i></button>
</form>
@endif
</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<td colspan="8">
{{ $datas->appends(request()->query())->links() }}
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
@endsection
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]