tampilan index

parent 66152966
<?php
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html>
<head> <head>
<meta charset="UTF-8">
<title>Cafe Bunga Toba</title> <title>Cafe Bunga Toba</title>
<meta charset="utf-8"> <link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/reset.css" type="text/css" media="all"> <link rel="stylesheet" href="css/main.css" media="screen" type="text/css">
<link rel="stylesheet" href="css/layout.css" type="text/css" media="all"> <link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/style.css" type="text/css" media="all"> <link href='http://fonts.googleapis.com/css?family=Playball' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="js/jquery-1.6.js"></script> <link rel="stylesheet" href="css/bootstrap.css">
<script type="text/javascript" src="js/jquery.easing.1.3.js"></script> <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<script type="text/javascript" src="js/tms-0.3.js"></script>
<script type="text/javascript" src="js/tms_presets.js"></script> <link rel="stylesheet" href="css/style-portfolio.css">
<script type="text/javascript" src="js/script.js"></script> <link rel="stylesheet" href="css/picto-foundry-food.css" />
<!--[if lt IE 9]> <link rel="stylesheet" href="css/jquery-ui.css">
<script type="text/javascript" src="js/html5.js"></script> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">#menu a, .bg, .bg2, #ContactForm a {behavior:url("../js/PIE.htc")}</style> <link href="css/font-awesome.min.css" rel="stylesheet">
<![endif]--> <link rel="icon" href="favicon-1.ico" type="image/x-icon">
</head> </head>
<body id="page4">
<div class="body1"> <body>
<div class="main">
<!--header --> <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<?php <div class="container">
require_once(dirname(__FILE__) . '/common/header.php'); <div class="row">
?>
<body> <div class="navbar-header">
<div class="slider_bg"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<div class="slider"> <span class="sr-only">Toggle navigation</span>
<ul class="items"> <span class="icon-bar"></span>
<span class="icon-bar"></span>
<li><img src="images/img0.jpg" alt=""></li> <span class="icon-bar"></span>
<li><img src="images/img1,2.jpg" alt=""></li> </button>
<li><img src="images/h12.jpg" alt="" ></li> <a class="navbar-brand" href="#">Cafe Bunga Toba</a>
</ul>
</div>
</div> </div>
</header>
<!-- / header --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<!-- content --> <ul class="nav navbar-nav main-nav clear navbar-right ">
<article id="content"> <li><a class="navactive color_animation" href="#top">WELCOME</a></li>
<div class="wrapper"> <?php
<h2>CAFE Bunga Toba</h2> if (isset($_SESSION['isLogin']) && (get_session('role') == "member")) {
</div> echo('<li><a class="color_animation" href="#pricing">MENU</a></li>');
</article> echo('<li><a class="color_animation" href="#pesanan">PESANAN</a></li>');
</div> echo('<li><a class="color_animation" href="#pembayaran">Pembayaran</a></li>');
</div> echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
<div class="body2"> }
<div class="main"> if (isset($_SESSION['isLogin']) && (get_session('role') == "karyawan" || get_session('role') == "admin")) {
<article id="content2"> echo('<li><a class="color_animation" href="#olahmenu">OLAH MENU</a></li>');
<div class="wrapper"> echo('<li><a class="color_animation" href="#pricing">DAFTAR PESANAN</a></li>');
<section class="col2"> echo('<li><a class="color_animation" href="logout.php">LOGOUT (' . get_session('first_name') . ')</a></li>');
<h2>We will serve you <span> for the BEST</span></h2> }
<div class="testimonials"> if (!isset($_SESSION['isLogin'])) {
<p class="quot">Let's Come and Enjoy the Original Indonesian delicacy in Our Cafe, CAFE BUNGA TOBA.<img src="images/quot2.png" alt=""></p> echo('<li><a class="color_animation" href="#pricing">MENU</a></li>');
</div> echo('<li><a class="color_animation" href="#login">LOGIN</a></li>');
echo('<li><a class="color_animation" href="#signup">SIGN UP</a></li>');
<section class="col3 pad_left2"> }
<h2>Our Menu</h2> ?>
<div class="wrapper pad_top1">
<figure class="left marg_right1"><img src="images/page1_img.jpg" alt=""></figure>
<p><span class="font1 color2">Breakfast</span><br>
Makanan yang biasanya dijadwalkan untuk sarapan. &nbsp; <a href="menu.php" class="link1">Read More</a> </p> </ul>
</div>
<div class="wrapper">
<figure class="left marg_right1"><img src="images/page1_img2.jpg" alt=""></figure>
<p><span class="font1 color2">Lunch</span><br>
Menu yang biasanya dijadwalkan untuk makan siang &nbsp; <a href="menu.php" class="link1">Read More</a> </p>
</div>
<div class="wrapper">
<figure class="left marg_right1"><img src="images/page1_img3.jpg" alt=""></figure>
<p><span class="font1 color2">Dinner</span><br>
Menu yang biasanya dijadwalkan untuk makan siang &nbsp; <a href="menu.php" class="link1">Read More</a> </p>
</div>
</section>
</div> </div>
</article> </div>
<!-- / content --> </div>
</nav>
<div id="top" class="starter_container bg">
<div class="follow_container">
<div class="col-md-6 col-md-offset-3">
<h2 class="top-title"> Cafe Bunga Toba</h2>
<h2 class="white second-title">" Best in the Balige "</h2>
<hr>
</div>
</div> </div>
</div> </div>
<?php
require_once(dirname(__FILE__) . '/common/footer.php');
<section id ="pricing" class="description_content">
<div class="pricing background_content">
<h1>Daftar Menu</h1>
</div>
<div class="text-content container">
<div class="container">
<div class="row">
<div id="w">
<ul>
<div class="col-lg-12">
<?php
$query = "SELECT * FROM menu";
$result_set = $database->query($query);
while ($row = $result_set->fetch_assoc()) {
?>
<div class="col-lg-3">
<li class="item breakfast">
<img src="foto/<?= $row['gambar'] ?>" class="img-responsive">
<h2 class="white">Rp. <?php echo $row['harga']; ?></h2>
<a href="pesan_barang.php?id=<?= $row['id'] ?>">
<button class="text-center btn-block form-btn">Pesan</button>
</a>
</li>
</div>
<?php }
?>
</div>
</ul>
</div>
</div>
</div>
</div>
</section>
<br><br><br><br><br><br><br><br><br><br><br><br>
<?php if (!isset($_SESSION['isLogin'])) { ?>
<!-- ============ Signup ============= -->
<section id="signup" class="description_content">
<div class="text-content container">
<div class="inner contact">
<!-- Form Area -->
<div class="contact-form">
<!-- Form -->
<form id="contact-us" method="post" action="register.php">
<!-- Left Inputs -->
<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">
<!-- Name -->
<input type="text" name="first_name" id="first_name" required="required" class="form" placeholder="First Name" />
<input type="text" name="last_name" id="last_name" required="required" class="form" placeholder="Last Name" />
<input type="email" name="email" id="email" required="required" class="form" placeholder="Email" />
<input type="text" name="username" id="username" required="required" class="form" placeholder="Username" />
<input type="password" name="password" id="password" required="required" class="form" placeholder="Password" />
</div>
<div class="col-xs-6 ">
<!-- Send Button -->
<button type="submit" id="submit" name="submit" class="text-center form-btn form-btn">Register</button>
</div>
</div>
</div>
</div>
</div>
<div class="clear"></div>
</form>
</div><!-- End Contact Form Area -->
</div>
</div>
</section>
<!-- ============ Login ============= -->
<section id="login" class="description_content">
<div class="text-content container">
<div class="inner contact">
<!-- Form Area -->
<div class="contact-form">
<!-- Form -->
<form id="contact-us" method="post" action="login_process.php">
<!-- Left Inputs -->
<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">
<!-- Name -->
<input type="text" name="username" id="username" required="required" class="form" placeholder="Username" />
<input type="password" name="password" id="password" required="required" class="form" placeholder="Password" />
</div>
<div class="col-xs-6 ">
<!-- Send Button -->
<button type="submit" id="submit" name="submit" class="text-center form-btn form-btn">Login</button>
</div>
</div>
</div>
</div>
</div>
<div class="clear"></div>
</form>
</div><!-- End Contact Form Area -->
</div><!-- End Inner -->
</div>
</section>
<br><br><br><br><br><br><br><br><br><br><br><br>
<?php } else {
?>
<?php if (get_session('role') == "karyawan") { ?>
<!-- ============ Olah Menu ============= -->
<section id="olahmenu" class="description_content">
<div class="text-content container">
<div class="inner contact row">
<div class="contact-form">
<!-- Form -->
<table class="table table-bordered">
<a class="color_animation" href="#tambahmenu"><button type="button" class="btn btn-success">Tambah Menu</button></a>
<br>
<br>
<thead>
<tr>
<th>Nama Menu</th>
<th>Olah</th>
</tr>
</thead>
<tbody>
<?php
$id = get_session('id');
$query = "SELECT * FROM menu ";
$result_set = $database->query($query);
if ($result_set != NULL) {
while ($row = $result_set->fetch_array()) {
?>
<tr>
<td><?= $row['nama'] ?></td>
<td>
<a href="update_menu.php?id=<?= $row['id'] ?>"><button type="button" class="btn btn-success">Update</button></a>
<a href="delete_menu.php?id=<?= $row['id'] ?>"><button type="button" class="btn btn-danger">Delete</button></a>
</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>
<!-- ============ Tambah Menu ============= -->
<section id="tambahmenu" class="description_content">
<div class="text-content container">
<div class="inner contact">
<!-- Form Area -->
<div class="contact-form">
<form id="contact-us" method="post" action="tambah_menu.php" enctype="multipart/form-data">
<!-- Left Inputs -->
<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">
<!-- Name -->
<input type="text" name="nama" id="first_name" required="required" class="form" placeholder="Nama Menu" />
<input type="text" name="harga" id="last_name" required="required" class="form" placeholder="Harga" />
<textarea name="deskripsi" id="message" class="form textarea" placeholder="Deskripsi"></textarea>
<input type="file" name="uploaded_file" id="username" required="required" class="form" placeholder="Username" />
</div>
<div class="col-xs-6 ">
<!-- Send Button -->
<button type="submit" id="submit" name="submit" class="text-center form-btn form-btn">Tambah</button>
</div>
</div>
</div>
</div>
</div>
<!-- Clear -->
<div class="clear"></div>
</form>
</div><!-- End Contact Form Area -->
</div><!-- End Inner -->
</div>
</section>
<?php } ?>
<!-- ============ Pesanan ============= -->
<section id="pesanan" 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>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 = $database->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>
<a href = "bayar.php"><button class="btn btn-success">Bayar</button></a>
</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 = $database->query($query);
if ($result_set != NULL) {
while ($row = $result_set->fetch_array()) {
?>
<tr>
<td><?= $row['total'] ?></td>
<?php
if ($row['status'] == NULL) {
echo '<td><button class="btn btn-success">Upload Bukti</button></td>';
} 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 }
?> ?>
<!-- ============ Footer Section ============= -->
<br>
<footer class="sub_footer">
<div class="container">
<div class="col-md-4"><p class="sub-footer-text text-center">&copy; Cafe Bunga Toba, Design by <a href="#">PA1-1617-D3TI05</a></p></div>
<div class="col-md-4"><p class="sub-footer-text text-center">Back to <a href="#top">TOP</a></p></div>
</div>
</footer>
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js" ></script>
<script type="text/javascript" src="js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="js/jquery.mixitup.min.js" ></script>
<script type="text/javascript" src="js/main.js" ></script>
</body> </body>
</html> </html>
\ 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