verify marhun verify register
This commit is contained in:
@@ -14,13 +14,13 @@
|
||||
<div class="card-body">
|
||||
<div class="text-center">
|
||||
<h5 class="text-uppercase">masukkan nombor kad pengenalan</h5>
|
||||
<form name="frmsearch" action="{{ route('customer.search') }}" method="GET" onsubmit="verifyIC()">
|
||||
<form name="frmsearch" action="{{ route('customer.search') }}" method="GET">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-7">
|
||||
<div class="input-group my-3">
|
||||
<input type="text" class="form-control" name="noic" placeholder="No Kad Pengenalan Pelanggan" aria-label="No Kad Pengenalan Pelanggan" autocomplete="off" value="{{$search == false ? '' : $noic ?? ''}}" aria-describedby="button-addon2">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary" type="submit" id="button-addon2">Sahkan</button>
|
||||
<button class="btn btn-outline-primary" type="submit" id="button-addon2">Cari</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -44,7 +44,7 @@
|
||||
<h5 class="modal-title" id="ModalLabel">Daftar Pelanggan</h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{{ route('customer.store') }}" method="POST">
|
||||
<form action="{{ route('customer.store') }}" onsubmit="verifycustomer()" method="POST">
|
||||
@csrf
|
||||
<div class="row form-group">
|
||||
<div class="col-md-6">
|
||||
@@ -249,15 +249,113 @@
|
||||
});
|
||||
});
|
||||
|
||||
function verifyIC()
|
||||
{
|
||||
var a = $('input[name="noic"]').val();
|
||||
|
||||
|
||||
function verifycustomer(){
|
||||
var customername = $('#name').val();
|
||||
var customeralamat = $('#alamat').val();
|
||||
var customerposkod = $('#poskod').val();
|
||||
var customerphone = $('#main_phone').val();
|
||||
var customerphone_alternate = $('#alternate_phone').val();
|
||||
|
||||
if(customername == ''){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Masukkan Nama Pelanggan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
if(customeralamat == ''){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Masukkan Alamat Pelanggan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
if(customerposkod == ''){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Masukkan Poskod'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
if(customerposkod.length != 5){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Periksa Poskod'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
if($.isNumeric(customerposkod) == false){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Periksa Poskod'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(customerphone == ''){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Masukkan No Telefon Pelanggan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
if(customerphone.length < 8 && customerphone.length > 12){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Periksa No Telefon Pelanggan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
if($.isNumeric(customerphone) == false){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Masukkan Nombor Sahaja Pada No Telefon Pelanggan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(customerphone_alternate != ''){
|
||||
if(customerphone_alternate.length < 8 && customerphone_alternate.length > 12){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Periksa No Telefon Pelanggan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
if($.isNumeric(customerphone_alternate) == false){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Masukkan Nombor Sahaja Pada No Telefon Pelanggan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function identifyIC(noic){
|
||||
if(noic.match(/^(\d{2})(\d{2})(\d{2})-?\d{2}-?\d{4}$/)) {
|
||||
var year = noic.slice(0,2);
|
||||
|
||||
Reference in New Issue
Block a user