feat Log Masuk & Keluar Sistem
This commit is contained in:
@@ -35,13 +35,13 @@ class HomeController extends Controller
|
||||
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
|
||||
|
||||
$check_nokp = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/checknokp/' . $auth_user['cawangan'] . '/' . $auth_user['no_kp'] . '/' . $current) ->json();
|
||||
if($check_nokp == $auth_user['no_kp']){
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(session()->has('iklan') && session()->get('iklan') == 0)
|
||||
{
|
||||
session()->put('iklan', 1);
|
||||
@@ -75,10 +75,30 @@ class HomeController extends Controller
|
||||
|
||||
$countkhazanah = sizeof($gadai) + sizeof($listserah);
|
||||
|
||||
$session = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url') . '/api/logsession/' . $auth_user['cawangan'], [
|
||||
'id' => $auth_user['id'],
|
||||
'nama' => $auth_user['name'],
|
||||
'nokp' => $auth_user['no_kp'],
|
||||
'email' => $auth_user['email'],
|
||||
'taraf' => $auth_user['role_harian'],
|
||||
'tarikh' => $current,
|
||||
|
||||
|
||||
]);
|
||||
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();
|
||||
$session = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url') . '/api/logsession/' . $auth_user['cawangan'], [
|
||||
'id' => $auth_user['id'],
|
||||
'nama' => $auth_user['name'],
|
||||
'nokp' => $auth_user['no_kp'],
|
||||
'email' => $auth_user['email'],
|
||||
'taraf' => $auth_user['role_harian'],
|
||||
'tarikh' => $current,
|
||||
|
||||
|
||||
]);
|
||||
return view('homepage.'.$auth_user['roles'].'.home',compact('cawangan_info','api_url'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user