updated untuk 28-9-2022
This commit is contained in:
@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Auth;
|
||||
use App\Services\CustomerService;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
@@ -29,6 +30,16 @@ class HomeController extends Controller
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
|
||||
if(session()->has('iklan') && session()->get('iklan') == 0)
|
||||
{
|
||||
session()->put('iklan', 1);
|
||||
}else{
|
||||
if (Hash::check(config('app.reset_password'), $auth_user['password']) || Hash::check($auth_user['no_kp'], $auth_user['password'])) {
|
||||
session()->put('iklan', 0);
|
||||
}
|
||||
}
|
||||
|
||||
if($auth_user['roles'] == 'teller'){
|
||||
if($auth_user['role_harian'] == 'teller'){
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
@@ -45,7 +56,13 @@ class HomeController extends Controller
|
||||
}
|
||||
elseif($auth_user['roles'] == 'pc' || $auth_user['roles'] == 'ppc'){
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
return view('homepage.khazanah.home',compact('cawangan_info','api_url'));
|
||||
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->get( config('api.url') .'/api/gadai/serah_marhun/khazanah/'. $auth_user['cawangan'])->json();
|
||||
$listserah = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/listSerahMarhunController/'.$auth_user['cawangan'])->json();
|
||||
|
||||
$countkhazanah = sizeof($gadai) + sizeof($listserah);
|
||||
|
||||
return view('homepage.khazanah.home',compact('cawangan_info','api_url','countkhazanah'));
|
||||
}
|
||||
else{
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
Reference in New Issue
Block a user