diff --git a/app/Helpers/CustomHelper.php b/app/Helpers/CustomHelper.php
index 9703e00..aaa11ae 100644
--- a/app/Helpers/CustomHelper.php
+++ b/app/Helpers/CustomHelper.php
@@ -200,3 +200,77 @@ function display_image($name, $dir = 'defaults', $default = 'default.jpg') {
return $defaultPath;
}
}
+
+if (!function_exists('get_user_agent')) {
+ function get_user_agent($userAgentParam): array
+ {
+ $userAgent = $userAgentParam;
+
+ // Deteksi Sistem Operasi
+ $osArray = [
+ 'Windows' => 'Windows',
+ 'Mac' => 'Macintosh',
+ 'Linux' => 'Linux',
+ 'Android' => 'Android',
+ 'iOS' => 'iPhone|iPad|iPod',
+ ];
+
+ $osDetected = 'Unknown OS';
+ foreach ($osArray as $os => $pattern) {
+ if (preg_match("/$pattern/i", $userAgent)) {
+ $osDetected = $os;
+ break;
+ }
+ }
+
+ // Deteksi Browser
+ $browserArray = [
+ 'Chrome' => 'Chrome',
+ 'Firefox' => 'Firefox',
+ 'Safari' => 'Safari',
+ 'Edge' => 'Edg', // Microsoft Edge pakai "Edg" di User-Agent
+ 'Opera' => 'Opera|OPR',
+ 'Internet Explorer' => 'MSIE|Trident',
+ ];
+
+ $browserDetected = 'Unknown Browser';
+ foreach ($browserArray as $browser => $pattern) {
+ if (preg_match("/$pattern/i", $userAgent)) {
+ $browserDetected = $browser;
+ break;
+ }
+ }
+
+ return [
+ 'os' => $osDetected,
+ 'browser' => $browserDetected,
+ 'user_agent' => $userAgent,
+ ];
+ }
+}
+
+if (!function_exists('display_file')) {
+ function display_file($dir, $filename)
+ {
+ $path = storage_path("app/public/uploads/{$dir}/{$filename}");
+
+ if(!filled($filename)){
+ return '
Belum ditambahkan.
';
+ }
+
+ if (!file_exists($path)) {
+ return 'File tidak ditemukan.
';
+ }
+
+ $mimeType = mime_content_type($path);
+ $fileUrl = asset("storage/{$filename}");
+
+ if (str_contains($mimeType, 'image')) {
+ return "
diff --git a/resources/views/dashboard/journalists/show.blade.php b/resources/views/dashboard/journalists/show.blade.php
index d2c482f..bcfdcaa 100644
--- a/resources/views/dashboard/journalists/show.blade.php
+++ b/resources/views/dashboard/journalists/show.blade.php
@@ -37,7 +37,7 @@
Nomor Telepon
- {{$journalist->email}}
+ {{$journalist->phone_number}}
diff --git a/resources/views/dashboard/users/profiles/account.blade.php b/resources/views/dashboard/users/profiles/account.blade.php
new file mode 100644
index 0000000..fa5cd11
--- /dev/null
+++ b/resources/views/dashboard/users/profiles/account.blade.php
@@ -0,0 +1,102 @@
+@include('partials.dashboard.head')
+@include('partials.dashboard.sidebar', ['page' => 'profile'])
+@include('partials.dashboard.header')
+
+
+
+
+
+
+
+
+
Profile
+
+
+ - Lihat informasi pribadi Anda di sini.
+
+
+
+
+
+
+
+
+
+
+ @include('dashboard.users.profiles.tabs')
+
+
+
+
Informasi Akun
+
Informasi umum terkait akun Anda
+
+
+
+
+ Nama
+ {{$user->name}}
+
+
+
+
+ Email
+ {{$user->email}}
+
+
+
+
+ Role/Hak Akses
+ {{$user->role->name}}
+
+
+
+
+ Status
+
+ @switch($user->status)
+ @case(0)
+ Menunggu
+ @break
+ @case(1)
+ Aktif
+ @break
+ @case(2)
+ Nonaktif
+ @break
+ @case(3)
+ Ditolak
+ @break
+ @default
+ Tidak Diketahui
+ @endswitch
+
+
+
+
+
+ Dibuat Pada
+ {{idn_date($user->created_at, 'd F Y')}}
+
+
+
+
+ Pembaruan Terakhir
+ {{idn_date($user->updated_at, 'd F Y')}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+@include('partials.dashboard.footer', ['rich_editor' => false])
diff --git a/resources/views/dashboard/users/profiles/company.blade.php b/resources/views/dashboard/users/profiles/company.blade.php
new file mode 100644
index 0000000..b1d0c03
--- /dev/null
+++ b/resources/views/dashboard/users/profiles/company.blade.php
@@ -0,0 +1,217 @@
+@include('partials.dashboard.head')
+@include('partials.dashboard.sidebar', ['page' => 'profile'])
+@include('partials.dashboard.header')
+
+
+
+
+
+
+
+
+
Profile
+
+
+ - Lihat informasi pribadi Anda di sini.
+
+
+
+
+
+
+
+
+
+
+ @include('dashboard.users.profiles.tabs')
+
+
+
+
Informasi Perusahaan
+
Informasi umum terkait perusahaan Anda
+
+
+
+
+ Nama Perusahaan
+ {{$user->company->name ?? '-'}}
+
+
+
+
+ Email Perusahaan
+ {{$user->company->email ?? '-'}}
+
+
+
+
+ Direktur
+ {{$user->company->director_name ?? '-'}}
+
+
+
+
+ NIK Direktur
+ {{$user->company->director_nik ?? '-'}}
+
+
+
+
+ Alamat
+ {{$user->company->address ?? '-'}}
+
+
+
+
+ Akta Pendirian
+ {{$user->company->deed_incorporation ?? '-'}}
+
+
+
+
+ SPT Tahunan
+ {{$user->company->annual_tax_return ?? '-'}}
+
+
+
+
+ NPWP
+ {{$user->company->tax_id_number ?? '-'}}
+
+
+
+
+ PKP
+ {{$user->company->taxable_enterprise ?? '-'}}
+
+
+
+
+ Suket Domisili
+ {{$user->company->domicile_certificate ?? '-'}}
+
+
+
+
+ SIUP
+ {{$user->company->trade_license ?? '-'}}
+
+
+
+
+ Profile
+ {{$user->company->profile ?? '-'}}
+
+
+
+
+ {{--
--}}
+
+ {{--
+
Admin Note
+ --}}
+
+
+
+
+
+
+ Dokumen NPWP
+
+
+
+
+ {!! display_file('companies', $user->company->tax_id_number_doc) !!}
+
+
+
+
+
+ Dokumen PKP
+
+
+
+
+ {!! display_file('companies', $user->company->taxable_enterprise_doc) !!}
+
+
+
+
+
+
+ Dokumen SIUP
+
+
+
+
+ {!! display_file('companies', $user->company->trade_license_doc) !!}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+@include('partials.dashboard.footer', ['rich_editor' => false])
diff --git a/resources/views/dashboard/users/profiles/journalists.blade.php b/resources/views/dashboard/users/profiles/journalists.blade.php
new file mode 100644
index 0000000..18da5fa
--- /dev/null
+++ b/resources/views/dashboard/users/profiles/journalists.blade.php
@@ -0,0 +1,128 @@
+@include('partials.dashboard.head')
+@include('partials.dashboard.sidebar', ['page' => 'profile'])
+@include('partials.dashboard.header')
+
+
+
+
+
+
+
+
+
Profile
+
+
+ - Lihat informasi pribadi Anda di sini.
+
+
+
+
+
+
+
+
+
+
+ @include('dashboard.users.profiles.tabs')
+
+
+
+
Informasi Jurnalis
+
Informasi umum terkait jurnalis Anda
+
+ @foreach ($user->company->media->journalists as $journalist)
+
+
+
+
+
+
+
+
+
+
+
+ {{$journalist->name}}
+
+
+
+
+
+
+
+ {{--
--}}
+
+
+
+ Nama Jurnalis
+ {{$journalist->name}}
+
+
+
+
+ Email
+ {{$journalist->email}}
+
+
+
+
+ Nomor Telepon
+ {{$journalist->phone_number}}
+
+
+
+
+ Kartu Pers
+
+ {{$journalist->press_card ?? '-'}}
+
+
+
+
+
+ Sertifikat UKW
+
+ {{$journalist->ukw_sertificate ?? '-'}}
+
+
+
+
+
+
+
+
+
Dokumen Kartu Pers
+
+ {!! display_file('journalists', $journalist->press_card_doc) !!}
+
+
+
+
Dokumen Sertifikat UKW
+
+ {!! display_file('journalists', $journalist->ukw_sertificate_doc) !!}
+
+
+
+
+
+
+
+
+
+
+ @endforeach
+
+
+
+
+
+
+
+
+
+
+
+@include('partials.dashboard.footer', ['rich_editor' => false])
diff --git a/resources/views/dashboard/users/profiles/login-activity.blade.php b/resources/views/dashboard/users/profiles/login-activity.blade.php
new file mode 100644
index 0000000..bdf82df
--- /dev/null
+++ b/resources/views/dashboard/users/profiles/login-activity.blade.php
@@ -0,0 +1,72 @@
+@include('partials.dashboard.head')
+@include('partials.dashboard.sidebar', ['page' => 'profile'])
+@include('partials.dashboard.header')
+
+
+
+
+
+
+
+
+
Profile
+
+
+ - Lihat informasi pribadi Anda di sini.
+
+
+
+
+
+
+
+
+
+
+ @include('dashboard.users.profiles.tabs')
+
+
+
+
Informasi Aktivitas Login
+
Informasi umum terkait aktivitas/histori login akun Anda.
+
+
+
+
+
+ | Browser / IP |
+ IP |
+ Waktu |
+ |
+
+
+
+ @foreach ($loginActivities as $item)
+
+ | {{get_user_agent($item->user_agent)['browser']}} on {{get_user_agent($item->user_agent)['os']}} |
+ {{$item->ip_address}} |
+ {{idn_date($item->logged_in_at, 'H:i d F Y')}} |
+ |
+
+ @endforeach
+
+
+
+
+ {{$loginActivities->links()}}
+
+
+
+
+
+
+
+
+
+
+
+
+@include('partials.dashboard.footer', ['rich_editor' => false, 'datatable' => 'login_activity'])
diff --git a/resources/views/dashboard/users/profiles/media.blade.php b/resources/views/dashboard/users/profiles/media.blade.php
new file mode 100644
index 0000000..5d1c877
--- /dev/null
+++ b/resources/views/dashboard/users/profiles/media.blade.php
@@ -0,0 +1,115 @@
+@include('partials.dashboard.head')
+@include('partials.dashboard.sidebar', ['page' => 'profile'])
+@include('partials.dashboard.header')
+
+
+
+
+
+
+
+
+
Profile
+
+
+ - Lihat informasi pribadi Anda di sini.
+
+
+
+
+
+
+
+
+
+
+ @include('dashboard.users.profiles.tabs')
+
+
+
+
Informasi Media
+
Informasi umum terkait media Anda
+
+
+
+
+ Nama Media
+ {{$user->company->media->name ?? '-'}}
+
+
+
+
+ Jenis
+ {{ucfirst($user->company->media->type) ?? '-'}}
+
+
+
+
+ Klasifikasi
+ {{ucfirst($user->company->media->classification) ?? '-'}}
+
+
+
+
+ Alamat
+ {{$user->company->media->address ?? '-'}}
+
+
+
+
+ Organisasi Kewartawanan
+ {{$user->company->media->journalism_organization ?? '-'}}
+
+
+
+
+ Sertifikat Dewan Press
+ {{$user->company->media->press_council_certificate ?? '-'}}
+
+
+
+
+ {{--
--}}
+
+ {{--
+
Admin Note
+ --}}
+
+
+
+
+
+
+
+
+
+
+
+
+@include('partials.dashboard.footer', ['rich_editor' => false])
diff --git a/resources/views/dashboard/users/profiles/tabs.blade.php b/resources/views/dashboard/users/profiles/tabs.blade.php
new file mode 100644
index 0000000..6ddb1f0
--- /dev/null
+++ b/resources/views/dashboard/users/profiles/tabs.blade.php
@@ -0,0 +1,19 @@
+
diff --git a/resources/views/partials/app/datatable.blade.php b/resources/views/partials/app/datatable.blade.php
index 695327c..69efc1c 100644
--- a/resources/views/partials/app/datatable.blade.php
+++ b/resources/views/partials/app/datatable.blade.php
@@ -980,3 +980,39 @@
});
@endif
+
+@if ($datatable === 'login_activity')
+
+@endif
diff --git a/resources/views/partials/dashboard/header.blade.php b/resources/views/partials/dashboard/header.blade.php
index 9fde11d..3ee5adf 100644
--- a/resources/views/partials/dashboard/header.blade.php
+++ b/resources/views/partials/dashboard/header.blade.php
@@ -135,7 +135,7 @@
diff --git a/routes/web.php b/routes/web.php
index 41c0257..ba0b672 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -460,9 +460,9 @@
});
});
- Route::middleware('role:1')->group(function(){
- Route::prefix('users')->name('users.')->group(function(){
- Route::controller(UserController::class)->group(function(){
+ Route::prefix('users')->name('users.')->group(function(){
+ Route::controller(UserController::class)->group(function(){
+ Route::middleware(['role:1'])->group(function(){
Route::get('/', 'index')->name('index');
Route::get('/create', 'create')->name('create');
Route::post('/', 'store')->name('store');
@@ -475,8 +475,10 @@
Route::delete('/{id}', 'destroy')->name('destroy');
});
- Route::get('/data', [DatatableController::class, 'user'])->name('data');
+ Route::get('/profile/{type}', 'profile')->name('profile');
});
+
+ Route::get('/data', [DatatableController::class, 'user'])->name('data');
});
Route::middleware('role:1')->group(function(){