-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
153 lines (142 loc) · 6.17 KB
/
index.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?php include 'header.php'; ?>
<div class="content">
<div class="row">
<div class="col-md-9">
<div class="panel panel-flat">
<div class="panel-body">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
<li data-target="#carousel-example-generic" data-slide-to="4"></li>
<li data-target="#carousel-example-generic" data-slide-to="5"></li>
<li data-target="#carousel-example-generic" data-slide-to="6"></li>
<li data-target="#carousel-example-generic" data-slide-to="7"></li>
<li data-target="#carousel-example-generic" data-slide-to="8"></li>
<li data-target="#carousel-example-generic" data-slide-to="9"></li>
<li data-target="#carousel-example-generic" data-slide-to="10"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="images/slider/1.png">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/slider/2.png">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/slider/3.png">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/slider/4.png">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/slider/5.png">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/slider/6.png">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/slider/7.png">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/slider/8.png">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/slider/9.png">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/slider/10.png">
<div class="carousel-caption">
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<br/>
<div class="block-title">
<span>
POSTING TERBARU
</span>
</div>
<br/>
<?php
$halaman = 3;
$page = isset($_GET["halaman"]) ? (int)$_GET["halaman"] : 1;
$mulai = ($page>1) ? ($page * $halaman) - $halaman : 0;
$result = mysqli_query($config, "SELECT * FROM posting");
$total = mysqli_num_rows($result);
$pages = ceil($total/$halaman);
$query = mysqli_query($config,"select * from posting order by posting_id desc limit $mulai, $halaman");
// $query = mysqli_query($config,"select * from posting LIMIT $mulai, $halaman");
$no =$mulai+1;
while ($d = mysqli_fetch_assoc($query)) {
?>
<div class="row">
<div class="col-md-3">
<img style="width: 100%" src="images/posting/<?php echo $d['posting_gambar']; ?>" class="img-responsive">
</div>
<div class="col-md-9">
<a href="posting.php?id=<?php echo $d['posting_id'];?>"><h3 class="no-padding no-margin"><?php echo substr($d['posting_judul'],0,60); ?>...</h3></a>
<p class="text-muted">Diposkan oleh : <b>Admin</b> | Pada : <b><?php echo date('d-m-Y',strtotime($d['posting_tanggal'])); ?></b> |
Kategori : <b>
<?php
$kk = $d['posting_kategori'];
$kkk = mysqli_query($config, "select * from kategori where kategori_id='$kk'");
$kkkk = mysqli_fetch_assoc($kkk);
echo $kkkk['kategori_nama'];
?>
</b>
</p>
<p style="text-align: justify"><?php echo substr($d['posting_deskripsi'],0,200); ?><a href="posting.php?id=<?php echo $d['posting_id'];?>"> (Read More....)</p></a>
</div>
</div>
<br/>
<?php
}
?>
<hr>
<div class="center">
<?php if($total > $halaman){ ?>
<?php for ($i=1; $i<=$pages ; $i++){ ?>
<div class="pagination">
<a href="?halaman=<?php echo $i; ?>"><?php echo $i; ?></a></div>
<?php } ?>
</div>
<?php } ?>
</div>
</div>
</div>
<?php include 'sidebar.php'; ?>
</div>
</div>
<?php include 'footer.php'; ?>