One Hat Cyber Team
Your IP :
216.73.216.55
Server IP :
5.189.175.239
Server :
Linux panel.gemx-ai.com 5.14.0-570.19.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 4 04:00:24 EDT 2025 x86_64
Server Software :
LiteSpeed
PHP Version :
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
farmersapp
/
church.farmersapp.store
/
Edit File:
index.php
<?php // index.php require_once 'config.php'; // If user is already logged in, redirect to dashboard if (isLoggedIn()) { redirect('dashboard.php'); } // Insert default admin user if not exists $checkAdmin = $pdo->query("SELECT COUNT(*) as count FROM users WHERE username = 'admin'"); if ($checkAdmin->fetch()['count'] == 0) { $hashedPassword = password_hash('admin123', PASSWORD_DEFAULT); $pdo->prepare("INSERT INTO users (username, password, email, full_name, role) VALUES (?, ?, ?, ?, ?)") ->execute(['admin', $hashedPassword, 'admin@church.com', 'Administrator', 'Admin']); } $error = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $username = sanitize($_POST['username']); $password = $_POST['password']; $stmt = $pdo->prepare("SELECT * FROM users WHERE username = ?"); $stmt->execute([$username]); $user = $stmt->fetch(); if ($user && password_verify($password, $user['password'])) { $_SESSION['user_id'] = $user['id']; $_SESSION['username'] = $user['username']; $_SESSION['full_name'] = $user['full_name']; $_SESSION['role'] = $user['role']; // Update last login $pdo->prepare("UPDATE users SET last_login = NOW() WHERE id = ?") ->execute([$user['id']]); redirect('dashboard.php'); } else { $error = 'Invalid username or password!'; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Church Management System - Login</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; } .login-container { background: white; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden; width: 100%; max-width: 400px; animation: fadeIn 0.6s ease-out; } @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .login-header { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); color: white; padding: 40px 30px; text-align: center; } .login-header h1 { font-size: 28px; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; gap: 15px; } .login-header p { opacity: 0.9; font-size: 15px; } .login-form { padding: 40px 30px; } .form-group { margin-bottom: 25px; position: relative; } .form-group label { display: block; margin-bottom: 8px; color: #4a5568; font-weight: 600; font-size: 14px; } .input-with-icon { position: relative; } .input-with-icon i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #a0aec0; } .input-with-icon input { width: 100%; padding: 14px 14px 14px 45px; border: 2px solid #e2e8f0; border-radius: 12px; font-size: 16px; transition: all 0.3s ease; background: #f8fafc; } .input-with-icon input:focus { outline: none; border-color: #4f46e5; background: white; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); } .login-btn { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); color: white; border: none; padding: 16px; width: 100%; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; gap: 10px; } .login-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3); } .error-message { background: #fed7d7; color: #9b2c2c; padding: 12px; border-radius: 8px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; font-size: 14px; } .demo-credentials { background: #f7fafc; padding: 15px; border-radius: 10px; margin-top: 25px; font-size: 14px; color: #4a5568; } .demo-credentials h3 { color: #2d3748; margin-bottom: 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; } .credential { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid #e2e8f0; } .credential:last-child { border-bottom: none; } .cred-label { font-weight: 600; } .footer { text-align: center; padding: 20px; color: #718096; font-size: 14px; border-top: 1px solid #e2e8f0; } </style> </head> <body> <div class="login-container"> <div class="login-header"> <h1><i class="fas fa-church"></i> Church MS</h1> <p>Complete Church Management System</p> </div> <div class="login-form"> <?php if ($error): ?> <div class="error-message"> <i class="fas fa-exclamation-circle"></i> <?php echo $error; ?> </div> <?php endif; ?> <form method="POST" action=""> <div class="form-group"> <label>Username</label> <div class="input-with-icon"> <i class="fas fa-user"></i> <input type="text" name="username" placeholder="Enter username" required> </div> </div> <div class="form-group"> <label>Password</label> <div class="input-with-icon"> <i class="fas fa-lock"></i> <input type="password" name="password" placeholder="Enter password" required> </div> </div> <button type="submit" class="login-btn"> <i class="fas fa-sign-in-alt"></i> Login to Dashboard </button> </form> <div class="demo-credentials"> <h3><i class="fas fa-info-circle"></i> Demo Login Credentials</h3> <div class="credential"> <span class="cred-label">Username:</span> <span>admin</span> </div> <div class="credential"> <span class="cred-label">Password:</span> <span>admin123</span> </div> <div class="credential"> <span class="cred-label">Role:</span> <span>Administrator</span> </div> </div> </div> <div class="footer"> <p>Church Management System v1.0 © <?php echo date('Y'); ?></p> </div> </div> </body> </html>
Simpan