-
Notifications
You must be signed in to change notification settings - Fork 0
/
kategori.php
65 lines (63 loc) · 2.5 KB
/
kategori.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
// Veritabanı bağlantısını içeri aktar
include 'db_baglan.php';
// Kategorileri veritabanından al
$sql = "SELECT * FROM categories";
$result = $conn->query($sql);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kategoriler</title>
<!-- Bootstrap CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<header>
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="#">Kültür Sanat Etkinlikleri</a>
<!-- Navbar links -->
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="ana_sayfa.php">Ana Sayfa</a>
</li>
<li class="nav-item">
<a class="nav-link" href="giris.php">Giriş Yap</a>
</li>
<li class="nav-item">
<a class="nav-link" href="kayit.php">Kayıt Ol</a>
</li>
</ul>
</div>
</nav>
</header>
<main role="main" class="container mt-5">
<div class="row">
<div class="col-md-6 offset-md-3">
<h2 class="text-center mb-4">Kategoriler</h2>
<div class="list-group">
<?php
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
?>
<a href="#" class="list-group-item list-group-item-action"><?php echo $row['name']; ?></a>
<?php
}
} else {
echo "<p class='alert alert-info'>Henüz kategori bulunmamaktadır.</p>";
}
?>
</div>
</div>
</div>
</main>
<!-- Bootstrap ve jQuery JS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>