check member search

This commit is contained in:
phyusin
2018-12-27 17:00:18 +06:30
parent 398f97f244
commit a09dfe1d1f
3 changed files with 43 additions and 24 deletions

View File

@@ -274,23 +274,30 @@
// get CardNo from Java
function setCardNo(cardNo){
check_member = localStorage.getItem("member_card");
if(cardNo.length == 16){
if($.inArray(cardNo, paypar_account_no) !== -1){
if(check_member == "true"){
$("#paypar_account_no").val(cardNo);
$("#search").val(cardNo);
$("#type").val("card");
}else{
swal({
title: 'Oops',
text: 'CardNo already registered, Please try another card!',
type: 'error',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.reload();
});
if($.inArray(cardNo, paypar_account_no) !== -1){
swal({
title: 'Oops',
text: 'CardNo already registered, Please try another card!',
type: 'error',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.reload();
});
}else{
$("#paypar_account_no").val(cardNo);
$("#search").val(cardNo);
$("#type").val("card");
}
}
}
}