Merge pull request #41 from arieeefajar/fix/master-rule
fix(master-rule): bug fix button submit in modal add
This commit is contained in:
commit
90c4d8bd94
|
@ -61,6 +61,7 @@ public function store(Request $request)
|
||||||
|
|
||||||
public function update(Request $request, $id)
|
public function update(Request $request, $id)
|
||||||
{
|
{
|
||||||
|
// dd($request->all());
|
||||||
$customMessage = [
|
$customMessage = [
|
||||||
'parameter_type.required' => 'Jenis parameter wajib diisi',
|
'parameter_type.required' => 'Jenis parameter wajib diisi',
|
||||||
'parameter_type.string' => 'Jenis parameter harus berupa teks',
|
'parameter_type.string' => 'Jenis parameter harus berupa teks',
|
||||||
|
@ -87,6 +88,7 @@ public function update(Request $request, $id)
|
||||||
}
|
}
|
||||||
|
|
||||||
$rule = Rule::find($id);
|
$rule = Rule::find($id);
|
||||||
|
$rule->indicator_id = $request->indicator;
|
||||||
$rule->parameter_type = $request->parameter_type;
|
$rule->parameter_type = $request->parameter_type;
|
||||||
$rule->description = $request->description;
|
$rule->description = $request->description;
|
||||||
$rule->cf = $request->cf;
|
$rule->cf = $request->cf;
|
||||||
|
|
|
@ -69,9 +69,25 @@ function validateCfInput(input) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var checkAll = document.getElementById("checkAll");
|
||||||
|
checkAll &&
|
||||||
|
(checkAll.onclick = function () {
|
||||||
|
for (
|
||||||
|
var e = document.querySelectorAll(
|
||||||
|
'.form-check-all input[type="checkbox"]'
|
||||||
|
),
|
||||||
|
t = 0;
|
||||||
|
t < e.length;
|
||||||
|
t++
|
||||||
|
)
|
||||||
|
(e[t].checked = this.checked),
|
||||||
|
e[t].checked
|
||||||
|
? e[t].closest("tr").classList.add("table-active")
|
||||||
|
: e[t].closest("tr").classList.remove("table-active");
|
||||||
|
});
|
||||||
var perPage = 10,
|
var perPage = 10,
|
||||||
options = {
|
options = {
|
||||||
valueNames: ["id", "indicator", "category", "description", "status"],
|
valueNames: ["id", "customer_name", "email", "phone", "status"],
|
||||||
page: perPage,
|
page: perPage,
|
||||||
pagination: !0,
|
pagination: !0,
|
||||||
plugins: [ListPagination({ left: 2, right: 2 })],
|
plugins: [ListPagination({ left: 2, right: 2 })],
|
||||||
|
@ -171,7 +187,7 @@ refreshCallbacks(),
|
||||||
.addEventListener("show.bs.modal", function (e) {
|
.addEventListener("show.bs.modal", function (e) {
|
||||||
e.relatedTarget.classList.contains("edit-item-btn")
|
e.relatedTarget.classList.contains("edit-item-btn")
|
||||||
? ((document.getElementById("exampleModalLabel").innerHTML =
|
? ((document.getElementById("exampleModalLabel").innerHTML =
|
||||||
"Edit Aturan"),
|
"Edit Customer"),
|
||||||
(document
|
(document
|
||||||
.getElementById("showModal")
|
.getElementById("showModal")
|
||||||
.querySelector(".modal-footer").style.display = "block"),
|
.querySelector(".modal-footer").style.display = "block"),
|
||||||
|
@ -206,48 +222,52 @@ var table = document.getElementById("customerTable"),
|
||||||
tr = table.getElementsByTagName("tr"),
|
tr = table.getElementsByTagName("tr"),
|
||||||
trlist = table.querySelectorAll(".list tr"),
|
trlist = table.querySelectorAll(".list tr"),
|
||||||
count = Number(isValue.replace(/[^0-9]/g, "")) + 1;
|
count = Number(isValue.replace(/[^0-9]/g, "")) + 1;
|
||||||
// addBtn.addEventListener("click", function (e) {
|
addBtn.addEventListener("click", function (e) {
|
||||||
// "" !== customerNameField.value &&
|
"" !== customerNameField.value &&
|
||||||
// "" !== emailField.value &&
|
"" !== emailField.value &&
|
||||||
// "" !== dateField.value &&
|
"" !== dateField.value &&
|
||||||
// "" !== phoneField.value &&
|
"" !== phoneField.value &&
|
||||||
// (customerList.add({
|
(customerList.add({
|
||||||
// id:
|
id:
|
||||||
// '<a href="javascript:void(0);" class="fw-medium link-primary">#VZ' +
|
'<a href="javascript:void(0);" class="fw-medium link-primary">#VZ' +
|
||||||
// count +
|
count +
|
||||||
// "</a>",
|
"</a>",
|
||||||
// customer_name: customerNameField.value,
|
customer_name: customerNameField.value,
|
||||||
// email: emailField.value,
|
email: emailField.value,
|
||||||
// date: dateField.value,
|
date: dateField.value,
|
||||||
// phone: phoneField.value,
|
phone: phoneField.value,
|
||||||
// status: isStatus(statusField.value),
|
status: isStatus(statusField.value),
|
||||||
// }),
|
|
||||||
// document.getElementById("close-modal").click(),
|
|
||||||
// clearFields(),
|
|
||||||
// refreshCallbacks(),
|
|
||||||
// filterContact("All"),
|
|
||||||
// count++);
|
|
||||||
// }),
|
|
||||||
editBtn.addEventListener("click", function (e) {
|
|
||||||
(document.getElementById("exampleModalLabel").innerHTML = "Edit Customer"),
|
|
||||||
customerList.get({ id: idField.value }).forEach(function (e) {
|
|
||||||
(isid = new DOMParser().parseFromString(e._values.id, "text/html")),
|
|
||||||
isid.body.firstElementChild.innerHTML == itemId &&
|
|
||||||
e.values({
|
|
||||||
id:
|
|
||||||
'<a href="javascript:void(0);" class="fw-medium link-primary">' +
|
|
||||||
idField.value +
|
|
||||||
"</a>",
|
|
||||||
customer_name: customerNameField.value,
|
|
||||||
email: emailField.value,
|
|
||||||
date: dateField.value,
|
|
||||||
phone: phoneField.value,
|
|
||||||
status: isStatus(statusField.value),
|
|
||||||
});
|
|
||||||
}),
|
}),
|
||||||
document.getElementById("close-modal").click(),
|
document.getElementById("close-modal").click(),
|
||||||
clearFields();
|
clearFields(),
|
||||||
});
|
refreshCallbacks(),
|
||||||
|
filterContact("All"),
|
||||||
|
count++);
|
||||||
|
}),
|
||||||
|
editBtn.addEventListener("click", function (e) {
|
||||||
|
(document.getElementById("exampleModalLabel").innerHTML =
|
||||||
|
"Edit Customer"),
|
||||||
|
customerList.get({ id: idField.value }).forEach(function (e) {
|
||||||
|
(isid = new DOMParser().parseFromString(
|
||||||
|
e._values.id,
|
||||||
|
"text/html"
|
||||||
|
)),
|
||||||
|
isid.body.firstElementChild.innerHTML == itemId &&
|
||||||
|
e.values({
|
||||||
|
id:
|
||||||
|
'<a href="javascript:void(0);" class="fw-medium link-primary">' +
|
||||||
|
idField.value +
|
||||||
|
"</a>",
|
||||||
|
customer_name: customerNameField.value,
|
||||||
|
email: emailField.value,
|
||||||
|
date: dateField.value,
|
||||||
|
phone: phoneField.value,
|
||||||
|
status: isStatus(statusField.value),
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
document.getElementById("close-modal").click(),
|
||||||
|
clearFields();
|
||||||
|
});
|
||||||
var statusVal = new Choices(statusField);
|
var statusVal = new Choices(statusField);
|
||||||
function isStatus(e) {
|
function isStatus(e) {
|
||||||
switch (e) {
|
switch (e) {
|
||||||
|
|
|
@ -0,0 +1,342 @@
|
||||||
|
var checkAll = document.getElementById("checkAll");
|
||||||
|
checkAll &&
|
||||||
|
(checkAll.onclick = function () {
|
||||||
|
for (
|
||||||
|
var e = document.querySelectorAll(
|
||||||
|
'.form-check-all input[type="checkbox"]'
|
||||||
|
),
|
||||||
|
t = 0;
|
||||||
|
t < e.length;
|
||||||
|
t++
|
||||||
|
)
|
||||||
|
(e[t].checked = this.checked),
|
||||||
|
e[t].checked
|
||||||
|
? e[t].closest("tr").classList.add("table-active")
|
||||||
|
: e[t].closest("tr").classList.remove("table-active");
|
||||||
|
});
|
||||||
|
|
||||||
|
function deleteData(id) {
|
||||||
|
var form = document.getElementById("delete-form");
|
||||||
|
form.action = "/data-aturan/" + id;
|
||||||
|
}
|
||||||
|
|
||||||
|
var perPage = 10,
|
||||||
|
options = {
|
||||||
|
valueNames: ["id", "customer_name", "email", "date", "phone", "status"],
|
||||||
|
page: perPage,
|
||||||
|
pagination: !0,
|
||||||
|
plugins: [ListPagination({ left: 2, right: 2 })],
|
||||||
|
},
|
||||||
|
customerList = new List("customerList", options).on(
|
||||||
|
"updated",
|
||||||
|
function (e) {
|
||||||
|
0 == e.matchingItems.length
|
||||||
|
? (document.getElementsByClassName(
|
||||||
|
"noresult"
|
||||||
|
)[0].style.display = "block")
|
||||||
|
: (document.getElementsByClassName(
|
||||||
|
"noresult"
|
||||||
|
)[0].style.display = "none");
|
||||||
|
var t = 1 == e.i,
|
||||||
|
a = e.i > e.matchingItems.length - e.page;
|
||||||
|
document.querySelector(".pagination-prev.disabled") &&
|
||||||
|
document
|
||||||
|
.querySelector(".pagination-prev.disabled")
|
||||||
|
.classList.remove("disabled"),
|
||||||
|
document.querySelector(".pagination-next.disabled") &&
|
||||||
|
document
|
||||||
|
.querySelector(".pagination-next.disabled")
|
||||||
|
.classList.remove("disabled"),
|
||||||
|
t &&
|
||||||
|
document
|
||||||
|
.querySelector(".pagination-prev")
|
||||||
|
.classList.add("disabled"),
|
||||||
|
a &&
|
||||||
|
document
|
||||||
|
.querySelector(".pagination-next")
|
||||||
|
.classList.add("disabled"),
|
||||||
|
e.matchingItems.length <= perPage
|
||||||
|
? (document.querySelector(
|
||||||
|
".pagination-wrap"
|
||||||
|
).style.display = "none")
|
||||||
|
: (document.querySelector(
|
||||||
|
".pagination-wrap"
|
||||||
|
).style.display = "flex"),
|
||||||
|
e.matchingItems.length == perPage &&
|
||||||
|
document
|
||||||
|
.querySelector(".pagination.listjs-pagination")
|
||||||
|
.firstElementChild.children[0].click(),
|
||||||
|
0 < e.matchingItems.length
|
||||||
|
? (document.getElementsByClassName(
|
||||||
|
"noresult"
|
||||||
|
)[0].style.display = "none")
|
||||||
|
: (document.getElementsByClassName(
|
||||||
|
"noresult"
|
||||||
|
)[0].style.display = "block");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
isCount = new DOMParser().parseFromString(
|
||||||
|
customerList.items.slice(-1)[0]._values.id,
|
||||||
|
"text/html"
|
||||||
|
);
|
||||||
|
var isValue = isCount.body.firstElementChild.innerHTML,
|
||||||
|
idField = document.getElementById("id-field"),
|
||||||
|
customerNameField = document.getElementById("customername-field"),
|
||||||
|
emailField = document.getElementById("email-field"),
|
||||||
|
dateField = document.getElementById("date-field"),
|
||||||
|
phoneField = document.getElementById("phone-field"),
|
||||||
|
statusField = document.getElementById("status-field"),
|
||||||
|
addBtn = document.getElementById("add-btn"),
|
||||||
|
editBtn = document.getElementById("edit-btn"),
|
||||||
|
removeBtns = document.getElementsByClassName("remove-item-btn"),
|
||||||
|
editBtns = document.getElementsByClassName("edit-item-btn");
|
||||||
|
function filterContact(e) {
|
||||||
|
var t = e;
|
||||||
|
customerList.filter(function (e) {
|
||||||
|
matchData = new DOMParser().parseFromString(
|
||||||
|
e.values().status,
|
||||||
|
"text/html"
|
||||||
|
);
|
||||||
|
e = matchData.body.firstElementChild.innerHTML;
|
||||||
|
return "All" == e || "All" == t || e == t;
|
||||||
|
}),
|
||||||
|
customerList.update();
|
||||||
|
}
|
||||||
|
function updateList() {
|
||||||
|
var a = document.querySelector("input[name=status]:checked").value;
|
||||||
|
(data = userList.filter(function (e) {
|
||||||
|
var t = !1;
|
||||||
|
return (
|
||||||
|
"All" == a
|
||||||
|
? (t = !0)
|
||||||
|
: ((t = e.values().sts == a), console.log(t, "statusFilter")),
|
||||||
|
t
|
||||||
|
);
|
||||||
|
})),
|
||||||
|
userList.update();
|
||||||
|
}
|
||||||
|
refreshCallbacks(),
|
||||||
|
filterContact("All"),
|
||||||
|
document
|
||||||
|
.getElementById("showModal")
|
||||||
|
.addEventListener("show.bs.modal", function (e) {
|
||||||
|
e.relatedTarget.classList.contains("edit-item-btn")
|
||||||
|
? ((document.getElementById("exampleModalLabel").innerHTML =
|
||||||
|
"Edit Customer"),
|
||||||
|
(document
|
||||||
|
.getElementById("showModal")
|
||||||
|
.querySelector(".modal-footer").style.display = "block"),
|
||||||
|
(document.getElementById("add-btn").style.display = "none"),
|
||||||
|
(document.getElementById("edit-btn").style.display = "block"))
|
||||||
|
: e.relatedTarget.classList.contains("add-btn")
|
||||||
|
? ((document.getElementById("exampleModalLabel").innerHTML =
|
||||||
|
"Add Customer"),
|
||||||
|
(document
|
||||||
|
.getElementById("showModal")
|
||||||
|
.querySelector(".modal-footer").style.display = "block"),
|
||||||
|
(document.getElementById("edit-btn").style.display = "none"),
|
||||||
|
(document.getElementById("add-btn").style.display = "block"))
|
||||||
|
: ((document.getElementById("exampleModalLabel").innerHTML =
|
||||||
|
"List Customer"),
|
||||||
|
(document
|
||||||
|
.getElementById("showModal")
|
||||||
|
.querySelector(".modal-footer").style.display = "none"));
|
||||||
|
}),
|
||||||
|
ischeckboxcheck(),
|
||||||
|
document
|
||||||
|
.getElementById("showModal")
|
||||||
|
.addEventListener("hidden.bs.modal", function () {
|
||||||
|
clearFields();
|
||||||
|
}),
|
||||||
|
document
|
||||||
|
.querySelector("#customerList")
|
||||||
|
.addEventListener("click", function () {
|
||||||
|
refreshCallbacks(), ischeckboxcheck();
|
||||||
|
});
|
||||||
|
var table = document.getElementById("customerTable"),
|
||||||
|
tr = table.getElementsByTagName("tr"),
|
||||||
|
trlist = table.querySelectorAll(".list tr"),
|
||||||
|
count = Number(isValue.replace(/[^0-9]/g, "")) + 1;
|
||||||
|
addBtn.addEventListener("click", function (e) {
|
||||||
|
"" !== customerNameField.value &&
|
||||||
|
"" !== emailField.value &&
|
||||||
|
"" !== dateField.value &&
|
||||||
|
"" !== phoneField.value &&
|
||||||
|
(customerList.add({
|
||||||
|
id:
|
||||||
|
'<a href="javascript:void(0);" class="fw-medium link-primary">#VZ' +
|
||||||
|
count +
|
||||||
|
"</a>",
|
||||||
|
customer_name: customerNameField.value,
|
||||||
|
email: emailField.value,
|
||||||
|
date: dateField.value,
|
||||||
|
phone: phoneField.value,
|
||||||
|
status: isStatus(statusField.value),
|
||||||
|
}),
|
||||||
|
document.getElementById("close-modal").click(),
|
||||||
|
clearFields(),
|
||||||
|
refreshCallbacks(),
|
||||||
|
filterContact("All"),
|
||||||
|
count++);
|
||||||
|
}),
|
||||||
|
editBtn.addEventListener("click", function (e) {
|
||||||
|
(document.getElementById("exampleModalLabel").innerHTML =
|
||||||
|
"Edit Customer"),
|
||||||
|
customerList.get({ id: idField.value }).forEach(function (e) {
|
||||||
|
(isid = new DOMParser().parseFromString(
|
||||||
|
e._values.id,
|
||||||
|
"text/html"
|
||||||
|
)),
|
||||||
|
isid.body.firstElementChild.innerHTML == itemId &&
|
||||||
|
e.values({
|
||||||
|
id:
|
||||||
|
'<a href="javascript:void(0);" class="fw-medium link-primary">' +
|
||||||
|
idField.value +
|
||||||
|
"</a>",
|
||||||
|
customer_name: customerNameField.value,
|
||||||
|
email: emailField.value,
|
||||||
|
date: dateField.value,
|
||||||
|
phone: phoneField.value,
|
||||||
|
status: isStatus(statusField.value),
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
document.getElementById("close-modal").click(),
|
||||||
|
clearFields();
|
||||||
|
});
|
||||||
|
var statusVal = new Choices(statusField);
|
||||||
|
function isStatus(e) {
|
||||||
|
switch (e) {
|
||||||
|
case "Active":
|
||||||
|
return (
|
||||||
|
'<span class="badge badge-soft-success text-uppercase">' +
|
||||||
|
e +
|
||||||
|
"</span>"
|
||||||
|
);
|
||||||
|
case "Block":
|
||||||
|
return (
|
||||||
|
'<span class="badge badge-soft-danger text-uppercase">' +
|
||||||
|
e +
|
||||||
|
"</span>"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function ischeckboxcheck() {
|
||||||
|
document.getElementsByName("checkAll").forEach(function (e) {
|
||||||
|
e.addEventListener("click", function (e) {
|
||||||
|
e.target.checked
|
||||||
|
? e.target.closest("tr").classList.add("table-active")
|
||||||
|
: e.target.closest("tr").classList.remove("table-active");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function refreshCallbacks() {
|
||||||
|
removeBtns.forEach(function (e) {
|
||||||
|
e.addEventListener("click", function (e) {
|
||||||
|
e.target.closest("tr").children[1].innerText,
|
||||||
|
(itemId = e.target.closest("tr").children[1].innerText),
|
||||||
|
customerList.get({ id: itemId }).forEach(function (e) {
|
||||||
|
deleteid = new DOMParser().parseFromString(
|
||||||
|
e._values.id,
|
||||||
|
"text/html"
|
||||||
|
);
|
||||||
|
var t = deleteid.body.firstElementChild;
|
||||||
|
deleteid.body.firstElementChild.innerHTML == itemId &&
|
||||||
|
document
|
||||||
|
.getElementById("delete-record")
|
||||||
|
.addEventListener("click", function () {
|
||||||
|
customerList.remove("id", t.outerHTML),
|
||||||
|
document
|
||||||
|
.getElementById("deleteRecordModal")
|
||||||
|
.click();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
editBtns.forEach(function (e) {
|
||||||
|
e.addEventListener("click", function (e) {
|
||||||
|
e.target.closest("tr").children[1].innerText,
|
||||||
|
(itemId = e.target.closest("tr").children[1].innerText),
|
||||||
|
customerList.get({ id: itemId }).forEach(function (e) {
|
||||||
|
isid = new DOMParser().parseFromString(
|
||||||
|
e._values.id,
|
||||||
|
"text/html"
|
||||||
|
);
|
||||||
|
var t = isid.body.firstElementChild.innerHTML;
|
||||||
|
t == itemId &&
|
||||||
|
((idField.value = t),
|
||||||
|
(customerNameField.value = e._values.customer_name),
|
||||||
|
(emailField.value = e._values.email),
|
||||||
|
(dateField.value = e._values.date),
|
||||||
|
(phoneField.value = e._values.phone),
|
||||||
|
statusVal && statusVal.destroy(),
|
||||||
|
(statusVal = new Choices(statusField)),
|
||||||
|
(val = new DOMParser().parseFromString(
|
||||||
|
e._values.status,
|
||||||
|
"text/html"
|
||||||
|
)),
|
||||||
|
(t = val.body.firstElementChild.innerHTML),
|
||||||
|
statusVal.setChoiceByValue(t),
|
||||||
|
flatpickr("#date-field", {
|
||||||
|
dateFormat: "d M, Y",
|
||||||
|
defaultDate: e._values.date,
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function clearFields() {
|
||||||
|
(customerNameField.value = ""),
|
||||||
|
(emailField.value = ""),
|
||||||
|
(dateField.value = ""),
|
||||||
|
(phoneField.value = "");
|
||||||
|
}
|
||||||
|
document
|
||||||
|
.querySelector(".pagination-next")
|
||||||
|
.addEventListener("click", function () {
|
||||||
|
!document.querySelector(".pagination.listjs-pagination") ||
|
||||||
|
(document
|
||||||
|
.querySelector(".pagination.listjs-pagination")
|
||||||
|
.querySelector(".active") &&
|
||||||
|
document
|
||||||
|
.querySelector(".pagination.listjs-pagination")
|
||||||
|
.querySelector(".active")
|
||||||
|
.nextElementSibling.children[0].click());
|
||||||
|
}),
|
||||||
|
document
|
||||||
|
.querySelector(".pagination-prev")
|
||||||
|
.addEventListener("click", function () {
|
||||||
|
!document.querySelector(".pagination.listjs-pagination") ||
|
||||||
|
(document
|
||||||
|
.querySelector(".pagination.listjs-pagination")
|
||||||
|
.querySelector(".active") &&
|
||||||
|
document
|
||||||
|
.querySelector(".pagination.listjs-pagination")
|
||||||
|
.querySelector(".active")
|
||||||
|
.previousSibling.children[0].click());
|
||||||
|
});
|
||||||
|
var attroptions = {
|
||||||
|
valueNames: [
|
||||||
|
"name",
|
||||||
|
"born",
|
||||||
|
{ data: ["id"] },
|
||||||
|
{ attr: "src", name: "image" },
|
||||||
|
{ attr: "href", name: "link" },
|
||||||
|
{ attr: "data-timestamp", name: "timestamp" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
attrList = new List("users", attroptions);
|
||||||
|
attrList.add({
|
||||||
|
name: "Leia",
|
||||||
|
born: "1954",
|
||||||
|
image: "assets/images/users/avatar-5.jpg",
|
||||||
|
id: 5,
|
||||||
|
timestamp: "67893",
|
||||||
|
});
|
||||||
|
var existOptionsList = { valueNames: ["contact-name", "contact-message"] },
|
||||||
|
existList = new List("contact-existing-list", existOptionsList),
|
||||||
|
fuzzySearchList = new List("fuzzysearch-list", { valueNames: ["name"] }),
|
||||||
|
paginationList = new List("pagination-list", {
|
||||||
|
valueNames: ["pagi-list"],
|
||||||
|
page: 3,
|
||||||
|
pagination: !0,
|
||||||
|
});
|
|
@ -18,8 +18,7 @@
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h4 class="card-title mb-0">Data Aturan</h4>
|
<h4 class="card-title mb-0">Data Aturan</h4>
|
||||||
</div>
|
</div><!-- end card header -->
|
||||||
<!-- end card header -->
|
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div id="customerList">
|
<div id="customerList">
|
||||||
|
@ -27,15 +26,14 @@
|
||||||
<div class="col-sm-auto">
|
<div class="col-sm-auto">
|
||||||
<div>
|
<div>
|
||||||
<button type="button" class="btn btn-success add-btn" data-bs-toggle="modal"
|
<button type="button" class="btn btn-success add-btn" data-bs-toggle="modal"
|
||||||
id="create-btn" data-bs-target="#showModal">
|
id="create-btn" data-bs-target="#showModal"><i
|
||||||
<i class="ri-add-line align-bottom me-1"></i> Tambah
|
class="ri-add-line align-bottom me-1"></i> Tambah</button>
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<div class="d-flex justify-content-sm-end">
|
<div class="d-flex justify-content-sm-end">
|
||||||
<div class="search-box ms-2">
|
<div class="search-box ms-2">
|
||||||
<input type="text" class="form-control search" placeholder="Search..." />
|
<input type="text" class="form-control search" placeholder="Search...">
|
||||||
<i class="ri-search-line search-icon"></i>
|
<i class="ri-search-line search-icon"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -46,15 +44,13 @@
|
||||||
<table class="table align-middle table-nowrap" id="customerTable">
|
<table class="table align-middle table-nowrap" id="customerTable">
|
||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
<tr class="text-center">
|
<tr class="text-center">
|
||||||
<th scope="col" data-sort="no">No</th>
|
<th scope="col" data-sort="no">
|
||||||
<th class="sort" data-sort="indicator">
|
No
|
||||||
Indikator
|
|
||||||
</th>
|
|
||||||
<th class="sort" data-sort="category">Kategori</th>
|
|
||||||
<th class="sort" data-sort="description">Deskripsi</th>
|
|
||||||
<th class="sort" data-sort="status">
|
|
||||||
CF(e)
|
|
||||||
</th>
|
</th>
|
||||||
|
<th class="sort" data-sort="customer_name">Indikator</th>
|
||||||
|
<th class="sort" data-sort="email">Kategori</th>
|
||||||
|
<th class="sort" data-sort="phone">Deskripsi</th>
|
||||||
|
<th class="sort" data-sort="status">CF(e)</th>
|
||||||
<th class="sort" data-sort="action">Action</th>
|
<th class="sort" data-sort="action">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -65,35 +61,29 @@
|
||||||
@foreach ($indicators as $indicator)
|
@foreach ($indicators as $indicator)
|
||||||
@foreach ($indicator->rules as $index => $rule)
|
@foreach ($indicator->rules as $index => $rule)
|
||||||
<tr class="text-center">
|
<tr class="text-center">
|
||||||
<th class="no">
|
<th scope="row" class="no">
|
||||||
{{ $no++ }}
|
{{ $no++ }}
|
||||||
</th>
|
</th>
|
||||||
<td class="id" style="display: none">
|
<td class="id" style="display:none;"><a
|
||||||
<a href="javascript:void(0);"
|
href="javascript:void(0);"
|
||||||
class="fw-medium link-primary">#VZ2101</a>
|
class="fw-medium link-primary">#VZ2101</a></td>
|
||||||
</td>
|
<td class="customer_name">{{ $indicator->name }}</td>
|
||||||
<td class="indicator">{{ $indicator->name }}</td>
|
<td class="email">{{ $rule->parameter_type }}</td>
|
||||||
<td class="category">{{ $rule->parameter_type }}</td>
|
<td class="phone">{{ $rule->description }}</td>
|
||||||
<td class="description">{{ $rule->description }}</td>
|
<td class="status"><span>{{ $rule->cf }}</span>
|
||||||
<td class="status">
|
|
||||||
<span>{{ $rule->cf }}</span>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="d-flex gap-2 justify-content-center">
|
<div class="d-flex gap-2 justify-content-center">
|
||||||
<div class="edit">
|
<div class="edit">
|
||||||
<button class="btn btn-sm btn-warning edit-item-btn"
|
<button class="btn btn-sm btn-warning edit-item-btn"
|
||||||
data-bs-toggle="modal" data-bs-target="#editModal"
|
data-bs-toggle="modal" data-bs-target="#editModal"
|
||||||
onclick="updateData({{ $rule }})">
|
onclick="updateData({{ $rule }})">Edit</button>
|
||||||
Edit
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="remove">
|
<div class="remove">
|
||||||
<button class="btn btn-sm btn-danger remove-item-btn"
|
<button class="btn btn-sm btn-danger remove-item-btn"
|
||||||
data-bs-toggle="modal"
|
data-bs-toggle="modal"
|
||||||
data-bs-target="#deleteRecordModal"
|
data-bs-target="#deleteRecordModal"
|
||||||
onclick="deleteData({{ $rule->id }})">
|
onclick="deleteData({{ $rule->id }})">Hapus</button>
|
||||||
Hapus
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
@ -117,17 +107,16 @@ class="fw-medium link-primary">#VZ2101</a>
|
||||||
<div class="d-flex justify-content-end">
|
<div class="d-flex justify-content-end">
|
||||||
<div class="pagination-wrap hstack gap-2">
|
<div class="pagination-wrap hstack gap-2">
|
||||||
<a class="page-item pagination-prev disabled" href="#">
|
<a class="page-item pagination-prev disabled" href="#">
|
||||||
Previous
|
Sebelumnya
|
||||||
</a>
|
</a>
|
||||||
<ul class="pagination listjs-pagination mb-0"></ul>
|
<ul class="pagination listjs-pagination mb-0"></ul>
|
||||||
<a class="page-item pagination-next" href="#">
|
<a class="page-item pagination-next" href="#">
|
||||||
Next
|
Selanjutnya
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div><!-- end card -->
|
||||||
<!-- end card -->
|
|
||||||
</div>
|
</div>
|
||||||
<!-- end col -->
|
<!-- end col -->
|
||||||
</div>
|
</div>
|
||||||
|
@ -135,12 +124,11 @@ class="fw-medium link-primary">#VZ2101</a>
|
||||||
</div>
|
</div>
|
||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
|
|
||||||
{{-- add modal --}}
|
|
||||||
<div class="modal fade" id="showModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
<div class="modal fade" id="showModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered">
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header bg-light p-3">
|
<div class="modal-header bg-light p-3">
|
||||||
<h5 class="modal-title" id="exampleModalLabel">Tambah Aturan</h5>
|
<h5 class="modal-title" id="exampleModalLabel"></h5>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"
|
||||||
id="close-modal"></button>
|
id="close-modal"></button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -196,12 +184,9 @@ class="fw-medium link-primary">#VZ2101</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<div class="hstack gap-2 justify-content-end">
|
<div class="hstack gap-2 justify-content-end">
|
||||||
<button type="button" class="btn btn-light" data-bs-dismiss="modal">
|
<button type="button" class="btn btn-light" data-bs-dismiss="modal">Tutup</button>
|
||||||
Tutup
|
<button type="submit" class="btn btn-success" id="add-btn">Simpan</button>
|
||||||
</button>
|
<button type="button" class="btn btn-primary" id="edit-btn">Ubah</button>
|
||||||
<button type="submit" class="btn btn-success" id="edit-btn">
|
|
||||||
Simpan
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -209,13 +194,12 @@ class="fw-medium link-primary">#VZ2101</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- edit modal --}}
|
|
||||||
<div class="modal fade" id="editModal" tabindex="-1" aria-labelledby="exampleModalLabel"
|
<div class="modal fade" id="editModal" tabindex="-1" aria-labelledby="exampleModalLabel"
|
||||||
aria-hidden="true">
|
aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered">
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header bg-light p-3">
|
<div class="modal-header bg-light p-3">
|
||||||
<h5 class="modal-title" id="exampleModalLabel">Edit Aturan</h5>
|
<h5 class="modal-title" id="exampleModalLabel">Edit Data Aturan</h5>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"
|
||||||
id="close-modal"></button>
|
id="close-modal"></button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -223,7 +207,8 @@ class="fw-medium link-primary">#VZ2101</a>
|
||||||
@csrf
|
@csrf
|
||||||
@method('PUT')
|
@method('PUT')
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="mb-3" id="modal-id" style="display: none">
|
|
||||||
|
<div class="mb-3" id="modal-id" style="display: none;">
|
||||||
<label for="id-field" class="form-label">ID</label>
|
<label for="id-field" class="form-label">ID</label>
|
||||||
<input type="text" id="id-field" class="form-control" placeholder="ID"
|
<input type="text" id="id-field" class="form-control" placeholder="ID"
|
||||||
readonly />
|
readonly />
|
||||||
|
@ -231,7 +216,7 @@ class="fw-medium link-primary">#VZ2101</a>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="indicator-edit-field" class="form-label">Indikator</label>
|
<label for="indicator-edit-field" class="form-label">Indikator</label>
|
||||||
<select name="indicator" class="form-control" id="indicator-edit-field">
|
<select name="indicator" class="form-control" id="indicator-edit-field" required>
|
||||||
<option value="" selected disabled>Pilih Indikator</option>
|
<option value="" selected disabled>Pilih Indikator</option>
|
||||||
@foreach ($indicators as $indicator)
|
@foreach ($indicators as $indicator)
|
||||||
<option value="{{ $indicator->id }}">{{ $indicator->name }}</option>
|
<option value="{{ $indicator->id }}">{{ $indicator->name }}</option>
|
||||||
|
@ -268,15 +253,21 @@ class="fw-medium link-primary">#VZ2101</a>
|
||||||
Masukan CF(e)
|
Masukan CF(e)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="d-none">
|
||||||
|
<label for="status-field" class="form-label">Status</label>
|
||||||
|
<select class="form-control" data-trigger name="status-field" id="status-field">
|
||||||
|
<option value="">Status</option>
|
||||||
|
<option value="Active">Active</option>
|
||||||
|
<option value="Block">Block</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<div class="hstack gap-2 justify-content-end">
|
<div class="hstack gap-2 justify-content-end">
|
||||||
<button type="button" class="btn btn-light" data-bs-dismiss="modal">
|
<button type="button" class="btn btn-light" data-bs-dismiss="modal">Tutup</button>
|
||||||
Tutup
|
<button type="submit" class="btn btn-success" id="edit-btn">Ubah</button>
|
||||||
</button>
|
|
||||||
<button type="submit" class="btn btn-success" id="edit-btn">
|
|
||||||
Ubah
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -327,7 +318,7 @@ class="fw-medium link-primary">#VZ2101</a>
|
||||||
<script src="assets/libs/list.pagination.js/list.pagination.min.js"></script>
|
<script src="assets/libs/list.pagination.js/list.pagination.min.js"></script>
|
||||||
|
|
||||||
<!-- listjs init -->
|
<!-- listjs init -->
|
||||||
<script src="assets/js/pages/customJs/master-data/aturan/index.js"></script>
|
<script src="assets/js/pages/customJs/master-data/aturan/index1.js"></script>
|
||||||
|
|
||||||
<script src="assets/js/pages/form-validation.init.js"></script>
|
<script src="assets/js/pages/form-validation.init.js"></script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|
Loading…
Reference in New Issue