first commit

This commit is contained in:
2024-01-08 09:33:24 +07:00
commit ed1d4a2b08
2369 changed files with 875560 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
var getUrl = window.location;
var baseUrl =
getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split("/")[1];
var controller = baseUrl + "/user";
$(document).ready(function () {
//alert("Please enter a valid");
});
$(".btn-switch-user").click(function (e) {
id = $(this).data("id");
Swal.fire({
title: "Apakah anda yakin?",
text: "Anda Akan Pindah Acces User",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33",
confirmButtonText: "Ya,switch user",
cancelButtonText: "Batal",
}).then((result) => {
if (result.value) {
$.ajax({
url: controller + "/switch_user",
dataType: "JSON",
type: "POST",
data: {
id: id,
},
success: function (data) {
if (data.status) {
console.log("success");
window.location.href = baseUrl + "/site/dashboard";
} else {
console.log("filed");
window.location.href = baseUrl + "/user";
}
},
error: function (jqXHR, textStatus, errorThrown) {},
}); //end ajax
}
});
});