tambah carian nama arcc
This commit is contained in:
@@ -22,15 +22,16 @@
|
||||
<div class="card-body">
|
||||
<div class="text-center">
|
||||
<h5 class="text-uppercase">Pilih Cawangan Dan Masukkan nombor kad pengenalan</h5>
|
||||
<form name="frmsearch" onsubmit="verifynokp()" action="{{ route('arcc.searchpelanggan') }}" method="GET">
|
||||
<form name="frmsearch" onsubmit="return verifynokp(event)" action="{{ route('arcc.searchpelanggan') }}" method="GET">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-9">
|
||||
<div class="input-group my-3">
|
||||
<div class='col-md-4'>
|
||||
<!-- Cawangan dropdown tetap sama -->
|
||||
<div class="col-md-4">
|
||||
@php
|
||||
$cawangan_all = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/arcc/cawangan')->json();
|
||||
@endphp
|
||||
<select class="form-control" name="cawangan" data-placeholder="Pilih Cawangan" id="cawangan">
|
||||
<select class="form-control" name="cawangan" id="cawangan">
|
||||
<option disabled selected value>--Cawangan--</option>
|
||||
@foreach($cawangan_all as $cawangan)
|
||||
<option value="{{ $cawangan['kodcaw'] }}">{{ $cawangan['details_caw'] }}</option>
|
||||
@@ -38,20 +39,28 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- KP atau Passport -->
|
||||
<input type="text" class="form-control" id="noic" name="noic" placeholder="No.KP/Passport"
|
||||
value="{{ $search == false ? '' : $noic ?? '' }}" autocomplete="off">
|
||||
|
||||
<input type="text" class="form-control" id="noic" name="noic" placeholder="No.KP Pelanggan" aria-label="No Kad Pengenalan Pelanggan" autocomplete="off" value="{{$search == false ? '' : $noic ?? ''}}" aria-describedby="button-addon2">
|
||||
<!-- Jenis ID -->
|
||||
<div class="input-group-append">
|
||||
<select class="form-select" id="customerIDType" name="customerIDType" class="form-control">
|
||||
<option value="nokp" {{ $idtype == 'nokp' ? 'selected' : ''}}>No.KP</option>
|
||||
<option value="passport" {{ $idtype == 'passport' ? 'selected' : ''}}>Passport</option>
|
||||
<select class="form-select" id="customerIDType" name="customerIDType">
|
||||
<option value="nokp" {{ $idtype == 'nokp' ? 'selected' : '' }}>No.KP</option>
|
||||
<option value="passport" {{ $idtype == 'passport' ? 'selected' : '' }}>Passport</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary" type="submit" id="button-addon2">Cari</button>
|
||||
</div>
|
||||
<br>
|
||||
<!-- Nama pelanggan -->
|
||||
<div class="input-group my-2">
|
||||
<input type="text" class="form-control" id="nama" name="nama" placeholder="Nama Pelanggan"
|
||||
value="{{ $search == false ? '' : $nama ?? '' }}">
|
||||
</div>
|
||||
|
||||
<!-- Butang cari -->
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary" type="submit">Cari</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -832,25 +841,27 @@
|
||||
function verifynokp(){
|
||||
var id_type = $('#customerIDType').val();
|
||||
var nokp = $('#noic').val();
|
||||
if(id_type=='nokp'){
|
||||
if($.isNumeric(nokp) == false){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Masukkan Nombor Sahaja Pada No KP Pelanggan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
if(nokp.length != 12){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Periksa No KP Pelanggan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
if(id_type === 'nokp'){
|
||||
if(!$.isNumeric(nokp)){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Masukkan Nombor Sahaja Pada No KP Pelanggan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(nokp.length != 12){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Periksa No KP Pelanggan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}else if(id_type=='passport'){
|
||||
// if(nokp.length < 5){
|
||||
// Swal.fire({
|
||||
|
||||
Reference in New Issue
Block a user