tambah_menu.php 9.95 KB
Newer Older
1 2 3 4 5
<?php
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';

6 7 8
?> 
<!DOCTYPE html>
<html>
9

10 11 12 13 14 15 16 17 18
    <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">
19

20 21 22 23 24 25 26
        <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>
27

28
    <body>
29

30 31 32 33 34 35 36 37 38 39 40 41 42
        <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>
43

44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
                    <!-- 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>');
                            }
                            ?> 
69 70


71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101

                        </ul>
                    </div><!-- /.navbar-collapse -->
                </div>
            </div><!-- /.container-fluid -->
        </nav>
 <!-- ============ 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 ";
102
                                        $result_set = $conn->query($query);
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
                                        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="tambahmenu_process.php" enctype="multipart/form-data">
                                    <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 -->
                                                            <!-- Left Inputs -->
                                                        <h2>Tambah Menu</h2>
                                                        <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" />
                                                        <select name="kategori" class="form" placeholder="Kategori">
                                                        <option value=1>Makanan</option>
                                                        <option value=2>Minuman</option>
                                                </select>

                                                    </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>
       
176