mengedit kode yang ada

parent 1bd340fd
<?php
session_start();
include_once('fungsi.php');
if(!isset($_SESSION['admin'])){
header("location: login.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PENELOLA GIBEON</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/datepicker3.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">
<!--Icons-->
<script src="js/lumino.glyphs.js"></script>
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#sidebar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><span>GIBEON</span>Admin</a>
<ul class="user-menu">
<li class="dropdown pull-right">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><svg class="glyph stroked male-user"><use xlink:href="#stroked-male-user"></use></svg>Admin<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="Logout.php"><svg class="glyph stroked cancel"><use xlink:href="#stroked-cancel"></use></svg> Logout</a></li>
</ul>
</li>
</ul>
</div>
</div><!-- /.container-fluid -->
</nav>
<div id="sidebar-collapse" class="col-sm-3 col-lg-2 sidebar">
<form role="search">
</form>
<ul class="nav menu">
<li class="active"><a href="home.php"><svg class="glyph stroked dashboard-dial"><use xlink:href="#stroked-dashboard-dial"></use></svg> Dashboard</a></li>
<li><a href="isikeluhan.php"><svg class="glyph stroked calendar"><use xlink:href="#stroked-calendar"></use></svg> DAFTAR KELUHAN</a></li>
<li><a href="Daftar_pesanan.php"><svg class="glyph stroked table"><use xlink:href="#stroked-table"></use></svg> PESANAN</a></li>
<li role="presentation" class="divider"></li>
</ul>
</div><!--/.sidebar-->
<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">
<div class="row">
<ol class="breadcrumb">
<li><a href="home.php"><svg class="glyph stroked home"><use xlink:href="#stroked-home"></use></svg></a></li>
<li class="active">Icons</li>
</ol>
</div><!--/.row-->
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/chart.min.js"></script>
<script src="js/chart-data.js"></script>
<script src="js/easypiechart.js"></script>
<script src="js/easypiechart-data.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script>
$('#calendar').datepicker({
});
!function ($) {
$(document).on("click","ul.nav li.parent > a > span.icon", function(){
$(this).find('em:first').toggleClass("glyphicon-minus");
});
$(".sidebar span.icon").find('em:first').addClass("glyphicon-plus");
}(window.jQuery);
$(window).on('resize', function () {
if ($(window).width() > 768) $('#sidebar-collapse').collapse('show')
})
$(window).on('resize', function () {
if ($(window).width() <= 767) $('#sidebar-collapse').collapse('hide')
})
</script>
<h3>Daftar Pesanan Kamar</h3>
<table cellpadding="5" cellspacing="10" border="1">
<tr>
<th style="text-align:center">id</th>
<th style="text-align:center">Nama Lengkap</th>
<th style="text-align:center">Alamat</th>
<th style="text-align:center">Email</th>
<th style="text-align:center">Jumlah Peserta</th>
<th style="text-align:center">Waktu Mulai</th>
<th style="text-align:center">Waktu Selesai</th>
<th style="text-align:center">Nama Ruangan</th>
<th width="300px" height="100" style="text-align:center">Gambar</th>
<th style="text-align:center">Action</th>
</tr>
<?php
require_once(dirname(__FILE__ ).'/fungsi.php');
$pemesanan = getPemesanan();
//jika data tidak kosong, maka akan melakukan perulangan while
$no = 1; //membuat variabel $no untuk membuat nomor urut
foreach ($pemesanan as $data)
{ //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 '</tr>';
}
?>
</body>
</html>
......@@ -21,8 +21,8 @@
<?php
require_once(dirname(__FILE__ ).'/fungsi.php');
$profil = getProfil();
$query = mysql_query("SELECT * FROM profil WHERE id='2'");
$data = mysql_fetch_array($query);
$query = mysqli_query($conn,"SELECT * FROM profil WHERE id='2'");
$data = mysqli_fetch_array($query);
?>
<table>
......
......@@ -18,8 +18,8 @@ require_once(dirname(__FILE__).'/header.php');
<?php
require_once(dirname(__FILE__ ).'/fungsi.php');
$profil = getProfil();
$query = mysql_query("SELECT * FROM kamar WHERE id='$_GET[id]'");
$data = mysql_fetch_array($query);
$query = mysqli_query($conn,"SELECT * FROM kamar WHERE id='$_GET[id]'");
$data = mysqli_fetch_array($query);
?>
<br><br><br><br>;
<div class="hero-unit" style="margin-left: 300px; margin-bottom: 126px;">
......
<?php
include_once('fungsi.php');
$nama= mysql_real_escape_string($_GET['id']);
$id = $_GET['id'];
?>
<?php
$pemesanan=mysql_query("SELECT * FROM pemesanan WHERE id='$id'");
while($p=mysql_fetch_array($pemesanan)){
?>
<table>
<tr>
<td width="200px">ID</td>
<td width="150px">:</td>
<td><input type="text" name="id" id="nama" value='<?php echo $p['id'] ?>' readonly> </td>
</tr>
<tr>
<td width="200px">Nama Pengunjung</td>
<td width="150px">:</td>
<td><input type="text" name="nama" id="nama" value='<?php echo $p['namalengkap'] ?>' readonly> </td>
</tr>
<tr>
<td>Alamat Pengunjung</td>
<td>:</td>
<td><input type="text" name="alamat" id="nama" value='<?php echo $p['alamat'] ?>' readonly></td>
</tr>
<tr>
<td>Email Pengunjung</td>
<td>:</td>
<td><input type="text" name="email" id="nama" value='<?php echo $p['email'] ?>' readonly></td>
</tr>
<tr>
<td>Jumlah Peserta</td>
<td>:</td>
<td><input type="text" name="jumlahpeserta" id="nama" value='<?php echo $p['jumlahpeserta'] ?>' readonly></td>
</tr>
<tr>
<td>Tanggal Mulai</td>
<td>:</td>
<td width="300px"><input type="text" name="waktumulai" id="nama" value='<?php echo $p['waktumulai'] ?>' readonly></td>
</tr>
<tr>
<td>Tanggal Selesai</td>
<td>:</td>
<td><input type="text" name="waktuselesai" id="nama" value='<?php echo $p['waktuselesai'] ?>' readonly></td>
</tr>
<tr>
<td>Nama Ruangan</td>
<td>:</td>
<td><input type="text" name="namaruangan" id="nama" required></td>
</tr>
</table>
<?php
}
?>
\ No newline at end of file
......@@ -7,10 +7,10 @@ $password =$_POST['password'];
$query = "select * from user where username='".$username."' and password='".$password."'";
$sql = mysql_query($query);
$sql = mysqli_query($conn, $query);
$check = mysql_num_rows($sql);
$r = mysql_fetch_array($sql);
$check = mysqli_num_rows($sql);
$r = mysqli_fetch_array($sql);
if($check>=0){
$_SESSION['username'] = $username;
......
<?php
$host="127.0.0.1";
$user="root";
$pass="";
$name="p1d3ti08_proyek";
$koneksi=mysql_connect($host,$user,$pass)or die("Koneksi ke database gagal!");
mysql_select_db($name,$koneksi)or die("Tidak ada database yang dipilih!");
$id = $_POST['id'];
$nama_lengkap = $_POST['nama'];
$alamat = $_POST['alamat'];
$email = $_POST['email'];
$jumlahpeserta = $_POST['jumlahpeserta'];
$waktu_mulai = $_POST['waktumulai'];
$waktu_selesai = $_POST['waktuselesai'];
$namaruangan = $_POST['namaruangan'];
$gambar = $_POST['namaruangan'];
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{
mysql_query("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');
}
?>
\ No newline at end of file
......@@ -20,8 +20,8 @@
include_once('header.php');
require_once(dirname(__FILE__ ).'/fungsi.php');
$profil = getProfil();
$query = mysql_query("SELECT * FROM profil WHERE id='3'");
$data = mysql_fetch_array($query);
$query = mysqli_query($conn,"SELECT * FROM profil WHERE id='3'");
$data = mysqli_fetch_array($query);
?>
<div class="col-md-6">
<table>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Picture Life</title>
<link rel="shortcut icon" href="images/inst.png">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/myStyle.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/js.js"></script>
</head>
<?php
require_once(dirname(__FILE__).'/header.php');
require_once(dirname(__FILE__ ).'/fungsi.php');
$profil = getProfil();
$no = 1;
foreach ($profil as $data)
{
echo'<div class="col-md-6 thumbnail">
<img src="'.$data['gambar'].'" style="width: 100%; height: 400px;"><br><hr>
<div><a href="detailprofil.php?id='.$data['id'].'" class="btn btn-default">Detail</a></div></div>';
}
?>
</body>
</html>
\ No newline at end of file
......@@ -20,8 +20,8 @@
<?php
require_once(dirname(__FILE__ ).'/fungsi.php');
$profil = getProfil();
$query = mysql_query("SELECT * FROM profil WHERE id='1'");
$data = mysql_fetch_array($query);
$query = mysqli_query($conn,"SELECT * FROM profil WHERE id='1'");
$data = mysqli_fetch_array($query);
?>
<table>
......
......@@ -21,8 +21,8 @@
<?php
require_once(dirname(__FILE__ ).'/fungsi.php');
$profil = getProfil();
$query = mysql_query("SELECT * FROM profil WHERE id='5'");
$data = mysql_fetch_array($query);
$query = mysqli_query($conn,"SELECT * FROM profil WHERE id='5'");
$data = mysqli_fetch_array($query);
?>
<div class="col-md-6">
......
......@@ -21,8 +21,8 @@
<?php
require_once(dirname(__FILE__ ).'/fungsi.php');
$profil = getProfil();
$query = mysql_query("SELECT * FROM profil WHERE id='4'");
$data = mysql_fetch_array($query);
$query = mysqli_query($conn,"SELECT * FROM profil WHERE id='4'");
$data = mysqli_fetch_array($query);
?>
<div class="col-md-6">
......
<?php
include_once('fungsi.php');
$host="127.0.0.1";
$user="root";
$pass="";
$name="p1d3ti08_proyek";
$koneksi=mysql_connect($host,$user,$pass)or die("Koneksi ke database gagal!");
mysql_select_db($name,$koneksi)or die("Tidak ada database yang dipilih!");
$koneksi=mysqli_connect($host,$user,$pass)or die("Koneksi ke database gagal!");
mysqli_select_db ($conn, $name)or die("Tidak ada database yang dipilih!");
$nama_lengkap = $_POST['namalengkap'];
$alamat = $_POST['alamat'];
......@@ -12,7 +13,7 @@ mysql_select_db($name,$koneksi)or die("Tidak ada database yang dipilih!");
$username = $_POST['username'];
$password = $_POST['password'];
mysql_query("insert into user (namalengkap, alamat, email, username, password) values('$nama_lengkap', '$alamat', '$email', '$username', '$password')");
mysqli_query($conn, "insert into user (namalengkap, alamat, email, username, password) values('$nama_lengkap', '$alamat', '$email', '$username', '$password')");
header('Location: login.php');
?>
\ No newline at end of file
......@@ -6,7 +6,7 @@
header("location: login.php");
}
$nama= mysql_real_escape_string($_GET['id']);
$nama= mysqli_real_escape_string($conn,$_GET['id']);
$id = $_GET['id'];
?>
......@@ -68,8 +68,8 @@
</div><!--/.row-->
<?php
$pemesanan=mysql_query("SELECT * FROM pemesanan WHERE id='$id'");
while($p=mysql_fetch_array($pemesanan)){
$pemesanan=mysqli_query($conn, "SELECT * FROM pemesanan WHERE id='$id'");
while($p=mysqli_fetch_array($pemesanan)){
......
......@@ -15,10 +15,10 @@
$update2 = mysql_query("UPDATE pemesanan SET namalengkap='$nama_lengkap', alamat='$alamat', email='$email', jumlahpeserta='$jumlahpeserta', waktumulai='$waktu_mulai', waktuselesai='$waktu_selesai', namaruangan='$namaruangan' WHERE id='$id'");
$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){
echo mysql_error();
echo mysqli_error();
}
redirect('Daftar_pesanan.php');
......
......@@ -14,9 +14,5 @@ if ($_FILES['gambar']['name']) {
}
$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'");
if($query){
echo "<script>alert('Data $nama berhasil disimpan!'); window.location = 'barang.php'</script>";
}else{
echo "<script>alert('Data $nama gagal disimpan!'); window.location = 'barang.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