fix stki2
This commit is contained in:
+52
-62
@@ -115,77 +115,77 @@ Route::get('/bayarsag', function () {
|
||||
});
|
||||
|
||||
|
||||
Route::get('/', function () {
|
||||
// return view('dashboard');
|
||||
$auth_user = Auth::user();
|
||||
// Route::get('/', function () {
|
||||
// // return view('dashboard');
|
||||
// $auth_user = Auth::user();
|
||||
|
||||
$harga_emas = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/harga_emas/')->json();
|
||||
// $harga_emas = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/harga_emas/')->json();
|
||||
|
||||
$hargaemasterdahulu = array();
|
||||
// $hargaemasterdahulu = array();
|
||||
|
||||
foreach($harga_emas as $index=>$harga)
|
||||
{
|
||||
$hargaemassandaran = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/harga_emas/rekod/sandaran',['karat' => $harga['karat']])->json();
|
||||
// foreach($harga_emas as $index=>$harga)
|
||||
// {
|
||||
// $hargaemassandaran = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/harga_emas/rekod/sandaran',['karat' => $harga['karat']])->json();
|
||||
|
||||
$percentnaik = (floatval($harga['harga']) - floatval($hargaemassandaran[1]['harga'])) / ($hargaemassandaran[1]['harga']) * 100;
|
||||
// $percentnaik = (floatval($harga['harga']) - floatval($hargaemassandaran[1]['harga'])) / ($hargaemassandaran[1]['harga']) * 100;
|
||||
|
||||
array_push($hargaemasterdahulu,['karat' => $harga['karat'],'hargasemasa' => $harga['harga'], 'hargadahulu' => $hargaemassandaran[1]['harga'],'percent' => $percentnaik]);
|
||||
// array_push($hargaemasterdahulu,['karat' => $harga['karat'],'hargasemasa' => $harga['harga'], 'hargadahulu' => $hargaemassandaran[1]['harga'],'percent' => $percentnaik]);
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
// $CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
|
||||
$total = 0.00;
|
||||
$sixmonths = 0;
|
||||
$bilangan = 0;
|
||||
foreach($CustomerInfo['gadai'] as $index=>$gadai)
|
||||
{
|
||||
$bilangan++;
|
||||
$total += $gadai['pinjaman'];
|
||||
// $total = 0.00;
|
||||
// $sixmonths = 0;
|
||||
// $bilangan = 0;
|
||||
// foreach($CustomerInfo['gadai'] as $index=>$gadai)
|
||||
// {
|
||||
// $bilangan++;
|
||||
// $total += $gadai['pinjaman'];
|
||||
|
||||
if($gadai['tempoh'] >= 6)
|
||||
{
|
||||
$sixmonths++;
|
||||
}
|
||||
}
|
||||
// if($gadai['tempoh'] >= 6)
|
||||
// {
|
||||
// $sixmonths++;
|
||||
// }
|
||||
// }
|
||||
|
||||
$bilanganlelong = 0;
|
||||
foreach($CustomerInfo['lelong'] as $index1=>$lelong)
|
||||
{
|
||||
$bilanganlelong += 1;
|
||||
}
|
||||
// $bilanganlelong = 0;
|
||||
// foreach($CustomerInfo['lelong'] as $index1=>$lelong)
|
||||
// {
|
||||
// $bilanganlelong += 1;
|
||||
// }
|
||||
|
||||
$arraysag = [];
|
||||
$belum_tebus = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customers/'. $auth_user['icno'] . '/gadai/' . 'belum_tebus')->json();
|
||||
// $arraysag = [];
|
||||
// $belum_tebus = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customers/'. $auth_user['icno'] . '/gadai/' . 'belum_tebus')->json();
|
||||
|
||||
if(is_array($belum_tebus))
|
||||
{
|
||||
if(sizeof($belum_tebus) > 0)
|
||||
{
|
||||
foreach($belum_tebus as $index=>$bt)
|
||||
{
|
||||
foreach($bt as $index1=>$bet)
|
||||
{
|
||||
array_push($arraysag,$bet);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// if(is_array($belum_tebus))
|
||||
// {
|
||||
// if(sizeof($belum_tebus) > 0)
|
||||
// {
|
||||
// foreach($belum_tebus as $index=>$bt)
|
||||
// {
|
||||
// foreach($bt as $index1=>$bet)
|
||||
// {
|
||||
// array_push($arraysag,$bet);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
$belum_tebus = $arraysag;
|
||||
// $belum_tebus = $arraysag;
|
||||
|
||||
$api_url = config('api.url');
|
||||
// $api_url = config('api.url');
|
||||
|
||||
return view('includes.home',compact('api_url','hargaemasterdahulu','bilangan','sixmonths','total','bilanganlelong','belum_tebus'));
|
||||
})->middleware(['auth','verified']);
|
||||
// return view('includes.home',compact('api_url','hargaemasterdahulu','bilangan','sixmonths','total','bilanganlelong','belum_tebus'));
|
||||
// })->middleware(['auth','verified']);
|
||||
|
||||
// Route::get('/home', 'HomeController@index');
|
||||
|
||||
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
|
||||
Route::get('/', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
|
||||
|
||||
Auth::routes(['verify' => true]);
|
||||
|
||||
Route::get('/home', 'App\Http\Controllers\HomeController@index')->name('home');
|
||||
// Route::get('/home', 'App\Http\Controllers\HomeController@index')->name('home');
|
||||
|
||||
Route::group(['middleware' => 'auth'], function () {
|
||||
Route::resource('user', 'App\Http\Controllers\UserController', ['except' => ['show']]);
|
||||
@@ -254,18 +254,8 @@ Route::get('send-mail', function () {
|
||||
dd("Email is Sent.");
|
||||
});
|
||||
|
||||
|
||||
|
||||
//For Reference
|
||||
|
||||
// Route::resource('user', 'App\Http\Controllers\UserController', ['except' => ['show']]);
|
||||
// Route::get('profile', ['as' => 'profile.edit', 'uses' => 'App\Http\Controllers\ProfileController@edit']);
|
||||
// Route::put('profile', ['as' => 'profile.update', 'uses' => 'App\Http\Controllers\ProfileController@update']);
|
||||
// Route::get('upgrade', function () {return view('pages.upgrade');})->name('upgrade');
|
||||
// Route::get('map', function () {return view('pages.maps');})->name('map');
|
||||
// Route::get('icons', function () {return view('pages.icons');})->name('icons');
|
||||
// Route::get('table-list', function () {return view('pages.tables');})->name('table');
|
||||
// Route::put('profile/password', ['as' => 'profile.password', 'uses' => 'App\Http\Controllers\ProfileController@password']);
|
||||
Route::get('/requestic', 'App\Http\Controllers\TacController@requestKadPengenalan')->name('requestic');
|
||||
Route::get('/requesttac', 'App\Http\Controllers\TacController@TACrequest')->name('requesttac');
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user