Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PA1-1617-D3TI107
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Franciskus Partogu Hamonangan Napitupulu
PA1-1617-D3TI107
Commits
d986651d
Commit
d986651d
authored
May 23, 2017
by
Franciskus Partogu Hamonangan Napitupulu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fungsi pencarian
parent
9254886d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
20 deletions
+36
-20
allarticle.php
allarticle.php
+17
-1
allbook.php
allbook.php
+19
-2
header.php
header.php
+0
-17
No files found.
allarticle.php
View file @
d986651d
<?php
require_once
(
"koneksi.php"
);
include
'header.php'
;
global
$sql
;
$sql
=
mysqli_query
(
$koneksi
,
"SELECT * FROM t_artikel ORDER BY tanggal_dibuat DESC limit 8"
);
?>
<!-- breadcrumbs -->
<div
class=
"breadcrumbs"
>
...
...
@@ -19,6 +21,21 @@
}
?>
</ol>
<?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>
</div>
</div>
<!-- //breadcrumbs -->
...
...
@@ -27,7 +44,6 @@
<div
class=
"container"
>
<div
class=
"agile_top_brands_grids"
>
<?php
$sql
=
mysqli_query
(
$koneksi
,
"SELECT * FROM t_artikel ORDER BY tanggal_dibuat DESC limit 8"
);
while
(
$data
=
mysqli_fetch_array
(
$sql
)){
?>
<div
class=
"col-md-6 top_brand_left"
>
...
...
allbook.php
View file @
d986651d
<?php
require_once
(
"koneksi.php"
);
include
'header.php'
;
global
$sql
;
$sql
=
mysqli_query
(
$koneksi
,
"SELECT * FROM t_buku ORDER BY isbn ASC LIMIT 24"
);
?>
<!-- breadcrumbs -->
<div
class=
"breadcrumbs"
>
...
...
@@ -10,15 +12,30 @@
if
(
isset
(
$_SESSION
[
'pengunjung'
]))
{
echo
'
<li><span><i class="fa fa-sign-in" aria-hidden="true"></i><a href="login.php"> Masuk</a></span></li>
<li class="active">
Keranjang Belanja
</li> '
;
<li class="active">
Daftar Buku
</li> '
;
}
else
{
echo
'
<li><a href="index.php"><span class="glyphicon glyphicon-home" aria-hidden="true"></span>Beranda</a></li>
<li class="active">
Keranjang Belanja
</li> '
;
<li class="active">
Daftar Buku
</li> '
;
}
?>
</ol>
<?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 -->
...
...
header.php
View file @
d986651d
...
...
@@ -6,8 +6,6 @@
session_destroy
();
header
(
'location: index.php'
);
};
global
$sql
;
$sql
=
mysqli_query
(
$koneksi
,
"SELECT * FROM t_buku ORDER BY isbn ASC LIMIT 24"
);
?>
<!DOCTYPE html>
...
...
@@ -103,21 +101,6 @@
<div
class=
"w3ls_logo_products_left"
>
<h1><a
href=
"about.php"
>
Toko Buku Cemerlang
</a></h1>
</div>
<?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
class=
"clearfix"
>
</div>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment