@@ -399,34 +445,34 @@
Daerah
-
+ {{--
@php
$poskod = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/poskod/'. $customer_info['poskod'])->json();
if(empty($poskod)){
$poskod = array('koddaerah'=>'NIL','kodnegeri' => 'NIL');
}
$daerah = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/daerah/' . $poskod['koddaerah'])->json();
- @endphp
+ @endphp --}}
{{-- --}}
-
-
-
+
--}}
+ {{--
+
--}}
@@ -2396,6 +2442,7 @@
$('#kodbank').attr('disabled', false);
$('#noakaun').attr('readonly', false);
$('#nota').attr('readonly', false);
+ $('#nota_arcc').attr('readonly', false);
$('#alamat').attr('readonly', false);
$('#poskod').attr('readonly', false);
@@ -2417,6 +2464,7 @@
$('#kodbank').attr('disabled', true);
$('#noakaun').attr('readonly', true);
$('#nota').attr('readonly', true);
+ $('#nota_arcc').attr('readonly', true);
$('#alamat').attr('readonly', true);
$('#poskod').attr('readonly', true);
}
@@ -2424,18 +2472,20 @@
$("#kemaskiniform").submit(function(event) {
event.preventDefault();
- var nokp = $('#icno').val();
+ var nokp = $('#noic').val();
var telefon1 = $('#telefon').val();
var telefon2 = $('#telefon2').val();
var kodbank = $('#kodbank').val();
var noakaun = $('#noakaun').val();
var nota = $('#nota').val();
+ var nota_arcc = $('#nota_arcc').val();
var alamat = $('#alamat').val();
var poskod = $('#poskod').val();
$.ajax({
method:"put",
- url: api_url + "/api/customers/update/kaunter/" + nokp,
+ // url: api_url + "/api/customers/update/kaunter/" + nokp + "/" + kodcaw,
+ url: api_url + "/api/callcenter/customers/update/kaunter/" + nokp + "/" + kodcaw,
data:{
"namateller" : "{{ Auth::user()->name }}",
"telefon1": telefon1,
@@ -2443,6 +2493,7 @@
"kodbank":kodbank,
"noakaun":noakaun,
'nota':nota,
+ 'nota_arcc':nota_arcc,
'alamat':alamat,
'poskod':poskod
},
@@ -2479,94 +2530,119 @@
});
});
+ // function kemaskinipelanggan(){
+
+ // var errortelefon1 = 0;
+ // var errortelefon2 = 0;
+
+ // if(!($('#telefon').val().length >= 9 && $('#telefon').val().length < 12)){
+ // $('#errortelefon').show();
+ // $('#errortelefon').text("*lebih kecil dari 10 dan lebih besar dari 12");
+ // $('#telefon').addClass('is-invalid');
+ // errortelefon1++;
+ // }else{
+ // $('#errortelefon').hide();
+ // $('#telefon').removeClass('is-invalid');
+ // errortelefon1--;
+ // }
+
+ // if($('#telefon2').val() != ''){
+ // if(!($('#telefon2').val().length >= 9 && $('#telefon2').val().length < 12)){
+ // $('#errortelefon2').show();
+ // $('#errortelefon2').text("*lebih kecil dari 10 dan lebih besar dari 12");
+ // $('#telefon2').addClass('is-invalid');
+ // errortelefon2++;
+ // }else{
+ // $('#errortelefon2').hide();
+ // $('#telefon2').removeClass('is-invalid');
+ // errortelefon2--;
+ // }
+ // }else{
+ // $('#errortelefon2').hide();
+ // $('#telefon2').removeClass('is-invalid');
+ // errortelefon2--;
+ // }
+
+ // if(errortelefon1 <= 0 && errortelefon2 <= 0){
+ // $('#btnkemaskini').removeClass('btn-danger');
+ // $('#btnkemaskini').addClass('btn-primary');
+ // $('#btnkemaskini').text('Ubah');
+ // $('#btnkemaskini').attr('onclick','kemaskinifunc()');
+ // $('#btnotp').text('Daftar Akuan Online');
+ // $('#btnotp').attr('onclick','#');
+
+ // //attribute nak readonly false
+ // $('#telefon').attr('readonly', true);
+ // $('#telefon2').attr('readonly', true);
+ // $('#noakaun').attr('readonly', true);
+ // $('#kodbank').attr('readonly', true);
+ // $('#nota').attr('readonly', true);
+ // $('#nota_arcc').attr('readonly', true);
+ // $('#alamat').attr('readonly', true);
+ // $('#poskod').attr('readonly', true);
+
+ // $('#kemaskiniform').trigger('submit');
+ // }
+ // }
+
+ // $('#btnotp').click(function(){
+ // $('#customer_detail').modal('hide');
+ // var noic = $('#noic').val();
+ // $('#noic_otp').val(noic);
+ // $('#opt_modal').modal('show');
+ // });
+
+ // $('#jana_otp').click(function(){
+ // var noic = $('#noic_otp').val();
+
+ // $.ajax({
+ // method:'get',
+ // url: "{{ route('customer.otp') }}",
+ // data:{
+ // 'noic_otp' : noic
+ // },
+ // dataType:'json',
+ // success: function(otp_token){
+ // if(otp_token['error']){
+ // Swal.fire({
+ // icon: 'error',
+ // title: 'Amaran!',
+ // text: otp_token['error']
+ // });
+ // }else if(otp_token['otp']){
+ // $('#otp_form').hide();
+ // $('#otp_generate').show();
+ // $('#otp_number').text(otp_token['otp']);
+ // }
+ // },
+ // error: function(xhRequest, ErrorText, thrownError){
+ // console.log(xhRequest);
+ // }
+ // });
+ // });
+
function kemaskinipelanggan(){
+ // Tukar butang "Batal" jadi "Ubah" semula
+ $('#btnkemaskini').removeClass('btn-danger');
+ $('#btnkemaskini').addClass('btn-primary');
+ $('#btnkemaskini').text('Ubah');
+ $('#btnkemaskini').attr('onclick','kemaskinifunc()');
+ $('#btnotp').text('Daftar Akuan Online');
+ $('#btnotp').attr('onclick','#');
- var errortelefon1 = 0;
- var errortelefon2 = 0;
+ // Lock balik semua field
+ $('#telefon').attr('readonly', true);
+ $('#telefon2').attr('readonly', true);
+ $('#noakaun').attr('readonly', true);
+ $('#kodbank').attr('disabled', true);
+ $('#nota').attr('readonly', true);
+ $('#nota_arcc').attr('readonly', true);
+ $('#alamat').attr('readonly', true);
+ $('#poskod').attr('readonly', true);
- if(!($('#telefon').val().length >= 9 && $('#telefon').val().length < 12)){
- $('#errortelefon').show();
- $('#errortelefon').text("*lebih kecil dari 10 dan lebih besar dari 12");
- $('#telefon').addClass('is-invalid');
- errortelefon1++;
- }else{
- $('#errortelefon').hide();
- $('#telefon').removeClass('is-invalid');
- errortelefon1--;
- }
+ console.log("👉 Hantar form kemaskini (nota_arcc)");
+ $('#kemaskiniform').trigger('submit');
+}
- if($('#telefon2').val() != ''){
- if(!($('#telefon2').val().length >= 9 && $('#telefon2').val().length < 12)){
- $('#errortelefon2').show();
- $('#errortelefon2').text("*lebih kecil dari 10 dan lebih besar dari 12");
- $('#telefon2').addClass('is-invalid');
- errortelefon2++;
- }else{
- $('#errortelefon2').hide();
- $('#telefon2').removeClass('is-invalid');
- errortelefon2--;
- }
- }else{
- $('#errortelefon2').hide();
- $('#telefon2').removeClass('is-invalid');
- errortelefon2--;
- }
-
- if(errortelefon1 <= 0 && errortelefon2 <= 0){
- $('#btnkemaskini').removeClass('btn-danger');
- $('#btnkemaskini').addClass('btn-primary');
- $('#btnkemaskini').text('Ubah');
- $('#btnkemaskini').attr('onclick','kemaskinifunc()');
- $('#btnotp').text('Daftar Akuan Online');
- $('#btnotp').attr('onclick','#');
-
- //attribute nak readonly false
- $('#telefon').attr('readonly', true);
- $('#telefon2').attr('readonly', true);
- $('#noakaun').attr('readonly', true);
- $('#kodbank').attr('disabled', true);
- $('#nota').attr('readonly', true);
- $('#alamat').attr('readonly', true);
- $('#poskod').attr('readonly', true);
-
- $('#kemaskiniform').trigger('submit');
- }
- }
-
- $('#btnotp').click(function(){
- $('#customer_detail').modal('hide');
- var noic = $('#noic').val();
- $('#noic_otp').val(noic);
- $('#opt_modal').modal('show');
- });
-
- $('#jana_otp').click(function(){
- var noic = $('#noic_otp').val();
-
- $.ajax({
- method:'get',
- url: "{{ route('customer.otp') }}",
- data:{
- 'noic_otp' : noic
- },
- dataType:'json',
- success: function(otp_token){
- if(otp_token['error']){
- Swal.fire({
- icon: 'error',
- title: 'Amaran!',
- text: otp_token['error']
- });
- }else if(otp_token['otp']){
- $('#otp_form').hide();
- $('#otp_generate').show();
- $('#otp_number').text(otp_token['otp']);
- }
- },
- error: function(xhRequest, ErrorText, thrownError){
- console.log(xhRequest);
- }
- });
- });
@endsection
diff --git a/resources/views/customers/v2/info.blade.php b/resources/views/customers/v2/info.blade.php
index f925023..cd4463a 100644
--- a/resources/views/customers/v2/info.blade.php
+++ b/resources/views/customers/v2/info.blade.php
@@ -404,6 +404,9 @@
@php
$poskod = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/poskod/'. $customer_info['poskod'])->json();
+ // $data = $poskod;
+ // $poskod2 = array('koddaerah'=>'NIL','kodnegeri' => 'NIL');
+ // dd($poskod,$poskod2,$data,$customer_info);
if(empty($poskod)){
$poskod = array('koddaerah'=>'NIL','kodnegeri' => 'NIL');
}
@@ -431,6 +434,14 @@