87 lines
4.9 KiB
PHP
87 lines
4.9 KiB
PHP
@extends('layouts.master')
|
|
@section('content')
|
|
<div class="flex flex-col gap-6">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<div class="flex justify-between items-center">
|
|
<h4 class="card-title">{{$title}}</h4>
|
|
</div>
|
|
</div>
|
|
<form action="{{route($route.'.store')}}" method="POST" class="">
|
|
{{csrf_field()}}
|
|
<input type="hidden" name="secure_id" value="{{@$keyId}}">
|
|
<div class="p-6">
|
|
<div class="grid lg:grid-cols-2 gap-3">
|
|
<div class="mb-3">
|
|
<label class="mb-3">Nama Instansi</label>
|
|
<input type="text" value="{{@$item->name ? @$item->name : old('name')}}" name="name" class="form-input @error('name') is-invalid @enderror" placeholder="Masukan Nama Instansi" required>
|
|
@error('name')
|
|
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
|
|
@enderror
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="mb-3">Jenis Instansi</label>
|
|
<select name="parent" class="form-input @error('parent') is-invalid @enderror" required>
|
|
<option value="">-Pilih Jenis Instansi-</option>
|
|
<option {{@$item->parent == 'Biro' ? 'selected' : ''}} value="Biro">Biro</option>
|
|
<option {{@$item->parent == 'Badan' ? 'selected' : ''}} value="Badan">Badan</option>
|
|
<option {{@$item->parent == 'Deputi' ? 'selected' : ''}} value="Deputi">Deputi</option>
|
|
<option {{@$item->parent == 'Dinas' ? 'selected' : ''}} value="Dinas">Dinas</option>
|
|
</select>
|
|
@error('parent')
|
|
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
|
|
@enderror
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="mb-3">Telp</label>
|
|
<input type="text" value="{{@$item->telp ? @$item->telp : old('telp')}}" name="telp" class="form-input @error('telp') is-invalid @enderror" placeholder="Masukan Telp Instansi">
|
|
@error('telp')
|
|
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
|
|
@enderror
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="mb-3">Website</label>
|
|
<input type="text" value="{{@$item->website ? @$item->website : old('website')}}" name="website" class="form-input @error('website') is-invalid @enderror" placeholder="Masukan Website">
|
|
@error('website')
|
|
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
|
|
@enderror
|
|
</div>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="mb-3">Alamat</label>
|
|
<textarea name="alamat" class="form-input @error('alamat') is-invalid @enderror" id="">{{@$item->alamat}}</textarea>
|
|
@error('alamat')
|
|
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
|
|
@enderror
|
|
</div>
|
|
</div>
|
|
<div class="p-6">
|
|
<a href="{{route($route.'.index')}}" class="btn bg-danger text-white"><i class="ri-close-line"></i> Batal</a>
|
|
<button type="submit" class="btn bg-success text-white"><i class="ri-save-line"></i> Simpan</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
@section('page-js')
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
$('.numberInput').on('input', function() {
|
|
this.value = this.value.replace(/[^0-9]/g, ''); // Hanya angka 0-9
|
|
});
|
|
$('#togglePassword').on('click', function() {
|
|
let passwordField = $('#password');
|
|
let icon = $(this).find('i');
|
|
|
|
// Cek apakah input saat ini bertipe password
|
|
if (passwordField.attr('type') === 'password') {
|
|
passwordField.attr('type', 'text'); // Ubah ke teks
|
|
icon.removeClass('fa-eye').addClass('fa-eye-slash'); // Ganti ikon
|
|
} else {
|
|
passwordField.attr('type', 'password'); // Ubah ke password
|
|
icon.removeClass('fa-eye-slash').addClass('fa-eye'); // Kembalikan ikon
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
@endsection |