Commit 1723920b by DESKTOP-4R50ASQ\DELL
parents 2e43d715 aa46f6f3
<?php
//session_start();
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
global $total;
$query = "SELECT menu.harga as harga, pesanan.jumlah as jumlah FROM pesanan INNER JOIN menu ON pesanan.id_menu = menu.id";
$result_set = $database->query($query);
$result_set = $conn->query($query);
$row = mysqli_fetch_array($query);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Cafe Bunga Toba</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css" media="screen" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Playball' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style-portfolio.css">
<link rel="stylesheet" href="css/picto-foundry-food.css" />
<link rel="stylesheet" href="css/jquery-ui.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link rel="icon" href="favicon-1.ico" type="image/x-icon">
</head>
<body>
<div class="checkout grid_16">
<div class="billInfo grid_11 alpha">
<h4>Daftar Pesanan</h4><br>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="row">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<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="index.php">Cafe BUNGA TOBA</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav main-nav clear navbar-right ">
<li><a class="navactive color_animation" href="index.php">WELCOME</a></li>
<?php
if (isset($_SESSION['isLogin']) && (get_session('role') == "member")) {
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="index.php #menu">MENU</a></li>');
echo('<li><a class="color_animation" href="pesanan.php">PESANAN</a></li>');
echo('<li><a class="color_animation" href="upload_bukti.php">PEMBAYARAN</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (isset($_SESSION['isLogin']) && (get_session('role') == "karyawan" || get_session('role') == "admin")) {
echo('<li><a class="color_animation" href="tambah_menu.php">OLAH MENU</a></li>');
echo('<li><a class="color_animation" href="daftar_pesanan.php">DAFTAR PESANAN</a></li>');
echo('<li><a class="color_animation" href="list_komentar.php">DAFTAR KOMENTAR</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (!isset($_SESSION['isLogin'])) {
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="#menu">MENU</a></li>');
echo('<li><a class="color_animation" href="login.php">LOGIN</a></li>');
echo('<li><a class="color_animation" href="signup.php">SIGN UP</a></li>');
}
?>
</ul>
</div><!-- /.navbar-collapse -->
</div>
</div><!-- /.container-fluid -->
</nav>
<body>
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-6 col-xs-12">
<div class="row">
<div class="col-lg-8 col-md-6 col-xs-6">
<br>
<br>
<br>
<p>
<table border="2px">
<div><img src="foto/<?php echo $row['gambar'] ?>" class="img-thumbnail" width="330" height="260"> </div>
<table border="3px"><br>
<tr>
<td>Total harga</td>
<th>Total harga</th>
</tr>
<?php
$total = 0;
while ($row = $result_set->fetch_array()) {
$total = $total + ($row['harga'] * $row['jumlah']);
$total = $total += ($row['harga'] * $row['jumlah']);
}
?>
<tr><td><?= $total ?></td></tr>
<tr>
<td><?= $total ?></td>
</tr>
</table>
<a href="bayar_process.php?harga=<?= $total ?>">oke</a>
</p>
</div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</body>
\ No newline at end of file
......@@ -6,14 +6,14 @@ include_once 'connection/koneksi.php';
$id = get_session('id');
mysqli_query($database, "DELETE FROM pesanan WHERE id_user=$id");
mysqli_query($conn, "DELETE FROM pesanan WHERE id_user=$id");
$harga = $_GET['harga'];
$id = get_session('id');
$query = 'INSERT INTO pembayaran( `id_user`, `total`) VALUES(?, ?)';
$statement = $database->prepare($query);
$statement = $conn->prepare($query);
$statement->bind_param('is', $id, $harga);
$statement->execute();
redirect('index.php#pembayaran');
......
-- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 21, 2017 at 04:16 PM
-- Server version: 5.6.24
-- PHP Version: 5.6.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `cafe_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `kategori`
--
CREATE TABLE IF NOT EXISTS `kategori` (
`id` int(11) NOT NULL,
`nama` varchar(7) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `kategori`
--
INSERT INTO `kategori` (`id`, `nama`) VALUES
(1, 'makanan'),
(2, 'minuman');
-- --------------------------------------------------------
--
-- Table structure for table `komentar`
--
CREATE TABLE IF NOT EXISTS `komentar` (
`id` int(11) NOT NULL,
`name` varchar(50) DEFAULT NULL,
`email` varchar(100) DEFAULT NULL,
`komentar` text
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `komentar`
--
INSERT INTO `komentar` (`id`, `name`, `email`, `komentar`) VALUES
(4, 'Marit', 'maritia@yahoo.com', 'kai ken\r\n'),
(5, 'Sule', 'Priktiew@gmail.com', 'bfhsfsbfsdf');
-- --------------------------------------------------------
--
-- Table structure for table `menu`
--
CREATE TABLE IF NOT EXISTS `menu` (
`id` int(11) NOT NULL,
`id_karyawan` int(11) DEFAULT NULL,
`nama` varbinary(64) DEFAULT NULL,
`harga` varchar(9) DEFAULT NULL,
`gambar` varbinary(64) DEFAULT NULL,
`deskripsi` varchar(32) DEFAULT NULL,
`id_kategori` int(11) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `menu`
--
INSERT INTO `menu` (`id`, `id_karyawan`, `nama`, `harga`, `gambar`, `deskripsi`, `id_kategori`) VALUES
(5, NULL, 0x4179616d2050656e796574, '23.000', 0x6179616d2070656e7965742e6a7067, 'Enak dan Gurih', NULL),
(6, NULL, 0x426562656b20476f72656e67, '20.000', 0x626562656b20676f72656e672e6a7067, 'Sedap', NULL),
(7, NULL, 0x4e61736920476f72656e67202b204179616d, '16.000', 0x6e61736920676f72656e67202b206179616d2e6a7067, 'Enak', NULL),
(8, NULL, 0x4461756e205562692054756d62756b, '10.000', 0x6461756e207562692074756d62756b2e6a7067, 'Sedap', NULL),
(9, NULL, 0x426968756e204b756168, '14.000', 0x626968756e206b7561682e6a7067, 'Enak bangetttt', NULL),
(10, NULL, 0x496e646f6d696520476f72656e67, '10.000', 0x696e646f6d696520676f72656e672e6a7067, 'Seleraku', NULL),
(11, NULL, 0x4966756d6965204b756168, '13.000', 0x6966756d6965206b7561682e6a7067, 'Ifumie Kuah ini kali', NULL),
(12, NULL, 0x4e617369204b756e696e67, '17.000', 0x6e617369206b756e696e672e6a7067, 'Enak lahhh', NULL),
(13, NULL, 0x4d69652041636568, '15.000', 0x6d696520616365682e6a7067, 'Enak ', NULL),
(14, NULL, 0x4e61736920476f72656e67204269617361, '16.000', 0x6e61736920676f72656e672062696173612e6a7067, 'Enak', NULL),
(15, NULL, 0x4e61736920476f72656e67205370657369616c, '16.000', 0x6e61736920676f72656e67207370657369616c2e6a7067, 'Enak', NULL),
(16, NULL, 0x506563656c204c656c65, '56.000', 0x706563656c206c656c652e6a7067, 'Enakkkk', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `pembayaran`
--
CREATE TABLE IF NOT EXISTS `pembayaran` (
`id` int(11) NOT NULL,
`id_user` int(11) DEFAULT NULL,
`total` varchar(10) DEFAULT NULL,
`status` varchar(32) DEFAULT NULL,
`gambar` varchar(64) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pembayaran`
--
INSERT INTO `pembayaran` (`id`, `id_user`, `total`, `status`, `gambar`) VALUES
(11, 5, '0', NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `pesanan`
--
CREATE TABLE IF NOT EXISTS `pesanan` (
`id` int(11) NOT NULL,
`id_user` int(11) NOT NULL,
`id_menu` int(11) NOT NULL,
`jumlah` int(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `role`
--
CREATE TABLE IF NOT EXISTS `role` (
`id` int(11) NOT NULL,
`nama` varchar(8) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `role`
--
INSERT INTO `role` (`id`, `nama`) VALUES
(1, 'karyawan'),
(2, 'member');
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL,
`first_name` varchar(64) DEFAULT NULL,
`last_name` varchar(64) DEFAULT NULL,
`email` varchar(64) DEFAULT NULL,
`username` varchar(32) DEFAULT NULL,
`password` varchar(32) DEFAULT NULL,
`id_role` varchar(10) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `first_name`, `last_name`, `email`, `username`, `password`, `id_role`) VALUES
(5, 'member', 'member', 'member@yahoo.com', 'member', 'member', '2'),
(6, 'karyawan', 'karyawan', 'karyawan@yahoo.com', 'karyawan', 'karyawan', '1');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `kategori`
--
ALTER TABLE `kategori`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `komentar`
--
ALTER TABLE `komentar`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `menu`
--
ALTER TABLE `menu`
ADD PRIMARY KEY (`id`), ADD KEY `id_karyawan` (`id_karyawan`), ADD KEY `id_kategori` (`id_kategori`);
--
-- Indexes for table `pembayaran`
--
ALTER TABLE `pembayaran`
ADD PRIMARY KEY (`id`), ADD KEY `id_user` (`id_user`);
--
-- Indexes for table `pesanan`
--
ALTER TABLE `pesanan`
ADD PRIMARY KEY (`id`), ADD KEY `id_user` (`id_user`), ADD KEY `pesanan_ibfk_2` (`id_menu`);
--
-- Indexes for table `role`
--
ALTER TABLE `role`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `kategori`
--
ALTER TABLE `kategori`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `komentar`
--
ALTER TABLE `komentar`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `menu`
--
ALTER TABLE `menu`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `pembayaran`
--
ALTER TABLE `pembayaran`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `pesanan`
--
ALTER TABLE `pesanan`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `role`
--
ALTER TABLE `role`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `menu`
--
ALTER TABLE `menu`
ADD CONSTRAINT `menu_ibfk_1` FOREIGN KEY (`id_karyawan`) REFERENCES `user` (`id`),
ADD CONSTRAINT `menu_ibfk_2` FOREIGN KEY (`id_kategori`) REFERENCES `kategori` (`id`);
--
-- Constraints for table `pembayaran`
--
ALTER TABLE `pembayaran`
ADD CONSTRAINT `pembayaran_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `user` (`id`);
--
-- Constraints for table `pesanan`
--
ALTER TABLE `pesanan`
ADD CONSTRAINT `pesanan_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `user` (`id`),
ADD CONSTRAINT `pesanan_ibfk_2` FOREIGN KEY (`id_menu`) REFERENCES `menu` (`id`);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<?php
$cari=$_GET['cari'];
header("location:index.php #menu?cari=$cari");
?>
\ No newline at end of file
<?php
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
$status = "accepted";
$id = $_GET['id'];
//die($gambar);
$sql = "UPDATE pembayaran SET status='$status' WHERE id=$id";
if ($database->query($sql) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $database->error;
}
redirect('index.php');
?>
\ No newline at end of file
<?php
$database = new mysqli('127.0.0.1', 'root', '', 'cafe_db');
\ No newline at end of file
$database = new mysqli('127.0.0.1', 'p1d3ti05', 'Fredrick8', 'p1d3ti05_cafedb');
\ No newline at end of file
This diff is collapsed. Click to expand it.
......@@ -204,9 +204,9 @@ INTRO CONTAINER
}
.top-title{
color: white;
font-family: 'Playball', cursive;
font-size: 120px;
font-weight: 400;
font-family: "Arial Black", Gadget, sans-serif;
font-size: 58px;
font-weight: 300;
}
.second-title {
font-weight: lighter;
......@@ -250,7 +250,7 @@ INTRO CONTAINER
border-bottom: 8px solid #fff;
}
.beer.background_content{
.profil.background_content{
background: url('../images/beer.jpg') no-repeat center center;
background-size: cover;
background-position: 70% 50%;
......
<?php
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Cafe Bunga Toba</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css" media="screen" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Playball' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style-portfolio.css">
<link rel="stylesheet" href="css/picto-foundry-food.css" />
<link rel="stylesheet" href="css/jquery-ui.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link rel="icon" href="favicon-1.ico" type="image/x-icon">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="row">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<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="index.php">Cafe BUNGA TOBA</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav main-nav clear navbar-right ">
<li><a class="navactive color_animation" href="index.php">WELCOME</a></li>
<?php
if (isset($_SESSION['isLogin']) && (get_session('role') == "member")) {
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="#menu">MENU</a></li>');
echo('<li><a class="color_animation" href="pesanan.php">PESANAN</a></li>');
echo('<li><a class="color_animation" href="upload_bukti.php">PEMBAYARAN</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (isset($_SESSION['isLogin']) && (get_session('role') == "karyawan" || get_session('role') == "admin")) {
echo('<li><a class="color_animation" href="tambah_menu.php">OLAH MENU</a></li>');
echo('<li><a class="color_animation" href="daftar_pesanan.php">DAFTAR PESANAN</a></li>');
echo('<li><a class="color_animation" href="list_komentar.php">DAFTAR KOMENTAR</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (!isset($_SESSION['isLogin'])) {
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="#menu">MENU</a></li>');
echo('<li><a class="color_animation" href="login.php">LOGIN</a></li>');
echo('<li><a class="color_animation" href="signup.php">SIGN UP</a></li>');
}
?>
</ul>
</div><!-- /.navbar-collapse -->
</div>
</div><!-- /.container-fluid -->
</nav>
<!-- ============ Daftar Pesanan ============= -->
<section id="daftarpesanan" class="description_content">
<div class="text-content container">
<div class="inner contact row">
<div class="contact-form">
<!-- Form -->
<table class="table table-bordered">
<thead>
<tr>
<th>Pembeli</th>
<th>Total Biaya Pembayaran</th>
<th>Status Pembayaran</th>
</tr>
</thead>
<tbody>
<?php
// $query = "SELECT * FROM pembayaran ";
$query = "SELECT user.first_name as nama, pembayaran.total as total,pembayaran.status as status , pembayaran.gambar as gambar, pembayaran.id as id FROM pembayaran INNER JOIN user ON pembayaran.id_user = user.id ";
$result_set = $conn->query($query);
if ($result_set != NULL) {
while ($row = $result_set->fetch_array()) {
if ($row['status'] != NULL) {
?>
<tr>
<td><?= $row['nama'] ?></td>
<td><?= $row['total'] ?></td>
<?php
if ($row['status'] != "accepted" && $row['status'] != NULL) {
echo '<td>'
. '<a href="view_bukti.php?id=' . $row['gambar'] . '"><button class="btn btn-success">View</button></a> '
. '<a href="confirm.php?id=' . $row['id'] . '"><button class="btn btn-success">Confirm</button></td></a>';
} else {
echo ' <td>' . $row['status'] . '</td> ';
}
?>
</tr>
<?php
}
}
} else {
echo 'ada belum memesan pesan sekarang juga<br><a href="menu.php">Pesan</a>';
}
?>
</tbody>
</table>
</div><!-- End Contact Form Area -->
</div><!-- End Inner -->
</div>
</section>
\ No newline at end of file
<?php
session_start();
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
$id = $_GET['id'];
// retrieve posted form data
mysqli_query($conn, "DELETE FROM menu WHERE id=$id");
mysqli_close($onn);
redirect('index.php');
?>
<?php
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Cafe Bunga Toba</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css" media="screen" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Playball' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/animate.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style-portfolio.css">
<link rel="stylesheet" href="css/picto-foundry-food.css" />
<link rel="stylesheet" href="css/jquery-ui.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link rel="icon" href="favicon-1.ico" type="image/x-icon">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<ul class="tp-hd-lft wow fadeInDown animated" data-wow-delay="0.5s"></ul>
<div class="row">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<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="index.php">Cafe BUNGA TOBA</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<ul class="tp-hd-lft wow fadeInDown animated" data-wow-delay="0.5s">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav main-nav clear navbar-right ">
<li><a class="navactive color_animation" href="index.php">WELCOME</a></li>
<?php
if (isset($_SESSION['isLogin']) && (get_session('role') == "member")) {
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="index.php #menu">MENU</a></li>');
echo('<li><a class="color_animation" href="pesanan.php">PESANAN</a></li>');
echo('<li><a class="color_animation" href="upload_bukti.php">PEMBAYARAN</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (isset($_SESSION['isLogin']) && (get_session('role') == "karyawan" || get_session('role') == "admin")) {
echo('<li><a class="color_animation" href="tambah_menu.php">OLAH MENU</a></li>');
echo('<li><a class="color_animation" href="daftar_pesanan.php">DAFTAR PESANAN</a></li>');
echo('<li><a class="color_animation" href="list_komentar.php">DAFTAR KOMENTAR</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (!isset($_SESSION['isLogin'])) {
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="#menu">MENU</a></li>');
echo('<li><a class="color_animation" href="login.php">LOGIN</a></li>');
echo('<li><a class="color_animation" href="signup.php">SIGN UP</a></li>');
}
?>
</ul>
</div><!-- /.navbar-collapse -->
</div>
</div><!-- /.container-fluid -->
</nav>
<div class="container">
<div class="row">
<br><br><br><br>
<h1><span class="glyphicon glyphicon-check" style="font-size: 50px;"></span>Picture Uploaded</h1>
<center><h2>Terima Kasih karena telah mengupload bukti pembayaran anda kepada kami,Silahkan untuk menunggu konfirmasi dari kami</h2>
<form id="contact-us" method="post" action="pesanan.php">
<center> <button type="submit" id="submit" name="submit" class="text-center form-btn form-btn">Klik Disini</button>
</form>
</div>
</div>
<?php
global $conn;
$conn = mysql_connect("localhost", "root", "");
$conn = mysqli_connect("localhost", "p1d3ti05", "Fredrick8");
if(!$conn){
die("database connect problem");
}
$db_use = mysql_select_db("cafe_db", $conn) or die ("select db problem!!");
$db_use = mysqli_select_db($conn,"p1d3ti05_cafedb") or die ("select db problem!!");
function execQ($strQ){
global $conn;
$res = mysql_query($strQ, $conn);
$res = mysqli_query( $conn, $strQ);
return $res;
}
......@@ -62,9 +62,9 @@ global $conn;
$resItem = execQ($strQ);
if(mysql_num_rows($resItem)!=0){
if(mysqli_num_rows($resItem)!=0){
$ret = array();
while($data = mysql_fetch_assoc($resItem)){
while($data = mysqli_fetch_assoc($resItem)){
array_push($ret, array(
'id' => $data['id'],
'name' => $data['name'],
......
......@@ -4,6 +4,6 @@ include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
$id = $_GET['id'];
mysql_query("DELETE FROM komentar WHERE id = '$id'");
mysqli_query($conn, "DELETE FROM komentar WHERE id = '$id'");
header('Location: list_komentar.php');
?>
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
......@@ -2,6 +2,7 @@
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
?>
<!DOCTYPE html>
<html>
......@@ -46,19 +47,21 @@ include_once 'connection/koneksi.php';
<li><a class="navactive color_animation" href="index.php">WELCOME</a></li>
<?php
if (isset($_SESSION['isLogin']) && (get_session('role') == "member")) {
echo('<li><a class="color_animation" href="#pricing">MENU</a></li>');
echo('<li><a class="color_animation" href="#pesanan">PESANAN</a></li>');
echo('<li><a class="color_animation" href="#pembayaran">Pembayaran</a></li>');
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="index.php #menu">MENU</a></li>');
echo('<li><a class="color_animation" href="pesanan.php">PESANAN</a></li>');
echo('<li><a class="color_animation" href="upload_bukti.php">PEMBAYARAN</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (isset($_SESSION['isLogin']) && (get_session('role') == "karyawan" || get_session('role') == "admin")) {
echo('<li><a class="color_animation" href="index.php #olahmenu">OLAH MENU</a></li>');
echo('<li><a class="color_animation" href="index.php #daftarpesanan">DAFTAR PESANAN</a></li>');
echo('<li><a class="color_animation" href="tambah_menu.php">OLAH MENU</a></li>');
echo('<li><a class="color_animation" href="daftar_pesanan.php">DAFTAR PESANAN</a></li>');
echo('<li><a class="color_animation" href="list_komentar.php">DAFTAR KOMENTAR</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (!isset($_SESSION['isLogin'])) {
echo('<li><a class="color_animation" href="#pricing">MENU</a></li>');
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="#menu">MENU</a></li>');
echo('<li><a class="color_animation" href="login.php">LOGIN</a></li>');
echo('<li><a class="color_animation" href="signup.php">SIGN UP</a></li>');
}
......@@ -71,12 +74,20 @@ include_once 'connection/koneksi.php';
</div>
</div><!-- /.container-fluid -->
</nav>
</ul>
</div><!-- /.navbar-collapse -->
</div>
</div><!-- /.container-fluid -->
</nav>
<div class="container-fluid">
<h2> Daftar Komentar </h2>
<hr/>
<?php
$komen = mysql_query("SELECT * FROM komentar");
while($q = mysql_fetch_array($komen)){
$komen = mysqli_query($conn,"SELECT * FROM komentar");
while($q = mysqli_fetch_array($komen)){
?>
<div class="col-md-6">
<div class="thumbnail">
......
......@@ -7,13 +7,17 @@ include_once 'connection/koneksi.php';
$username = $_POST["username"];
$password = $_POST["password"];
$res_set = mysqli_query($database, "select * from user where username='$username' and password='$password'");
$res_set = mysqli_query($conn, "select * from user where username='$username' and password='$password'");
$res = mysqli_fetch_array($res_set);
if ($res_set->num_rows < 1) {
redirect('login.php');
$_SESSION['error'] = TRUE;
} else {
set_session('role', $res["role"]);
$id = $res["id_role"];
$res_role = mysqli_query($conn, "select * from role where id =$id ");
$resRole = mysqli_fetch_array($res_role);
set_session('role', $resRole["nama"]);
set_session('id', $res["id"]);
set_session('first_name', $res["first_name"]);
......
index.file=index.php
url=http://localhost/Fredrick/restaurant/
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/C:/xampp/htdocs/Fredrick/restaurant/delete_menu.php</file>
<file>file:/C:/xampp/htdocs/Fredrick/restaurant/update_menu_process.php</file>
<file>file:/C:/xampp/htdocs/Fredrick/restaurant/index.php</file>
<file>file:/C:/xampp/htdocs/Fredrick/restaurant/logout.php</file>
<file>file:/C:/xampp/htdocs/Fredrick/restaurant/register.php</file>
<file>file:/C:/xampp/htdocs/Fredrick/restaurant/tambah_menu.php</file>
<file>file:/C:/xampp/htdocs/Fredrick/restaurant/pesan_barang.php</file>
<file>file:/C:/xampp/htdocs/Fredrick/restaurant/pesan_barang_process.php</file>
<file>file:/C:/xampp/htdocs/Fredrick/restaurant/update_menu.php</file>
<file>file:/C:/xampp/htdocs/Fredrick/restaurant/bayar.php</file>
<file>file:/C:/xampp/htdocs/Fredrick/restaurant/bayar_process.php</file>
<file>file:/C:/xampp/htdocs/Fredrick/restaurant/login_process.php</file>
</group>
</open-files>
</project-private>
include.path=${php.global.include.path}
php.version=PHP_70
source.encoding=UTF-8
src.dir=.
tags.asp=false
tags.short=false
web.root=.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>restaurant</name>
</data>
</configuration>
</project>
<?php
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Cafe Bunga Toba</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css" media="screen" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Playball' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style-portfolio.css">
<link rel="stylesheet" href="css/picto-foundry-food.css" />
<link rel="stylesheet" href="css/jquery-ui.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link rel="icon" href="favicon-1.ico" type="image/x-icon">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="row">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<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="index.php">Cafe BUNGA TOBA</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav main-nav clear navbar-right ">
<li><a class="navactive color_animation" href="index.php">WELCOME</a></li>
<?php
if (isset($_SESSION['isLogin']) && (get_session('role') == "member")) {
echo('<li><a class="color_animation" href="#pricing">MENU</a></li>');
echo('<li><a class="color_animation" href="pesanan.php">PESANAN</a></li>');
echo('<li><a class="color_animation" href="#pembayaran">Pembayaran</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (isset($_SESSION['isLogin']) && (get_session('role') == "karyawan" || get_session('role') == "admin")) {
echo('<li><a class="color_animation" href="tambah_menu.php">OLAH MENU</a></li>');
echo('<li><a class="color_animation" href="#daftarpesanan">DAFTAR PESANAN</a></li>');
echo('<li><a class="color_animation" href="list_komentar.php">DAFTAR KOMENTAR</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (!isset($_SESSION['isLogin'])) {
echo('<li><a class="color_animation" href="#pricing">MENU</a></li>');
echo('<li><a class="color_animation" href="login.php">LOGIN</a></li>');
echo('<li><a class="color_animation" href="signup.php">SIGN UP</a></li>');
}
?>
</ul>
</div><!-- /.navbar-collapse -->
</div>
</div><!-- /.container-fluid -->
</nav>
<body>
<br><br><br><br><br>
<?php
$id_barang = $_GET['id'];
$query = mysqli_query($conn, "SELECT * FROM menu WHERE id = '$id_barang'");
$row = mysqli_fetch_array($query);
?><!-- / header -->
<body>
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-6 col-xs-12">
<div class="row">
<div class="col-lg-8 col-md-6 col-xs-6">
<form method="post" action="pesan_barang_process.php?id=<?php echo $id_barang; ?>" id="comment_form">
<fieldset>
<h2><?php echo $row['nama'] ?></h2>
<div><img src="foto/<?php echo $row['gambar'] ?>" class="img-thumbnail" width="330" height="260"> </div>
<div class="col-lg-8 col-md-6 col-xs-6">
<label for="Jumlah">Jumlah Pemesanan: </label>
<input type="text" tabindex="1" size="22" value="" name="jumlah" class="form" />
<input type="submit" value="Pesan"/>
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
<div class="clear"></div>
</div>
</body>
<!-- footer -->
<?php
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
$id_barang = $_GET['id'];
$id_user = get_session('id');
$jumlah = $_POST['jumlah'];
$query = 'INSERT INTO pesanan( `id_user`, `id_menu`, `jumlah`) VALUES(?, ?, ?)';
//die($id_barang . $id_user . $jumlah);
$statement = $conn->prepare($query);
$statement->bind_param('iii', $id_user, $id_barang, $jumlah);
$statement->execute();
redirect('pesanan.php');
?>
\ No newline at end of file
<?php
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Cafe Bunga Toba</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css" media="screen" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Playball' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/animate.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style-portfolio.css">
<link rel="stylesheet" href="css/picto-foundry-food.css" />
<link rel="stylesheet" href="css/jquery-ui.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link rel="icon" href="favicon-1.ico" type="image/x-icon">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<ul class="tp-hd-lft wow fadeInDown animated" data-wow-delay="0.5s"></ul>
<div class="row">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<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="index.php">Cafe BUNGA TOBA</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<ul class="tp-hd-lft wow fadeInDown animated" data-wow-delay="0.5s">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav main-nav clear navbar-right ">
<li><a class="navactive color_animation" href="index.php">WELCOME</a></li>
<?php
if (isset($_SESSION['isLogin']) && (get_session('role') == "member")) {
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="index.php #menu">MENU</a></li>');
echo('<li><a class="color_animation" href="pesanan.php">PESANAN</a></li>');
echo('<li><a class="color_animation" href="upload_bukti.php">PEMBAYARAN</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (isset($_SESSION['isLogin']) && (get_session('role') == "karyawan" || get_session('role') == "admin")) {
echo('<li><a class="color_animation" href="tambah_menu.php">OLAH MENU</a></li>');
echo('<li><a class="color_animation" href="daftar_pesanan.php">DAFTAR PESANAN</a></li>');
echo('<li><a class="color_animation" href="list_komentar.php">DAFTAR KOMENTAR</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (!isset($_SESSION['isLogin'])) {
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="#menu">MENU</a></li>');
echo('<li><a class="color_animation" href="login.php">LOGIN</a></li>');
echo('<li><a class="color_animation" href="signup.php">SIGN UP</a></li>');
}
?>
</ul>
</div><!-- /.navbar-collapse -->
</div>
</div><!-- /.container-fluid -->
</nav>
<!-- ============ Pesanan ============= -->
<section id="pesanan" class="description_content">
<div class="text-content container">
<div class="inner contact row">
<div class="contact-form">
<a href = "bayar.php?id=<?= $row['id']?>"><button class="btn btn-success">Bayar</button></a><br><br>
<!-- Form -->
<table class="table table-bordered">
<thead>
<tr>
<th>Menu</th>
<th>Jumlah</th>
</tr>
</thead>
<tbody>
<?php
$id = get_session('id');
$query = "SELECT menu.nama as nama, pesanan.jumlah as jumlah FROM pesanan INNER JOIN menu ON pesanan.id_menu = menu.id ";
$result_set = $conn->query($query);
if ($result_set != NULL) {
while ($row = $result_set->fetch_array()) {
?>
<tr>
<td><?= $row['nama'] ?></td>
<td><?= $row['jumlah'] ?></td>
</tr>
<?php
}
} else {
echo 'ada belum memesan pesan sekarang juga<br><a href="menu.php">Pesan</a>';
}
?>
</tbody>
</table>
</div><!-- End Contact Form Area -->
</div><!-- End Inner -->
</div>
</section>
<br><br><br><br><br><br><br><br><br><br><br><br>
<!-- ============ Pembayaran ============= -->
<section id="pembayaran" class="description_content">
<div class="text-content container">
<div class="inner contact row">
<div class="contact-form">
<!-- Form -->
<table class="table table-bordered">
<thead>
<tr>
<th>Total Biaya Pembayaran</th>
<th>Status Pembayaran</th>
</tr>
</thead>
<tbody>
<?php
$id = get_session('id');
$query = "SELECT * FROM pembayaran where id_user = $id ";
$result_set = $conn->query($query);
if ($result_set != NULL) {
while ($row = $result_set->fetch_array()) {
?>
<tr>
<td><?= $row['total'] ?></td>
<?php
if ($row['status'] == NULL) {
echo '<td><a href="upload_bukti.php?id=' . $row['id'] . '"><button class="btn btn-success">Upload Bukti</button></td></a>';
} else {
echo ' <td>' . $row['status'] . '</td> ';
}
?>
</tr>
<?php
}
} else {
echo 'ada belum memesan pesan sekarang juga<br><a href="menu.php">Pesan</a>';
}
?>
</tbody>
</table>
</div><!-- End Contact Form Area -->
</div><!-- End Inner -->
</div>
</section>
<br><br><br><br><br><br><br><br><br><br><br><br>
<?php
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Cafe Bunga Toba</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css" media="screen" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Playball' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style-portfolio.css">
<link rel="stylesheet" href="css/picto-foundry-food.css" />
<link rel="stylesheet" href="css/jquery-ui.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link rel="icon" href="favicon-1.ico" type="image/x-icon">
<script src="js/jquery-3.1.1.min.js"></script>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="row">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<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="index.php">Cafe BUNGA TOBA</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav main-nav clear navbar-right ">
<li><a class="navactive color_animation" href="index.php">WELCOME</a></li>
<?php
if (isset($_SESSION['isLogin']) && (get_session('role') == "member")) {
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="index.php #menu">MENU</a></li>');
echo('<li><a class="color_animation" href="pesanan.php">PESANAN</a></li>');
echo('<li><a class="color_animation" href="upload_bukti.php">PEMBAYARAN</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (isset($_SESSION['isLogin']) && (get_session('role') == "karyawan" || get_session('role') == "admin")) {
echo('<li><a class="color_animation" href="tambah_menu.php">OLAH MENU</a></li>');
echo('<li><a class="color_animation" href="daftar_pesanan.php">DAFTAR PESANAN</a></li>');
echo('<li><a class="color_animation" href="list_komentar.php">DAFTAR KOMENTAR</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (!isset($_SESSION['isLogin'])) {
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="index.php #menu">MENU</a></li>');
echo('<li><a class="color_animation" href="login.php">LOGIN</a></li>');
echo('<li><a class="color_animation" href="signup.php">SIGN UP</a></li>');
}
?>
</ul>
</div><!-- /.navbar-collapse -->
</div>
</div><!-- /.container-fluid -->
</nav>
<br><br><br><br>
<div class="col-md-8 col-md-offset-2">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<!-- Carousel -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="images/1.jpg" alt="slider">
<div class="carousel-caption">
<h2>Cafe Bunga Toba</h2>
</div>
</div>
<div class="item">
<img src="images/2.JPG" alt="slider">
<div class="carousel-caption">
<h2>Cafe Bunga Toba</h2>
</div>
</div>
<div class="item">
<img src="images/3.JPG" alt="slider">
<div class="carousel-caption">
<h2>Cafe Bunga Toba</h2>
</div>
</div>
<div class="item">
<img src="images/4.JPG" alt="slider">
<div class="carousel-caption">
<h2>Cafe Bunga Toba</h2>
</div>
</div>
<div class="item">
<img src="images/5.JPG" alt="slider">
<div class="carousel-caption">
<h2>Cafe Bunga Toba</h2>
</div>
</div>
<div class="item">
<img src="images/6.JPG" alt="slider">
<div class="carousel-caption">
<h2>Cafe Bunga Toba</h2>
</div>
</div>
<div class="item">
<img src="images/7.JPG" alt="slider">
<div class="carousel-caption">
<h2>Cafe Bunga Toba</h2>
</div>
</div>
</div>
<!-- Prev and Next-->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
<div class="jumbotron">
<div class="container">
<h2 style="font-size: 65px;">Cafe Bunga Toba</h2>
<p>Cafe ini biasanya dikunjungi banyak oleh pelanggan pelanggan yang berasal dari daerah lokal ataupun daerah luar,seperti turis turis.
Cafe ini menyediakan banyak makanan dan minuman yang nikmat bagi para pelanggan yang ingin memesan dan membeli makanan dan minuman.
Cafe ini berlokasi di :<Br>
Jl.Pemandian No.2 Balige - Tobasa
TELP 21572
</p>
</div>
</div>
\ No newline at end of file
......@@ -19,7 +19,7 @@ $role = "member";
$query = 'INSERT INTO user( `first_name`, `last_name`, `email`,`username`,`password`,`role`) VALUES(?, ?, ?, ?, ?, ?)';
$statement = $database->prepare($query);
$statement = $conn->prepare($query);
$statement->bind_param('ssssss', $firstName, $lastName, $email, $username, $password, $role);
$statement->execute();
......
......@@ -2,6 +2,7 @@
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
?>
<!DOCTYPE html>
<html>
......@@ -46,18 +47,22 @@ include_once 'connection/koneksi.php';
<li><a class="navactive color_animation" href="index.php">WELCOME</a></li>
<?php
if (isset($_SESSION['isLogin']) && (get_session('role') == "member")) {
echo('<li><a class="color_animation" href="#pricing">MENU</a></li>');
echo('<li><a class="color_animation" href="#pesanan">PESANAN</a></li>');
echo('<li><a class="color_animation" href="#pembayaran">Pembayaran</a></li>');
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="index.php #menu">MENU</a></li>');
echo('<li><a class="color_animation" href="pesanan.php">PESANAN</a></li>');
echo('<li><a class="color_animation" href="upload_bukti.php">PEMBAYARAN</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (isset($_SESSION['isLogin']) && (get_session('role') == "karyawan" || get_session('role') == "admin")) {
echo('<li><a class="color_animation" href="#olahmenu">OLAH MENU</a></li>');
echo('<li><a class="color_animation" href="#daftarpesanan">DAFTAR PESANAN</a></li>');
echo('<li><a class="color_animation" href="tambah_menu.php">OLAH MENU</a></li>');
echo('<li><a class="color_animation" href="daftar_pesanan.php">DAFTAR PESANAN</a></li>');
echo('<li><a class="color_animation" href="list_komentar.php">DAFTAR KOMENTAR</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (!isset($_SESSION['isLogin'])) {
echo('<li><a class="color_animation active" href="login.php">LOGIN</a></li>');
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="#menu">MENU</a></li>');
echo('<li><a class="color_animation" href="login.php">LOGIN</a></li>');
echo('<li><a class="color_animation" href="signup.php">SIGN UP</a></li>');
}
?>
......
<?php
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
if (!empty($_FILES['uploaded_file'])) {
$path = "foto/";
$path = $path . basename($_FILES['uploaded_file']['name']);
if (move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {
echo "The file " . basename($_FILES['uploaded_file']['name']) .
" has been uploaded";
} else {
echo "There was an error uploading the file, please try again!";
}
}
$nama = $_POST['nama'];
$harga = $_POST['harga'];
$deskripsi = $_POST['deskripsi'];
$id_karyawan = $_POST['id'];
$gambar = basename($_FILES['uploaded_file']['name']);
$query = 'INSERT INTO menu( `id_karyawan`, `nama`, `harga`,`deskripsi`,`gambar`) VALUES(?, ?, ?, ?, ?)';
$kategori = $_POST['kategori'];
//die($kategori);
$statement = $conn->prepare($query);
$statement->bind_param('issss', $id_karyawan, $nama, $harga, $deskripsi, $gambar);
$statement->execute();
redirect('index.php');
?>
\ No newline at end of file
......@@ -5,9 +5,9 @@ include_once 'connection/koneksi.php';
$id = $_GET['id'];
//die($id);
$id_brg = mysql_real_escape_string($_GET['id']);
$det = mysql_query("select * from menu where id='$id_brg'")or die(mysql_error());
while ($d = mysql_fetch_array($det)) {
$id_brg = mysqli_real_escape_string($_GET['id']);
$det = mysqli_query($conn, "select * from menu where id='$id_brg'")or die(mysqli_error());
while ($d = mysqli_fetch_array($det)) {
?>
<!DOCTYPE html>
<html>
......@@ -33,10 +33,6 @@ while ($d = mysql_fetch_array($det)) {
<body>
<!-- ============ Tambah Menu ============= -->
<section id="tambahmenu" class="description_content">
......
......@@ -28,10 +28,10 @@ $gambar = basename($_FILES['uploaded_file']['name']);
$sql = "UPDATE menu SET nama='$nama', harga='$harga', deskripsi='$deskripsi', id_karyawan=$id_karyawan, gambar='$gambar' WHERE id=$id";
if ($database->query($sql) === TRUE) {
if ($conn->query($sql) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $database->error;
echo "Error updating record: " . $conn->error;
}
......
<?php
$id = $_GET['id'];
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Cafe Bunga Toba</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css" media="screen" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Playball' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style-portfolio.css">
<link rel="stylesheet" href="css/picto-foundry-food.css" />
<link rel="stylesheet" href="css/jquery-ui.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link rel="icon" href="favicon-1.ico" type="image/x-icon">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="row">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<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="index.php">Cafe BUNGA TOBA</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav main-nav clear navbar-right ">
<li><a class="navactive color_animation" href="index.php">WELCOME</a></li>
<?php
if (isset($_SESSION['isLogin']) && (get_session('role') == "member")) {
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="index.php #menu">MENU</a></li>');
echo('<li><a class="color_animation" href="pesanan.php">PESANAN</a></li>');
echo('<li><a class="color_animation" href="upload_bukti.php">PEMBAYARAN</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (isset($_SESSION['isLogin']) && (get_session('role') == "karyawan" || get_session('role') == "admin")) {
echo('<li><a class="color_animation" href="tambah_menu.php">OLAH MENU</a></li>');
echo('<li><a class="color_animation" href="daftar_pesanan.php">DAFTAR PESANAN</a></li>');
echo('<li><a class="color_animation" href="list_komentar.php">DAFTAR KOMENTAR</a></li>');
echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
}
if (!isset($_SESSION['isLogin'])) {
echo('<li><a class="color_animation" href="profil.php">PROFIL</a></li>');
echo('<li><a class="color_animation" href="#menu">MENU</a></li>');
echo('<li><a class="color_animation" href="login.php">LOGIN</a></li>');
echo('<li><a class="color_animation" href="signup.php">SIGN UP</a></li>');
}
?>
</ul>
</div><!-- /.navbar-collapse -->
</div>
</div><!-- /.container-fluid -->
</nav>
<fieldset>
<form id="contact-us" method="post" action="upload_bukti_process.php?id=<?= $id ?>" enctype="multipart/form-data">
<!-- Left Inputs -->
<br><br><br><br>
<div class="col-md-6">
<h1>Upload Bukti Pembayaran</h1>
<input type="file" name="uploaded_file" id="username" required="required" class="form" placeholder="Username" />
<br><br>
<button type="submit" id="submit" name="submit" class="text-center form-btn form-btn">Upload</button>
</form>
</fieldset>
\ No newline at end of file
......@@ -27,10 +27,10 @@ $id = $_GET['id'];
$sql = "UPDATE pembayaran SET status='$status',gambar='$gambar' WHERE id=$id";
if ($database->query($sql) === TRUE) {
if ($conn->query($sql) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $database->error;
echo "Error updating record: " . $conn->error;
}
redirect('index.php#pembayaran');
redirect('finish.php');
?>
\ No newline at end of file
<?php
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
$gambar = $_GET['id'];
?>
<img src="pembayaran/<?= $gambar ?>">
\ 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