upadte
parent
b70ce911fc
commit
8874fb5a68
|
@ -57,7 +57,7 @@ class DatasetController extends Controller
|
||||||
public function grid(Request $request)
|
public function grid(Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$data = Dataset::all();
|
$data = Dataset::orderBy('DatasetId','DESC')->get();
|
||||||
// $data = User::with(['group'])->orderBy('id','DESC')->get();
|
// $data = User::with(['group'])->orderBy('id','DESC')->get();
|
||||||
$_data = [];
|
$_data = [];
|
||||||
|
|
||||||
|
@ -73,19 +73,31 @@ class DatasetController extends Controller
|
||||||
$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>';
|
$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){
|
||||||
// $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/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>';
|
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>';
|
||||||
|
}else{
|
||||||
|
$action .= '<a href="#" data-href="'.url('opendata/dataset/aktif/'.encode_id($row->DatasetId)).'" data-toggle="tooltip" title="Aktifkan Data" class="aktif_data btn btn-sm btn-block bg-success"><i class="ri-check-line text-white"></i></a>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$action .= '</div>';
|
$action .= '</div>';
|
||||||
}
|
}
|
||||||
|
$status = '';
|
||||||
|
if($row->status == 1){
|
||||||
|
$status = '<small class="p-1 w-full bg-success text-white rounded" title="Aktif"><i class="ri-check-line"></i></small>';
|
||||||
|
}else{
|
||||||
|
$status = '<small class="p-1 w-full bg-danger text-white rounded" title="Tidak Aktif"><i class="ri-close-line"></i></small>';
|
||||||
|
}
|
||||||
|
|
||||||
$_data[] = [
|
$_data[] = [
|
||||||
'no' => $key+1,
|
'no' => $key+1,
|
||||||
'id' => encode_id($row->id),
|
'id' => encode_id($row->id),
|
||||||
'name' => @$row->name,
|
'name' => @$row->name,
|
||||||
'publik' => @$row->publik,
|
'publik' => @$row->publik,
|
||||||
|
'tahun' => @$row->tahun,
|
||||||
'created_at' => date('d-m-Y H:i:s',strtotime(@$row->created_at)),
|
'created_at' => date('d-m-Y H:i:s',strtotime(@$row->created_at)),
|
||||||
'instansi' => @$row->instansi->name,
|
'instansi' => @$row->instansi->name,
|
||||||
'action' => @$action,
|
'action' => @$action,
|
||||||
|
'status' => @$status,
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -146,7 +158,7 @@ class DatasetController extends Controller
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for ($i = 1; $i < count($rows); $i++) {
|
for ($i = 5; $i < count($rows); $i++) {
|
||||||
$row = $rows[$i];
|
$row = $rows[$i];
|
||||||
|
|
||||||
// Skip baris kosong
|
// Skip baris kosong
|
||||||
|
@ -192,16 +204,18 @@ class DatasetController extends Controller
|
||||||
$insert->deskripsi = $request->deskripsi;
|
$insert->deskripsi = $request->deskripsi;
|
||||||
$insert->save();
|
$insert->save();
|
||||||
}else{
|
}else{
|
||||||
|
// dd($request->all());
|
||||||
Validator::make($request->all(), [
|
Validator::make($request->all(), [
|
||||||
'name' => 'required',
|
// 'name' => 'required',
|
||||||
'instansi_id' => 'required',
|
// 'instansi_id' => 'required',
|
||||||
'template_id' => 'required',
|
// 'template_id' => 'required',
|
||||||
'template_default' => 'required',
|
// 'template_default' => 'required',
|
||||||
'publik' => 'required',
|
// 'publik' => 'required',
|
||||||
'tags' => 'required',
|
// 'tags' => 'required',
|
||||||
'file' => 'required|file|mimes:xlsx,xls',
|
// 'file' => 'required|file',
|
||||||
'topik' => 'required',
|
// 'topik' => 'required',
|
||||||
])->validate();
|
])->validate();
|
||||||
|
|
||||||
|
|
||||||
$insert = new Dataset;
|
$insert = new Dataset;
|
||||||
$insert->instansi_id = decode_id($request->instansi_id);
|
$insert->instansi_id = decode_id($request->instansi_id);
|
||||||
|
@ -299,4 +313,23 @@ class DatasetController extends Controller
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function delete($id)
|
||||||
|
{
|
||||||
|
$keyId = decode_id($id);
|
||||||
|
$dataset = Dataset::find($keyId);
|
||||||
|
$dataset->status = 0;
|
||||||
|
$dataset->save();
|
||||||
|
|
||||||
|
return response()->json(['success' => true,'message' => 'Berhasil update data','type' => 'success']);
|
||||||
|
}
|
||||||
|
public function aktif($id)
|
||||||
|
{
|
||||||
|
$keyId = decode_id($id);
|
||||||
|
$dataset = Dataset::find($keyId);
|
||||||
|
$dataset->status = 1;
|
||||||
|
$dataset->save();
|
||||||
|
|
||||||
|
return response()->json(['success' => true,'message' => 'Berhasil update data','type' => 'success']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 279 KiB |
|
@ -9,7 +9,9 @@
|
||||||
<meta content="coderthemes" name="author">
|
<meta content="coderthemes" name="author">
|
||||||
|
|
||||||
<!-- App favicon -->
|
<!-- App favicon -->
|
||||||
<link rel="shortcut icon" href="https://lingkunganhidup.jakarta.go.id/dist/images/logo/logo-dlh-big.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="https://banksampah.jakarta.go.id/images/logo-dinas.ico">
|
||||||
|
<link rel="icon" type="image/png" sizes="32x32" href="https://banksampah.jakarta.go.id/images/logo-dinas.ico">
|
||||||
|
<link rel="mask-icon" href="https://banksampah.jakarta.go.id/images/logo-dinas.ico" color="#5bbad5">
|
||||||
|
|
||||||
<!--Swiper slider css-->
|
<!--Swiper slider css-->
|
||||||
<link href="{{asset('assets/libs/swiper/swiper-bundle.min.css')}}" rel="stylesheet" type="text/css">
|
<link href="{{asset('assets/libs/swiper/swiper-bundle.min.css')}}" rel="stylesheet" type="text/css">
|
||||||
|
@ -29,8 +31,8 @@
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
<div class="text-center lg:text-start">
|
<div class="text-center lg:text-start">
|
||||||
<a href="{{url('login')}}" class="flex justify-center lg:justify-center">
|
<a href="{{url('login')}}" class="flex justify-center lg:justify-center">
|
||||||
<img src="https://lingkunganhidup.jakarta.go.id/dist/images/logo/logo-dlh-big.png" alt="logo" class="hidden dark:block">
|
<img width="80" src="{{asset('assets/logo-dlh.png')}}" alt="logo" class="hidden dark:block">
|
||||||
<img src="https://lingkunganhidup.jakarta.go.id/dist/images/logo/logo-dlh-big.png" alt="logo" class="block dark:hidden">
|
<img width="80" src="{{asset('assets/logo-dlh.png')}}" alt="logo" class="block dark:hidden">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-5">
|
<div class="mb-5">
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<meta content="coderthemes" name="author">
|
<meta content="coderthemes" name="author">
|
||||||
|
|
||||||
<!-- App favicon -->
|
<!-- App favicon -->
|
||||||
<link rel="shortcut icon" href="https://lingkunganhidup.jakarta.go.id/dist/images/logo/logo-dlh-big.png">
|
<link rel="shortcut icon" href="{{asset('assets/logo-dlh.png')}}">
|
||||||
|
|
||||||
<!-- App css -->
|
<!-- App css -->
|
||||||
<link href="{{asset('assets/css/app.min.css')}}" rel="stylesheet" type="text/css">
|
<link href="{{asset('assets/css/app.min.css')}}" rel="stylesheet" type="text/css">
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
<div class="p-9">
|
<div class="p-9">
|
||||||
<div class="text-center mx-auto w-3/4">
|
<div class="text-center mx-auto w-3/4">
|
||||||
<div class="flex justify-center">
|
<div class="flex justify-center">
|
||||||
<img src="https://lingkunganhidup.jakarta.go.id/dist/images/logo/logo-dlh-big.png" alt="logo" width="50">
|
<img src="{{asset('assets/logo-dlh.png')}}" alt="logo" width="50">
|
||||||
</div>
|
</div>
|
||||||
<h4 class="text-dark/70 text-center text-lg font-bold dark:text-light/80 mb-2">Register</h4>
|
<h4 class="text-dark/70 text-center text-lg font-bold dark:text-light/80 mb-2">Register</h4>
|
||||||
<!-- <p class="text-gray-400 mb-9"></p> -->
|
<!-- <p class="text-gray-400 mb-9"></p> -->
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<a href="{{url('/')}}">
|
<a href="{{url('/')}}">
|
||||||
<div class="flex gap-3 p-4 items-center">
|
<div class="flex gap-3 p-4 items-center">
|
||||||
<div>
|
<div>
|
||||||
<img src="https://lingkunganhidup.jakarta.go.id/dist/images/logo/logo-dlh-big.png" class="" alt="Light logo" width="35">
|
<img src="{{asset('assets/logo-dlh.png')}}" class="" alt="Light logo" width="35">
|
||||||
</div>
|
</div>
|
||||||
<div class="flex text-menu flex-col gap-1">
|
<div class="flex text-menu flex-col gap-1">
|
||||||
<h6 class="text-white text-lg bold">DIKPLHD</h6>
|
<h6 class="text-white text-lg bold">DIKPLHD</h6>
|
||||||
|
|
|
@ -88,7 +88,7 @@
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<div class="flex flex-row gap-3">
|
<div class="flex flex-row gap-3">
|
||||||
<div>
|
<div>
|
||||||
<img src="https://lingkunganhidup.jakarta.go.id/dist/images/logo/logo-dlh-big.png" width="80" alt="">
|
<img src="{{asset('assets/logo-dlh.png')}}" width="80" alt="">
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-3">
|
<div class="flex flex-col gap-3">
|
||||||
<h4 class="font-bold text-md">{{$dataSet->name}}</h4>
|
<h4 class="font-bold text-md">{{$dataSet->name}}</h4>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<title>DIKPLHD | Dinas Lingkungan Hidup</title>
|
<title>DIKPLHD | Dinas Lingkungan Hidup</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<link rel="shortcut icon" href="https://lingkunganhidup.jakarta.go.id/dist/images/logo/logo-dlh-big.png">
|
<link rel="shortcut icon" href="{{asset('assets/logo-dlh.png')}}">
|
||||||
<link href="{{asset('assets/libs/jsvectormap/css/jsvectormap.min.css')}}" rel="stylesheet" type="text/css">
|
<link href="{{asset('assets/libs/jsvectormap/css/jsvectormap.min.css')}}" rel="stylesheet" type="text/css">
|
||||||
<link href="{{asset('assets/css/app.min.css')}}" rel="stylesheet" type="text/css">
|
<link href="{{asset('assets/css/app.min.css')}}" rel="stylesheet" type="text/css">
|
||||||
<link href="{{asset('assets/css/icons.min.css')}}" rel="stylesheet" type="text/css">
|
<link href="{{asset('assets/css/icons.min.css')}}" rel="stylesheet" type="text/css">
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
<div class="flex justify-between items-center px-5 py-5">
|
<div class="flex justify-between items-center px-5 py-5">
|
||||||
<div class="flex flex-row items-center gap-3">
|
<div class="flex flex-row items-center gap-3">
|
||||||
<div class="p-1 bg-white rounded-full">
|
<div class="p-1 bg-white rounded-full">
|
||||||
<img src="https://lingkunganhidup.jakarta.go.id/dist/images/logo/logo-dlh-big.png" width="40" alt="">
|
<img src="{{asset('assets/logo-dlh.png')}}" width="40" alt="">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h5 class="text-white bold text-2xl">DIKPLHD</h5>
|
<h5 class="text-white bold text-2xl">DIKPLHD</h5>
|
||||||
|
|
|
@ -6,7 +6,10 @@
|
||||||
<title>{{@$title}} | DIKPLHD</title>
|
<title>{{@$title}} | DIKPLHD</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<link rel="shortcut icon" href="https://lingkunganhidup.jakarta.go.id/dist/images/logo/logo-dlh-big.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="https://banksampah.jakarta.go.id/images/logo-dinas.ico">
|
||||||
|
<link rel="icon" type="image/png" sizes="32x32" href="https://banksampah.jakarta.go.id/images/logo-dinas.ico">
|
||||||
|
<link rel="mask-icon" href="https://banksampah.jakarta.go.id/images/logo-dinas.ico" color="#5bbad5">
|
||||||
|
|
||||||
<link href="{{asset('assets/libs/jsvectormap/css/jsvectormap.min.css')}}" rel="stylesheet" type="text/css">
|
<link href="{{asset('assets/libs/jsvectormap/css/jsvectormap.min.css')}}" rel="stylesheet" type="text/css">
|
||||||
<link href="{{asset('assets/css/app.min.css')}}" rel="stylesheet" type="text/css">
|
<link href="{{asset('assets/css/app.min.css')}}" rel="stylesheet" type="text/css">
|
||||||
<link href="{{asset('assets/css/icons.min.css')}}" rel="stylesheet" type="text/css">
|
<link href="{{asset('assets/css/icons.min.css')}}" rel="stylesheet" type="text/css">
|
||||||
|
|
|
@ -134,6 +134,10 @@
|
||||||
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
|
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
|
||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="mb-3">Data Tahun</label>
|
||||||
|
<input type="text" class="form-input bg-secondary/50 text-white" value="{{date('Y')}}" disabled>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-6">
|
<div class="p-6">
|
||||||
<a href="{{route($route.'.index')}}" class="btn bg-danger text-white"><i class="ri-close-line"></i> Batal</a>
|
<a href="{{route($route.'.index')}}" class="btn bg-danger text-white"><i class="ri-close-line"></i> Batal</a>
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
<th class="gridjs-td gridjs-th text-sm text-gray-500" data-width="10" data-field="no">No</th>
|
<th class="gridjs-td gridjs-th text-sm text-gray-500" data-width="10" data-field="no">No</th>
|
||||||
<th class="gridjs-td gridjs-th text-sm text-gray-500" data-field="instansi">Nama Instansi</th>
|
<th class="gridjs-td gridjs-th text-sm text-gray-500" data-field="instansi">Nama Instansi</th>
|
||||||
<th class="gridjs-td gridjs-th text-sm text-gray-500" data-field="name">Nama Dataset</th>
|
<th class="gridjs-td gridjs-th text-sm text-gray-500" data-field="name">Nama Dataset</th>
|
||||||
|
<th class="gridjs-td gridjs-th text-sm text-gray-500" data-field="tahun">Tahun</th>
|
||||||
|
<th class="gridjs-td gridjs-th text-sm text-center text-gray-500" data-field="status">Status</th>
|
||||||
<th class="gridjs-td gridjs-th text-sm text-gray-500" data-field="created_at">Tanggal Dibuat</th>
|
<th class="gridjs-td gridjs-th text-sm text-gray-500" data-field="created_at">Tanggal Dibuat</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -85,5 +87,45 @@ var id = $(this).attr('data-id');
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#grid-data").on("click", ".aktif_data", function() {
|
||||||
|
var base_url = $(this).attr('data-href');
|
||||||
|
var id = $(this).attr('data-id');
|
||||||
|
swal({
|
||||||
|
title: "Aktifkan Data!",
|
||||||
|
text: "Apa anda yakin ingin aktifkan data ini ?",
|
||||||
|
type: "warning",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#2dad62",
|
||||||
|
confirmButtonText: "Ya Aktifkan Sekarang",
|
||||||
|
cancelButtonText: "Tidak",
|
||||||
|
closeOnConfirm: true,
|
||||||
|
closeOnCancel: true
|
||||||
|
},
|
||||||
|
function(isConfirm) {
|
||||||
|
if(isConfirm){
|
||||||
|
|
||||||
|
request = $.ajax({
|
||||||
|
url: base_url,
|
||||||
|
type: "GET",
|
||||||
|
});
|
||||||
|
|
||||||
|
// Callback handler that will be called on success
|
||||||
|
request.done(function(response, textStatus, jqXHR){
|
||||||
|
console.log(response);
|
||||||
|
toastr.success("Berhasil Mengaktifkan Data", 'Berhasil!', {positionClass: 'toast-bottom-right', containerId: 'toast-bottom-right'});
|
||||||
|
$('#grid-data').bootstrapTable('refresh');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Callback handler that will be called on failure
|
||||||
|
request.fail(function (jqXHR, textStatus, errorThrown){
|
||||||
|
toastr.error(
|
||||||
|
"Gagal "+textStatus, errorThrown
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
|
@ -67,7 +67,7 @@
|
||||||
<div class="card p-6 border w-full">
|
<div class="card p-6 border w-full">
|
||||||
<div class="flex flex-row items-center gap-6">
|
<div class="flex flex-row items-center gap-6">
|
||||||
<div>
|
<div>
|
||||||
<img src="https://lingkunganhidup.jakarta.go.id/dist/images/logo/logo-dlh-big.png" width="80" alt="">
|
<img src="{{asset('assets/logo-dlh.png')}}" width="80" alt="">
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-3">
|
<div class="flex flex-col gap-3">
|
||||||
<a href="">
|
<a href="">
|
||||||
|
|
|
@ -19,6 +19,8 @@ Route::name('opendata.')->prefix('opendata')->group(function () {
|
||||||
Route::get('gridDetail',[DatasetController::class,'gridDetail'])->name('gridDetail');
|
Route::get('gridDetail',[DatasetController::class,'gridDetail'])->name('gridDetail');
|
||||||
Route::get('update/{id?}',[DatasetController::class,'update'])->name('update');
|
Route::get('update/{id?}',[DatasetController::class,'update'])->name('update');
|
||||||
Route::get('view/{id?}',[DatasetController::class,'view'])->name('view');
|
Route::get('view/{id?}',[DatasetController::class,'view'])->name('view');
|
||||||
|
Route::get('delete/{id?}',[DatasetController::class,'delete'])->name('delete');
|
||||||
|
Route::get('aktif/{id?}',[DatasetController::class,'aktif'])->name('aktif');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue