diff --git a/Entities/ViewAccount.php b/Entities/ViewAccount.php index 5764101..4dfe4b0 100644 --- a/Entities/ViewAccount.php +++ b/Entities/ViewAccount.php @@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Facades\DB; +use Carbon\Carbon; class ViewAccount extends Model @@ -35,6 +36,32 @@ class ViewAccount extends Model 'MATURITY_DATE'" ]; + public function getSearchAccount($cif , $kodecabang, $periode){ + // $store = DB::connection('oracle'); + $currentDate = Carbon::now(); + $formattedDate = $currentDate->format('Y'); + + $data = []; + + if ($cif != null && $kodecabang == null && $periode == null) { + $data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS") + ->where('CUSTOMER_NO',$cif) + ->where('BATCH_DATE','LIKE','%'.$formattedDate.'%'); + } elseif ($cif != null && $kodecabang != null && $periode == null) { + $data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS") + ->where('CUSTOMER_NO',$cif) + ->where('COMPANY_NAME', 'like', "%" .$kodecabang."%") + ->where('BATCH_DATE','LIKE','%'.$formattedDate.'%'); + }else { + $data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS") + ->where('CUSTOMER_NO',$cif) + ->where('COMPANY_NAME', 'like', "%" .$kodecabang."%") + ->where('BATCH_DATE','LIKE','%'.$periode.'%'); + } + + return $data; + } + public function getAccount($cus_no,$account,$kodecabang,$periode){ $data = []; $data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS")->select('*')->where('CUSTOMER_NO',$cus_no)->whereIn('ACCOUNT_NUMBER',$account)->get(); diff --git a/Http/Controllers/KonfirmasiBankController.php b/Http/Controllers/KonfirmasiBankController.php index 19dab91..1099b3f 100644 --- a/Http/Controllers/KonfirmasiBankController.php +++ b/Http/Controllers/KonfirmasiBankController.php @@ -29,14 +29,41 @@ /** * Display a listing of the resource. */ - public function index(ViewAccountDataTable $dataTable) + // public function index(ViewAccountDataTable $dataTable) + // { + + // if (is_null($this->user) || !$this->user->can('konfirmasibank.read')) { + // abort(403, 'Sorry !! You are Unauthorized to view any master data !'); + // } + + // return $dataTable->render('konfirmasibank::index'); + // } + + public function index(Request $request) { + // $keyword = $request->input('search'); - if (is_null($this->user) || !$this->user->can('konfirmasibank.read')) { - abort(403, 'Sorry !! You are Unauthorized to view any master data !'); - } + //$data = ViewAccount::take(10)->get(); + //dd($data); - return $dataTable->render('konfirmasibank::index'); + return view('konfirmasibank::pages.index'); + } + + public function getData(Request $request) + { + $data = []; + $Account = new ViewAccount; + + $Accounts = $Account->getSearchAccount($request->cif, $request->kodecabang,$request->periode)->get(); + foreach ($Accounts as $key => $account) { + $data[$key]['ACCOUNT_NUMBER'] = $account->ACCOUNT_NUMBER; + $data[$key]['COMPANY_NAME'] = $account->COMPANY_NAME; + $data[$key]['SHORT_TITLE'] = $account->SHORT_TITLE; + $data[$key]['WORKING_BALANCE'] = $account->WORKING_BALANCE; + $data[$key]['PRODUCT'] = $account->PRODUCT; + $data[$key]['CURRENCY'] = $account->CURRENCY; + } + return json_encode($data); } diff --git a/Resources/views/pages/exportPdf.blade.php b/Resources/views/pages/exportPdf.blade.php new file mode 100644 index 0000000..4980e3d --- /dev/null +++ b/Resources/views/pages/exportPdf.blade.php @@ -0,0 +1,160 @@ + + + + + Membuat Laporan PDF Dengan DOMPDF Laravel + + + + + + + +
+ + + + + + +
+ +

Nomor :

+

Tanggal :

+
+ + +

BANK ARTHA GRAHA INTERNATIONAL

+

Kawasan Niaga Terpadu Sudirman (SCBD) + Jl. Jendral Sudirman Kav. 52 – 53 , Jakarta Indonesia +

+

Phone :

+

Faxmail :

+

+ + +

Kepada Yth

+

Bp. ...

+

Sepatan, Kab. Tanggerang

+ +

Sesuai dengan surat saudara Nomor …. tanggal … dengan ini kami smpaikan data – data nasbah sesuai permintaan saudara sebagai berikut :

+ +

Nama Nasabah : {{$data[0]->NAME_1}}

+

Nomor Rekening : {{$data[0]->CUSTOMER_NO}}


+ +

SIMPAMAN NASABAH YANG BERSANGKUTAN PADA BANK

+

POSISI ....

+ + + + + + + + + + + + + + + + @php $i=1 @endphp + @foreach ($data as $val) + + + + + + + + + + + + @endforeach + +
NoRekeningCabangJenis RekeningMata UangSaldoJangka WaktuSuku BungTgl Jatuh Tempo
{{ $i++ }}{{ $val->ACCOUNT_NUMBER }}{{ $val->COMPANY_NAME }}{{ $val->SHORT_NAME }}{{ $val->CURRENCY }}

+ +

PINJAMAN YANG DI BERIKAN OLEH BANK KEPADA NASABAH

+

POSISI ....

+ + + + + + + + + + + + + + + + + + + + + +
NoJenis PinjamanCabangJenis RekeningMata UangSaldoJangka WaktuSuku BungTgl Jatuh Tempo
Tidak Ada Pinjaman
+ +

FASILITAS LAIN YANG DI TERIMA OLEH NASABAH

+

POSISI ....

+ + + + + + + + + + + + + + + + + + + +
NoJenis FasilitasCabangJenis RekeningMata UangSaldoJangka WaktuSuku BungTgl Jatuh Tempo
Tidak Ada Fasilitas

+ +
+ + + + + +
+

Nama Pejabat 1

+

Jabatan

+
+

Nama Pejabat 2

+

Jabatan

+
+
+
+ + + + diff --git a/Resources/views/pages/index.blade.php b/Resources/views/pages/index.blade.php new file mode 100644 index 0000000..448dab1 --- /dev/null +++ b/Resources/views/pages/index.blade.php @@ -0,0 +1,197 @@ + + @php + $route = explode('.', Route::currentRouteName()); + @endphp + + +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + +
+ @csrf + +
+ + + + +
+
+ +
+ +
+
+
+ + +
+
+
+
+
+
+
+ + +
+
+
+ @include('konfirmasibank::pages.table') +
+
+
+ +
+ +
+ + @push('customscript') + + @endpush +
diff --git a/Resources/views/pages/pagination_data.blade.php b/Resources/views/pages/pagination_data.blade.php new file mode 100644 index 0000000..13cb47b --- /dev/null +++ b/Resources/views/pages/pagination_data.blade.php @@ -0,0 +1,17 @@ +
+ + + + + + + @foreach($data as $row) + + + + + + @endforeach +
ACCOUNT NOBRANCHACCOUNT TYPE
{{ $row->account_number }}{{ $row->branch_name }}{{ $row->product_description }}
+ {!! $data->links() !!} +
diff --git a/Resources/views/pages/table.blade.php b/Resources/views/pages/table.blade.php new file mode 100644 index 0000000..1b503de --- /dev/null +++ b/Resources/views/pages/table.blade.php @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
NoRekeningCabangJenis RekeningSaldoProdukMata UangTanggal Jatuh TempoCheck List
Tidak Ada Data Yang Ditampilkan
diff --git a/Routes/web.php b/Routes/web.php index 4840858..d1cab1e 100644 --- a/Routes/web.php +++ b/Routes/web.php @@ -17,7 +17,14 @@ $module = file_get_contents(dirname(__FILE__, 2) . '/module.json'); $module = json_decode($module); Route::group(['middleware' => ['auth', 'verified']], function () { - Route::resource('konfirmasibank', KonfirmasiBankController::class); + //Route::resource('konfirmasibank', KonfirmasiBankController::class); // Route::post('konfirmasibank/getPdf', [KonfirmasiBankController::class, 'getPdf'])->name('getPdf'); - Route::Post('/export',[KonfirmasiBankController::class,'export'])->name('konfirmasibank.export'); + Route::get('/konfirmasibank', 'KonfirmasiBankController@index')->name('konfirmasibank.index'); + //Route::get('/list', [CustomerController::class, 'list'])->name('customer.list'); + Route::get('getData',array('as'=>'getData','uses'=>'KonfirmasiBankController@getData')); + //Route::post('getPdf/',array('as'=>'getPdf','uses'=>'CustomerController@getPdf')); + Route::post('export', [KonfirmasiBankController::class, 'export'])->name('konfirmasibank.export'); + //Route::get('/store', 'CustomerController@store'); + // Route::get('/create', [CustomerController::class, 'create'])->name('customer.create'); + //Route::Post('/export',[KonfirmasiBankController::class,'export'])->name('konfirmasibank.export'); }); \ No newline at end of file