fix portal
This commit is contained in:
@@ -10,7 +10,76 @@ class AnalisaController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$kpbaru = Auth::User()->icno;
|
||||
|
||||
$totalgadai = 0;
|
||||
$arraytotalgadai = [];
|
||||
$cawangangadai = [];
|
||||
$cawanganlelong = [];
|
||||
$count = 0;
|
||||
|
||||
$customers_detail = Http::get(config('api.url') .'/api/customers/' . $kpbaru)->json();
|
||||
$gadaidetail[] = Http::get(config('api.url') .'/api/customers/' . $kpbaru . '/gadai/belum_tebus')->json();
|
||||
|
||||
if(empty($gadaidetail[0]) )
|
||||
{
|
||||
$gadai_belum_tebus = $gadaidetail[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
$gadai_belum_tebus = $gadaidetail[0][0];
|
||||
}
|
||||
|
||||
$bilangan_belum_tebus = (empty($gadaidetail[0])) ? count($gadaidetail[0]) : count($gadaidetail[0][0]);
|
||||
$lelongdetail = Http::get(config('api.url') .'/api/customers/' . $kpbaru . '/gadai/lelong')->json();
|
||||
$bilangan_lelong = (empty($lelongdetail)) ? sizeof($lelongdetail) : sizeof($lelongdetail[0]);
|
||||
|
||||
$marhunakanlelong = Http::get(config('api.url') .'/api/bilangandilelong/' . $kpbaru)->json();
|
||||
|
||||
$totalgadaicawangan = 0;
|
||||
|
||||
foreach ($gadaidetail as $index => $gadai) {
|
||||
|
||||
foreach ($gadai as $index1 => $pinjamanzz) {
|
||||
foreach($pinjamanzz as $pin)
|
||||
{
|
||||
$pinjaman = floatval($pin['pinjaman']);
|
||||
|
||||
$totalgadai += $pinjaman;
|
||||
$totalgadaicawangan += $pinjaman;
|
||||
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$bilangan_melebihi_6_bulan = 0;
|
||||
|
||||
foreach($gadai_belum_tebus as $index => $gadai){
|
||||
if($gadai['jbg'] >= 6){
|
||||
$bilangan_melebihi_6_bulan ++;
|
||||
}
|
||||
}
|
||||
|
||||
$marhunakanlelong = Http::get(config('api.url') .'/api/bilangandilelong/' . $kpbaru)->json();
|
||||
|
||||
$bilakandilelong = (empty($marhunakanlelong)) ? sizeof($marhunakanlelong) : sizeof($marhunakanlelong[0]);
|
||||
|
||||
$harga_emas = Http::get(config('api.url') .'/api/harga_emas/')->json();
|
||||
|
||||
$belum_tebus = Http::get(config('api.url') . '/api/customers/'. $kpbaru . '/gadai/' . 'belum_tebus')->json();
|
||||
|
||||
if(is_array($belum_tebus))
|
||||
{
|
||||
if(sizeof($belum_tebus) > 0)
|
||||
{
|
||||
$belum_tebus = $belum_tebus[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// $StatistikBulanan = Http::get(config('api.url') .'/portal/financeMonth/',['icno' => $kpbaru])->json();
|
||||
|
||||
return view('analisa.index');
|
||||
return view('analisa.index', compact("totalgadai",'bilangan_belum_tebus','belum_tebus','harga_emas','bilangan_melebihi_6_bulan','bilakandilelong'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,14 @@ class BayaranController extends Controller
|
||||
|
||||
$belum_tebus = Http::get(config('api.url') . '/api/customers/'. $auth_user['icno'] . '/gadai/' . 'belum_tebus')->json();
|
||||
|
||||
if(sizeof($belum_tebus) > 0)
|
||||
$belum_tebus = $belum_tebus[0];
|
||||
if(is_array($belum_tebus))
|
||||
{
|
||||
if(sizeof($belum_tebus) > 0)
|
||||
{
|
||||
$belum_tebus = $belum_tebus[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return view('pembayaran.senaraibayaran', compact('belum_tebus'));
|
||||
}
|
||||
|
||||
@@ -13,26 +13,25 @@ class SemakController extends Controller
|
||||
$auth_user = Auth::user();
|
||||
|
||||
$belum_tebus = Http::get(config('api.url') . '/api/customers/'. $auth_user['icno'] . '/gadai/' . 'belum_tebus')->json();
|
||||
$cawangan = Http::get(config('api.url') . '/api/customer/eachcawangan/'. $auth_user['icno'])->json();
|
||||
|
||||
if(sizeof($belum_tebus) > 0)
|
||||
$belum_tebus = $belum_tebus[0];
|
||||
if(is_array($belum_tebus))
|
||||
{
|
||||
if(sizeof($belum_tebus) > 0)
|
||||
{
|
||||
$belum_tebus = $belum_tebus[0];
|
||||
}
|
||||
}
|
||||
|
||||
return view('semak.semaksag', compact('belum_tebus'));
|
||||
return view('semak.semaksag', compact('belum_tebus','cawangan'));
|
||||
}
|
||||
|
||||
public function SenaraiSAG()
|
||||
public function SenaraiSAG(Request $request)
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
|
||||
$belum_tebus = Http::get(config('api.url') . '/api/customers/'. $auth_user['icno'] . '/gadai/' . 'belum_tebus')->json();
|
||||
|
||||
if(sizeof($belum_tebus) > 0)
|
||||
$belum_tebus = $belum_tebus[0];
|
||||
|
||||
$sudah_tebus = Http::get(config('api.url') . '/api/customers/'. $auth_user['icno'] . '/gadai/' . 'sudah_tebus')->json();
|
||||
|
||||
if(sizeof($sudah_tebus) > 0)
|
||||
$sudah_tebus = $sudah_tebus[0];
|
||||
$belum_tebus = Http::get(config('api.url') . '/api/customers/'. $auth_user['icno'] . '/gadai/' . 'belum_tebus/' . $request->sltcawangan)->json();
|
||||
$sudah_tebus = Http::get(config('api.url') . '/api/customers/'. $auth_user['icno'] . '/gadai/' . 'sudah_tebus/' . $request->sltcawangan)->json();
|
||||
|
||||
return view('semak.senaraisag', compact('belum_tebus','sudah_tebus'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user