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({
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
@if(count($customers) > 0)
|
||||
<table class="table table-bordered table-hover" style="background-color: #f9f9f9;">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>Nama</th>
|
||||
<th>No KP</th>
|
||||
<th>Kod Cawangan</th>
|
||||
<th>Tindakan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($customers as $customer)
|
||||
<tr>
|
||||
<td>{{ $customer['nama'] }}</td>
|
||||
<td>{{ $customer['kpbaru'] ?? $customer['kplama'] ?? '-' }}</td>
|
||||
<td>{{ $customer['kodcaw'] }}</td>
|
||||
<td>
|
||||
<form action="{{ route('arcc.pilihpelanggan.proceed') }}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="customer" value="{{ base64_encode(json_encode($customer)) }}">
|
||||
<input type="hidden" name="kodcaw" value="{{ $customer['kodcaw'] }}">
|
||||
<input type="hidden" name="nokp" value="{{ $customer['kpbaru'] ?? $customer['kplama'] ?? '-' }}">
|
||||
<button type="submit" class="btn btn-sm btn-primary">Pilih</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<div class="alert alert-warning">Tiada pelanggan dijumpai.</div>
|
||||
@endif
|
||||
@@ -0,0 +1,39 @@
|
||||
@extends('layouts.app_callcenter')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<h4 class="text-center mb-4">Senarai Pelanggan Dijumpai</h4>
|
||||
@if(session('customer_list') && count(session('customer_list')) > 0)
|
||||
<table class="table table-bordered table-hover" style="background-color: #f9f9f9;">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>Nama</th>
|
||||
<th>No KP</th>
|
||||
<th>Kod Cawangan</th>
|
||||
<th>Tindakan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach(session('customer_list') as $customer)
|
||||
<tr>
|
||||
<td>{{ $customer['nama'] }}</td>
|
||||
<td>{{ $customer['kpbaru'] ?? $customer['kplama'] ?? '-' }}</td>
|
||||
<td>{{ $customer['kodcaw'] }}</td>
|
||||
<td>
|
||||
<form action="{{ route('arcc.pilihpelanggan.proceed') }}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="customer" value="{{ base64_encode(json_encode($customer)) }}">
|
||||
<button type="submit" class="btn btn-sm btn-primary">Pilih</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<div class="alert alert-warning">Tiada pelanggan dijumpai.</div>
|
||||
@endif
|
||||
|
||||
<a href="{{ route('arcc.pelanggan') }}" class="btn btn-secondary mt-3">Kembali</a>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user