-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathara.php
113 lines (101 loc) · 2.98 KB
/
ara.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
include "sistem/ayar.php";
if (isset($_GET["s"])) {
$s=$_GET["s"];
}
else{
header("Location:index.php");
}
?>
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<title>Nefis Yemek Tarifleri</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!--Başlık-->
<header>
<p><b>Nefis Yemek Tarifleri</b>, en çok okunan yemek tarifi paylaşım sitesi. Üye ol, tariflerini paylaş.</p>
<div class="login-button">
<?php
if (isset($_SESSION["giris"])) {
echo '<a href="cikis.php" class="button-style">Çıkış Yap</a>';
}
else{
echo '<a href="giris.php" class="button-style">Giriş Yap</a>';
echo '<a href="kayit.php" class="button-style">Kayıt Ol</a>';
}
?>
</div>
</header>
<!--Arama Kutusu-->
<section class="header-out">
<div class="group">
<img src="img/logo.jpg" alt="Nefis Yemek Tarifleri" height="100" width="100">
<div class="search-group">
<form action="ara.php" method="get">
<input type="text" name="s" placeholder="Hangi tarifi istersin?" class="search-input" />
<input type="submit" name="search-button" class="search-button" value="Ara" />
</form>
</div>
<a href="tarif_gonder.php" class="send-tariffs-button">Tarif Gönder</a>
</div>
</section>
<!--Menüler-->
<section class="menu-group">
<div class="flex-group">
<a href="index.php" class="menu">Anasayfa</a>
<?php
$kategoriler=$db->query("SELECT * FROM kategoriler",PDO::FETCH_ASSOC);
if ($kategoriler->rowCount()) {
foreach ($kategoriler as $kategori) {
echo '<a href="kategori.php?id='.$kategori["kat_id"].'" class="menu">'.$kategori["kat_isim"].'</a>';
}
}
?>
</div>
</section>
<!--İçerik-->
<section class="content bg">
<div class="recipies">
<div class="new-recipies">
<?php
$tarifler=$db->query("SELECT * FROM tarifler WHERE baslik LIKE '%{$s}%' ORDER BY tarif_id DESC LIMIT 8", PDO::FETCH_ASSOC);
if ($tarifler->rowCount()) {
foreach ($tarifler as $tarif) {
echo '<div class="new-recipe">
<a href="tarif_detay.php?id='.$tarif["tarif_id"].'"><img src="'.$tarif["resim"].'" alt="" height="80" width="120"></a>
<div class="recipe-description">
<p>'.$tarif["baslik"].'</p>
</div>
</div>';
}
}
else{
echo "Aranan tarif bulunamadı.";
}
?>
</div>
</div>
<div class="categories">
<p>Kategoriler</p>
<?php
$kategoriler=$db->query("SELECT * FROM kategoriler",PDO::FETCH_ASSOC);
if ($kategoriler->rowCount()) {
foreach ($kategoriler as $kategori) {
echo '<div class="category-menu"><a href="kategori.php?id='.$kategori["kat_id"].'">'.$kategori["kat_isim"].'</a></div>';
}
}
?>
</div>
</section>
<footer>
<img src="img/footer-logo.png" alt="" height="80" width="80" class="footer-logo">
<div class="mind">
<p class="footer-copyright-text">Her hakkı saklıdır. © 2007-2019 Nefis Yemek Tarifleri</p>
</div>
</footer>
</body>
</html>