feat: location or lokus
This commit is contained in:
parent
4d3eedf3c0
commit
d51959371c
@ -7,9 +7,11 @@
|
||||
use App\Models\Classification;
|
||||
use App\Models\ContentRecap;
|
||||
use App\Models\GovernmentAgency;
|
||||
use App\Models\Location;
|
||||
use App\Models\News;
|
||||
use App\Models\Role;
|
||||
use App\Models\SubClassification;
|
||||
use App\Models\SubLocation;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@ -149,6 +151,134 @@ public function subClassification(Request $request){
|
||||
|
||||
}
|
||||
|
||||
public function location(Request $request){
|
||||
if ($request->ajax()) {
|
||||
|
||||
$data = Location::with(['subLocations'])->get();
|
||||
|
||||
return DataTables::of($data)
|
||||
->addIndexColumn()
|
||||
->addColumn('status', function ($data) {
|
||||
if ($data->status == '0') {
|
||||
return '<span class="badge bg-danger" style="display:inline-block;font-size:0.8rem;">Nonaktif</span>';
|
||||
}else{
|
||||
return '<span class="badge bg-primary" style="display:inline-block;font-size:0.8rem;">Aktif</span>';
|
||||
}
|
||||
})
|
||||
->addColumn('sub_locations', function ($data) {
|
||||
$subLocationsCount = $data->subLocations->count();
|
||||
|
||||
if($subLocationsCount > 0){
|
||||
return $subLocationsCount. ' [<a href="'.route('dashboard.sub.locations.index', ['location' => $data->slug]).'">Lihat</a>]';
|
||||
}else{
|
||||
return $subLocationsCount;
|
||||
}
|
||||
|
||||
})
|
||||
->addColumn('action', function ($data) {
|
||||
$showUrl = route('dashboard.locations.show', ['id' => encrypt_id($data->id)]);
|
||||
|
||||
$addSubLocationUrl = route('dashboard.sub.locations.create', ['location' => $data->slug]);
|
||||
|
||||
$editUrl = route('dashboard.locations.edit', ['id' => encrypt_id($data->id)]);
|
||||
|
||||
$deleteUrl = route('dashboard.locations.destroy', ['id' => encrypt_id($data->id)]);
|
||||
|
||||
$dropdown = '<div class="dropdown" style="display:flex; justify-content:center;">
|
||||
<a class="dropdown-toggle btn btn-icon btn-light" data-bs-toggle="dropdown"><em class="icon ni ni-more-v"></em></a>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
<ul class="link-list-opt">
|
||||
<li><a href="'.$showUrl.'"><em class="icon ni ni-eye"></em><span>Detail</span></a></li>';
|
||||
|
||||
if (is_role([1])) {
|
||||
$dropdown .= '<li><a href="'.$addSubLocationUrl.'"><em class="icon ni ni-plus"></em><span>Tambah Sub Lokus</span></a></li>';
|
||||
}
|
||||
|
||||
if (is_role([1])) {
|
||||
$dropdown .= '<li><a href="'.$editUrl.'"><em class="icon ni ni-edit"></em><span>Ubah</span></a></li>';
|
||||
}
|
||||
|
||||
if (is_role([1])) {
|
||||
$dropdown .= '<li><a href="javascript:void(0);" onclick="deleteItem(\''.$deleteUrl.'\', \'Apakah Anda yakin ingin menghapus lokus '.$data->name.'? Item ini akan dihapus secara permanen!\')"><em class="icon ni ni-trash"></em><span>Hapus</span></a></li>';
|
||||
|
||||
}
|
||||
|
||||
$dropdown .= '</ul>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
return $dropdown;
|
||||
})
|
||||
|
||||
->rawColumns(['sub_locations', 'status', 'action'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
return response()->json(['error' => 'Unauthorized'], 401);
|
||||
|
||||
}
|
||||
|
||||
public function subLocation(Request $request){
|
||||
if ($request->ajax()) {
|
||||
|
||||
$locationParam = $request->input('location', null);
|
||||
|
||||
if($locationParam){
|
||||
$location = Location::where('slug', '=', $locationParam)->first();
|
||||
$data = SubLocation::with(['location'])->where('location_id', '=', $location->id)->get();
|
||||
}else{
|
||||
$data = SubLocation::with(['location'])->get();
|
||||
}
|
||||
|
||||
return DataTables::of($data)
|
||||
->addIndexColumn()
|
||||
->addColumn('location', function ($data) {
|
||||
return $data->location->name;
|
||||
})
|
||||
->addColumn('status', function ($data) {
|
||||
if ($data->status == '0') {
|
||||
return '<span class="badge bg-danger" style="display:inline-block;font-size:0.8rem;">Nonaktif</span>';
|
||||
}else{
|
||||
return '<span class="badge bg-primary" style="display:inline-block;font-size:0.8rem;">Aktif</span>';
|
||||
}
|
||||
})
|
||||
->addColumn('action', function ($data) {
|
||||
$showUrl = route('dashboard.sub.locations.show', ['id' => encrypt_id($data->id)]);
|
||||
|
||||
$editUrl = route('dashboard.sub.locations.edit', ['id' => encrypt_id($data->id)]);
|
||||
|
||||
$deleteUrl = route('dashboard.sub.locations.destroy', ['id' => encrypt_id($data->id)]);
|
||||
|
||||
$dropdown = '<div class="dropdown" style="display:flex; justify-content:center;">
|
||||
<a class="dropdown-toggle btn btn-icon btn-light" data-bs-toggle="dropdown"><em class="icon ni ni-more-v"></em></a>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
<ul class="link-list-opt">
|
||||
<li><a href="'.$showUrl.'"><em class="icon ni ni-eye"></em><span>Detail</span></a></li>';
|
||||
|
||||
if (is_role([1])) {
|
||||
$dropdown .= '<li><a href="'.$editUrl.'"><em class="icon ni ni-edit"></em><span>Ubah</span></a></li>';
|
||||
}
|
||||
|
||||
if (is_role([1])) {
|
||||
$dropdown .= '<li><a href="javascript:void(0);" onclick="deleteItem(\''.$deleteUrl.'\', \'Apakah Anda yakin ingin menghapus sub lokus '.$data->name.'? Item ini akan dihapus secara permanen!\')"><em class="icon ni ni-trash"></em><span>Hapus</span></a></li>';
|
||||
|
||||
}
|
||||
|
||||
$dropdown .= '</ul>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
return $dropdown;
|
||||
})
|
||||
|
||||
->rawColumns(['status', 'action'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
return response()->json(['error' => 'Unauthorized'], 401);
|
||||
|
||||
}
|
||||
|
||||
public function governmentAgency(Request $request){
|
||||
if ($request->ajax()) {
|
||||
$data = GovernmentAgency::all();
|
||||
|
||||
84
app/Http/Controllers/Dashboard/LocationController.php
Normal file
84
app/Http/Controllers/Dashboard/LocationController.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Dashboard;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\LocationRequest;
|
||||
use App\Models\Location;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class LocationController extends Controller
|
||||
{
|
||||
public function index(){
|
||||
return view('dashboard.locations.index', [
|
||||
'title' => 'Lokus'
|
||||
]);
|
||||
}
|
||||
|
||||
public function create(){
|
||||
return view('dashboard.locations.create', [
|
||||
'title' => 'Tambah Lokus'
|
||||
]);
|
||||
}
|
||||
|
||||
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.');
|
||||
}else{
|
||||
return redirect()->back()->with('failed-status', 'Gagal menambahkan lokus.');
|
||||
}
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
$location = Location::findOrFail(decrypt_id($id));
|
||||
|
||||
return view('dashboard.locations.edit', [
|
||||
'title' => 'Ubah Lokus',
|
||||
'location' => $location
|
||||
]);
|
||||
}
|
||||
|
||||
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));
|
||||
$updatedLocation = $location->update($validatedData);
|
||||
|
||||
if($updatedLocation){
|
||||
return redirect()->back()->with('success-status', 'Berhasil mengubah lokus.');
|
||||
}else{
|
||||
return redirect()->back()->with('failed-status', 'Gagal mengubah lokus.');
|
||||
}
|
||||
}
|
||||
|
||||
public function show($id){
|
||||
$location = Location::find(decrypt_id($id));
|
||||
|
||||
return view('dashboard.locations.show', [
|
||||
'title' => 'Detail Lokus',
|
||||
'location' => $location
|
||||
]);
|
||||
}
|
||||
|
||||
public function destroy($id){
|
||||
try {
|
||||
$location = Location::findOrFail(decrypt_id($id));
|
||||
|
||||
$location->delete();
|
||||
|
||||
return response()->json(['message' => 'Berhasil menghapus lokus.']);
|
||||
} catch (\Exception $e) {
|
||||
return response()->json(['message' => 'Gagal menghapus lokus.'], 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
102
app/Http/Controllers/Dashboard/SubLocationController.php
Normal file
102
app/Http/Controllers/Dashboard/SubLocationController.php
Normal file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Dashboard;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\SubLocationRequest;
|
||||
use App\Models\Location;
|
||||
use App\Models\SubLocation;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class SubLocationController extends Controller
|
||||
{
|
||||
public function index(Request $request){
|
||||
|
||||
$viewData = [
|
||||
'title' => 'Sub Lokus',
|
||||
'location' => $request->input('location', null),
|
||||
];
|
||||
|
||||
return view('dashboard.sub-locations.index', $viewData);
|
||||
}
|
||||
|
||||
public function create(Request $request){
|
||||
|
||||
$viewData = [
|
||||
'title' => 'Tambah Sub Lokus',
|
||||
'fromLocation' => false
|
||||
];
|
||||
|
||||
if($request->has('location')){
|
||||
$locationSlug = $request->query('location');
|
||||
$viewData['location'] = Location::where('slug', '=', $locationSlug)->first();
|
||||
$viewData['fromLocation'] = true;
|
||||
}else{
|
||||
$viewData['locations'] = Location::all();
|
||||
}
|
||||
|
||||
return view('dashboard.sub-locations.create', $viewData);
|
||||
}
|
||||
|
||||
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.');
|
||||
}else{
|
||||
return redirect()->back()->with('failed-status', 'Gagal menambahkan sub lokus.');
|
||||
}
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
$subLocation = SubLocation::findOrFail(decrypt_id($id));
|
||||
|
||||
return view('dashboard.sub-locations.edit', [
|
||||
'title' => 'Ubah Sub Lokus',
|
||||
'subLocation' => $subLocation,
|
||||
'locations' => Location::all()
|
||||
]);
|
||||
}
|
||||
|
||||
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));
|
||||
$updatedSubLocation = $subLocation->update($validatedData);
|
||||
|
||||
if($updatedSubLocation){
|
||||
return redirect()->back()->with('success-status', 'Berhasil mengubah sub lokus.');
|
||||
}else{
|
||||
return redirect()->back()->with('failed-status', 'Gagal mengubah sub lokus.');
|
||||
}
|
||||
}
|
||||
|
||||
public function show($id){
|
||||
$subLocation = SubLocation::with(['location'])->find(decrypt_id($id));
|
||||
|
||||
return view('dashboard.sub-locations.show', [
|
||||
'title' => 'Detail Sub Lokus',
|
||||
'subLocation' => $subLocation,
|
||||
]);
|
||||
}
|
||||
|
||||
public function destroy($id){
|
||||
try {
|
||||
$subLocation = SubLocation::findOrFail(decrypt_id($id));
|
||||
|
||||
$subLocation->delete();
|
||||
|
||||
return response()->json(['message' => 'Berhasil menghapus sub lokus.']);
|
||||
} catch (\Exception $e) {
|
||||
return response()->json(['message' => 'Gagal menghapus sub lokus.'], 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
41
app/Http/Requests/LocationRequest.php
Normal file
41
app/Http/Requests/LocationRequest.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class LocationRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return Auth::check() && is_role(['1']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required'],
|
||||
'status' => ['required', 'in:0,1'],
|
||||
'description' => ['nullable']
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'name.required' => 'Nama lokus harus diisi.',
|
||||
'status.required' => 'Status harus dipilih.',
|
||||
'status.in' => 'Status harus memiliki nilai aktif atau tidak aktif.',
|
||||
'description.nullable' => 'Deskripsi boleh kosong jika tidak diperlukan.',
|
||||
];
|
||||
}
|
||||
}
|
||||
44
app/Http/Requests/SubLocationRequest.php
Normal file
44
app/Http/Requests/SubLocationRequest.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class SubLocationRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return Auth::check() && is_role(['1']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required'],
|
||||
'location_id' => ['required', 'exists:locations,id'],
|
||||
'status' => ['required', 'in:0,1'],
|
||||
'description' => ['nullable']
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'name.required' => 'Nama lokus harus diisi.',
|
||||
'location_id.required' => 'Lokus utama harus dipilih.',
|
||||
'location_id.exists' => 'Lokus yang dipilih tidak valid.',
|
||||
'status.required' => 'Status harus dipilih.',
|
||||
'status.in' => 'Status harus bernilai aktif atau tidak aktif.',
|
||||
'description.nullable' => 'Deskripsi boleh kosong jika tidak diperlukan.',
|
||||
];
|
||||
}
|
||||
}
|
||||
22
app/Models/Location.php
Normal file
22
app/Models/Location.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Location extends Model
|
||||
{
|
||||
protected $table = 'locations';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'slug',
|
||||
'status',
|
||||
'description',
|
||||
'enhancer_id'
|
||||
];
|
||||
|
||||
public function subLocations(){
|
||||
return $this->hasMany(SubLocation::class, 'location_id', 'id');
|
||||
}
|
||||
}
|
||||
23
app/Models/SubLocation.php
Normal file
23
app/Models/SubLocation.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SubLocation extends Model
|
||||
{
|
||||
protected $table = 'sub_locations';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'slug',
|
||||
'status',
|
||||
'description',
|
||||
'location_id',
|
||||
'enhancer_id'
|
||||
];
|
||||
|
||||
public function location(){
|
||||
return $this->belongsTo(Location::class, 'location_id', 'id');
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('locations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('slug')->unique();;
|
||||
$table->text('description')->nullable();
|
||||
$table->enum('status', ['0', '1'])->default('0');
|
||||
$table->unsignedBigInteger('enhancer_id');
|
||||
$table->foreign('enhancer_id')->references('id')->on('users');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('locations');
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('sub_locations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('slug')->unique();;
|
||||
$table->text('description')->nullable();
|
||||
$table->enum('status', ['0', '1'])->default('0');
|
||||
$table->unsignedBigInteger('location_id');
|
||||
$table->foreign('location_id')->references('id')->on('locations');
|
||||
$table->unsignedBigInteger('enhancer_id');
|
||||
$table->foreign('enhancer_id')->references('id')->on('users');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('sub_locations');
|
||||
}
|
||||
};
|
||||
17
database/seeders/LocationSeeder.php
Normal file
17
database/seeders/LocationSeeder.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class LocationSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
17
database/seeders/SubLocationSeeder.php
Normal file
17
database/seeders/SubLocationSeeder.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class SubLocationSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
65
resources/views/dashboard/locations/create.blade.php
Normal file
65
resources/views/dashboard/locations/create.blade.php
Normal file
@ -0,0 +1,65 @@
|
||||
@include('partials.dashboard.head')
|
||||
@include('partials.dashboard.sidebar', ['page' => 'locations'])
|
||||
@include('partials.dashboard.header')
|
||||
<!-- content @s -->
|
||||
<div class="nk-content ">
|
||||
<div class="container-fluid">
|
||||
<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="{{route('dashboard.locations.store')}}" method="post">
|
||||
@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>
|
||||
<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')}}">
|
||||
</div>
|
||||
@error('name')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Status<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<select class="form-select js-select2" name="status">
|
||||
<option value="1" {{old('status') == '1' ? 'selected' : ''}}>Aktif</option>
|
||||
<option value="0" {{old('status') == '0' ? 'selected' : ''}}>Tidak Aktif</option>
|
||||
</select>
|
||||
</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">
|
||||
<textarea class="tinymce-basic form-control" name="description">{!!old('description')!!}</textarea>
|
||||
</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>
|
||||
<button type="submit" class="btn btn-md btn-primary">Tambahkan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- content @e -->
|
||||
@include('partials.dashboard.footer', ['rich_editor' => false])
|
||||
66
resources/views/dashboard/locations/edit.blade.php
Normal file
66
resources/views/dashboard/locations/edit.blade.php
Normal file
@ -0,0 +1,66 @@
|
||||
@include('partials.dashboard.head')
|
||||
@include('partials.dashboard.sidebar', ['page' => 'locations'])
|
||||
@include('partials.dashboard.header')
|
||||
<!-- content @s -->
|
||||
<div class="nk-content ">
|
||||
<div class="container-fluid">
|
||||
<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="{{route('dashboard.locations.update', ['id' => encrypt_id($location->id)])}}" 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<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}}">
|
||||
</div>
|
||||
@error('name')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Status<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<select class="form-select js-select2" name="status">
|
||||
<option value="1" {{$location->status == '1' ? 'selected' : ''}}>Aktif</option>
|
||||
<option value="0" {{$location->status == '0' ? 'selected' : ''}}>Tidak Aktif</option>
|
||||
</select>
|
||||
</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">
|
||||
<textarea class="tinymce-basic form-control" name="description">{!!$location->description!!}</textarea>
|
||||
</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>
|
||||
<button type="submit" class="btn btn-md btn-primary">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- content @e -->
|
||||
@include('partials.dashboard.footer', ['rich_editor' => true])
|
||||
62
resources/views/dashboard/locations/index.blade.php
Normal file
62
resources/views/dashboard/locations/index.blade.php
Normal file
@ -0,0 +1,62 @@
|
||||
@include('partials.dashboard.head')
|
||||
@include('partials.dashboard.sidebar', ['page' => 'locations'])
|
||||
@include('partials.dashboard.header')
|
||||
<!-- content @s -->
|
||||
<div class="nk-content ">
|
||||
<div class="container-fluid">
|
||||
<div class="nk-content-inner">
|
||||
<div class="nk-content-body">
|
||||
<div class="nk-block-head nk-block-head-sm">
|
||||
<div class="nk-block-between">
|
||||
<div class="nk-block-head-content">
|
||||
<h3 class="nk-block-title page-title">{{$title}}</h3>
|
||||
</div><!-- .nk-block-head-content -->
|
||||
<div class="nk-block-head-content">
|
||||
<div class="toggle-wrap nk-block-tools-toggle">
|
||||
<a href="#" class="btn btn-icon btn-trigger toggle-expand me-n1" data-target="pageMenu"><em class="icon ni ni-more-v"></em></a>
|
||||
<div class="toggle-expand-content" data-content="pageMenu">
|
||||
<ul class="nk-block-tools g-3">
|
||||
{{-- <li>
|
||||
<div class="drodown">
|
||||
<a href="#" class="dropdown-toggle btn btn-white btn-dim btn-outline-light" data-bs-toggle="dropdown"><em class="d-none d-sm-inline icon ni ni-calender-date"></em><span><span class="d-none d-md-inline">Last</span> 30 Days</span><em class="dd-indc icon ni ni-chevron-right"></em></a>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
<ul class="link-list-opt no-bdr">
|
||||
<li><a href="#"><span>Last 30 Days</span></a></li>
|
||||
<li><a href="#"><span>Last 6 Months</span></a></li>
|
||||
<li><a href="#"><span>Last 1 Years</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</li> --}}
|
||||
<li class="nk-block-tools-opt"><a href="{{route('dashboard.locations.create')}}" class="btn btn-primary"><em class="icon ni ni-plus"></em><span>Tambah</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .nk-block-head-content -->
|
||||
</div><!-- .nk-block-between -->
|
||||
</div><!-- .nk-block-head -->
|
||||
<div class="nk-block nk-block-lg">
|
||||
<div class="card card-bordered card-preview">
|
||||
<div class="card-inner">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-bordered nowrap" id="locationsTable" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10% !important;">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>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- content @e -->
|
||||
@include('partials.dashboard.footer' ,['datatable' => 'location'])
|
||||
60
resources/views/dashboard/locations/show.blade.php
Normal file
60
resources/views/dashboard/locations/show.blade.php
Normal file
@ -0,0 +1,60 @@
|
||||
@include('partials.dashboard.head')
|
||||
@include('partials.dashboard.sidebar', ['page' => 'locations'])
|
||||
@include('partials.dashboard.header')
|
||||
<!-- content @s -->
|
||||
<div class="nk-content ">
|
||||
<div class="container-fluid">
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- content @e -->
|
||||
@include('partials.dashboard.footer', ['rich_editor' => false])
|
||||
@ -19,7 +19,7 @@
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="name">Nama Sub Klasifikasi<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="{{old('name')}}">
|
||||
<input type="text" class="form-control @error('name') border-danger @enderror" id="name" name="name" placeholder="Masukan nama sub klasifikasi" value="{{old('name')}}">
|
||||
</div>
|
||||
@error('name')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="name">Nama Sub 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="{{ $subClassification->name}}" readonly>
|
||||
<input type="text" class="form-control @error('name') border-danger @enderror" id="name" name="name" placeholder="Masukan nama sub klasifikasi" value="{{ $subClassification->name}}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
83
resources/views/dashboard/sub-locations/create.blade.php
Normal file
83
resources/views/dashboard/sub-locations/create.blade.php
Normal file
@ -0,0 +1,83 @@
|
||||
@include('partials.dashboard.head')
|
||||
@include('partials.dashboard.sidebar', ['page' => 'sub_locations'])
|
||||
@include('partials.dashboard.header')
|
||||
<!-- content @s -->
|
||||
<div class="nk-content ">
|
||||
<div class="container-fluid">
|
||||
<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="{{route('dashboard.sub.locations.store')}}" method="post">
|
||||
@csrf
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="name">Nama Sub 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 sub lokus" value="{{old('name')}}">
|
||||
</div>
|
||||
@error('name')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Lokus<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
@if ($fromLocation)
|
||||
<select class="form-select js-select2" name="location_id" aria-readonly="on">
|
||||
<option value="{{$location->id}}" {{old('location_id') == $location->id ? 'selected' : ''}}>{{$location->name}}</option>
|
||||
</select>
|
||||
@else
|
||||
<select class="form-select js-select2" data-search="on" name="location_id">
|
||||
@foreach ($locations as $location)
|
||||
<option value="{{$location->id}}" {{old('location_id') == $location->id ? 'selected' : ''}}>{{$location->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Status<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<select class="form-select js-select2" name="status">
|
||||
<option value="1" {{old('status') == '1' ? 'selected' : ''}}>Aktif</option>
|
||||
<option value="0" {{old('status') == '0' ? 'selected' : ''}}>Tidak Aktif</option>
|
||||
</select>
|
||||
</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">
|
||||
<textarea class="tinymce-basic form-control" name="description">{!!old('description')!!}</textarea>
|
||||
</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>
|
||||
<button type="submit" class="btn btn-md btn-primary">Tambahkan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- content @e -->
|
||||
@include('partials.dashboard.footer', ['rich_editor' => true])
|
||||
78
resources/views/dashboard/sub-locations/edit.blade.php
Normal file
78
resources/views/dashboard/sub-locations/edit.blade.php
Normal file
@ -0,0 +1,78 @@
|
||||
@include('partials.dashboard.head')
|
||||
@include('partials.dashboard.sidebar', ['page' => 'sub_locations'])
|
||||
@include('partials.dashboard.header')
|
||||
<!-- content @s -->
|
||||
<div class="nk-content ">
|
||||
<div class="container-fluid">
|
||||
<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="{{route('dashboard.sub.locations.update', ['id' => encrypt_id($subLocation->id)])}}" 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<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 sub lokus" value="{{$subLocation->name}}">
|
||||
</div>
|
||||
@error('name')
|
||||
<span class="validation-error">{{$message}}</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Lokus<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<select class="form-select js-select2" data-search="on" name="location_id">
|
||||
@foreach ($locations as $location)
|
||||
<option value="{{$location->id}}" {{$subLocation->location_id == $location->id ? 'selected' : ''}}>{{$location->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Status<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<select class="form-select js-select2" name="status">
|
||||
<option value="1" {{$subLocation->status == '1' ? 'selected' : ''}}>Aktif</option>
|
||||
<option value="0" {{$subLocation->status == '0' ? 'selected' : ''}}>Tidak Aktif</option>
|
||||
</select>
|
||||
</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">
|
||||
<textarea class="tinymce-basic form-control" name="description">{!!$subLocation->description!!}</textarea>
|
||||
</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>
|
||||
<button type="submit" class="btn btn-md btn-primary">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- content @e -->
|
||||
@include('partials.dashboard.footer', ['rich_editor' => true])
|
||||
62
resources/views/dashboard/sub-locations/index.blade.php
Normal file
62
resources/views/dashboard/sub-locations/index.blade.php
Normal file
@ -0,0 +1,62 @@
|
||||
@include('partials.dashboard.head')
|
||||
@include('partials.dashboard.sidebar', ['page' => 'sub_locations'])
|
||||
@include('partials.dashboard.header')
|
||||
<!-- content @s -->
|
||||
<div class="nk-content ">
|
||||
<div class="container-fluid">
|
||||
<div class="nk-content-inner">
|
||||
<div class="nk-content-body">
|
||||
<div class="nk-block-head nk-block-head-sm">
|
||||
<div class="nk-block-between">
|
||||
<div class="nk-block-head-content">
|
||||
<h3 class="nk-block-title page-title">{{$title}}</h3>
|
||||
</div><!-- .nk-block-head-content -->
|
||||
<div class="nk-block-head-content">
|
||||
<div class="toggle-wrap nk-block-tools-toggle">
|
||||
<a href="#" class="btn btn-icon btn-trigger toggle-expand me-n1" data-target="pageMenu"><em class="icon ni ni-more-v"></em></a>
|
||||
<div class="toggle-expand-content" data-content="pageMenu">
|
||||
<ul class="nk-block-tools g-3">
|
||||
{{-- <li>
|
||||
<div class="drodown">
|
||||
<a href="#" class="dropdown-toggle btn btn-white btn-dim btn-outline-light" data-bs-toggle="dropdown"><em class="d-none d-sm-inline icon ni ni-calender-date"></em><span><span class="d-none d-md-inline">Last</span> 30 Days</span><em class="dd-indc icon ni ni-chevron-right"></em></a>
|
||||
<div class="dropdown-menu dropdown-menu-end">
|
||||
<ul class="link-list-opt no-bdr">
|
||||
<li><a href="#"><span>Last 30 Days</span></a></li>
|
||||
<li><a href="#"><span>Last 6 Months</span></a></li>
|
||||
<li><a href="#"><span>Last 1 Years</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</li> --}}
|
||||
<li class="nk-block-tools-opt"><a href="{{route('dashboard.sub.locations.create')}}" class="btn btn-primary"><em class="icon ni ni-plus"></em><span>Tambah</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .nk-block-head-content -->
|
||||
</div><!-- .nk-block-between -->
|
||||
</div><!-- .nk-block-head -->
|
||||
<div class="nk-block nk-block-lg">
|
||||
<div class="card card-bordered card-preview">
|
||||
<div class="card-inner">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-bordered nowrap" id="subLocationsTable" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10% !important;">No</th>
|
||||
<th>Lokus</th>
|
||||
<th>Nama</th>
|
||||
<th style="width: 13% !important;">Status</th>
|
||||
<th style="width: 10% !important;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- content @e -->
|
||||
@include('partials.dashboard.footer' ,['datatable' => 'sub_location'])
|
||||
68
resources/views/dashboard/sub-locations/show.blade.php
Normal file
68
resources/views/dashboard/sub-locations/show.blade.php
Normal file
@ -0,0 +1,68 @@
|
||||
@include('partials.dashboard.head')
|
||||
@include('partials.dashboard.sidebar', ['page' => 'sub_locations'])
|
||||
@include('partials.dashboard.header')
|
||||
<!-- content @s -->
|
||||
<div class="nk-content ">
|
||||
<div class="container-fluid">
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- content @e -->
|
||||
@include('partials.dashboard.footer', ['rich_editor' => true])
|
||||
@ -69,6 +69,55 @@
|
||||
</script>
|
||||
@endif
|
||||
|
||||
@if ($datatable === 'location')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#locationsTable').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: '{{ route('dashboard.locations.data') }}',
|
||||
columns: [
|
||||
{ data: 'DT_RowIndex', name: 'DT_RowIndex', orderable: false, searchable: false },
|
||||
{ data: 'name', name: 'name' },
|
||||
{ data: 'status', name: 'status' },
|
||||
{ data: 'sub_locations', name: 'sub_locations' },
|
||||
{ data: 'action', name: 'action', orderable: false, searchable: false },
|
||||
{ data: 'id', name: 'id', orderable: true, searchable: false, visible: false },
|
||||
],
|
||||
language: datatableLanguage,
|
||||
autoWidth: false,
|
||||
order: [[1, 'desc']],
|
||||
lengthMenu: [[10, 25, 50, 100, -1], ['Tampilkan 10 data', 'Tampilkan 25 data', 'Tampilkan 50 data', 'Tampilkan 100 data', 'Tampilkan semua']]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
|
||||
@if ($datatable === 'sub_location')
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#subLocationsTable').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: '{{ route('dashboard.sub.locations.data', ["location" => $location]) }}',
|
||||
columns: [
|
||||
{ data: 'DT_RowIndex', name: 'DT_RowIndex', orderable: false, searchable: false },
|
||||
{ data: 'location', name: 'location' },
|
||||
{ data: 'name', name: 'name' },
|
||||
{ data: 'status', name: 'status' },
|
||||
{ data: 'action', name: 'action', orderable: false, searchable: false },
|
||||
{ data: 'id', name: 'id', orderable: true, searchable: false, visible: false },
|
||||
],
|
||||
language: datatableLanguage,
|
||||
autoWidth: false,
|
||||
order: [[1, 'desc']],
|
||||
lengthMenu: [[10, 25, 50, 100, -1], ['Tampilkan 10 data', 'Tampilkan 25 data', 'Tampilkan 50 data', 'Tampilkan 100 data', 'Tampilkan semua']]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
|
||||
@if ($datatable === 'government_agency')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
@ -46,13 +46,13 @@
|
||||
</a>
|
||||
</li><!-- .nk-menu-item -->
|
||||
<li class="nk-menu-item">
|
||||
<a href="javascript:void(0);" class="nk-menu-link">
|
||||
<a href="{{route('dashboard.locations.index')}}" class="nk-menu-link {{$page === 'locations' ? 'active-page' : ''}}">
|
||||
<span class="nk-menu-icon"><em class="icon ni ni-list-round"></em></span>
|
||||
<span class="nk-menu-text">Lokus</span>
|
||||
</a>
|
||||
</li><!-- .nk-menu-item -->
|
||||
<li class="nk-menu-item">
|
||||
<a href="javascript:void(0);" class="nk-menu-link">
|
||||
<a href="{{route('dashboard.sub.locations.index')}}" class="nk-menu-link {{$page === 'sub_locations' ? 'active-page' : ''}}">
|
||||
<span class="nk-menu-icon"><em class="icon ni ni-list-round"></em></span>
|
||||
<span class="nk-menu-text">Sub Lokus</span>
|
||||
</a>
|
||||
|
||||
@ -6,11 +6,13 @@
|
||||
use App\Http\Controllers\Dashboard\ContentRecapController;
|
||||
use App\Http\Controllers\Dashboard\DatatableController;
|
||||
use App\Http\Controllers\Dashboard\GovernmentAgencyController;
|
||||
use App\Http\Controllers\Dashboard\LocationController;
|
||||
use App\Http\Controllers\Dashboard\NewsController;
|
||||
use App\Http\Controllers\Dashboard\OverviewController;
|
||||
use App\Http\Controllers\Dashboard\RoleController;
|
||||
use App\Http\Controllers\Dashboard\SettingController;
|
||||
use App\Http\Controllers\Dashboard\SubClassificationController;
|
||||
use App\Http\Controllers\Dashboard\SubLocationController;
|
||||
use App\Http\Controllers\Dashboard\UserController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
@ -66,6 +68,34 @@
|
||||
Route::get('/data', [DatatableController::class, 'subClassification'])->name('data');
|
||||
});
|
||||
|
||||
Route::prefix('locations')->name('locations.')->group(function(){
|
||||
Route::controller(LocationController::class)->group(function(){
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::get('/create', 'create')->name('create');
|
||||
Route::post('/', 'store')->name('store');
|
||||
Route::get('/{id}/show', 'show')->name('show');
|
||||
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::prefix('sub-locations')->name('sub.locations.')->group(function(){
|
||||
Route::controller(SubLocationController::class)->group(function(){
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::get('/create', 'create')->name('create');
|
||||
Route::post('/', 'store')->name('store');
|
||||
Route::get('/{id}/show', 'show')->name('show');
|
||||
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::prefix('government-agencies')->name('government.agencies.')->group(function(){
|
||||
Route::controller(GovernmentAgencyController::class)->group(function(){
|
||||
Route::get('/', 'index')->name('index');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user