penambahan search di beberapa halaman

parent 447a5841
......@@ -11,7 +11,7 @@
$start = ($page - 1) * $per_hal;
global $sql;
$sql = mysqli_query($koneksi, "SELECT * FROM t_artikel ORDER BY tanggal_dibuat DESC limit 8");
$sql = mysqli_query($koneksi, "SELECT * FROM t_artikel ORDER BY tanggal_dibuat ASC LIMIT $start, $per_hal");
?>
<!-- breadcrumbs -->
<div class="breadcrumbs">
......
<?php
require_once("koneksi.php");
include 'header.php';
$sql = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE keterangan != 1 AND jumlah != 0 ORDER BY keterangan");
?>
<!-- main-slider -->
<ul id="demo1">
......@@ -25,6 +27,32 @@
</li>
</ul>
<!-- //main-slider -->
<!-- breadcrumbs -->
<div class="breadcrumbs">
<div class="container">
<?php
if(isset($_POST['cari'])){
$cari = $_POST['search'];
$sql = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE judul LIKE '%$cari%' ORDER BY isbn");
}
?>
<div class="w3l_search">
<form action="" method="post">
<input type="search" name="search" placeholder="Cari Judul Buku" required="">
<button type="submit" class="btn btn-default search" aria-label="Left Align" name="cari">
<i class="fa fa-search" aria-hidden="true"> </i>
</button>
<div class="clearfix"></div>
</form>
</div>
</div>
</div>
<!-- //breadcrumbs -->
<?php
if($cari){
}
?>
<!-- top-brands -->
<div class="top-brands">
<div class="container">
......
<?php
require_once("koneksi.php");
include 'header.php';
$per_hal = 5;
$jumlah_record = mysqli_query($koneksi, "SELECT * FROM t_artikel");
$no = 1;
$jum = mysqli_num_rows($jumlah_record);
$halaman = ceil($jum / $per_hal);
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_hal;
global $sql;
$sql = mysqli_query($koneksi, "SELECT * FROM t_artikel LIMIT $start, $per_hal");
?>
<!-- breadcrumbs -->
......@@ -9,21 +20,25 @@
<ol class="breadcrumb breadcrumb1">
<li><span><i class="fa fa-sign-in" aria-hidden="true"></i><a href="login.php"> Masuk</a></span></li>
<li class="active">Kelola Data Artikel</li>
<?php
if(isset($_POST['cari'])) {
$cari = $_POST['search'];
$sql = mysqli_query($koneksi, "SELECT * FROM t_artikel WHERE judul_artikel LIKE '%$cari%' ORDER BY tanggal_dibuat");
}
?>
<div class="w3l_search">
<form action="" method="post">
<input type="search" name="search" placeholder="Cari Judul Artikel" required="">
<button type="submit" class="btn btn-default search" aria-label="Left Align" name="cari">
<i class="fa fa-search" aria-hidden="true"> </i>
</button>
<div class="clearfix"></div>
</form>
</div>
</ol>
</div>
</div>
<!-- //breadcrumbs -->
<!-- Page -->
<?php
$per_hal = 5;
$jumlah_record = mysqli_query($koneksi, "SELECT * FROM t_artikel");
$no = 1;
$jum = mysqli_num_rows($jumlah_record);
$halaman = ceil($jum / $per_hal);
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_hal;
?>
<!-- //Page -->
<div class="col-md-12">
<table class="col-md-3">
<tr>
......@@ -49,8 +64,7 @@
</tr>
</thead>
<?php
$tampil = mysqli_query($koneksi, "SELECT * FROM t_artikel LIMIT $start, $per_hal");
while($data = mysqli_fetch_array($tampil)) {
while($data = mysqli_fetch_array($sql)) {
?>
<tr class="rem1">
<td class="invert"><?php echo $data['id_artikel']; ?></td>
......
<?php
require_once("koneksi.php");
include 'header.php';
$per_hal = 10;
$jumlah_record = mysqli_query($koneksi, "SELECT * FROM t_buku");
$no = 1;
$jum = mysqli_num_rows($jumlah_record);
$halaman = ceil($jum / $per_hal);
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_hal;
global $sql;
$sql = mysqli_query($koneksi, "SELECT * FROM t_buku LIMIT $start, $per_hal");
?>
<!-- breadcrumbs -->
......@@ -9,24 +20,29 @@
<ol class="breadcrumb breadcrumb1">
<li><span><i class="fa fa-sign-in" aria-hidden="true"></i><a href="login.php"> Masuk</a></span></li>
<li class="active">Kelola Data Buku</li>
<?php
if(isset($_POST['cari'])){
$cari = $_POST['search'];
$sql = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE judul LIKE '%$cari%' ORDER BY isbn");
}
?>
<div class="w3l_search">
<form action="" method="post">
<input type="search" name="search" placeholder="Cari Judul Buku" required="">
<button type="submit" class="btn btn-default search" aria-label="Left Align" name="cari">
<i class="fa fa-search" aria-hidden="true"> </i>
</button>
<div class="clearfix"></div>
</form>
</div>
</ol>
</div>
</div>
<!-- //breadcrumbs -->
<!-- Page -->
<?php
$per_hal = 10;
$jumlah_record = mysqli_query($koneksi, "SELECT * FROM t_buku");
$no = 1;
$jum = mysqli_num_rows($jumlah_record);
$halaman = ceil($jum / $per_hal);
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_hal;
?>
<!-- //Page -->
<div class="col-md-12">
<table class="col-md-3">
<tr>
<br>
<td>Jumlah Data Buku</td>
<td>:<b> <?php echo $jum; ?></b></td>
</tr>
......@@ -52,9 +68,8 @@
<th>Opsi</th>
</tr>
</thead>
<?php
$tampil = mysqli_query($koneksi, "SELECT * FROM t_buku LIMIT $start, $per_hal");
while($data = mysqli_fetch_array($tampil)) {
<?php
while($data = mysqli_fetch_array($sql)) {
?>
<tr class="rem1">
<td class="invert"><?php echo $data['isbn']; ?></td>
......
<?php
require_once("koneksi.php");
include 'header.php';
$per_hal = 10;
$jumlah_record = mysqli_query($koneksi, "SELECT * FROM t_komentar");
$no = 1;
$jum = mysqli_num_rows($jumlah_record);
$halaman = ceil($jum / $per_hal);
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_hal;
global $sql;
$sql = mysqli_query($koneksi, "SELECT * FROM t_komentar ORDER BY tanggal DESC LIMIT $start, $per_hal");
?>
<!-- breadcrumbs -->
......@@ -9,21 +20,25 @@
<ol class="breadcrumb breadcrumb1">
<li><span><i class="fa fa-sign-in" aria-hidden="true"></i><a href="login.php"> Masuk</a></span></li>
<li class="active">Kelola Data Saran</li>
<?php
if(isset($_POST['cari'])){
$cari = $_POST['search'];
$sql = mysqli_query($koneksi, "SELECT * FROM t_komentar WHERE nama_pengirim LIKE '%$cari%' ORDER BY tanggal");
}
?>
<div class="w3l_search">
<form action="" method="post">
<input type="search" name="search" placeholder="Cari Nama Pengirim" required="">
<button type="submit" class="btn btn-default search" aria-label="Left Align" name="cari">
<i class="fa fa-search" aria-hidden="true"> </i>
</button>
<div class="clearfix"></div>
</form>
</div>
</ol>
</div>
</div>
<!-- //breadcrumbs -->
<!-- Page -->
<?php
$per_hal = 10;
$jumlah_record = mysqli_query($koneksi, "SELECT * FROM t_komentar");
$no = 1;
$jum = mysqli_num_rows($jumlah_record);
$halaman = ceil($jum / $per_hal);
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_hal;
?>
<!-- //Page -->
<!-- //breadcrumbs -->
<div class="col-md-12">
<table class="col-md-3">
<tr>
......@@ -48,8 +63,7 @@
</tr>
</thead>
<?php
$tampil = mysqli_query($koneksi, "SELECT * FROM t_komentar LIMIT $start, $per_hal");
while($data = mysqli_fetch_array($tampil)) {
while($data = mysqli_fetch_array($sql)) {
?>
<tr class="rem1">
<td class="invert"><?php echo $data['id_komentar']; ?></td>
......
<?php
require_once("koneksi.php");
include 'header.php';
$per_hal = 10;
$jumlah_record = mysqli_query($koneksi, "SELECT * FROM t_user WHERE role=2");
$no = 1;
$jum = mysqli_num_rows($jumlah_record);
$halaman = ceil($jum / $per_hal);
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_hal;
global $sql;
$sql = mysqli_query($koneksi, "SELECT * FROM t_user WHERE role = 2 LIMIT $start, $per_hal");
?>
<!-- breadcrumbs -->
......@@ -9,21 +20,25 @@
<ol class="breadcrumb breadcrumb1">
<li><span><i class="fa fa-sign-in" aria-hidden="true"></i><a href="login.php"> Masuk</a></span></li>
<li class="active">Kelola Data Pelanggan</li>
<?php
if(isset($_POST['cari'])) {
$cari = $_POST['search'];
$sql = mysqli_query($koneksi, "SELECT * FROM t_user WHERE username LIKE '%$cari%' ORDER BY id_user");
}
?>
<div class="w3l_search">
<form action="" method="post">
<input type="search" name="search" placeholder="Cari Nama Pelanggan" required="">
<button type="submit" class="btn btn-default search" aria-label="Left Align" name="cari">
<i class="fa fa-search" aria-hidden="true"> </i>
</button>
<div class="clearfix"></div>
</form>
</div>
</ol>
</div>
</div>
<!-- //breadcrumbs -->
<!-- Page -->
<?php
$per_hal = 10;
$jumlah_record = mysqli_query($koneksi, "SELECT * FROM t_user WHERE role=2");
$no = 1;
$jum = mysqli_num_rows($jumlah_record);
$halaman = ceil($jum / $per_hal);
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_hal;
?>
<!-- //Page -->
<div class="col-md-12">
<table class="col-md-3">
<tr>
......@@ -49,14 +64,13 @@
</tr>
</thead>
<?php
$tampil = mysqli_query($koneksi, "SELECT * FROM t_user WHERE role = 2 LIMIT $start, $per_hal");
while($data = mysqli_fetch_array($tampil)) {
while($data = mysqli_fetch_array($sql)) {
?>
<tr class="rem1">
<td class="invert"><?php echo $data['id_user']; ?></td>
<td class="invert"><?php echo $data['nama_lengkap']; ?></td>
<td class="invert"><?php echo $data['alamat']; ?></td>
<td class="invert"><?php echo $data['nomor_ponsel']; ?></td>
<td class="invert">0<?php echo $data['nomor_ponsel']; ?></td>
<td class="invert"><?php echo $data['email']; ?></td>
<td class="invert">
<div class="rem">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment