-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduk.php
161 lines (117 loc) · 5.49 KB
/
produk.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
154
155
156
157
158
159
160
161
<?php
error_reporting(0);
include 'db.php';
$kontak = mysqli_query($conn, "SELECT telp_admin, email_admin, alamat_admin FROM tb_admin WHERE id_admin = 2");
$a = mysqli_fetch_object($kontak);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0" />
<title>MateS</title>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" />
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection" />
</head>
<body>
<nav class="teal darken-2 lighten-1" role="navigation">
<div class="nav-wrapper container"><a id="logo-container" href="index.php" class="brand-logo">MateS</a>
<ul class="right hide-on-med-and-down">
<li><a href="produk.php">Produk</a></li>
</ul>
<ul id="nav-mobile" class="sidenav">
<li><a href="produk.php">Produk</a></li>
</ul>
<a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>
</div>
</nav>
<div class="section no-pad-bot" id="index-banner">
<div class="container">
<form action="produk.php">
<div class="row">
<div class="col s12">
<div class="row">
<div class="input-field col s12">
<i class="material-icons prefix">search</i>
<input type="search" type="submit" id="search" name="search" class="autocomplete" value="<?php echo $_GET['search'] ?>" >
<input type="hidden" name="kat" value="<?php echo $_GET['kat'] ?>">
<label for=" search "></label>
<i class="material-icons ">close</i>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<!--LIST PRODUK -->
<div class="container">
<h3>Produk Terbaru</h3>
<div class="row">
<div class="box">
<?php
if($_GET['search'] != '' || $_GET['kat'] != ''){
$where = "AND produk_nama LIKE '%".$_GET['search']."%' AND kategori_id LIKE '%".$_GET['kat']."%' ";
}
$produk = mysqli_query($conn, "SELECT * FROM tb_produk WHERE produk_status = 1 $where ORDER BY produk_id ");
if(mysqli_num_rows($produk) > 0){
while($p = mysqli_fetch_array($produk)){
?>
<a href="detail-produk.php?id=<?php echo $p['produk_id'] ?>">
<div class="col s12 m4">
<div class="card hoverable">
<div class="card-image">
<img src="produk/<?php echo $p['produk_gbr'] ?>">
<hr>
<a class="halfway-fab btn-floating teal darken-2 pulse" href="detail-produk.php?id=<?php echo $p['produk_id'] ?>"> <i class="material-icons">add_shopping_cart</i> </a>
</div>
<div class="card-content">
<span class="card-title"><?php echo substr($p['produk_nama'], 0, 30) ?></span>
</div>
<div class="card-action">
<p class="harga">Rp.
<?php echo number_format($p['produk_harga']) ?>
</p>
</div>
</div>
</div>
</a>
<?php }}else{ ?>
<p>Produk tidak ada</p>
<?php } ?>
</div>
</div>
</div>
<footer class="page-footer black ">
<div class="container">
<div class="row ">
<!--===== Footer =====-->
<div class="footer">
<div class="container">
<h4>Alamat</h4>
<p>
<?php echo $a->alamat_admin ?>
</p>
<h4>Email</h4>
<p>
<?php echo $a->email_admin ?>
</p>
<h4>WhatsApp</h4>
<p>
<?php echo $a->telp_admin ?>
</p>
</div>
<div class="container"> <p> Copyright © 2022 <a class="teal-text text-darken-2 " href="https://www.himang.my.id/">Himang.my.id</a></p></div>
</div>
</div>
</div>
</footer>
<!-- Scripts-->
<script src="https://code.jquery.com/jquery-2.1.1.min.js "></script>
<script src="js/materialize.js "></script>
<script src="js/init.js "></script>
</body>
</html>