Merge branch 'pipi' into 'master'
change ui See merge request online-sistem1/kaunter!15
This commit is contained in:
@@ -156,4 +156,5 @@ class CustomersController extends Controller
|
||||
|
||||
return view('onetimepassword.home',compact('cawangan_info','api_url'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Vendored
+4
File diff suppressed because one or more lines are too long
Vendored
+4
File diff suppressed because one or more lines are too long
@@ -10,6 +10,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="kemaskiniform">
|
||||
<div class='row form-group'>
|
||||
<div class='col-md-6'>
|
||||
<div class='form-group row col-md-12'>
|
||||
@@ -17,7 +18,7 @@
|
||||
Nama
|
||||
</div>
|
||||
<div class='col-md-7'>
|
||||
<input type="text" readonly name='' id='' value="{{ $customer_info['nama'] }}" class='form-control'>
|
||||
<input type="text" readonly name='nama' id='nama' value="{{ $customer_info['nama'] }}" class='form-control'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-group row col-md-12'>
|
||||
@@ -25,7 +26,7 @@
|
||||
No KP
|
||||
</div>
|
||||
<div class='col-md-7'>
|
||||
<input type="text" readonly name='' id='' value="{{ $customer_info['kpbaru'] }}" class='form-control'>
|
||||
<input type="text" readonly name='icno' id='icno' value="{{ $customer_info['kpbaru'] }}" class='form-control'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-group row col-md-12'>
|
||||
@@ -33,7 +34,7 @@
|
||||
No Pelanggan
|
||||
</div>
|
||||
<div class='col-md-7'>
|
||||
<input type="text" readonly name='' id='' value="{{ $customer_info['nopelanggan'] }}" class='form-control'>
|
||||
<input type="text" readonly name='nopelanggan' id='nopelanggan' value="{{ $customer_info['nopelanggan'] }}" class='form-control'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-group row col-md-12'>
|
||||
@@ -41,7 +42,8 @@
|
||||
No Telefon 1
|
||||
</div>
|
||||
<div class='col-md-7'>
|
||||
<input type="text" readonly name='' id='' value="{{ $customer_info['telefon'] }}" class='form-control'>
|
||||
<input type="text" readonly name='' id='telefon' value="{{ $customer_info['telefon'] }}" class='form-control'>
|
||||
<span id="errortelefon" style="color:red;"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-group row col-md-12'>
|
||||
@@ -49,7 +51,8 @@
|
||||
No Telefon 2
|
||||
</div>
|
||||
<div class='col-md-7'>
|
||||
<input type="text" readonly name='' id='' value="{{ $customer_info['telefon2'] }}" class='form-control'>
|
||||
<input type="text" readonly name='telefon2' id='telefon2' value="{{ $customer_info['telefon2'] }}" class='form-control'>
|
||||
<span id="errortelefon2" style="color:red;"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -67,7 +70,7 @@
|
||||
Poskod
|
||||
</div>
|
||||
<div class='col-md-8'>
|
||||
<input type="text" readonly name='' id='' value="{{ $customer_info['poskod'] }}" class='form-control'>
|
||||
<input type="text" readonly name='poskod' id='poskod' value="{{ $customer_info['poskod'] }}" class='form-control'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-group row col-md-12'>
|
||||
@@ -75,7 +78,7 @@
|
||||
Daerah
|
||||
</div>
|
||||
<div class='col-md-8'>
|
||||
<input type="text" readonly name='' id='' value="{{ $customer_info['koddaerah'] }}" class='form-control'>
|
||||
<input type="text" readonly name='koddaerah' id='koddaerah' value="{{ $customer_info['koddaerah'] }}" class='form-control'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-group row col-md-12'>
|
||||
@@ -83,11 +86,19 @@
|
||||
Negeri
|
||||
</div>
|
||||
<div class='col-md-8'>
|
||||
<input type="text" readonly name='' id='' value="{{ $customer_info['kodnegeri'] }}" class='form-control'>
|
||||
<input type="text" readonly name='kodnegeri' id='kodnegeri' value="{{ $customer_info['kodnegeri'] }}" class='form-control'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="mr-5 form-group float-right">
|
||||
<button type="button" class="btn btn-primary" onclick="kemaskinifunc()" id="btnkemaskini">Kemaskini</button>
|
||||
<button type="button" class="btn btn-primary" id="btnotp">OTP</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
@@ -95,6 +106,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
@@ -220,7 +233,7 @@
|
||||
function gadaiOptionButton(noic){
|
||||
tablegadai.clear().draw();
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus'){
|
||||
// console.log(noic);
|
||||
|
||||
$.ajax({
|
||||
method:"GET",
|
||||
url: api_url + "/api/customers/"+noic+"/gadai/belum_tebus",
|
||||
@@ -248,5 +261,138 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function kemaskinifunc()
|
||||
{
|
||||
$('#btnkemaskini').addClass('btn-danger');
|
||||
$('#btnkemaskini').removeClass('btn-primary');
|
||||
$('#btnkemaskini').text('Cancel');
|
||||
$('#btnkemaskini').attr('onclick','cancelbutton()');
|
||||
$('#btnotp').text('Save');
|
||||
$('#btnotp').attr('onclick','kemaskinipelanggan()');
|
||||
|
||||
//attribute nak readonly false
|
||||
$('#telefon').attr('readonly', false);
|
||||
$('#telefon2').attr('readonly', false);
|
||||
|
||||
}
|
||||
|
||||
function cancelbutton()
|
||||
{
|
||||
$('#btnkemaskini').removeClass('btn-danger');
|
||||
$('#btnkemaskini').addClass('btn-primary');
|
||||
$('#btnkemaskini').text('Kemaskini');
|
||||
$('#btnkemaskini').attr('onclick','kemaskinifunc()');
|
||||
$('#btnotp').text('OTP');
|
||||
$('#btnotp').attr('onclick','#');
|
||||
|
||||
document.getElementById("kemaskiniform").reset();
|
||||
|
||||
//attribute nak readonly false
|
||||
$('#telefon').attr('readonly', true);
|
||||
$('#telefon2').attr('readonly', true);
|
||||
|
||||
}
|
||||
|
||||
$("#kemaskiniform").submit(function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
var alamat = $('#alamat').val();
|
||||
var nokp = $('#icno').val();
|
||||
var poskod = $('#poskod').val();
|
||||
var telefon1 = $('#telefon').val();
|
||||
var telefon2 = $('#telefon2').val();
|
||||
|
||||
$.ajax({
|
||||
method:"put",
|
||||
url: api_url + "/api/customersonline/" + nokp,
|
||||
data:{
|
||||
"alamat": alamat,
|
||||
"poskod": poskod,
|
||||
"telefon1": telefon1,
|
||||
"telefon2": telefon2
|
||||
},
|
||||
success: function(success){
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Berjaya',
|
||||
text: 'Anda telah berjaya mengemaskini maklumat pelanggan'
|
||||
})
|
||||
},
|
||||
error: function (request, status, error) {
|
||||
alert(request.responseText);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
function kemaskinipelanggan()
|
||||
{
|
||||
|
||||
var errortelefon1 = 0;
|
||||
var errortelefon2 = 0;
|
||||
|
||||
if(!($('#telefon').val().length > 10 && $('#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 > 10 && $('#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('Kemaskini');
|
||||
$('#btnkemaskini').attr('onclick','kemaskinifunc()');
|
||||
$('#btnotp').text('OTP');
|
||||
$('#btnotp').attr('onclick','#');
|
||||
|
||||
//attribute nak readonly false
|
||||
$('#telefon').attr('readonly', true);
|
||||
$('#telefon2').attr('readonly', true);
|
||||
|
||||
$('#kemaskiniform').trigger('submit');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -456,8 +456,9 @@
|
||||
var harga = $('#harga').val();
|
||||
var nilaimarhun = $('#nilai_marhun').val();
|
||||
var nota_array = $('#nota').val();
|
||||
var nota = nota_array.toString();
|
||||
|
||||
if(marhun == null && karat == null && berat_emas == null){
|
||||
if(marhun == null && karat == null && berat_emas == ''){
|
||||
$('#daftar_marhun').modal('hide');
|
||||
}
|
||||
else{
|
||||
@@ -472,10 +473,10 @@
|
||||
'karat' : karat,
|
||||
'berat_emas' :berat_emas,
|
||||
'harga' : harga,
|
||||
'nilai_marhun' : nilai_marhun
|
||||
'nilai_marhun' : nilaimarhun
|
||||
},
|
||||
success:function(data){
|
||||
// alert('Tambah Marhun Berjaya');
|
||||
success:function(successdata){
|
||||
alert('Tambah Marhun Berjaya');
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Berjaya!',
|
||||
@@ -505,7 +506,10 @@
|
||||
console.log(xhRequest);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('#tambah_marhun').click(function(){
|
||||
|
||||
@@ -35,6 +35,12 @@
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
|
||||
<script src="{{ asset('vendor/DataTables/datatables.min.js') }}"></script>
|
||||
|
||||
{{-- jquery validation --}}
|
||||
<script src="{{ asset('js/jquery.validate.min.js') }}"></script>
|
||||
<script src="{{ asset('js/additional-methods.min.js') }}"></script>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function startTime() {
|
||||
var today = new Date();
|
||||
|
||||
Reference in New Issue
Block a user