Upload files to "/"
This commit is contained in:
+1
-5
@@ -1,13 +1,9 @@
|
|||||||
FROM php:8.2-apache
|
FROM php:8.2-apache
|
||||||
|
|
||||||
RUN docker-php-ext-install mysqli pdo pdo_mysql
|
RUN docker-php-ext-install mysqli pdo pdo_mysql
|
||||||
RUN a2enmod rewrite
|
|
||||||
|
|
||||||
COPY . /var/www/html/
|
COPY . /var/www/html/
|
||||||
|
|
||||||
RUN mkdir -p /var/www/html/uploads \
|
RUN chown -R www-data:www-data /var/www/html
|
||||||
&& chown -R www-data:www-data /var/www/html \
|
|
||||||
&& chmod -R 755 /var/www/html \
|
|
||||||
&& chmod -R 775 /var/www/html/uploads
|
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<!-- Tempelkan setelah <body> atau sebelum penutup </body> di index.html kalau tombol belum terlihat -->
|
||||||
|
<a href="cek_bantuan.php" style="position:fixed;bottom:80px;right:20px;z-index:9999;background:#27ae60;color:white;padding:10px 16px;border-radius:30px;font-size:13px;font-weight:bold;text-decoration:none;box-shadow:0 4px 14px rgba(0,0,0,0.3);">Cek Bantuan</a>
|
||||||
|
<a href="login.php" style="position:fixed;bottom:130px;right:20px;z-index:9999;background:#2c3e50;color:white;padding:10px 16px;border-radius:30px;font-size:13px;font-weight:bold;text-decoration:none;box-shadow:0 4px 14px rgba(0,0,0,0.3);">Login Admin</a>
|
||||||
+9
-5
@@ -1,17 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
// koneksi.php - versi deploy Coolify + tetap aman untuk XAMPP lokal
|
// koneksi.php - versi aman untuk XAMPP lokal dan Coolify
|
||||||
$host = getenv('DB_HOST') ?: 'localhost';
|
$host = getenv('DB_HOST') ?: 'localhost';
|
||||||
$user = getenv('DB_USER') ?: 'root';
|
$user = getenv('DB_USER') ?: 'root';
|
||||||
$pass = getenv('DB_PASS') ?: (getenv('DB_PASSWORD') ?: '');
|
$password = getenv('DB_PASS') ?: (getenv('DB_PASSWORD') ?: '');
|
||||||
$db = getenv('DB_NAME') ?: 'webgis_kemiskinan';
|
$database = getenv('DB_NAME') ?: 'webgis_kemiskinan';
|
||||||
$port = (int)(getenv('DB_PORT') ?: 3306);
|
$port = (int)(getenv('DB_PORT') ?: 3306);
|
||||||
|
|
||||||
$conn = new mysqli($host, $user, $pass, $db, $port);
|
$conn = new mysqli($host, $user, $password, $database, $port);
|
||||||
|
|
||||||
if ($conn->connect_error) {
|
if ($conn->connect_error) {
|
||||||
|
http_response_code(500);
|
||||||
die(json_encode([
|
die(json_encode([
|
||||||
'status' => 'error',
|
'status' => 'error',
|
||||||
'msg' => 'Koneksi database gagal: ' . $conn->connect_error
|
'msg' => 'Koneksi database gagal: ' . $conn->connect_error,
|
||||||
|
'target' => $host . ':' . $port,
|
||||||
|
'database' => $database,
|
||||||
|
'user' => $user
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
if (isset($_SESSION['login']) && $_SESSION['login'] === true) {
|
||||||
|
header('Location: admin.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$error = $_GET['error'] ?? '';
|
||||||
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="id">
|
<html lang="id">
|
||||||
<head>
|
<head>
|
||||||
@@ -5,273 +13,50 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Login Admin - WebGIS Kemiskinan</title>
|
<title>Login Admin - WebGIS Kemiskinan</title>
|
||||||
<style>
|
<style>
|
||||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
*{box-sizing:border-box;margin:0;padding:0;font-family:'Segoe UI',Tahoma,Verdana,sans-serif}
|
||||||
|
body{min-height:100vh;background:linear-gradient(135deg,#0f766e,#0ea5e9);display:flex;align-items:center;justify-content:center;padding:20px}
|
||||||
body {
|
.card{width:100%;max-width:420px;background:#fff;border-radius:18px;box-shadow:0 22px 60px rgba(15,23,42,.25);overflow:hidden}
|
||||||
font-family: 'Segoe UI', Arial, sans-serif;
|
.head{padding:28px 30px;background:#0f172a;color:#fff;text-align:center}
|
||||||
min-height: 100vh;
|
.head h1{font-size:24px;margin-bottom:8px}.head p{font-size:14px;color:#cbd5e1}
|
||||||
display: flex;
|
form{padding:28px 30px}.field{margin-bottom:18px}.field label{display:block;font-weight:700;color:#334155;margin-bottom:8px;font-size:14px}
|
||||||
align-items: center;
|
.field input{width:100%;padding:13px 14px;border:1px solid #cbd5e1;border-radius:10px;font-size:15px;outline:none}.field input:focus{border-color:#0ea5e9;box-shadow:0 0 0 3px rgba(14,165,233,.15)}
|
||||||
justify-content: center;
|
.alert{background:#fee2e2;color:#991b1b;border:1px solid #fecaca;padding:11px 12px;border-radius:10px;margin-bottom:16px;font-size:14px}
|
||||||
background: linear-gradient(135deg, #1a252f 0%, #2c3e50 40%, #1a6b4a 100%);
|
button{width:100%;border:0;background:#0f766e;color:white;padding:13px;border-radius:10px;font-weight:800;font-size:15px;cursor:pointer}button:hover{background:#115e59}
|
||||||
position: relative;
|
.links{display:flex;justify-content:space-between;gap:10px;margin-top:18px;font-size:14px}.links a{color:#0369a1;text-decoration:none;font-weight:700}.links a:hover{text-decoration:underline}
|
||||||
overflow: hidden;
|
.demo{margin-top:18px;background:#f1f5f9;border:1px dashed #94a3b8;border-radius:10px;padding:12px;font-size:13px;color:#334155;line-height:1.6}
|
||||||
}
|
|
||||||
|
|
||||||
/* Lingkaran dekorasi background */
|
|
||||||
body::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
width: 500px; height: 500px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: rgba(52, 152, 219, 0.08);
|
|
||||||
top: -150px; left: -150px;
|
|
||||||
}
|
|
||||||
body::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
width: 400px; height: 400px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: rgba(39, 174, 96, 0.08);
|
|
||||||
bottom: -100px; right: -100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrapper {
|
|
||||||
display: flex;
|
|
||||||
width: 820px;
|
|
||||||
max-width: 96vw;
|
|
||||||
border-radius: 18px;
|
|
||||||
overflow: hidden;
|
|
||||||
box-shadow: 0 25px 60px rgba(0,0,0,0.5);
|
|
||||||
position: relative;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Panel kiri - branding */
|
|
||||||
.panel-kiri {
|
|
||||||
flex: 1;
|
|
||||||
background: linear-gradient(160deg, #27ae60, #2c3e50);
|
|
||||||
padding: 50px 36px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
.panel-kiri .logo { font-size: 56px; margin-bottom: 18px; }
|
|
||||||
.panel-kiri h1 { font-size: 22px; font-weight: 700; margin-bottom: 10px; line-height: 1.3; }
|
|
||||||
.panel-kiri p { font-size: 13px; color: rgba(255,255,255,0.75); line-height: 1.7; }
|
|
||||||
|
|
||||||
.fitur-list { margin-top: 28px; list-style: none; }
|
|
||||||
.fitur-list li {
|
|
||||||
font-size: 13px;
|
|
||||||
color: rgba(255,255,255,0.85);
|
|
||||||
padding: 6px 0;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
.fitur-list li span.dot {
|
|
||||||
width: 8px; height: 8px;
|
|
||||||
background: #2ecc71;
|
|
||||||
border-radius: 50%;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Panel kanan - form */
|
|
||||||
.panel-kanan {
|
|
||||||
width: 360px;
|
|
||||||
background: #ffffff;
|
|
||||||
padding: 48px 36px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel-kanan h2 {
|
|
||||||
font-size: 22px;
|
|
||||||
color: #2c3e50;
|
|
||||||
font-weight: 700;
|
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
|
||||||
.panel-kanan .sub {
|
|
||||||
font-size: 13px;
|
|
||||||
color: #999;
|
|
||||||
margin-bottom: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.field { margin-bottom: 18px; }
|
|
||||||
.field label {
|
|
||||||
display: block;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 700;
|
|
||||||
color: #555;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.5px;
|
|
||||||
margin-bottom: 7px;
|
|
||||||
}
|
|
||||||
.input-wrap {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.input-wrap .icon {
|
|
||||||
position: absolute;
|
|
||||||
left: 13px;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
font-size: 16px;
|
|
||||||
color: #aaa;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
.input-wrap input {
|
|
||||||
width: 100%;
|
|
||||||
padding: 12px 14px 12px 40px;
|
|
||||||
border: 2px solid #e8e8e8;
|
|
||||||
border-radius: 9px;
|
|
||||||
font-size: 14px;
|
|
||||||
outline: none;
|
|
||||||
transition: border-color 0.2s, box-shadow 0.2s;
|
|
||||||
color: #2c3e50;
|
|
||||||
background: #fafafa;
|
|
||||||
}
|
|
||||||
.input-wrap input:focus {
|
|
||||||
border-color: #27ae60;
|
|
||||||
box-shadow: 0 0 0 3px rgba(39,174,96,0.12);
|
|
||||||
background: white;
|
|
||||||
}
|
|
||||||
.input-wrap input::placeholder { color: #c0c0c0; }
|
|
||||||
|
|
||||||
/* Toggle password */
|
|
||||||
.toggle-pw {
|
|
||||||
position: absolute;
|
|
||||||
right: 13px;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 16px;
|
|
||||||
color: #aaa;
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
.toggle-pw:hover { color: #27ae60; }
|
|
||||||
|
|
||||||
.btn-login {
|
|
||||||
width: 100%;
|
|
||||||
padding: 13px;
|
|
||||||
background: linear-gradient(135deg, #27ae60, #1e8449);
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
border-radius: 9px;
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: 700;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: opacity 0.2s, transform 0.15s;
|
|
||||||
margin-top: 6px;
|
|
||||||
letter-spacing: 0.5px;
|
|
||||||
}
|
|
||||||
.btn-login:hover { opacity: 0.92; transform: translateY(-1px); }
|
|
||||||
.btn-login:active { transform: translateY(0); }
|
|
||||||
|
|
||||||
.error-msg {
|
|
||||||
background: #fdf0f0;
|
|
||||||
border: 1px solid #f5c6cb;
|
|
||||||
border-left: 4px solid #e74c3c;
|
|
||||||
color: #721c24;
|
|
||||||
padding: 10px 14px;
|
|
||||||
border-radius: 8px;
|
|
||||||
font-size: 13px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.link {
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 20px;
|
|
||||||
font-size: 13px;
|
|
||||||
color: #aaa;
|
|
||||||
}
|
|
||||||
.link a {
|
|
||||||
color: #27ae60;
|
|
||||||
text-decoration: none;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
.link a:hover { text-decoration: underline; }
|
|
||||||
|
|
||||||
/* Responsive - sembunyikan panel kiri di layar kecil */
|
|
||||||
@media (max-width: 600px) {
|
|
||||||
.panel-kiri { display: none; }
|
|
||||||
.panel-kanan { width: 100%; padding: 40px 28px; }
|
|
||||||
.wrapper { border-radius: 14px; }
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div class="card">
|
||||||
<div class="wrapper">
|
<div class="head">
|
||||||
<!-- PANEL KIRI -->
|
<h1>Login Admin</h1>
|
||||||
<div class="panel-kiri">
|
<p>WebGIS Pemetaan Kemiskinan Pontianak</p>
|
||||||
<div class="logo">🗺️</div>
|
|
||||||
<h1>WebGIS Kemiskinan<br>Kota Pontianak</h1>
|
|
||||||
<p>Sistem pemetaan rumah ibadah dan pendataan penduduk miskin berbasis geografis.</p>
|
|
||||||
<ul class="fitur-list">
|
|
||||||
<li><span class="dot"></span> Peta interaktif real-time</li>
|
|
||||||
<li><span class="dot"></span> Manajemen data penduduk miskin</li>
|
|
||||||
<li><span class="dot"></span> Pencatatan & laporan bantuan</li>
|
|
||||||
<li><span class="dot"></span> Analisis radius distribusi</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- PANEL KANAN -->
|
|
||||||
<div class="panel-kanan">
|
|
||||||
<h2>Selamat Datang 👋</h2>
|
|
||||||
<p class="sub">Masuk ke dashboard admin WebGIS</p>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
if (isset($_GET['error'])) {
|
|
||||||
if ($_GET['error'] == 'empty') {
|
|
||||||
echo '<div class="error-msg">⚠️ Username dan password wajib diisi!</div>';
|
|
||||||
} elseif ($_GET['error'] == 'wrong') {
|
|
||||||
echo '<div class="error-msg">⚠️ Username atau password salah. Coba lagi.</div>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<form action="login_process.php" method="POST">
|
<form action="login_process.php" method="POST">
|
||||||
|
<?php if ($error === 'empty'): ?>
|
||||||
|
<div class="alert">Username dan password wajib diisi.</div>
|
||||||
|
<?php elseif ($error === 'wrong'): ?>
|
||||||
|
<div class="alert">Username atau password salah.</div>
|
||||||
|
<?php endif; ?>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label>Username</label>
|
<label>Username</label>
|
||||||
<div class="input-wrap">
|
<input type="text" name="username" placeholder="Masukkan username" required autofocus>
|
||||||
<span class="icon">👤</span>
|
|
||||||
<input type="text" name="username" placeholder="Masukkan username" required autofocus autocomplete="username">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label>Password</label>
|
<label>Password</label>
|
||||||
<div class="input-wrap">
|
<input type="password" name="password" placeholder="Masukkan password" required>
|
||||||
<span class="icon">🔒</span>
|
|
||||||
<input type="password" name="password" id="inputPassword" placeholder="Masukkan password" required autocomplete="current-password">
|
|
||||||
<span class="toggle-pw" onclick="togglePassword()" id="toggleIcon">👁️</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
<button type="submit">Masuk Dashboard Admin</button>
|
||||||
|
<div class="links">
|
||||||
|
<a href="index.html">← Kembali ke Peta</a>
|
||||||
|
<a href="cek_bantuan.php">Cek Bantuan</a>
|
||||||
|
</div>
|
||||||
|
<div class="demo">
|
||||||
|
<strong>Akun demo:</strong><br>
|
||||||
|
Username: <code>admin</code><br>
|
||||||
|
Password: <code>password</code>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="submit" class="btn-login">🔐 LOGIN</button>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="link">
|
|
||||||
<a href="lupa_password.html">Lupa password?</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function togglePassword() {
|
|
||||||
var input = document.getElementById('inputPassword');
|
|
||||||
var icon = document.getElementById('toggleIcon');
|
|
||||||
if (input.type === 'password') {
|
|
||||||
input.type = 'text';
|
|
||||||
icon.textContent = '🙈';
|
|
||||||
} else {
|
|
||||||
input.type = 'password';
|
|
||||||
icon.textContent = '👁️';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
// Alias agar halaman admin mudah dibuka lewat /login_admin.php
|
||||||
|
header('Location: login.php');
|
||||||
|
exit;
|
||||||
|
?>
|
||||||
Reference in New Issue
Block a user