Compare commits
No commits in common. "ai-dev" and "master" have entirely different histories.
102
api_members.php
102
api_members.php
@ -1,102 +0,0 @@
|
|||||||
<?php
|
|
||||||
ini_set('display_errors', 0); // Disable error display for production
|
|
||||||
header('Content-Type: application/json');
|
|
||||||
|
|
||||||
require_once 'db/config.php';
|
|
||||||
|
|
||||||
// Initialize response array
|
|
||||||
$response = ['success' => false, 'error' => '', 'members' => []];
|
|
||||||
|
|
||||||
// Get action from request, default to 'list'
|
|
||||||
$action = $_REQUEST['action'] ?? 'list';
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
|
||||||
$pdo = db();
|
|
||||||
|
|
||||||
switch ($action) {
|
|
||||||
case 'list':
|
|
||||||
$stmt = $pdo->query("SELECT id, name, nik, address, phone FROM members ORDER BY created_at DESC");
|
|
||||||
$response['members'] = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
||||||
$response['success'] = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'add':
|
|
||||||
// Simple validation
|
|
||||||
if (empty($_POST['name']) || empty($_POST['nik'])) {
|
|
||||||
throw new Exception('Nama dan NIK tidak boleh kosong.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = "INSERT INTO members (name, nik, address, phone) VALUES (:name, :nik, :address, :phone)";
|
|
||||||
$stmt = $pdo->prepare($sql);
|
|
||||||
|
|
||||||
$stmt->execute([
|
|
||||||
':name' => $_POST['name'],
|
|
||||||
':nik' => $_POST['nik'],
|
|
||||||
':address' => $_POST['address'] ?? '',
|
|
||||||
':phone' => $_POST['phone'] ?? ''
|
|
||||||
]);
|
|
||||||
|
|
||||||
$response['success'] = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'get':
|
|
||||||
if (empty($_GET['id'])) {
|
|
||||||
throw new Exception('ID anggota tidak valid.');
|
|
||||||
}
|
|
||||||
$stmt = $pdo->prepare("SELECT id, name, nik, address, phone FROM members WHERE id = :id");
|
|
||||||
$stmt->execute([':id' => $_GET['id']]);
|
|
||||||
$member = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
||||||
if (!$member) {
|
|
||||||
throw new Exception('Anggota tidak ditemukan.');
|
|
||||||
}
|
|
||||||
$response['member'] = $member;
|
|
||||||
$response['success'] = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'update':
|
|
||||||
if (empty($_POST['id']) || empty($_POST['name']) || empty($_POST['nik'])) {
|
|
||||||
throw new Exception('ID, Nama, dan NIK tidak boleh kosong.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = "UPDATE members SET name = :name, nik = :nik, address = :address, phone = :phone WHERE id = :id";
|
|
||||||
$stmt = $pdo->prepare($sql);
|
|
||||||
|
|
||||||
$stmt->execute([
|
|
||||||
':id' => $_POST['id'],
|
|
||||||
':name' => $_POST['name'],
|
|
||||||
':nik' => $_POST['nik'],
|
|
||||||
':address' => $_POST['address'] ?? '',
|
|
||||||
':phone' => $_POST['phone'] ?? ''
|
|
||||||
]);
|
|
||||||
|
|
||||||
$response['success'] = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'delete':
|
|
||||||
if (empty($_POST['id'])) {
|
|
||||||
throw new Exception('ID anggota tidak valid.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = "DELETE FROM members WHERE id = :id";
|
|
||||||
$stmt = $pdo->prepare($sql);
|
|
||||||
$stmt->execute([':id' => $_POST['id']]);
|
|
||||||
|
|
||||||
$response['success'] = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
throw new Exception('Aksi tidak valid.');
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
$response['error'] = 'Database error: ' . $e->getMessage();
|
|
||||||
// Check for duplicate entry
|
|
||||||
if ($e->getCode() == 23000) {
|
|
||||||
$response['error'] = 'NIK sudah terdaftar.';
|
|
||||||
}
|
|
||||||
} catch (Exception $e) {
|
|
||||||
$response['error'] = $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
echo json_encode($response);
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
|
|
||||||
body {
|
|
||||||
background-color: #f8f9fa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
border: none;
|
|
||||||
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-header {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-footer {
|
|
||||||
border-top: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toast {
|
|
||||||
position: fixed;
|
|
||||||
top: 20px;
|
|
||||||
right: 20px;
|
|
||||||
z-index: 1055;
|
|
||||||
}
|
|
||||||
@ -1,196 +0,0 @@
|
|||||||
document.addEventListener('DOMContentLoaded', function () {
|
|
||||||
const addMemberModal = new bootstrap.Modal(document.getElementById('addMemberModal'));
|
|
||||||
const editMemberModal = new bootstrap.Modal(document.getElementById('editMemberModal'));
|
|
||||||
const addMemberForm = document.getElementById('addMemberForm');
|
|
||||||
const editMemberForm = document.getElementById('editMemberForm');
|
|
||||||
const memberTableBody = document.getElementById('memberTableBody');
|
|
||||||
|
|
||||||
// Function to show a toast notification
|
|
||||||
function showToast(message, success = true) {
|
|
||||||
const toastContainer = document.getElementById('toastContainer');
|
|
||||||
const toast = document.createElement('div');
|
|
||||||
toast.className = `toast align-items-center text-white ${success ? 'bg-success' : 'bg-danger'} border-0 show`;
|
|
||||||
toast.role = 'alert';
|
|
||||||
toast.ariaLive = 'assertive';
|
|
||||||
toast.ariaAtomic = 'true';
|
|
||||||
|
|
||||||
toast.innerHTML = `
|
|
||||||
<div class="d-flex">
|
|
||||||
<div class="toast-body">${message}</div>
|
|
||||||
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
toastContainer.appendChild(toast);
|
|
||||||
|
|
||||||
const bsToast = new bootstrap.Toast(toast);
|
|
||||||
bsToast.show();
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
bsToast.hide();
|
|
||||||
setTimeout(() => {
|
|
||||||
toast.remove();
|
|
||||||
}, 500);
|
|
||||||
}, 3000);
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadMembers() {
|
|
||||||
fetch('api_members.php?action=list')
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
memberTableBody.innerHTML = '';
|
|
||||||
if (data.success) {
|
|
||||||
if (data.members.length === 0) {
|
|
||||||
memberTableBody.innerHTML = '<tr><td colspan="6" class="text-center">Belum ada anggota.</td></tr>';
|
|
||||||
} else {
|
|
||||||
data.members.forEach(member => {
|
|
||||||
const row = `<tr>
|
|
||||||
<td>${member.id}</td>
|
|
||||||
<td>${escapeHTML(member.name)}</td>
|
|
||||||
<td>${escapeHTML(member.nik)}</td>
|
|
||||||
<td>${escapeHTML(member.address)}</td>
|
|
||||||
<td>${escapeHTML(member.phone)}</td>
|
|
||||||
<td>
|
|
||||||
<button class="btn btn-sm btn-warning btn-edit" data-id="${member.id}" title="Edit"><i class="bi bi-pencil-square"></i></button>
|
|
||||||
<button class="btn btn-sm btn-danger btn-delete" data-id="${member.id}" title="Hapus"><i class="bi bi-trash-fill"></i></button>
|
|
||||||
</td>
|
|
||||||
</tr>`;
|
|
||||||
memberTableBody.innerHTML += row;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// Update total members card
|
|
||||||
document.getElementById('totalMembers').innerText = data.members.length;
|
|
||||||
} else {
|
|
||||||
memberTableBody.innerHTML = `<tr><td colspan="6" class="text-center text-danger">Gagal memuat data: ${data.error}</td></tr>`;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
memberTableBody.innerHTML = `<tr><td colspan="6" class="text-center text-danger">Error: ${error}</td></tr>`;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helper to prevent XSS
|
|
||||||
function escapeHTML(str) {
|
|
||||||
return str.toString().replace(/[&<>"']/g, function (tag) {
|
|
||||||
var chars = {
|
|
||||||
'&': '&',
|
|
||||||
'<': '<',
|
|
||||||
'>': '>',
|
|
||||||
'"': '"',
|
|
||||||
"'": '''
|
|
||||||
};
|
|
||||||
return chars[tag] || tag;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle Add Member form submission
|
|
||||||
addMemberForm.addEventListener('submit', function (event) {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
const formData = new FormData(addMemberForm);
|
|
||||||
fetch('api_members.php', {
|
|
||||||
method: 'POST',
|
|
||||||
body: new URLSearchParams(formData)
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
if (data.success) {
|
|
||||||
showToast('Anggota berhasil ditambahkan!');
|
|
||||||
addMemberModal.hide();
|
|
||||||
addMemberForm.reset();
|
|
||||||
loadMembers();
|
|
||||||
} else {
|
|
||||||
showToast('Gagal menambahkan anggota: ' + data.error, false);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
showToast('Terjadi kesalahan. Silakan coba lagi.', false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
''' // Delegated event listener for edit and delete buttons
|
|
||||||
memberTableBody.addEventListener('click', function (event) {
|
|
||||||
const editButton = event.target.closest('.btn-edit');
|
|
||||||
const deleteButton = event.target.closest('.btn-delete');
|
|
||||||
|
|
||||||
if (editButton) {
|
|
||||||
const memberId = editButton.dataset.id;
|
|
||||||
openEditModal(memberId);
|
|
||||||
} else if (deleteButton) {
|
|
||||||
const memberId = deleteButton.dataset.id;
|
|
||||||
deleteMember(memberId);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Function to open and populate the edit modal
|
|
||||||
function openEditModal(memberId) {
|
|
||||||
fetch(`api_members.php?action=get&id=${memberId}`)
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
if (data.success) {
|
|
||||||
const member = data.member;
|
|
||||||
document.getElementById('editMemberId').value = member.id;
|
|
||||||
document.getElementById('editName').value = member.name;
|
|
||||||
document.getElementById('editNik').value = member.nik;
|
|
||||||
document.getElementById('editAddress').value = member.address;
|
|
||||||
document.getElementById('editPhone').value = member.phone;
|
|
||||||
editMemberModal.show();
|
|
||||||
} else {
|
|
||||||
showToast('Gagal mengambil data anggota: ' + data.error, false);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => showToast('Terjadi kesalahan jaringan.', false));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle Edit Member form submission
|
|
||||||
editMemberForm.addEventListener('submit', function (event) {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
const formData = new FormData(editMemberForm);
|
|
||||||
formData.append('action', 'update');
|
|
||||||
|
|
||||||
fetch('api_members.php', {
|
|
||||||
method: 'POST',
|
|
||||||
body: new URLSearchParams(formData)
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
if (data.success) {
|
|
||||||
showToast('Data anggota berhasil diperbarui!');
|
|
||||||
editMemberModal.hide();
|
|
||||||
loadMembers();
|
|
||||||
} else {
|
|
||||||
showToast('Gagal memperbarui data: ' + data.error, false);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
showToast('Terjadi kesalahan. Silakan coba lagi.', false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Function to delete a member
|
|
||||||
function deleteMember(memberId) {
|
|
||||||
if (confirm('Apakah Anda yakin ingin menghapus anggota ini?')) {
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('action', 'delete');
|
|
||||||
formData.append('id', memberId);
|
|
||||||
|
|
||||||
fetch('api_members.php', {
|
|
||||||
method: 'POST',
|
|
||||||
body: new URLSearchParams(formData)
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
if (data.success) {
|
|
||||||
showToast('Anggota berhasil dihapus.');
|
|
||||||
loadMembers();
|
|
||||||
} else {
|
|
||||||
showToast('Gagal menghapus anggota: ' + data.error, false);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => showToast('Terjadi kesalahan jaringan.', false));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initial load
|
|
||||||
loadMembers();
|
|
||||||
});''
|
|
||||||
30
db_setup.php
30
db_setup.php
@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
require_once 'db/config.php';
|
|
||||||
|
|
||||||
function setup_database() {
|
|
||||||
try {
|
|
||||||
$pdo = db();
|
|
||||||
|
|
||||||
$sql = "
|
|
||||||
CREATE TABLE IF NOT EXISTS members (
|
|
||||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
name VARCHAR(255) NOT NULL,
|
|
||||||
nik VARCHAR(20) NOT NULL UNIQUE,
|
|
||||||
address TEXT,
|
|
||||||
phone VARCHAR(20),
|
|
||||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
||||||
);";
|
|
||||||
|
|
||||||
$pdo->exec($sql);
|
|
||||||
|
|
||||||
// You can add more table creations here in the future
|
|
||||||
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
// In a real app, you'd want to log this error
|
|
||||||
// For this example, we'll just output it.
|
|
||||||
die("DB setup failed: " . $e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run the setup
|
|
||||||
setup_database();
|
|
||||||
331
index.php
331
index.php
@ -1,197 +1,150 @@
|
|||||||
<?php
|
<?php
|
||||||
// Run the database setup script
|
declare(strict_types=1);
|
||||||
require_once 'db_setup.php';
|
@ini_set('display_errors', '1');
|
||||||
|
@error_reporting(E_ALL);
|
||||||
// Project details from environment variables for SEO and metadata
|
@date_default_timezone_set('UTC');
|
||||||
$projectName = htmlspecialchars(getenv('PROJECT_NAME') ?: 'Koperasi Simpan Pinjam');
|
|
||||||
$projectDescription = htmlspecialchars(getenv('PROJECT_DESCRIPTION') ?: 'Aplikasi Manajemen Koperasi Simpan Pinjam');
|
|
||||||
$projectImage = htmlspecialchars(getenv('PROJECT_IMAGE_URL') ?: '');
|
|
||||||
|
|
||||||
|
$phpVersion = PHP_VERSION;
|
||||||
|
$now = date('Y-m-d H:i:s');
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="id">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title><?php echo $projectName; ?></title>
|
<title>New Style</title>
|
||||||
<meta name="description" content="<?php echo $projectDescription; ?>">
|
<?php
|
||||||
|
// Read project preview data from environment
|
||||||
<!-- Open Graph / Facebook -->
|
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
||||||
<meta property="og:type" content="website">
|
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||||
<meta property="og:title" content="<?php echo $projectName; ?>">
|
?>
|
||||||
<meta property="og:description" content="<?php echo $projectDescription; ?>">
|
<?php if ($projectDescription): ?>
|
||||||
<?php if ($projectImage): ?>
|
<!-- Meta description -->
|
||||||
<meta property="og:image" content="<?php echo $projectImage; ?>">
|
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
||||||
<?php endif; ?>
|
<!-- Open Graph meta tags -->
|
||||||
|
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||||
<!-- Twitter -->
|
<!-- Twitter meta tags -->
|
||||||
<meta property="twitter:card" content="summary_large_image">
|
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||||
<meta property="twitter:title" content="<?php echo $projectName; ?>">
|
<?php endif; ?>
|
||||||
<meta property="twitter:description" content="<?php echo $projectDescription; ?>">
|
<?php if ($projectImageUrl): ?>
|
||||||
<?php if ($projectImage): ?>
|
<!-- Open Graph image -->
|
||||||
<meta property="twitter:image" content="<?php echo $projectImage; ?>">
|
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||||
<?php endif; ?>
|
<!-- Twitter image -->
|
||||||
|
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||||
<!-- Favicon -->
|
<?php endif; ?>
|
||||||
<link rel="icon" href="/favicon.ico" sizes="any">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<!-- Bootstrap CSS -->
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
<style>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
:root {
|
||||||
|
--bg-color-start: #6a11cb;
|
||||||
<!-- Custom CSS -->
|
--bg-color-end: #2575fc;
|
||||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
--text-color: #ffffff;
|
||||||
|
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||||
|
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
font-family: 'Inter', sans-serif;
|
||||||
|
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||||
|
color: var(--text-color);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
body::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
||||||
|
animation: bg-pan 20s linear infinite;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
@keyframes bg-pan {
|
||||||
|
0% { background-position: 0% 0%; }
|
||||||
|
100% { background-position: 100% 100%; }
|
||||||
|
}
|
||||||
|
main {
|
||||||
|
padding: 2rem;
|
||||||
|
}
|
||||||
|
.card {
|
||||||
|
background: var(--card-bg-color);
|
||||||
|
border: 1px solid var(--card-border-color);
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 2rem;
|
||||||
|
backdrop-filter: blur(20px);
|
||||||
|
-webkit-backdrop-filter: blur(20px);
|
||||||
|
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
.loader {
|
||||||
|
margin: 1.25rem auto 1.25rem;
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
||||||
|
border-top-color: #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: spin 1s linear infinite;
|
||||||
|
}
|
||||||
|
@keyframes spin {
|
||||||
|
from { transform: rotate(0deg); }
|
||||||
|
to { transform: rotate(360deg); }
|
||||||
|
}
|
||||||
|
.hint {
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
.sr-only {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px; height: 1px;
|
||||||
|
padding: 0; margin: -1px;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
white-space: nowrap; border: 0;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: 3rem;
|
||||||
|
font-weight: 700;
|
||||||
|
margin: 0 0 1rem;
|
||||||
|
letter-spacing: -1px;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
margin: 0.5rem 0;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
}
|
||||||
|
code {
|
||||||
|
background: rgba(0,0,0,0.2);
|
||||||
|
padding: 2px 6px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||||
|
}
|
||||||
|
footer {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 1rem;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<main>
|
||||||
<nav class="navbar navbar-expand-lg navbar-dark bg-primary shadow-sm">
|
<div class="card">
|
||||||
<div class="container-fluid">
|
<h1>Analyzing your requirements and generating your website…</h1>
|
||||||
<a class="navbar-brand fw-bold" href="/"><?php echo $projectName; ?></a>
|
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||||
</div>
|
<span class="sr-only">Loading…</span>
|
||||||
</nav>
|
</div>
|
||||||
|
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
||||||
<main class="container py-5">
|
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
||||||
<h1 class="mb-4">Dashboard</h1>
|
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
||||||
|
|
||||||
<!-- Summary Cards -->
|
|
||||||
<div class="row mb-4">
|
|
||||||
<div class="col-md-4">
|
|
||||||
<div class="card text-center p-3">
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title"><i class="bi bi-people-fill me-2"></i>Total Anggota</h5>
|
|
||||||
<p class="card-text fs-2 fw-bold" id="totalMembers">0</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4">
|
|
||||||
<div class="card text-center p-3">
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title"><i class="bi bi-wallet-fill me-2"></i>Total Simpanan</h5>
|
|
||||||
<p class="card-text fs-2 fw-bold">Rp 0</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4">
|
|
||||||
<div class="card text-center p-3">
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title"><i class="bi bi-cash-coin me-2"></i>Total Pinjaman</h5>
|
|
||||||
<p class="card-text fs-2 fw-bold">Rp 0</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Member List Table -->
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header d-flex justify-content-between align-items-center">
|
|
||||||
<h4 class="mb-0">Daftar Anggota</h4>
|
|
||||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addMemberModal">
|
|
||||||
<i class="bi bi-plus-circle-fill me-2"></i>Tambah Anggota
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="table-responsive">
|
|
||||||
<table class="table table-striped table-hover">
|
|
||||||
<thead class="table-light">
|
|
||||||
<tr>
|
|
||||||
<th scope="col">ID</th>
|
|
||||||
<th scope="col">Nama</th>
|
|
||||||
<th scope="col">NIK</th>
|
|
||||||
<th scope="col">Alamat</th>
|
|
||||||
<th scope="col">Telepon</th>
|
|
||||||
<th scope="col">Aksi</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody id="memberTableBody">
|
|
||||||
<!-- Member rows will be injected by JavaScript -->
|
|
||||||
<tr><td colspan="6" class="text-center">Memuat data...</td></tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<!-- Toast Container -->
|
|
||||||
<div id="toastContainer" class="position-fixed top-0 end-0 p-3" style="z-index: 1055"></div>
|
|
||||||
|
|
||||||
<!-- Add Member Modal -->
|
|
||||||
<div class="modal fade" id="addMemberModal" tabindex="-1" aria-labelledby="addMemberModalLabel" aria-hidden="true">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title" id="addMemberModalLabel">Tambah Anggota Baru</h5>
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<form id="addMemberForm">
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="name" class="form-label">Nama Lengkap</label>
|
|
||||||
<input type="text" class="form-control" id="name" name="name" required>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="nik" class="form-label">NIK (Nomor Induk Kependudukan)</label>
|
|
||||||
<input type="text" class="form-control" id="nik" name="nik" required>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="address" class="form-label">Alamat</label>
|
|
||||||
<textarea class="form-control" id="address" name="address" rows="3"></textarea>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="phone" class="form-label">Nomor Telepon</label>
|
|
||||||
<input type="tel" class="form-control" id="phone" name="phone">
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
|
|
||||||
<button type="submit" class="btn btn-primary">Simpan</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</main>
|
||||||
<!-- Edit Member Modal -->
|
<footer>
|
||||||
<div class="modal fade" id="editMemberModal" tabindex="-1" aria-labelledby="editMemberModalLabel" aria-hidden="true">
|
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||||
<div class="modal-dialog">
|
</footer>
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title" id="editMemberModalLabel">Edit Data Anggota</h5>
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<form id="editMemberForm">
|
|
||||||
<input type="hidden" id="editMemberId" name="id">
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="editName" class="form-label">Nama Lengkap</label>
|
|
||||||
<input type="text" class="form-control" id="editName" name="name" required>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="editNik" class="form-label">NIK (Nomor Induk Kependudukan)</label>
|
|
||||||
<input type="text" class="form-control" id="editNik" name="nik" required>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="editAddress" class="form-label">Alamat</label>
|
|
||||||
<textarea class="form-control" id="editAddress" name="address" rows="3"></textarea>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="editPhone" class="form-label">Nomor Telepon</label>
|
|
||||||
<input type="tel" class="form-control" id="editPhone" name="phone">
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
|
|
||||||
<button type="submit" class="btn btn-primary">Simpan Perubahan</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Bootstrap JS Bundle -->
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
||||||
|
|
||||||
<!-- Custom JS -->
|
|
||||||
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user