fix redirect back reklame and tourisms
This commit is contained in:
@@ -37,7 +37,8 @@ const dataAdvertisementsColumns = [
|
||||
actionButtons += `
|
||||
<button class="btn btn-warning me-2 btn-edit"
|
||||
data-id="${id}"
|
||||
data-model="${model}">
|
||||
data-model="${model}"
|
||||
data-menu="${menuId}">
|
||||
<i class='bx bx-edit'></i>
|
||||
</button>`;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
const form = document.querySelector("form#create-update-form");
|
||||
var authLogo = document.querySelector(".auth-logo");
|
||||
let menuId = document.getElementById("menuId").value;
|
||||
console.log(menuId);
|
||||
|
||||
if (!saveButton || !form) return;
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ console.log(dropzonePreviewNode);
|
||||
.getAttribute("content")}`,
|
||||
},
|
||||
init: function () {
|
||||
let menuId = document.getElementById("menuId").value;
|
||||
// Listen for the success event
|
||||
this.on("success", function (file, response) {
|
||||
console.log("File successfully uploaded:", file);
|
||||
@@ -39,7 +40,7 @@ console.log(dropzonePreviewNode);
|
||||
"Upload Files";
|
||||
// Tunggu sebentar lalu reload halaman
|
||||
setTimeout(() => {
|
||||
window.location.href = "/data/web-advertisements";
|
||||
window.location.href = `/data/web-advertisements?menu_id=${menuId}`;
|
||||
}, 2000);
|
||||
});
|
||||
// Listen for the error event
|
||||
|
||||
@@ -11,6 +11,7 @@ const tableElement = document.getElementById("tourisms-data-table");
|
||||
const canView = "1";
|
||||
const canUpdate = tableElement.getAttribute("data-updater") === "1";
|
||||
const canDelete = tableElement.getAttribute("data-destroyer") === "1";
|
||||
let menuId = document.getElementById("menuId").value;
|
||||
|
||||
const dataTourismsColumns = [
|
||||
"No",
|
||||
@@ -32,7 +33,7 @@ const dataTourismsColumns = [
|
||||
const district = row.cells[4].data;
|
||||
const long = row.cells[9].data;
|
||||
const lat = row.cells[10].data;
|
||||
const model = "data/tourisms";
|
||||
const model = "data/web-tourisms";
|
||||
|
||||
let actionButtons = '<div class="d-flex justify-items-end gap-10">';
|
||||
let hasPrivilege = false;
|
||||
@@ -53,7 +54,8 @@ const dataTourismsColumns = [
|
||||
actionButtons += `
|
||||
<button class="btn btn-warning me-2 btn-edit"
|
||||
data-id="${id}"
|
||||
data-model="${model}">
|
||||
data-model="${model}"
|
||||
data-menu="${menuId}">
|
||||
<i class='bx bx-edit'></i>
|
||||
</button>`;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
const modalButton = document.querySelector(".btn-modal");
|
||||
const form = document.querySelector("form#create-update-form");
|
||||
var authLogo = document.querySelector(".auth-logo");
|
||||
let menuId = document.getElementById("menuId").value;
|
||||
|
||||
if (!saveButton || !form) return;
|
||||
|
||||
@@ -73,7 +74,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
}, 3000);
|
||||
|
||||
setTimeout(() => {
|
||||
window.location.href = "/data/web-tourisms";
|
||||
window.location.href = `/data/web-tourisms?menu_id=${menuId}`;
|
||||
}, 3000);
|
||||
} else {
|
||||
if (authLogo) {
|
||||
|
||||
@@ -28,6 +28,7 @@ console.log(dropzonePreviewNode);
|
||||
.getAttribute("content")}`,
|
||||
},
|
||||
init: function () {
|
||||
let menuId = document.getElementById("menuId").value;
|
||||
// Listen for the success event
|
||||
this.on("success", function (file, response) {
|
||||
console.log("File successfully uploaded:", file);
|
||||
@@ -39,7 +40,7 @@ console.log(dropzonePreviewNode);
|
||||
"Upload Files";
|
||||
// Tunggu sebentar lalu reload halaman
|
||||
setTimeout(() => {
|
||||
window.location.href = "/data/web-tourisms";
|
||||
window.location.href = `/data/web-tourisms?menu_id=${menuId}`;
|
||||
}, 2000);
|
||||
});
|
||||
// Listen for the error event
|
||||
|
||||
@@ -13,10 +13,10 @@ class GeneralTable {
|
||||
|
||||
init() {
|
||||
const tableContainer = document.getElementById(this.tableId);
|
||||
|
||||
|
||||
// Kosongkan container sebelum render ulang
|
||||
tableContainer.innerHTML = "";
|
||||
|
||||
|
||||
const table = new Grid({
|
||||
columns: this.columns,
|
||||
search: this.options.search || {
|
||||
@@ -47,7 +47,7 @@ class GeneralTable {
|
||||
total: (data) => data.meta.total,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
table.render(tableContainer);
|
||||
this.handleActions();
|
||||
}
|
||||
@@ -88,13 +88,15 @@ class GeneralTable {
|
||||
handleCreate(event) {
|
||||
// Menggunakan model dan ID untuk membangun URL dinamis
|
||||
const model = event.target.getAttribute("data-model"); // Mengambil model dari data-model
|
||||
window.location.href = `${this.baseUrl}/${model}/create`;
|
||||
let menuId = event.target.getAttribute("data-menu");
|
||||
window.location.href = `${this.baseUrl}/${model}/create?menu_id=${menuId}`;
|
||||
}
|
||||
|
||||
handleBulkCreate(event) {
|
||||
// Menggunakan model dan ID untuk membangun URL dinamis
|
||||
const model = event.target.getAttribute("data-model");
|
||||
window.location.href = `${this.baseUrl}/${model}/bulk-create`;
|
||||
let menuId = event.target.getAttribute("data-menu");
|
||||
window.location.href = `${this.baseUrl}/${model}/bulk-create?menu_id=${menuId}`;
|
||||
}
|
||||
|
||||
// Fungsi untuk menangani edit
|
||||
@@ -103,7 +105,8 @@ class GeneralTable {
|
||||
const model = event.target.getAttribute("data-model"); // Mengambil model dari data-model
|
||||
console.log("Editing record with ID:", id);
|
||||
// Menggunakan model dan ID untuk membangun URL dinamis
|
||||
window.location.href = `${this.baseUrl}/${model}/${id}/edit`;
|
||||
let menuId = event.target.getAttribute("data-menu");
|
||||
window.location.href = `${this.baseUrl}/${model}/${id}/edit?menu_id=${menuId}`;
|
||||
}
|
||||
|
||||
// Fungsi untuk menangani delete
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@section('content')
|
||||
|
||||
@include('layouts.partials/page-title', ['title' => 'Form', 'subtitle' => 'File Uploads'])
|
||||
|
||||
<input type="hidden" id="menuId" value="{{ $menuId ?? 0 }}">
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
<div class="row">
|
||||
<div class="d-flex justify-content-end gap-10 pb-3">
|
||||
@if ($creator)
|
||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/advertisements">
|
||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/advertisements" data-menu="{{ $menuId }}">
|
||||
<i class='bx bxs-file-plus'></i>
|
||||
Create</button>
|
||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/advertisements">
|
||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/advertisements" data-menu="{{ $menuId }}">
|
||||
<i class='bx bx-upload' ></i>
|
||||
Bulk Create
|
||||
</button>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@section('content')
|
||||
|
||||
@include('layouts.partials/page-title', ['title' => 'Form', 'subtitle' => 'File Uploads'])
|
||||
|
||||
<input type="hidden" id="menuId" value="{{ $menuId ?? 0 }}">
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@section('content')
|
||||
|
||||
@include('layouts.partials/page-title', ['title' => $title, 'subtitle' => $subtitle]) <!-- Menggunakan title dan subtitle dari controller -->
|
||||
|
||||
<input type="hidden" id="menuId" value="{{ $menuId ?? 0 }}">
|
||||
<div class="row d-flex justify-content-center">
|
||||
@if (session('error'))
|
||||
<div class="alert alert-danger">
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
@section('content')
|
||||
@include('layouts.partials/page-title', ['title' => 'Data', 'subtitle' => 'Pariwisata'])
|
||||
|
||||
<input type="hidden" id="menuId" value="{{ $menuId ?? 0 }}">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">Daftar Pariwisata</h5>
|
||||
@@ -15,10 +16,10 @@
|
||||
<div class="row">
|
||||
<div class="d-flex justify-content-end gap-10 pb-3">
|
||||
@if ($creator)
|
||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/tourisms">
|
||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/tourisms" data-menu="{{ $menuId }}">
|
||||
<i class='bx bxs-file-plus'></i>
|
||||
Create</button>
|
||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/tourisms">
|
||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/tourisms" data-menu="{{ $menuId }}">
|
||||
<i class='bx bx-upload' ></i>
|
||||
Bulk Create
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user