main
Ilham Wara Nugroho 2026-03-03 11:32:26 +07:00
parent 6ac77cd327
commit 4dfd6f1afb
13 changed files with 75 additions and 41 deletions

View File

@ -32,7 +32,7 @@ class HomeController extends Controller
{
$data['title'] = 'Dashboard';
$data['route'] = $this->route;
if((session('group_id') == 1) || (session('group_alias') == 'admin')){
if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta') ){
$data['dataset'] = Dataset::orderBy('DatasetId','DESC')->where('tahun',date('Y'))->where('status',1)->count();
$data['datasetTambahan'] = DatasetTambahan::where('status',1)->orderBy('DatasetId','DESC')->where('tahun',date('Y'))->count();
$data['datasetInstansi'] = Instansi::selectRaw("
@ -148,7 +148,7 @@ class HomeController extends Controller
public function gridTabel(Request $request)
{
if((session('group_id') == 1) || (session('group_alias') == 'admin')){
if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta') ){
$data = Instansi::all();
}else{
$data = Instansi::where('MsInstansiId',session('instansi_id'))->get();
@ -191,7 +191,7 @@ class HomeController extends Controller
public function grid(Request $request)
{
if((session('group_id') == 1) || (session('group_alias') == 'admin')){
if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta') ){
$data = Dataset::orderBy('DatasetId','DESC')->limit(10)->get();
}else{
$data = Dataset::orderBy('DatasetId','DESC')->limit(10)->whereIn('created_by',[auth()->user()->id,1])->get();
@ -234,7 +234,7 @@ class HomeController extends Controller
public function gridResource(Request $request)
{
if((session('group_id') == 1) || (session('group_alias') == 'admin')){
if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta') ){
$data = TabelData::with(['dataset'])->where('show_dashboard',1)->get();
}else{
$data = TabelData::with(['dataset'])->whereHas('dataset',function($query){
@ -247,7 +247,7 @@ class HomeController extends Controller
foreach ($data as $key => $row) {
$action = '';
if((session('group_id') == 1) || (session('group_alias') == 'admin')){
if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta') ){
$action .= '<a href="'.url('dashboard/dataset/resource/'.encode_id($row->MsTemplateId)) .'" class="btn w-full bg-success text-white">Lihat Data</a>';
}else{
$action .= '<a href="'.url('dashboard/dataset/resource/instansi/'.encode_id(session('instansi_id')).'/'.encode_id($row->MsTemplateId)).'" class="btn w-full bg-success text-white">Lihat Data</a>';
@ -270,7 +270,7 @@ class HomeController extends Controller
public function datasetGrid($alias,Request $request)
{
if((session('group_id') == 1) || (session('group_alias') == 'admin')){
if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta') ){
$data = Dataset::whereHas('instansi',function($query) use ($alias){
$query->where('parent','ilike','%'.$alias.'%');
})->orderBy('DatasetId','DESC')->get();

View File

@ -53,7 +53,7 @@ class UserController extends Controller
if((permission('is_create', $this->route.'.*','module',false)) || (permission('is_update', $this->route.'.*','module',false))){
$action .= '<div class="flex gap-1 justify-center items-center">';
$action .= '<a href="'.url('management/user/update/'.encode_id($row->id)).'" data-toggle="tooltip" title="Edit Data" class="p-2 w-full rounded text-white bg-blue-500"><i class="ri-pencil-line text-white"></i></a>';
if((session('group_id') == 1) || (session('group_alias') == 'admin')){
if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta') ){
$action .= '<a href="#" data-href="'.url('management/user/forcelogin/'.encode_id($row->id)).'" data-toggle="tooltip" title="Force Login" class="forcelogin p-2 w-full rounded text-white bg-emerald-500"><i class="ri-user-line text-white"></i></a>';
$action .= '<a href="#" data-href="'.url('management/user/delete/'.encode_id($row->id)).'" data-toggle="tooltip" title="Hapus Data" class="remove_data p-2 w-full rounded text-white bg-red-500"><i class="ri-delete-bin-line text-white"></i></a>';
}

View File

@ -54,7 +54,7 @@ class InstansiController extends Controller
if((permission('is_create', $this->route.'.*','module',false)) || (permission('is_update', $this->route.'.*','module',false))){
$action .= '<div class="flex gap-3 justify-center items-center flex-row">';
$action .= '<a href="'.url('master/instansi/update/'.encode_id($row->MsInstansiId)).'" data-toggle="tooltip" title="Edit Data" class="p-2 text-white rounded bg-blue-500">Edit</a>';
if((session('group_id') == 1) || (session('group_alias') == 'admin')){
if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta') ){
$action .= '<a href="#" data-href="'.url('master/instansi/delete/'.encode_id($row->MsInstansiId)).'" data-toggle="tooltip" title="Hapus Data" class="remove_data p-2 text-white rounded bg-red-500">Hapus</a>';
}
$action .= '</div>';

View File

@ -48,7 +48,7 @@ class TabelDataController extends Controller
$action .= '<div class="flex gap-3 justify-center items-center flex-row">';
$action .= '<a href="'.url('master/tabel-data/update/'.encode_id($row->MsTabelDataId)).'" data-toggle="tooltip" title="Edit Data" class="p-2 rounded bg-blue-500 text-white">Edit</a>';
$action .= '<a href="'.url('master/tabel-data/kolom/'.encode_id($row->MsTabelDataId)).'" data-toggle="tooltip" title="View Data" class="p-2 rounded text-white bg-emerald-500">Detail</a>';
if((session('group_id') == 1) || (session('group_alias') == 'admin')){
if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta') ){
// $action .= '<a href="#" data-href="'.url('master/table-data/delete/'.encode_id($row->MsTabelDataId)).'" data-toggle="tooltip" title="Hapus Data" class="remove_data p-2 rounded bg-danger"><i class="ri-delete-bin-line text-white"></i></a>';
}
$action .= '</div>';

View File

@ -48,7 +48,7 @@ class TabelDataKolomController extends Controller
if((permission('is_create', $this->route.'.*','module',false)) || (permission('is_update', $this->route.'.*','module',false))){
$action .= '<div class="flex gap-3 justify-center items-center flex-row">';
$action .= '<a href="'.url('master/tabel-data/kolom/'.encode_id($row->ms_tabel_data_id).'/update/'.encode_id($row->MsTabelDataKolomId).'').'" data-toggle="tooltip" title="Edit Data" class="btn btn-sm btn-block bg-primary"><i class="ri-pencil-line text-white"></i></a>';
if((session('group_id') == 1) || (session('group_alias') == 'admin')){
if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta') ){
// $action .= '<a href="#" data-href="'.url('master/table-data/delete/'.encode_id($row->MsTabelDataKolomId)).'" data-toggle="tooltip" title="Hapus Data" class="remove_data btn btn-sm btn-block bg-danger"><i class="ri-delete-bin-line text-white"></i></a>';
}
$action .= '</div>';

View File

@ -106,10 +106,13 @@ class DatasetController extends Controller
$action = '';
if((permission('is_create', $this->route.'.*','module',false)) || (permission('is_update', $this->route.'.*','module',false))){
if(access('is_read', $this->route.'.*','module',false)){
$action .= '<div class="flex flex-col gap-1 justify-center text-center items-center">';
if(($row->created_by == auth()->user()->id) && ($row->status == 2)){
$action .= '<a href="'.url('opendata/dataset/update/'.encode_id($row->DatasetId)).'" title="Ubah Data" class="p-2 w-full rounded text-white bg-blue-600">Edit</a>';
if((access('is_update', $this->route.'.*','module',false))){
if(($row->created_by == auth()->user()->id) && ($row->status == 2)){
$action .= '<a href="'.url('opendata/dataset/update/'.encode_id($row->DatasetId)).'" title="Ubah Data" class="p-2 w-full rounded text-white bg-blue-600">Edit</a>';
}
}
$action .= '<a href="'.url('opendata/dataset/view/'.encode_id($row->DatasetId)).'" title="Lihat Data" class="p-2 w-full rounded text-white bg-slate-600">Detail</a>';
if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta') ){

View File

@ -58,7 +58,7 @@ class DatasetTambahanController extends Controller
public function grid(Request $request)
{
if((session('group_id') == 1) || (session('group_alias') == 'admin')){
if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta') ){
$data = DatasetTambahan::with(['tabelData'])->orderBy('DatasetTambahanId','DESC')->get();
}else{
$data = DatasetTambahan::with(['tabelData'])->orderBy('DatasetTambahanId','DESC')->whereIn('instansi_id',[session('instansi_id')])->get();
@ -72,13 +72,15 @@ class DatasetTambahanController extends Controller
$action = '';
if((permission('is_create', $this->route.'.*','module',false)) || (permission('is_update', $this->route.'.*','module',false))){
if((access('is_read', $this->route.'.*','module',false))){
$action .= '<div class="flex gap-1 justify-center items-center flex-row">';
if(($row->created_by == auth()->user()->id) && ($row->status == 2)){
$action .= '<a href="'.url('opendata/dataset-tambahan/update/'.encode_id($row->DatasetTambahanId)).'" data-toggle="tooltip" title="Ubah Data" class="p-2 rounded text-white bg-blue-500">Edit</a>';
if((access('is_update', $this->route.'.*','module',false))){
if(($row->created_by == auth()->user()->id) && ($row->status == 2)){
$action .= '<a href="'.url('opendata/dataset-tambahan/update/'.encode_id($row->DatasetTambahanId)).'" data-toggle="tooltip" title="Ubah Data" class="p-2 rounded text-white bg-blue-500">Edit</a>';
}
}
$action .= '<a href="'.url('opendata/dataset-tambahan/view/'.encode_id($row->DatasetTambahanId)).'" data-toggle="tooltip" title="Lihat Data" class="p-2 rounded text-white bg-blue-900">Detail</a>';
if((session('group_id') == 1) || (session('group_alias') == 'admin')){
$action .= '<a href="'.url('opendata/dataset-tambahan/view/'.encode_id($row->DatasetTambahanId)).'" data-toggle="tooltip" title="Lihat Data" class="p-2 w-full rounded text-white bg-slate-600">Detail</a>';
if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta') ){
// $action .= '<a href="#" data-href="'.url('management/user/forcelogin/'.encode_id($row->id)).'" data-toggle="tooltip" title="Force Login" class="forcelogin p-2 rounded text-white bg-success"><i class="ri-user-2-line text-white"></i></a>';
if($row->status == 1){
// $action .= '<a href="#" data-href="'.url('opendata/dataset-tambahan/delete/'.encode_id($row->DatasetTambahanId)).'" data-toggle="tooltip" title="Hapus Data" class="remove_data p-2 rounded text-white bg-red-500"><i class="ri-delete-bin-line text-white"></i></a>';
@ -90,11 +92,11 @@ class DatasetTambahanController extends Controller
}
$status = '';
if($row->status == 1){
$status = '<small class="p-1 w-full flex bg-emerald-500 text-white rounded" title="Valid">Valid</small>';
$status = '<small class="p-1 w-full items-center justify-center flex bg-emerald-500 text-white rounded" title="Valid">Valid</small>';
}elseif($row->status == 0){
$status = '<small class="p-1 w-full flex bg-yellow-500 text-white rounded" title="Tidak Valid">Menunggu Verifikasi</small>';
$status = '<small class="p-1 w-full items-center justify-center flex bg-yellow-500 text-white rounded" title="Tidak Valid">Menunggu Verifikasi</small>';
}elseif($row->status == 2){
$status = '<small class="p-1 w-full flex bg-red-500 text-white rounded" title="Tidak Valid">Verifikasi Ditolak</small>';
$status = '<small class="p-1 w-full items-center justify-center flex bg-red-500 text-white rounded" title="Tidak Valid">Verifikasi Ditolak</small>';
}
$_data[] = [
@ -223,7 +225,7 @@ class DatasetTambahanController extends Controller
if(@$request->hasFile('file')){
$insert->file = $filePath;
}
if((session('group_id') == 1) || (session('group_alias') == 'admin')){
if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta') ){
$insert->status = 1;
}else{
$insert->status = 0;
@ -278,7 +280,7 @@ class DatasetTambahanController extends Controller
$data['route'] = $this->route;
$data['keyId'] = $id;
$data['item'] = DatasetTambahan::find($keyId);
if((session('group_id') == 1) || (session('group_alias') == 'admin')){
if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta') ){
$data['instansi'] = Instansi::all();
}else{
$data['instansi'] = Instansi::where('MsInstansiId',session('instansi_id'))->get();
@ -304,7 +306,7 @@ class DatasetTambahanController extends Controller
$data['instansi'] = Instansi::all();
$data['topik'] = Topik::all();
$data['template'] = Template::all();
$data['catatan'] = DatasetCatatan::where('dataset_id',$keyId)->orderBy('created_at','ASC')->get();
$data['catatan'] = DatasetCatatan::where('dataset_id',$keyId)->orderBy('created_at','DESC')->first();
return view($this->template.'.view',$data);
}

View File

@ -8,11 +8,11 @@
<link rel="icon" type="image/png" sizes="32x32" href="{{asset('assets/logo3.png')}}">
<!-- Tailwind CSS CDN -->
<!-- Tailwind CSS CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<script src="{{ asset('assets/js/tailwind.js') }}"></script>
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<link href="{{ asset('assets/css/font.css') }}" rel="stylesheet">
<!-- Lucide Icons -->
<script src="https://unpkg.com/lucide@latest"></script>
<script src="{{ asset('assets/js/lucide.js') }}"></script>
<style>
body { font-family: 'Plus Jakarta Sans', sans-serif; }
.login-gradient {
@ -94,7 +94,7 @@
<i data-lucide="lock" class="absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400"></i>
<input type="password" id="password" name="password" placeholder="••••••••"
class="w-full pl-12 pr-12 py-4 bg-slate-50 border border-slate-200 rounded-2xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-all font-medium">
<button type="button" class="absolute right-4 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors">
<button type="button" id="togglePassword" class="absolute right-4 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors">
<i data-lucide="eye" class="w-5 h-5"></i>
</button>
</div>
@ -117,7 +117,7 @@
</div>
<!-- jQuery CDN -->
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="{{ asset('assets/js/jquery.min.js') }}"></script>
<script>
$(document).ready(function() {
lucide.createIcons();
@ -133,6 +133,20 @@
lucide.createIcons();
});
});
$('#togglePassword').on('click', function() {
let passwordField = $('#password');
let icon = $(this).find('i');
// Cek apakah input saat ini bertipe password
if (passwordField.attr('type') === 'password') {
passwordField.attr('type', 'text'); // Ubah ke teks
icon.attr('data-lucide', 'eye-off');
} else {
passwordField.attr('type', 'password'); // Ubah ke password
icon.attr('data-lucide', 'eye');
}
lucide.createIcons();
});
</script>
</body>
</html>

View File

@ -194,6 +194,20 @@
$('#count-display').text(count);
}
});
$('#togglePassword').on('click', function() {
let passwordField = $('#password');
let icon = $(this).find('i');
// Cek apakah input saat ini bertipe password
if (passwordField.attr('type') === 'password') {
passwordField.attr('type', 'text'); // Ubah ke teks
icon.removeClass('ri-eye-line').addClass('ri-eye-2-line'); // Ganti ikon
} else {
passwordField.attr('type', 'password'); // Ubah ke password
icon.removeClass('ri-eye-2-line').addClass('ri-eye-line'); // Kembalikan ikon
}
});
</script>
@yield('js')
</body>

View File

@ -39,6 +39,7 @@
.bootstrap-table .fixed-table-container .table td.tengah{
text-align: center!important;
padding:10px;
vertical-align: middle!important;
font-weight: 500!important;
}

View File

@ -45,7 +45,7 @@
</div>
</div>
@if((session('group_id') == 1) || (session('group_alias') == 'admin'))
@if((session('group_id') == 1) || (session('group_alias') == 'admin') || (session('group_alias') == 'admin_ta'))
<!-- Datatable Section -->
<div class="bg-white rounded-3xl border border-slate-200 shadow-sm overflow-hidden">
<div class="p-6 border-b border-slate-100 flex flex-col md:flex-row md:items-center justify-between gap-4">

View File

@ -11,8 +11,8 @@
{{-- <p class="text-xs text-slate-500 font-medium">Pengelolaan data masuk dari berbagai stasiun pemantauan.</p> --}}
</div>
<div class="flex items-center space-x-2">
@if(permission('is_create', $route.'.*','module',false) || permission('is_update', $route.'.*','module',false))
<a href="{{route($route.'.update')}}" class="p-2 border border-slate-200 rounded-xl hover:bg-slate-50 transition-colors flex items-center text-sm font-semibold text-slate-600">
@if(access('is_create', $route.'.*','module',false) || access('is_update', $route.'.*','module',false))
<a href="{{route($route.'.update')}}" class="p-2 rounded-xl bg-blue-500 transition-colors flex items-center text-sm font-semibold text-white">
<i data-lucide="plus" class="w-4 h-4 mr-2"></i> Tambah Data
</a>
@endif
@ -37,12 +37,12 @@
id="grid-data">
<thead class="bg-slate-100 border-b border-slate-100">
<tr class="">
<th class="text-[10px] border font-bold text-slate-900 text-center" data-width="10" data-field="action">#</th>
<th class="text-[10px] border font-bold text-slate-900 text-center" data-width="10" data-field="no">No</th>
<th class="text-[10px] border font-bold text-slate-900 text-center tengah" data-width="10" data-field="action">#</th>
<th class="text-[10px] border font-bold text-slate-900 text-center tengah" data-width="10" data-field="no">No</th>
<th class="text-[10px] border font-bold text-slate-900 text-center" data-field="instansi">Nama Instansi</th>
<th class="text-[10px] border font-bold text-slate-900 text-center" data-field="name">Nama Dataset</th>
<th class="text-[10px] border font-bold text-slate-900 text-center" data-field="template">Sumber Data Terkait</th>
<th class="text-[10px] border font-bold text-slate-900 text-center" data-field="status">Status</th>
<th class="text-[10px] border font-bold text-slate-900 text-center tengah" data-field="status">Status</th>
<th class="text-[10px] border font-bold text-slate-900 text-center" data-field="tahun">Tahun Sistem</th>
<th class="text-[10px] border font-bold text-slate-900 text-center" data-field="created_at">Tanggal Input</th>
</tr>

View File

@ -11,8 +11,8 @@
{{-- <p class="text-xs text-slate-500 font-medium">Pengelolaan data masuk dari berbagai stasiun pemantauan.</p> --}}
</div>
<div class="flex items-center space-x-2">
@if(permission('is_create', $route.'.*','module',false) || permission('is_update', $route.'.*','module',false))
<a href="{{route($route.'.update')}}" class="p-2 border border-slate-200 rounded-xl hover:bg-slate-50 transition-colors flex items-center text-sm font-semibold text-slate-600">
@if(access('is_create', $route.'.*','module',false) || access('is_update', $route.'.*','module',false))
<a href="{{route($route.'.update')}}" class="p-2 rounded-xl bg-blue-500 transition-colors flex items-center text-sm font-semibold text-white">
<i data-lucide="plus" class="w-4 h-4 mr-2"></i> Tambah Data
</a>
@endif
@ -36,13 +36,13 @@
id="grid-data">
<thead class="bg-slate-100 border-b border-slate-100">
<tr class="">
<th class="text-[10px] border font-bold text-slate-900 text-center" data-width="10" data-field="action">#</th>
<th class="text-[10px] border font-bold text-slate-900 text-center" data-width="10" data-field="no">No</th>
<th class="text-[10px] border font-bold text-slate-900 text-center tengah" data-width="10" data-field="action">#</th>
<th class="text-[10px] border font-bold text-slate-900 text-center tengah" data-width="10" data-field="no">No</th>
<th class="text-[10px] border font-bold text-slate-900 text-center" data-field="instansi">Nama Instansi</th>
<th class="text-[10px] border font-bold text-slate-900 text-center" data-field="name">Nama Dataset</th>
<th class="text-[10px] border font-bold text-slate-900 text-center" data-field="template">Sumber Data</th>
<th class="text-[10px] border font-bold text-slate-900 text-center" data-field="tahun">Tahun Sistem</th>
<th class="text-[10px] border font-bold text-slate-900 text-center" data-field="status">Status</th>
<th class="text-[10px] border font-bold text-slate-900 text-center tengah" data-field="status">Status</th>
<th class="text-[10px] border font-bold text-slate-900 text-center" data-field="created_at">Tanggal Input</th>
</tr>
</thead>