ubah wakil approved
This commit is contained in:
@@ -1264,6 +1264,8 @@ class AliranTunaiController extends Controller
|
|||||||
Session::put('upahsemasa', $requestupah);
|
Session::put('upahsemasa', $requestupah);
|
||||||
|
|
||||||
$requestalirantunai = Http::get(config('api.url') . '/api/GetCurrentTunai/' . $auth_user['cawangan'],['kodlaluan' => Auth::user()->name])->json();
|
$requestalirantunai = Http::get(config('api.url') . '/api/GetCurrentTunai/' . $auth_user['cawangan'],['kodlaluan' => Auth::user()->name])->json();
|
||||||
|
$masuk = $requestalirantunai['masuk'];
|
||||||
|
$keluar = $requestalirantunai['keluar'];
|
||||||
|
|
||||||
$baki = $requestalirantunai['baki'];
|
$baki = $requestalirantunai['baki'];
|
||||||
|
|
||||||
|
|||||||
@@ -757,9 +757,92 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function daftarwakilfunction(nokp)
|
function daftarwakil()
|
||||||
{
|
{
|
||||||
$('#nokp').val(nokp);
|
let nopelanggan = $('#nopelangganwakil').val();
|
||||||
|
let nowakil = $('#nowakil').val();
|
||||||
|
let nama = $('#namawakil').val();
|
||||||
|
let hubungan = $('#slthubungan').val();
|
||||||
|
let alamat = $('#alamatwakil').val();
|
||||||
|
let telefon = $('#notelwakil').val();
|
||||||
|
let nota = $('#notawakil').val();
|
||||||
|
let nokp = $('#nokpwakil').val();
|
||||||
|
let norujukan = $('#norujukanwakil').val();
|
||||||
|
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
method:'POST',
|
||||||
|
url: "{{ route('wakil.create') }}",
|
||||||
|
data:{
|
||||||
|
"_token": "{{ csrf_token() }}",
|
||||||
|
"nopelanggan" : nopelanggan,
|
||||||
|
"nowakil" : nowakil,
|
||||||
|
"nama" : nama,
|
||||||
|
"hubungan" : hubungan,
|
||||||
|
"alamat" : alamat,
|
||||||
|
"telefon" : telefon,
|
||||||
|
"nota" : nota,
|
||||||
|
"icno" : nokp
|
||||||
|
},
|
||||||
|
success:function(data){
|
||||||
|
|
||||||
|
if(data == 1)
|
||||||
|
{
|
||||||
|
$('#WakilModal').hide();
|
||||||
|
$('#WakilModal').modal('hide');
|
||||||
|
nw = nowakil;
|
||||||
|
Swal.fire({
|
||||||
|
allowOutsideClick: false,
|
||||||
|
allowEscapeKey: false,
|
||||||
|
allowEnterKey: false,
|
||||||
|
confirmButtonText: '<i class="fa fa-thumbs-up"></i> Baik Boss!',
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Berjaya Mendaftar Wakil Pelanggan!'
|
||||||
|
}).then(function(){
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
method:'put',
|
||||||
|
url: api_url + '/api/ubahwakil/' + kodcaw,
|
||||||
|
data:{ 'nowakil' : nw,
|
||||||
|
'norujukan' : norujukan},
|
||||||
|
success:function(data){
|
||||||
|
|
||||||
|
if(data === 1)
|
||||||
|
{
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Berjaya!',
|
||||||
|
text: 'Penukaran Wakil berjaya'
|
||||||
|
}).then(async function(){
|
||||||
|
return true;
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'info',
|
||||||
|
title: 'Pemberitahuan!',
|
||||||
|
text: 'Wakil telah didaftarkan dengan IC tersebut!'
|
||||||
|
}).then(async function(){
|
||||||
|
return true;
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
},error: function (request, status, error) {
|
||||||
|
console.log(request.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function daftarwakilfunction(nokp,norujukan)
|
||||||
|
{
|
||||||
|
$('#nokpwakil').val(nokp);
|
||||||
|
$('#norujukanwakil').val(norujukan);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method:'GET',
|
method:'GET',
|
||||||
@@ -768,9 +851,9 @@
|
|||||||
success:function(data){
|
success:function(data){
|
||||||
|
|
||||||
$('#WakilModal').modal();
|
$('#WakilModal').modal();
|
||||||
$('#nama').val('');
|
$('#namawakil').val('');
|
||||||
$('#alamat').val(data['']);
|
$('#alamatwakil').val(data['']);
|
||||||
$('#notel').val(data['']);
|
$('#notelwakil').val(data['']);
|
||||||
|
|
||||||
//get first wakil
|
//get first wakil
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -786,10 +869,10 @@
|
|||||||
|
|
||||||
if(data != 'no-data')
|
if(data != 'no-data')
|
||||||
{
|
{
|
||||||
$('#nama').val(data['nama']);
|
$('#namawakil').val(data['nama']);
|
||||||
$('#alamat').val(data['alamat1']);
|
$('#alamatwakil').val(data['alamat1']);
|
||||||
$('#notel').val(data['telefon']);
|
$('#notelwakil').val(data['telefon']);
|
||||||
$('#nopelanggan').val(data['nopelanggan']);
|
$('#nopelangganwakil').val(data['nopelanggan']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1021,7 +1104,7 @@
|
|||||||
icon: 'info',
|
icon: 'info',
|
||||||
title: 'Maklumat anda tiada dalam senarai wakil! Tekan button Daftar untuk mendaftar!'
|
title: 'Maklumat anda tiada dalam senarai wakil! Tekan button Daftar untuk mendaftar!'
|
||||||
}).then(function(){
|
}).then(function(){
|
||||||
daftarwakilfunction(amaun);
|
daftarwakilfunction(amaun,norujukan);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},error: function(xhr, status, error) {
|
},error: function(xhr, status, error) {
|
||||||
|
|||||||
@@ -19,14 +19,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" id="nopelanggan"/>
|
<input type="hidden" id="nopelangganwakil"/>
|
||||||
|
<input type="hidden" id="norujukanwakil"/>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<label>No KP</label>
|
<label>No KP</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-7">
|
<div class="col-7">
|
||||||
<input type="text" class="form-control" id="nokp" name="nokp" readonly/>
|
<input type="text" class="form-control" id="nokpwakil" name="nokpwakil" readonly/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
<label>Nama</label>
|
<label>Nama</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<input type="text" class="form-control" id="nama" name="nama"/>
|
<input type="text" class="form-control" id="namawakil" name="namawakil"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@
|
|||||||
<label>Alamat</label>
|
<label>Alamat</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<input type="text" class="form-control" id="alamat" name="alamat"/>
|
<input type="text" class="form-control" id="alamatwakil" name="alamatwakil"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -54,7 +55,7 @@
|
|||||||
<label>No Tel</label>
|
<label>No Tel</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<input type="text" class="form-control" id="notel" name="notel"/>
|
<input type="text" class="form-control" id="notelwakil" name="notelwakil"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -63,7 +64,7 @@
|
|||||||
<label>Nota</label>
|
<label>Nota</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<input type="text" class="form-control" name="nota" id="nota"/>
|
<input type="text" class="form-control" name="notawakil" id="notawakil"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1997,14 +1997,14 @@
|
|||||||
|
|
||||||
function daftarwakil()
|
function daftarwakil()
|
||||||
{
|
{
|
||||||
let nopelanggan = $('#nopelanggan').val();
|
let nopelanggan = $('#nopelangganwakil').val();
|
||||||
let nowakil = $('#nowakil').val();
|
let nowakil = $('#nowakil').val();
|
||||||
let nama = $('#nama').val();
|
let nama = $('#namawakil').val();
|
||||||
let hubungan = $('#slthubungan').val();
|
let hubungan = $('#slthubungan').val();
|
||||||
let alamat = $('#alamat').val();
|
let alamat = $('#alamatwakil').val();
|
||||||
let telefon = $('#notel').val();
|
let telefon = $('#notelwakil').val();
|
||||||
let nota = $('#nota').val();
|
let nota = $('#notawakil').val();
|
||||||
let nokp = $('#nokp').val();
|
let nokp = $('#nokpwakil').val();
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -2052,7 +2052,7 @@
|
|||||||
|
|
||||||
function daftarfunction(id)
|
function daftarfunction(id)
|
||||||
{
|
{
|
||||||
$('#nokp').val(id);
|
$('#nokpwakil').val(id);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method:'GET',
|
method:'GET',
|
||||||
@@ -2061,9 +2061,9 @@
|
|||||||
success:function(data){
|
success:function(data){
|
||||||
|
|
||||||
$('#WakilModal').modal();
|
$('#WakilModal').modal();
|
||||||
$('#nama').val('');
|
$('#namawakil').val('');
|
||||||
$('#alamat').val(data['']);
|
$('#alamatwakil').val(data['']);
|
||||||
$('#notel').val(data['']);
|
$('#notelwakil').val(data['']);
|
||||||
|
|
||||||
//get first wakil
|
//get first wakil
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -2079,10 +2079,10 @@
|
|||||||
|
|
||||||
if(data != 'no-data')
|
if(data != 'no-data')
|
||||||
{
|
{
|
||||||
$('#nama').val(data['nama']);
|
$('#namawakil').val(data['nama']);
|
||||||
$('#alamat').val(data['alamat1']);
|
$('#alamatwakil').val(data['alamat1']);
|
||||||
$('#notel').val(data['telefon']);
|
$('#notelwakil').val(data['telefon']);
|
||||||
$('#nopelanggan').val(data['nopelanggan']);
|
$('#nopelangganwakil').val(data['nopelanggan']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user