-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.php
53 lines (41 loc) · 1.52 KB
/
main.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
<?php include_once "database.php" ?>
<div id="main" class="eight columns">
<?php
if (isset($_GET['kategori'])) {
$sorgu = $db->query("SELECT * FROM main WHERE main.kategori_id=".$_GET['kategori']." ORDER BY yazi_tarih DESC " , PDO::FETCH_ASSOC);
}
elseif (isset($_GET['arama'])) {
$sorgu = $db->query("SELECT * FROM main WHERE yazi_icerigi LIKE '%".$_GET['arama']."%' ORDER BY yazi_tarih DESC " , PDO::FETCH_ASSOC);
}
elseif (isset($_GET['tarih'])) {
$sorgu = $db->query("SELECT * FROM main WHERE yazi_tarih LIKE '%".$_GET['tarih']."%' ORDER BY yazi_tarih DESC " , PDO::FETCH_ASSOC);
}
else
$sorgu = $db->query("SELECT * FROM main ORDER BY yazi_tarih DESC LIMIT 0,3 " , PDO::FETCH_ASSOC);
if($sorgu -> rowCount()){
foreach ($sorgu as $row) {
?>
<article class="entry">
<header class="entry-header">
<h2 class="entry-title">
<a href="single.php?gonderi=<?php echo $row['id'] ?>" title=""><?php echo $row['yazi_baslik'] ?></a>
</h2>
<div class="entry-meta">
<ul>
<li><?php echo $row['yazi_tarih'] ?></li>
<span class="meta-sep">•</span>
<li><a href="#" title="" rel="category tag"><?php echo $row['yazi_kategori'] ?></a></li>
<span class="meta-sep">•</span>
<li><?php echo $row['yazar'] ?></li>
</ul>
</div>
</header>
<div class="entry-content">
<?php echo $row['yazi_icerigi'] ?>
</div>
</article> <!-- end entry -->
<?php
}
}
?>
</div> <!-- end main -->