update
This commit is contained in:
@@ -6,9 +6,8 @@
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Daftar Kakitangan') }}</div>
|
||||
|
||||
<div class="card-body text-center">
|
||||
<form action="{{ route('kakitangan.baru') }}" method="post">
|
||||
<form action="{{ route('kakitangan.baru') }}" method="post" onsubmit="return verifyregister()">
|
||||
@csrf
|
||||
<div class='row form-group'>
|
||||
<div class='col-md-6'>
|
||||
@@ -38,7 +37,7 @@
|
||||
@endphp
|
||||
<select class="form-control" name="cawangan" data-placeholder="Pilih Cawangan" id="cawangan">
|
||||
<option disabled selected value> -- Pilih Cawangan -- </option>
|
||||
<option value="ope">Operasi</option>
|
||||
<option value="operasi">Operasi</option>
|
||||
@foreach($cawangan_all as $cawangan)
|
||||
<option value="{{ $cawangan['kodcaw'] }}">{{ $cawangan['details_caw'] }}</option>
|
||||
@endforeach
|
||||
@@ -68,10 +67,10 @@
|
||||
Jawatan
|
||||
</div>
|
||||
<div class='col-md-7'>
|
||||
<select class="form-control" name="role" data-placeholder="Pilih Bank" id="role">
|
||||
<select class="form-control" name="role" data-placeholder="Pilih Jawatan" id="role">
|
||||
<option disabled selected> -- Pilih Jawatan -- </option>
|
||||
@foreach($role as $roles)
|
||||
<option value="{{ $roles['keterangan'] }}">{{ $roles['keterangan'] }}</option>
|
||||
<option value="{{ $roles['role_code'] }}">{{ $roles['keterangan'] }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@@ -90,6 +89,141 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
function verifyregister(){
|
||||
var cawangan = $('#cawangan').val();
|
||||
var role = $('#role').val();
|
||||
var nama = $('#nama').val();
|
||||
var email = $('#email').val();
|
||||
var nokp = $('#nokp').val();
|
||||
var telefon = $('#telefon').val();
|
||||
if (cawangan == null){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Pilih Cawangan Kakitangan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
if (role == null){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Pilih Jawatan Kakitangan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
if(cawangan == 'operasi'){
|
||||
if(role != 'operasi'){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Jawatan Tidak Sah'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
if(role == 'operasi'){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Jawatan Tidak Sah'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(nama == ''){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Masukan Nama Kakitangan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
if(nokp == ''){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Masukan No KP Kakitangan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
if(isNaN(nokp) == true){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Masukan Hanya Nombor Pada No KP Kakitangan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
if(nokp.length != 12){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Periksa No KP Kakitangan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
if(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) == false){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Periksa Email Kakitangan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
if(telefon == ''){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Masukan No Telefon Kakitangan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
if(isNaN(telefon) == true){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Masukan Hanya Nombor Pada No Telefon Kakitangan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
if(telefon.length <= 9 || telefon.length >= 12){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Periksa No Telefon Kakitangan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
if(cawangan == null){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Pilih Cawangan Kakitangan'
|
||||
});
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -2,38 +2,38 @@
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Komoditi') }}</div>
|
||||
<div class="card-body text-center">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-2 justify-content-start">
|
||||
<a href="{{ url('/') }}" class="ion-backspace" style="font-size:50px;color:blue;"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group justify-content-start" id="maklumat_komuditi">
|
||||
<div class="row form-group" id="maklumat_komuditi">
|
||||
<div class="col-md-4">
|
||||
<div class="row form-group">
|
||||
<div class="col-md-4">No Sijil : </div>
|
||||
<div class="col-md-4 text-right">No Sijil : </div>
|
||||
<div class="col-md-8"><span id="nosijil_span"></span></div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col-md-4">Harga : </div>
|
||||
<div class="col-md-4 text-right">Harga : </div>
|
||||
<div class="col-md-8"><span id="harga_span"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="row form-group">
|
||||
<div class="col-md-4">Kod Produk / Diskripsi : </div>
|
||||
<div class="col-md-4 text-right">Kod Produk / Diskripsi : </div>
|
||||
<div class="col-md-8"><span id="produk_span"></span></div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col-md-4">Unit : </div>
|
||||
<div class="col-md-4 text-right">Unit : </div>
|
||||
<div class="col-md-8"><span id="unit_span"></span></div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col-md-4">Nilai : </div>
|
||||
<div class="col-md-4 text-right">Baki Nilai Komoditi : </div>
|
||||
<div class="col-md-8"><span id="nilai_span"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user