fix polis

This commit is contained in:
fifi97
2021-07-15 04:38:12 +08:00
parent 68b2cd63cc
commit f7b26a0c47
11 changed files with 81 additions and 29 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ class OperasiNotice implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $cawangan,$namateller;
public $cawangan,$namakhazanah;
public function __construct($cawangan,$namakhazanah)
{
+3 -3
View File
@@ -573,7 +573,7 @@ class KhazanahController extends Controller
if($updatelulus)
{
event(new NotifikasiUbahHapus($norujukan,"batal",$request->komenubahhapus,$getlulus['teller']));
event(new NotifikasiUbahHapus($norujukan,"batal",$request->komenubahhapus,$request->teller));
}
}else{
@@ -583,7 +583,7 @@ class KhazanahController extends Controller
if($updatelulus)
{
event(new NotifikasiUbahHapus($norujukan,"lulus","tiada",$getlulus['teller']));
event(new NotifikasiUbahHapus($norujukan,"lulus","tiada",$request->teller));
}
}
}
@@ -2916,7 +2916,7 @@ class KhazanahController extends Controller
// return redirect()->route('khazanah.customer_info')->with('aghinformation','Mengalami masalah dalam menjana.|error');
}
return response($daftarpolis);
return response($daftar);
}
public function ulangcetakSuratAkuanGadaianHilang($norujukan)
+10 -5
View File
@@ -561,7 +561,7 @@
channel.bind('my-kelulusan', function(data) {
if(data.norujukan == norujukan && data.siri == siricreated)
if(data.norujukan == norujukan && data.siri == siricreated && data.teller == teller)
{
if(data.kelulusan == 'lulus')
{
@@ -1203,10 +1203,12 @@
encrypted: true
});
let teller = "{{ Auth::user()->name }}";
var channel = pusher.subscribe('notice-ubahhapus');
channel.bind('my-ubahhapus', function(data) {
if(data.norujukan == norujukan)
if(data.norujukan == norujukan && data.teller == teller)
{
if(data.kelulusan == 'lulus')
{
@@ -1416,10 +1418,12 @@
encrypted: true
});
let teller = "{{ Auth::user()->name }}";
var channel = pusher.subscribe('notice-ubahhapus');
channel.bind('my-ubahhapus', function(data) {
if(data.norujukan == ubahid)
if(data.norujukan == ubahid && data.teller == teller)
{
if(data.kelulusan == 'lulus')
{
@@ -1565,6 +1569,8 @@
}
});
let teller = "{{ Auth::user()->name }}";
var pusher = new Pusher("{{ env('PUSHER_APP_KEY') }}", {
cluster: 'ap1',
encrypted: true
@@ -1573,7 +1579,7 @@
var channel = pusher.subscribe('notice-ubahhapus');
channel.bind('my-ubahhapus', function(data) {
if(data.norujukan == id)
if(data.norujukan == id && data.teller == teller)
{
if(data.kelulusan == 'lulus')
{
@@ -1583,7 +1589,6 @@
title: 'Telah Disahkan'
}).then(function(){
let teller = "{{ Auth::user()->name }}";
if($("input[name='options']:checked").val() == 'belum_tebus'){
$.ajax({
+2 -2
View File
@@ -939,7 +939,7 @@
channel.bind('my-kelulusan', function(data) {
if(data.norujukan == norujukan && data.siri == siricreated)
if(data.norujukan == norujukan && data.siri == siricreated && data.teller == teller)
{
if(data.kelulusan == 'lulus')
{
@@ -1046,7 +1046,7 @@
// console.log(message);
if(data.norujukan == norujukan && data.siri == siricreated)
if(data.norujukan == norujukan && data.siri == siricreated && data.teller == teller)
{
if(data.kelulusan == 'lulus')
{
+30 -2
View File
@@ -556,7 +556,7 @@
function checkAGH()
{
$('AGHModalEdit').hide();
}
function checktuntutbaki(e)
@@ -691,6 +691,7 @@
function ulangcetakagh(e)
{
var komen2 = $(e).data('komen2');
var noruj = $(e).data('histid');
if(komen2 !== null)
{
@@ -711,6 +712,7 @@
}
}else{
$('#AGHModalEdit').modal('show');
$('#norujukanhiddenedit').val(noruj);
swal.close();
}
@@ -746,7 +748,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(this)" data-komen2="' + data[0].komen2 + '">' + 'Ulang Cetak' + '</button>',
'<button type="button" role="button" tabindex="0" class="btn btn-primary" data-histid="' + histid + '" onclick="ulangcetakagh(this)" data-komen2="' + data[0].komen2 + '">' + 'Ulang Cetak' + '</button>',
icon: 'error',
title: 'Surat Akuan Gadaian Hilang telah dikeluarkan!'
});
@@ -802,6 +804,24 @@
});
$('#negeriaghedit').change(function(){
var daerahselect = document.getElementById("daerahaghedit");
$('#daerahaghedit').attr('disabled', false);
$(daerahagh).empty();
$.ajax({
method:'get',
url: api_url + '/api/daerahkodnegeri/' + this.value,
success:function(data){
$.each(data, function( index, daerah ){
addOptionEdit(daerah.koddaerah,daerah.namadaerah);
});
}
});
});
function addOption(textopt,valueopt) {
optionText = textopt;
@@ -810,6 +830,14 @@
$('#daerahagh').append(`<option value='${optionText}'>${optionValue}</option>`);
}
function addOptionEdit(textopt,valueopt) {
optionText = textopt;
optionValue = valueopt;
$('#daerahaghedit').append(`<option value='${optionText}'>${optionValue}</option>`);
}
function rekodasal(gadaian){
+16 -3
View File
@@ -400,11 +400,14 @@
allowOutsideClick: false
})
let teller = $(e).closest('tr').children('td:eq(1)').text();
let norujukan = $(e).data('norujukan');
let pelulus = $(e).data('pelulus');
let siri = $(e).data('siri');
let namakhazanah = "{{ Auth::user()->name }}";
teller = String(teller);
$.ajax({
method:'put',
url: "{{ route('khazanah.updatekelulusan') }}",
@@ -415,7 +418,8 @@
"siri" : siri,
"komenkelulusan" : komenkelulusan,
"pembatalan" : "batal",
'namakhazanah' : namakhazanah
'namakhazanah' : namakhazanah,
'teller' : teller
},
success:function(data){
@@ -476,15 +480,19 @@
let norujukan = $(e).data('norujukan');
let teller = $(e).closest('tr').children('td:eq(1)').text();
let namakhazanah = "{{ $auth_user = Auth::user()->name }}";
teller = String(teller);
$.ajax({
method:'put',
url: "{{ route('khazanah.updatekelulusan') }}",
data: {
"_token": "{{ csrf_token() }}",
"norujukan" : norujukan,
"khazanah" : namakhazanah
"khazanah" : namakhazanah,
'teller' : teller
},
success:function(data){
@@ -552,6 +560,9 @@
let norujukan = $(e).data('norujukan');
let namakhazanah = "{{ $auth_user = Auth::user()->name }}";
let teller = $(e).closest('tr').children('td:eq(1)').text();
teller = String(teller);
$.ajax({
method:'put',
@@ -561,7 +572,9 @@
"norujukan" : norujukan,
"khazanah" : namakhazanah,
"komenubahhapus" : komenkelulusan,
"batal" : 'batal'
"batal" : 'batal',
'teller' : teller
},
success:function(data){
+3 -1
View File
@@ -307,11 +307,13 @@
encrypted: true
});
let teller = "{{ Auth::user()->name }}";
var channel = pusher.subscribe('notice-ubahhapus');
channel.bind('my-ubahhapus', function(data) {
if(data.norujukan == norujukan)
if(data.norujukan == norujukan && data.teller == teller)
{
if(data.kelulusan == 'lulus')
{
+4 -4
View File
@@ -78,11 +78,11 @@
<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"/>
<input type="hidden" name="norujukanhidden" id="norujukanhiddenedit"/>
<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">
<select name="alasan" id="alasanedit" class="form-control">
<option value="Simpanan">Simpanan</option>
<option value="Bencana alam">Bencana alam</option>
<option value="Kecurian">Kecurian</option>
@@ -96,7 +96,7 @@
<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">
<select name="negeriagh" id="negeriaghedit" class="form-control">
@foreach($negeri as $neg)
<option value="{{ $neg['kodnegeri'] }}">{{ $neg['negeri'] }}</option>
@endforeach
@@ -108,7 +108,7 @@
<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>
<select name="daerahagh" id="daerahaghedit" class="form-control" disabled>
<option value="No Data">Sila Pilih Negeri *</option>
</select>
</div>
+5 -1
View File
@@ -400,6 +400,9 @@
let siri = $(e).data('siri');
let cawangankod = $(e).data('kodcaw');
let namaoperasi = "{{ Auth::user()->name }}";
let teller = $(e).closest('tr').children('td:eq(1)').text();
teller = String(teller);
$.ajax({
method:'put',
@@ -411,7 +414,8 @@
"kodcaw" : cawangankod,
"komenkelulusan" : komenkelulusan,
"pembatalan" : "batal",
'namaoperasi' : namaoperasi
'namaoperasi' : namaoperasi,
'teller' : teller
},
success:function(data){
Swal.fire({
+6 -6
View File
@@ -1284,7 +1284,7 @@
channel.bind('my-kelulusan', function(data) {
console.log(data);
if(data.norujukan == norujukan && data.siri == siricreated)
if(data.norujukan == norujukan && data.siri == siricreated && data.teller == teller)
{
if(data.kelulusan == 'lulus')
{
@@ -1412,7 +1412,7 @@
channel.bind('my-kelulusan', function(data) {
if(data.norujukan == norujukan && data.siri == siricreated)
if(data.norujukan == norujukan && data.siri == siricreated && data.teller == teller)
{
if(data.kelulusan == 'lulus')
{
@@ -1558,7 +1558,7 @@
channel.bind('my-kelulusan', function(data) {
if(data.norujukan == norujukan && data.siri == siricreated)
if(data.norujukan == norujukan && data.siri == siricreated && data.teller == teller)
{
if(data.kelulusan == 'lulus')
{
@@ -1686,7 +1686,7 @@
channel.bind('my-kelulusan', function(data) {
if(data.norujukan == norujukan && data.siri == siricreated)
if(data.norujukan == norujukan && data.siri == siricreated && data.teller == teller)
{
if(data.kelulusan == 'lulus')
{
@@ -1902,7 +1902,7 @@
channel.bind('my-kelulusan', function(data) {
if(data.norujukan == norujukan && data.siri == siricreated)
if(data.norujukan == norujukan && data.siri == siricreated && data.teller == teller)
{
if(data.kelulusan == 'lulus')
{
@@ -2030,7 +2030,7 @@
channel.bind('my-kelulusan', function(data) {
if(data.norujukan == norujukan && data.siri == siricreated)
if(data.norujukan == norujukan && data.siri == siricreated && data.teller == teller)
{
if(data.kelulusan == 'lulus')
{
+1 -1
View File
@@ -250,7 +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::post('/khazanah/suratakuangadaianedit',['as'=>'agh.update','uses'=>'KhazanahController@SuratAkuanGadaianUpdate'])->middleware('auth','khazanah');
Route::get('/khazanah/ulangcetakagh/{norujukan}',['as'=>'agh.ulangcetak','uses'=>'KhazanahController@ulangcetakSuratAkuanGadaianHilang'])->middleware('auth','khazanah');