Perbaikan untuk serverlive. Terjadi kesalahan pengeditan data di local data saya.

parent 33d60f20
......@@ -8,7 +8,7 @@
<div class="container">
<ol class="breadcrumb breadcrumb1 animated wow slideInLeft" data-wow-delay=".5s">
<?php
if (isset($_SESSION['pengunjung']) AND isset($_SESSION['pengunjung'])) {
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">Profil Toko</li> ';
......
......@@ -7,7 +7,7 @@
<div class="container">
<ol class="breadcrumb breadcrumb1 animated wow slideInLeft" data-wow-delay=".5s">
<?php
if (isset($_SESSION['pengunjung']) AND isset($_SESSION['pengunjung'])) {
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">Daftar Artikel</li> ';
......@@ -27,8 +27,8 @@
<div class="container">
<div class="agile_top_brands_grids">
<?php
$sql = mysql_query("SELECT * FROM t_artikel ORDER BY tanggal_dibuat DESC limit 8");
while($data = mysql_fetch_array($sql)){
$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">
<div class="hover14 column">
......@@ -37,13 +37,13 @@
<figure>
<div class="snipcart-item block" >
<div class="snipcart-thumb">
<center>
<a href="singlearticle.php?kd=<?php echo $data['id_artikel'];?>"><img src="<?php echo $data['gambar_artikel']; ?>" placeholder="Baca Selengkapnya Disini"/></a>
</center>
<br>
<h4><?php echo $data['judul_artikel']; ?></h4>
<h6><?php echo $data['tanggal_dibuat']; ?></h6>
<h6><?php echo $data['isi_artikel']; ?></h6>
<div class="col-md-5">
<a href="singlearticle.php?kd=<?php echo $data['id_artikel'];?>"><img class="col-md-10" src="<?php echo $data['gambar_artikel']; ?>" placeholder="Baca Selengkapnya Disini"/></a>
</div>
<div class="col-md-7">
<center><h4><?php echo $data['judul_artikel']; ?></h4></center><br>
<h6><?php echo $data['tanggal_dibuat']; ?></h6>
</div>
</div>
</div>
</figure>
......
......@@ -7,7 +7,7 @@
<div class="container">
<ol class="breadcrumb breadcrumb1 animated wow slideInLeft" data-wow-delay=".5s">
<?php
if (isset($_SESSION['pengunjung']) AND isset($_SESSION['pengunjung'])) {
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> ';
......@@ -25,30 +25,31 @@
<!-- gourmet -->
<div class="products">
<div class="container">
<div class="col-md-3 products-left">
</div>
<div class="agile_top_brands_grids">
<?php
$sql = mysql_query("SELECT * FROM t_buku WHERE keterangan != 4 ORDER BY isbn DESC limit 16");
while($data = mysql_fetch_array($sql)){
$sql = mysqli_query($koneksi, "SELECT * FROM t_buku ORDER BY isbn ASC LIMIT 24");
while($data = mysqli_fetch_array($sql)){
?>
<div class="col-md-3 top_brand_left">
<div class="hover14 column">
<div class="agile_top_brand_left_grid">
<?php
if ($data['keterangan'] != 1) {
echo '<div class="agile_top_brand_left_grid_pos">
<img src="images/offer.png" alt=" " class="img-responsive">
</div>';
}
?>
<div class="agile_top_brand_left_grid1">
<figure>
<div class="snipcart-item block" >
<div class="snipcart-thumb">
<center>
<a href="singlebook.php?kd=<?php echo $data['isbn'];?>"><img src="<?php echo $data['gambar']; ?>" /></a>
</center>
<br>
<h4><?php echo $data['judul']; ?></h4>
<h4><?php echo $data['pengarang']; ?></h4>
<h4><?php echo $data['penerbit']; ?></h4>
<h4><?php echo $data['tahun']; ?></h4>
<h4>Rp.<?php echo number_format($data['harga'],2,",",".");?></h4>
<div class="snipcart-thumb">
<a href="singlebook.php?kd=<?php echo $data['isbn'];?>"><img class="col-md-12" src="<?php echo $data['gambar']; ?>" >
<center><h4><?php echo $data['judul']; ?></h4></center>
<center><h4><?php echo $data['pengarang']; ?></h4></center>
<center><h4><?php echo $data['tahun']; ?></h4></center>
<center><h4>Rp.<?php echo number_format($data['harga'],2,",",".");?></h4></center>
</a>
</div>
<div class="snipcart-details top_brand_home_details">
<a href="function.php?act=add&amp;barang_id=<?php echo $data['isbn']; ?>&amp;ref=checkout.php?kd=<?php echo $data['isbn'];?>">
......@@ -59,13 +60,13 @@
</div>
</div>
</div>
<br>
</div>
<?php
}
?>
<div class="clearfix"> </div>
</div>
</div>
</div>
<!-- gourmet -->
......
......@@ -24,17 +24,15 @@
</div>
<!-- //breadcrumbs -->
<!-- checkout -->
<div class="checkout">
<div class="container">
<h2>Detail keranjang belanja : </h2>
<h2><br>Detail keranjang belanja :</h2><br>
<div class="checkout-right">
<table class="timetable_sub">
<thead>
<tr>
<th>No. Pesanan</th>
<th>ISBN</th>
<th>Judul Buku</th>
<th>Gambar</th>
<th>Judul Buku</th>
<th>Harga</th>
<th>Jumlah</th>
<th>Sub-Total</th>
......@@ -44,8 +42,8 @@
$total = 0;
if (isset($_SESSION['items'])) {
foreach ($_SESSION['items'] as $key => $val) {
$query = mysql_query("SELECT * FROM t_buku WHERE isbn = '$key'");
$data = mysql_fetch_array($query);
$query = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE isbn = '$key'");
$data = mysqli_fetch_array($query);
$jumlah_harga = $data['harga'] * $val;
$total += $jumlah_harga;
......@@ -56,19 +54,18 @@
<td class="invert"><?php echo $no++; ?></td>
<td class="invert"><?php echo $data['isbn']; ?></td>
<td class="invert"><?php echo $data['judul']; ?></td>
<td class="invert-image"><?php echo $data['gambar']; ?></td>
<td class="invert"><?php echo $data['harga']; ?></td>
<td class="invert"><?php echo number_format($val); ?></td>
<td class="invert">Rp.<?php echo number_format($jumlah_harga); ?>,00</td>
<td class="invert">
<div class="rem">
<div>
<a href="function.php?act=plus&amp;barang_id=<?php echo $key; ?>&amp;ref=singlebook.php">
<img src="images/plus.png" />
</a>
<a href="function.php?act=min&amp;barang_id=<?php echo $key; ?>&amp;ref=singlebook.php">
<img src="images/minus.png" />
</a>
<a href="function.php?act=plus&amp;barang_id=<?php echo $key; ?>&amp;ref=singlebook.php">
<img src="images/plus.png" />
</a>
<a href="function.php?act=del&amp;barang_id=<?php echo $key; ?>&amp;ref=singlebook.php">
<img src="images/close_1.png" />
</a>
......@@ -83,11 +80,11 @@
<?php
if($total != 0 && isset($_SESSION['pengunjung'])){
echo '
<tr style="background-color:#dbase_delete_record(dbase_identifier, record_number);"><td colspan="4" align="right"><b>Total :</b></td><td align="right"><b>Rp. '.number_format($total,2,",",".").'</b></tr></table>
<tr style="background-color:#dbase_delete_record(dbase_identifier, record_number);"><td colspan="3" align="right"><b>Total :</b></td><td align="right"><b>Rp. '.number_format($total,2,",",".").'</b></tr></table>
<p><div align="right">
<div class="checkout-right-basket">
<a href="allbook.php"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>Lanjut Berbelanja</a>
<a href="savebook.php"><span aria-hidden="true"></span>Simpan Pesanan Buku</a>
<a href="savebook.php">Lakukan pembayaran &nbsp&nbsp;<span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span></a>
<br><br><br><br><br><br>
</div>
</div></p>
......@@ -99,6 +96,7 @@
<p><div align="right">
<div class="checkout-right-basket">
<a href="allbook.php"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>Lanjut Berbelanja</a>
<a href="login.php"><span aria-hidden="true"></span>Masuk Lebih Dulu</a>
<br><br><br><br><br>
</div>
</div></p>
......@@ -106,7 +104,7 @@
}
else {
echo '
<tr><td colspan="8" align="center" style="background-color:#ffffff">
<tr><td colspan="7" align="center" style="background-color:#ffffff">
Ups, Keranjang belanja kosong ! </td></tr></table>
<div class="checkout-right-basket">
<a href="allbook.php"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>Lanjut Berbelanja</a>
......@@ -117,7 +115,7 @@
?>
</table>
</div>
</div>
</div>
<!-- //checkout -->
<?php
......
......@@ -8,17 +8,17 @@
<div class="container">
<ol class="breadcrumb breadcrumb1 animated wow slideInLeft" data-wow-delay=".5s">
<?php
if (isset($_SESSION['pengunjung']) AND 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> ';
}
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> ';
}
?>
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> ';
}
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> ';
}
?>
</ol>
</div>
</div>
......@@ -28,12 +28,12 @@
<div class="w3_agileits_contact_grids">
<div class="col-md-6 w3_agileits_contact_grid_right">
<?php
$query = mysql_query("SELECT * FROM t_komentar ORDER BY id_komentar DESC") or die(mysql_error());
$masukan = mysql_num_rows($query);
$query = mysqli_query($koneksi, "SELECT * FROM t_komentar ORDER BY id_komentar DESC") or die(mysqli_error());
$masukan = mysqli_num_rows($query);
echo "<h4>" . "Jumlah komentar saat ini $masukan buah." . "</h4>";
echo "<b>" . "Berikan kritik & saran Anda agar kami <br> dapat meingkatkan pelayanan kami." . "</b>";
echo "<hr>";
while($row = mysql_fetch_array($query))
while($row = mysqli_fetch_array($query))
{
echo "<b>" . $row['nama_pengirim'] . "</b>" . " " . " | " . " " . "<i>" .
$row['tanggal'] . "</i>" . "<br />" . $row['komentar'] . "<br />";
......
......@@ -4,7 +4,7 @@ include 'koneksi.php';
$nama_pengirim = $_POST['nama_pengirim'];
$komentar = $_POST['komentar'];
$query = mysql_query("INSERT INTO t_komentar VALUES('', '$nama_pengirim', '$komentar', NOW())");
$query = mysqli_query($koneksi, "INSERT INTO t_komentar VALUES('', '$nama_pengirim', '$komentar', NOW())");
if ($query) {
echo "<script>alert('Terimakasih $nama_pengirim telah memberikan masukannya !'); window.location = 'contact.php'</script>";
}else{
......
......@@ -11,6 +11,7 @@ p{
}
h1,h2,h3,h4,h5,h6,a{
font-family: 'Raleway', sans-serif;
background: #ffffff;
margin:0;
font-weight:700;
}
......@@ -1185,6 +1186,7 @@ td.invert-image a img {
text-transform: uppercase;
text-align: center;
margin: 0 0 1em;
width: 350px;
}
.checkout-left {
margin: 2em 0 0;
......@@ -1197,7 +1199,7 @@ td.invert-image a img {
}
.checkout-left-basket {
float: left;
width: 25%;
width: 30%;
}
.checkout-right-basket{
float: right;
......
<?php
require_once("koneksi.php");
$id=$_GET['id'];
mysql_query("DELETE FROM t_artikel where id_artikel='$id'");
header("location:processarticle.php");
mysqli_query($koneksi, "DELETE FROM t_artikel where id_artikel='$id'");
echo "<script>alert('Data artikel berhasil dihapus');window.location = 'processarticle.php'</script>";
?>
\ No newline at end of file
......@@ -43,13 +43,16 @@
}
elseif (isset($_SESSION['pengunjung'])){
echo '
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="singleprofile.php">Profil Anda</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="checkout.php">Keranjang Belanja</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="logout_process.php">Keluar</a></li>
';
}
else {
echo '
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="login.php">Masuk</a></li><li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="registered.php">Daftar</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="checkout.php">Keranjang Belanja</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="login.php">Masuk</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="registered.php">Daftar</a></li>
';
}
?>
......
<?php
require_once("koneksi.php");
include 'header.php';
?>
<!-- breadcrumbs -->
<div class="breadcrumbs">
<div class="container">
<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">Form Kelola Artikel</li>
</ol>
</div>
</div>
<!-- //breadcrumbs -->
<!-- register -->
<div class="register">
<div class="container">
<h2>Form Tambah Data Artikel</h2>
<div class="login-form-grids">
<h5>Data Artikel</h5>
<form action="formarticle_process.php" method="POST">
<input type="text" name="judul_artikel" placeholder="Judul Artikel" required=" " ><br>
<textarea name="isi_artikel" placeholder="Isi Artikel" required=" "></textarea>
<input type="file" name="gambar_artikel" required=" ">
<input type="submit" name="tambah" value="tambah">
</form>
</div>
<div class="register-home">
<a href="index.php">Beranda</a>
</div>
</div>
</div>
<!-- //register -->
<?php
include 'footer.php';
?>
\ No newline at end of file
<?php
session_start();
include 'koneksi.php';
if(isset($_POST['tambah'])){
$username = $_SESSION['username'];
$profile = "";
$judul_artikel = $_POST['judul_artikel'];
$isi_artikel = $_POST['isi_artikel'];
$gambar_artikel = $_POST['gambar_artikel'];
if ($_FILES[$gambar_artikel]['name']) {
move_uploaded_file($_FILES[$gambar_artikel]['tmp_name'], 'images/' . $judul_artikel . '.jpg');
$profile = 'images/' . $judul_artikel . '.jpg';
}
$profile = 'images/' . $judul_artikel . '.jpg';
$tambah = mysql_query("INSERT INTO t_artikel VALUES('', '$judul_artikel', '$isi_artikel', NOW(), '$profile', '$username')") or die(mysql_error());
if($tambah) {
echo "<script>alert('Data buku $judul_artikel berhasil ditambahkan');'</script>";
}
else {
echo "<script>alert('Gagal menambahkan artikel !'); window.location = 'formarticle.php'</script>";
}
}
?>
\ No newline at end of file
<?php
require_once("koneksi.php");
include 'header.php';
?>
<!-- breadcrumbs -->
<div class="breadcrumbs">
<div class="container">
<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">Form Kelola Buku</li>
</ol>
</div>
</div>
<!-- //breadcrumbs -->
<!-- register -->
<div class="register">
<div class="container">
<h2>Form Tambah Data Buku Baru</h2>
<div class="login-form-grids">
<h5>Data Buku</h5>
<form action="formbook_process.php" method="POST">
<input type="text" name="isbn" placeholder="ISBN" required=" " ><br>
<input type="text" name="judul" placeholder="Judul Buku" required=" " ><br>
<input type="text" name="pengarang" placeholder="Nama Pengarang" required=" " ><br>
<input type="text" name="penerbit" placeholder="Nama Penerbit" required=" " ><br>
<input type="text" name="kategori" placeholder="Kategori Buku" required=" " ><br>
<input type="text" name="tahun" placeholder="Tahun Terbit" required=" " ><br>
<input type="text" name="harga" placeholder="Harga per Eksemplar" required=" " ><br>
<input type="text" name="jumlah" placeholder="Jumlah Tersedia" required=" " ><br>
<input type="text" name="keterangan" placeholder="Keterangan Buku" required=" " ><br>
<input type="file" name="gambar" required=" ">
<input type="submit" name="tambah" value="tambah">
</form>
</div>
<div class="register-home">
<a href="index.php">Beranda</a>
</div>
</div>
</div>
<!-- //register -->
<?php
include 'footer.php';
?>
\ No newline at end of file
<?php
session_start();
include 'koneksi.php';
if(isset($_POST['tambah'])){
$isbn = $_POST['isbn'];
$judul = $_POST['judul'];
$pengarang = $_POST['pengarang'];
$penerbit = $_POST['penerbit'];
$kategori = $_POST['kategori'];
$tahun = $_POST['tahun'];
$harga = $_POST['harga'];
$jumlah = $_POST['jumlah'];
$keterangan = $_POST['keterangan'];
$gambar = $_POST['gambar'];
$tambah = mysql_query("INSERT INTO t_buku VALUES('$isbn', '$judul', '$pengarang', '$penerbit', '$kategori', '$tahun', '$harga', '$jumlah', '$gambar', '$keterangan')") or die(mysql_error());
if($tambah) {
echo "<script>alert('Data buku $judul berhasil ditambahkan');window.location = 'processbook.php '</script>";
}
else {
echo "<script>alert('Gagal menambahkan data buku !'); window.location = 'formbook.php'</script>";
}
}
?>
\ No newline at end of file
......@@ -55,12 +55,21 @@
if (isset($_SESSION['administrator'])) {
echo '
<li><a href="logout_process.php">Keluar</a><br></li>
</ul>
</div>
';
}
elseif (isset($_SESSION['pengunjung'])){
echo '
<li><a href="singleprofile.php">Profil Anda</a><br></li>
<li><a href="logout_process.php">Keluar</a><br></li>
<li><a href="contact.php">komentar</a></li>
</ul>
</div>
<div class="product_list_header">
<a href="checkout.php"><button class="w3view-cart" type="submit" name="submit" value=""><i class="fa fa-cart-arrow-down" aria-hidden="true"></i></a>
</form>
</div>
';
}
else {
......@@ -68,16 +77,15 @@
<li><a href="registered.php">Daftar</a></li>
<li><a href="login.php">Masuk</a></li>
<li><a href="contact.php">komentar</a></li>
</ul>
</div>
<div class="product_list_header">
<a href="checkout.php"><button class="w3view-cart" type="submit" name="submit" value=""><i class="fa fa-cart-arrow-down" aria-hidden="true"></i></a>
</form>
</div>
';
}
?>
</ul>
</div>
<div class="product_list_header">
<a href="checkout.php"><button class="w3view-cart" type="submit" name="submit" value=""><i class="fa fa-cart-arrow-down" aria-hidden="true"></i></a>
</form>
</div>
<div class="clearfix"> </div>
</div>
</div>
......@@ -93,6 +101,12 @@
<div class="w3ls_logo_products_left">
<h1><a href="about.php">Toko Buku Cemerlang</a></h1>
</div>
<?php
if(isset($_GET['cari'])){
$cari = mysql_real_escape_string($_GET['cari']);
$query = mysqli_query($koneksi, "SELECT * FROM t_buku, t_artikel WHERE nama LIKE '$cari'");
}
?>
<!--
<div class="w3l_search">
<form action="#" method="post">
......@@ -104,8 +118,7 @@
</form>
</div>
-->
<div class="clearfix"> </div>
<div class="clearfix"> </div>
</div>
</div>
<!-- //header -->
......@@ -131,7 +144,9 @@
echo '
<li><a href=processbook.php>Kelola Data Buku</a><br></li>
<li><a href=processarticle.php>Kelola Data Artikel</a><br></li>
<li><a href="formuser.php">Kelola Data Pengunjung</a><br></li>
<li><a href="processorder.php">Kelola Data Pesanan</a><br></li>
<li><a href="processmember.php">Kelola Data Pelanggan</a><br></li>
<li><a href="processcomment.php">Kelola Data Komentar</a><br></li>
' ;
}
else {
......@@ -145,14 +160,14 @@
<div class="multi-gd-img">
<ul class="multi-column-dropdown">
<h6>Daftar Kategori</h6>
<li><a href="categories.php">Agama & Rohani</a></li>
<li><a href="categories.php">Kesehatan & Jasmani</a></li>
<li><a href="categories.php">Buku Anak</a></li>
<li><a href="categories.php">Buku Pelajaran</a></li>
<li><a href="categories.php">Hobi & Keterampilan</a></li>
<li><a href="categories.php">Motivasi & Bisnis</a></li>
<li><a href="categories.php">Fiksi</a></li>
<li><a href="categories.php">Perguruan Tinggi</a></li>
<li><a href="categories.php?kd=1">Agama & Rohani</a></li>
<li><a href="categories.php?kd=2">Kesehatan & Jasmani</a></li>
<li><a href="categories.php?kd=3">Buku Anak</a></li>
<li><a href="categories.php?kd=4">Buku Pelajaran</a></li>
<li><a href="categories.php?kd=5">Hobi & Keterampilan</a></li>
<li><a href="categories.php?kd=6">Motivasi & Bisnis</a></li>
<li><a href="categories.php?kd=7">Fiksi</a></li>
<li><a href="categories.php?kd=8">Perguruan Tinggi</a></li>
</ul>
</div>
</div>
......@@ -165,13 +180,14 @@
<div class="multi-gd-img">
<ul class="multi-column-dropdown">
<h6>Daftar Penerbit</h6>
<li><a href="publisher.php">Balai Pustaka</a></li>
<li><a href="publisher.php">Elex Media Kumputindo</a></li>
<li><a href="publisher.php">Erlangga</a></li>
<li><a href="publisher.php">Gramedia</a></li>
<li><a href="publisher.php">Grasindo</a></li>
<li><a href="publisher.php">Kanisius</a></li>
<li><a href="publisher.php">Media Pressindo</a></li>
<li><a href="publisher.php?kd=1">Balai Pustaka</a></li>
<li><a href="publisher.php?kd=2">Sinar Grafika</a></li>
<li><a href="publisher.php?kd=3">LP3ES</a></li>
<li><a href="publisher.php?kd=4">Gramedia Pustaka Utama</a></li>
<li><a href="publisher.php?kd=5">Loko Media</a></li>
<li><a href="publisher.php?kd=6">Kanisius</a></li>
<li><a href="publisher.php?kd=7">Media Aesculapius</a></li>
<li><a href="publisher.php?kd=8">Elex Media Komputindo</a></li>
</ul>
</div>
</div>
......
......@@ -25,7 +25,6 @@
</li>
</ul>
<!-- //main-slider -->
<!-- //top-header and slider -->
<!-- top-brands -->
<div class="top-brands">
<div class="container">
......@@ -44,10 +43,10 @@
</div>
<div class="agile_top_brands_grids">
<?php
$sql = mysql_query("SELECT * FROM t_buku WHERE keterangan = 2 ORDER BY isbn DESC limit 12");
while($data = mysql_fetch_array($sql)){
$sql = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE keterangan = 2 AND jumlah != 0 ORDER BY jumlah ASC LIMIT 6");
while($data = mysqli_fetch_array($sql)){
?>
<div class="col-md-3 top_brand_left">
<div class="col-md-4 top_brand_left">
<div class="hover14 column">
<div class="agile_top_brand_left_grid">
<div class="agile_top_brand_left_grid_pos">
......@@ -57,13 +56,9 @@
<figure>
<div class="snipcart-item block" >
<div class="snipcart-thumb">
<center>
<a href="singlebook.php?kd=<?php echo $data['isbn'];?>"><img src="<?php echo $data['gambar']; ?>" /></a>
</center>
<br>
<a href="singlebook.php?kd=<?php echo $data['isbn'];?>"><img class="col-md-12" src="<?php echo $data['gambar']; ?>" /></a>
<h4><?php echo $data['judul']; ?></h4>
<h4><?php echo $data['pengarang']; ?></h4>
<h4><?php echo $data['penerbit']; ?></h4>
<h4><?php echo $data['tahun']; ?></h4>
<h4>Rp.<?php echo number_format($data['harga'],2,",",".");?></h4>
</div>
......@@ -91,10 +86,10 @@
</div>
<div class="agile_top_brands_grids">
<?php
$sql = mysql_query("SELECT * FROM t_buku WHERE keterangan = 3 ORDER BY isbn DESC limit 12");
while($data = mysql_fetch_array($sql)){
$sql = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE keterangan = 3 AND jumlah != 0 ORDER BY harga ASC LIMIT 6");
while($data = mysqli_fetch_array($sql)){
?>
<div class="col-md-3 top_brand_left">
<div class="col-md-4 top_brand_left">
<div class="hover14 column">
<div class="agile_top_brand_left_grid">
<div class="agile_top_brand_left_grid_pos">
......@@ -104,13 +99,9 @@
<figure>
<div class="snipcart-item block" >
<div class="snipcart-thumb">
<center>
<a href="singlebook.php?kd=<?php echo $data['isbn'];?>"><img src="<?php echo $data['gambar']; ?>" />
</center>
<br>
<a href="singlebook.php?kd=<?php echo $data['isbn'];?>"><img class="col-md-12" src="<?php echo $data['gambar']; ?>" /></a>
<h4><?php echo $data['judul']; ?></h4>
<h4><?php echo $data['pengarang']; ?></h4>
<h4><?php echo $data['penerbit']; ?></h4>
<h4><?php echo $data['tahun']; ?></h4>
<h4>Rp.<?php echo number_format($data['harga'],2,",",".");?></h4>
</div>
......@@ -140,11 +131,11 @@
<!-- new -->
<div class="newproducts-w3agile">
<div class="container">
<h3>Segera Hadir</h3>
<h3>Rilis Terbaru</h3>
<div class="agile_top_brands_grids">
<?php
$sql = mysql_query("SELECT * FROM t_buku WHERE keterangan = 4 ORDER BY isbn DESC limit 4");
while($data = mysql_fetch_array($sql)){
$sql = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE keterangan = 4 AND jumlah != 0 ORDER BY harga ASC LIMIT 4");
while($data = mysqli_fetch_array($sql)){
?>
<div class="col-md-3 top_brand_left-1">
<div class="hover14 column">
......@@ -157,17 +148,17 @@
</div>
<div class="agile_top_brand_left_grid1">
<figure>
<div class="snipcart-item block" >
<div class="snipcart-thumb">
<center>
<a href="singlebook.php?kd=<?php echo $data['isbn'];?>"><img src="<?php echo $data['gambar']; ?>" /></a>
</center>
<br>
<div class="snipcart-thumb">
<a href="singlebook.php?kd=<?php echo $data['isbn'];?>"><img class="col-md-12" src="<?php echo $data['gambar']; ?>" />
<h4><?php echo $data['judul']; ?></h4>
<h4><?php echo $data['pengarang']; ?></h4>
<h4><?php echo $data['penerbit']; ?></h4>
<h4><?php echo $data['tahun']; ?></h4>
<h4>Rp.<?php echo number_format($data['harga'],2,",",".");?></h4>
</div>
<div class="snipcart-details top_brand_home_details">
<a href="function.php?act=add&amp;barang_id=<?php echo $data['isbn']; ?>&amp;ref=checkout.php?kd=<?php echo $data['isbn'];?>">
<input type="submit" name="simpan" value="Tambah" class="button" />
</div>
</div>
</figure>
......
<?php
global $koneksi;
$koneksi = mysql_connect("localhost", "root", "");
//$koneksi = mysqli_connect("localhost", "root", "");
$koneksi = mysqli_connect("localhost", "p1d3ti07", "p1d3ti07");
if (!$koneksi) {
die("Database connection problem");
}
$db_use = mysql_select_db("toko_buku_cemerlang") or die("Select database problem !!");
//$db_use = mysqli_select_db($koneksi, "toko_buku_cemerlang") or die("Select database problem !!");
$db_use = mysqli_select_db($koneksi, "p1d3ti07_d3ti07") or die("Select database problem !!");
?>
\ No newline at end of file
......@@ -6,8 +6,8 @@
$password = $_POST['password'];
$_SESSION['username'] = $username;
$query = mysql_query("SELECT * FROM t_user where username='$username' AND password='$password'");
$masuk = mysql_fetch_array($query);
$query = mysqli_query($koneksi, "SELECT * FROM t_user where username='$username' AND password='$password'");
$masuk = mysqli_fetch_array($query);
if ($masuk == FALSE) {
$_SESSION['error'] == TRUE;
......
......@@ -31,8 +31,8 @@
</div>
<div class="agile_top_brands_grids">
<?php
$sql = mysql_query("SELECT * FROM t_buku WHERE keterangan = 2 ORDER BY isbn DESC limit 12");
while($data = mysql_fetch_array($sql)){
$sql = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE keterangan = 2 ORDER BY isbn DESC limit 12");
while($data = mysqli_fetch_array($sql)) {
?>
<div class="col-md-3 top_brand_left">
<div class="hover14 column">
......@@ -78,8 +78,8 @@
</div>
<div class="agile_top_brands_grids">
<?php
$sql = mysql_query("SELECT * FROM t_buku WHERE keterangan = 3 ORDER BY isbn DESC limit 12");
while($data = mysql_fetch_array($sql)){
$sql = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE keterangan = 3 ORDER BY isbn DESC limit 12");
while($data = mysqli_fetch_array($sql)){
?>
<div class="col-md-3 top_brand_left">
<div class="hover14 column">
......@@ -123,8 +123,8 @@
<h3>Potongan Harga</h3>
<div class="agile_top_brands_grids">
<?php
$sql = mysql_query("SELECT * FROM t_buku WHERE keterangan = 4 ORDER BY isbn DESC limit 4");
while($data = mysql_fetch_array($sql)){
$sql = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE keterangan = 4 ORDER BY isbn DESC limit 4");
while($data = mysqli_fetch_array($sql)){
?>
<div class="col-md-3 top_brand_left-1">
<div class="hover14 column">
......
......@@ -15,10 +15,10 @@
<!-- //breadcrumbs -->
<!-- Page -->
<?php
$per_hal = 10;
$jumlah_record = mysql_query("SELECT COUNT(*) from t_artikel");
$per_hal = 5;
$jumlah_record = mysqli_query($koneksi, "SELECT * FROM t_artikel");
$no = 1;
$jum = mysql_result($jumlah_record, 0);
$jum = mysqli_num_rows($jumlah_record);
$halaman = ceil($jum / $per_hal);
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_hal;
......@@ -29,42 +29,43 @@
<tr>
<br>
<td>Jumlah Data Artikel</td>
<td><?php echo $jum; ?></td>
<td>: <b><?php echo $jum; ?></b></td>
</tr>
</table>
</div>
<!-- checkout -->
<div class="checkout">
<div class="container">
<h2>Detail keranjang belanja : </h2>
<div class="container"><br><br><br>
<h2>Daftar Artikel : </h2><br>
<div class="checkout-right">
<table class="timetable_sub">
<thead>
<tr><th>No.</th>
<tr>
<th>No.</th>
<th>ID</th>
<th>Judul</th>
<th>Isi</th>
<th>Tanngal Dibuat</th>
<th>Gambar</th>
<th>Admin Pengelola</th>
<th>Tanngal Diubah</th>
<th>Pengelola</th>
<th>Opsi</th>
</tr>
</thead>
<?php
$tampil = mysql_query("SELECT * FROM t_artikel");
while($data = mysql_fetch_array($tampil)) {
$tampil = mysqli_query($koneksi, "SELECT * FROM t_artikel LIMIT $start, $per_hal");
while($data = mysqli_fetch_array($tampil)) {
?>
<tr class="rem1">
<td class="invert"><?php echo $no++; ?></td>
<td class="invert"><?php echo $data['id_artikel']; ?></td>
<td class="invert"><?php echo $data['judul_artikel']; ?></td>
<td class="invert"><?php echo $data['isi_artikel']; ?></td>
<td class="invert"><?php echo $data['tanggal_dibuat']; ?></td>
<td class="invert-image"><?php echo $data['gambar_artikel']; ?></td>
<td class="invert"><?php echo $data['tanggal_diedit']; ?></td>
<td class="invert"><?php echo $data['username']; ?></td>
<td class="invert">
<div class="rem">
<div>
<a href="singlearticle.php?kd=<?php echo $data['id_artikel'];?>">
<img src="images/search.png" />
</a>
<a href="editarticle.php?id=<?php echo $data['id_artikel']; ?>">
<img src="images/edit.png" />
</a>
......@@ -81,13 +82,13 @@
<?php
if( isset($_SESSION['administrator'])){
echo '
<tr><td colspan="7" align="center" style="background-color:#ffffff"><b> Tambah Artikel </b></td>
<td><a href="formarticle.php"><img src="images/tambah.png" /></td></tr></table>
<tr><td colspan="6" align="center" style="background-color:#ffffff"><b> Tambah Artikel </b></td>
<td><a href="addarticle.php"><img src="images/tambah.png" /></td></tr></table>
';
}
else {
echo '
<tr><td colspan="11" align="center" style="background-color:#ffffff"> Data buku kosong ! </td></tr></table>
<tr><td colspan="7" align="center" style="background-color:#ffffff"> Data buku kosong ! </td></tr></table>
';
}
?>
......@@ -97,9 +98,9 @@
<ul class="pagination paging">
<li>
<?php
for($x=1;$x<=$halaman;$x++){
for($page=1;$page<=$halaman;$page++){
?>
<li><a href="?page=<?php echo $x ?>"><?php echo $x ?></a></li>
<li><a href="?page=<?php echo $page ?>"><?php echo $page ?></a></li>
<?php
}
?>
......
......@@ -15,41 +15,41 @@
<!-- //breadcrumbs -->
<!-- Page -->
<?php
$per_hal = 10;
$jumlah_record = mysql_query("SELECT COUNT(*) from t_buku");
$per_hal = 5;
$jumlah_record = mysqli_query($koneksi, "SELECT * FROM t_buku");
$no = 1;
$jum = mysql_result($jumlah_record, 0);
$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-2">
<table class="col-md-3">
<tr>
<td>Jumlah Data Buku</td>
<td>: <b><?php echo $jum; ?></b></td>
<td>:<b> <?php echo $jum; ?></b></td>
</tr>
<tr>
<td>Total Dana</td>
<td>
: <b><?php
$modal = mysql_query("SELECT sum(harga) as total from t_buku");
$data = mysql_fetch_array($modal);
<td>:<b>
<?php
$modal = mysqli_query($koneksi, "SELECT SUM(harga) AS total FROM t_buku");
$data = mysqli_fetch_array($modal);
echo " Rp.". number_format($data['total']).",-";
?></b>
</td>
?>
</b></td>
</tr>
</table>
</div>
<!-- checkout -->
<div class="checkout">
<div class="container">
<h2>Detail keranjang belanja : </h2>
<div class="container"><br><br><br>
<h2>Detail Buku : </h2><br>
<div class="checkout-right">
<table class="timetable_sub">
<thead>
<tr><th>No.</th>
<tr>
<th>No.</th>
<th>ISBN</th>
<th>Judul</th>
<th>Pengarang</th>
......@@ -59,13 +59,13 @@
<th>Harga</th>
<th>Jumlah</th>
<th>Keterangan</th>
<th>Gambar</th>
<th>Pengelola</th>
<th>Opsi</th>
</tr>
</thead>
<?php
$tampil = mysql_query("SELECT * FROM t_buku");
while($data = mysql_fetch_array($tampil)) {
$tampil = mysqli_query($koneksi, "SELECT * FROM t_buku LIMIT $start, $per_hal");
while($data = mysqli_fetch_array($tampil)) {
?>
<tr class="rem1">
<td class="invert"><?php echo $no++; ?></td>
......@@ -78,11 +78,14 @@
<td class="invert">Rp.<?php echo number_format($data['harga'],2,",",".");?></td>
<td class="invert"><?php echo $data['jumlah']; ?></td>
<td class="invert"><?php echo $data['keterangan']; ?></td>
<td class="invert-image"><?php echo $data['gambar']; ?></td>
<td class="invert">
<td class="invert"><?php echo $data['username']; ?></td>
<td class="col-md-2">
<div class="rem">
<div>
<a href="formbook.php?id=<?php echo $data['isbn']; ?>">
<a href="singlebook.php?kd=<?php echo $data['isbn'];?>">
<img src="images/search.png" />
</a>
<a href="editbook.php?id=<?php echo $data['isbn']; ?>">
<img src="images/edit.png" />
</a>
<a href='deletebook_process.php?id=<?php echo $data['isbn']; ?>' }">
......@@ -99,12 +102,12 @@
if( isset($_SESSION['administrator'])){
echo '
<tr><td colspan="11" align="center" style="background-color:#ffffff"><b> Tambah Data Buku </b></td>
<td><a href="formbook.php"><img src="images/tambah.png" /></td></tr></table>
<td><a href="addbook.php"><img src="images/tambah.png" /></td></tr></table>
';
}
else {
echo '
<tr><td colspan="11" align="center" style="background-color:#ffffff"> Data buku kosong ! </td></tr></table>
<tr><td colspan="12" align="center" style="background-color:#ffffff"> Data buku kosong ! </td></tr></table>
';
}
?>
......@@ -114,15 +117,15 @@
<ul class="pagination paging">
<li>
<?php
for($x=1;$x<=$halaman;$x++){
for($page=1;$page<=$halaman;$page++){
?>
<li><a href="?page=<?php echo $x ?>"><?php echo $x ?></a></li>
<li><a href="?page=<?php echo $page ?>"><?php echo $page ?></a></li>
<?php
}
?>
</li>
<!--<li>
<a href="?page=<?php echo $x++ ?>" aria-label="Next">
<a href="?page=<?php echo $page++ ?>" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>-->
......
......@@ -16,10 +16,10 @@
}
else {
if($password == $re_password) {
$query = mysql_query("SELECT * FROM t_user WHERE username='$username'");
$daftar = mysql_num_rows($query);
$query = mysqli_query($koneksi, "SELECT * FROM t_user WHERE username='$username'");
$daftar = mysqli_num_rows($query);
if($daftar == NULL){
mysql_query("INSERT INTO t_user VALUES('', '$role', '$username', '$password', '$nama_lengkap', '$email', '$alamat', '$nomor_ponsel')");
mysqli_query($koneksi, "INSERT INTO t_user VALUES('', '$role', '$username', '$password', '$nama_lengkap', '$email', '$alamat', '$nomor_ponsel')");
echo "<script>alert('Daftar Berhasil $username, Silahkan masuk'); window.location = 'login.php';</script>";
}
else{
......
......@@ -8,30 +8,40 @@
<div class="container">
<center><h2>TERIMAKASIH TELAH BERBELANJA DI TOKO BUKU CEMERLANG</h12</center>
<div class="checkout-left">
<div class="col-md-12 checkout-left">
<div class="checkout-left-basket">
<h4>Struk Pesanan</h4>
<?php
<h4>Struk Pemesanan</h4>
<?php
$total = 0;
if (isset($_SESSION['items'])) {
foreach ($_SESSION['items'] as $key => $val) {
$query = mysql_query("SELECT * FROM t_buku WHERE isbn = '$key'");
$data = mysql_fetch_array($query);
$query = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE isbn = '$key'");
$data = mysqli_fetch_array($query);
$jumlah_harga = $data['harga'] * $val;
$total += $jumlah_harga;
$no = 1;
?>
<ul>
<li><?php echo $no++; ?></li>
<li><?php echo $data['judul']; ?><i> - </i> <span>Rp.<?php echo number_format($data['harga'],2,",",".");?></span></li>
<li>Potongan Harga <i>-</i> <span> - </span></li>
<li>Total Harga <i>-</i> <span>Rp.<?php echo number_format($jumlah_harga); ?>,00</span></li>
</ul>
<?php
}
?>
<li>Potongan Harga<span> - </span></li>
<li>Total Harga <i>-</i> <span>Rp.<?php echo number_format($total); ?>,00</span></li>
</ul>
<?php
}
?>
<?php
if (isset($_SESSION['items'])) {
foreach ($_SESSION['items'] as $key => $val) {
$query = mysqli_query($koneksi, "INSERT INTO t_pemesanan WHERE isbn = '$key'");
$data = mysqli_fetch_array($query);
?>
</div>
<div class="clearfix"> </div>
</div>
......
......@@ -17,16 +17,16 @@
<div class="container">
<div class="agileinfo_single">
<?php
$query = mysql_query("SELECT * FROM t_artikel WHERE id_artikel = '$_GET[kd]'");
$data = mysql_fetch_array($query);
$query = mysqli_query($koneksi, "SELECT * FROM t_artikel WHERE id_artikel = '$_GET[kd]'");
$data = mysqli_fetch_array($query);
?>
<div class="col-md-2 agileinfo_single_left">
<img src="<?php echo $data['gambar_artikel']; ?>" class="img-responsive" />
</div>
<div class="col-md-10 agileinfo_single_right">
Judul Buku : <h1><?php echo $data['judul_artikel']; ?></h1><br>
<div class="col-md-10">
Judul Buku : <h3><?php echo $data['judul_artikel']; ?></h3><br>
Tanggal Ditambahkan : <h4><?php echo $data['tanggal_dibuat']; ?></h4><br>
Isi Artikel : <h3><?php echo $data['isi_artikel']; ?></h3>
Isi Artikel : <h5><?php echo $data['isi_artikel']; ?></h5>
</div>
<div class="clearfix"> </div>
</div>
......
if(isset($_POST['edit'])){
$edit = mysql_query("UPDATE t_buku SET isbn='$isbn', judul='$judul', pengarang='$pengarang', penerbit='$penerbit', kategori='$kategori', tahun='$tahun', harga='$harga', jumlah='$jumlah', gambar='$gambar', keterangan='$keterangan'") or die(mysql_error());
if($edit) {
echo "<script>alert('Data buku $judul berhasil dibaharui');window.location = 'processbook.php '</script>";
}
else {
echo "<script>alert('Gagal membaharui data buku !'); window.location = 'formbook.php'</script>";
}
}
\ No newline at end of file
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