diff --git a/app/CawanganAR.php b/app/CawanganAR.php new file mode 100644 index 0000000..7521d5e --- /dev/null +++ b/app/CawanganAR.php @@ -0,0 +1,18 @@ +cawangan = $cawangan; + $this->status = $status; + $this->bakipetibesi = $bakipetibesi; + } + + public function broadcastOn() + { + return ['notice-notify']; + } + + public function broadcastAs() + { + return 'trigger-notify'; + } +} \ No newline at end of file diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index 79ad591..891ce28 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -10,9 +10,11 @@ use App\Events\PendahuluanSerahan; use App\Events\NotifikasiKelulusan; use App\Events\NotifikasiUbahHapus; use App\Events\NotifikasiAGH; +use App\Events\NotifikasiPetiBesi; use App\User; use App\Cawangan; +use App\CawanganAR; use App\Lejeram; use Illuminate\Http\Request; @@ -3492,29 +3494,17 @@ class KhazanahController extends Controller $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); - //Peti Besi Cawangan - // $getVault=Http::withOptions(['verify' => config('app.api_verify')])->get( config('api.url').'/api/TunaiDiTangan/'.$auth_user['cawangan'])->json(); - $getVault = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/TunaiDiTangan/' . $auth_user['cawangan'],['tarikh' => $tarikhsemasa])->json(); - // if(sizeof($getVault) == 0) - // { - // $peti_besi_terkini=Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/daftarVault/'.$auth_user['cawangan'])->json(); - // $getVault = $peti_besi_terkini['bakiakhir']; - - // }else{ - // $getVault = $getVault[0]['bakiakhir']; - // } - - //Dashboardall $dashboard=Http::withOptions(['verify' => config('app.api_verify')])->get( config('api.url').'/api/Dashboard_all/'.$auth_user['cawangan'])->json(); $permohonan = Http::withOptions(['verify' => config('app.api_verify')])->get( config('api.url').'/admin/permohonan/get/'.$auth_user['cawangan'])->json(); + $bank = Http::withOptions(['verify' => config('app.api_verify')])->get( config('api.url').'/api/bank')->json(); - return view('khazanah.permohonanwang', compact('cawangan_info','api_url','getVault','tarikhsemasa','dashboard','permohonan')); + return view('khazanah.permohonanwang', compact('bank','cawangan_info','api_url','getVault','tarikhsemasa','dashboard','permohonan')); } public function RekodPermohonan() @@ -3574,16 +3564,23 @@ class KhazanahController extends Controller $auth_user = Auth::user(); $api_url = config('api.url'); - //Peti Besi Cawangan - $getVault=Http::withOptions(['verify' => config('app.api_verify')])->get( config('api.url').'/api/VaultController/'.$auth_user['cawangan'])->json(); + $current = Carbon::now(); + $tarikhsemasa = $current->toDateString(); + + $cawangan = CawanganAR::where('kodcaw','KB2')->get()->toArray(); + $getVault = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/TunaiDiTangan/' . 'KB2',['tarikh' => $tarikhsemasa])->json(); - if(sizeof($getVault) == 0) + if(floatval($getVault) > $cawangan[0]['max']) { - $peti_besi_terkini=Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/daftarVault/'.$auth_user['cawangan'])->json(); - $getVault = $peti_besi_terkini['bakiakhir']; + session(['status' => 'max']); + event(new NotifikasiPetiBesi('KB2','max',$getVault)); + }else if(floatval($getVault) < $cawangan[0]['min']) + { + session(['status' => 'min']); + event(new NotifikasiPetiBesi('KB2','min',$getVault)); }else{ - $getVault = $getVault[0]['bakiakhir']; + echo 'tiada'; } } diff --git a/resources/views/homepage/khazanah/home.blade.php b/resources/views/homepage/khazanah/home.blade.php index 485db0f..bcd415b 100644 --- a/resources/views/homepage/khazanah/home.blade.php +++ b/resources/views/homepage/khazanah/home.blade.php @@ -153,35 +153,8 @@ - -
-
- -
- Baki Maksimum - Baki peti besi melebihi RM 150,000.00 -
- -
-
-
- - {{--
-
- -
- Baki Minimum - Baki peti besi melebihi RM 150,000.00 -
- -
-
-
--}} - -
-
@@ -780,20 +753,5 @@ } - // function clickedbutton(){ - // const button = $('#show').val(); - // } - - $("#showbutton").click(function(){ - // alert("The paragraph was clicked."); - $(".notify-petibesi").addClass("active"); - }); - - $(".close").click(function(){ - // alert("The paragraph was clicked."); - $(".notify-petibesi").removeClass("active"); - }); - - @endsection diff --git a/resources/views/khazanah/permohonanwang.blade.php b/resources/views/khazanah/permohonanwang.blade.php index 58816d5..9ca9c6b 100644 --- a/resources/views/khazanah/permohonanwang.blade.php +++ b/resources/views/khazanah/permohonanwang.blade.php @@ -71,7 +71,11 @@ if($mohon['tagdeposit'] === 1) { echo ''; - }else{ + }else if(($mohon['tagcit'] === 0 && $mohon['jenismohon'] === 'bayaranbalik')) + { + echo ''; + } + else{ echo 'DALAM PROSES'; } @endphp @@ -184,5 +188,51 @@ }); }); + $(document).on('click', '#btncit', function(e) { + + let mid = $(this).data("mohonid"); + + var bank = @php echo json_encode($bank) @endphp; + var options = {}; + $.map(bank, + function(o) { + options[o.abbreviation] = o.name; + }); + + Swal.fire({ + title: 'BANK CIT', + text: 'Sila Pilih Bank', + input: 'select', + inputOptions: options, + showCancelButton: true, + animation: 'slide-from-top', + inputPlaceholder: 'Sila Pilih Bank', + allowOutsideClick: false + }).then(function (result) { + if (result) { + if (result.isConfirmed) { + + $.ajax({ + method:"put", + url: api_url + '/admin/permohonan/tagcit', + data: { + "mohonid" : mid, + "bank" : result.value + }, + success:function(data) + { + if(data === 1) + Swal.fire('Diterima!', '', 'success') + } + }); + + }else{ + + } + + } + }); + }); + @endsection diff --git a/resources/views/khazanah/status.blade.php b/resources/views/khazanah/status.blade.php index 50ae962..3ce88dd 100644 --- a/resources/views/khazanah/status.blade.php +++ b/resources/views/khazanah/status.blade.php @@ -166,102 +166,106 @@ -
- -
- -
    - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
- -
- -
- - - -
- -
- -
- -

Permohonan
Cawangan

- + @if($permohonan['jenismohon'] == 'permohonanwang') +
+
+
    +
  • +
  • +
  • +
  • +
  • +
  • +
+
+ @else +
+
+
    +
  • +
  • +
  • +
  • +
+
+
+ + @endif + + @if($permohonan['jenismohon'] == 'permohonanwang') + +
+
+
+

Permohonan
Cawangan

+
-
-

Pengesahan
Operasi

{!! ($permohonan['tagoperasi'] === 2) ? '' : '' !!} - - -
-
-
-

Akaun

{!! ($permohonan['tagakaun'] === 2) ? '' : '' !!} -
-
-
-

Kelulusan
Pengurus Besar

{!! ($permohonan['tagpb'] === 2) ? '' : '' !!} -
-
-
-

Akaun
Deposit Ke Bank
Selesai

{!! ($permohonan['tagdeposit'] === 2) ? '' : '' !!} -
-
-
-

Cawangan
Terima Wang

-
- +
+
+ @else +
+
+
+

Permohonan
Cawangan

+
+
+ +
+
+

CIT Selesai Deposit ke Bank

+
+
+
+

Pengesahan
Operasi

+
+
+ +
+
+

Akaun

+
+
+ @endif + @@ -294,6 +298,8 @@ break; case 7: echo $desc['description']; break; + case 8: echo $desc['description'] . '
' . 'JENIS BANK :' . $desc[0]['jenisbank']; + break; } diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index c82fe93..65954c5 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -74,101 +74,6 @@ flex-direction: column; align-items: flex-start !important; } - - .notify-petibesi.max{ - position: absolute; - bottom:50px; - right: 30px; - border-radius:12px; - background: #fff; - padding: 20px 35px 20px 25px; - box-shadow:0 5px 10px rgba(0,0,0,0.1); - border-left: 6px solid #e67e22; - z-index:1; - display:none; - -webkit-transition: opacity 600ms, visibility 600ms; - transition: opacity 600ms, visibility 600ms; - } - - .notify-petibesi.min{ - position: absolute; - bottom:50px; - right: 30px; - border-radius:12px; - background: #fff; - padding: 20px 35px 20px 25px; - box-shadow:0 5px 10px rgba(0,0,0,0.1); - border-left: 6px solid #e74c3c; - z-index:1; - display:none; - -webkit-transition: opacity 600ms, visibility 600ms; - transition: opacity 600ms, visibility 600ms; - } - - .notify-petibesi.active{ - display:block; - } - - .notify-petibesi .toast-content{ - display:flex; - align-items:center; - - } - - .toast-content .message{ - display:flex; - flex-direction: column; - margin: 0 20px; - } - - .toast-content.max .check{ - display:flex; - align-items:center; - justify-content:center; - height:35px; - width:35px; - background-color:#e67e22; - color:#fff; - font-size:20px; - border-radius:50%; - } - - .toast-content.min .check{ - display:flex; - align-items:center; - justify-content:center; - height:35px; - width:35px; - background-color:#e74c3c; - color:#fff; - font-size:20px; - border-radius:50%; - } - - .message .text{ - font-size:20px; - font-weight:400; - color:#666666; - } - - .message .text.text-1{ - font-weight:600; - color:#333; - } - - .notify-petibesi .close{ - position:absolute; - top:10px; - right:15px; - padding:5px; - cursor:pointer; - opacity:0.7; - } - - .notify-petibesi .close:hover{ - opacity:1; - } - @@ -282,6 +187,26 @@ }); + var channel2 = pusher.subscribe('notice-notify'); + channel2.bind('trigger-notify', function(data) { + if(cawangankhazanah == data.cawangan) + { + if(data.status == 'max') + { + $("#notify-maksimum").removeClass("d-none"); + $("#notify-maksimum").addClass("d-block"); + $("#value-maksimum").text('RM ' + data.bakipetibesi); + } + + if(data.status == 'min') + { + $("#notify-minimum").removeClass("d-none"); + $("#notify-minimum").addClass("d-block"); + $("#value-minimum").text('RM ' + data.bakipetibesi); + } + } + }); + $("#navbarDropdown").click(function(){ $('#bell').css("color", "grey"); @@ -407,12 +332,19 @@ - + {{-- {{ dd(session()->has('status')) }} --}} + +
@yield('content')
+ @yield('footer')