Skip to content

Commit

Permalink
patch separate pengajuan
Browse files Browse the repository at this point in the history
  • Loading branch information
punkestu committed Nov 24, 2024
1 parent 0f4bb67 commit 7b7623e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Rotasi/PengajuanController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function input(Request $request)
'masa_kerja' => 'required',
'jabatan' => 'required',
]);
if ($request->has('tidak_pindah')) {
if ($request->has('tidak_pindah') && $request->tidak_pindah == 'ya') {
$personel = Personel::where('nik', $request->nik)->first();
$personel->update([
'tidak_pindah' => true,
Expand Down
1 change: 0 additions & 1 deletion resources/views/components/modal-component.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
@include('components.modal', ['message' => session('success')])
@endif
@if ($errors->any())
{{$errors->first()}}
@include('components.modal', [
'message' => str_contains($errors->first(), 'required')
? 'Mohon isi semua kolom'
Expand Down
31 changes: 24 additions & 7 deletions resources/views/rotasi/pengajuan/input.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,32 @@ class="col-span-1 bg-[#003285] opacity-80 hover:opacity-100 duration-200 text-w
class="w-full px-2 py-1 mt-1 border-2 border-slate-400 rounded-md"
placeholder="Ketik Disini ..." value="{{ old('jabatan') }}" />
</aside>
<input type="hidden" name="tidak_pindah" id="tidak_pindah"
value="{{ old('tidak_pindah') ?? 'tidak'}}">
</div>
<div class="flex justify-end gap-4 w-full">
<button type="button"
class="bg-[#003285] opacity-80 hover:opacity-100 duration-200 text-white px-4 py-2 rounded-lg font-semibold"
onclick="changeSection(2)">
onclick="changeSection(0)">
Selanjutnya
</button>
</div>
</section>
<section id="section-0" class="sections hidden flex-col gap-4 p-2 rounded-md">
<label class="font-semibold text-center" for="tidak-pindah">Pilih Pengajun</label>
<div class="flex justify-center gap-2">
<button type="button"
class="bg-[#003285] opacity-80 hover:opacity-100 duration-200 text-white px-4 py-2 rounded-lg font-semibold"
onclick="tidakpindah()">
Tidak Pindah
</button>
<button type="button"
class="bg-[#003285] opacity-80 hover:opacity-100 duration-200 text-white px-4 py-2 rounded-lg font-semibold"
onclick="changeSection(2)">
Mutasi
</button>
</div>
</section>
<section id="section-2" class="sections hidden flex-col gap-4 p-2 rounded-md">
<div class="grid md:grid-cols-9 gap-4 items-stretch">
<aside class="w-full md:col-span-4 flex flex-col justify-between">
Expand Down Expand Up @@ -141,11 +158,6 @@ class="w-full px-2 py-1 mt-1 bg-white border-2 border-slate-400 rounded-md">
</aside>
</div>
<div class="self-end flex items-center gap-4">
<label class="flex items-center gap-1">
<input type="checkbox" name="tidak_pindah" id="tidak_pindah"
{{ old('tidak_pindah') ? 'checked' : '' }}>
Tidak Pindah?
</label>
<label class="flex items-center gap-1">
<input type="checkbox" name="use_tujuan_alt" id="use_tujuan_alt"
{{ old('use_tujuan_alt') ? 'checked' : '' }}>
Expand Down Expand Up @@ -223,7 +235,7 @@ class="w-full bg-[#003285] opacity-80 hover:opacity-100 duration-200 text-white
'url' => 'surat_persetujuan_url',
'file' => 'surat_persetujuan_file',
'file_url' => old('surat_persetujuan_url'),
'note' => '*surat GM, surat pernyataan, berkas data pribadi (CV)'
'note' => '*surat GM, surat pernyataan, berkas data pribadi (CV)',
])
</div>
<div>
Expand Down Expand Up @@ -564,6 +576,11 @@ function debounce(func, timeout = 300) {
};
}
const searchNIKDebounce = debounce(searchNIK, 500);
function tidakpindah() {
document.getElementById('tidak_pindah').value = 'ya';
document.querySelector('form').submit();
}
</script>
<script src="/script/chatbot.js"></script>
</body>
Expand Down

0 comments on commit 7b7623e

Please sign in to comment.