fix kelulusan
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
|
||||
class OperasiNotice implements ShouldBroadcast
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
public $cawangan,$namateller;
|
||||
|
||||
public function __construct($cawangan,$namakhazanah)
|
||||
{
|
||||
$this->cawangan = $cawangan;
|
||||
$this->namakhazanah = $namakhazanah;
|
||||
}
|
||||
|
||||
public function broadcastOn()
|
||||
{
|
||||
return ['operasi-notify'];
|
||||
}
|
||||
|
||||
public function broadcastAs()
|
||||
{
|
||||
return 'operasi-event';
|
||||
}
|
||||
}
|
||||
@@ -11,11 +11,12 @@ class StatusLiked implements ShouldBroadcast
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
public $message;
|
||||
public $cawangan,$namateller;
|
||||
|
||||
public function __construct($message)
|
||||
public function __construct($cawangan,$namateller)
|
||||
{
|
||||
$this->message = $message;
|
||||
$this->cawangan = $cawangan;
|
||||
$this->namateller = $namateller;
|
||||
}
|
||||
|
||||
public function broadcastOn()
|
||||
|
||||
@@ -413,7 +413,7 @@ class GadaianController extends Controller
|
||||
$wakil = [];
|
||||
}
|
||||
|
||||
return view('print.resittebussebelum',compact('gadai','customers_info','penebusan','wakil','totaltransaction'));
|
||||
return view('print.resittebussebelum',compact('gadai','customers_info','penebusan','wakil'));
|
||||
}
|
||||
|
||||
public function history(Request $request)
|
||||
@@ -425,6 +425,7 @@ class GadaianController extends Controller
|
||||
if(sizeof($gadai) > 0)
|
||||
$history = $gadai[0][0]['historygadaian'];
|
||||
|
||||
|
||||
$count = 0;
|
||||
$arrayhist = [];
|
||||
|
||||
@@ -436,7 +437,7 @@ class GadaianController extends Controller
|
||||
"norujukan" => $history
|
||||
])->json();
|
||||
|
||||
array_push($arrayhist,["norujukan" => $history,"jenistebus" => $tebus[0]['jenistebus'],"jbg" => $tebus[0]['jbg'],"t_tebus" => $tebus[0]['t_tebus']]);
|
||||
array_push($arrayhist,["norujukan" => $history,"jenistebus" => ((isset($tebus[0])) ? $tebus[0]['jenistebus'] : 0),"jbg" => ((isset($tebus[0])) ? $tebus[0]['jbg'] : 0),"t_tebus" => ((isset($tebus[0])) ? $tebus[0]['t_tebus'] : 0)]);
|
||||
|
||||
if(sizeof($gadai) > 0)
|
||||
$history = $gadai[0][0]['historygadaian'];
|
||||
@@ -504,7 +505,7 @@ class GadaianController extends Controller
|
||||
'teller' => $auth_user['name']
|
||||
])->json();
|
||||
|
||||
event(new StatusLiked('Penghantaran kepada Khazanah!'));
|
||||
event(new StatusLiked($auth_user['cawangan'],$auth_user['name']));
|
||||
|
||||
return response()->json($createlulus,201);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
|
||||
//Events
|
||||
use App\Events\StatusLiked;
|
||||
use App\Events\NotifikasiPembayaran;
|
||||
use App\Events\OperasiNotice;
|
||||
|
||||
|
||||
use App\User;
|
||||
@@ -80,7 +81,7 @@ class KhazanahController extends Controller
|
||||
//Peti Besi Cawangan
|
||||
$getVault=Http::get( config('api.url').'/api/VaultController/'.$auth_user['cawangan'])->json();
|
||||
|
||||
$getVault = $getVault[0]['BakiAwal'];
|
||||
$getVault = $getVault[0]['bakiawal'];
|
||||
|
||||
//Marhun Terkumpul
|
||||
$marhun = Http::get(config('api.url'). '/api/marhunterkumpul/laporan/'. $auth_user['cawangan'] .'/'. $harini->toDateString())->json();
|
||||
@@ -274,6 +275,7 @@ class KhazanahController extends Controller
|
||||
$api_url = config('api.url');
|
||||
|
||||
$norujukan = $request->norujukan;
|
||||
$pelulus = $request->pelulus;
|
||||
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
@@ -286,7 +288,20 @@ class KhazanahController extends Controller
|
||||
}
|
||||
else
|
||||
{
|
||||
$updatelulus = Http::put(config('api.url') . '/api/UpdateKelulusan/' . $auth_user['cawangan'] . '/' . $norujukan)->json();
|
||||
if($pelulus == 'khazanah')
|
||||
{
|
||||
$updatelulus = Http::put(config('api.url') . '/api/UpdateKelulusan/' . $auth_user['cawangan'] . '/' . $norujukan,[
|
||||
"pengesahan" => "khazanah"
|
||||
])->json();
|
||||
}
|
||||
else
|
||||
{
|
||||
$updatelulus = Http::put(config('api.url') . '/api/UpdateKelulusan/' . $auth_user['cawangan'] . '/' . $norujukan,[
|
||||
"pengesahan" => "operasi"
|
||||
])->json();
|
||||
|
||||
event(new OperasiNotice($auth_user['cawangan'],$auth_user['name']));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -318,7 +333,7 @@ class KhazanahController extends Controller
|
||||
// 'teller' => $request->teller
|
||||
])->json();
|
||||
|
||||
event(new StatusLiked('Penghantaran kepada Khazanah!'));
|
||||
event(new StatusLiked($auth_user['cawangan'],$auth_user['name']));
|
||||
|
||||
return response()->json($createlulus,201);
|
||||
}
|
||||
@@ -466,12 +481,12 @@ class KhazanahController extends Controller
|
||||
$rekodb50 = $denominasilist[0]['bd50']; $rekodb100 = $denominasilist[0]['bd100'];
|
||||
|
||||
//wang Syilling Initialize
|
||||
$rekodsen1 = $denominasilist[0]['txtSen1']; $rekodsen5 = $denominasilist[0]['txtSen5']; $rekodsen10 = $denominasilist[0]['txtSen10'];
|
||||
$rekodsen20 = $denominasilist[0]['txtSen20']; $rekodsen50 = $denominasilist[0]['txtSen50'];
|
||||
$rekodsen1 = $denominasilist[0]['txtsen1']; $rekodsen5 = $denominasilist[0]['txtsen5']; $rekodsen10 = $denominasilist[0]['txtsen10'];
|
||||
$rekodsen20 = $denominasilist[0]['txtsen20']; $rekodsen50 = $denominasilist[0]['txtsen50'];
|
||||
|
||||
//Wang Ringgit Initialize
|
||||
$rekodring1 = $denominasilist[0]['txtRing1']; $rekodring5 = $denominasilist[0]['txtRing5']; $rekodring10 = $denominasilist[0]['txtRing10'];
|
||||
$rekodring20 = $denominasilist[0]['txtRing20']; $rekodring50 = $denominasilist[0]['txtRing50']; $rekodring100 = $denominasilist[0]['txtRing100'];
|
||||
$rekodring1 = $denominasilist[0]['txtring1']; $rekodring5 = $denominasilist[0]['txtring5']; $rekodring10 = $denominasilist[0]['txtring10'];
|
||||
$rekodring20 = $denominasilist[0]['txtring20']; $rekodring50 = $denominasilist[0]['txtring50']; $rekodring100 = $denominasilist[0]['txtring100'];
|
||||
|
||||
//Tolok Rekod
|
||||
$rekodb1 -= intval($request->ambilanb1);
|
||||
@@ -503,20 +518,20 @@ class KhazanahController extends Controller
|
||||
'bd20'=> $rekodb20,
|
||||
'bd50'=> $rekodb50,
|
||||
'bd100'=> $rekodb100,
|
||||
'txtRing1'=> $rekodring1,
|
||||
'txtRing5'=> $rekodring5,
|
||||
'txtSen1'=> $rekodsen1,
|
||||
'txtSen5'=> $rekodsen5,
|
||||
'txtSen10'=> $rekodsen10,
|
||||
'txtSen20'=> $rekodsen20,
|
||||
'txtSen50'=> $rekodsen50,
|
||||
'txtRing10'=> $rekodring10,
|
||||
'txtRing20'=> $rekodring20,
|
||||
'txtRing50'=> $rekodring50,
|
||||
'txtRing100'=> $rekodring100,
|
||||
'txtRing1000'=> "0",
|
||||
'txtring1'=> $rekodring1,
|
||||
'txtring5'=> $rekodring5,
|
||||
'txtsen1'=> $rekodsen1,
|
||||
'txtsen5'=> $rekodsen5,
|
||||
'txtsen10'=> $rekodsen10,
|
||||
'txtsen20'=> $rekodsen20,
|
||||
'txtsen50'=> $rekodsen50,
|
||||
'txtring10'=> $rekodring10,
|
||||
'txtring20'=> $rekodring20,
|
||||
'txtring50'=> $rekodring50,
|
||||
'txtring100'=> $rekodring100,
|
||||
'txtring1000'=> "0",
|
||||
'jumlahbundle'=> "0",
|
||||
'txtJumlah'=> "0",
|
||||
'txtjumlah'=> "0",
|
||||
'jumlahkeping' => "0"
|
||||
|
||||
]);
|
||||
@@ -579,20 +594,20 @@ class KhazanahController extends Controller
|
||||
'bd20'=> $rekodb20,
|
||||
'bd50'=> $rekodb50,
|
||||
'bd100'=> $rekodb100,
|
||||
'txtRing1'=> $rekodring1,
|
||||
'txtRing5'=> $rekodring5,
|
||||
'txtSen1'=> $rekodsen1,
|
||||
'txtSen5'=> $rekodsen5,
|
||||
'txtSen10'=> $rekodsen10,
|
||||
'txtSen20'=> $rekodsen20,
|
||||
'txtSen50'=> $rekodsen50,
|
||||
'txtRing10'=> $rekodring10,
|
||||
'txtRing20'=> $rekodring20,
|
||||
'txtRing50'=> $rekodring50,
|
||||
'txtRing100'=> $rekodring100,
|
||||
'txtRing1000'=> "0",
|
||||
'txtring1'=> $rekodring1,
|
||||
'txtring5'=> $rekodring5,
|
||||
'txtsen1'=> $rekodsen1,
|
||||
'txtsen5'=> $rekodsen5,
|
||||
'txtsen10'=> $rekodsen10,
|
||||
'txtsen20'=> $rekodsen20,
|
||||
'txtsen50'=> $rekodsen50,
|
||||
'txtring10'=> $rekodring10,
|
||||
'txtring20'=> $rekodring20,
|
||||
'txtring50'=> $rekodring50,
|
||||
'txtring100'=> $rekodring100,
|
||||
'txtring1000'=> "0",
|
||||
'jumlahbundle'=> "0",
|
||||
'txtJumlah'=> "0",
|
||||
'txtjumlah'=> "0",
|
||||
'jumlahkeping' => "0"
|
||||
|
||||
]);
|
||||
@@ -703,11 +718,11 @@ class KhazanahController extends Controller
|
||||
|
||||
|
||||
$latestVault=Http::get(config('api.url').'/api/VaultController/'.$auth_user['cawangan'])->json();
|
||||
$masukV=$latestVault[0]['Masuk'];
|
||||
$keluarV=$latestVault[0]['Keluar'];
|
||||
$masukV=$latestVault[0]['masuk'];
|
||||
$keluarV=$latestVault[0]['keluar'];
|
||||
$pendahuluanV=$latestVault[0]['pendahuluan'];
|
||||
$serahanV=$latestVault[0]['serahan'];
|
||||
$BakiAwalV=$latestVault[0]['BakiAwal'];
|
||||
$BakiAwalV=$latestVault[0]['bakiawal'];
|
||||
|
||||
// dd($latestVault);
|
||||
// return;
|
||||
|
||||
@@ -4,8 +4,8 @@ namespace App\Http\Controllers;
|
||||
|
||||
|
||||
//Events
|
||||
use App\Events\OperasiNotice;
|
||||
use App\Events\StatusLiked;
|
||||
use App\Events\NotifikasiPembayaran;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -30,12 +30,6 @@ class OperasiController extends Controller
|
||||
{
|
||||
$kelulusan = $kelulusan[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return view('operasi.kelulusan',compact('cawangan_info','api_url','kelulusan'));
|
||||
}
|
||||
@@ -74,7 +68,9 @@ class OperasiController extends Controller
|
||||
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
$updatelulus = Http::put(config('api.url') . '/api/UpdateKelulusan/' . $request->kodcaw . '/' . $norujukan)->json();
|
||||
$updatelulus = Http::put(config('api.url') . '/api/UpdateKelulusan/' . $request->kodcaw . '/' . $norujukan,[
|
||||
'sahkan' => 1
|
||||
])->json();
|
||||
|
||||
return response()->json($updatelulus,200);
|
||||
}
|
||||
@@ -104,7 +100,7 @@ class OperasiController extends Controller
|
||||
// 'teller' => $request->teller
|
||||
])->json();
|
||||
|
||||
event(new StatusLiked('Penghantaran kepada Operasi!'));
|
||||
event(new StatusLiked($auth_user['cawangan'],$auth_user['name']));
|
||||
|
||||
return response()->json($createlulus,201);
|
||||
}
|
||||
|
||||
@@ -313,12 +313,12 @@
|
||||
<th>Bil</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Tarikh Gadai</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Tarikh Matang</th>
|
||||
<th>Nilai Marhun</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Margin</th>
|
||||
<th>Tempoh</th>
|
||||
<th>Keuntungan</th>
|
||||
<th>Tarikh Matang</th>
|
||||
<th>Margin</th>
|
||||
<th>Kos Keuntungan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -330,12 +330,12 @@
|
||||
<th>Bil</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Tarikh Gadai</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Tarikh Matang</th>
|
||||
<th>Nilai Marhun</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Margin</th>
|
||||
<th>Tempoh</th>
|
||||
<th>Keuntungan</th>
|
||||
<th>Tarikh Matang</th>
|
||||
<th>Margin</th>
|
||||
<th>Kos Keuntungan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -355,6 +355,8 @@
|
||||
<script>
|
||||
var api_url = "<?php echo $api_url ?>";
|
||||
|
||||
|
||||
|
||||
var tablegadai = $('#myTable').DataTable({
|
||||
"scrollX": true
|
||||
});
|
||||
@@ -571,6 +573,39 @@
|
||||
function ubahfunc(e)
|
||||
{
|
||||
let ubahid = $('input[name="belum"]:checked').val();
|
||||
let harini = new Date();harini.setHours(0, 0, 0, 0);
|
||||
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
let test1 = $('input[name="belum"]:checked').closest('tr').children('td:eq(2)').text();
|
||||
let tarikhgadai2 = new Date(test1);tarikhgadai2.setHours(0, 0, 0, 0);
|
||||
if(+harini !== +tarikhgadai2)
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Tidak boleh Ubah gadai melebihi tarikh yang sama!'
|
||||
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if($("input[name='options']:checked").val() == 'sudah_tebus')
|
||||
{
|
||||
let test = $('input[name="sudahtebus"]:checked').closest('tr').children('td:eq(2)').text();
|
||||
let tarikhgadai1 = new Date(test);tarikhgadai1.setHours(0, 0, 0, 0);
|
||||
|
||||
if(+harini !== +tarikhgadai1)
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Tidak boleh Ubah gadai melebihi tarikh yang sama!'
|
||||
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(ubahid == null && $("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
@@ -593,6 +628,9 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const swalWithBootstrapButtons = Swal.mixin
|
||||
({
|
||||
@@ -707,6 +745,40 @@
|
||||
let hapusid = $('input[name="belum"]:checked').val();
|
||||
let hapusidsudah = $('input[name="sudahtebus"]:checked').val();
|
||||
|
||||
let harini = new Date();harini.setHours(0, 0, 0, 0);
|
||||
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
let test1 = $('input[name="belum"]:checked').closest('tr').children('td:eq(2)').text();
|
||||
let tarikhgadai2 = new Date(test1);tarikhgadai2.setHours(0, 0, 0, 0);
|
||||
if(+harini !== +tarikhgadai2)
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Tidak boleh Hapus gadai melebihi tarikh yang sama!'
|
||||
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if($("input[name='options']:checked").val() == 'sudah_tebus')
|
||||
{
|
||||
let test = $('input[name="sudahtebus"]:checked').closest('tr').children('td:eq(2)').text();
|
||||
let tarikhgadai1 = new Date(test);tarikhgadai1.setHours(0, 0, 0, 0);
|
||||
|
||||
if(+harini !== +tarikhgadai1)
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Tidak boleh Hapus gadai melebihi tarikh yang sama!'
|
||||
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(hapusid == null && $("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
@@ -746,154 +818,155 @@
|
||||
cancelButtonText: 'Batal',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
Swal.fire({
|
||||
title: 'Tunggu Pengesahan Daripada Khazanah.',
|
||||
icon: 'info',
|
||||
width: 600,
|
||||
padding: '3em',
|
||||
background: '#fffff',
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false
|
||||
})
|
||||
Swal.fire({
|
||||
title: 'Tunggu Pengesahan Daripada Khazanah.',
|
||||
icon: 'info',
|
||||
width: 600,
|
||||
padding: '3em',
|
||||
background: '#fffff',
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false
|
||||
})
|
||||
|
||||
let mohon = "Hapus Gadai";
|
||||
let id = 0;
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
id = hapusid;
|
||||
}
|
||||
else if($("input[name='options']:checked").val() == 'sudah_tebus')
|
||||
{
|
||||
id = hapusidsudah;
|
||||
}
|
||||
let mohon = "Hapus Gadai";
|
||||
let id = 0;
|
||||
|
||||
$.ajax({
|
||||
method:'post',
|
||||
url: '{{ route("teller.createkelulusan") }}',
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"norujukan" : id,
|
||||
"mohon" : mohon
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
console.log(data);
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
//TIME INTERVAL
|
||||
let timerInterval;
|
||||
|
||||
timerInterval = setInterval(function()
|
||||
{
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: "{{ route('teller.getkelulusan') }}",
|
||||
data: {
|
||||
"norujukan" : id
|
||||
},
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
if(data != 0)
|
||||
{
|
||||
console.log('berjaya');
|
||||
clearInterval(timerInterval);
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Anda Berjaya Menerima Pengesahan'
|
||||
}).then(function(){
|
||||
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url:api_url + '/api/gadai/hapus/' + kodcaw + '/' + hapusid,
|
||||
success:function(data)
|
||||
{
|
||||
console.log(data);
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Hapus!',
|
||||
'Data pelanggan telah dihapuskan.',
|
||||
'success'
|
||||
).then(function () {
|
||||
location.reload();
|
||||
});
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
else if($("input[name='options']:checked").val() == 'sudah_tebus')
|
||||
{
|
||||
|
||||
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url:api_url+'/api/tebus/hapus/' + kodcaw + '/' + hapusidsudah,
|
||||
success:function(data)
|
||||
{
|
||||
if(data != "Bukan-Tebus")
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Hapus!',
|
||||
'Data pelanggan telah dihapuskan.',
|
||||
'success'
|
||||
).then(function () {
|
||||
location.reload();
|
||||
id = hapusid;
|
||||
}
|
||||
else if($("input[name='options']:checked").val() == 'sudah_tebus')
|
||||
{
|
||||
id = hapusidsudah;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
method:'post',
|
||||
url: '{{ route("teller.createkelulusan") }}',
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"norujukan" : id,
|
||||
"mohon" : mohon
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
console.log(data);
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
//TIME INTERVAL
|
||||
let timerInterval;
|
||||
|
||||
timerInterval = setInterval(function()
|
||||
{
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: "{{ route('teller.getkelulusan') }}",
|
||||
data: {
|
||||
"norujukan" : id
|
||||
},
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
if(data != 0)
|
||||
{
|
||||
console.log('berjaya');
|
||||
clearInterval(timerInterval);
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Anda Berjaya Menerima Pengesahan'
|
||||
}).then(function(){
|
||||
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus')
|
||||
{
|
||||
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url: api_url + '/api/gadai/hapus/' + kodcaw + '/' + hapusid,
|
||||
success:function(data)
|
||||
{
|
||||
console.log(data);
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Hapus!',
|
||||
'Data pelanggan telah dihapuskan.',
|
||||
'success'
|
||||
).then(function () {
|
||||
location.reload();
|
||||
});
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
else if($("input[name='options']:checked").val() == 'sudah_tebus')
|
||||
{
|
||||
|
||||
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url:api_url + '/api/tebus/hapus/' + kodcaw + '/' + hapusidsudah,
|
||||
success:function(data)
|
||||
{
|
||||
if(data != "Bukan-Tebus")
|
||||
{
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Hapus!',
|
||||
'Data pelanggan telah dihapuskan.',
|
||||
'success'
|
||||
).then(function () {
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Amaran!',
|
||||
'Hapus Hanya Untuk Jenis Tebus Sahaja!',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
console.log(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}, 3000);
|
||||
|
||||
|
||||
}else if (result.dismiss === Swal.DismissReason.cancel) {
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Amaran!',
|
||||
'Hapus Hanya Untuk Jenis Tebus Sahaja!',
|
||||
'Cancelled',
|
||||
'Your imaginary file is safe :)',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
}, 3000);
|
||||
|
||||
|
||||
}else if (result.dismiss === Swal.DismissReason.cancel) {
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Cancelled',
|
||||
'Your imaginary file is safe :)',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function gadaiOptionButton(noic){
|
||||
|
||||
@@ -39,7 +39,9 @@
|
||||
<td>{{ $cawangan_info['details_caw'] }}</td>
|
||||
<td>{{ $k['norujukan'] }}</td>
|
||||
<td>{{ $k['komen'] }}</td>
|
||||
<td><button class="btn btn-primary mr-2" onclick="updatelulus(this)" data-norujukan="{{ $k['norujukan'] }}"><i class="fas fa-thumbs-up"></i></button><button class="btn btn-danger"><i class="fas fa-thumbs-down"></i></button></td>
|
||||
<td>{{ $k['pelulus'] }}</td>
|
||||
<td><button class="btn btn-primary mr-2" data-pelulus="{{ $k['pelulus'] }}" onclick="updatelulus(this)" data-norujukan="{{ $k['norujukan'] }}"><i class="fas fa-thumbs-up"></i></button>
|
||||
<button class="btn btn-danger"><i class="fas fa-thumbs-down"></i></button></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@foreach($kelulusanmohonid as $index=>$km)
|
||||
@@ -78,13 +80,16 @@
|
||||
function updatelulus(e)
|
||||
{
|
||||
let norujukan = $(e).data('norujukan');
|
||||
let pelulus = $(e).data('pelulus');
|
||||
|
||||
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url: "{{ route('khazanah.updatekelulusan') }}",
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"norujukan" : norujukan
|
||||
"norujukan" : norujukan,
|
||||
"pelulus" : pelulus
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
|
||||
@@ -122,12 +122,18 @@
|
||||
encrypted: true
|
||||
});
|
||||
|
||||
var cawangankhazanah = '{{ $auth_user["cawangan"] }}';
|
||||
|
||||
var channel = pusher.subscribe('status-liked');
|
||||
channel.bind('my-event', function(data) {
|
||||
let message = JSON.stringify(data);
|
||||
// let message = JSON.stringify(data);
|
||||
|
||||
|
||||
if(cawangankhazanah == data.cawangan)
|
||||
{
|
||||
|
||||
$('#bell').css("color", "red");
|
||||
$('#linkz').text("Teller Pohon Kelulusan");
|
||||
$('#linkz').text(data.namateller + " Memohon Kelulusan");
|
||||
$("#linkz").attr("href", "{{ url('kelulusan') }}");
|
||||
|
||||
const Toast = Swal.mixin({
|
||||
@@ -146,6 +152,8 @@
|
||||
icon: 'error',
|
||||
title: 'Kelulusan Dipohon Sekarang!'
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -223,12 +223,12 @@
|
||||
encrypted: true
|
||||
});
|
||||
|
||||
var channel = pusher.subscribe('status-liked');
|
||||
channel.bind('my-event', function(data) {
|
||||
var channel = pusher.subscribe('operasi-notify');
|
||||
channel.bind('operasi-event', function(data) {
|
||||
let message = JSON.stringify(data);
|
||||
|
||||
$('#bell').css("color", "red");
|
||||
$('#linkz').text("Teller Pohon Kelulusan");
|
||||
$('#linkz').text(data.namateller + " Pohon Kelulusan");
|
||||
$("#linkz").attr("href", "{{ url('kelulusan') }}");
|
||||
|
||||
const Toast = Swal.mixin({
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
Try publishing an event to channel <code>my-channel</code>
|
||||
with event name <code>my-event</code>.
|
||||
</p>
|
||||
<button onclick="trigtest()">Click</button>
|
||||
<button>Click</button>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -121,10 +121,12 @@
|
||||
|
||||
var channel = pusher.subscribe('status-liked');
|
||||
channel.bind('my-event', function(data) {
|
||||
let message = JSON.stringify(data);
|
||||
|
||||
console.log(data);
|
||||
console.log(message);
|
||||
console.log(data);
|
||||
|
||||
if(data.message == 'KOK LANAS')
|
||||
console.log(data.message);
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ Route::get('/testtry',function(){
|
||||
|
||||
//Testing Jer
|
||||
Route::get('test', function () {
|
||||
event(new App\Events\StatusLiked('KOK LANAS'));
|
||||
return "Event has been sent!";
|
||||
event(new App\Events\StatusLiked('KOK LANAS','KOK KELI'));
|
||||
return "Event has been try je sent!";
|
||||
});
|
||||
|
||||
// Route::get('resitbiasa', function () {
|
||||
|
||||
Reference in New Issue
Block a user