Compare commits
2 Commits
fix/sync-t
...
change-req
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbfa2a37bb | ||
|
|
dceb46ab86 |
@@ -39,7 +39,7 @@ class TourismController extends Controller
|
|||||||
$tourisms->village_name = $village ? $village->village_name : null;
|
$tourisms->village_name = $village ? $village->village_name : null;
|
||||||
|
|
||||||
$district = DB::table('districts')->where('district_code', $tourisms->district_code)->first();
|
$district = DB::table('districts')->where('district_code', $tourisms->district_code)->first();
|
||||||
$tourisms->district_name = $village ? $village->village_name : null;
|
$tourisms->district_name = $district ? $district->district_name : null;
|
||||||
return $tourisms;
|
return $tourisms;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ use App\Traits\GlobalApiResponse;
|
|||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class UsersController extends Controller
|
class UsersController extends Controller
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ class AuthenticatedSessionController extends Controller
|
|||||||
|
|
||||||
// Buat token untuk API
|
// Buat token untuk API
|
||||||
$token = $user->createToken(env('APP_KEY'))->plainTextToken;
|
$token = $user->createToken(env('APP_KEY'))->plainTextToken;
|
||||||
|
|
||||||
// Simpan token di session (bisa digunakan di JavaScript)
|
|
||||||
session(['api_token' => $token]);
|
session(['api_token' => $token]);
|
||||||
|
|
||||||
return redirect()->intended(RouteServiceProvider::HOME);
|
return redirect()->intended(RouteServiceProvider::HOME);
|
||||||
|
|||||||
@@ -4,15 +4,36 @@ namespace App\Http\Controllers;
|
|||||||
|
|
||||||
use App\Models\BusinessOrIndustry;
|
use App\Models\BusinessOrIndustry;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class BusinessOrIndustriesController extends Controller
|
class BusinessOrIndustriesController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
return view('business-industries.index');
|
$menuId = $request->query('menu_id');
|
||||||
|
$user = Auth::user();
|
||||||
|
$userId = $user->id;
|
||||||
|
|
||||||
|
// Ambil role_id yang dimiliki user
|
||||||
|
$roleIds = DB::table('user_role')
|
||||||
|
->where('user_id', $userId)
|
||||||
|
->pluck('role_id');
|
||||||
|
|
||||||
|
// Ambil data akses berdasarkan role_id dan menu_id
|
||||||
|
$roleAccess = DB::table('role_menu')
|
||||||
|
->whereIn('role_id', $roleIds)
|
||||||
|
->where('menu_id', $menuId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||||
|
$creator = $roleAccess->allow_create ?? 0;
|
||||||
|
$updater = $roleAccess->allow_update ?? 0;
|
||||||
|
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||||
|
return view('business-industries.index', compact('creator', 'updater', 'destroyer'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,12 +4,33 @@ namespace App\Http\Controllers;
|
|||||||
|
|
||||||
use App\Models\Customer;
|
use App\Models\Customer;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class CustomersController extends Controller
|
class CustomersController extends Controller
|
||||||
{
|
{
|
||||||
public function index()
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
return view('customers.index');
|
$menuId = $request->query('menu_id');
|
||||||
|
$user = Auth::user();
|
||||||
|
$userId = $user->id;
|
||||||
|
|
||||||
|
// Ambil role_id yang dimiliki user
|
||||||
|
$roleIds = DB::table('user_role')
|
||||||
|
->where('user_id', $userId)
|
||||||
|
->pluck('role_id');
|
||||||
|
|
||||||
|
// Ambil data akses berdasarkan role_id dan menu_id
|
||||||
|
$roleAccess = DB::table('role_menu')
|
||||||
|
->whereIn('role_id', $roleIds)
|
||||||
|
->where('menu_id', $menuId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||||
|
$creator = $roleAccess->allow_create ?? 0;
|
||||||
|
$updater = $roleAccess->allow_update ?? 0;
|
||||||
|
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||||
|
|
||||||
|
return view('customers.index', compact('creator', 'updater', 'destroyer'));
|
||||||
}
|
}
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,15 +6,36 @@ use App\Http\Controllers\Controller;
|
|||||||
use App\Models\Advertisement;
|
use App\Models\Advertisement;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class AdvertisementController extends Controller
|
class AdvertisementController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
return view('data.advertisements.index');
|
$menuId = $request->query('menu_id');
|
||||||
|
$user = Auth::user();
|
||||||
|
$userId = $user->id;
|
||||||
|
|
||||||
|
// Ambil role_id yang dimiliki user
|
||||||
|
$roleIds = DB::table('user_role')
|
||||||
|
->where('user_id', $userId)
|
||||||
|
->pluck('role_id');
|
||||||
|
|
||||||
|
// Ambil data akses berdasarkan role_id dan menu_id
|
||||||
|
$roleAccess = DB::table('role_menu')
|
||||||
|
->whereIn('role_id', $roleIds)
|
||||||
|
->where('menu_id', $menuId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||||
|
$creator = $roleAccess->allow_create ?? 0;
|
||||||
|
$updater = $roleAccess->allow_update ?? 0;
|
||||||
|
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||||
|
|
||||||
|
return view('data.advertisements.index', compact('creator', 'updater', 'destroyer'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,15 +5,37 @@ namespace App\Http\Controllers\Data;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\SpatialPlanning;
|
use App\Models\SpatialPlanning;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class SpatialPlanningController extends Controller
|
class SpatialPlanningController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
return view('data.spatialPlannings.index');
|
$menuId = $request->query('menu_id');
|
||||||
|
$user = Auth::user();
|
||||||
|
$userId = $user->id;
|
||||||
|
|
||||||
|
// Ambil role_id yang dimiliki user
|
||||||
|
$roleIds = DB::table('user_role')
|
||||||
|
->where('user_id', $userId)
|
||||||
|
->pluck('role_id');
|
||||||
|
|
||||||
|
// Ambil data akses berdasarkan role_id dan menu_id
|
||||||
|
$roleAccess = DB::table('role_menu')
|
||||||
|
->whereIn('role_id', $roleIds)
|
||||||
|
->where('menu_id', $menuId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||||
|
$creator = $roleAccess->allow_create ?? 0;
|
||||||
|
$updater = $roleAccess->allow_update ?? 0;
|
||||||
|
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||||
|
|
||||||
|
return view('data.spatialPlannings.index', compact('creator', 'updater', 'destroyer'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,15 +6,35 @@ use App\Http\Controllers\Controller;
|
|||||||
use App\Models\Tourism;
|
use App\Models\Tourism;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class TourismController extends Controller
|
class TourismController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Display a listing of the resource
|
* Display a listing of the resource
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
return view('data.tourisms.index');
|
$menuId = $request->query('menu_id');
|
||||||
|
$user = Auth::user();
|
||||||
|
$userId = $user->id;
|
||||||
|
|
||||||
|
// Ambil role_id yang dimiliki user
|
||||||
|
$roleIds = DB::table('user_role')
|
||||||
|
->where('user_id', $userId)
|
||||||
|
->pluck('role_id');
|
||||||
|
|
||||||
|
// Ambil data akses berdasarkan role_id dan menu_id
|
||||||
|
$roleAccess = DB::table('role_menu')
|
||||||
|
->whereIn('role_id', $roleIds)
|
||||||
|
->where('menu_id', $menuId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||||
|
$creator = $roleAccess->allow_create ?? 0;
|
||||||
|
$updater = $roleAccess->allow_update ?? 0;
|
||||||
|
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||||
|
return view('data.tourisms.index', compact('creator', 'updater', 'destroyer'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,15 +6,35 @@ use App\Http\Controllers\Controller;
|
|||||||
use App\Models\Umkm;
|
use App\Models\Umkm;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class UmkmController extends Controller
|
class UmkmController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
return view('data.umkm.index');
|
$menuId = $request->query('menu_id');
|
||||||
|
$user = Auth::user();
|
||||||
|
$userId = $user->id;
|
||||||
|
|
||||||
|
// Ambil role_id yang dimiliki user
|
||||||
|
$roleIds = DB::table('user_role')
|
||||||
|
->where('user_id', $userId)
|
||||||
|
->pluck('role_id');
|
||||||
|
|
||||||
|
// Ambil data akses berdasarkan role_id dan menu_id
|
||||||
|
$roleAccess = DB::table('role_menu')
|
||||||
|
->whereIn('role_id', $roleIds)
|
||||||
|
->where('menu_id', $menuId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||||
|
$creator = $roleAccess->allow_create ?? 0;
|
||||||
|
$updater = $roleAccess->allow_update ?? 0;
|
||||||
|
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||||
|
return view('data.umkm.index', compact('creator', 'updater', 'destroyer'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,15 +8,36 @@ use Exception;
|
|||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Request;
|
use Illuminate\Support\Facades\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Http\Request as IndexRequest;
|
||||||
|
|
||||||
class DataSettingController extends Controller
|
class DataSettingController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index(IndexRequest $request)
|
||||||
{
|
{
|
||||||
return view("data-settings.index");
|
$menuId = $request->query('menu_id');
|
||||||
|
$user = Auth::user();
|
||||||
|
$userId = $user->id;
|
||||||
|
|
||||||
|
// Ambil role_id yang dimiliki user
|
||||||
|
$roleIds = DB::table('user_role')
|
||||||
|
->where('user_id', $userId)
|
||||||
|
->pluck('role_id');
|
||||||
|
|
||||||
|
// Ambil data akses berdasarkan role_id dan menu_id
|
||||||
|
$roleAccess = DB::table('role_menu')
|
||||||
|
->whereIn('role_id', $roleIds)
|
||||||
|
->where('menu_id', $menuId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||||
|
$creator = $roleAccess->allow_create ?? 0;
|
||||||
|
$updater = $roleAccess->allow_update ?? 0;
|
||||||
|
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||||
|
return view("data-settings.index", compact('creator', 'updater', 'destroyer'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ use Illuminate\Support\Facades\Hash;
|
|||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Traits\GlobalApiResponse;
|
use App\Traits\GlobalApiResponse;
|
||||||
use Illuminate\Auth\Events\Registered;
|
use Illuminate\Auth\Events\Registered;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class UsersController extends Controller
|
class UsersController extends Controller
|
||||||
{
|
{
|
||||||
@@ -21,9 +22,29 @@ class UsersController extends Controller
|
|||||||
$users = User::all();
|
$users = User::all();
|
||||||
return $this->resSuccess($users);
|
return $this->resSuccess($users);
|
||||||
}
|
}
|
||||||
public function index(){
|
public function index(Request $request){
|
||||||
|
$menuId = $request->query('menu_id');
|
||||||
|
$user = Auth::user();
|
||||||
|
$userId = $user->id;
|
||||||
|
|
||||||
|
// Ambil role_id yang dimiliki user
|
||||||
|
$roleIds = DB::table('user_role')
|
||||||
|
->where('user_id', $userId)
|
||||||
|
->pluck('role_id');
|
||||||
|
|
||||||
|
// Ambil data akses berdasarkan role_id dan menu_id
|
||||||
|
$roleAccess = DB::table('role_menu')
|
||||||
|
->whereIn('role_id', $roleIds)
|
||||||
|
->where('menu_id', $menuId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||||
|
$creator = $roleAccess->allow_create ?? 0;
|
||||||
|
$updater = $roleAccess->allow_update ?? 0;
|
||||||
|
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||||
|
|
||||||
$users = User::paginate();
|
$users = User::paginate();
|
||||||
return view('master.users.index', compact('users'));
|
return view('master.users.index', compact('users', 'creator', 'updater', 'destroyer'));
|
||||||
}
|
}
|
||||||
public function create(){
|
public function create(){
|
||||||
$roles = Role::all();
|
$roles = Role::all();
|
||||||
|
|||||||
@@ -6,15 +6,36 @@ use App\Http\Requests\MenuRequest;
|
|||||||
use App\Models\Menu;
|
use App\Models\Menu;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class MenusController extends Controller
|
class MenusController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
return view('menus.index');
|
$menuId = $request->query('menu_id');
|
||||||
|
$user = Auth::user();
|
||||||
|
$userId = $user->id;
|
||||||
|
|
||||||
|
// Ambil role_id yang dimiliki user
|
||||||
|
$roleIds = DB::table('user_role')
|
||||||
|
->where('user_id', $userId)
|
||||||
|
->pluck('role_id');
|
||||||
|
|
||||||
|
// Ambil data akses berdasarkan role_id dan menu_id
|
||||||
|
$roleAccess = DB::table('role_menu')
|
||||||
|
->whereIn('role_id', $roleIds)
|
||||||
|
->where('menu_id', $menuId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||||
|
$creator = $roleAccess->allow_create ?? 0;
|
||||||
|
$updater = $roleAccess->allow_update ?? 0;
|
||||||
|
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||||
|
|
||||||
|
return view('menus.index', compact('creator', 'updater', 'destroyer'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,15 +5,37 @@ namespace App\Http\Controllers\RequestAssignment;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\PbgTask;
|
use App\Models\PbgTask;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class PbgTaskController extends Controller
|
class PbgTaskController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
return view('pbg_task.index');
|
$menuId = $request->query('menu_id');
|
||||||
|
$user = Auth::user();
|
||||||
|
$userId = $user->id;
|
||||||
|
|
||||||
|
// Ambil role_id yang dimiliki user
|
||||||
|
$roleIds = DB::table('user_role')
|
||||||
|
->where('user_id', $userId)
|
||||||
|
->pluck('role_id');
|
||||||
|
|
||||||
|
// Ambil data akses berdasarkan role_id dan menu_id
|
||||||
|
$roleAccess = DB::table('role_menu')
|
||||||
|
->whereIn('role_id', $roleIds)
|
||||||
|
->where('menu_id', $menuId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||||
|
$creator = $roleAccess->allow_create ?? 0;
|
||||||
|
$updater = $roleAccess->allow_update ?? 0;
|
||||||
|
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||||
|
|
||||||
|
return view('pbg_task.index', compact('creator', 'updater', 'destroyer'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,15 +10,36 @@ use Illuminate\Http\Request;
|
|||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class RolesController extends Controller
|
class RolesController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
return view("roles.index");
|
$menuId = $request->query('menu_id');
|
||||||
|
$user = Auth::user();
|
||||||
|
$userId = $user->id;
|
||||||
|
|
||||||
|
// Ambil role_id yang dimiliki user
|
||||||
|
$roleIds = DB::table('user_role')
|
||||||
|
->where('user_id', $userId)
|
||||||
|
->pluck('role_id');
|
||||||
|
|
||||||
|
// Ambil data akses berdasarkan role_id dan menu_id
|
||||||
|
$roleAccess = DB::table('role_menu')
|
||||||
|
->whereIn('role_id', $roleIds)
|
||||||
|
->where('menu_id', $menuId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||||
|
$creator = $roleAccess->allow_create ?? 0;
|
||||||
|
$updater = $roleAccess->allow_update ?? 0;
|
||||||
|
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||||
|
|
||||||
|
return view("roles.index", compact('creator', 'updater', 'destroyer'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -13,7 +13,27 @@ class SyncronizeController extends Controller
|
|||||||
$this->service_simbg = $service_simbg;
|
$this->service_simbg = $service_simbg;
|
||||||
}
|
}
|
||||||
public function index(Request $request){
|
public function index(Request $request){
|
||||||
return view('settings.syncronize.index');
|
$menuId = $request->query('menu_id');
|
||||||
|
$user = Auth::user();
|
||||||
|
$userId = $user->id;
|
||||||
|
|
||||||
|
// Ambil role_id yang dimiliki user
|
||||||
|
$roleIds = DB::table('user_role')
|
||||||
|
->where('user_id', $userId)
|
||||||
|
->pluck('role_id');
|
||||||
|
|
||||||
|
// Ambil data akses berdasarkan role_id dan menu_id
|
||||||
|
$roleAccess = DB::table('role_menu')
|
||||||
|
->whereIn('role_id', $roleIds)
|
||||||
|
->where('menu_id', $menuId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||||
|
$creator = $roleAccess->allow_create ?? 0;
|
||||||
|
$updater = $roleAccess->allow_update ?? 0;
|
||||||
|
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||||
|
|
||||||
|
return view('settings.syncronize.index', compact('creator', 'updater', 'destroyer'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function syncPbgTask(){
|
public function syncPbgTask(){
|
||||||
|
|||||||
@@ -31,6 +31,11 @@ class BusinessIndustries {
|
|||||||
let tableContainer = document.getElementById(
|
let tableContainer = document.getElementById(
|
||||||
"table-business-industries"
|
"table-business-industries"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
tableContainer.innerHTML = "";
|
||||||
|
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||||
|
let canDelete = tableContainer.getAttribute("data-destroyer") === "1";
|
||||||
|
|
||||||
// Create a new Grid.js instance only if it doesn't exist
|
// Create a new Grid.js instance only if it doesn't exist
|
||||||
this.table = new Grid({
|
this.table = new Grid({
|
||||||
columns: [
|
columns: [
|
||||||
@@ -50,17 +55,30 @@ class BusinessIndustries {
|
|||||||
{ name: "Created", width: "180px" },
|
{ name: "Created", width: "180px" },
|
||||||
{
|
{
|
||||||
name: "Action",
|
name: "Action",
|
||||||
formatter: (cell) =>
|
formatter: (cell) => {
|
||||||
gridjs.html(`
|
|
||||||
<div class="d-flex justify-content-center gap-2">
|
let buttons = `<div class="d-flex justify-content-center gap-2">`;
|
||||||
<a href="/data/business-industries/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
|
||||||
<i class='bx bx-edit'></i>
|
if (canUpdate) {
|
||||||
</a>
|
buttons += `
|
||||||
<button data-id="${cell}" class="btn btn-sm btn-red btn-delete-business-industry d-inline-flex align-items-center justify-content-center">
|
<a href="/data/business-industries/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||||
<i class='bx bxs-trash' ></i>
|
<i class='bx bx-edit'></i>
|
||||||
</button>
|
</a>
|
||||||
</div>
|
`;
|
||||||
`),
|
}
|
||||||
|
|
||||||
|
if (canDelete) {
|
||||||
|
buttons += `
|
||||||
|
<button data-id="${cell}" class="btn btn-sm btn-red btn-delete-business-industry d-inline-flex align-items-center justify-content-center">
|
||||||
|
<i class='bx bxs-trash'></i>
|
||||||
|
</button>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
buttons += `</div>`;
|
||||||
|
|
||||||
|
return gridjs.html(buttons);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
pagination: {
|
pagination: {
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ class Customers {
|
|||||||
initTableCustomers() {
|
initTableCustomers() {
|
||||||
let tableContainer = document.getElementById("table-customers");
|
let tableContainer = document.getElementById("table-customers");
|
||||||
// Create a new Grid.js instance only if it doesn't exist
|
// Create a new Grid.js instance only if it doesn't exist
|
||||||
|
|
||||||
|
tableContainer.innerHTML = "";
|
||||||
|
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||||
|
let canDelete = tableContainer.getAttribute("data-destroyer") === "1";
|
||||||
this.table = new Grid({
|
this.table = new Grid({
|
||||||
columns: [
|
columns: [
|
||||||
"ID",
|
"ID",
|
||||||
@@ -39,17 +43,31 @@ class Customers {
|
|||||||
"Longitude",
|
"Longitude",
|
||||||
{
|
{
|
||||||
name: "Action",
|
name: "Action",
|
||||||
formatter: (cell) =>
|
formatter: (cell) => {
|
||||||
gridjs.html(`
|
let buttons = "";
|
||||||
<div class="d-flex justify-content-center gap-2">
|
|
||||||
<a href="/data/customers/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
if (canUpdate) {
|
||||||
<i class='bx bx-edit'></i>
|
buttons += `
|
||||||
</a>
|
<a href="/data/customers/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||||
<button data-id="${cell}" class="btn btn-sm btn-red btn-delete-customers d-inline-flex align-items-center justify-content-center">
|
<i class='bx bx-edit'></i>
|
||||||
<i class='bx bxs-trash' ></i>
|
</a>
|
||||||
</button>
|
`;
|
||||||
</div>
|
}
|
||||||
`),
|
|
||||||
|
if (canDelete) {
|
||||||
|
buttons += `
|
||||||
|
<button data-id="${cell}" class="btn btn-sm btn-red btn-delete-customers d-inline-flex align-items-center justify-content-center">
|
||||||
|
<i class='bx bxs-trash'></i>
|
||||||
|
</button>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!canUpdate && !canDelete) {
|
||||||
|
buttons = `<span class="text-muted">No Privilege</span>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return gridjs.html(`<div class="d-flex justify-content-center gap-2">${buttons}</div>`);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
pagination: {
|
pagination: {
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ class DataSettings {
|
|||||||
|
|
||||||
initTableDataSettings() {
|
initTableDataSettings() {
|
||||||
let tableContainer = document.getElementById("table-data-settings");
|
let tableContainer = document.getElementById("table-data-settings");
|
||||||
|
|
||||||
|
tableContainer.innerHTML = "";
|
||||||
|
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||||
|
let canDelete = tableContainer.getAttribute("data-destroyer") === "1"
|
||||||
// Create a new Grid.js instance only if it doesn't exist
|
// Create a new Grid.js instance only if it doesn't exist
|
||||||
this.table = new Grid({
|
this.table = new Grid({
|
||||||
columns: [
|
columns: [
|
||||||
@@ -40,16 +44,29 @@ class DataSettings {
|
|||||||
name: "Actions",
|
name: "Actions",
|
||||||
width: "120px",
|
width: "120px",
|
||||||
formatter: function (cell) {
|
formatter: function (cell) {
|
||||||
return gridjs.html(`
|
let buttons = "";
|
||||||
<div class="d-flex justify-content-center gap-2">
|
|
||||||
|
if (canUpdate) {
|
||||||
|
buttons += `
|
||||||
<a href="/data-settings/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
<a href="/data-settings/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||||
<i class='bx bx-edit'></i>
|
<i class='bx bx-edit'></i>
|
||||||
</a>
|
</a>
|
||||||
<button class="btn btn-sm btn-red d-inline-flex align-items-center justify-content-center btn-delete-data-settings" data-id="${cell}">
|
`;
|
||||||
<i class='bx bxs-trash' ></i>
|
}
|
||||||
|
|
||||||
|
if (canDelete) {
|
||||||
|
buttons += `
|
||||||
|
<button class="btn btn-sm btn-red d-inline-flex align-items-center justify-content-center btn-delete-data-settings" data-id="${cell}">
|
||||||
|
<i class='bx bxs-trash'></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
`;
|
||||||
`);
|
}
|
||||||
|
|
||||||
|
if (!canUpdate && !canDelete) {
|
||||||
|
buttons = `<span class="text-muted">No Privilege</span>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return gridjs.html(`<div class="d-flex justify-content-center gap-2">${buttons}</div>`);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ import "gridjs/dist/gridjs.umd.js";
|
|||||||
import GlobalConfig from "../../global-config.js";
|
import GlobalConfig from "../../global-config.js";
|
||||||
import GeneralTable from "../../table-generator.js";
|
import GeneralTable from "../../table-generator.js";
|
||||||
|
|
||||||
|
// Ambil hak akses dari data-attribute
|
||||||
|
const tableElement = document.getElementById("reklame-data-table");
|
||||||
|
const canUpdate = tableElement.getAttribute("data-updater") === "1";
|
||||||
|
const canDelete = tableElement.getAttribute("data-destroyer") === "1";
|
||||||
|
|
||||||
const dataAdvertisementsColumns = [
|
const dataAdvertisementsColumns = [
|
||||||
"No",
|
"No",
|
||||||
"Nama Wajib Pajak",
|
"Nama Wajib Pajak",
|
||||||
@@ -17,21 +22,39 @@ const dataAdvertisementsColumns = [
|
|||||||
"Kontak",
|
"Kontak",
|
||||||
{
|
{
|
||||||
name: "Actions",
|
name: "Actions",
|
||||||
widht: "120px",
|
width: "120px",
|
||||||
formatter: function(cell, row) {
|
formatter: function(cell, row) {
|
||||||
const id = row.cells[10].data;
|
const id = row.cells[10].data;
|
||||||
const model = "data/advertisements";
|
const model = "data/advertisements";
|
||||||
return gridjs.html(`
|
|
||||||
<div class="d-flex justify-items-end gap-10">
|
let actionButtons = '<div class="d-flex justify-items-end gap-10">';
|
||||||
|
let hasPrivilege = false;
|
||||||
|
|
||||||
|
// Tampilkan tombol Edit jika user punya akses update
|
||||||
|
if (canUpdate) {
|
||||||
|
hasPrivilege = true;
|
||||||
|
actionButtons += `
|
||||||
<button class="btn btn-warning me-2 btn-edit"
|
<button class="btn btn-warning me-2 btn-edit"
|
||||||
data-id="${id}"
|
data-id="${id}"
|
||||||
data-model="${model}">
|
data-model="${model}">
|
||||||
<i class='bx bx-edit' ></i></button>
|
<i class='bx bx-edit'></i>
|
||||||
|
</button>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tampilkan tombol Delete jika user punya akses delete
|
||||||
|
if (canDelete) {
|
||||||
|
hasPrivilege = true;
|
||||||
|
actionButtons += `
|
||||||
<button class="btn btn-red btn-delete"
|
<button class="btn btn-red btn-delete"
|
||||||
data-id="${id}">
|
data-id="${id}">
|
||||||
<i class='bx bxs-trash' ></i></button>
|
<i class='bx bxs-trash'></i>
|
||||||
</div>
|
</button>`;
|
||||||
`);
|
}
|
||||||
|
|
||||||
|
actionButtons += '</div>';
|
||||||
|
|
||||||
|
// Jika tidak memiliki akses, tampilkan teks "No Privilege"
|
||||||
|
return gridjs.html(hasPrivilege ? actionButtons : '<span class="text-muted">No Privilege</span>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ import "gridjs/dist/gridjs.umd.js";
|
|||||||
import GlobalConfig from "../../global-config.js";
|
import GlobalConfig from "../../global-config.js";
|
||||||
import GeneralTable from "../../table-generator.js";
|
import GeneralTable from "../../table-generator.js";
|
||||||
|
|
||||||
|
// Ambil hak akses dari data-attribute
|
||||||
|
const tableElement = document.getElementById("spatial-planning-data-table");
|
||||||
|
const canUpdate = tableElement.getAttribute("data-updater") === "1";
|
||||||
|
const canDelete = tableElement.getAttribute("data-destroyer") === "1";
|
||||||
|
|
||||||
const dataSpatialPlanningColumns = [
|
const dataSpatialPlanningColumns = [
|
||||||
"No",
|
"No",
|
||||||
"Nama",
|
"Nama",
|
||||||
@@ -19,18 +24,35 @@ const dataSpatialPlanningColumns = [
|
|||||||
formatter: function (cell, row) {
|
formatter: function (cell, row) {
|
||||||
const id = row.cells[8].data;
|
const id = row.cells[8].data;
|
||||||
const model = "data/spatial-plannings";
|
const model = "data/spatial-plannings";
|
||||||
return gridjs.html(`
|
|
||||||
<div class="d-flex justify-items-end gap-10">
|
let actionButtons = '<div class="d-flex justify-items-end gap-10">';
|
||||||
|
let hasPrivilege = false;
|
||||||
|
|
||||||
|
// Tampilkan tombol Edit jika user punya akses update
|
||||||
|
if (canUpdate) {
|
||||||
|
hasPrivilege = true;
|
||||||
|
actionButtons += `
|
||||||
<button class="btn btn-warning me-2 btn-edit"
|
<button class="btn btn-warning me-2 btn-edit"
|
||||||
data-id="${id}"
|
data-id="${id}"
|
||||||
data-model="${model}">
|
data-model="${model}">
|
||||||
<i class='bx bx-edit'></i></button>
|
<i class='bx bx-edit'></i>
|
||||||
|
</button>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tampilkan tombol Delete jika user punya akses delete
|
||||||
|
if (canDelete) {
|
||||||
|
hasPrivilege = true;
|
||||||
|
actionButtons += `
|
||||||
<button class="btn btn-red btn-delete"
|
<button class="btn btn-red btn-delete"
|
||||||
data-id="${id}">
|
data-id="${id}">
|
||||||
<i class='bx bxs-trash'></i></button>
|
<i class='bx bxs-trash'></i>
|
||||||
</div>
|
</button>`;
|
||||||
`);
|
}
|
||||||
|
|
||||||
|
actionButtons += '</div>';
|
||||||
|
|
||||||
|
// Jika tidak memiliki akses, tampilkan teks "No Privilege"
|
||||||
|
return gridjs.html(hasPrivilege ? actionButtons : '<span class="text-muted">No Privilege</span>');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -3,6 +3,14 @@ import gridjs from "gridjs/dist/gridjs.umd.js";
|
|||||||
import "gridjs/dist/gridjs.umd.js";
|
import "gridjs/dist/gridjs.umd.js";
|
||||||
import GlobalConfig from "../../global-config.js";
|
import GlobalConfig from "../../global-config.js";
|
||||||
import GeneralTable from "../../table-generator.js";
|
import GeneralTable from "../../table-generator.js";
|
||||||
|
import L from "leaflet";
|
||||||
|
import "leaflet/dist/leaflet.css";
|
||||||
|
|
||||||
|
// Ambil hak akses dari data-attribute
|
||||||
|
const tableElement = document.getElementById("tourisms-data-table");
|
||||||
|
const canView = "1";
|
||||||
|
const canUpdate = tableElement.getAttribute("data-updater") === "1";
|
||||||
|
const canDelete = tableElement.getAttribute("data-destroyer") === "1";
|
||||||
|
|
||||||
const dataTourismsColumns = [
|
const dataTourismsColumns = [
|
||||||
"No",
|
"No",
|
||||||
@@ -21,26 +29,49 @@ const dataTourismsColumns = [
|
|||||||
widht: "120px",
|
widht: "120px",
|
||||||
formatter: function (cell, row) {
|
formatter: function (cell, row) {
|
||||||
const id = row.cells[11].data;
|
const id = row.cells[11].data;
|
||||||
|
const district = row.cells[4].data;
|
||||||
const long = row.cells[9].data;
|
const long = row.cells[9].data;
|
||||||
const lat = row.cells[10].data;
|
const lat = row.cells[10].data;
|
||||||
const model = "data/tourisms";
|
const model = "data/tourisms";
|
||||||
return gridjs.html(`
|
|
||||||
<div class="d-flex justify-items-end gap-10">
|
let actionButtons = '<div class="d-flex justify-items-end gap-10">';
|
||||||
<button class="btn btn-warning me-2 btn-edit"
|
let hasPrivilege = false;
|
||||||
data-id="${id}"
|
|
||||||
data-model="${model}">
|
// Tampilkan tombol View jika user punya akses view
|
||||||
<i class='bx bx-edit'></i></button>
|
if (canView) {
|
||||||
|
hasPrivilege = true;
|
||||||
<button class="btn btn-info me-2 btn-view"
|
actionButtons += `
|
||||||
data-long="${long}" data-lat="${lat}">
|
<button class="btn btn-info me-2 btn-view"
|
||||||
<i class='bx bx-map'></i></button>
|
data-long="${long}" data-lat="${lat}" data-district="${district}">
|
||||||
|
<i class='bx bx-map'></i>
|
||||||
|
</button>`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tampilkan tombol Edit jika user punya akses update
|
||||||
|
if (canUpdate) {
|
||||||
|
hasPrivilege = true;
|
||||||
|
actionButtons += `
|
||||||
|
<button class="btn btn-warning me-2 btn-edit"
|
||||||
|
data-id="${id}"
|
||||||
|
data-model="${model}">
|
||||||
|
<i class='bx bx-edit'></i>
|
||||||
|
</button>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tampilkan tombol Delete jika user punya akses delete
|
||||||
|
if (canDelete) {
|
||||||
|
hasPrivilege = true;
|
||||||
|
actionButtons += `
|
||||||
<button class="btn btn-red btn-delete"
|
<button class="btn btn-red btn-delete"
|
||||||
data-id="${id}">
|
data-id="${id}">
|
||||||
<i class='bx bxs-trash'></i></button>
|
<i class='bx bxs-trash'></i>
|
||||||
</div>
|
</button>`
|
||||||
`);
|
}
|
||||||
},
|
|
||||||
|
actionButtons += '</div>';
|
||||||
|
// Jika tidak memiliki akses, tampilkan teks "No Privilege"
|
||||||
|
return gridjs.html(hasPrivilege ? actionButtons : '<span class="text-muted">No Privilege</span>');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -74,24 +105,117 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
table.init();
|
table.init();
|
||||||
|
|
||||||
// Event listener untuk tombol "View" yang memunculkan modal
|
// Event listener untuk tombol "View" yang memunculkan modal
|
||||||
|
// document.addEventListener("click", function (e) {
|
||||||
|
// if (e.target && e.target.classList.contains("btn-view")) {
|
||||||
|
// const long = e.target.getAttribute("data-long");
|
||||||
|
// const lat = e.target.getAttribute("data-lat");
|
||||||
|
|
||||||
|
// // Menyiapkan URL iframe dengan koordinat yang didapatkan
|
||||||
|
// const iframeSrc = `https://www.google.com/maps?q=${lat},${long}&hl=es;z=14&output=embed`;
|
||||||
|
|
||||||
|
// // Menemukan modal dan iframe di dalam modal
|
||||||
|
// const modal = document.querySelector(".modalGMaps");
|
||||||
|
// const iframe = modal.querySelector("iframe");
|
||||||
|
|
||||||
|
// // Set src iframe untuk menampilkan peta dengan koordinat yang relevan
|
||||||
|
// iframe.src = iframeSrc;
|
||||||
|
|
||||||
|
// // Menampilkan modal
|
||||||
|
// var modalInstance = new bootstrap.Modal(modal);
|
||||||
|
// modalInstance.show();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
let map;
|
||||||
|
let geoLayer;
|
||||||
|
// Event listener untuk tombol "View" yang memunculkan modal dengan Leaflet
|
||||||
document.addEventListener("click", function (e) {
|
document.addEventListener("click", function (e) {
|
||||||
if (e.target && e.target.classList.contains("btn-view")) {
|
if (e.target && e.target.classList.contains("btn-view")) {
|
||||||
const long = e.target.getAttribute("data-long");
|
const long = parseFloat(e.target.getAttribute("data-long"));
|
||||||
const lat = e.target.getAttribute("data-lat");
|
const lat = parseFloat(e.target.getAttribute("data-lat"));
|
||||||
|
const district = e.target.getAttribute("data-district");
|
||||||
|
|
||||||
// Menyiapkan URL iframe dengan koordinat yang didapatkan
|
|
||||||
const iframeSrc = `https://www.google.com/maps?q=${lat},${long}&hl=es;z=14&output=embed`;
|
|
||||||
|
|
||||||
// Menemukan modal dan iframe di dalam modal
|
|
||||||
const modal = document.querySelector(".modalGMaps");
|
const modal = document.querySelector(".modalGMaps");
|
||||||
const iframe = modal.querySelector("iframe");
|
|
||||||
|
|
||||||
// Set src iframe untuk menampilkan peta dengan koordinat yang relevan
|
|
||||||
iframe.src = iframeSrc;
|
|
||||||
|
|
||||||
// Menampilkan modal
|
|
||||||
var modalInstance = new bootstrap.Modal(modal);
|
var modalInstance = new bootstrap.Modal(modal);
|
||||||
modalInstance.show();
|
modalInstance.show();
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
if (!map) {
|
||||||
|
map = L.map("map").setView([lat, long], 14);
|
||||||
|
|
||||||
|
// Tambahkan tile layer (peta dasar)
|
||||||
|
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
|
||||||
|
attribution: '© OpenStreetMap contributors'
|
||||||
|
}).addTo(map);
|
||||||
|
} else {
|
||||||
|
map.setView([lat, long], 14);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (geoLayer) {
|
||||||
|
map.removeLayer(geoLayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tambahkan marker untuk lokasi
|
||||||
|
L.marker([lat, long]).addTo(map)
|
||||||
|
.bindPopup(`<b>${district}</b><br>Lat: ${lat}, Long: ${long}`)
|
||||||
|
.openPopup();
|
||||||
|
|
||||||
|
// Tambahkan GeoJSON ke dalam peta
|
||||||
|
fetch(`/storage/maps/tourisms/${district.toUpperCase()}.json`)
|
||||||
|
.then((res) => res.json())
|
||||||
|
.then((geojson) => {
|
||||||
|
let colorMapping = {
|
||||||
|
BJ: "rgb(235, 30, 30)",
|
||||||
|
BA: "rgb(151, 219, 242)",
|
||||||
|
CA: "rgb(70, 70, 165)",
|
||||||
|
"P-2": "rgb(230, 255, 75)",
|
||||||
|
HL: "rgb(50, 95, 40)",
|
||||||
|
HPT: "rgb(75, 155, 55)",
|
||||||
|
HP: "rgb(125, 180, 55)",
|
||||||
|
W: "rgb(255, 165, 255)",
|
||||||
|
PTL: "rgb(0, 255, 205)",
|
||||||
|
"IK-2": "rgb(130, 185, 210)",
|
||||||
|
"P-3": "rgb(175, 175, 55)",
|
||||||
|
PS: "rgb(5, 215, 215)",
|
||||||
|
PD: "rgb(235, 155, 60)",
|
||||||
|
PK: "rgb(245, 155, 30)",
|
||||||
|
HK: "rgb(155, 0, 255)",
|
||||||
|
KPI: "rgb(105, 0, 0)",
|
||||||
|
MBT: "rgb(95, 115, 145)",
|
||||||
|
"P-4": "rgb(185, 235, 185)",
|
||||||
|
TB: "rgb(70, 150, 255)",
|
||||||
|
"P-1": "rgb(200, 245, 70)",
|
||||||
|
TR: "rgb(215, 55, 0)",
|
||||||
|
THR: "rgb(185, 165, 255)",
|
||||||
|
TWA: "rgb(210, 190, 255)",
|
||||||
|
};
|
||||||
|
var geoLayer = L.geoJSON(geojson, {
|
||||||
|
style: function (feature) {
|
||||||
|
let htmlString = feature.properties.description.toString();
|
||||||
|
let match = htmlString.match(
|
||||||
|
/<td>Kode Zona<\/td>\s*<td>(.*?)<\/td>/
|
||||||
|
);
|
||||||
|
|
||||||
|
let color_code = match[1];
|
||||||
|
return {
|
||||||
|
color: colorMapping[color_code],
|
||||||
|
fillColor: colorMapping[color_code] || "#cccccc",
|
||||||
|
fillOpacity: 0.6,
|
||||||
|
weight: 1.5,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onEachFeature: function(feature, layer) {
|
||||||
|
if (feature.properties && feature.properties.name) {
|
||||||
|
layer.bindPopup(feature.properties.name);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}).addTo(map);
|
||||||
|
map.fitBounds(geoLayer.getBounds());
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error("Error loading GeoJSON:", error);
|
||||||
|
});
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,6 +3,11 @@ import "gridjs/dist/gridjs.umd.js";
|
|||||||
import GlobalConfig from "../../global-config.js";
|
import GlobalConfig from "../../global-config.js";
|
||||||
import GeneralTable from "../../table-generator.js";
|
import GeneralTable from "../../table-generator.js";
|
||||||
|
|
||||||
|
// Ambil hak akses dari data-attribute
|
||||||
|
const tableElement = document.getElementById("umkm-data-table");
|
||||||
|
const canUpdate = tableElement.getAttribute("data-updater") === "1";
|
||||||
|
const canDelete = tableElement.getAttribute("data-destroyer") === "1";
|
||||||
|
|
||||||
const dataUMKMColumns = [
|
const dataUMKMColumns = [
|
||||||
"No",
|
"No",
|
||||||
"Nama Usaha",
|
"Nama Usaha",
|
||||||
@@ -29,17 +34,35 @@ const dataUMKMColumns = [
|
|||||||
formatter: function(cell, row) {
|
formatter: function(cell, row) {
|
||||||
const id = row.cells[19].data;
|
const id = row.cells[19].data;
|
||||||
const model = "data/umkm";
|
const model = "data/umkm";
|
||||||
return gridjs.html(`
|
|
||||||
<div class="d-flex justify-items-end gap-10">
|
let actionButtons = '<div class="d-flex justify-items-end gap-10">';
|
||||||
|
let hasPrivilege = false;
|
||||||
|
|
||||||
|
// Tampilkan tombol Edit jika user punya akses update
|
||||||
|
if (canUpdate) {
|
||||||
|
hasPrivilege = true;
|
||||||
|
actionButtons += `
|
||||||
<button class="btn btn-warning me-2 btn-edit"
|
<button class="btn btn-warning me-2 btn-edit"
|
||||||
data-id="${id}"
|
data-id="${id}"
|
||||||
data-model="${model}">
|
data-model="${model}">
|
||||||
<i class='bx bx-edit' ></i></button>
|
<i class='bx bx-edit'></i>
|
||||||
|
</button>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tampilkan tombol Delete jika user punya akses delete
|
||||||
|
if (canDelete) {
|
||||||
|
hasPrivilege = true;
|
||||||
|
actionButtons += `
|
||||||
<button class="btn btn-red btn-delete"
|
<button class="btn btn-red btn-delete"
|
||||||
data-id="${id}">
|
data-id="${id}">
|
||||||
<i class='bx bxs-trash' ></i></button>
|
<i class='bx bxs-trash'></i>
|
||||||
</div>
|
</button>`;
|
||||||
`);
|
}
|
||||||
|
|
||||||
|
actionButtons += '</div>';
|
||||||
|
|
||||||
|
// Jika tidak memiliki akses, tampilkan teks "No Privilege"
|
||||||
|
return gridjs.html(hasPrivilege ? actionButtons : '<span class="text-muted">No Privilege</span>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -9,6 +9,12 @@ class UsersTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initTableUsers() {
|
initTableUsers() {
|
||||||
|
let tableContainer = document.getElementById(
|
||||||
|
"table-users"
|
||||||
|
);
|
||||||
|
|
||||||
|
tableContainer.innerHTML = "";
|
||||||
|
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||||
new Grid({
|
new Grid({
|
||||||
columns: [
|
columns: [
|
||||||
"ID",
|
"ID",
|
||||||
@@ -20,14 +26,18 @@ class UsersTable {
|
|||||||
"Roles",
|
"Roles",
|
||||||
{
|
{
|
||||||
name: "Action",
|
name: "Action",
|
||||||
formatter: (cell) =>
|
formatter: (cell) =>{
|
||||||
gridjs.html(`
|
if (!canUpdate) {
|
||||||
|
return gridjs.html(`<span class="text-muted">No Privilege</span>`);
|
||||||
|
}
|
||||||
|
return gridjs.html(`
|
||||||
<div class="d-flex justify-content-center">
|
<div class="d-flex justify-content-center">
|
||||||
<a href="/master/users/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
<a href="/master/users/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||||
<i class='bx bx-edit'></i>
|
<i class='bx bx-edit'></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
`),
|
`);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
pagination: {
|
pagination: {
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ class Menus {
|
|||||||
initTableMenus() {
|
initTableMenus() {
|
||||||
let tableContainer = document.getElementById("table-menus");
|
let tableContainer = document.getElementById("table-menus");
|
||||||
|
|
||||||
|
tableContainer.innerHTML = "";
|
||||||
|
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||||
|
let canDelete = tableContainer.getAttribute("data-destroyer") === "1";
|
||||||
if (this.table) {
|
if (this.table) {
|
||||||
// If table exists, update its data instead of recreating
|
// If table exists, update its data instead of recreating
|
||||||
this.table
|
this.table
|
||||||
@@ -68,18 +71,33 @@ class Menus {
|
|||||||
"Sort Order",
|
"Sort Order",
|
||||||
{
|
{
|
||||||
name: "Action",
|
name: "Action",
|
||||||
formatter: (cell) =>
|
formatter: (cell) => {
|
||||||
gridjs.html(`
|
let buttons = `<div class="d-flex justify-content-center align-items-center gap-2">`;
|
||||||
<div class="d-flex justify-content-center align-items-center gap-2">
|
|
||||||
<a href="/menus/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
if (canUpdate) {
|
||||||
<i class='bx bx-edit'></i>
|
buttons += `
|
||||||
</a>
|
<a href="/menus/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||||
<button data-id="${cell}"
|
<i class='bx bx-edit'></i>
|
||||||
class="btn btn-red btn-sm btn-delete-menu d-inline-flex align-items-center justify-content-center">
|
</a>
|
||||||
<i class='bx bxs-trash' ></i>
|
`;
|
||||||
</button>
|
}
|
||||||
</div>
|
|
||||||
`),
|
if (canDelete) {
|
||||||
|
buttons += `
|
||||||
|
<button data-id="${cell}" class="btn btn-red btn-sm btn-delete-menu d-inline-flex align-items-center justify-content-center">
|
||||||
|
<i class='bx bxs-trash'></i>
|
||||||
|
</button>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!canUpdate && !canDelete) {
|
||||||
|
buttons += `<span class="text-muted">No Privilege</span>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
buttons += `</div>`;
|
||||||
|
|
||||||
|
return gridjs.html(buttons);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
pagination: {
|
pagination: {
|
||||||
|
|||||||
@@ -9,6 +9,11 @@ class PbgTasks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initTableRequestAssignment() {
|
initTableRequestAssignment() {
|
||||||
|
let tableContainer = document.getElementById("table-pbg-tasks");
|
||||||
|
|
||||||
|
// Pastikan kontainer kosong sebelum merender ulang Grid.js
|
||||||
|
tableContainer.innerHTML = "";
|
||||||
|
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||||
new Grid({
|
new Grid({
|
||||||
columns: [
|
columns: [
|
||||||
"ID",
|
"ID",
|
||||||
@@ -24,13 +29,24 @@ class PbgTasks {
|
|||||||
{
|
{
|
||||||
name: "Action",
|
name: "Action",
|
||||||
formatter: function (cell) {
|
formatter: function (cell) {
|
||||||
|
let tableContainer = document.getElementById("table-pbg-tasks");
|
||||||
|
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||||
|
|
||||||
|
if (!canUpdate) {
|
||||||
|
return gridjs.html(`
|
||||||
|
<span class="text-muted">No Privilege</span>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
|
||||||
return gridjs.html(`
|
return gridjs.html(`
|
||||||
<div class="d-flex justify-content-center align-items-center gap-2">
|
<div class="d-flex justify-content-center align-items-center gap-2">
|
||||||
<a href="/pbg-task/${cell}" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">Detail</a
|
<a href="/pbg-task/${cell}" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||||
|
Detail
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
search: {
|
search: {
|
||||||
server: {
|
server: {
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ class Roles {
|
|||||||
|
|
||||||
initTableRoles() {
|
initTableRoles() {
|
||||||
let tableContainer = document.getElementById("table-roles");
|
let tableContainer = document.getElementById("table-roles");
|
||||||
|
|
||||||
|
tableContainer.innerHTML = "";
|
||||||
|
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||||
|
let canDelete = tableContainer.getAttribute("data-destroyer") === "1";
|
||||||
// Create a new Grid.js instance only if it doesn't exist
|
// Create a new Grid.js instance only if it doesn't exist
|
||||||
this.table = new gridjs.Grid({
|
this.table = new gridjs.Grid({
|
||||||
columns: [
|
columns: [
|
||||||
@@ -34,22 +38,38 @@ class Roles {
|
|||||||
"Name",
|
"Name",
|
||||||
"Description",
|
"Description",
|
||||||
{
|
{
|
||||||
name: "Action",
|
name: "Action",
|
||||||
formatter: (cell) =>
|
formatter: (cell) => {
|
||||||
gridjs.html(`
|
let buttons = `<div class="d-flex justify-content-center gap-2">`;
|
||||||
<div class="d-flex justify-content-center gap-2">
|
|
||||||
<a href="/roles/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
if (canUpdate) {
|
||||||
<i class='bx bx-edit'></i>
|
buttons += `
|
||||||
</a>
|
<a href="/roles/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||||
<a href="/roles/role-menu/${cell}" class="btn btn-primary btn-sm d-inline-flex align-items-center justify-content-center">
|
<i class='bx bx-edit'></i>
|
||||||
Role Menu
|
</a>
|
||||||
</a>
|
<a href="/roles/role-menu/${cell}" class="btn btn-primary btn-sm d-inline-flex align-items-center justify-content-center">
|
||||||
<button data-id="${cell}" class="btn btn-sm btn-red btn-delete-role d-inline-flex align-items-center justify-content-center">
|
Role Menu
|
||||||
<i class='bx bxs-trash' ></i>
|
</a>
|
||||||
</button>
|
`;
|
||||||
</div>
|
}
|
||||||
`),
|
|
||||||
|
if (canDelete) {
|
||||||
|
buttons += `
|
||||||
|
<button data-id="${cell}" class="btn btn-sm btn-red btn-delete-role d-inline-flex align-items-center justify-content-center">
|
||||||
|
<i class='bx bxs-trash'></i>
|
||||||
|
</button>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!canUpdate && !canDelete) {
|
||||||
|
buttons += `<span class="text-muted">No Privilege</span>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
buttons += `</div>`;
|
||||||
|
|
||||||
|
return gridjs.html(buttons);
|
||||||
},
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
pagination: {
|
pagination: {
|
||||||
limit: 50,
|
limit: 50,
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ class GeneralTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
|
const tableContainer = document.getElementById(this.tableId);
|
||||||
|
|
||||||
|
// Kosongkan container sebelum render ulang
|
||||||
|
tableContainer.innerHTML = "";
|
||||||
|
|
||||||
const table = new Grid({
|
const table = new Grid({
|
||||||
columns: this.columns,
|
columns: this.columns,
|
||||||
search: this.options.search || {
|
search: this.options.search || {
|
||||||
@@ -39,8 +44,8 @@ class GeneralTable {
|
|||||||
total: (data) => data.meta.total,
|
total: (data) => data.meta.total,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
table.render(document.getElementById(this.tableId));
|
table.render(tableContainer);
|
||||||
this.handleActions();
|
this.handleActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,14 @@
|
|||||||
<div class="card w-100">
|
<div class="card w-100">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
||||||
<a href="{{ route('business-industries.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Upload</a>
|
@if ($creator)
|
||||||
|
<a href="{{ route('business-industries.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Upload</a>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
<div id="table-business-industries"
|
||||||
|
data-updater="{{ $updater }}"
|
||||||
|
data-destroyer="{{ $destroyer }}">
|
||||||
</div>
|
</div>
|
||||||
<div id="table-business-industries"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,10 +15,15 @@
|
|||||||
<div class="card w-100">
|
<div class="card w-100">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
||||||
<a href="{{ route('customers.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto me-3">Create</a>
|
@if ($creator)
|
||||||
<a href="{{ route('customers.upload')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Upload</a>
|
<a href="{{ route('customers.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto me-3">Create</a>
|
||||||
|
<a href="{{ route('customers.upload')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Upload</a>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
<div id="table-customers"
|
||||||
|
data-updater="{{ $updater }}"
|
||||||
|
data-destroyer="{{ $destroyer }}">
|
||||||
</div>
|
</div>
|
||||||
<div id="table-customers"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,9 +15,14 @@
|
|||||||
<div class="card w-100">
|
<div class="card w-100">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
||||||
<a href="{{ route('data-settings.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
@if ($creator)
|
||||||
|
<a href="{{ route('data-settings.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
<div id="table-data-settings"
|
||||||
|
data-updater="{{ $updater }}"
|
||||||
|
data-destroyer="{{ $destroyer }}">
|
||||||
</div>
|
</div>
|
||||||
<div id="table-data-settings"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,16 +16,21 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="d-flex justify-content-end gap-10 pb-3">
|
<div class="d-flex justify-content-end gap-10 pb-3">
|
||||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/advertisements">
|
@if ($creator)
|
||||||
<i class='bx bxs-file-plus'></i>
|
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/advertisements">
|
||||||
Create</button>
|
<i class='bx bxs-file-plus'></i>
|
||||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/advertisements">
|
Create</button>
|
||||||
<i class='bx bx-upload' ></i>
|
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/advertisements">
|
||||||
Bulk Create
|
<i class='bx bx-upload' ></i>
|
||||||
</button>
|
Bulk Create
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div id="reklame-data-table"></div>
|
<div id="reklame-data-table"
|
||||||
|
data-updater="{{ $updater }}"
|
||||||
|
data-destroyer="{{ $destroyer }}">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,16 +14,21 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="d-flex justify-content-end gap-10 pb-3">
|
<div class="d-flex justify-content-end gap-10 pb-3">
|
||||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/spatial-plannings">
|
@if ($creator)
|
||||||
<i class='bx bxs-file-plus'></i>
|
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/spatial-plannings">
|
||||||
Create</button>
|
<i class='bx bxs-file-plus'></i>
|
||||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/spatial-plannings">
|
Create</button>
|
||||||
<i class='bx bx-upload' ></i>
|
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/spatial-plannings">
|
||||||
Bulk Create
|
<i class='bx bx-upload' ></i>
|
||||||
</button>
|
Bulk Create
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div id="spatial-planning-data-table"></div>
|
<div id="spatial-planning-data-table"
|
||||||
|
data-updater="{{ $updater }}"
|
||||||
|
data-destroyer="{{ $destroyer }}">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,16 +14,21 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="d-flex justify-content-end gap-10 pb-3">
|
<div class="d-flex justify-content-end gap-10 pb-3">
|
||||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/tourisms">
|
@if ($creator)
|
||||||
<i class='bx bxs-file-plus'></i>
|
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/tourisms">
|
||||||
Create</button>
|
<i class='bx bxs-file-plus'></i>
|
||||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/tourisms">
|
Create</button>
|
||||||
<i class='bx bx-upload' ></i>
|
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/tourisms">
|
||||||
Bulk Create
|
<i class='bx bx-upload' ></i>
|
||||||
</button>
|
Bulk Create
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div id="tourisms-data-table"></div>
|
<div id="tourisms-data-table"
|
||||||
|
data-updater="{{ $updater }}"
|
||||||
|
data-destroyer="{{ $destroyer }}">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -39,14 +44,15 @@
|
|||||||
aria-label="Close"></button>
|
aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<iframe
|
{{-- <iframe
|
||||||
src=""
|
src=""
|
||||||
width="100%"
|
width="100%"
|
||||||
height="450"
|
height="450"
|
||||||
style="border:0;"
|
style="border:0;"
|
||||||
allowfullscreen=""
|
allowfullscreen=""
|
||||||
loading="lazy">
|
loading="lazy">
|
||||||
</iframe>
|
</iframe> --}}
|
||||||
|
<div id="map" style="height: 400px;"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,16 +14,21 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="d-flex justify-content-end gap-10 pb-3">
|
<div class="d-flex justify-content-end gap-10 pb-3">
|
||||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/umkm">
|
@if ($creator)
|
||||||
<i class='bx bxs-file-plus'></i>
|
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/umkm">
|
||||||
Create</button>
|
<i class='bx bxs-file-plus'></i>
|
||||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/umkm">
|
Create</button>
|
||||||
<i class='bx bx-upload' ></i>
|
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/umkm">
|
||||||
Bulk Create
|
<i class='bx bx-upload' ></i>
|
||||||
</button>
|
Bulk Create
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div id="umkm-data-table"></div>
|
<div id="umkm-data-table"
|
||||||
|
data-updater="{{ $updater }}"
|
||||||
|
data-destroyer="{{ $destroyer }}">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,58 +16,49 @@
|
|||||||
<ul class="navbar-nav" id="navbar-nav">
|
<ul class="navbar-nav" id="navbar-nav">
|
||||||
<li class="menu-title">Menu</li>
|
<li class="menu-title">Menu</li>
|
||||||
|
|
||||||
@foreach ($menus as $menu)
|
@php
|
||||||
<li class="nav-item">
|
// Fungsi rekursif untuk menampilkan menu bertingkat dengan indentasi
|
||||||
<!-- parent menu -->
|
function renderMenu($menus, $depth = 0) {
|
||||||
@if ($menu->parent_id == null)
|
foreach ($menus as $menu) {
|
||||||
<a class="nav-link menu-arrow" href="#sidebar-{{$menu->id}}" data-bs-toggle="collapse" role="button"
|
$collapseId = "sidebar-" . $menu->id; // Unique ID untuk Bootstrap Collapse
|
||||||
aria-expanded="true" aria-controls="sidebar-{{$menu->id}}">
|
$hasChildren = $menu->children->count() > 0; // Cek apakah punya anak
|
||||||
|
$marginLeft = $depth * 10; // Set jarak margin berdasarkan level
|
||||||
|
|
||||||
|
echo '<li class="nav-item" style="margin-left: ' . $marginLeft . 'px;">';
|
||||||
|
|
||||||
|
// Menu utama / anak (dengan dropdown jika punya anak)
|
||||||
|
echo '<a class="nav-link ' . ($hasChildren ? 'menu-arrow' : '') . '"
|
||||||
|
href="' . ($hasChildren ? "#$collapseId" : ($menu->url ? (Route::has($menu->url) ? route($menu->url, ['menu_id' => $menu->id]) : $menu->url . '?menu_id=' . $menu->id) : '#')) . '"
|
||||||
|
' . ($hasChildren ? 'data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="' . $collapseId . '"' : '') . '>
|
||||||
<span class="nav-icon">
|
<span class="nav-icon">
|
||||||
<iconify-icon icon="{{$menu->icon}}"></iconify-icon>
|
<iconify-icon icon="' . $menu->icon . '"></iconify-icon>
|
||||||
</span>
|
</span>
|
||||||
<span class="nav-text">{{$menu->name}}</span>
|
<span class="nav-text">' . $menu->name . '</span>
|
||||||
</a>
|
</a>';
|
||||||
@endif
|
// Jika menu punya anak, buat sub-menu
|
||||||
<!-- children menu foreach -->
|
if ($hasChildren) {
|
||||||
@if ($menu->children->count() > 0)
|
echo '<div class="collapse" id="' . $collapseId . '">
|
||||||
<div class="collapse" id="sidebar-{{$menu->id}}">
|
<ul class="nav sub-navbar-nav">';
|
||||||
<ul class="nav sub-navbar-nav">
|
renderMenu($menu->children, $depth + 1); // Rekursi dengan level lebih dalam
|
||||||
@foreach ( $menu->children as $child)
|
echo '</ul></div>';
|
||||||
<li class="sub-nav-item">
|
}
|
||||||
<a class="sub-nav-link" href="{{ $child->url ? (Route::has($child->url) ? route($child->url) : $child->url) : '#' }}">
|
|
||||||
{{ $child->name }}
|
echo '</li>';
|
||||||
</a>
|
}
|
||||||
</li>
|
}
|
||||||
@endforeach
|
@endphp
|
||||||
</ul>
|
|
||||||
</div>
|
@php
|
||||||
@endif
|
// Tampilkan hanya menu dengan parent_id NULL (menu utama)
|
||||||
</li>
|
renderMenu($menus->where('parent_id', null));
|
||||||
@endforeach
|
@endphp
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Efek Bintang -->
|
||||||
<div class="animated-stars">
|
<div class="animated-stars">
|
||||||
<div class="shooting-star"></div>
|
@for ($i = 0; $i < 20; $i++)
|
||||||
<div class="shooting-star"></div>
|
<div class="shooting-star"></div>
|
||||||
<div class="shooting-star"></div>
|
@endfor
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
<div class="shooting-star"></div>
|
|
||||||
</div>
|
</div>
|
||||||
@@ -13,11 +13,16 @@
|
|||||||
<div class="card w-100">
|
<div class="card w-100">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
||||||
<a href="{{ route('users.create') }}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">
|
@if ($creator)
|
||||||
Create
|
<a href="{{ route('users.create') }}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">
|
||||||
</a>
|
Create
|
||||||
|
</a>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
<div id="table-users"
|
||||||
|
data-updater="{{ $updater }}"
|
||||||
|
data-destroyer="{{ $destroyer }}">
|
||||||
</div>
|
</div>
|
||||||
<div id="table-users"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,10 +16,15 @@
|
|||||||
<div class="card w-100">
|
<div class="card w-100">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
||||||
<a href="{{ route('menus.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
@if ($creator)
|
||||||
|
<a href="{{ route('menus.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div id="table-menus"></div>
|
<div id="table-menus"
|
||||||
|
data-updater="{{ $updater }}"
|
||||||
|
data-destroyer="{{ $destroyer }}">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,9 +13,14 @@
|
|||||||
<div class="card w-100">
|
<div class="card w-100">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="d-flex flex-wrap justify-content-end">
|
<div class="d-flex flex-wrap justify-content-end">
|
||||||
<a href="{{ route('pbg-task.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
@if ($creator)
|
||||||
|
<a href="{{ route('pbg-task.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
<div id="table-pbg-tasks"
|
||||||
|
data-updater="{{ $updater }}"
|
||||||
|
data-destroyer="{{ $destroyer }}">
|
||||||
</div>
|
</div>
|
||||||
<div id="table-pbg-tasks"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,9 +16,14 @@
|
|||||||
<div class="card w-100">
|
<div class="card w-100">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
||||||
<a href="{{ route('roles.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
@if ($creator)
|
||||||
|
<a href="{{ route('roles.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
<div id="table-roles"
|
||||||
|
data-updater="{{ $updater }}"
|
||||||
|
data-destroyer="{{ $destroyer }}">
|
||||||
</div>
|
</div>
|
||||||
<div id="table-roles"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,10 +13,12 @@
|
|||||||
<div class="card w-100">
|
<div class="card w-100">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="d-flex flex-wrap justify-content-end gap-2">
|
<div class="d-flex flex-wrap justify-content-end gap-2">
|
||||||
<button type="button" class="btn btn-success btn-sm d-block d-sm-inline w-auto" id="btn-sync-submit">
|
@if ($creator)
|
||||||
<span id="spinner" class="spinner-border spinner-border-sm me-1 d-none" role="status" aria-hidden="true"></span>
|
<button type="button" class="btn btn-success btn-sm d-block d-sm-inline w-auto" id="btn-sync-submit">
|
||||||
Sync SIMBG
|
<span id="spinner" class="spinner-border spinner-border-sm me-1 d-none" role="status" aria-hidden="true"></span>
|
||||||
</button>
|
Sync SIMBG
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div id="table-import-datasources"></div>
|
<div id="table-import-datasources"></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user