add error page
This commit is contained in:
@ -95,7 +95,7 @@ class Account extends Model
|
||||
->where('LIMIT_REF', null)
|
||||
->where('AC.BATCH_DATE', $startDate)
|
||||
->whereIn('AC.ACCOUNT_NUMBER', $arrAccount)
|
||||
->whereIn(DB::raw("LEFT(CATEGORY, 3)"),['100','101'])
|
||||
->whereIn(DB::raw("LEFT(CATEGORY, 3)"),['100','101','600'])
|
||||
// ->groupBy('CUSTOMER_NO', 'ACCOUNT_NUMBER', 'SHORT_TITLE', 'SHORT_NAME', 'COMPANY_NAME', 'CATEGORY', 'LIMIT_REF')
|
||||
->orderBy('CATEGORY', 'ASC')
|
||||
->limit(100);
|
||||
|
@ -34,6 +34,7 @@ use Modules\Konfirmasibank\Http\Requests\Fasilitas\StoreFasilitasRequest;
|
||||
use Akaunting\Money\Currency;
|
||||
use Akaunting\Money\Money;
|
||||
use Illuminate\Validation\Rule;
|
||||
use App\Exports\DataExport; // Sesuaikan dengan class export Anda
|
||||
|
||||
class KonfirmasiBankController extends Controller
|
||||
{
|
||||
@ -418,7 +419,6 @@ class KonfirmasiBankController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// try {
|
||||
foreach ($listAccount as $key1 => $account) {
|
||||
|
||||
@ -448,15 +448,8 @@ class KonfirmasiBankController extends Controller
|
||||
$DataDepo = [];
|
||||
try {
|
||||
$Deposito = $Account->getDepo($request['cusNo'], $arrAccount, $dateCoreDepo)->get();
|
||||
|
||||
} catch (\Illuminate\Database\QueryException $e) {
|
||||
$errorCode = $e->errorInfo[1];
|
||||
if ($errorCode == 1205) { // 1205 adalah kode error untuk Lock wait timeout exceeded; try restarting transaction
|
||||
// Lakukan sesuatu jika terjadi timeout
|
||||
return response()->json(['error' => 'Database timeout, please try again later'], 503);
|
||||
}
|
||||
// Handle error lainnya
|
||||
return response()->json(['error' => 'Database error'], 500);
|
||||
} catch (Exception $e) {
|
||||
return redirect()->route('konfirmasibank.timeout');
|
||||
}
|
||||
|
||||
foreach ($Deposito as $keyDep => $depo) {
|
||||
@ -478,13 +471,7 @@ class KonfirmasiBankController extends Controller
|
||||
$Arrangement = $Account->getPinjaman($request['cusNo'], $dateCoreAccount)->get();
|
||||
|
||||
} catch (\Illuminate\Database\QueryException $e) {
|
||||
$errorCode = $e->errorInfo[1];
|
||||
if ($errorCode == 1205) { // 1205 adalah kode error untuk Lock wait timeout exceeded; try restarting transaction
|
||||
// Lakukan sesuatu jika terjadi timeout
|
||||
return response()->json(['error' => 'Database timeout, please try again later'], 503);
|
||||
}
|
||||
// Handle error lainnya
|
||||
return response()->json(['error' => 'Database error'], 500);
|
||||
return redirect()->route('konfirmasibank.timeout');
|
||||
}
|
||||
|
||||
foreach ($Arrangement as $key2 => $pinjaman) {
|
||||
@ -507,21 +494,13 @@ class KonfirmasiBankController extends Controller
|
||||
$listAccountRK = $Account->getAccountRK($arrAccount, $dateCoreAccount)->get();
|
||||
|
||||
} catch (\Illuminate\Database\QueryException $e) {
|
||||
$errorCode = $e->errorInfo[1];
|
||||
if ($errorCode == 1205) { // 1205 adalah kode error untuk Lock wait timeout exceeded; try restarting transaction
|
||||
// Lakukan sesuatu jika terjadi timeout
|
||||
return response()->json(['error' => 'Database timeout, please try again later'], 503);
|
||||
}
|
||||
// Handle error lainnya
|
||||
return response()->json(['error' => 'Database error'], 500);
|
||||
return redirect()->route('konfirmasibank.timeout');
|
||||
}
|
||||
|
||||
|
||||
foreach ($listAccountRK as $rk => $valRk) {
|
||||
$DataRK[$rk]['ACCOUNT_NUMBER'] = $valRk->ACCOUNT_NUMBER;
|
||||
// $DataRK[$rk]['OPENING_DATE'] = $valRk->OPENING_DATE;
|
||||
$DataRK[$rk]['BATCH_DATE'] = $valRk->BATCH_DATE;
|
||||
// $DataRK[$rk]['CUSTOMER_NO'] = $valRk->CUSTOMER_NO;
|
||||
$DataRK[$rk]['SHORT_NAME'] = $valRk->PRODUCT_LOAN;
|
||||
$DataRK[$rk]['CURRENCY'] = $valRk->LOAN_CCY;
|
||||
$DataRK[$rk]['PRODUCT'] = $valRk->PRODUCT_LOAN;
|
||||
@ -534,17 +513,11 @@ class KonfirmasiBankController extends Controller
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
$fasilitas = Fasilitas::where('nomor_cif', $request['cusNo'])->where('status', 1)->get();
|
||||
|
||||
} catch (\Illuminate\Database\QueryException $e) {
|
||||
$errorCode = $e->errorInfo[1];
|
||||
if ($errorCode == 1205) { // 1205 adalah kode error untuk Lock wait timeout exceeded; try restarting transaction
|
||||
// Lakukan sesuatu jika terjadi timeout
|
||||
return response()->json(['error' => 'Database timeout, please try again later'], 503);
|
||||
}
|
||||
// Handle error lainnya
|
||||
return response()->json(['error' => 'Database error'], 500);
|
||||
return redirect()->route('konfirmasibank.timeout');
|
||||
}
|
||||
|
||||
foreach ($fasilitas as $key3 => $val3) {
|
||||
@ -564,13 +537,7 @@ class KonfirmasiBankController extends Controller
|
||||
$ListAnjak = $Account->getAccountAnjak($rekEscrow, $dateCoreAccount)->get();
|
||||
|
||||
} catch (\Illuminate\Database\QueryException $e) {
|
||||
$errorCode = $e->errorInfo[1];
|
||||
if ($errorCode == 1205) { // 1205 adalah kode error untuk Lock wait timeout exceeded; try restarting transaction
|
||||
// Lakukan sesuatu jika terjadi timeout
|
||||
return response()->json(['error' => 'Database timeout, please try again later'], 503);
|
||||
}
|
||||
// Handle error lainnya
|
||||
return response()->json(['error' => 'Database error'], 500);
|
||||
return redirect()->route('konfirmasibank.timeout');
|
||||
}
|
||||
$totalOutstanding = $ListAnjak->sum('OUTSTANDING') != null ? number_format(abs($ListAnjak->sum('OUTSTANDING')), 2, ',', '.') : 'NIHIL';
|
||||
|
||||
@ -883,5 +850,9 @@ class KonfirmasiBankController extends Controller
|
||||
|
||||
}
|
||||
|
||||
public function timeout(){
|
||||
return view('konfirmasibank::errors.404');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
89
Resources/views/errors/404.blade.php
Normal file
89
Resources/views/errors/404.blade.php
Normal file
@ -0,0 +1,89 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Author: Keenthemes
|
||||
Product Name: Metronic | Bootstrap HTML, VueJS, React, Angular, Asp.Net Core, Blazor, Django, Flask & Laravel Admin Dashboard Theme
|
||||
Purchase: https://1.envato.market/EA4JP
|
||||
Website: http://www.keenthemes.com
|
||||
Contact: support@keenthemes.com
|
||||
Follow: www.twitter.com/keenthemes
|
||||
Dribbble: www.dribbble.com/keenthemes
|
||||
Like: www.facebook.com/keenthemes
|
||||
License: For each use you must have a valid license purchased only from above link in order to legally use the theme for your project.
|
||||
-->
|
||||
<html lang="en">
|
||||
<!--begin::Head-->
|
||||
<head><base href="../../"/>
|
||||
<title>Metronic - the world's #1 selling Bootstrap Admin Theme Ecosystem for HTML, Vue, React, Angular & Laravel by Keenthemes</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="description" content="The most advanced Bootstrap Admin Theme on Themeforest trusted by 100,000 beginners and professionals. Multi-demo, Dark Mode, RTL support and complete React, Angular, Vue, Asp.Net Core, Blazor, Django, Flask & Laravel versions. Grab your copy now and get life-time updates for free." />
|
||||
<meta name="keywords" content="metronic, bootstrap, bootstrap 5, angular, VueJs, React, Asp.Net Core, Blazor, Django, Flask & Laravel starter kits, admin themes, web design, figma, web development, free templates, free admin themes, bootstrap theme, bootstrap template, bootstrap dashboard, bootstrap dak mode, bootstrap button, bootstrap datepicker, bootstrap timepicker, fullcalendar, datatables, flaticon" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:title" content="Metronic | Bootstrap HTML, VueJS, React, Angular, Asp.Net Core, Blazor, Django, Flask & Laravel Admin Dashboard Theme" />
|
||||
<meta property="og:url" content="https://keenthemes.com/metronic" />
|
||||
<meta property="og:site_name" content="Keenthemes | Metronic" />
|
||||
<link rel="canonical" href="https://preview.keenthemes.com/metronic8" />
|
||||
<link rel="shortcut icon" href="assets/media/logos/favicon.ico" />
|
||||
<!--begin::Fonts-->
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700" />
|
||||
<!--end::Fonts-->
|
||||
<!--begin::Global Stylesheets Bundle(used by all pages)-->
|
||||
<link href="assets/plugins/global/plugins.bundle.css" rel="stylesheet" type="text/css" />
|
||||
<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
|
||||
<!--end::Global Stylesheets Bundle-->
|
||||
</head>
|
||||
<!--end::Head-->
|
||||
<!--begin::Body-->
|
||||
<body id="kt_body" class="app-blank app-blank bgi-size-cover bgi-position-center bgi-no-repeat">
|
||||
<!--begin::Theme mode setup on page load-->
|
||||
<script>var defaultThemeMode = "light"; var themeMode; if ( document.documentElement ) { if ( document.documentElement.hasAttribute("data-theme-mode")) { themeMode = document.documentElement.getAttribute("data-theme-mode"); } else { if ( localStorage.getItem("data-theme") !== null ) { themeMode = localStorage.getItem("data-theme"); } else { themeMode = defaultThemeMode; } } if (themeMode === "system") { themeMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; } document.documentElement.setAttribute("data-theme", themeMode); }</script>
|
||||
<!--end::Theme mode setup on page load-->
|
||||
<!--begin::Root-->
|
||||
<div class="d-flex flex-column flex-root" id="kt_app_root">
|
||||
<!--begin::Page bg image-->
|
||||
<style>body { background-image: url('assets/media/auth/bg7.jpg'); } [data-theme="dark"] body { background-image: url('assets/media/auth/bg7-dark.jpg'); }</style>
|
||||
<!--end::Page bg image-->
|
||||
<!--begin::Authentication - Signup Welcome Message -->
|
||||
<div class="d-flex flex-column flex-center flex-column-fluid">
|
||||
<!--begin::Content-->
|
||||
<div class="d-flex flex-column flex-center text-center p-10">
|
||||
<!--begin::Wrapper-->
|
||||
<div class="card card-flush w-lg-650px py-5">
|
||||
<div class="card-body py-15 py-lg-20">
|
||||
<!--begin::Title-->
|
||||
<h1 class="fw-bolder fs-2qx text-gray-900 mb-4">System Error</h1>
|
||||
<!--end::Title-->
|
||||
<!--begin::Text-->
|
||||
<div class="fw-semibold fs-6 text-gray-500 mb-7">Terjadi kesalahan ! Coba beberapa saat lagi.</div>
|
||||
<!--end::Text-->
|
||||
<!--begin::Illustration-->
|
||||
<div class="mb-11">
|
||||
<img src="assets/media/auth/500-error.png" class="mw-100 mh-300px theme-light-show" alt="" />
|
||||
<img src="assets/media/auth/500-error-dark.png" class="mw-100 mh-300px theme-dark-show" alt="" />
|
||||
</div>
|
||||
<!--end::Illustration-->
|
||||
<!--begin::Link-->
|
||||
<div class="mb-0">
|
||||
<a href="{{ route('konfirmasibank.index') }}" class="btn btn-sm btn-primary">Kembali Ke Halaman Utama</a>
|
||||
</div>
|
||||
<!--end::Link-->
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Wrapper-->
|
||||
</div>
|
||||
<!--end::Content-->
|
||||
</div>
|
||||
<!--end::Authentication - Signup Welcome Message-->
|
||||
</div>
|
||||
<!--end::Root-->
|
||||
<!--begin::Javascript-->
|
||||
<script>var hostUrl = "assets/";</script>
|
||||
<!--begin::Global Javascript Bundle(used by all pages)-->
|
||||
<script src="assets/plugins/global/plugins.bundle.js"></script>
|
||||
<script src="assets/js/scripts.bundle.js"></script>
|
||||
<!--end::Global Javascript Bundle-->
|
||||
<!--end::Javascript-->
|
||||
</body>
|
||||
<!--end::Body-->
|
||||
</html>
|
@ -38,5 +38,7 @@ Route::group(['middleware' => ['auth', 'verified']], function () {
|
||||
Route::post('konfirmasibank/editSigner','KonfirmasiBankController@editSigner')->name('konfirmasibank.editSigner');
|
||||
Route::post('konfirmasibank/updateSigner','KonfirmasiBankController@updateSigner')->name('konfirmasibank.updateSigner');
|
||||
Route::post('konfirmasibank/destroySigner','KonfirmasiBankController@destroySigner')->name('konfirmasibank.destroySigner');
|
||||
Route::get('konfirmasibank/timeout', 'KonfirmasiBankController@timeout')->name('konfirmasibank.timeout');
|
||||
Route::post('konfirmasibank/error','KonfirmasiBankController@error')->name('konfirmasibank.error');
|
||||
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user