fix sedikit2
This commit is contained in:
@@ -600,11 +600,10 @@ class KhazanahController extends Controller
|
||||
'siri' => $request->siri
|
||||
])->json();
|
||||
|
||||
$getlulus = Http::get(config('api.url') . '/api/ListLatestLulus/'. $auth_user['cawangan'] . '/' . $norujukan)->json();
|
||||
|
||||
if($updatelulus)
|
||||
{
|
||||
event(new NotifikasiKelulusan($norujukan,"lulus",$request->siri,$request->komenkelulusan,$getlulus['teller']));
|
||||
event(new NotifikasiKelulusan($norujukan,"lulus",$request->siri,$request->komenkelulusan,$request->teller));
|
||||
}
|
||||
|
||||
}else{
|
||||
@@ -615,11 +614,10 @@ class KhazanahController extends Controller
|
||||
"pembatalan" => "batal"
|
||||
])->json();
|
||||
|
||||
$getlulus = Http::get(config('api.url') . '/api/ListLatestLulus/'. $auth_user['cawangan'] . '/' . $norujukan)->json();
|
||||
|
||||
if($updatelulus)
|
||||
{
|
||||
event(new NotifikasiKelulusan($norujukan,"batal",$request->siri,$request->komenkelulusan,$getlulus['teller']));
|
||||
event(new NotifikasiKelulusan($norujukan,"batal",$request->siri,$request->komenkelulusan,$request->teller));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -648,9 +646,7 @@ class KhazanahController extends Controller
|
||||
'namaoperasi' => $request->namaoperasi
|
||||
])->json();
|
||||
|
||||
$getlulus = Http::get(config('api.url') . '/api/ListLatestLulus/'. $auth_user['cawangan'] . '/' . $norujukan)->json();
|
||||
|
||||
event(new NotifikasiKelulusan($norujukan,"batal",$request->siri,$request->komenkelulusan,$getlulus['teller']));
|
||||
event(new NotifikasiKelulusan($norujukan,"batal",$request->siri,$request->komenkelulusan,$request->teller));
|
||||
|
||||
}
|
||||
|
||||
@@ -2875,6 +2871,54 @@ class KhazanahController extends Controller
|
||||
return response($daftarpolis);
|
||||
}
|
||||
|
||||
public function SuratAkuanGadaianUpdate(Request $request)
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
|
||||
$cawangan = Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
|
||||
$gadai = Http::get(config('api.url').'/api/gadai/norujukan/'.$request->norujukanhidden)->json();
|
||||
|
||||
foreach($gadai as $index1=>$gad)
|
||||
$customers = Http::get(config('api.url').'/api/customers/'.$gad[0]['nokp'])->json();
|
||||
|
||||
$kodnegeridandaerah = $request->negeriagh .'|' . $request->daerahagh;
|
||||
|
||||
$polis = Http::get(config('api.url').'/api/polis/get/',['norujukan' => $request->norujukanhidden,'kodcaw' => $auth_user['cawangan']])->json();
|
||||
|
||||
$daftar = 0;
|
||||
|
||||
$daftarpolis = Http::put(config('api.url').'/api/polis/edit/',[
|
||||
|
||||
'kodcaw' =>$auth_user['cawangan'],
|
||||
'norujukan' => $request->norujukanhidden,
|
||||
'komen1' => $request->alasan,
|
||||
'komen2' => $kodnegeridandaerah,
|
||||
'teller' => $auth_user['name']
|
||||
|
||||
]);
|
||||
|
||||
$daftar = $daftarpolis->getStatusCode();
|
||||
|
||||
if($daftar == 200)
|
||||
{
|
||||
$polis = Http::get(config('api.url').'/api/polis/get/',['norujukan' => $request->norujukanhidden,'kodcaw' => $auth_user['cawangan']])->json();
|
||||
|
||||
event(new NotifikasiAGH($auth_user['cawangan'],'Surat Akuan Gadaian Hilang berjaya dijana.','success',$auth_user['name']));
|
||||
// return redirect()->route('khazanah.customer_info')->with('aghinformation','Surat Akuan Gadaian Hilang berjaya dijana.|success');
|
||||
return view('print.suratgadaianhilang', compact('polis','gadai','customers','cawangan_detail','api_url'));
|
||||
|
||||
}else{
|
||||
|
||||
event(new NotifikasiAGH($auth_user['cawangan'],'Mengalami masalah dalam menjana.','error',$auth_user['name']));
|
||||
// return redirect()->route('khazanah.customer_info')->with('aghinformation','Mengalami masalah dalam menjana.|error');
|
||||
}
|
||||
|
||||
return response($daftarpolis);
|
||||
}
|
||||
|
||||
public function ulangcetakSuratAkuanGadaianHilang($norujukan)
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
|
||||
@@ -92,11 +92,9 @@ class OperasiController extends Controller
|
||||
'siri' => $request->siri
|
||||
])->json();
|
||||
|
||||
$getlulus = Http::get(config('api.url') . '/api/ListLatestLulus/'. $auth_user['cawangan'] . '/' . $norujukan)->json();
|
||||
|
||||
if($updatelulus)
|
||||
{
|
||||
event(new NotifikasiKelulusan($norujukan,"lulus",$request->siri,$request->komenkelulusan,$getlulus['teller']));
|
||||
event(new NotifikasiKelulusan($norujukan,"lulus",$request->siri,$request->komenkelulusan,$request->teller));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -107,11 +105,9 @@ class OperasiController extends Controller
|
||||
'siri' => $request->siri
|
||||
])->json();
|
||||
|
||||
$getlulus = Http::get(config('api.url') . '/api/ListLatestLulus/'. $auth_user['cawangan'] . '/' . $norujukan)->json();
|
||||
|
||||
if($updatelulus)
|
||||
{
|
||||
event(new NotifikasiKelulusan($norujukan,"batal",$request->siri,$request->komenkelulusan,$getlulus['teller']));
|
||||
event(new NotifikasiKelulusan($norujukan,"batal",$request->siri,$request->komenkelulusan,$request->teller));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -688,23 +688,33 @@
|
||||
}
|
||||
}
|
||||
|
||||
function ulangcetakagh()
|
||||
function ulangcetakagh(e)
|
||||
{
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus'){
|
||||
var komen2 = $(e).data('komen2');
|
||||
|
||||
if(komen2 !== null)
|
||||
{
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus'){
|
||||
let histid = $('input[name="belum"]:checked').val();
|
||||
if(histid == null){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Sila pilih salah satu SAG'
|
||||
});
|
||||
}else{
|
||||
let urlroute = '{{ route("agh.ulangcetak", ":id") }}';
|
||||
urlroute = urlroute.replace(':id', histid);
|
||||
window.open(urlroute, '_blank');
|
||||
swal.close();
|
||||
if(histid == null){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Sila pilih salah satu SAG'
|
||||
});
|
||||
}else{
|
||||
let urlroute = '{{ route("agh.ulangcetak", ":id") }}';
|
||||
urlroute = urlroute.replace(':id', histid);
|
||||
window.open(urlroute, '_blank');
|
||||
swal.close();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$('#AGHModalEdit').modal('show');
|
||||
swal.close();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
function saghilangfunc()
|
||||
@@ -724,6 +734,7 @@
|
||||
data:{ "norujukan" : histid,"kodcaw" : kodcaw},
|
||||
success:function(data)
|
||||
{
|
||||
|
||||
var count = Object.keys(data).length;
|
||||
|
||||
if(count > 0)
|
||||
@@ -735,7 +746,7 @@
|
||||
showConfirmButton: false,
|
||||
html: "<br>" +
|
||||
'<button type="button" role="button" tabindex="0" class="btn btn-primary mr-1" onclick="swal.close()">' + 'Okay' + '</button>' +
|
||||
'<button type="button" role="button" tabindex="0" class="btn btn-primary" onclick="ulangcetakagh()">' + 'Ulang Cetak' + '</button>',
|
||||
'<button type="button" role="button" tabindex="0" class="btn btn-primary" onclick="ulangcetakagh(this)" data-komen2="' + data[0].komen2 + '">' + 'Ulang Cetak' + '</button>',
|
||||
icon: 'error',
|
||||
title: 'Surat Akuan Gadaian Hilang telah dikeluarkan!'
|
||||
});
|
||||
|
||||
@@ -311,6 +311,7 @@
|
||||
allowOutsideClick: false
|
||||
})
|
||||
|
||||
let teller = $(e).closest('tr').children('td:eq(1)').text();
|
||||
let nm = $(e).closest('tr').children('td:eq(4)').text();
|
||||
let ber = $(e).closest('tr').children('td:eq(5)').text();
|
||||
let marg = $(e).closest('tr').children('td:eq(6)').text();
|
||||
@@ -322,6 +323,8 @@
|
||||
let siri = $(e).data('siri');
|
||||
let namakhazanah = "{{ Auth::user()->name }}";
|
||||
|
||||
teller = String(teller);
|
||||
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url: "{{ route('khazanah.updatekelulusan') }}",
|
||||
@@ -331,7 +334,8 @@
|
||||
"pelulus" : pelulus,
|
||||
"siri" : siri,
|
||||
'komen' : komen,
|
||||
'namakhazanah' : namakhazanah
|
||||
'namakhazanah' : namakhazanah,
|
||||
'teller' : teller
|
||||
},
|
||||
success:function(data){
|
||||
Swal.fire({
|
||||
|
||||
@@ -63,4 +63,69 @@
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Modal HistoryBayaran -->
|
||||
<div class="modal fade" id="AGHModalEdit" tabindex="-1" role="dialog" aria-labelledby="ModalCenterTitle" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title text-center" id="ModalTitle">Surat Akuan Gadaian Hilang</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="container">
|
||||
<form name="frmagh" target="_blank" action="{{ route('agh.update') }}" onsubmit="return checkAGH();" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="norujukanhidden" id="norujukanhidden"/>
|
||||
<div class="col-12 row">
|
||||
<div class="col-5"><label class="mt-1">Jenis Alasan :</label></div>
|
||||
<div class="col-7">
|
||||
<select name="alasan" id="alasan" class="form-control">
|
||||
<option value="Simpanan">Simpanan</option>
|
||||
<option value="Bencana alam">Bencana alam</option>
|
||||
<option value="Kecurian">Kecurian</option>
|
||||
<option value="Di Ragut">Di Ragut</option>
|
||||
<option value="Kes Polis">Kes Polis</option>
|
||||
<option value="Hilang">Hilang</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 row mt-2">
|
||||
<div class="col-5"><label class="mt-1">Negeri :</label></div>
|
||||
<div class="col-7">
|
||||
<select name="negeriagh" id="negeriagh" class="form-control">
|
||||
@foreach($negeri as $neg)
|
||||
<option value="{{ $neg['kodnegeri'] }}">{{ $neg['negeri'] }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-12 row mt-2">
|
||||
<div class="col-5"><label class="mt-1">Daerah :</label></div>
|
||||
<div class="col-7">
|
||||
<select name="daerahagh" id="daerahagh" class="form-control" disabled>
|
||||
<option value="No Data">Sila Pilih Negeri *</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Batal</button>
|
||||
<button type="submit" class="btn btn-success">Hantar</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -314,7 +314,13 @@
|
||||
let cawangankod = $(e).data('kodcaw');
|
||||
let siri = $(e).data('siri');
|
||||
let namaoperasi = "{{ Auth::user()->name }}";
|
||||
let teller = $(e).closest('tr').children('td:eq(1)').text();
|
||||
|
||||
teller = String(teller);
|
||||
|
||||
console.log(teller);
|
||||
|
||||
return;
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url: "{{ route('operasi.updatekelulusan') }}",
|
||||
|
||||
@@ -2417,7 +2417,11 @@
|
||||
{
|
||||
let wakil = $('#wakiltxt').val();
|
||||
|
||||
if(wakil.length == 12)
|
||||
var patternregex = /\s+|[-,\/]/g;
|
||||
|
||||
wakil = wakil.replace(patternregex,"").toUpperCase();
|
||||
|
||||
if(wakil.length <= 12)
|
||||
{
|
||||
$.ajax({
|
||||
method:'GET',
|
||||
@@ -2465,7 +2469,7 @@
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
titleText: 'Kad Pengenalan',
|
||||
titleText: 'Kad Pengenalan dan Passport',
|
||||
text: 'mestilah tidak melebihi dan kurang daripada 12 patah perkataan'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -250,6 +250,7 @@ Route::get('/komoditi/rekod',['as'=>'rekod.komoditi','uses'=>'KomuditiController
|
||||
Route::get('/komoditi/rekod/print',['as'=>'komoditi.rekod.print','uses'=>'KomuditiController@printRekodTransaksi']);
|
||||
|
||||
Route::post('/khazanah/suratakuangadaian',['as'=>'agh.create','uses'=>'KhazanahController@SuratAkuanGadaian'])->middleware('auth','khazanah');
|
||||
Route::put('/khazanah/suratakuangadaian',['as'=>'agh.update','uses'=>'KhazanahController@SuratAkuanGadaianUpdate'])->middleware('auth','khazanah');
|
||||
Route::get('/khazanah/ulangcetakagh/{norujukan}',['as'=>'agh.ulangcetak','uses'=>'KhazanahController@ulangcetakSuratAkuanGadaianHilang'])->middleware('auth','khazanah');
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user