update pekerjaan lain-lain

This commit is contained in:
Ain Izazi
2024-12-01 14:15:15 +08:00
parent 3cbc26aebe
commit 6443548081
8 changed files with 203 additions and 90 deletions
+9 -5
View File
@@ -40,9 +40,10 @@ class CustomersController extends Controller
$idtype = 'nokp'; $idtype = 'nokp';
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
$bank = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/bank')->json(); $bank = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/bank')->json();
$pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json();
$blacklist_search = false; $blacklist_search = false;
return view('customers.' . $cawangan_info['version'] . '.index',compact('search','blacklist_search','cawangan_info','bank','api_url','idtype')); return view('customers.' . $cawangan_info['version'] . '.index',compact('search','blacklist_search','cawangan_info','bank','api_url','idtype','pekerjaan'));
} }
public function info(Request $request){ public function info(Request $request){
@@ -51,7 +52,8 @@ class CustomersController extends Controller
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
$customer_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customers/'. Session::get('noic'))->json(); $customer_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customers/'. Session::get('noic'))->json();
// dd($customer_info);
$pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json();
$komoditi = Komoditi::first(); $komoditi = Komoditi::first();
$min_komoditi = $komoditi['min_komoditi']; $min_komoditi = $komoditi['min_komoditi'];
@@ -68,7 +70,7 @@ class CustomersController extends Controller
$request->session()->flash('activate_tab', 'SAG_baru'); $request->session()->flash('activate_tab', 'SAG_baru');
} }
return view($customer_page,compact('cawangan_info','api_url','customer_info','bakilelong','rugilelong','min_komoditi')); return view($customer_page,compact('cawangan_info','api_url','customer_info','bakilelong','rugilelong','min_komoditi','pekerjaan'));
} }
public function search(Request $request){ public function search(Request $request){
@@ -81,6 +83,7 @@ class CustomersController extends Controller
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
$bank = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/bank')->json(); $bank = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/bank')->json();
$customer_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customers/'. $noic)->json(); $customer_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customers/'. $noic)->json();
$pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json();
$blacklist = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customer/blacklist',[ $blacklist = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customer/blacklist',[
'nokp' => $noic 'nokp' => $noic
@@ -105,9 +108,9 @@ class CustomersController extends Controller
}else{ }else{
if($blacklist){ if($blacklist){
$blacklist_search = true; $blacklist_search = true;
return view('customers.' . $cawangan_info['version'] . '.index',compact('blacklist_search','customer_info','search','noic','cawangan_info','bank','api_url','idtype')); return view('customers.' . $cawangan_info['version'] . '.index',compact('blacklist_search','customer_info','search','noic','cawangan_info','bank','api_url','idtype','pekerjaan'));
}else{ }else{
return view('customers.' . $cawangan_info['version'] . '.index',compact('blacklist_search','customer_info','search','noic','cawangan_info','bank','api_url','idtype')); return view('customers.' . $cawangan_info['version'] . '.index',compact('blacklist_search','customer_info','search','noic','cawangan_info','bank','api_url','idtype','pekerjaan'));
} }
} }
} }
@@ -219,6 +222,7 @@ class CustomersController extends Controller
'nosiri' => $nosiri_latest, 'nosiri' => $nosiri_latest,
'nota'=>$request->nota, 'nota'=>$request->nota,
'kodkerja'=>$request->pekerjaan, 'kodkerja'=>$request->pekerjaan,
'nota_pekerjaan'=>$request->nota_pekerjaan,
'tujuangadai'=>$request->tujuan_gadai, 'tujuangadai'=>$request->tujuan_gadai,
]); ]);
+6 -4
View File
@@ -78,15 +78,17 @@ class KhazanahController extends Controller
Session::put('customer_info_khazanah',$customer_info); Session::put('customer_info_khazanah',$customer_info);
if($auth_user->roles == 'admin'){ if($auth_user->roles == 'admin'){
return redirect()->route('admin.customer_info')->with( ['customer_info' => $customer_info,'cawangan_info'=>$cawangan_info,'api_url'=>$api_url]); return redirect()->route('admin.customer_info')->with( ['customer_info' => $customer_info,'cawangan_info'=>$cawangan_info,'api_url'=>$api_url]);
}else{
return redirect()->route('khazanah.customer_info')->with( ['customer_info' => $customer_info,'cawangan_info'=>$cawangan_info,'api_url'=>$api_url]);
} }
return redirect()->route('khazanah.customer_info')->with( ['customer_info' => $customer_info,'cawangan_info'=>$cawangan_info,'api_url'=>$api_url]);
// return redirect()->back()->with('failed','Maaf,Tiada Data Pelanggan...');
}else{ }else{
if($auth_user->roles == 'admin'){ if($auth_user->roles == 'admin'){
return view('admin.customer_index',compact('search','noic','cawangan_info','bank','api_url','idtype')); return view('admin.customer_index',compact('search','noic','cawangan_info','bank','api_url','idtype'));
}else{
return view('khazanah.index',compact('search','noic','cawangan_info','bank','api_url','idtype'));
} }
// return view('khazanah.index',compact('search','noic','cawangan_info','bank','api_url','idtype'));
return redirect()->back()->with('failed','Maaf,Tiada Data Pelanggan...');
} }
} }
@@ -145,10 +145,10 @@
</div> </div>
</div> </div>
</div> </div>
<div class="mr-5 form-group float-right"> {{-- <div class="mr-5 form-group float-right">
<button type="button" class="btn btn-primary" onclick="kemaskinifunc()" id="btnkemaskini">Kemaskini</button> <button type="button" class="btn btn-primary" onclick="kemaskinifunc()" id="btnkemaskini">Kemaskini</button>
<button type="button" class="btn btn-primary" onclick="kemaskinipelanggan()" id="btnsave">Save</button> <button type="button" class="btn btn-primary" onclick="kemaskinipelanggan()" id="btnsave">Save</button>
</div> </div> --}}
</form> </form>
</div> </div>
</div> </div>
+8 -8
View File
@@ -56,14 +56,14 @@
</div> </div>
</div> </div>
@if ($message = Session::get('success')) @if ($message = Session::get('success'))
<div class="alert alert-success"> <div class="alert alert-success">
<p>{{ $message }}</p> <p>{{ $message }}</p>
</div> </div>
@elseif ($message = Session::get('failed')) @elseif ($message = Session::get('failed'))
<div class="alert alert-danger"> <div class="alert alert-danger">
<p>{{ $message }}</p> <p>{{ $message }}</p>
</div> </div>
@endif @endif
</form> </form>
</div> </div>
@if($search == true ) @if($search == true )
+30 -17
View File
@@ -182,23 +182,23 @@
</select> </select>
</div> </div>
<div class="col-md-4">Pekerjaan</div> <div class="col-md-4">Pekerjaan</div>
@php
$pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json();
@endphp
<div class="col-md-8"> <div class="col-md-8">
<select class="form-control" name="pekerjaan" data-placeholder="Pilih Pekerjaan" id="pekerjaan"> <select class="form-control" name="pekerjaan" id="pekerjaan">
<option disabled selected value> -- Pilih Pekerjaan -- </option> <option disabled selected value> -- Pilih Pekerjaan -- </option>
@foreach($pekerjaan as $kerja) @foreach($pekerjaan as $kerja)
<option value="{{ $kerja['kodkerja'] }}">{{ $kerja['keterangan'] }}</option> <option value="{{ $kerja['kodkerja'] }}">{{ $kerja['keterangan'] }}</option>
@endforeach @endforeach
</select> </select>
<div id="pekerjaan-lain-container" style="display: none; margin-top: 10px;">
<input type="text" class="form-control" id="pekerjaan-lain" name="nota_pekerjaan" placeholder="Masukkan pekerjaan lain">
</div>
</div> </div>
<div class="col-md-4">Nota</div> <div class="col-md-4">Nota</div>
<div class="col-md-8"><input class="form-control" type="text" name="nota" id="nota" placeholder="Nota"></div> <div class="col-md-8"><input class="form-control" type="text" name="nota" id="nota" placeholder="Nota"></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<input type="text" hidden name="idtype" value="nokp"> <input type="text" hidden name="idtype" value="nokp">
@@ -321,16 +321,17 @@
</select> </select>
</div> </div>
<div class="col-md-4">Pekerjaan</div> <div class="col-md-4">Pekerjaan</div>
@php
$pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json();
@endphp
<div class="col-md-8"> <div class="col-md-8">
<select class="form-control" name="pekerjaan" data-placeholder="Pilih Pekerjaan" id="pekerjaan"> <select class="form-control" name="pekerjaan" id="pekerjaan">
<option disabled selected value> -- Pilih Pekerjaan -- </option> <option disabled selected value> -- Pilih Pekerjaan -- </option>
@foreach($pekerjaan as $kerja) @foreach($pekerjaan as $kerja)
<option value="{{ $kerja['kodkerja'] }}">{{ $kerja['keterangan'] }}</option> <option value="{{ $kerja['kodkerja'] }}">{{ $kerja['keterangan'] }}</option>
@endforeach @endforeach
</select> </select>
<div id="pekerjaan-lain-container" style="display: none; margin-top: 10px;">
<input type="text" class="form-control" id="pekerjaan-lain" name="nota_pekerjaan" placeholder="Masukkan pekerjaan lain">
</div>
</div> </div>
<div class="col-md-4">Nota</div> <div class="col-md-4">Nota</div>
<div class="col-md-8"><input class="form-control" type="text" name="nota" id="nota" placeholder="Nota"></div> <div class="col-md-8"><input class="form-control" type="text" name="nota" id="nota" placeholder="Nota"></div>
@@ -446,16 +447,17 @@
</select> </select>
</div> </div>
<div class="col-md-4">Pekerjaan</div> <div class="col-md-4">Pekerjaan</div>
@php
$pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json();
@endphp
<div class="col-md-8"> <div class="col-md-8">
<select class="form-control" name="pekerjaan" data-placeholder="Pilih Pekerjaan" id="passport_pekerjaan"> <select class="form-control" name="pekerjaan" id="pekerjaan">
<option disabled selected value> -- Pilih Pekerjaan -- </option> <option disabled selected value> -- Pilih Pekerjaan -- </option>
@foreach($pekerjaan as $kerja) @foreach($pekerjaan as $kerja)
<option value="{{ $kerja['kodkerja'] }}">{{ $kerja['keterangan'] }}</option> <option value="{{ $kerja['kodkerja'] }}">{{ $kerja['keterangan'] }}</option>
@endforeach @endforeach
</select> </select>
<div id="pekerjaan-lain-container" style="display: none; margin-top: 10px;">
<input type="text" class="form-control" id="pekerjaan-lain" name="nota_pekerjaan" placeholder="Masukkan pekerjaan lain">
</div>
</div> </div>
<div class="col-md-4">Nota</div> <div class="col-md-4">Nota</div>
<div class="col-md-8"><input class="form-control" type="text" name="nota" id="passport_nota" placeholder="Nota"></div> <div class="col-md-8"><input class="form-control" type="text" name="nota" id="passport_nota" placeholder="Nota"></div>
@@ -1281,6 +1283,17 @@
</script> </script>
<script src="{{ asset('js/searchName.js') }}"></script> <script src="{{ asset('js/searchName.js') }}"></script>
<script>
$('#pekerjaan').on('change', function() {
var lainContainer = $('#pekerjaan-lain-container');
if ($(this).val() === '6') {
lainContainer.show();
} else {
$('#pekerjaan-lain').val('');
lainContainer.hide();
}
});
</script>
@push('additional_scripts') @push('additional_scripts')
<script> <script>
// mycard-read endpoint initialization // mycard-read endpoint initialization
@@ -345,6 +345,27 @@
<span id="errorkodbank" style="color:red;"></span> <span id="errorkodbank" style="color:red;"></span>
</div> </div>
</div> </div>
<div class='form-group row col-md-12'>
<div class='col-md-5'>
Pekerjaan
</div>
<div class='col-md-7'>
@php
$pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json();
@endphp
<select class="form-control" name="kodkerja" data-placeholder="Pilih Pekerjaan" id="kodkerja" disabled="true">
<option value="-" selected disabled>-</option>
@foreach($pekerjaan as $kerja)
<option value="{{ $kerja['kodkerja'] }}" {{ $kerja['kodkerja'] == $customer_info['kodkerja'] ? 'selected' : '' }}>
{{ $kerja['keterangan'] }}
</option>
@endforeach
</select>
<div id="pekerjaan-lain-container" style="display: {{ $customer_info['kodkerja'] == '6' ? 'block' : 'none' }}; margin-top: 10px;" >
<input type="text" class="form-control" id="nota_pekerjaan" name="nota_pekerjaan" placeholder="Sila Nyatakan" value="{{ $customer_info['nota_pekerjaan'] ?? '' }}" disabled="true">
</div>
</div>
</div>
<div class='form-group row col-md-12'> <div class='form-group row col-md-12'>
<div class='col-md-5'> <div class='col-md-5'>
No Akaun No Akaun
@@ -2500,6 +2521,8 @@
$('#telefon').attr('readonly', false); $('#telefon').attr('readonly', false);
$('#telefon2').attr('readonly', false); $('#telefon2').attr('readonly', false);
$('#kodbank').attr('disabled', false); $('#kodbank').attr('disabled', false);
$('#kodkerja').attr('disabled', false);
$('#nota_pekerjaan').attr('disabled', false);
$('#noakaun').attr('readonly', false); $('#noakaun').attr('readonly', false);
$('#nota').attr('readonly', false); $('#nota').attr('readonly', false);
$('#alamat').attr('readonly', false); $('#alamat').attr('readonly', false);
@@ -2521,6 +2544,8 @@
$('#telefon').attr('readonly', true); $('#telefon').attr('readonly', true);
$('#telefon2').attr('readonly', true); $('#telefon2').attr('readonly', true);
$('#kodbank').attr('disabled', true); $('#kodbank').attr('disabled', true);
$('#kodkerja').attr('disabled', true);
$('#nota_pekerjaan').attr('disabled', true);
$('#noakaun').attr('readonly', true); $('#noakaun').attr('readonly', true);
$('#nota').attr('readonly', true); $('#nota').attr('readonly', true);
$('#alamat').attr('readonly', true); $('#alamat').attr('readonly', true);
@@ -2534,6 +2559,8 @@
var telefon1 = $('#telefon').val(); var telefon1 = $('#telefon').val();
var telefon2 = $('#telefon2').val(); var telefon2 = $('#telefon2').val();
var kodbank = $('#kodbank').val(); var kodbank = $('#kodbank').val();
var kodkerja = $('#kodkerja').val();
var nota_pekerjaan = $('#nota_pekerjaan').val();
var noakaun = $('#noakaun').val(); var noakaun = $('#noakaun').val();
var nota = $('#nota').val(); var nota = $('#nota').val();
var alamat = $('#alamat').val(); var alamat = $('#alamat').val();
@@ -2547,6 +2574,8 @@
"telefon1": telefon1, "telefon1": telefon1,
"telefon2": telefon2, "telefon2": telefon2,
"kodbank":kodbank, "kodbank":kodbank,
"kodkerja":kodkerja,
"nota_pekerjaan":nota_pekerjaan,
"noakaun":noakaun, "noakaun":noakaun,
'nota':nota, 'nota':nota,
'alamat':alamat, 'alamat':alamat,
@@ -2631,6 +2660,8 @@
$('#telefon2').attr('readonly', true); $('#telefon2').attr('readonly', true);
$('#noakaun').attr('readonly', true); $('#noakaun').attr('readonly', true);
$('#kodbank').attr('disabled', true); $('#kodbank').attr('disabled', true);
$('#kodkerja').attr('disabled', true);
$('#nota_pekerjaan').attr('disabled', true);
$('#nota').attr('readonly', true); $('#nota').attr('readonly', true);
$('#alamat').attr('readonly', true); $('#alamat').attr('readonly', true);
$('#poskod').attr('readonly', true); $('#poskod').attr('readonly', true);
@@ -2915,4 +2946,15 @@
} }
} }
</script> </script>
<script>
$('#kodkerja').on('change', function() {
var lainContainer = $('#pekerjaan-lain-container');
if ($(this).val() === '6') {
lainContainer.show();
} else {
$('#pekerjaan-lain').val('');
lainContainer.hide();
}
});
</script>
@endsection @endsection
+9
View File
@@ -40,6 +40,15 @@
<button class="btn btn-outline-primary" type="submit" id="button-addon2">Cari</button> <button class="btn btn-outline-primary" type="submit" id="button-addon2">Cari</button>
</div> </div>
</div> </div>
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@elseif ($message = Session::get('failed'))
<div class="alert alert-danger">
<p>{{ $message }}</p>
</div>
@endif
</div> </div>
</div> </div>
</form> </form>
@@ -332,6 +332,27 @@
<span id="errorkodbank" style="color:red;"></span> <span id="errorkodbank" style="color:red;"></span>
</div> </div>
</div> </div>
<div class='form-group row col-md-12'>
<div class='col-md-5'>
Pekerjaan
</div>
<div class='col-md-7'>
@php
$pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json();
@endphp
<select class="form-control" name="kodkerja" data-placeholder="Pilih Pekerjaan" id="kodkerja" disabled="true">
<option value="-" selected disabled>-</option>
@foreach($pekerjaan as $kerja)
<option value="{{ $kerja['kodkerja'] }}" {{ $kerja['kodkerja'] == $customer_info['kodkerja'] ? 'selected' : '' }}>
{{ $kerja['keterangan'] }}
</option>
@endforeach
</select>
<div id="pekerjaan-lain-container" style="display: {{ $customer_info['kodkerja'] == '6' ? 'block' : 'none' }}; margin-top: 10px;" >
<input type="text" class="form-control" id="nota_pekerjaan" name="nota_pekerjaan" placeholder="Sila Nyatakan" value="{{ $customer_info['nota_pekerjaan'] ?? '' }}" disabled="true">
</div>
</div>
</div>
<div class='form-group row col-md-12'> <div class='form-group row col-md-12'>
<div class='col-md-5'> <div class='col-md-5'>
No Akaun No Akaun
@@ -1383,6 +1404,8 @@ $.each(data,function(index,gadai_detail){
$('#telefon').attr('readonly', false); $('#telefon').attr('readonly', false);
$('#telefon2').attr('readonly', false); $('#telefon2').attr('readonly', false);
$('#kodbank').attr('disabled', false); $('#kodbank').attr('disabled', false);
$('#kodkerja').attr('disabled', false);
$('#nota_pekerjaan').attr('disabled', false);
$('#noakaun').attr('readonly', false); $('#noakaun').attr('readonly', false);
$('#nota').attr('readonly', false); $('#nota').attr('readonly', false);
$('#nama').attr('readonly', false); $('#nama').attr('readonly', false);
@@ -1404,6 +1427,8 @@ $.each(data,function(index,gadai_detail){
$('#telefon').attr('readonly', true); $('#telefon').attr('readonly', true);
$('#telefon2').attr('readonly', true); $('#telefon2').attr('readonly', true);
$('#kodbank').attr('disabled', true); $('#kodbank').attr('disabled', true);
$('#kodkerja').attr('disabled', true);
$('#nota_pekerjaan').attr('disabled', true);
$('#noakaun').attr('readonly', true); $('#noakaun').attr('readonly', true);
$('#nota').attr('readonly', true); $('#nota').attr('readonly', true);
$('#nama').attr('readonly', true); $('#nama').attr('readonly', true);
@@ -1427,6 +1452,8 @@ $.each(data,function(index,gadai_detail){
var telefon1 = $('#telefon').val(); var telefon1 = $('#telefon').val();
var telefon2 = $('#telefon2').val(); var telefon2 = $('#telefon2').val();
var kodbank = $('#kodbank').val(); var kodbank = $('#kodbank').val();
var kodkerja = $('#kodkerja').val();
var nota_pekerjaan = $('#nota_pekerjaan').val();
var noakaun = $('#noakaun').val(); var noakaun = $('#noakaun').val();
var nota = $('#nota').val(); var nota = $('#nota').val();
var nama = $('#nama').val(); var nama = $('#nama').val();
@@ -1441,6 +1468,8 @@ $.each(data,function(index,gadai_detail){
"telefon1": telefon1, "telefon1": telefon1,
"telefon2": telefon2, "telefon2": telefon2,
"kodbank":kodbank, "kodbank":kodbank,
"kodkerja":kodkerja,
"nota_pekerjaan":nota_pekerjaan,
"noakaun":noakaun, "noakaun":noakaun,
'nota':nota, 'nota':nota,
'nama':nama, 'nama':nama,
@@ -1526,6 +1555,8 @@ $.each(data,function(index,gadai_detail){
$('#telefon2').attr('readonly', true); $('#telefon2').attr('readonly', true);
$('#noakaun').attr('readonly', true); $('#noakaun').attr('readonly', true);
$('#kodbank').attr('disabled', true); $('#kodbank').attr('disabled', true);
$('#kodkerja').attr('disabled', true);
$('#nota_pekerjaan').attr('disabled', true);
$('#nota').attr('readonly', true); $('#nota').attr('readonly', true);
$('#nama').attr('readonly', true); $('#nama').attr('readonly', true);
$('#alamat').attr('readonly', true); $('#alamat').attr('readonly', true);
@@ -1580,4 +1611,16 @@ $.each(data,function(index,gadai_detail){
}); });
}); });
</script> </script>
<script>
$('#kodkerja').on('change', function() {
var lainContainer = $('#pekerjaan-lain-container');
if ($(this).val() === '6') {
lainContainer.show();
} else {
$('#pekerjaan-lain').val('');
lainContainer.hide();
}
});
</script>
@endsection @endsection