91 lines
2.7 KiB
PHP
91 lines
2.7 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
class InformationController extends Controller
|
|
{
|
|
public function pembiayaansemasa()
|
|
{
|
|
$auth_user = Auth::User();
|
|
|
|
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
|
|
|
$pembiayaansemasa = [];
|
|
if(isset($CustomerInfo['gadai']))
|
|
{
|
|
$pembiayaansemasa = $CustomerInfo['gadai'];
|
|
}
|
|
|
|
return response()->json($pembiayaansemasa,200);
|
|
|
|
// return view('includes.information.pembiayaansemasa',compact('pembiayaansemasa'));
|
|
}
|
|
|
|
public function pembiayaanaktif()
|
|
{
|
|
$auth_user = Auth::User();
|
|
|
|
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
|
|
|
$pembiayaansemasa = [];
|
|
if(isset($CustomerInfo['gadai']))
|
|
{
|
|
$pembiayaansemasa = $CustomerInfo['gadai'];
|
|
}
|
|
|
|
return response()->json($pembiayaansemasa,200);
|
|
// return view('includes.information.pembiayaanaktif',compact('pembiayaansemasa'));
|
|
}
|
|
|
|
public function pembiayaanmelebihi6bulan()
|
|
{
|
|
$auth_user = Auth::User();
|
|
|
|
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
|
|
|
$melebihi6bulan = [];
|
|
|
|
if(isset($CustomerInfo['gadai']))
|
|
{
|
|
foreach($CustomerInfo['gadai'] as $index=>$gadai)
|
|
{
|
|
if($gadai['tempoh'] >= 6)
|
|
{
|
|
array_push($melebihi6bulan,$gadai);
|
|
}
|
|
}
|
|
}
|
|
|
|
return response()->json($melebihi6bulan,200);
|
|
// return view('includes.information.melebihi6bulan',compact('melebihi6bulan'));
|
|
}
|
|
|
|
public function pembiayaanakandilelong()
|
|
{
|
|
$auth_user = Auth::User();
|
|
|
|
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
|
|
|
$lelong = [];
|
|
if(isset($CustomerInfo['lelong']))
|
|
{
|
|
$lelong += $CustomerInfo['lelong'];
|
|
}
|
|
|
|
|
|
return response()->json($lelong,200);
|
|
// return view('includes.information.lelongan',compact('lelong'));
|
|
}
|
|
|
|
public function termaSyarat() {
|
|
|
|
$termasyarat = "AVAILABLE";
|
|
|
|
return view('auth.termasyarat', compact('termasyarat'));
|
|
}
|
|
}
|