115 lines
4.2 KiB
PHP
115 lines
4.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\LelongBid;
|
|
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'];
|
|
}
|
|
|
|
if(isset($CustomerInfo['lelong'])){
|
|
if(sizeof($CustomerInfo['lelong']) > 0){
|
|
foreach($CustomerInfo['lelong'] as $index=>$lelong){
|
|
$array_lelong = Http::withOptions(['verify' => config('app.api_verify')])->get('https://adminbid.arrahn.com.my/api/portalApi',['norujukan' => $lelong['norujukan']])->json();
|
|
|
|
if($array_lelong['lelong'] !== null){
|
|
$CustomerInfo['lelong'][$index] = collect($lelong)->merge($array_lelong['lelong'])->toArray();
|
|
}
|
|
}
|
|
$pembiayaansemasa = collect($pembiayaansemasa)->merge($CustomerInfo['lelong']);
|
|
$pembiayaansemasa = $pembiayaansemasa->toArray();
|
|
}
|
|
}
|
|
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'])){
|
|
if(sizeof($CustomerInfo['lelong']) > 0){
|
|
foreach($CustomerInfo['lelong'] as $index=>$lel){
|
|
// $array_lelong = Http::withOptions(['verify' => config('app.api_verify')])->get('https://adminbid.arrahn.com.my/api/portalApi',['norujukan' => $lel['norujukan']])->json();
|
|
$array_lelong = Http::withOptions(['verify' => config('app.api_verify')])->get('http://lelong.test/api/portalApi/',['norujukan' => $lel['norujukan']]);
|
|
if($array_lelong['lelong'] !== null){
|
|
$CustomerInfo['lelong'][$index] = collect($lel)->merge($array_lelong['lelong'])->toArray();
|
|
}
|
|
}
|
|
$lelong = collect($lelong)->merge($CustomerInfo['lelong']);
|
|
$lelong = $lelong->toArray();
|
|
}
|
|
}
|
|
|
|
|
|
return response()->json($lelong,200);
|
|
// return view('includes.information.lelongan',compact('lelong'));
|
|
}
|
|
|
|
public function termaSyarat() {
|
|
|
|
$termasyarat = "AVAILABLE";
|
|
|
|
return view('auth.termasyarat', compact('termasyarat'));
|
|
}
|
|
}
|
|
|