This commit is contained in:
Afiq Zakwan Hamdan
2021-07-09 00:56:33 +08:00
parent dfab5fafa0
commit 95d244ff79
13 changed files with 271 additions and 119 deletions
+27 -2
View File
@@ -175,7 +175,7 @@
<div class="modal-footer">
<input type="text" hidden name="idtype" value="nokp">
<button type="button" class="btn btn-danger" data-dismiss="modal">Batal</button>
<input type="submit" name="submit" class="btn btn-primary" value="Terima">
<input type="submit" name="submit" class="btn btn-primary" id="terima_ic" value="Terima">
</div>
</form>
</div>
@@ -296,7 +296,7 @@
<div class="modal-footer">
<input type="text" hidden name="idtype" value="passport">
<button type="button" class="btn btn-danger" data-dismiss="modal">Batal</button>
<input type="submit" name="submit" class="btn btn-primary" value="Terima">
<input type="submit" name="submit" class="btn btn-primary" id="terima_passport" value="Terima">
</div>
</form>
</div>
@@ -436,6 +436,7 @@
});
function verifycustomer(){
$("#terima_ic").prop('disabled', true);
var customername = $('#name').val();
var customeralamat = $('#alamat').val();
var customerposkod = $('#poskod').val();
@@ -443,6 +444,7 @@
var customerphone_alternate = $('#alternate_phone').val();
var age = $('#age').val();
if(age < 18){
$("#terima_ic").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -452,6 +454,7 @@
return false;
}
if(customername == ''){
$("#terima_ic").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -461,6 +464,7 @@
return false;
}
if(customeralamat == ''){
$("#terima_ic").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -470,6 +474,7 @@
return false;
}
if(customerposkod == ''){
$("#terima_ic").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -479,6 +484,7 @@
return false;
}else{
if(customerposkod.length != 5){
$("#terima_ic").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -488,6 +494,7 @@
return false;
}else{
if($.isNumeric(customerposkod) == false){
$("#terima_ic").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -499,6 +506,7 @@
}
}
if(customerphone == ''){
$("#terima_ic").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -508,6 +516,7 @@
return false;
}else{
if((customerphone.length < 9 || customerphone.length >= 12)){
$("#terima_ic").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -517,6 +526,7 @@
return false;
}else{
if($.isNumeric(customerphone) == false){
$("#terima_ic").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -529,6 +539,7 @@
}
if(customerphone_alternate != ''){
if(customerphone_alternate.length < 8 && customerphone_alternate.length > 12){
$("#terima_ic").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -538,6 +549,7 @@
return false;
}else{
if($.isNumeric(customerphone_alternate) == false){
$("#terima_ic").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -552,6 +564,7 @@
}
function verifycustomerpassport(){
$("#terima_passport").prop('disabled', true);
var customername = $('#passport_name').val();
var customeralamat = $('#passport_alamat').val();
var customerposkod = $('#passport_poskod').val();
@@ -561,6 +574,7 @@
var age = $('#passport_age').val();
if(age < 18){
$("#terima_passport").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -570,6 +584,7 @@
return false;
}
if(customername == ''){
$("#terima_passport").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -579,6 +594,7 @@
return false;
}
if(tarikh_lahir == ''){
$("#terima_passport").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -588,6 +604,7 @@
return false;
}
if(customeralamat == ''){
$("#terima_passport").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -597,6 +614,7 @@
return false;
}
if(customerposkod == ''){
$("#terima_passport").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -606,6 +624,7 @@
return false;
}else{
if(customerposkod.length != 5){
$("#terima_passport").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -615,6 +634,7 @@
return false;
}else{
if($.isNumeric(customerposkod) == false){
$("#terima_passport").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -626,6 +646,7 @@
}
}
if(customerphone == ''){
$("#terima_passport").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -635,6 +656,7 @@
return false;
}else{
if(customerphone.length <= 9 || customerphone.length >= 12){
$("#terima_passport").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -644,6 +666,7 @@
return false;
}else{
if($.isNumeric(customerphone) == false){
$("#terima_passport").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -656,6 +679,7 @@
}
if(customerphone_alternate != ''){
if(customerphone_alternate.length <= 8 && customerphone_alternate.length >= 12){
$("#terima_passport").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -665,6 +689,7 @@
return false;
}else{
if($.isNumeric(customerphone_alternate) == false){
$("#terima_passport").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
+12 -9
View File
@@ -92,7 +92,7 @@
<b>No Telefon</b>
</div>
<div class="col-md-8">
<input type="text" class="form-control" name="cust_telefon" id="cust_telefon" readonly value="{{ $customer_info['telefon'] }}">
<input type="text" class="form-control" name="cust_telefon" id="cust_telefon" readonly value="{{ $customer_info['telefon'] ? $customer_info['telefon'] : 'NIL' }}">
</div>
</div>
@@ -248,7 +248,7 @@
No KP
</div>
<div class='col-md-7'>
<input type="text" readonly name='icno' id='icno' value="{{ $customer_info['kpbaru'] }}" class='form-control'>
<input type="text" readonly name='icno' id='icno' value="{{ $customer_info['kpbaru'] ? $customer_info['kpbaru'] : $customer_info['kplama'] }}" class='form-control'>
</div>
</div>
<div class='form-group row col-md-12'>
@@ -264,7 +264,7 @@
No Telefon 1
</div>
<div class='col-md-7'>
<input type="text" readonly name='' id='telefon' value="{{ $customer_info['telefon'] }}" class='form-control'>
<input type="text" readonly name='' id='telefon' value="{{ $customer_info['telefon'] ? $customer_info['telefon'] : 'NIL' }}" class='form-control'>
<span id="errortelefon" style="color:red;"></span>
</div>
</div>
@@ -273,7 +273,7 @@
No Telefon 2
</div>
<div class='col-md-7'>
<input type="text" readonly name='telefon2' id='telefon2' value="{{ $customer_info['telefon2'] }}" class='form-control'>
<input type="text" readonly name='telefon2' id='telefon2' value="{{ $customer_info['telefon2'] ? $customer_info['telefon2'] : 'NIL' }}" class='form-control'>
<span id="errortelefon2" style="color:red;"></span>
</div>
</div>
@@ -310,7 +310,7 @@
Alamat
</div>
<div class='col-md-8'>
<textarea style="resize:none" name="alamat" id="alamat" cols="30" rows="3" readonly class='form-control'>{{ $customer_info['alamat1'] }}</textarea>
<textarea style="resize:none" name="alamat" id="alamat" cols="30" rows="3" readonly class='form-control'>{{ $customer_info['alamat1'] ? $customer_info['alamat1'] : 'NIL' }}</textarea>
</div>
</div>
<div class='form-group row col-md-12'>
@@ -318,7 +318,7 @@
Poskod
</div>
<div class='col-md-8'>
<input type="text" readonly name='poskod' id='poskod' value="{{ $customer_info['poskod'] }}" class='form-control'>
<input type="text" readonly name='poskod' id='poskod' value="{{ $customer_info['poskod'] ? $customer_info['poskod'] : 'NIL' }}" class='form-control'>
</div>
</div>
<div class='form-group row col-md-12'>
@@ -328,9 +328,12 @@
<div class='col-md-8'>
@php
$poskod = Http::get($api_url . '/api/poskod/'. $customer_info['poskod'])->json();
if(sizeof($poskod) < 1 || sizeof($poskod) > 1){
$poskod = array('koddaerah'=>'NIL','kodnegeri' => 'NIL');
}
$daerah = Http::get($api_url . '/api/daerah/' . $poskod['koddaerah'])->json();
@endphp
<input type="text" readonly name='koddaerah' id='koddaerah' value="{{ $daerah['namadaerah'] }}" class='form-control'>
<input type="text" readonly name='koddaerah' id='koddaerah' value="{{ $daerah ? $daerah['namadaerah'] : 'NIL' }}" class='form-control'>
</div>
</div>
<div class='form-group row col-md-12'>
@@ -341,7 +344,7 @@
@php
$negeri = Http::get($api_url . '/api/negeri/' . $poskod['kodnegeri'])->json();
@endphp
<input type="text" readonly name='kodnegeri' id='kodnegeri' value="{{ $negeri['negeri'] }}" class='form-control'>
<input type="text" readonly name='kodnegeri' id='kodnegeri' value="{{ $negeri ? $negeri['negeri'] : 'NIL' }}" class='form-control'>
</div>
</div>
<div class='form-group row col-md-12'>
@@ -699,7 +702,7 @@
'<input type="radio" value='+ gadai_detail["norujukan"] +' name="belum"/>',
'<a href="#" onclick="checkserah(this)" data-norujukan='+ gadai_detail['norujukan'] +' data-url=' + urlroute +'>' + gadai_detail['norujukan'] + '</a>',
gadai_detail['t_gadai'],
gadai_detail['t_matang1'],
gadai_detail['t_matang'],
'RM '+ formatter.format(gadai_detail['bakihargajualan']),
'RM '+formatter.format(gadai_detail['bakipjm']),
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',