feat: Add user edit modal and user management pages
- Implemented user edit modal in user_edit.html for editing user details. - Updated sidebar.html to correctly reflect active states for Users and Settings. - Created table-07.html for displaying user data in a structured format. - Added settings.html for managing email content and configurations. - Developed users.html for listing all users with functionality to add and edit users.
This commit is contained in:
BIN
tailadmin/src/images/spamhasi.png
Normal file
BIN
tailadmin/src/images/spamhasi.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 MiB |
@@ -244,7 +244,6 @@
|
||||
.catch(error => console.error("API Error: " + error))
|
||||
|
||||
function opferEdit(id) {
|
||||
console.log(document.getElementById("opfer_name"));
|
||||
fetch("/api/opfer/info.php", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
@@ -270,8 +269,8 @@
|
||||
const toogle_el = document.querySelector('#toggle2');
|
||||
const toogle_data = Alpine.$data(document.getElementById("toogle2_div"));
|
||||
|
||||
toogle_data.switcherToggle = data.status;
|
||||
toogle_el.checked = data.status;
|
||||
toogle_data.switcherToggle = true;
|
||||
toogle_el.checked = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -154,10 +154,10 @@
|
||||
@click.prevent="dropdownOpen = ! dropdownOpen"
|
||||
>
|
||||
<span class="mr-3 h-11 w-11 overflow-hidden rounded-full">
|
||||
<img src="./images/user/owner.jpg" alt="User" />
|
||||
<img src="./images/spamhasi.png" alt="User" />
|
||||
</span>
|
||||
|
||||
<span class="text-theme-sm mr-1 block font-medium"> Musharof </span>
|
||||
<span class="text-theme-sm mr-1 block font-medium"> <span id="username"></span> </span>
|
||||
|
||||
<svg
|
||||
:class="dropdownOpen && 'rotate-180'"
|
||||
@@ -187,90 +187,13 @@
|
||||
<span
|
||||
class="text-theme-sm block font-medium text-gray-700 dark:text-gray-400"
|
||||
>
|
||||
Musharof Chowdhury
|
||||
</span>
|
||||
<span
|
||||
class="text-theme-xs mt-0.5 block text-gray-500 dark:text-gray-400"
|
||||
>
|
||||
randomuser@pimjo.com
|
||||
SPAMHASI
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<ul
|
||||
class="flex flex-col gap-1 border-b border-gray-200 pt-4 pb-3 dark:border-gray-800"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
href="profile.html"
|
||||
class="group text-theme-sm flex items-center gap-3 rounded-lg px-3 py-2 font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-gray-300"
|
||||
>
|
||||
<svg
|
||||
class="fill-gray-500 group-hover:fill-gray-700 dark:fill-gray-400 dark:group-hover:fill-gray-300"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M12 3.5C7.30558 3.5 3.5 7.30558 3.5 12C3.5 14.1526 4.3002 16.1184 5.61936 17.616C6.17279 15.3096 8.24852 13.5955 10.7246 13.5955H13.2746C15.7509 13.5955 17.8268 15.31 18.38 17.6167C19.6996 16.119 20.5 14.153 20.5 12C20.5 7.30558 16.6944 3.5 12 3.5ZM17.0246 18.8566V18.8455C17.0246 16.7744 15.3457 15.0955 13.2746 15.0955H10.7246C8.65354 15.0955 6.97461 16.7744 6.97461 18.8455V18.856C8.38223 19.8895 10.1198 20.5 12 20.5C13.8798 20.5 15.6171 19.8898 17.0246 18.8566ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM11.9991 7.25C10.8847 7.25 9.98126 8.15342 9.98126 9.26784C9.98126 10.3823 10.8847 11.2857 11.9991 11.2857C13.1135 11.2857 14.0169 10.3823 14.0169 9.26784C14.0169 8.15342 13.1135 7.25 11.9991 7.25ZM8.48126 9.26784C8.48126 7.32499 10.0563 5.75 11.9991 5.75C13.9419 5.75 15.5169 7.32499 15.5169 9.26784C15.5169 11.2107 13.9419 12.7857 11.9991 12.7857C10.0563 12.7857 8.48126 11.2107 8.48126 9.26784Z"
|
||||
fill=""
|
||||
/>
|
||||
</svg>
|
||||
Edit profile
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="messages.html"
|
||||
class="group text-theme-sm flex items-center gap-3 rounded-lg px-3 py-2 font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-gray-300"
|
||||
>
|
||||
<svg
|
||||
class="fill-gray-500 group-hover:fill-gray-700 dark:fill-gray-400 dark:group-hover:fill-gray-300"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M10.4858 3.5L13.5182 3.5C13.9233 3.5 14.2518 3.82851 14.2518 4.23377C14.2518 5.9529 16.1129 7.02795 17.602 6.1682C17.9528 5.96567 18.4014 6.08586 18.6039 6.43667L20.1203 9.0631C20.3229 9.41407 20.2027 9.86286 19.8517 10.0655C18.3625 10.9253 18.3625 13.0747 19.8517 13.9345C20.2026 14.1372 20.3229 14.5859 20.1203 14.9369L18.6039 17.5634C18.4013 17.9142 17.9528 18.0344 17.602 17.8318C16.1129 16.9721 14.2518 18.0471 14.2518 19.7663C14.2518 20.1715 13.9233 20.5 13.5182 20.5H10.4858C10.0804 20.5 9.75182 20.1714 9.75182 19.766C9.75182 18.0461 7.88983 16.9717 6.40067 17.8314C6.04945 18.0342 5.60037 17.9139 5.39767 17.5628L3.88167 14.937C3.67903 14.586 3.79928 14.1372 4.15026 13.9346C5.63949 13.0748 5.63946 10.9253 4.15025 10.0655C3.79926 9.86282 3.67901 9.41401 3.88165 9.06303L5.39764 6.43725C5.60034 6.08617 6.04943 5.96581 6.40065 6.16858C7.88982 7.02836 9.75182 5.9539 9.75182 4.23399C9.75182 3.82862 10.0804 3.5 10.4858 3.5ZM13.5182 2L10.4858 2C9.25201 2 8.25182 3.00019 8.25182 4.23399C8.25182 4.79884 7.64013 5.15215 7.15065 4.86955C6.08213 4.25263 4.71559 4.61859 4.0986 5.68725L2.58261 8.31303C1.96575 9.38146 2.33183 10.7477 3.40025 11.3645C3.88948 11.647 3.88947 12.3531 3.40026 12.6355C2.33184 13.2524 1.96578 14.6186 2.58263 15.687L4.09863 18.3128C4.71562 19.3814 6.08215 19.7474 7.15067 19.1305C7.64015 18.8479 8.25182 19.2012 8.25182 19.766C8.25182 20.9998 9.25201 22 10.4858 22H13.5182C14.7519 22 15.7518 20.9998 15.7518 19.7663C15.7518 19.2015 16.3632 18.8487 16.852 19.1309C17.9202 19.7476 19.2862 19.3816 19.9029 18.3134L21.4193 15.6869C22.0361 14.6185 21.6701 13.2523 20.6017 12.6355C20.1125 12.3531 20.1125 11.647 20.6017 11.3645C21.6701 10.7477 22.0362 9.38152 21.4193 8.3131L19.903 5.68667C19.2862 4.61842 17.9202 4.25241 16.852 4.86917C16.3632 5.15138 15.7518 4.79856 15.7518 4.23377C15.7518 3.00024 14.7519 2 13.5182 2ZM9.6659 11.9999C9.6659 10.7103 10.7113 9.66493 12.0009 9.66493C13.2905 9.66493 14.3359 10.7103 14.3359 11.9999C14.3359 13.2895 13.2905 14.3349 12.0009 14.3349C10.7113 14.3349 9.6659 13.2895 9.6659 11.9999ZM12.0009 8.16493C9.88289 8.16493 8.1659 9.88191 8.1659 11.9999C8.1659 14.1179 9.88289 15.8349 12.0009 15.8349C14.1189 15.8349 15.8359 14.1179 15.8359 11.9999C15.8359 9.88191 14.1189 8.16493 12.0009 8.16493Z"
|
||||
fill=""
|
||||
/>
|
||||
</svg>
|
||||
Account settings
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="settings.html"
|
||||
class="group text-theme-sm flex items-center gap-3 rounded-lg px-3 py-2 font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-gray-300"
|
||||
>
|
||||
<svg
|
||||
class="fill-gray-500 group-hover:fill-gray-700 dark:fill-gray-400 dark:group-hover:fill-gray-300"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M3.5 12C3.5 7.30558 7.30558 3.5 12 3.5C16.6944 3.5 20.5 7.30558 20.5 12C20.5 16.6944 16.6944 20.5 12 20.5C7.30558 20.5 3.5 16.6944 3.5 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM11.0991 7.52507C11.0991 8.02213 11.5021 8.42507 11.9991 8.42507H12.0001C12.4972 8.42507 12.9001 8.02213 12.9001 7.52507C12.9001 7.02802 12.4972 6.62507 12.0001 6.62507H11.9991C11.5021 6.62507 11.0991 7.02802 11.0991 7.52507ZM12.0001 17.3714C11.5859 17.3714 11.2501 17.0356 11.2501 16.6214V10.9449C11.2501 10.5307 11.5859 10.1949 12.0001 10.1949C12.4143 10.1949 12.7501 10.5307 12.7501 10.9449V16.6214C12.7501 17.0356 12.4143 17.3714 12.0001 17.3714Z"
|
||||
fill=""
|
||||
/>
|
||||
</svg>
|
||||
Support
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<button
|
||||
class="group text-theme-sm mt-3 flex items-center gap-3 rounded-lg px-3 py-2 font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-gray-300"
|
||||
onclick="logout()"
|
||||
>
|
||||
<svg
|
||||
class="fill-gray-500 group-hover:fill-gray-700 dark:group-hover:fill-gray-300"
|
||||
@@ -288,7 +211,7 @@
|
||||
/>
|
||||
</svg>
|
||||
|
||||
Sign out
|
||||
Abmelden
|
||||
</button>
|
||||
</div>
|
||||
<!-- Dropdown End -->
|
||||
@@ -296,4 +219,21 @@
|
||||
<!-- User Area -->
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var cookies = document.cookie.split(";");
|
||||
|
||||
for (let cookie of cookies) {
|
||||
var [key, value] = cookie.trim().split("=");
|
||||
|
||||
if (key === "username") {
|
||||
username = decodeURIComponent(value);
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById("username").innerHTML = username;
|
||||
|
||||
function logout() {
|
||||
window.location.href = "/login.php?action=logout";
|
||||
}
|
||||
</script>
|
||||
</header>
|
||||
|
||||
36
tailadmin/src/partials/profile/list.php
Normal file
36
tailadmin/src/partials/profile/list.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
require "../api.php";
|
||||
|
||||
$api = new spamhasiApi();
|
||||
|
||||
if (!$api->checkAuth()) {
|
||||
die('{"status":500, "error":"Unauthorized"}');
|
||||
}
|
||||
|
||||
$db = $api->getDB();
|
||||
|
||||
$sql = "SELECT * FROM users";
|
||||
$stmt = $db->query($sql);
|
||||
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$all_users = [];
|
||||
|
||||
if ($result) {
|
||||
foreach ($result as $user_res) {
|
||||
$user["id"] = $user_res["id"];
|
||||
$user["name"] = $user_res["name"];
|
||||
$user["mail"] = $user_res["mail"];
|
||||
$user["number"] = $user_res["number"];
|
||||
|
||||
$all_opfer[] = $opfer;
|
||||
}
|
||||
|
||||
$json["user"] = $all_user;
|
||||
}else{
|
||||
$json["user"] = [];
|
||||
}
|
||||
|
||||
$json["status"] = 200;
|
||||
|
||||
die(json_encode($json));
|
||||
?>
|
||||
109
tailadmin/src/partials/profile/user_add.html
Normal file
109
tailadmin/src/partials/profile/user_add.html
Normal file
@@ -0,0 +1,109 @@
|
||||
<div
|
||||
x-show="isUserAdd"
|
||||
class="fixed inset-0 flex items-center justify-center p-5 overflow-y-auto z-99999"
|
||||
>
|
||||
<div
|
||||
class="modal-close-btn fixed inset-0 h-full w-full bg-gray-400/50 backdrop-blur-[32px]"
|
||||
></div>
|
||||
<div
|
||||
@click.outside="isUserAdd = false"
|
||||
class="no-scrollbar relative w-full max-w-[700px] overflow-y-auto rounded-3xl bg-white p-4 dark:bg-gray-900 lg:p-11"
|
||||
>
|
||||
<!-- close btn -->
|
||||
<button
|
||||
@click="isUserAdd = false"
|
||||
class="transition-color absolute right-5 top-5 z-999 flex h-11 w-11 items-center justify-center rounded-full bg-gray-100 text-gray-400 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-700 dark:bg-white/[0.05] dark:text-gray-400 dark:hover:bg-white/[0.07] dark:hover:text-gray-300"
|
||||
>
|
||||
<svg
|
||||
class="fill-current"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M6.04289 16.5418C5.65237 16.9323 5.65237 17.5655 6.04289 17.956C6.43342 18.3465 7.06658 18.3465 7.45711 17.956L11.9987 13.4144L16.5408 17.9565C16.9313 18.347 17.5645 18.347 17.955 17.9565C18.3455 17.566 18.3455 16.9328 17.955 16.5423L13.4129 12.0002L17.955 7.45808C18.3455 7.06756 18.3455 6.43439 17.955 6.04387C17.5645 5.65335 16.9313 5.65335 16.5408 6.04387L11.9987 10.586L7.45711 6.04439C7.06658 5.65386 6.43342 5.65386 6.04289 6.04439C5.65237 6.43491 5.65237 7.06808 6.04289 7.4586L10.5845 12.0002L6.04289 16.5418Z"
|
||||
fill=""
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="px-2 pr-14">
|
||||
<h4 class="mb-2 text-2xl font-semibold text-gray-800 dark:text-white/90">
|
||||
Ein neuen Benutzer hinzufügen!
|
||||
</h4>
|
||||
<p class="mb-6 text-sm text-gray-500 dark:text-gray-400 lg:mb-7">
|
||||
Füge hier einen neuen Benutzer hinzu, damit jeder Spamhasi haben kann!
|
||||
</p>
|
||||
</div>
|
||||
<form class="flex flex-col" action="/api/users/add.php" method="post">
|
||||
<div class="custom-scrollbar h-[450px] overflow-y-auto px-2">
|
||||
<div class="mt-7">
|
||||
<div class="grid grid-cols-1 gap-x-6 gap-y-5 lg:grid-cols-2">
|
||||
<div class="col-span-2 lg:col-span-1">
|
||||
<label
|
||||
class="mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400"
|
||||
>
|
||||
Name
|
||||
</label>
|
||||
<input
|
||||
required
|
||||
type="text"
|
||||
value=""
|
||||
name="name"
|
||||
class="dark:bg-dark-900 h-11 w-full rounded-lg border border-gray-300 bg-transparent bg-none px-4 py-2.5 text-sm text-gray-800 shadow-theme-xs placeholder:text-gray-400 focus:border-brand-300 focus:outline-hidden focus:ring-3 focus:ring-brand-500/10 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30 dark:focus:border-brand-800"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-span-2 lg:col-span-1">
|
||||
<label
|
||||
class="mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400"
|
||||
>
|
||||
Passwort
|
||||
</label>
|
||||
<input
|
||||
required
|
||||
type="password"
|
||||
name="passwd1"
|
||||
value=""
|
||||
class="dark:bg-dark-900 h-11 w-full appearance-none rounded-lg border border-gray-300 bg-transparent bg-none px-4 py-2.5 text-sm text-gray-800 shadow-theme-xs placeholder:text-gray-400 focus:border-brand-300 focus:outline-hidden focus:ring-3 focus:ring-brand-500/10 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30 dark:focus:border-brand-800"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-span-2 lg:col-span-1">
|
||||
<label
|
||||
class="mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400"
|
||||
>
|
||||
Passwort wiederholen
|
||||
</label>
|
||||
<input
|
||||
required
|
||||
name="passwd2"
|
||||
type="password"
|
||||
value=""
|
||||
class="dark:bg-dark-900 h-11 w-full appearance-none rounded-lg border border-gray-300 bg-transparent bg-none px-4 py-2.5 text-sm text-gray-800 shadow-theme-xs placeholder:text-gray-400 focus:border-brand-300 focus:outline-hidden focus:ring-3 focus:ring-brand-500/10 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30 dark:focus:border-brand-800"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-3 px-2 mt-6 lg:justify-end">
|
||||
<button
|
||||
@click="isUserAdd = false"
|
||||
type="button"
|
||||
class="flex w-full justify-center rounded-lg border border-gray-300 bg-white px-4 py-2.5 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/[0.03] sm:w-auto"
|
||||
>
|
||||
Später
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
class="flex w-full justify-center rounded-lg bg-brand-500 px-4 py-2.5 text-sm font-medium text-white hover:bg-brand-600 sm:w-auto"
|
||||
>
|
||||
Hinzufügen
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
120
tailadmin/src/partials/profile/user_edit.html
Normal file
120
tailadmin/src/partials/profile/user_edit.html
Normal file
@@ -0,0 +1,120 @@
|
||||
<div
|
||||
x-show="isUserEdit"
|
||||
class="fixed inset-0 flex items-center justify-center p-5 overflow-y-auto z-99999"
|
||||
>
|
||||
<div
|
||||
class="modal-close-btn fixed inset-0 h-full w-full bg-gray-400/50 backdrop-blur-[32px]"
|
||||
></div>
|
||||
<div
|
||||
@click.outside="isUserEdit = false"
|
||||
class="no-scrollbar relative w-full max-w-[700px] overflow-y-auto rounded-3xl bg-white p-4 dark:bg-gray-900 lg:p-11"
|
||||
>
|
||||
<!-- close btn -->
|
||||
<button
|
||||
@click="isUserEdit = false"
|
||||
class="transition-color absolute right-5 top-5 z-999 flex h-11 w-11 items-center justify-center rounded-full bg-gray-100 text-gray-400 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-700 dark:bg-white/[0.05] dark:text-gray-400 dark:hover:bg-white/[0.07] dark:hover:text-gray-300"
|
||||
>
|
||||
<svg
|
||||
class="fill-current"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M6.04289 16.5418C5.65237 16.9323 5.65237 17.5655 6.04289 17.956C6.43342 18.3465 7.06658 18.3465 7.45711 17.956L11.9987 13.4144L16.5408 17.9565C16.9313 18.347 17.5645 18.347 17.955 17.9565C18.3455 17.566 18.3455 16.9328 17.955 16.5423L13.4129 12.0002L17.955 7.45808C18.3455 7.06756 18.3455 6.43439 17.955 6.04387C17.5645 5.65335 16.9313 5.65335 16.5408 6.04387L11.9987 10.586L7.45711 6.04439C7.06658 5.65386 6.43342 5.65386 6.04289 6.04439C5.65237 6.43491 5.65237 7.06808 6.04289 7.4586L10.5845 12.0002L6.04289 16.5418Z"
|
||||
fill=""
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="px-2 pr-14">
|
||||
<h4 class="mb-2 text-2xl font-semibold text-gray-800 dark:text-white/90">
|
||||
Einen Benutzer bearbeiten
|
||||
</h4>
|
||||
<p class="mb-6 text-sm text-gray-500 dark:text-gray-400 lg:mb-7">
|
||||
Bearbeite einen Benutzer!
|
||||
</p>
|
||||
</div>
|
||||
<form class="flex flex-col" action="/api/users/edit.php" method="post">
|
||||
<div class="custom-scrollbar h-[450px] overflow-y-auto px-2">
|
||||
<div class="mt-7">
|
||||
<div class="grid grid-cols-1 gap-x-6 gap-y-5 lg:grid-cols-2">
|
||||
<div class="col-span-2 lg:col-span-1">
|
||||
<label
|
||||
class="mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400"
|
||||
>
|
||||
Benutzername
|
||||
</label>
|
||||
<input
|
||||
required
|
||||
id="user_name"
|
||||
type="text"
|
||||
value=""
|
||||
name="name"
|
||||
class="dark:bg-dark-900 h-11 w-full rounded-lg border border-gray-300 bg-transparent bg-none px-4 py-2.5 text-sm text-gray-800 shadow-theme-xs placeholder:text-gray-400 focus:border-brand-300 focus:outline-hidden focus:ring-3 focus:ring-brand-500/10 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30 dark:focus:border-brand-800"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-span-2 lg:col-span-1">
|
||||
<label
|
||||
class="mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400"
|
||||
>
|
||||
Neues Passwort
|
||||
</label>
|
||||
<input
|
||||
required
|
||||
id="user_passwd_1"
|
||||
type="password"
|
||||
name="passwd1"
|
||||
value=""
|
||||
class="dark:bg-dark-900 h-11 w-full appearance-none rounded-lg border border-gray-300 bg-transparent bg-none px-4 py-2.5 text-sm text-gray-800 shadow-theme-xs placeholder:text-gray-400 focus:border-brand-300 focus:outline-hidden focus:ring-3 focus:ring-brand-500/10 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30 dark:focus:border-brand-800"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-span-2 lg:col-span-1">
|
||||
<label
|
||||
class="mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400"
|
||||
>
|
||||
Neues Passwort bestätigen
|
||||
</label>
|
||||
<input
|
||||
required
|
||||
id="user_passwd_2"
|
||||
type="password"
|
||||
name="passwd2"
|
||||
value=""
|
||||
class="dark:bg-dark-900 h-11 w-full appearance-none rounded-lg border border-gray-300 bg-transparent bg-none px-4 py-2.5 text-sm text-gray-800 shadow-theme-xs placeholder:text-gray-400 focus:border-brand-300 focus:outline-hidden focus:ring-3 focus:ring-brand-500/10 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30 dark:focus:border-brand-800"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="id" value="" id="user_id">
|
||||
<div class="flex items-center gap-3 px-2 mt-6 lg:justify-end">
|
||||
<button
|
||||
@click="isUserEdit = false"
|
||||
type="button"
|
||||
class="flex w-full justify-center rounded-lg border border-gray-300 bg-white px-4 py-2.5 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/[0.03] sm:w-auto"
|
||||
>
|
||||
Später
|
||||
</button>
|
||||
<button
|
||||
onclick="removeUser()"
|
||||
type="button"
|
||||
class="flex w-full justify-center rounded-lg bg-brand-500 px-4 py-2.5 text-sm font-medium text-white hover:bg-brand-600 sm:w-auto"
|
||||
style="background-color: #e70000;"
|
||||
>
|
||||
Löschen
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
class="flex w-full justify-center rounded-lg bg-brand-500 px-4 py-2.5 text-sm font-medium text-white hover:bg-brand-600 sm:w-auto"
|
||||
>
|
||||
Speichern
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -97,10 +97,10 @@
|
||||
href="users.html"
|
||||
@click="selected = (selected === 'Users' ? '':'Users')"
|
||||
class="menu-item group"
|
||||
:class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'"
|
||||
:class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'"
|
||||
>
|
||||
<svg
|
||||
:class="(selected === 'Users') && (page === 'users') ? 'menu-item-icon-active' :'menu-item-icon-inactive'"
|
||||
:class="(selected === 'Users') && (page === 'Users') ? 'menu-item-icon-active' :'menu-item-icon-inactive'"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
@@ -125,13 +125,13 @@
|
||||
<!-- Menu Item Dashboard -->
|
||||
<li>
|
||||
<a
|
||||
href="#"
|
||||
@click.prevent="selected = (selected === 'Settings' ? '':'Settings')"
|
||||
href="settings.html"
|
||||
@click="selected = (selected === 'Settings' ? '':'Settings')"
|
||||
class="menu-item group"
|
||||
:class=" (selected === 'Settings') || (page === 'ecommerce' || page === 'analytics' || page === 'marketing' || page === 'crm' || page === 'stocks') ? 'menu-item-active' : 'menu-item-inactive'"
|
||||
:class=" (selected === 'Settings') && (page === 'Settings') ? 'menu-item-active' : 'menu-item-inactive'"
|
||||
>
|
||||
<svg
|
||||
:class="(selected === 'Settings') || (page === 'ecommerce' || page === 'analytics' || page === 'marketing' || page === 'crm' || page === 'stocks') ? 'menu-item-icon-active' :'menu-item-icon-inactive'"
|
||||
:class="(selected === 'Settings') && (page === 'Settings') ? 'menu-item-icon-active' :'menu-item-icon-inactive'"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
@@ -141,7 +141,7 @@
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M10.4858 3.5L13.5182 3.5C13.9233 3.5 14.2518 3.82851 14.2518 4.23377C14.2518 5.9529 16.1129 7.02795 17.602 6.1682C17.9528 5.96567 18.4014 6.08586 18.6039 6.43667L20.1203 9.0631C20.3229 9.41407 20.2027 9.86286 19.8517 10.0655C18.3625 10.9253 18.3625 13.0747 19.8517 13.9345C20.2026 14.1372 20.3229 14.5859 20.1203 14.9369L18.6039 17.5634C18.4013 17.9142 17.9528 18.0344 17.602 17.8318C16.1129 16.9721 14.2518 18.0471 14.2518 19.7663C14.2518 20.1715 13.9233 20.5 13.5182 20.5H10.4858C10.0804 20.5 9.75182 20.1714 9.75182 19.766C9.75182 18.0461 7.88983 16.9717 6.40067 17.8314C6.04945 18.0342 5.60037 17.9139 5.39767 17.5628L3.88167 14.937C3.67903 14.586 3.79928 14.1372 4.15026 13.9346C5.63949 13.0748 5.63946 10.9253 4.15025 10.0655C3.79926 9.86282 3.67901 9.41401 3.88165 9.06303L5.39764 6.43725C5.60034 6.08617 6.04943 5.96581 6.40065 6.16858C7.88982 7.02836 9.75182 5.9539 9.75182 4.23399C9.75182 3.82862 10.0804 3.5 10.4858 3.5ZM13.5182 2L10.4858 2C9.25201 2 8.25182 3.00019 8.25182 4.23399C8.25182 4.79884 7.64013 5.15215 7.15065 4.86955C6.08213 4.25263 4.71559 4.61859 4.0986 5.68725L2.58261 8.31303C1.96575 9.38146 2.33183 10.7477 3.40025 11.3645C3.88948 11.647 3.88947 12.3531 3.40026 12.6355C2.33184 13.2524 1.96578 14.6186 2.58263 15.687L4.09863 18.3128C4.71562 19.3814 6.08215 19.7474 7.15067 19.1305C7.64015 18.8479 8.25182 19.2012 8.25182 19.766C8.25182 20.9998 9.25201 22 10.4858 22H13.5182C14.7519 22 15.7518 20.9998 15.7518 19.7663C15.7518 19.2015 16.3632 18.8487 16.852 19.1309C17.9202 19.7476 19.2862 19.3816 19.9029 18.3134L21.4193 15.6869C22.0361 14.6185 21.6701 13.2523 20.6017 12.6355C20.1125 12.3531 20.1125 11.647 20.6017 11.3645C21.6701 10.7477 22.0362 9.38152 21.4193 8.3131L19.903 5.68667C19.2862 4.61842 17.9202 4.25241 16.852 4.86917C16.3632 5.15138 15.7518 4.79856 15.7518 4.23377C15.7518 3.00024 14.7519 2 13.5182 2ZM9.6659 11.9999C9.6659 10.7103 10.7113 9.66493 12.0009 9.66493C13.2905 9.66493 14.3359 10.7103 14.3359 11.9999C14.3359 13.2895 13.2905 14.3349 12.0009 14.3349C10.7113 14.3349 9.6659 13.2895 9.6659 11.9999ZM12.0009 8.16493C9.88289 8.16493 8.1659 9.88191 8.1659 11.9999C8.1659 14.1179 9.88289 15.8349 12.0009 15.8349C14.1189 15.8349 15.8359 14.1179 15.8359 11.9999C15.8359 9.88191 14.1189 8.16493 12.0009 8.16493Z"
|
||||
d="M8.80443 5.60156C7.59109 5.60156 6.60749 6.58517 6.60749 7.79851C6.60749 9.01185 7.59109 9.99545 8.80443 9.99545C10.0178 9.99545 11.0014 9.01185 11.0014 7.79851C11.0014 6.58517 10.0178 5.60156 8.80443 5.60156ZM5.10749 7.79851C5.10749 5.75674 6.76267 4.10156 8.80443 4.10156C10.8462 4.10156 12.5014 5.75674 12.5014 7.79851C12.5014 9.84027 10.8462 11.4955 8.80443 11.4955C6.76267 11.4955 5.10749 9.84027 5.10749 7.79851ZM4.86252 15.3208C4.08769 16.0881 3.70377 17.0608 3.51705 17.8611C3.48384 18.0034 3.5211 18.1175 3.60712 18.2112C3.70161 18.3141 3.86659 18.3987 4.07591 18.3987H13.4249C13.6343 18.3987 13.7992 18.3141 13.8937 18.2112C13.9797 18.1175 14.017 18.0034 13.9838 17.8611C13.7971 17.0608 13.4132 16.0881 12.6383 15.3208C11.8821 14.572 10.6899 13.955 8.75042 13.955C6.81096 13.955 5.61877 14.572 4.86252 15.3208ZM3.8071 14.2549C4.87163 13.2009 6.45602 12.455 8.75042 12.455C11.0448 12.455 12.6292 13.2009 13.6937 14.2549C14.7397 15.2906 15.2207 16.5607 15.4446 17.5202C15.7658 18.8971 14.6071 19.8987 13.4249 19.8987H4.07591C2.89369 19.8987 1.73504 18.8971 2.05628 17.5202C2.28015 16.5607 2.76117 15.2906 3.8071 14.2549ZM15.3042 11.4955C14.4702 11.4955 13.7006 11.2193 13.0821 10.7533C13.3742 10.3314 13.6054 9.86419 13.7632 9.36432C14.1597 9.75463 14.7039 9.99545 15.3042 9.99545C16.5176 9.99545 17.5012 9.01185 17.5012 7.79851C17.5012 6.58517 16.5176 5.60156 15.3042 5.60156C14.7039 5.60156 14.1597 5.84239 13.7632 6.23271C13.6054 5.73284 13.3741 5.26561 13.082 4.84371C13.7006 4.37777 14.4702 4.10156 15.3042 4.10156C17.346 4.10156 19.0012 5.75674 19.0012 7.79851C19.0012 9.84027 17.346 11.4955 15.3042 11.4955ZM19.9248 19.8987H16.3901C16.7014 19.4736 16.9159 18.969 16.9827 18.3987H19.9248C20.1341 18.3987 20.2991 18.3141 20.3936 18.2112C20.4796 18.1175 20.5169 18.0034 20.4837 17.861C20.2969 17.0607 19.913 16.088 19.1382 15.3208C18.4047 14.5945 17.261 13.9921 15.4231 13.9566C15.2232 13.6945 14.9995 13.437 14.7491 13.1891C14.5144 12.9566 14.262 12.7384 13.9916 12.5362C14.3853 12.4831 14.8044 12.4549 15.2503 12.4549C17.5447 12.4549 19.1291 13.2008 20.1936 14.2549C21.2395 15.2906 21.7206 16.5607 21.9444 17.5202C22.2657 18.8971 21.107 19.8987 19.9248 19.8987Z"
|
||||
fill="" />
|
||||
</svg>
|
||||
|
||||
@@ -151,47 +151,7 @@
|
||||
>
|
||||
Einstellungen
|
||||
</span>
|
||||
|
||||
<svg
|
||||
class="menu-item-arrow"
|
||||
:class="[(selected === 'Settings') ? 'menu-item-arrow-active' : 'menu-item-arrow-inactive', sidebarToggle ? 'lg:hidden' : '' ]"
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 20 20"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M4.79175 7.39584L10.0001 12.6042L15.2084 7.39585"
|
||||
stroke=""
|
||||
stroke-width="1.5"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</a>
|
||||
|
||||
<!-- Dropdown Menu Start -->
|
||||
<div
|
||||
class="overflow-hidden transform translate"
|
||||
:class="(selected === 'Settings') ? 'block' :'hidden'"
|
||||
>
|
||||
<ul
|
||||
:class="sidebarToggle ? 'lg:hidden' : 'flex'"
|
||||
class="flex flex-col gap-1 mt-2 menu-dropdown pl-9"
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
href="index.html"
|
||||
class="menu-dropdown-item group"
|
||||
:class="page === 'ecommerce' ? 'menu-dropdown-item-active' : 'menu-dropdown-item-inactive'"
|
||||
>
|
||||
eCommerce
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- Dropdown Menu End -->
|
||||
</li>
|
||||
<!-- Menu Item Dashboard -->
|
||||
</ul>
|
||||
|
||||
36
tailadmin/src/partials/table/table-07.html
Normal file
36
tailadmin/src/partials/table/table-07.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<div
|
||||
class="overflow-hidden rounded-xl border border-gray-200 bg-white dark:border-gray-800 dark:bg-white/[0.03]"
|
||||
>
|
||||
<div class="max-w-full overflow-x-auto">
|
||||
<table class="min-w-full">
|
||||
<!-- table header start -->
|
||||
<thead>
|
||||
<tr class="border-b border-gray-100 dark:border-gray-800">
|
||||
<th class="px-5 py-3 sm:px-6">
|
||||
<div class="flex items-center">
|
||||
<p
|
||||
class="font-medium text-gray-500 text-theme-xs dark:text-gray-400"
|
||||
>
|
||||
Interne ID
|
||||
</p>
|
||||
</div>
|
||||
</th>
|
||||
<th class="px-5 py-3 sm:px-6">
|
||||
<div class="flex items-center">
|
||||
<p
|
||||
class="font-medium text-gray-500 text-theme-xs dark:text-gray-400"
|
||||
>
|
||||
Benutzername
|
||||
</p>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<!-- table header end -->
|
||||
<!-- table body start -->
|
||||
<tbody class="divide-y divide-gray-100 dark:divide-gray-800" id="user_table">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
145
tailadmin/src/settings.html
Normal file
145
tailadmin/src/settings.html
Normal file
@@ -0,0 +1,145 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
|
||||
/>
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||
<title>
|
||||
Alle Opfer | Spamhasi
|
||||
</title>
|
||||
<style>
|
||||
#alert-success {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#alert-error {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body
|
||||
x-data="{ page: 'Opfer', 'loaded': true, 'darkMode': false, 'stickyMenu': false, 'sidebarToggle': false, 'scrollTop': false, isOpferAdd: false, isOpferEdit: false }"
|
||||
x-init="
|
||||
darkMode = JSON.parse(localStorage.getItem('darkMode'));
|
||||
$watch('darkMode', value => localStorage.setItem('darkMode', JSON.stringify(value)))"
|
||||
:class="{'dark bg-gray-900': darkMode === true}"
|
||||
>
|
||||
<!-- ===== Preloader Start ===== -->
|
||||
<include src="./partials/preloader.html"></include>
|
||||
<!-- ===== Preloader End ===== -->
|
||||
|
||||
<!-- ===== Page Wrapper Start ===== -->
|
||||
<div class="flex h-screen overflow-hidden">
|
||||
<!-- ===== Sidebar Start ===== -->
|
||||
<include src="./partials/sidebar.html"></include>
|
||||
<!-- ===== Sidebar End ===== -->
|
||||
|
||||
<!-- ===== Content Area Start ===== -->
|
||||
<div
|
||||
class="relative flex flex-col flex-1 overflow-x-hidden overflow-y-auto"
|
||||
>
|
||||
<!-- Small Device Overlay Start -->
|
||||
<include src="./partials/overlay.html" />
|
||||
<!-- Small Device Overlay End -->
|
||||
|
||||
<!-- ===== Header Start ===== -->
|
||||
<include src="./partials/header.html" />
|
||||
<!-- ===== Header End ===== -->
|
||||
|
||||
<!-- ===== Main Content Start ===== -->
|
||||
<main>
|
||||
<div class="p-4 mx-auto max-w-(--breakpoint-2xl) md:p-6">
|
||||
<!-- Breadcrumb Start -->
|
||||
<div x-data="{ pageName: `Opfer`}">
|
||||
<div class="mb-6 flex flex-wrap items-center justify-between gap-3">
|
||||
<h2
|
||||
class="text-xl font-semibold text-gray-800 dark:text-white/90"
|
||||
x-text="pageName"
|
||||
></h2>
|
||||
<button
|
||||
@click="isOpferAdd = true"
|
||||
class="flex w-full items-center justify-center gap-2 rounded-full border border-gray-300 bg-white px-4 py-3 text-sm font-medium text-gray-700 shadow-theme-xs hover:bg-gray-50 hover:text-gray-800 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/[0.03] dark:hover:text-gray-200 lg:inline-flex lg:w-auto"
|
||||
>
|
||||
Add
|
||||
</button>
|
||||
</div>
|
||||
<!-- Breadcrumb End -->
|
||||
|
||||
<div
|
||||
class="rounded-2xl border border-gray-200 bg-white dark:border-gray-800 dark:bg-white/[0.03]"
|
||||
>
|
||||
<div class="px-5 py-4 sm:px-6 sm:py-5">
|
||||
<h3
|
||||
class="text-base font-medium text-gray-800 dark:text-white/90"
|
||||
>
|
||||
Inhalt der Mails
|
||||
</h3>
|
||||
</div>
|
||||
<div
|
||||
class="space-y-6 border-t border-gray-100 p-5 sm:p-6 dark:border-gray-800"
|
||||
>
|
||||
<!-- Elements -->
|
||||
<div>
|
||||
<label
|
||||
class="mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400"
|
||||
>
|
||||
HTML Inhalt
|
||||
</label>
|
||||
<textarea
|
||||
placeholder="SPAMHASI IST WIEDER DA!"
|
||||
type="text"
|
||||
rows="6"
|
||||
class="dark:bg-dark-900 shadow-theme-xs focus:border-brand-300 focus:ring-brand-500/10 dark:focus:border-brand-800 w-full rounded-lg border border-gray-300 bg-transparent px-4 py-2.5 text-sm text-gray-800 placeholder:text-gray-400 focus:ring-3 focus:outline-hidden dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30"
|
||||
></textarea>
|
||||
</div>
|
||||
|
||||
<!-- Elements -->
|
||||
<div>
|
||||
<label
|
||||
class="mb-1.5 block text-sm font-medium text-gray-300 dark:text-white/15"
|
||||
>
|
||||
Description
|
||||
</label>
|
||||
<textarea
|
||||
placeholder="Enter a description..."
|
||||
type="text"
|
||||
rows="6"
|
||||
disabled
|
||||
class="dark:bg-dark-900 shadow-theme-xs focus:border-brand-300 focus:shadow-focus-ring dark:focus:border-brand-800 w-full rounded-lg border border-gray-300 bg-transparent px-4 py-2.5 text-sm text-gray-800 placeholder:text-gray-400 focus:ring-0 focus:outline-hidden disabled:border-gray-100 disabled:bg-gray-50 disabled:placeholder:text-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30 dark:disabled:border-gray-800 dark:disabled:bg-white/[0.03] dark:disabled:placeholder:text-white/15"
|
||||
></textarea>
|
||||
</div>
|
||||
|
||||
<!-- Elements -->
|
||||
<div>
|
||||
<label
|
||||
class="mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400"
|
||||
>
|
||||
Description
|
||||
</label>
|
||||
<textarea
|
||||
placeholder="Enter a description..."
|
||||
type="text"
|
||||
rows="6"
|
||||
class="dark:bg-dark-900 border-error-300 shadow-theme-xs focus:border-error-300 focus:ring-error-500/10 dark:border-error-700 dark:focus:border-error-800 w-full rounded-lg border bg-transparent px-4 py-2.5 text-sm text-gray-800 placeholder:text-gray-400 focus:ring-3 focus:outline-hidden dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30"
|
||||
></textarea>
|
||||
<p class="text-theme-xs text-error-500">
|
||||
Please enter a message in the textarea.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<!-- ===== Main Content End ===== -->
|
||||
</div>
|
||||
<!-- ===== Content Area End ===== -->
|
||||
</div>
|
||||
<!-- ===== Page Wrapper End ===== -->
|
||||
<script>
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
271
tailadmin/src/users.html
Normal file
271
tailadmin/src/users.html
Normal file
@@ -0,0 +1,271 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, user-scalable=no, initial-scale=1.0"
|
||||
/>
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||
<title>Alle Benutzer | Spamhasi</title>
|
||||
|
||||
<style>
|
||||
#alert-success {
|
||||
display: none;
|
||||
}
|
||||
#alert-error {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body
|
||||
x-data="{ page: 'Users', loaded: true, darkMode: false, stickyMenu: false, sidebarToggle: false, scrollTop: false, isUserAdd: false, isUserEdit: false }"
|
||||
x-init="
|
||||
darkMode = JSON.parse(localStorage.getItem('darkMode'));
|
||||
$watch('darkMode', value => localStorage.setItem('darkMode', JSON.stringify(value)))
|
||||
"
|
||||
:class="{'dark bg-gray-900': darkMode === true}"
|
||||
>
|
||||
<!-- ===== Preloader Start ===== -->
|
||||
<include src="./partials/preloader.html"></include>
|
||||
<!-- ===== Preloader End ===== -->
|
||||
|
||||
<!-- ===== Page Wrapper Start ===== -->
|
||||
<div class="flex h-screen overflow-hidden">
|
||||
|
||||
<!-- ===== Sidebar Start ===== -->
|
||||
<include src="./partials/sidebar.html"></include>
|
||||
<!-- ===== Sidebar End ===== -->
|
||||
|
||||
<!-- ===== Content Area Start ===== -->
|
||||
<div class="relative flex flex-col flex-1 overflow-x-hidden overflow-y-auto">
|
||||
|
||||
<!-- Small Device Overlay -->
|
||||
<include src="./partials/overlay.html" />
|
||||
|
||||
<!-- ===== Header Start ===== -->
|
||||
<include src="./partials/header.html" />
|
||||
<!-- ===== Header End ===== -->
|
||||
|
||||
<!-- ===== Main Content Start ===== -->
|
||||
<main>
|
||||
<div class="p-4 mx-auto max-w-(--breakpoint-2xl) md:p-6">
|
||||
|
||||
<!-- Header / Titel -->
|
||||
<div x-data="{ pageName: `Benutzer`}">
|
||||
<div class="mb-6 flex flex-wrap items-center justify-between gap-3">
|
||||
<h2
|
||||
class="text-xl font-semibold text-gray-800 dark:text-white/90"
|
||||
x-text="pageName"
|
||||
></h2>
|
||||
|
||||
<button
|
||||
@click="isUserAdd = true"
|
||||
class="flex w-full items-center justify-center gap-2 rounded-full border border-gray-300 bg-white px-4 py-3 text-sm font-medium text-gray-700 shadow-theme-xs hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 lg:inline-flex lg:w-auto"
|
||||
>
|
||||
Add
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Alerts -->
|
||||
<div id="alert-container">
|
||||
<div
|
||||
class="rounded-xl border border-success-500 bg-success-50 p-4 dark:border-success-500/30 dark:bg-success-500/15"
|
||||
id="alert-success"
|
||||
>
|
||||
<div class="flex items-start gap-3">
|
||||
<div class="-mt-0.5 text-success-500">
|
||||
<svg
|
||||
class="fill-current"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M3.70186 12.0001C3.70186 7.41711 7.41711 3.70186 12.0001 3.70186C16.5831 3.70186 20.2984 7.41711 20.2984 12.0001C20.2984 16.5831 16.5831 20.2984 12.0001 20.2984C7.41711 20.2984 3.70186 16.5831 3.70186 12.0001ZM12.0001 1.90186C6.423 1.90186 1.90186 6.423 1.90186 12.0001C1.90186 17.5772 6.423 22.0984 12.0001 22.0984C17.5772 22.0984 22.0984 17.5772 22.0984 12.0001C22.0984 6.423 17.5772 1.90186 12.0001 1.90186ZM15.6197 10.7395C15.9712 10.388 15.9712 9.81819 15.6197 9.46672C15.2683 9.11525 14.6984 9.11525 14.347 9.46672L11.1894 12.6243L9.6533 11.0883C9.30183 10.7368 8.73198 10.7368 8.38051 11.0883C8.02904 11.4397 8.02904 12.0096 8.38051 12.3611L10.553 14.5335C10.7217 14.7023 10.9507 14.7971 11.1894 14.7971C11.428 14.7971 11.657 14.7023 11.8257 14.5335L15.6197 10.7395Z"
|
||||
fill=""
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4 class="mb-1 text-sm font-semibold text-gray-800 dark:text-white/90">
|
||||
Erfolgreich!
|
||||
</h4>
|
||||
|
||||
<p class="text-sm text-gray-500 dark:text-gray-400">
|
||||
Die Aktion wurde erfolgreich ausgeführt
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="rounded-xl border border-error-500 bg-error-50 p-4 dark:border-error-500/30 dark:bg-error-500/15"
|
||||
id="alert-error"
|
||||
>
|
||||
<div class="flex items-start gap-3">
|
||||
<div class="-mt-0.5 text-error-500">
|
||||
<svg
|
||||
class="fill-current"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M20.3499 12.0004C20.3499 16.612 16.6115 20.3504 11.9999 20.3504C7.38832 20.3504 3.6499 16.612 3.6499 12.0004C3.6499 7.38881 7.38833 3.65039 11.9999 3.65039C16.6115 3.65039 20.3499 7.38881 20.3499 12.0004ZM11.9999 22.1504C17.6056 22.1504 22.1499 17.6061 22.1499 12.0004C22.1499 6.3947 17.6056 1.85039 11.9999 1.85039C6.39421 1.85039 1.8499 6.3947 1.8499 12.0004C1.8499 17.6061 6.39421 22.1504 11.9999 22.1504ZM13.0008 16.4753C13.0008 15.923 12.5531 15.4753 12.0008 15.4753L11.9998 15.4753C11.4475 15.4753 10.9998 15.923 10.9998 16.4753C10.9998 17.0276 11.4475 17.4753 11.9998 17.4753L12.0008 17.4753C12.5531 17.4753 13.0008 17.0276 13.0008 16.4753ZM11.9998 6.62898C12.414 6.62898 12.7498 6.96476 12.7498 7.37898L12.7498 13.0555C12.7498 13.4697 12.414 13.8055 11.9998 13.8055C11.5856 13.8055 11.2498 13.4697 11.2498 13.0555L11.2498 7.37898C11.2498 6.96476 11.5856 6.62898 11.9998 6.62898Z"
|
||||
fill="#F04438"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4 class="mb-1 text-sm font-semibold text-gray-800 dark:text-white/90">
|
||||
Es ist ein Fehler aufgetreten
|
||||
</h4>
|
||||
|
||||
<p class="text-sm text-gray-500 dark:text-gray-400">
|
||||
<span id="user-error"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<!-- Tabelle -->
|
||||
<div class="space-y-5 sm:space-y-6">
|
||||
<div
|
||||
class="rounded-2xl border border-gray-200 bg-white dark:border-gray-800 dark:bg-white/[0.03]"
|
||||
>
|
||||
<div class="px-5 py-4 sm:px-6 sm:py-5">
|
||||
<h3
|
||||
class="text-base font-medium text-gray-800 dark:text-white/90"
|
||||
>
|
||||
ALLE OPFER
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="p-5 border-t border-gray-100 dark:border-gray-800 sm:p-6">
|
||||
<include src="./partials/table/table-07.html" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
<!-- ===== Main Content End ===== -->
|
||||
|
||||
</div>
|
||||
<!-- ===== Content Area End ===== -->
|
||||
</div>
|
||||
<!-- ===== Page Wrapper End ===== -->
|
||||
|
||||
<!-- Modals -->
|
||||
<include src="./partials/profile/user_add.html" />
|
||||
<include src="./partials/profile/user_edit.html" />
|
||||
|
||||
<script>
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
|
||||
if (params.has("status")) {
|
||||
if (params.get("status") == 200) {
|
||||
document.getElementById("alert-success").style.display = "block";
|
||||
}else{
|
||||
document.getElementById("alert-error").style.display = "block";
|
||||
document.getElementById("user-error").innerHTML = params.get("error");
|
||||
}
|
||||
}
|
||||
|
||||
fetch("/api/users/list.php")
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.status == 500) {
|
||||
console.error("API Error: " + data.error);
|
||||
}
|
||||
|
||||
var list = document.getElementById("user_table").innerHTML;
|
||||
|
||||
for (const user of data.users) {
|
||||
list += `
|
||||
<tr>
|
||||
<td class="px-5 py-4 sm:px-6">
|
||||
<div class="flex items-center">
|
||||
<div class="flex items-center gap-3">
|
||||
<div>
|
||||
<span
|
||||
@click="isUserEdit = true"
|
||||
onclick="userEdit(` + user.id + `)"
|
||||
class="block font-medium text-gray-800 text-theme-sm dark:text-white/90"
|
||||
>
|
||||
` + user.id + `
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-5 py-4 sm:px-6">
|
||||
<div class="flex items-center">
|
||||
<p class="text-gray-500 text-theme-sm dark:text-gray-400">
|
||||
` + user.name + `
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
}
|
||||
document.getElementById("user_table").innerHTML = list;
|
||||
})
|
||||
.catch(error => console.error("API Error: " + error))
|
||||
|
||||
function userEdit(id) {
|
||||
fetch("/api/users/info.php", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
},
|
||||
body: "id=" + id
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.status == 500) {
|
||||
console.error("API Error: " + data.error);
|
||||
}
|
||||
|
||||
const user = data.user;
|
||||
|
||||
document.getElementById("user_id").value = user.id;
|
||||
document.getElementById("user_name").value = user.username;
|
||||
})
|
||||
}
|
||||
|
||||
function removeUser() {
|
||||
const id = document.getElementById("user_id").value;
|
||||
|
||||
fetch("/api/users/delete.php", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
},
|
||||
body: "id=" + id
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
const url = "/users.html?status=" + data.status + "&error=" + data.error;
|
||||
|
||||
window.location.href = url;
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user