penambahan search di beberapa halaman

parent 447a5841
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
$start = ($page - 1) * $per_hal; $start = ($page - 1) * $per_hal;
global $sql; 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 --> <!-- breadcrumbs -->
<div class="breadcrumbs"> <div class="breadcrumbs">
......
<?php <?php
require_once("koneksi.php"); require_once("koneksi.php");
include 'header.php'; include 'header.php';
$sql = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE keterangan != 1 AND jumlah != 0 ORDER BY keterangan");
?> ?>
<!-- main-slider --> <!-- main-slider -->
<ul id="demo1"> <ul id="demo1">
...@@ -25,6 +27,32 @@ ...@@ -25,6 +27,32 @@
</li> </li>
</ul> </ul>
<!-- //main-slider --> <!-- //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 --> <!-- top-brands -->
<div class="top-brands"> <div class="top-brands">
<div class="container"> <div class="container">
......
<?php <?php
require_once("koneksi.php"); require_once("koneksi.php");
include 'header.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 --> <!-- breadcrumbs -->
...@@ -9,21 +20,25 @@ ...@@ -9,21 +20,25 @@
<ol class="breadcrumb breadcrumb1"> <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><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> <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> </ol>
</div> </div>
</div> </div>
<!-- //breadcrumbs --> <!-- //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"> <div class="col-md-12">
<table class="col-md-3"> <table class="col-md-3">
<tr> <tr>
...@@ -49,8 +64,7 @@ ...@@ -49,8 +64,7 @@
</tr> </tr>
</thead> </thead>
<?php <?php
$tampil = mysqli_query($koneksi, "SELECT * FROM t_artikel LIMIT $start, $per_hal"); while($data = mysqli_fetch_array($sql)) {
while($data = mysqli_fetch_array($tampil)) {
?> ?>
<tr class="rem1"> <tr class="rem1">
<td class="invert"><?php echo $data['id_artikel']; ?></td> <td class="invert"><?php echo $data['id_artikel']; ?></td>
......
<?php <?php
require_once("koneksi.php"); require_once("koneksi.php");
include 'header.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 --> <!-- breadcrumbs -->
...@@ -9,24 +20,29 @@ ...@@ -9,24 +20,29 @@
<ol class="breadcrumb breadcrumb1"> <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><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> <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> </ol>
</div> </div>
</div> </div>
<!-- //breadcrumbs --> <!-- //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"> <div class="col-md-12">
<table class="col-md-3"> <table class="col-md-3">
<tr> <tr>
<br>
<td>Jumlah Data Buku</td> <td>Jumlah Data Buku</td>
<td>:<b> <?php echo $jum; ?></b></td> <td>:<b> <?php echo $jum; ?></b></td>
</tr> </tr>
...@@ -53,8 +69,7 @@ ...@@ -53,8 +69,7 @@
</tr> </tr>
</thead> </thead>
<?php <?php
$tampil = mysqli_query($koneksi, "SELECT * FROM t_buku LIMIT $start, $per_hal"); while($data = mysqli_fetch_array($sql)) {
while($data = mysqli_fetch_array($tampil)) {
?> ?>
<tr class="rem1"> <tr class="rem1">
<td class="invert"><?php echo $data['isbn']; ?></td> <td class="invert"><?php echo $data['isbn']; ?></td>
......
<?php <?php
require_once("koneksi.php"); require_once("koneksi.php");
include 'header.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 --> <!-- breadcrumbs -->
...@@ -9,21 +20,25 @@ ...@@ -9,21 +20,25 @@
<ol class="breadcrumb breadcrumb1"> <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><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> <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> </ol>
</div> </div>
</div> </div>
<!-- //breadcrumbs --> <!-- //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 -->
<div class="col-md-12"> <div class="col-md-12">
<table class="col-md-3"> <table class="col-md-3">
<tr> <tr>
...@@ -48,8 +63,7 @@ ...@@ -48,8 +63,7 @@
</tr> </tr>
</thead> </thead>
<?php <?php
$tampil = mysqli_query($koneksi, "SELECT * FROM t_komentar LIMIT $start, $per_hal"); while($data = mysqli_fetch_array($sql)) {
while($data = mysqli_fetch_array($tampil)) {
?> ?>
<tr class="rem1"> <tr class="rem1">
<td class="invert"><?php echo $data['id_komentar']; ?></td> <td class="invert"><?php echo $data['id_komentar']; ?></td>
......
<?php <?php
require_once("koneksi.php"); require_once("koneksi.php");
include 'header.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 --> <!-- breadcrumbs -->
...@@ -9,21 +20,25 @@ ...@@ -9,21 +20,25 @@
<ol class="breadcrumb breadcrumb1"> <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><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> <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> </ol>
</div> </div>
</div> </div>
<!-- //breadcrumbs --> <!-- //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"> <div class="col-md-12">
<table class="col-md-3"> <table class="col-md-3">
<tr> <tr>
...@@ -49,14 +64,13 @@ ...@@ -49,14 +64,13 @@
</tr> </tr>
</thead> </thead>
<?php <?php
$tampil = mysqli_query($koneksi, "SELECT * FROM t_user WHERE role = 2 LIMIT $start, $per_hal"); while($data = mysqli_fetch_array($sql)) {
while($data = mysqli_fetch_array($tampil)) {
?> ?>
<tr class="rem1"> <tr class="rem1">
<td class="invert"><?php echo $data['id_user']; ?></td> <td class="invert"><?php echo $data['id_user']; ?></td>
<td class="invert"><?php echo $data['nama_lengkap']; ?></td> <td class="invert"><?php echo $data['nama_lengkap']; ?></td>
<td class="invert"><?php echo $data['alamat']; ?></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"><?php echo $data['email']; ?></td>
<td class="invert"> <td class="invert">
<div class="rem"> <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