parents d723cd7b 33d60f20
<?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>Tambah Data Buku</h2>
<div class="login-form-grids">
<h5>Data Buku</h5>
<form action="addbook_process.php" method="POST" enctype="multipart/form-data">
<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" accept="img/*" required=" ">
<input type="submit" name="tambah" value="tambah">
</form>
</div>
<div class="register-home">
<a href="processbook.php">BATAL</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'];
$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'];
if($_FILES['gambar']['name']) {
move_uploaded_file($_FILES['gambar']['tmp_name'],'images/'.$judul.'.jpg');
$profil = 'images/'.$judul.'.jpg';
}
$tambah = mysqli_query($koneksi, "INSERT INTO t_buku VALUES('$isbn', '$judul', '$pengarang', '$penerbit', '$kategori', '$tahun', '$harga', '$jumlah', '$profil', '$keterangan', '$username')") or die(mysqli_error());
if($tambah) {
echo "<script>alert('Data buku $judul berhasil disimpan'); window.location = 'processbook.php'</script>";
}
else {
echo "<script>alert('Gagal menyimpan buku !'); window.location = 'addbook.php'</script>";
}
}
?>
\ No newline at end of file
<?php
require_once("koneksi.php");
$id=$_GET['id'];
mysqli_query($koneksi, "DELETE FROM t_user where id_user='$id'");
echo "<script>alert('Akun berhasil dihapus');window.location = 'processmember.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>Edit Data Buku</h2>
<div class="login-form-grids">
<h5>Data Buku</h5>
<?php
$id_buku = mysqli_real_escape_string($koneksi, $_GET['id']);
$cari = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE isbn='$id_buku'")or die(mysqli_error());
while($data = mysqli_fetch_array($cari)) {
?>
<form action="editbook_process.php" method="POST" enctype="multipart/form-data">
<input type="hidden" name="id" placeholder="ISBN" value="<?php echo $data['isbn'] ?>" >
<b>Judul Buku : </b>
<input type="text" name="judul" placeholder="Judul Buku" value="<?php echo $data['judul'] ?>" >
<b><br>Nama Pengarang :</b>
<input type="text" name="pengarang" placeholder="Nama Pengarang" value="<?php echo $data['pengarang'] ?>" >
<b><br>Nama Penerbit :</b>
<input type="text" name="penerbit" placeholder="Nama Penerbit" value="<?php echo $data['penerbit'] ?>" >
<b><br>Kategori Buku :</b>
<input type="text" name="kategori" placeholder="Kategori Buku" value="<?php echo $data['kategori'] ?>" >
<b><br>Tahun Terbit :</b>
<input type="text" name="tahun" placeholder="Tahun Terbit" value="<?php echo $data['tahun'] ?>" >
<b><br>Harga per Eksemplar :</b>
<input type="text" name="harga" placeholder="Harga per Eksemplar" value="<?php echo $data['harga'] ?>" >
<b><br>Jumlah Tersedia :</b>
<input type="text" name="jumlah" placeholder="Jumlah Tersedia" value="<?php echo $data['jumlah'] ?>" >
<b><br>Keterangan Buku :</b>
<input type="text" name="keterangan" placeholder="Keterangan Buku" value="<?php echo $data['keterangan'] ?>" >
<b><br>Gambar : <br><br></b>
<input type="file" name="gambar" accept="img/*" value="<?php echo $data['gambar'] ?>" >
<input type="submit" name="edit" value="edit">
</form>
<?php
}
?>
</div>
<div class="register-home">
<a href="processbook.php">BATAL</a>
</div>
</div>
</div>
<!-- //register -->
<?php
include 'footer.php';
?>
\ No newline at end of file
<?php
session_start();
include 'koneksi.php';
$username = $_SESSION['username'];
$id = $_POST['id'];
$judul = $_POST['judul'];
$pengarang = $_POST['pengarang'];
$penerbit = $_POST['penerbit'];
$kategori = $_POST['kategori'];
$tahun = $_POST['tahun'];
$harga = $_POST['harga'];
$jumlah = $_POST['jumlah'];
$keterangan = $_POST['keterangan'];
if($_FILES['gambar']['name']) {
move_uploaded_file($_FILES['gambar']['tmp_name'],'images/'.$judul.'.jpg');
$profil = 'images/'.$judul.'.jpg';
}
$edit = mysqli_query($koneksi, "UPDATE t_buku SET judul='$judul', pengarang='$pengarang', penerbit='$penerbit', kategori='$kategori', tahun='$tahun', harga='$harga', jumlah='$jumlah', gambar='$profil', keterangan='$keterangan', username='$username' WHERE isbn='$id'") or die(mysqli_error());
if($edit) {
echo "<script>alert('Data buku $judul berhasil disimpan');window.location = 'processbook.php'</script>";
}
else {
echo "<script>alert('Gagal menyimpan data buku !'); window.location = 'editbook.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 Ubah Informasi Data Diri</h2>
<div class="login-form-grids">
<h5>Informasi Data Diri</h5>
<?php
$id_nama = mysqli_real_escape_string($koneksi, $_GET['id']);
$cari = mysqli_query($koneksi, "SELECT * FROM t_user WHERE id_user='$id_nama'")or die(mysqli_error());
while($data = mysqli_fetch_array($cari)) {
?>
<form action="editprofile_process.php" method="POST">
<input type="hidden" name="id" placeholder="ID User" value="<?php echo $data['id_user'] ?>" >
Nama Lengkap :
<input type="text" name="nama_lengkap" placeholder="Nama Lengkap" value="<?php echo $data['nama_lengkap'] ?>" >
Alamat :
<input type="text" name="alamat" placeholder="Alamat" value="<?php echo $data['alamat'] ?>" ><br>
Nomor Ponsel :
<input type="text" name="nomor_ponsel" placeholder="Nomor Ponsel" value="<?php echo $data['nomor_ponsel'] ?>" >
Email :
<input type="email" name="email" placeholder="Email" value="<?php echo $data['email'] ?>" >
<div class="register-check-box">
<div class="check">
<label class="checkbox"><input type="checkbox" name="checkbox" required=" " ><i> </i>Saya telah mengetahui dan setuju</label>
</div>
</div>
<input type="submit" name="simpan" value="simpan">
</form>
<?php
}
?>
</div>
<div class="register-home">
<a href="editprofile.php">Batal</a>
</div>
</div>
</div>
<!-- //register -->
<?php
include 'footer.php';
?>
\ No newline at end of file
<?php
session_start();
include 'koneksi.php';
$username = $_SESSION['username'];
$id = $_POST['id'];
$nama_lengkap = $_POST['nama_lengkap'];
$alamat = $_POST['alamat'];
$nomor_ponsel = $_POST['nomor_ponsel'];
$email = $_POST['email'];
$edit = mysqli_query($koneksi, "UPDATE t_user SET nama_lengkap='$nama_lengkap', email='$email', alamat='$alamat', nomor_ponsel='$nomor_ponsel' WHERE id_user='$id'") or die(mysqli_error());
if($edit) {
echo "sukses";
}
else {
echo "<script>alert('Gagal menyimpan data diri !'); window.location = 'editprofile.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 animated wow slideInLeft" data-wow-delay=".5s">
<li><a href="index.php"><span class="glyphicon glyphicon-home" aria-hidden="true"></span>Beranda</a></li>
<li class="active">Informasi Data Diri</li>
</ol>
</div>
</div>
<!-- //breadcrumbs -->
<div class="products">
<div class="container">
<div class="agileinfo_single">
<?php
$username = $_SESSION['username'];
$query = mysqli_query($koneksi, "SELECT * FROM t_user, t_penerbit WHERE username = '$username'");
$data = mysqli_fetch_array($query);
?>
<div class="col-md-5 agileinfo_single_right">
Nama Lengkap : <h3><?php echo $data['nama_lengkap']; ?></h3><br>
Alamat : <h3><?php echo $data['alamat']; ?></h3><br>
Nomor Ponsel : <h3>0<?php echo $data['nomor_ponsel']; ?></h3><br>
Email : <h3><?php echo $data['email']; ?></h3>
</div>
<!--<div class="col-md-5 agileinfo_single_right">
<br><br>
<div class="snipcart-item block">
<div class="snipcart-details top_brand_home_details">
<a href="editpassword.php">
<input type="submit" name="simpan" value="edit data diri" class="button" />
</div>
<div class="snipcart-details top_brand_home_details">
<a href="editprofile.php">
<input type="submit" name="simpan" value="ganti kata sandi" class="button" />
</div>
</div>
</div>-->
<div class="clearfix"> </div>
</div>
</div>
</div>
<?php
include 'footer.php';
?>
\ 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