-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
197 lines (186 loc) · 8.28 KB
/
home.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<?php
error_reporting(0);
include 'koneksi.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>LAPAK MAHASISWA</title>
<link rel="shortcut icon" href="src/LOGO LM.png">
<link rel="stylesheet" href="css/home1.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<?php
session_start();
$koneksi=mysqli_connect("localhost","root","","lapakmahasiswa");
if(!isset($_SESSION['EMAIL_PENGGUNA'])){
echo "<script>location='alertpage.php'</script>";
}
?>
</head>
<body>
<div class="atas">
<div class="slideshow-container">
<div class="mySlides fade">
<img src="src/iklan1.png" style="width:100%">
</div>
<div class="mySlides fade">
<img src="src/iklan2.png" style="width:100%">
</div>
<div class="mySlides fade">
<img src="src/iklan3.png" style="width:100%">
</div>
<div class="mySlides fade">
<img src="src/iklan4.png" style="width:100%">
</div>
<div style="text-align:center; margin-top:-5%;">
<span class="dot"></span>
<span class="dot"></span>
<span class="dot"></span>
<span class="dot"></span>
</div>
<div class="bannerkanan">
<img src="src/LAPAK 2.png" style="width:100%;" class="bannerkanan1">
<img src="src/iklan5.png" style="width:100%;" class="bannerkanan2">
</div>
</div>
<script>
let slideIndex = 0;
showSlides();
function showSlides() {
let i;
let slides = document.getElementsByClassName("mySlides");
let dots = document.getElementsByClassName("dot");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex > slides.length) {slideIndex = 1}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" active", "");
}
slides[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " active";
setTimeout(showSlides, 5000); // Change image every 2 seconds
}
</script>
<div class="menuicon">
<div class="iconshop hovericon">
<center><img src="src/shopping-cart.png" style="width: 40px;" onclick="window.location.href='tampilanbarang/menubarang.php'"></center>
</div>
<div class="laundry hovericon">
<center><img src="src/laundry.png" style="width: 40px;" onclick="window.location.href='home.php'"></center>
</div>
<div class="food hovericon">
<center><img src="src/fast-food.png" style="width: 40px;" onclick="window.location.href='home.php'"></center>
</div>
<div class="more hovericon">
<center><img src="src/more.png" style="width: 40px;" onclick="window.location.href='home.php'"></center>
</div>
</div>
</div>
<div class="produk";">
<div class="newproduk">
<h2 style="color:#0057BD;">Produk Kami</h2>
</div>
<div class="tampilanproduk" id="tampil">
<?php
$result=mysqli_query($koneksi, "SELECT * FROM barang ORDER BY ID_BARANG ASC LIMIT 0,16");
while($row=mysqli_fetch_array($result)) {
$ID_BARANG=$row['ID_BARANG'];
$ID_LAPAK=$row['ID_LAPAK'];
$HARGA_BARANG=$row['HARGA_BARANG'];
$JENIS_BARANG=$row['JENIS_BARANG'];
$STOK_BARANG=$row['STOK_BARANG'];
$DESKRIPSI_BARANG=$row['DESKRIPSI_BARANG'];
$FOTO_BARANG=$row['FOTO_BARANG'];
$NAMA_BARANG=$row['NAMA_BARANG'];
?>
<div class="list-produk">
<img src="inputbarang/imagebarang/<?php echo $row['FOTO_BARANG']; ?>">
<h4><?php echo $NAMA_BARANG ;?></h4>
<h5>Rp. <?php echo $HARGA_BARANG;?>,-</h5>
<center>
<a class="tombol tombol-beli" href="tampilanbarang/tampilanbarang.php?detail=<?=$row['ID_BARANG'];?>">Detail</a>
</center>
</div>
<?php } ?>
</div>
</div>
<center>
<div class="next">
<button onclick="window.location.href='tampilanbarang/menubarang.php'">Next >></button>
</div>
</center>
<div class="list">
<div class="list-kiri">
<ul>
<a href="tampilanbarang/menubarang.php">Barang Bekas</a><br><br>
<li><a href="">Elektronik</a></li>
<li><a href="">Buku</a></li>
<li><a href="">Pakaian</a></li>
<li><a href="">Coming Soon</a></li>
<li><a href="">Coming Soon</a></li>
<li><a href="">Lainnya...</a></li>
</ul>
</div>
<div class="list-tengah">
<ul>
<a href="">Laundry</a><br><br>
<li><a href="">Coming Soon</a></li>
<li><a href="">Coming Soon</a></li>
<li><a href="">Coming Soon</a></li>
<li><a href="">Coming Soon</a></li>
<li><a href="">Coming Soon</a></li>
<li><a href="">Lainnya...</a></li>
</ul>
</div>
<div class="list-kanan">
<ul>
<a href="">Makanan</a><br><br>
<li><a href="">Coming Soon</a></li>
<li><a href="">Coming Soon</a></li>
<li><a href="">Coming Soon</a></li>
<li><a href="">Coming Soon</a></li>
<li><a href="">Coming Soon</a></li>
<li><a href="">Lainnya...</a></li>
</ul>
</div>
</div>
<center>
<div class="bottom">
<br>
<img src="src/4.png" style="width: 180px;">
<p class="botom1">
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Instagram</a>
<a href="#">Contact</a>
</p>
<footer class="footer">
<br>
Copyright © 2022 All rights reserved | <strong>Lapak Mahasiswa</strong> by <strong> TI UNS PSDKU</strong>
</footer>
</div>
</center>
<div class="container">
<img src="src/4.png" class="icon" onclick="window.location.href='home.php'">
<form action="tampilanbarang/menubarang.php">
<input type="text" name="cari" id="cari" placeholder="Cari Barang" style="padding: 0px 20px;width: 700px; height:40px;border-color:transparent ;border-radius:0.5em;">
<button class="butoncari" id="caribarang" type="submit" value="Cari"><i class="fa fa-search"></i></button>
</form>
</div>
<?php
$query = mysqli_query($koneksi,"SELECT * FROM pengguna WHERE EMAIL_PENGGUNA = '$_SESSION[EMAIL_PENGGUNA]'");
$row = mysqli_fetch_assoc($query);
?>
<div class="dropdwn">
<img src="user/profil/<?php echo $row['FOTO_PENGGUNA']; ?>" alt="img" height="40px" class="dropdown img">
<button class="dropbtn"> <?php echo $row['NAMADEPAN_PENGGUNA']; ?> </button>
<div class="dropdown-content">
<a href="" >Account</a>
<a href="keranjang/index.php">Keranjang</a>
<a href="user/logout.php" >Log Out</a>
</div>
</div>
</body>
</html>