edit

parent acc359c7
......@@ -106,9 +106,9 @@
<h3>Daftar Pesanan Kamar</h3>
<table cellpadding="5" cellspacing="10" border="1">
<tr>
<th style="text-align:center">id</th>
<table class="table table-bordered table-hover">
<thead>
<th style="text-align:center">id Pemesanan</th>
<th style="text-align:center">Nama Lengkap</th>
<th style="text-align:center">Alamat</th>
<th style="text-align:center">Email</th>
......@@ -119,33 +119,43 @@
<th width="300px" height="100" style="text-align:center">Gambar</th>
<th style="text-align:center">Action</th>
</tr>
</thead>
<?php
require_once(dirname(__FILE__ ).'/fungsi.php');
$pemesanan = getPemesanan();
$query = mysqli_query($conn, "SELECT * FROM pembayaran");
$queryy = mysqli_query($conn, "SELECT * FROM pemesanan");
$dataa = mysqli_fetch_assoc($queryy);
//jika data tidak kosong, maka akan melakukan perulangan while
$no = 1; //membuat variabel $no untuk membuat nomor urut
foreach ($pemesanan as $data)
while ($data = mysqli_fetch_assoc($query))
{ //perulangan while dg membuat variabel $data yang akan mengambil data di database
//menampilkan row dengan data di database
echo '<tr>';
echo '<td style="text-align:center">'.$data['id'].'</td>';
echo '<td>'.$data['namalengkap'].'</td>';
echo '<td>'.$data['alamat'].'</td>';
echo '<td>'.$data['email'].'</td>';
echo '<td style="text-align:center">'.$data['jumlahpeserta'].'</td>';
echo '<td>'.$data['waktumulai'].'</td>';
echo '<td>'.$data['waktuselesai'].'</td>';
echo '<td style="text-align:center" >'.$data['namaruangan'].'</td>';
echo '<td><img src="'.$data['gambar'].'>"</td>';
echo '<td><a href="update.php?id='.$data['id'].'">Update</a></td>';
echo '<td style="text-align:center">'.$data['id_pemesanan'].'</td>';
echo '<td>'.$dataa['namalengkap'].'</td>';
echo '<td>'.$dataa['alamat'].'</td>';
echo '<td>'.$dataa['email'].'</td>';
echo '<td style="text-align:center">'.$dataa['jumlahpeserta'].'</td>';
echo '<td>'.$dataa['waktumulai'].'</td>';
echo '<td>'.$dataa['waktuselesai'].'</td>';
echo '<td style="text-align:center" >'.$dataa['namaruangan'].'</td>';
echo '<td><img src="gambar/'.$data['bukti'].'"style="width:200px"></td>';
echo '<td>
<a href="update.php?id='.$data['id_pemesanan'].'">Update</a> <br>';
if($data['status'] != "Diterima" && $data['status'] == NULL){
echo '<a href="confirm.php?id='. $data['id_pemesanan'].'&status=Diterima"> Konfirmasi </a>';
}else{
echo $data['status'];
}
echo '</td>';
echo '</tr>';
}
?>
</table>
</body>
</html>
<?php
<?php
require_once(dirname(__FILE__).'/header.php');
?>
<!DOCTYPE html>
......@@ -29,7 +29,7 @@ require_once(dirname(__FILE__).'/header.php');
echo'<div class="col-md-3 thumbnail"style="margin-left:90px; margin-top:100px">
<img src="'.$data['gambar'].'" style="width: 100%; height: 400px;"><br><hr>
<center><div><a href="detailkamar.php?id='.$data['id'].'" class="btn btn-default">Detail</a>
<a href="memesan.php" class="btn btn-default">Pesan</a></div></div>';
<a href="memesan.php?id='. $data['id'].'" class="btn btn-default">Pesan</a></div></div>';
}
......
......@@ -102,14 +102,14 @@
</script>
<h3>Keluhan Pengunjung</h3>
<table cellpadding="5" cellspacing="10" border="1">
<tr>
<table class="table table-bordered table-hover">
<thead>
<th>ID</th>
<th>Nama Pengunjung</th>
<th>Email Pengunjung</th>
<th style="width:400px;">Isi Keluhan</th>
</tr>
</thead>
<?php
require_once(dirname(__FILE__ ).'/fungsi.php');
$keluhan = getAllKeluhan();
......
......@@ -79,7 +79,7 @@ session_start();
</p>
<p>
<label for="email" class="email" > email</label>
<input id="email" name="email" required="required" type="int" placeholder="Masukkan email"/>
<input id="email" name="email" required="required" type="email" placeholder="Masukkan email"/>
</p>
<p>
<label for="username" class="uname" >Masukkan Username </label>
......
......@@ -11,6 +11,7 @@
$alamat= $_SESSION['alamat'];
$email= $_SESSION['email'];
?>
<!DOCTYPE html>
<html>
......@@ -39,8 +40,15 @@
<div class="hero">
<?php
require_once(dirname(__FILE__ ).'/fungsi.php');
$id_kamar = $_GET['id'];
$profil = getProfil();
?>
<form method="POST" action="pemesanan.php?id_kamar=<?= $id_kamar?>" enctype="multipart/form-data">
<form method="POST" action="pemesanan.php" enctype="multipart/form-data">
<table>
<tr>
......@@ -83,7 +91,7 @@
<input type="file" style="width:200px" name="gambar">
<input type="submit" name="submit" class="btn btn-info" value="Pesan Sekarang" >
</form>
</div>
......
<?php
include_once('fungsi.php');
$id = $_POST['id'];
$id_kamar = $_GET['id_kamar'];
$id = $_GET['id'];
$nama_lengkap = $_POST['nama'];
$alamat = $_POST['alamat'];
$email = $_POST['email'];
......@@ -9,20 +9,22 @@ include_once('fungsi.php');
$waktu_mulai = $_POST['waktumulai'];
$waktu_selesai = $_POST['waktuselesai'];
$namaruangan = $_POST['namaruangan'];
$gambar = $_POST['namaruangan'];
$gambar = $_FILES['gambar']['name'];
if ($_FILES['gambar']['name']) {
move_uploaded_file($_FILES['gambar']['tmp_name'], 'gambar/'.$nama.'.jpg');
$gambar = 'gambar'.$nama.'.jpg';
}
if($jumlahpeserta>45){
echo"<script language='javascript'>alert('Jumlah Peserta Melebihi Kapasitas')</script>";
echo "<script>window.location = 'memesan.php'</script>";
}else{
$memesan = mysqli_query($conn, "insert into pemesanan(id,namalengkap, alamat, email, jumlahpeserta, waktumulai, waktuselesai, namaruangan, gambar) values('$id', '$nama_lengkap', '$alamat', '$email', '$jumlahpeserta', '$waktu_mulai', '$waktu_selesai', '$namaruangan', '$gambar')");
header('Location: index.php');
$memesan = mysqli_query($conn, "insert into pemesanan(id,namalengkap, alamat, email, jumlahpeserta, waktumulai, waktuselesai, namaruangan, gambar, id_kamar) values('', '$nama_lengkap', '$alamat', '$email', '$jumlahpeserta', '$waktu_mulai', '$waktu_selesai', '$namaruangan', '$gambar', '$id_kamar')");
header('Location: konfirmasipemesanan.php?id_kamar='. $id_kamar);
}
?>
\ No newline at end of file
......@@ -15,6 +15,7 @@
$update2 = mysqli_query($conn, "UPDATE pemesanan SET namalengkap='$nama_lengkap', alamat='$alamat', email='$email', jumlahpeserta='$jumlahpeserta', waktumulai='$waktu_mulai', waktuselesai='$waktu_selesai', namaruangan='$namaruangan' WHERE id='$id'");
if(!$update2){
......
......@@ -7,12 +7,13 @@ $email=$_POST['email'];
$waktu_mulai=$_POST['waktumulai'];
$waktu_selesai=$_POST['waktuselesai'];
$namaruangan=$_POST['namaruangan'];
$gambar = ['gambar'];
if ($_FILES['gambar']['name']) {
move_uploaded_file($_FILES['gambar']['tmp_name'], 'gambar/'.$nama.'.jpg');
$gambar = 'gambar/'.$nama.'.jpg';
$gambar = 'gambar'.$nama.'.jpg';
}
$query = mysql_query("update produk set namalengkap='$nama', alamat='$alamat', email='$email', waktumulai='$waktu_mulai', waktuselesai='$waktu_selesai', namaruangan='$namaruangan', gambar='$gambar' where id_produk='$id'");
$query = mysqli_query("update produk set namalengkap='$nama', alamat='$alamat', email='$email', waktumulai='$waktu_mulai', waktuselesai='$waktu_selesai', namaruangan='$namaruangan', gambar='$gambar' where id_produk='$id'");
?>
\ 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