refactor: make poverty map public and remove redundant user authentication requirements

This commit is contained in:
z0rayy
2026-06-10 16:29:04 +07:00
parent bae7c0b294
commit 24e75d6377
6 changed files with 37 additions and 147 deletions
+14 -1
View File
@@ -24,4 +24,17 @@ $sql2 = "CREATE TABLE IF NOT EXISTS penduduk_miskin (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;";
$c->query($sql2);
echo 'Tables OK';
$sql3 = "CREATE TABLE IF NOT EXISTS users (
id INT NOT NULL AUTO_INCREMENT,
username VARCHAR(50) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;";
$c->query($sql3);
$passwordHash = password_hash('admin123', PASSWORD_DEFAULT);
$insertAdmin = "INSERT IGNORE INTO users (username, password) VALUES ('admin', '$passwordHash')";
$c->query($insertAdmin);
echo 'Tables and Admin User OK';