36642-vm/index.php
2025-12-04 06:07:33 +00:00

46 lines
2.0 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quran Vocabulary</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<div class="container mt-5">
<h1 class="text-center mb-4">Quran Vocabulary</h1>
<input type="text" id="searchInput" class="form-control mb-3" placeholder="Search for a word...">
<div class="table-responsive">
<table id="vocabularyTable" class="table table-striped table-hover">
<thead class="table-dark">
<tr>
<th>Arabic</th>
<th>Urdu</th>
<th>English</th>
</tr>
</thead>
<tbody>
<?php
require_once 'db/config.php';
try {
$pdo = db();
$stmt = $pdo->query("SELECT arabic, urdu, english FROM vocabulary ORDER BY id");
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
echo "<tr>";
echo "<td dir='rtl'>" . htmlspecialchars($row['arabic']) . "</td>";
echo "<td dir='rtl'>" . htmlspecialchars($row['urdu']) . "</td>";
echo "<td>" . htmlspecialchars($row['english']) . "</td>";
echo "</tr>";
}
} catch (PDOException $e) {
echo "<tr><td colspan='3' class='text-center text-danger'>Error: " . $e->getMessage() . "</td></tr>";
}
?>
</tbody>
</table>
</div>
</div>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body>
</html>