update
							parent
							
								
									3fb08baa89
								
							
						
					
					
						commit
						210ea1d40b
					
				|  | @ -29,14 +29,14 @@ class HomeController extends Controller | |||
|     public function dashboard() | ||||
|     { | ||||
|         $data['title']   = 'Dashboard'; | ||||
|         if(session('group_id') == 1){ | ||||
|         if((session('group_id') == 1) || (session('group_id') == 9)){ | ||||
|             $data['dataset'] = Dataset::orderBy('DatasetId','DESC')->limit(10)->get(); | ||||
|         }else{ | ||||
|             $data['dataset'] = Dataset::orderBy('DatasetId','DESC')->whereIn('instansi_id',[auth()->user()->ms_instansi_id])->limit(10)->get(); | ||||
|         } | ||||
|         // $data['dataset'] = Dataset::orderBy('DatasetId','DESC')->limit(10)->get();
 | ||||
|         $data['group']          = Group::where('MsGroupId','!=',1)->where('name','!=','Balai')->get(); | ||||
|         if(session('group_id') == 1){ | ||||
|         if((session('group_id') == 1) || (session('group_id') == 9)){ | ||||
|             $data['resource']       = Template::with(['dataset'])->where('show_dashboard',1)->get(); | ||||
|         }else{ | ||||
|             $data['resource']       = Template::with(['dataset'])->whereHas('dataset',function($query){ | ||||
|  | @ -60,7 +60,7 @@ class HomeController extends Controller | |||
| 
 | ||||
|     public function grid(Request $request) | ||||
|     { | ||||
|         if(session('group_id') == 1){ | ||||
|         if((session('group_id') == 1) || (session('group_id') == 9)){ | ||||
|             $data = Dataset::orderBy('DatasetId','DESC')->limit(10)->get(); | ||||
|         }else{ | ||||
|             $data = Dataset::orderBy('DatasetId','DESC')->limit(10)->whereIn('created_by',[auth()->user()->id,1])->get(); | ||||
|  | @ -103,7 +103,7 @@ class HomeController extends Controller | |||
| 
 | ||||
|     public function gridResource(Request $request) | ||||
|     { | ||||
|         if(session('group_id') == 1){ | ||||
|         if((session('group_id') == 1) || (session('group_id') == 9)){ | ||||
|             $data = Template::with(['dataset'])->where('show_dashboard',1)->get(); | ||||
|         }else{ | ||||
|             $data = Template::with(['dataset'])->whereHas('dataset',function($query){ | ||||
|  | @ -116,7 +116,7 @@ class HomeController extends Controller | |||
|         foreach ($data as $key => $row) { | ||||
| 
 | ||||
|                 $action = ''; | ||||
|                 if(session('group_id') == 1){ | ||||
|                 if((session('group_id') == 1) || (session('group_id') == 9)){ | ||||
|                     $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(auth()->user()->ms_instansi_id).'/'.encode_id($row->MsTemplateId)).'" class="btn w-full bg-success text-white">Lihat Data</a>'; | ||||
|  | @ -139,7 +139,7 @@ class HomeController extends Controller | |||
| 
 | ||||
|     public function datasetGrid($alias,Request $request) | ||||
|     { | ||||
|         if(session('group_id') == 1){ | ||||
|         if((session('group_id') == 1) || (session('group_id') == 9)){ | ||||
|             $data = Dataset::whereHas('instansi',function($query) use ($alias){ | ||||
|                 $query->where('parent','ilike','%'.$alias.'%'); | ||||
|             })->orderBy('DatasetId','DESC')->get(); | ||||
|  |  | |||
|  | @ -50,7 +50,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-3 justify-center items-center flex-row">'; | ||||
|                 $action .= '<a href="'.url('management/user/update/'.encode_id($row->id)).'" 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){ | ||||
|                 if((session('group_id') == 1) || (session('group_id') == 9)){ | ||||
|                     $action .= '<a href="#" data-href="'.url('management/user/forcelogin/'.encode_id($row->id)).'" data-toggle="tooltip" title="Force Login" class="forcelogin btn btn-sm btn-block bg-success"><i class="ri-user-2-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 btn btn-sm btn-block bg-danger"><i class="ri-delete-bin-line text-white"></i></a>'; | ||||
|                 } | ||||
|  |  | |||
|  | @ -59,7 +59,7 @@ class DatasetController extends Controller | |||
| 
 | ||||
|     public function grid(Request $request) | ||||
|     { | ||||
|         if(session('group_id') == 1){ | ||||
|         if((session('group_id') == 1) || (session('group_id') == 9)){ | ||||
|             $data = Dataset::with(['template'])->orderBy('DatasetId','DESC')->get(); | ||||
|         }else{ | ||||
|             $data = Dataset::with(['template'])->orderBy('DatasetId','DESC')->whereIn('instansi_id',[auth()->user()->ms_instansi_id])->get(); | ||||
|  | @ -79,7 +79,7 @@ class DatasetController extends Controller | |||
|                     $action .= '<a href="'.url('opendata/dataset/update/'.encode_id($row->DatasetId)).'" data-toggle="tooltip" title="Ubah Data" class="btn btn-sm btn-block bg-primary"><i class="ri-pencil-line text-white"></i></a>'; | ||||
|                 } | ||||
|                 $action .= '<a href="'.url('opendata/dataset/view/'.encode_id($row->DatasetId)).'" data-toggle="tooltip" title="Lihat Data" class="btn btn-sm btn-block bg-info"><i class="ri-eye-line text-white"></i></a>'; | ||||
|                 if(session('group_id') == 1){ | ||||
|                 if((session('group_id') == 1) || (session('group_id') == 9)){ | ||||
|                     // $action .= '<a href="#" data-href="'.url('management/user/forcelogin/'.encode_id($row->id)).'" data-toggle="tooltip" title="Force Login" class="forcelogin btn btn-sm btn-block bg-success"><i class="ri-user-2-line text-white"></i></a>';
 | ||||
|                     if($row->status == 1){ | ||||
|                         $action .= '<a href="#" data-href="'.url('opendata/dataset/delete/'.encode_id($row->DatasetId)).'" 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>'; | ||||
|  |  | |||
|  | @ -56,7 +56,7 @@ class DatasetTambahanController extends Controller | |||
| 
 | ||||
|     public function grid(Request $request) | ||||
|     { | ||||
|         if(session('group_id') == 1){ | ||||
|         if((session('group_id') == 1) || (session('group_id') == 9)){ | ||||
|             $data = DatasetTambahan::orderBy('DatasetTambahanId','DESC')->get(); | ||||
|         }else{ | ||||
|             $data = DatasetTambahan::orderBy('DatasetTambahanId','DESC')->whereIn('instansi_id',[auth()->user()->ms_instansi_id])->get(); | ||||
|  | @ -76,7 +76,7 @@ class DatasetTambahanController extends Controller | |||
|                     $action .= '<a href="'.url('opendata/dataset-tambahan/update/'.encode_id($row->DatasetTambahanId)).'" data-toggle="tooltip" title="Ubah Data" class="btn btn-sm btn-block bg-primary"><i class="ri-pencil-line text-white"></i></a>'; | ||||
|                 } | ||||
|                 $action .= '<a href="'.url('opendata/dataset-tambahan/view/'.encode_id($row->DatasetTambahanId)).'" data-toggle="tooltip" title="Lihat Data" class="btn btn-sm btn-block bg-info"><i class="ri-eye-line text-white"></i></a>'; | ||||
|                 if(session('group_id') == 1){ | ||||
|                 if((session('group_id') == 1) || (session('group_id') == 9)){ | ||||
|                     // $action .= '<a href="#" data-href="'.url('management/user/forcelogin/'.encode_id($row->id)).'" data-toggle="tooltip" title="Force Login" class="forcelogin btn btn-sm btn-block 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 btn btn-sm btn-block bg-danger"><i class="ri-delete-bin-line text-white"></i></a>'; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue