chore: add issue count column in location and sub location
This commit is contained in:
parent
e4fd3ee809
commit
8de64a00dd
@ -209,16 +209,26 @@ public function location(Request $request){
|
||||
$subLocationsCount = $data->subLocations->count();
|
||||
|
||||
if($subLocationsCount > 0){
|
||||
return $subLocationsCount. ' [<a href="'.route('dashboard.sub.locations.index', ['location' => $data->slug]).'">Lihat</a>]';
|
||||
return $subLocationsCount. ' [<a href="'.route('dashboard.sub.locations.index', ['location' => encrypt_id($data->id)]).'">Lihat</a>]';
|
||||
}else{
|
||||
return $subLocationsCount;
|
||||
}
|
||||
|
||||
})
|
||||
->addColumn('issues', function ($data) {
|
||||
$issueCount = $data->issues->count();
|
||||
|
||||
if($issueCount > 0){
|
||||
return $issueCount. ' [<a href="'.route('dashboard.issue.managements.index', ['location' => encrypt_id($data->id)]).'">Lihat</a>]';
|
||||
}else{
|
||||
return $issueCount;
|
||||
}
|
||||
|
||||
})
|
||||
->addColumn('action', function ($data) {
|
||||
$showUrl = route('dashboard.locations.show', ['id' => encrypt_id($data->id)]);
|
||||
|
||||
$addSubLocationUrl = route('dashboard.sub.locations.create', ['location' => $data->slug]);
|
||||
$addSubLocationUrl = route('dashboard.sub.locations.create', ['location' => encrypt_id($data->id)]);
|
||||
|
||||
$editUrl = route('dashboard.locations.edit', ['id' => encrypt_id($data->id)]);
|
||||
|
||||
@ -250,7 +260,7 @@ public function location(Request $request){
|
||||
return $dropdown;
|
||||
})
|
||||
|
||||
->rawColumns(['sub_locations', 'status', 'action'])
|
||||
->rawColumns(['sub_locations', 'issues', 'status', 'action'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
@ -264,8 +274,7 @@ public function subLocation(Request $request){
|
||||
$locationParam = $request->input('location', null);
|
||||
|
||||
if($locationParam){
|
||||
$location = Location::where('slug', '=', $locationParam)->first();
|
||||
$data = SubLocation::with(['location'])->where('location_id', '=', $location->id)->get();
|
||||
$data = SubLocation::with(['location'])->where('location_id', '=', decrypt_id($locationParam))->get();
|
||||
}else{
|
||||
$data = SubLocation::with(['location'])->get();
|
||||
}
|
||||
@ -282,6 +291,16 @@ public function subLocation(Request $request){
|
||||
return '<span class="badge bg-primary" style="display:inline-block;font-size:0.8rem;">Aktif</span>';
|
||||
}
|
||||
})
|
||||
->addColumn('issues', function ($data) {
|
||||
$issueCount = $data->issues->count();
|
||||
|
||||
if($issueCount > 0){
|
||||
return $issueCount. ' [<a href="'.route('dashboard.issue.managements.index', ['sub_location' => encrypt_id($data->id)]).'">Lihat</a>]';
|
||||
}else{
|
||||
return $issueCount;
|
||||
}
|
||||
|
||||
})
|
||||
->addColumn('action', function ($data) {
|
||||
$showUrl = route('dashboard.sub.locations.show', ['id' => encrypt_id($data->id)]);
|
||||
|
||||
@ -311,7 +330,7 @@ public function subLocation(Request $request){
|
||||
return $dropdown;
|
||||
})
|
||||
|
||||
->rawColumns(['status', 'action'])
|
||||
->rawColumns(['issues', 'status', 'action'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
@ -1685,6 +1704,8 @@ public function issueManagement(Request $request){
|
||||
|
||||
$classificationParam = $request->input('classification', null);
|
||||
$subClassificationParam = $request->input('sub_classification', null);
|
||||
$locationParam = $request->input('location', null);
|
||||
$subLocationParam = $request->input('sub_location', null);
|
||||
|
||||
if($classificationParam){
|
||||
$data = IssueManagement::with(['location', 'subLocation', 'classification', 'subClassification', 'enhancer', 'governmentAgencies'])->where('classification_id', decrypt_id($classificationParam))->get();
|
||||
@ -1692,6 +1713,12 @@ public function issueManagement(Request $request){
|
||||
}else if($subClassificationParam){
|
||||
$data = IssueManagement::with(['location', 'subLocation', 'classification', 'subClassification', 'enhancer', 'governmentAgencies'])->where('sub_classification_id', decrypt_id($subClassificationParam))->get();
|
||||
|
||||
}else if($locationParam){
|
||||
$data = IssueManagement::with(['location', 'subLocation', 'classification', 'subClassification', 'enhancer', 'governmentAgencies'])->where('location_id', decrypt_id($locationParam))->get();
|
||||
|
||||
}else if($subLocationParam){
|
||||
$data = IssueManagement::with(['location', 'subLocation', 'classification', 'subClassification', 'enhancer', 'governmentAgencies'])->where('sub_location_id', decrypt_id($subLocationParam))->get();
|
||||
|
||||
}else{
|
||||
$data = IssueManagement::with(['location', 'subLocation', 'classification', 'subClassification', 'enhancer', 'governmentAgencies'])->get();
|
||||
}
|
||||
|
||||
@ -25,13 +25,12 @@ public function create(){
|
||||
|
||||
public function store(LocationRequest $request){
|
||||
$validatedData = $request->validated();
|
||||
$validatedData['slug'] = Str::slug($validatedData['name']);
|
||||
$validatedData['enhancer_id'] = Auth::id();
|
||||
|
||||
$createdLocation = Location::create($validatedData);
|
||||
|
||||
if($createdLocation){
|
||||
return redirect()->back()->with('success-status', 'Berhasil menambahkan lokus.');
|
||||
return redirect()->route('dashboard.locations.index')->with('success-status', 'Berhasil menambahkan lokus.');
|
||||
}else{
|
||||
return redirect()->back()->with('failed-status', 'Gagal menambahkan lokus.');
|
||||
}
|
||||
@ -48,7 +47,6 @@ public function edit($id){
|
||||
|
||||
public function update(LocationRequest $request, $id){
|
||||
$validatedData = $request->validated();
|
||||
$validatedData['slug'] = Str::slug($validatedData['name']);
|
||||
$validatedData['enhancer_id'] = Auth::id();
|
||||
|
||||
$location = Location::findOrFail(decrypt_id($id));
|
||||
|
||||
@ -30,8 +30,8 @@ public function create(Request $request){
|
||||
];
|
||||
|
||||
if($request->has('classification')){
|
||||
$classificationId = $request->query('classification');
|
||||
$viewData['classification'] = Classification::where('id', '=', decrypt_id($classificationId))->first();
|
||||
$classificationId = decrypt_id($request->query('classification'));
|
||||
$viewData['classification'] = Classification::findOrFail($classificationId);
|
||||
$viewData['fromClassification'] = true;
|
||||
}else{
|
||||
$viewData['classifications'] = Classification::all();
|
||||
|
||||
@ -30,8 +30,8 @@ public function create(Request $request){
|
||||
];
|
||||
|
||||
if($request->has('location')){
|
||||
$locationSlug = $request->query('location');
|
||||
$viewData['location'] = Location::where('slug', '=', $locationSlug)->first();
|
||||
$locationId = decrypt_id($request->query('location'));
|
||||
$viewData['location'] = Location::findOrFail($locationId);
|
||||
$viewData['fromLocation'] = true;
|
||||
}else{
|
||||
$viewData['locations'] = Location::all();
|
||||
@ -42,13 +42,12 @@ public function create(Request $request){
|
||||
|
||||
public function store(SubLocationRequest $request){
|
||||
$validatedData = $request->validated();
|
||||
$validatedData['slug'] = Str::slug($validatedData['name']);
|
||||
$validatedData['enhancer_id'] = Auth::id();
|
||||
|
||||
$createdSubLocation = SubLocation::create($validatedData);
|
||||
|
||||
if($createdSubLocation){
|
||||
return redirect()->back()->with('success-status', 'Berhasil menambahkan sub lokus.');
|
||||
return redirect()->route('dashboard.sub.locations.index')->with('success-status', 'Berhasil menambahkan sub lokus.');
|
||||
}else{
|
||||
return redirect()->back()->with('failed-status', 'Gagal menambahkan sub lokus.');
|
||||
}
|
||||
@ -66,7 +65,6 @@ public function edit($id){
|
||||
|
||||
public function update(SubLocationRequest $request, $id){
|
||||
$validatedData = $request->validated();
|
||||
$validatedData['slug'] = Str::slug($validatedData['name']);
|
||||
$validatedData['enhancer_id'] = Auth::id();
|
||||
|
||||
$subLocation = SubLocation::findOrFail(decrypt_id($id));
|
||||
|
||||
@ -18,4 +18,8 @@ class Location extends Model
|
||||
public function subLocations(){
|
||||
return $this->hasMany(SubLocation::class, 'location_id', 'id');
|
||||
}
|
||||
|
||||
public function issues(){
|
||||
return $this->hasMany(IssueManagement::class, 'location_id', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,4 +19,8 @@ class SubLocation extends Model
|
||||
public function location(){
|
||||
return $this->belongsTo(Location::class, 'location_id', 'id');
|
||||
}
|
||||
|
||||
public function issues(){
|
||||
return $this->hasMany(IssueManagement::class, 'sub_location_id', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,14 +12,14 @@
|
||||
<div class="card-head">
|
||||
<h5 class="card-title">{{$title}}</h5>
|
||||
</div>
|
||||
<form action="{{route('dashboard.locations.store')}}" method="post">
|
||||
<form action="{{route('dashboard.locations.store')}}" method="post" id="myForm">
|
||||
@csrf
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="name">Nama Lokasi<span class="required-input">*</span></label>
|
||||
<label class="form-label" for="name">Nama Lokus<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="text" class="form-control @error('name') border-danger @enderror" id="name" name="name" placeholder="Masukan nama lokasi" value="{{old('name')}}">
|
||||
<input type="text" class="form-control @error('name') border-danger @enderror" id="name" name="name" placeholder="Masukan nama lokus" value="{{old('name')}}">
|
||||
</div>
|
||||
@error('name')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@ -49,7 +49,7 @@
|
||||
<hr>
|
||||
<div class="form-group d-flex justify-content-end">
|
||||
<a href="{{route('dashboard.locations.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<button type="submit" class="btn btn-md btn-primary">Tambahkan</button>
|
||||
<button type="button" class="btn btn-md btn-primary" id="submitButton">Tambahkan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -12,15 +12,15 @@
|
||||
<div class="card-head">
|
||||
<h5 class="card-title">{{$title}}</h5>
|
||||
</div>
|
||||
<form action="{{route('dashboard.locations.update', ['id' => encrypt_id($location->id)])}}" method="post">
|
||||
<form action="{{route('dashboard.locations.update', ['id' => encrypt_id($location->id)])}}" method="post" id="myForm">
|
||||
@csrf
|
||||
@method('put')
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="name">Nama Klasifikasi<span class="required-input">*</span></label>
|
||||
<label class="form-label" for="name">Nama Lokus<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="text" class="form-control @error('name') border-danger @enderror" id="name" name="name" placeholder="Masukan nama klasifikasi" value="{{ $location->name}}">
|
||||
<input type="text" class="form-control @error('name') border-danger @enderror" id="name" name="name" placeholder="Masukan nama lokus" value="{{ $location->name}}">
|
||||
</div>
|
||||
@error('name')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@ -49,8 +49,12 @@
|
||||
<div class="col-12">
|
||||
<hr>
|
||||
<div class="form-group d-flex justify-content-end">
|
||||
@if (request()->query('show'))
|
||||
<a href="{{route('dashboard.locations.show', ['id' => encrypt_id($location->id)])}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
@else
|
||||
<a href="{{route('dashboard.locations.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<button type="submit" class="btn btn-md btn-primary">Simpan</button>
|
||||
@endif
|
||||
<button type="button" class="btn btn-md btn-primary" id="submitButton">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -44,11 +44,12 @@
|
||||
<table class="table table-striped table-bordered nowrap" id="locationsTable" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10% !important;">No</th>
|
||||
<th>No</th>
|
||||
<th>Nama</th>
|
||||
<th style="width: 13% !important;">Status</th>
|
||||
<th style="width: 17% !important;">Sub Lokasi</th>
|
||||
<th style="width: 10% !important;"></th>
|
||||
<th>Status</th>
|
||||
<th>Sub Lokasi</th>
|
||||
<th>Isu</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
@ -7,49 +7,90 @@
|
||||
<div class="nk-content-inner">
|
||||
<div class="nk-content-body">
|
||||
<div class="nk-block nk-block-lg">
|
||||
<div class="card card-bordered card-preview">
|
||||
<div class="card-inner">
|
||||
<div class="card-head">
|
||||
<h5 class="card-title">{{$title}}</h5>
|
||||
</div>
|
||||
<form action="#" method="post">
|
||||
@csrf
|
||||
@method('put')
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="name">Nama Klasifikasi</label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="text" class="form-control @error('name') border-danger @enderror" id="name" name="name" placeholder="Masukan nama klasifikasi" value="{{ $location->name}}" readonly>
|
||||
<div class="card">
|
||||
<div class="card-aside-wrap">
|
||||
<div class="card-content">
|
||||
<ul class="nav nav-tabs nav-tabs-mb-icon nav-tabs-card">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-primary" href="#"><em class="icon ni ni-info"></em><span>Detail Lokus</span></a>
|
||||
</li>
|
||||
</ul><!-- .nav-tabs -->
|
||||
<div class="card-inner">
|
||||
<div class="nk-block">
|
||||
{{-- <div class="nk-block-head">
|
||||
<h5 class="title">Personal Information</h5>
|
||||
<p>Basic info, like your name and address, that you use on Nio Platform.</p>
|
||||
</div> --}}
|
||||
<div class="profile-ud-list">
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Nama Lokasi</span>
|
||||
<span class="profile-ud-value">{{$location->name}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="status">Status</label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="text" class="form-control @error('status') border-danger @enderror" id="status" name="status" placeholder="Status klasifikasi" value="{{ $location->status == '1' ? 'Aktif' : 'Nonaktif'}}" readonly>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Status</span>
|
||||
@switch($location->status)
|
||||
@case(0)
|
||||
<span class="profile-ud-value"><span class="badge bg-warning">Nonaktif</span></span>
|
||||
@break
|
||||
@case(1)
|
||||
<span class="profile-ud-value"><span class="badge bg-success">Aktif</span></span>
|
||||
@break
|
||||
@default
|
||||
<span class="profile-ud-value"><span class="badge bg-secondary">Tidak Diketahui</span></span>
|
||||
@endswitch
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="phone-no-1">Deskripsi</label>
|
||||
<div class="form-control-wrap">
|
||||
<div class="description-content">{!! $location->description !!}</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Sub Lokus</span>
|
||||
<span class="profile-ud-value">
|
||||
@if ($location->subLocations->count() > 0)
|
||||
<a href="{{route('dashboard.sub.locations.index', ['location' => encrypt_id($location->id)])}}"><u>{{$location->subLocations->count()}}</u></a>
|
||||
@else
|
||||
{{$location->subLocations->count()}}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<hr>
|
||||
<div class="form-group d-flex justify-content-end">
|
||||
<a href="{{route('dashboard.locations.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<a href="{{route('dashboard.locations.edit', ['id' => encrypt_id($location->id)])}}" class="btn btn-warning"><span>Ubah</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Isu</span>
|
||||
<span class="profile-ud-value">
|
||||
@if ($location->issues->count() > 0)
|
||||
<a href="{{route('dashboard.issue.managements.index', ['location' => encrypt_id($location->id)])}}"><u>{{$location->issues->count()}}</u></a>
|
||||
@else
|
||||
{{$location->issues->count()}}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .profile-ud-list -->
|
||||
</div><!-- .nk-block -->
|
||||
{{-- <div class="nk-divider divider md"></div> --}}
|
||||
<div class="nk-block">
|
||||
<div class="nk-block-head nk-block-head-sm nk-block-between">
|
||||
<span class="profile-ud-label">Deskripsi</span>
|
||||
</div><!-- .nk-block-head -->
|
||||
<div class="bq-note">
|
||||
<div class="bq-note-item">
|
||||
<div class="bq-note-text">
|
||||
{!!$location->description ?? '-' !!}
|
||||
</div>
|
||||
</div><!-- .bq-note-item -->
|
||||
</div><!-- .bq-note -->
|
||||
</div><!-- .nk-block -->
|
||||
<hr>
|
||||
<div class="nk-block d-flex justify-content-end">
|
||||
<a href="{{route('dashboard.locations.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<a href="{{route('dashboard.locations.edit', ['id' => encrypt_id($location->id), 'show' => true])}}" class="btn btn-warning"><span>Ubah</span></a>
|
||||
</div><!-- .nk-block -->
|
||||
</div><!-- .card-inner -->
|
||||
</div><!-- .card-content -->
|
||||
</div><!-- .card-aside-wrap -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<div class="card-head">
|
||||
<h5 class="card-title">{{$title}}</h5>
|
||||
</div>
|
||||
<form action="{{route('dashboard.sub.locations.store')}}" method="post">
|
||||
<form action="{{route('dashboard.sub.locations.store')}}" method="post" id="myForm">
|
||||
@csrf
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-6">
|
||||
@ -67,7 +67,7 @@
|
||||
<hr>
|
||||
<div class="form-group d-flex justify-content-end">
|
||||
<a href="{{route('dashboard.sub.locations.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<button type="submit" class="btn btn-md btn-primary">Tambahkan</button>
|
||||
<button type="button" class="btn btn-md btn-primary" id="submitButton">Tambahkan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<div class="card-head">
|
||||
<h5 class="card-title">{{$title}}</h5>
|
||||
</div>
|
||||
<form action="{{route('dashboard.sub.locations.update', ['id' => encrypt_id($subLocation->id)])}}" method="post">
|
||||
<form action="{{route('dashboard.sub.locations.update', ['id' => encrypt_id($subLocation->id)])}}" method="post" id="myForm">
|
||||
@csrf
|
||||
@method('put')
|
||||
<div class="row g-4">
|
||||
@ -61,8 +61,12 @@
|
||||
<div class="col-12">
|
||||
<hr>
|
||||
<div class="form-group d-flex justify-content-end">
|
||||
@if (request()->query('show'))
|
||||
<a href="{{route('dashboard.sub.locations.show', ['id' => encrypt_id($subLocation->id)])}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
@else
|
||||
<a href="{{route('dashboard.sub.locations.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<button type="submit" class="btn btn-md btn-primary">Simpan</button>
|
||||
@endif
|
||||
<button type="button" class="btn btn-md btn-primary" id="submitButton">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -44,11 +44,12 @@
|
||||
<table class="table table-striped table-bordered nowrap" id="subLocationsTable" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10% !important;">No</th>
|
||||
<th>No</th>
|
||||
<th>Lokus</th>
|
||||
<th>Nama</th>
|
||||
<th style="width: 13% !important;">Status</th>
|
||||
<th style="width: 10% !important;"></th>
|
||||
<th>Isu</th>
|
||||
<th>Status</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
@ -7,57 +7,84 @@
|
||||
<div class="nk-content-inner">
|
||||
<div class="nk-content-body">
|
||||
<div class="nk-block nk-block-lg">
|
||||
<div class="card card-bordered card-preview">
|
||||
<div class="card-inner">
|
||||
<div class="card-head">
|
||||
<h5 class="card-title">{{$title}}</h5>
|
||||
</div>
|
||||
<form action="#" method="post">
|
||||
@csrf
|
||||
@method('put')
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="name">Nama Sub Lokus</label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="text" class="form-control @error('name') border-danger @enderror" id="name" name="name" placeholder="Masukan nama sub lokus" value="{{ $subLocation->name}}" readonly>
|
||||
<div class="card">
|
||||
<div class="card-aside-wrap">
|
||||
<div class="card-content">
|
||||
<ul class="nav nav-tabs nav-tabs-mb-icon nav-tabs-card">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-primary" href="#"><em class="icon ni ni-info"></em><span>Detail Sub Lokus</span></a>
|
||||
</li>
|
||||
</ul><!-- .nav-tabs -->
|
||||
<div class="card-inner">
|
||||
<div class="nk-block">
|
||||
{{-- <div class="nk-block-head">
|
||||
<h5 class="title">Personal Information</h5>
|
||||
<p>Basic info, like your name and address, that you use on Nio Platform.</p>
|
||||
</div> --}}
|
||||
<div class="profile-ud-list">
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Nama Sub Lokus</span>
|
||||
<span class="profile-ud-value">{{$subLocation->name}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="location_name">Lokus</label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="text" class="form-control @error('location_name') border-danger @enderror" id="location_name" name="location_name" placeholder="Masukan nama lokus" value="{{ $subLocation->location->name}}" readonly>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Nama Lokus</span>
|
||||
<span class="profile-ud-value">{{$subLocation->location->name}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="status">Status</label>
|
||||
<div class="form-control-wrap">
|
||||
<input type="text" class="form-control @error('status') border-danger @enderror" id="status" name="status" placeholder="Status klasifikasi" value="{{ $subLocation->status == '1' ? 'Aktif' : 'Tidak Aktif'}}" readonly>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Isu</span>
|
||||
<span class="profile-ud-value">
|
||||
@if ($subLocation->issues->count() > 0)
|
||||
<a href="{{route('dashboard.issue.managements.index', ['sub_location' => encrypt_id($subLocation->id)])}}"><u>{{$subLocation->issues->count()}}</u></a>
|
||||
@else
|
||||
{{$subLocation->issues->count()}}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="phone-no-1">Deskripsi</label>
|
||||
<div class="form-control-wrap">
|
||||
<div class="description-content">{!! $subLocation->description !!}</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Status</span>
|
||||
@switch($subLocation->status)
|
||||
@case(0)
|
||||
<span class="profile-ud-value"><span class="badge bg-warning">Nonaktif</span></span>
|
||||
@break
|
||||
@case(1)
|
||||
<span class="profile-ud-value"><span class="badge bg-success">Aktif</span></span>
|
||||
@break
|
||||
@default
|
||||
<span class="profile-ud-value"><span class="badge bg-secondary">Tidak Diketahui</span></span>
|
||||
@endswitch
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<hr>
|
||||
<div class="form-group d-flex justify-content-end">
|
||||
<a href="{{route('dashboard.sub.locations.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<a href="{{route('dashboard.sub.locations.edit', ['id' => encrypt_id($subLocation->id)])}}" class="btn btn-warning"><span>Ubah</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div><!-- .profile-ud-list -->
|
||||
</div><!-- .nk-block -->
|
||||
{{-- <div class="nk-divider divider md"></div> --}}
|
||||
<div class="nk-block">
|
||||
<div class="nk-block-head nk-block-head-sm nk-block-between">
|
||||
<span class="profile-ud-label">Deskripsi</span>
|
||||
</div><!-- .nk-block-head -->
|
||||
<div class="bq-note">
|
||||
<div class="bq-note-item">
|
||||
<div class="bq-note-text">
|
||||
{!!$subLocation->description ?? '-' !!}
|
||||
</div>
|
||||
</div><!-- .bq-note-item -->
|
||||
</div><!-- .bq-note -->
|
||||
</div><!-- .nk-block -->
|
||||
<hr>
|
||||
<div class="nk-block d-flex justify-content-end">
|
||||
<a href="{{route('dashboard.sub.locations.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<a href="{{route('dashboard.sub.locations.edit', ['id' => encrypt_id($subLocation->id), 'show' => true])}}" class="btn btn-warning"><span>Ubah</span></a>
|
||||
</div><!-- .nk-block -->
|
||||
</div><!-- .card-inner -->
|
||||
</div><!-- .card-content -->
|
||||
</div><!-- .card-aside-wrap -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -65,4 +92,4 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- content @e -->
|
||||
@include('partials.dashboard.footer', ['rich_editor' => true])
|
||||
@include('partials.dashboard.footer', ['rich_editor' => false])
|
||||
|
||||
@ -128,13 +128,31 @@
|
||||
{ data: 'name', name: 'name' },
|
||||
{ data: 'status', name: 'status' },
|
||||
{ data: 'sub_locations', name: 'sub_locations' },
|
||||
{ data: 'issues', name: 'issues' },
|
||||
{ data: 'action', name: 'action', orderable: false, searchable: false },
|
||||
{ data: 'created_at', name: 'created_at', visible: false },
|
||||
{ data: 'id', name: 'id', orderable: true, searchable: false, visible: false },
|
||||
],
|
||||
columnDefs: [
|
||||
{ targets: 0, width: 'auto' },
|
||||
{ targets: 2, width: '7%' },
|
||||
{ targets: 3, width: '10%' },
|
||||
{ targets: 4, width: '10%' },
|
||||
{ targets: 5, width: '5%' },
|
||||
{
|
||||
targets: [1],
|
||||
createdCell: function(td, cellData, rowData, row, col) {
|
||||
$(td).css({
|
||||
'word-wrap': 'break-word',
|
||||
'white-space': 'normal',
|
||||
'overflow-wrap': 'break-word'
|
||||
});
|
||||
}
|
||||
}
|
||||
],
|
||||
language: datatableLanguage,
|
||||
autoWidth: false,
|
||||
order: [[5, 'desc']],
|
||||
order: [[6, 'desc']],
|
||||
pagingType: "simple",
|
||||
lengthMenu: [[10, 25, 50, 100, -1], ['Tampilkan 10 data', 'Tampilkan 25 data', 'Tampilkan 50 data', 'Tampilkan 100 data', 'Tampilkan semua']],
|
||||
scrollX: true
|
||||
@ -155,14 +173,32 @@
|
||||
{ data: 'DT_RowIndex', name: 'DT_RowIndex', orderable: false, searchable: false },
|
||||
{ data: 'location', name: 'location' },
|
||||
{ data: 'name', name: 'name' },
|
||||
{ data: 'issues', name: 'issues' },
|
||||
{ data: 'status', name: 'status' },
|
||||
{ data: 'action', name: 'action', orderable: false, searchable: false },
|
||||
{ data: 'created_at', name: 'created_at', visible: false },
|
||||
{ data: 'id', name: 'id', orderable: true, searchable: false, visible: false },
|
||||
],
|
||||
columnDefs: [
|
||||
{ targets: 0, width: 'auto' },
|
||||
{ targets: 1, width: 'auto' },
|
||||
{ targets: 3, width: '12%' },
|
||||
{ targets: 4, width: '7%' },
|
||||
{ targets: 5, width: '5%' },
|
||||
{
|
||||
targets: [2],
|
||||
createdCell: function(td, cellData, rowData, row, col) {
|
||||
$(td).css({
|
||||
'word-wrap': 'break-word',
|
||||
'white-space': 'normal',
|
||||
'overflow-wrap': 'break-word'
|
||||
});
|
||||
}
|
||||
}
|
||||
],
|
||||
language: datatableLanguage,
|
||||
autoWidth: false,
|
||||
order: [[5, 'desc']],
|
||||
order: [[6, 'desc']],
|
||||
pagingType: "simple",
|
||||
lengthMenu: [[10, 25, 50, 100, -1], ['Tampilkan 10 data', 'Tampilkan 25 data', 'Tampilkan 50 data', 'Tampilkan 100 data', 'Tampilkan semua']],
|
||||
scrollX: true
|
||||
|
||||
@ -89,38 +89,42 @@
|
||||
});
|
||||
});
|
||||
|
||||
Route::prefix('locations')->name('locations.')->group(function(){
|
||||
Route::controller(LocationController::class)->group(function(){
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::get('/{id}/show', 'show')->name('show');
|
||||
Route::middleware('role:1,2,4')->group(function(){
|
||||
Route::prefix('locations')->name('locations.')->group(function(){
|
||||
Route::controller(LocationController::class)->group(function(){
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::get('/{id}/show', 'show')->name('show');
|
||||
|
||||
Route::middleware('role:1')->group(function(){
|
||||
Route::get('/create', 'create')->name('create');
|
||||
Route::post('/', 'store')->name('store');
|
||||
Route::get('/{id}/edit', 'edit')->name('edit');
|
||||
Route::put('/{id}', 'update')->name('update');
|
||||
Route::delete('/{id}', 'destroy')->name('destroy');
|
||||
Route::middleware('role:1')->group(function(){
|
||||
Route::get('/create', 'create')->name('create');
|
||||
Route::post('/', 'store')->name('store');
|
||||
Route::get('/{id}/edit', 'edit')->name('edit');
|
||||
Route::put('/{id}', 'update')->name('update');
|
||||
Route::delete('/{id}', 'destroy')->name('destroy');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Route::get('/data', [DatatableController::class, 'location'])->name('data');
|
||||
Route::get('/data', [DatatableController::class, 'location'])->name('data');
|
||||
});
|
||||
});
|
||||
|
||||
Route::prefix('sub-locations')->name('sub.locations.')->group(function(){
|
||||
Route::controller(SubLocationController::class)->group(function(){
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::get('/{id}/show', 'show')->name('show');
|
||||
Route::middleware('role:1,2,4')->group(function(){
|
||||
Route::prefix('sub-locations')->name('sub.locations.')->group(function(){
|
||||
Route::controller(SubLocationController::class)->group(function(){
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::get('/{id}/show', 'show')->name('show');
|
||||
|
||||
Route::middleware('role:1')->group(function(){
|
||||
Route::get('/create', 'create')->name('create');
|
||||
Route::post('/', 'store')->name('store');
|
||||
Route::get('/{id}/edit', 'edit')->name('edit');
|
||||
Route::put('/{id}', 'update')->name('update');
|
||||
Route::delete('/{id}', 'destroy')->name('destroy');
|
||||
Route::middleware('role:1')->group(function(){
|
||||
Route::get('/create', 'create')->name('create');
|
||||
Route::post('/', 'store')->name('store');
|
||||
Route::get('/{id}/edit', 'edit')->name('edit');
|
||||
Route::put('/{id}', 'update')->name('update');
|
||||
Route::delete('/{id}', 'destroy')->name('destroy');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Route::get('/data', [DatatableController::class, 'subLocation'])->name('data');
|
||||
Route::get('/data', [DatatableController::class, 'subLocation'])->name('data');
|
||||
});
|
||||
});
|
||||
|
||||
Route::prefix('government-agencies')->name('government.agencies.')->group(function(){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user