diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index d3b81b3..c4f495f 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -20,6 +20,11 @@ use PDF; class KhazanahController extends Controller { + public function __construct() + { + $this->middleware('auth'); + } + public function index() { $search = false; diff --git a/app/Http/Controllers/KomuditiController.php b/app/Http/Controllers/KomuditiController.php index e4eecc4..7f52ab0 100644 --- a/app/Http/Controllers/KomuditiController.php +++ b/app/Http/Controllers/KomuditiController.php @@ -7,6 +7,11 @@ use Illuminate\Support\Facades\Auth; class KomuditiController extends Controller { + public function __construct() + { + $this->middleware('auth'); + } + public function index(){ $auth_user = Auth::user(); $api_url = config('api.url'); diff --git a/app/Http/Controllers/LelongController.php b/app/Http/Controllers/LelongController.php index 8a8dd52..0c962fb 100644 --- a/app/Http/Controllers/LelongController.php +++ b/app/Http/Controllers/LelongController.php @@ -8,6 +8,11 @@ use Illuminate\Support\Facades\Auth; class LelongController extends Controller { + public function __construct() + { + $this->middleware('auth'); + } + public function lelong(){ $api_url = config('api.url'); $auth_user = Auth::user(); diff --git a/public/js/main.js b/public/js/main.js index b632e87..7584c52 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -107,9 +107,8 @@ function totalkey(datakeyin) $('#' + idkey).val(0); Swal.fire({ icon: 'error', - title: 'Oops...', - text: 'Something went wrong!', - footer: 'Why do I have this issue?' + title: 'Amaran', + text: 'Jumlah Melebihi kadar', }); } else @@ -147,9 +146,8 @@ function kiraan(datakeyin) // $('#' + idkey).val(''); Swal.fire({ icon: 'error', - title: 'Oops...', - text: 'Something went wrong!', - footer: 'Why do I have this issue?' + title: 'Amaran', + text: 'Jumlah denominasi melebihi kadar' }); } else diff --git a/resources/views/customers/info.blade.php b/resources/views/customers/info.blade.php index 37e7e32..0415fdf 100644 --- a/resources/views/customers/info.blade.php +++ b/resources/views/customers/info.blade.php @@ -680,11 +680,11 @@ }); swalWithBootstrapButtons.fire({ - title: 'Dapatkan Pengesahan Daripada Khazanah?', - text: "Ubah Rekod Pelanggan!", + title: 'Dapatkan Pengesahan Khazanah', + text: "Ubah Maklumat Gadaian", icon: 'info', showCancelButton: true, - confirmButtonText: 'Setuju!', + confirmButtonText: 'Hantar', cancelButtonText: 'Batal', reverseButtons: true }).then((result) => { @@ -739,7 +739,7 @@ clearInterval(timerInterval); Swal.fire({ icon: 'success', - title: 'Anda Berjaya Menerima Pengesahan' + title: 'Telah Disahkan' }).then(function(){ var urlroute = '{{ route("gadaian.edit", ":id") }}'; @@ -760,8 +760,8 @@ }, 3000); }else if (result.dismiss === Swal.DismissReason.cancel){ swalWithBootstrapButtons.fire( - 'Cancelled', - 'Your imaginary file is safe :)', + 'Batal', + 'Tidak Berjaya Mendaptkan Pengesahan Khazanah', 'error' ) } @@ -825,11 +825,11 @@ }); swalWithBootstrapButtons.fire({ - title: 'Dapatkan Pengesahan Daripada Khazanah?', + title: 'Dapatkan Pengesahan Khazanah', text: "Hapus Rekod!", icon: 'info', showCancelButton: true, - confirmButtonText: 'Setuju!', + confirmButtonText: 'Hantar', cancelButtonText: 'Batal', reverseButtons: true }).then((result) => { @@ -889,7 +889,7 @@ clearInterval(timerInterval); Swal.fire({ icon: 'success', - title: 'Anda Berjaya Menerima Pengesahan' + title: 'Telah Disahkan' }).then(function(){ if($("input[name='options']:checked").val() == 'belum_tebus'){ $.ajax({ @@ -906,7 +906,7 @@ success:function(batalkomuditi){ swalWithBootstrapButtons.fire( 'Hapus!', - 'Data pelanggan telah dihapuskan.', + 'Maklumat gadaian telah dihapuskan.', 'success' ).then(function(){ location.reload(); @@ -927,7 +927,7 @@ if(data != "Bukan-Tebus"){ swalWithBootstrapButtons.fire( 'Hapus!', - 'Data pelanggan telah dihapuskan.', + 'Maklumat gadaian telah dihapuskan.', 'success' ).then(function () { location.reload(); @@ -1073,7 +1073,7 @@ Swal.fire({ icon: 'success', title: 'Berjaya', - text: 'Anda telah berjaya mengemaskini maklumat pelanggan' + text: 'Berjaya mengemaskini maklumat pelanggan' }) }, error: function (request, status, error) { @@ -1167,7 +1167,6 @@ } }, error: function(xhRequest, ErrorText, thrownError){ - // alert('Gadai Tidak Berjaya'); console.log(xhRequest); } }); diff --git a/resources/views/gadaian/edit.blade.php b/resources/views/gadaian/edit.blade.php index a39f1bc..880e002 100644 --- a/resources/views/gadaian/edit.blade.php +++ b/resources/views/gadaian/edit.blade.php @@ -746,12 +746,19 @@ buttonsStyling: false }) + if(pinjaman > Number(pembiyaan_max_pelulus)+10){ + var errortext = "Tetapan margin melebihi 75% untuk Operasi!"; + } + if(pinjaman >= 10000){ + var errortext = "Pinjaman Melebihi 10000"; + } + swalWithBootstrapButtons.fire({ title: 'Dapatkan Pengesahan Operasi', - text: "Tetapan margin melebihi 75% untuk Operasi!", + text: errortext, icon: 'info', showCancelButton: true, - confirmButtonText: 'Setuju!', + confirmButtonText: 'Hantar', cancelButtonText: 'Batal', reverseButtons: true }).then((result) => { @@ -854,7 +861,7 @@ text: "Tetapan margin melebihi 70% untuk Khazanah!", icon: 'info', showCancelButton: true, - confirmButtonText: 'Setuju!', + confirmButtonText: 'Hantar', cancelButtonText: 'Batal', reverseButtons: true }).then((result) => { @@ -944,13 +951,16 @@ event.preventDefault(); return false; } + else if(pinjaman < 10000){ + Swal.fire({ + icon: 'success', + title: 'Berjaya!', + text: 'Gadaian Berjaya Disimpan' + }); + return true; + } } - Swal.fire({ - icon: 'success', - title: 'Berjaya!', - text: 'Gadaian Berjaya Disimpan' - }); - return true; + } diff --git a/resources/views/gadaian/index.blade.php b/resources/views/gadaian/index.blade.php index dd4d48a..549414f 100644 --- a/resources/views/gadaian/index.blade.php +++ b/resources/views/gadaian/index.blade.php @@ -679,7 +679,7 @@ return false; } else{ - if(pinjaman > Number(pembiyaan_max_pelulus)+10 || pinjaman > 10000){ + if(pinjaman > Number(pembiyaan_max_pelulus)+10 || pinjaman >= 10000){ const swalWithBootstrapButtons = Swal.mixin({ customClass: { confirmButton: 'btn btn-success', @@ -691,7 +691,7 @@ if(pinjaman > Number(pembiyaan_max_pelulus)+10){ var errortext = "Tetapan margin melebihi 75% untuk Operasi!"; } - if(pinjaman > 10000){ + if(pinjaman >= 10000){ var errortext = "Pinjaman Melebihi 10000"; } @@ -888,14 +888,16 @@ event.preventDefault(); return false; } - Swal.fire({ - icon: 'success', - title: 'Berjaya!', - text: 'Gadaian Berjaya Disimpan' - }); - $(func).attr("onSubmit","return true;"); - $(func).submit(); - return true; + else if( pinjaman < 10000){ + Swal.fire({ + icon: 'success', + title: 'Berjaya!', + text: 'Gadaian Berjaya Disimpan' + }); + $(func).attr("onSubmit","return true;"); + $(func).submit(); + return true; + } } } } diff --git a/resources/views/homepage/penilai/home.blade.php b/resources/views/homepage/penilai/home.blade.php index 8552ae3..834a3be 100644 --- a/resources/views/homepage/penilai/home.blade.php +++ b/resources/views/homepage/penilai/home.blade.php @@ -242,6 +242,10 @@ minimumFractionDigits: 2 }); + $('#cetak_sag').on('click',function(){ + location.reload(); + }); + //modal $('#marhunModal').on('show.bs.modal', function(event) { var button = $(event.relatedTarget); // button yg trigger @@ -258,7 +262,7 @@ var bil_count = 0; $.each(arraymarhun,function(index,marhun){ $.each(marhun, function(index2,marhun_detail){ - bil_count++; + var marhun_name; $.ajax({ method:'GET', @@ -268,6 +272,8 @@ marhun:marhun_detail['marhun'] }, success:function(marhun_ajax){ + console.log(index2); + bil_count++; $("#tablemarhun").append("
Upah Hari Ini
+Keuntungan Hari Ini
Upah Terkumpul
+Keuntungan Terkumpul