add view list data from google sheet
This commit is contained in:
@@ -3,33 +3,15 @@
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\GoogleSheetService;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class GoogleSheetController extends Controller
|
||||
{
|
||||
protected $googleSheetService;
|
||||
public function __construct(GoogleSheetService $googleSheetService){
|
||||
$this->googleSheetService = $googleSheetService;
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
public function index(Request $request)
|
||||
{
|
||||
$dataCollection = $this->googleSheetService->getSheetDataCollection();
|
||||
$result = [
|
||||
"last_row" => $this->googleSheetService->getLastRowByColumn("C"),
|
||||
"last_column" => $this->googleSheetService->getLastColumn(),
|
||||
"header" => $this->googleSheetService->getHeader(),
|
||||
"data_collection" => $dataCollection
|
||||
];
|
||||
return response()->json($result);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
|
||||
55
app/Http/Controllers/Api/PbgTaskGoogleSheetsController.php
Normal file
55
app/Http/Controllers/Api/PbgTaskGoogleSheetsController.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\PbgTaskGoogleSheetResource;
|
||||
use App\Models\PbgTaskGoogleSheet;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PbgTaskGoogleSheetsController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$query = PbgTaskGoogleSheet::query()->orderBy('id', 'desc');
|
||||
if ($request->filled('search')) {
|
||||
$query->where('no_registrasi', 'like', "%{$request->get('search')}%");
|
||||
}
|
||||
return PbgTaskGoogleSheetResource::collection($query->paginate(config('app.paginate_per_page', 50)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,54 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
abstract class Controller
|
||||
{
|
||||
//
|
||||
protected array $permissions = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
if (!Auth::check()) {
|
||||
return;
|
||||
}
|
||||
$this->setUserPermissions();
|
||||
}
|
||||
|
||||
protected function setUserPermissions()
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
if (!$user) {
|
||||
return;
|
||||
}
|
||||
|
||||
$menus = $user->roles()
|
||||
->with(['menus' => function ($query) {
|
||||
$query->select('menus.id', 'menus.name')
|
||||
->withPivot(['allow_show' ,'allow_create', 'allow_update', 'allow_destroy']);
|
||||
}])
|
||||
->get()
|
||||
->pluck('menus')
|
||||
->flatten()
|
||||
->unique('id');
|
||||
|
||||
// Store permissions in an associative array
|
||||
foreach ($menus as $menu) {
|
||||
$this->permissions[$menu->id] = [
|
||||
'allow_show' => $menu->pivot->allow_show ?? 0,
|
||||
'allow_create' => $menu->pivot->allow_create ?? 0,
|
||||
'allow_update' => $menu->pivot->allow_update ?? 0,
|
||||
'allow_destroy' => $menu->pivot->allow_destroy ?? 0,
|
||||
];
|
||||
}
|
||||
|
||||
// Share permissions globally in views
|
||||
view()->share('permissions', $this->permissions);
|
||||
}
|
||||
|
||||
public function getPermissions()
|
||||
{
|
||||
return $this->permissions;
|
||||
}
|
||||
}
|
||||
|
||||
34
app/Http/Controllers/Data/GoogleSheetsController.php
Normal file
34
app/Http/Controllers/Data/GoogleSheetsController.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Data;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class GoogleSheetsController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$menu_id = $request->query('menu_id');
|
||||
$user_menu_permission = $this->permissions[$menu_id];
|
||||
return view('data.google-sheet.index', compact('user_menu_permission'));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('data.google-sheet.create');
|
||||
}
|
||||
|
||||
public function show(string $id)
|
||||
{
|
||||
return view('data.google-sheet.show');
|
||||
}
|
||||
|
||||
public function edit(string $id)
|
||||
{
|
||||
return view('data.google-sheet.edit');
|
||||
}
|
||||
}
|
||||
19
app/Http/Resources/PbgTaskGoogleSheetResource.php
Normal file
19
app/Http/Resources/PbgTaskGoogleSheetResource.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class PbgTaskGoogleSheetResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return parent::toArray($request);
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,13 @@ class RoleMenu extends Model
|
||||
'allow_destroy',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'allow_show' => 'boolean',
|
||||
'allow_create' => 'boolean',
|
||||
'allow_update' => 'boolean',
|
||||
'allow_destroy' => 'boolean',
|
||||
];
|
||||
|
||||
public $timestamps = true;
|
||||
|
||||
public function role(){
|
||||
|
||||
@@ -215,6 +215,13 @@ class UsersRoleMenuSeeder extends Seeder
|
||||
"parent_id" => $data->id,
|
||||
"sort_order" => 7,
|
||||
],
|
||||
[
|
||||
"name" => "Google Sheets",
|
||||
"url" => "google-sheets",
|
||||
"icon" => null,
|
||||
"parent_id" => $data->id,
|
||||
"sort_order" => 8,
|
||||
],
|
||||
[
|
||||
"name" => "Lap Pariwisata",
|
||||
"url" => "tourisms-report.index",
|
||||
@@ -277,6 +284,7 @@ class UsersRoleMenuSeeder extends Seeder
|
||||
$chatbot = Menu::where('name', 'Chat')->first();
|
||||
$dalam_sistem = Menu::where('name', 'Dalam Sistem')->first();
|
||||
$luar_sistem = Menu::where('name', 'Luar Sistem')->first();
|
||||
$google_sheets = Menu::where('name', 'Google Sheets')->first();
|
||||
|
||||
// Superadmin gets all menus
|
||||
$superadmin->menus()->sync([
|
||||
@@ -310,6 +318,7 @@ class UsersRoleMenuSeeder extends Seeder
|
||||
$luar_sistem->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
$bigdata_resume->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
$chatbot->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
$google_sheets->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
]);
|
||||
|
||||
// Admin gets limited menus
|
||||
|
||||
0
resources/js/data/google-sheet/create.js
Normal file
0
resources/js/data/google-sheet/create.js
Normal file
0
resources/js/data/google-sheet/edit.js
Normal file
0
resources/js/data/google-sheet/edit.js
Normal file
211
resources/js/data/google-sheet/index.js
Normal file
211
resources/js/data/google-sheet/index.js
Normal file
@@ -0,0 +1,211 @@
|
||||
import { Grid } from "gridjs/dist/gridjs.umd.js";
|
||||
import gridjs from "gridjs/dist/gridjs.umd.js";
|
||||
import "gridjs/dist/gridjs.umd.js";
|
||||
import GlobalConfig from "../../global-config.js";
|
||||
|
||||
class GoogleSheets {
|
||||
constructor() {
|
||||
this.toastMessage = document.getElementById("toast-message");
|
||||
this.toastElement = document.getElementById("toastNotification");
|
||||
this.toast = new bootstrap.Toast(this.toastElement);
|
||||
this.table = null;
|
||||
|
||||
// Initialize functions
|
||||
this.initTableGoogleSheets();
|
||||
this.initEvents();
|
||||
}
|
||||
|
||||
initEvents() {
|
||||
document.body.addEventListener("click", async (event) => {
|
||||
const deleteButton = event.target.closest(
|
||||
".btn-delete-google-sheet"
|
||||
);
|
||||
if (deleteButton) {
|
||||
event.preventDefault();
|
||||
await this.handleDelete(deleteButton);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
initTableGoogleSheets() {
|
||||
let tableContainer = document.getElementById(
|
||||
"table-data-google-sheets"
|
||||
);
|
||||
|
||||
if (!tableContainer) {
|
||||
console.error("Table container not found!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear previous table content
|
||||
tableContainer.innerHTML = "";
|
||||
|
||||
// Get user permissions from data attributes
|
||||
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||
let canDelete = tableContainer.getAttribute("data-destroyer") === "1";
|
||||
|
||||
this.table = new Grid({
|
||||
columns: [
|
||||
"ID",
|
||||
"No Registratsi",
|
||||
"No KRK",
|
||||
"Format STS",
|
||||
"Fungsi BG",
|
||||
"Selesai Terbit",
|
||||
"Selesai Verifikasi",
|
||||
"Tanggal Permohonan",
|
||||
{
|
||||
name: "Action",
|
||||
formatter: (cell) => {
|
||||
let buttons = "";
|
||||
|
||||
buttons += `
|
||||
<a href="/data/google-sheets/${cell}" class="btn btn-primary btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bx-show'></i>
|
||||
</a>
|
||||
`;
|
||||
|
||||
if (canUpdate) {
|
||||
buttons += `
|
||||
<a href="/data/google-sheets/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bx-edit'></i>
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
|
||||
if (canDelete) {
|
||||
buttons += `
|
||||
<button data-id="${cell}" class="btn btn-sm btn-red btn-delete-google-sheet 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: {
|
||||
limit: 50,
|
||||
server: {
|
||||
url: (prev, page) => {
|
||||
let separator = prev.includes("?") ? "&" : "?";
|
||||
return `${prev}${separator}page=${page + 1}`;
|
||||
},
|
||||
},
|
||||
},
|
||||
sort: true,
|
||||
search: {
|
||||
server: {
|
||||
url: (prev, keyword) => {
|
||||
let separator = prev.includes("?") ? "&" : "?";
|
||||
return `${prev}${separator}search=${encodeURIComponent(
|
||||
keyword
|
||||
)}`;
|
||||
},
|
||||
},
|
||||
debounceTimeout: 1000,
|
||||
},
|
||||
server: {
|
||||
url: `${GlobalConfig.apiHost}/api/pbg-task-google-sheet`,
|
||||
headers: {
|
||||
Authorization: `Bearer ${document
|
||||
.querySelector('meta[name="api-token"]')
|
||||
.getAttribute("content")}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
then: (data) => {
|
||||
if (!data || !data.data) {
|
||||
console.warn("⚠️ No data received from API");
|
||||
return [];
|
||||
}
|
||||
|
||||
return data.data.map((item) => {
|
||||
console.log("🔹 Processing Item:", item);
|
||||
return [
|
||||
item.id,
|
||||
item.no_registrasi,
|
||||
item.no_krk,
|
||||
item.format_sts,
|
||||
item.fungsi_bg,
|
||||
item.selesai_terbit,
|
||||
item.selesai_verifikasi,
|
||||
item.tgl_permohonan,
|
||||
item.id,
|
||||
];
|
||||
});
|
||||
},
|
||||
total: (data) => {
|
||||
let totalRecords = data?.meta?.total || 0;
|
||||
return totalRecords;
|
||||
},
|
||||
catch: (error) => {
|
||||
console.error("❌ Error fetching data:", error);
|
||||
},
|
||||
},
|
||||
}).render(tableContainer);
|
||||
}
|
||||
|
||||
async handleDelete(deleteButton) {
|
||||
const id = deleteButton.getAttribute("data-id");
|
||||
|
||||
const result = await Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You won't be able to revert this!",
|
||||
icon: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: "Yes, delete it!",
|
||||
});
|
||||
|
||||
if (result.isConfirmed) {
|
||||
try {
|
||||
let response = await fetch(
|
||||
`${GlobalConfig.apiHost}/api/pbg-task-google-sheet/${id}`,
|
||||
{
|
||||
method: "DELETE",
|
||||
credentials: "include",
|
||||
headers: {
|
||||
Authorization: `Bearer ${document
|
||||
.querySelector('meta[name="api-token"]')
|
||||
.getAttribute("content")}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
if (response.ok) {
|
||||
let result = await response.json();
|
||||
this.toastMessage.innerText =
|
||||
result.message || "Deleted successfully!";
|
||||
this.toast.show();
|
||||
|
||||
// Refresh Grid.js table
|
||||
if (typeof this.table !== "undefined") {
|
||||
this.table.updateConfig({}).forceRender();
|
||||
}
|
||||
} else {
|
||||
let error = await response.json();
|
||||
console.error("Delete failed:", error);
|
||||
this.toastMessage.innerText =
|
||||
error.message || "Delete failed!";
|
||||
this.toast.show();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error deleting item:", error);
|
||||
this.toastMessage.innerText = "An error occurred!";
|
||||
this.toast.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", function (e) {
|
||||
new GoogleSheets();
|
||||
});
|
||||
162
resources/views/data/google-sheet/create.blade.php
Normal file
162
resources/views/data/google-sheet/create.blade.php
Normal file
@@ -0,0 +1,162 @@
|
||||
@extends('layouts.vertical', ['subtitle' => 'Menu'])
|
||||
|
||||
@section('content')
|
||||
|
||||
@include('layouts.partials/page-title', ['title' => 'Settings', 'subtitle' => 'Menu'])
|
||||
|
||||
<x-toast-notification />
|
||||
<div class="row">
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-end">
|
||||
<a href="{{ route('google-sheets') }}" class="btn btn-sm btn-secondary">Back</a>
|
||||
</div>
|
||||
<form id="formCreateGoogleSheet" action="{{route("pbg-task-google-sheet.store")}}" method="post">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="mb-3 mr-3">
|
||||
<label class="form-label" for="jenis_konsultasi">Jenis Konsultasi</label>
|
||||
<input type="text" id="jenis_konsultasi" name="jenis_konsultasi"
|
||||
class="form-control" placeholder="Jenis Konsultasi" >
|
||||
</div>
|
||||
<div class="mb-3 mr-3">
|
||||
<label class="form-label" for="no_registrasi">No Registrasi</label>
|
||||
<input type="text" id="no_registrasi" name="no_registrasi"
|
||||
class="form-control" placeholder="Nomor Registrasi" >
|
||||
</div>
|
||||
<div class="mb-3 mr-3">
|
||||
<label class="form-label" for="nama_pemilik">Nama Pemilik</label>
|
||||
<input type="text" id="nama_pemilik" name="nama_pemilik"
|
||||
class="form-control" placeholder="Nama Pemilik" >
|
||||
</div>
|
||||
<div class="mb-3 mr-3">
|
||||
<label class="form-label" for="lokasi_bg">Lokasi BG</label>
|
||||
<input type="text" id="lokasi_bg" name="lokasi_bg"
|
||||
class="form-control" placeholder="Lokasi BG" >
|
||||
</div>
|
||||
<div class="mb-3 mr-3">
|
||||
<label class="form-label" for="fungsi_bg">Fungsi BG</label>
|
||||
<input type="text" id="fungsi_bg" name="fungsi_bg"
|
||||
class="form-control" placeholder="Fungsi BG" >
|
||||
</div>
|
||||
<div class="mb-3 mr-3">
|
||||
<label class="form-label" for="nama_bangunan">Nama Bangunan</label>
|
||||
<input type="text" id="nama_bangunan" name="nama_bangunan"
|
||||
class="form-control" placeholder="Nama Bangunan" >
|
||||
</div>
|
||||
<div class="mb-3 mr-3">
|
||||
<label class="form-label" for="tgl_permohonan">Tanggal Permohonan</label>
|
||||
<input type="text" id="tgl_permohonan" name="tgl_permohonan"
|
||||
class="form-control" placeholder="Tanggal Permohonan" >
|
||||
</div>
|
||||
<div class="mb-3 mr-3">
|
||||
<label class="form-label" for="status_verifikasi">Status Verifikasi</label>
|
||||
<input type="text" id="status_verifikasi" name="status_verifikasi"
|
||||
class="form-control" placeholder="Status Verifikasi" >
|
||||
</div>
|
||||
<div class="mb-3 mr-3">
|
||||
<label class="form-label" for="status_permohonan">Status Permohonan</label>
|
||||
<input type="text" id="status_permohonan" name="status_permohonan"
|
||||
class="form-control" placeholder="Status Permohonan" >
|
||||
</div>
|
||||
<div class="mb-3 mr-3">
|
||||
<label class="form-label" for="status_permohonan">Status Permohonan</label>
|
||||
<input type="text" id="status_permohonan" name="status_permohonan"
|
||||
class="form-control" placeholder="Status Permohonan" >
|
||||
</div>
|
||||
<div class="mb-3 mr-3">
|
||||
<label class="form-label" for="alamat_pemilik">Alamat Pemilik</label>
|
||||
<input type="text" id="alamat_pemilik" name="alamat_pemilik"
|
||||
class="form-control" placeholder="Alamat Pemilik" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="no_hp">No Hp</label>
|
||||
<input type="text" id="no_hp" name="no_hp"
|
||||
class="form-control" placeholder="No Hp" >
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="email">Email</label>
|
||||
<input type="text" id="email" name="email"
|
||||
class="form-control" placeholder="Email" >
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="tanggal_catatan">Tanggal Catatan</label>
|
||||
<input type="text" id="tanggal_catatan" name="tanggal_catatan"
|
||||
class="form-control" placeholder="Tanggal Catatan" >
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="catatan_kekurangan_dokumen">Catatan Kekurangan Dokumen</label>
|
||||
<input type="text" id="catatan_kekurangan_dokumen" name="catatan_kekurangan_dokumen"
|
||||
class="form-control" placeholder="Catatan Kekurangan Dokumen" >
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="gambar">Gambar</label>
|
||||
<input type="text" id="gambar" name="gambar"
|
||||
class="form-control" placeholder="Gambar" >
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="krk_kkpr">KRK KKPR</label>
|
||||
<input type="text" id="krk_kkpr" name="krk_kkpr"
|
||||
class="form-control" placeholder="KRK KKPR" >
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="no_krk">NO KRK</label>
|
||||
<input type="text" id="no_krk" name="no_krk"
|
||||
class="form-control" placeholder="NO KRK" >
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="lh">LH</label>
|
||||
<input type="text" id="lh" name="lh"
|
||||
class="form-control" placeholder="LH" >
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="ska">SKA</label>
|
||||
<input type="text" id="ska" name="ska"
|
||||
class="form-control" placeholder="SKA" >
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="keterangan">Keterangan</label>
|
||||
<input type="text" id="keterangan" name="keterangan"
|
||||
class="form-control" placeholder="Keterangan" >
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="helpdesk">Help Desk</label>
|
||||
<input type="text" id="helpdesk" name="helpdesk"
|
||||
class="form-control" placeholder="Help Desk" >
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="pj">PJ</label>
|
||||
<input type="text" id="pj" name="pj" class="form-control" placeholder="PJ" >
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="kepemilikan">Kepemilikan</label>
|
||||
<input type="text" id="kepemilikan" name="kepemilikan" class="form-control" placeholder="Kepemilikan" >
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="potensi_taru">Potensi Taru</label>
|
||||
<input type="text" id="potensi_taru" name="potensi_taru" class="form-control" placeholder="Potensi Taru" >
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="validasi_dinas">Validasi Dinas</label>
|
||||
<input type="text" id="validasi_dinas" name="validasi_dinas" class="form-control" placeholder="Validasi Dinas" >
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="kategori_retribusi">Kategori Retribusi</label>
|
||||
<input type="text" id="kategori_retribusi" name="kategori_retribusi" class="form-control" placeholder="Kategori Retribusi" >
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-primary me-1" type="button" id="btnCreateGoogleSheet">
|
||||
<span id="spinner" class="spinner-border spinner-border-sm me-1 d-none" role="status" aria-hidden="true"></span>
|
||||
Create
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
@endsection
|
||||
3
resources/views/data/google-sheet/edit.blade.php
Normal file
3
resources/views/data/google-sheet/edit.blade.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<div>
|
||||
<!-- Always remember that you are absolutely unique. Just like everyone else. - Margaret Mead -->
|
||||
</div>
|
||||
35
resources/views/data/google-sheet/index.blade.php
Normal file
35
resources/views/data/google-sheet/index.blade.php
Normal file
@@ -0,0 +1,35 @@
|
||||
@extends('layouts.vertical', ['subtitle' => 'Google Sheets'])
|
||||
|
||||
@section('css')
|
||||
@vite(['node_modules/gridjs/dist/theme/mermaid.min.css'])
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
@include('layouts.partials/page-title', ['title' => 'Data', 'subtitle' => 'Google Sheets'])
|
||||
|
||||
<x-toast-notification />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card w-100">
|
||||
<div class="card-body">
|
||||
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
||||
@if ($user_menu_permission['allow_create'])
|
||||
<a href="{{ route('google-sheets.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
||||
@endif
|
||||
</div>
|
||||
<div id="table-data-google-sheets"
|
||||
data-updater="{{ $user_menu_permission['allow_update'] }}"
|
||||
data-destroyer="{{ $user_menu_permission['allow_destroy'] }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
@vite(['resources/js/data/google-sheet/index.js'])
|
||||
@endsection
|
||||
0
resources/views/data/google-sheet/show.blade.php
Normal file
0
resources/views/data/google-sheet/show.blade.php
Normal file
@@ -1,9 +1,5 @@
|
||||
@extends('layouts.vertical', ['subtitle' => 'Menu'])
|
||||
|
||||
@section('css')
|
||||
@vite(['node_modules/gridjs/dist/theme/mermaid.min.css'])
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
@include('layouts.partials/page-title', ['title' => 'Settings', 'subtitle' => 'Menu'])
|
||||
|
||||
@@ -11,6 +11,7 @@ use App\Http\Controllers\Api\ImportDatasourceController;
|
||||
use App\Http\Controllers\Api\LackOfPotentialController;
|
||||
use App\Http\Controllers\Api\MenusController;
|
||||
use App\Http\Controllers\Api\PbgTaskController;
|
||||
use App\Http\Controllers\Api\PbgTaskGoogleSheetsController;
|
||||
use App\Http\Controllers\Api\RequestAssignmentController;
|
||||
use App\Http\Controllers\Api\RolesController;
|
||||
use App\Http\Controllers\Api\ScrapingController;
|
||||
@@ -146,4 +147,7 @@ Route::group(['middleware' => 'auth:sanctum'], function (){
|
||||
Route::controller(TaskAssignmentsController::class)->group(function (){
|
||||
Route::get('/task-assignments/{uuid}', 'index')->name('api.task-assignments');
|
||||
});
|
||||
|
||||
// pbg-task-google-sheet
|
||||
Route::apiResource('pbg-task-google-sheet', PbgTaskGoogleSheetsController::class);
|
||||
});
|
||||
@@ -19,6 +19,7 @@ use App\Http\Controllers\Data\AdvertisementController;
|
||||
use App\Http\Controllers\Data\UmkmController;
|
||||
use App\Http\Controllers\Data\TourismController;
|
||||
use App\Http\Controllers\Data\SpatialPlanningController;
|
||||
use App\Http\Controllers\Data\GoogleSheetsController;
|
||||
use App\Http\Controllers\Report\ReportTourismController;
|
||||
use App\Http\Controllers\Chatbot\ChatbotController;
|
||||
use App\Http\Controllers\ChatbotPimpinan\ChatbotPimpinanController;
|
||||
@@ -114,6 +115,13 @@ Route::group(['middleware' => 'auth'], function(){
|
||||
Route::get('/customers/{customer_id}/edit', 'edit')->name('customers.edit');
|
||||
Route::get('/customers/upload', 'upload')->name('customers.upload');
|
||||
});
|
||||
|
||||
Route::controller(GoogleSheetsController::class)->group(function (){
|
||||
Route::get('/google-sheets', 'index')->name('google-sheets');
|
||||
Route::get('/google-sheets/create', 'create')->name('google-sheets.create');
|
||||
Route::get('/google-sheets/{google_sheet_id}', 'show')->name('google-sheets.show');
|
||||
Route::get('/google-sheets/{google_sheet_id}/edit', 'edit')->name('google-sheets.edit');
|
||||
});
|
||||
});
|
||||
|
||||
// Report
|
||||
|
||||
@@ -106,6 +106,8 @@ export default defineConfig({
|
||||
//pbg-task
|
||||
"resources/js/pbg-task/index.js",
|
||||
"resources/js/pbg-task/show.js",
|
||||
// google-sheets
|
||||
"resources/js/data/google-sheet/index.js",
|
||||
],
|
||||
refresh: true,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user