<?php if (isset($_POST['simpan'])) { include_once "../class/tamu.php"; $obj = new tamu(); $tanggal = date("Y-m-d h:i:s"); if ($obj->addTamu($_POST['fnama'], $_POST['fno'], $_POST['femail'], $_POST['fusername'], $_POST['fpassword'], $tanggal)) { echo "<script>alert('input berhasil!');</script>"; header("location:tamu.php"); } else { echo "<script>alert('Gagal input!');</script>"; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>SB Admin 2 - Bootstrap Admin Theme</title> <!-- Bootstrap Core CSS --> <link href="../bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> <!-- MetisMenu CSS -->
<table class="table table-striped table-bordered table-hover" id="dataTables-example"> <thead> <tr> <th>No</th> <th>Nama Tamu</th> <th>Username</th> <th>No Telp</th> <th>Email</th> <th>Last seen</th> <th>Aksi</th> </tr> </thead> <tbody> <?php include_once "../class/tamu.php"; $obj = new tamu(); $no = 1; $i = 0; foreach ($obj->viewTamu() as $value) { extract($value); $i++; ?> <tr <?php if ($i % 2 == 0) { echo "class='odd gradeX'"; } else { echo "class='even gradeC'"; } ?> > <td class="center"><?php
</nav> <div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <h1 class="page-header">Tables</h1> </div> <!-- /.col-lg-12 --> </div> <!-- /.row --> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <?php include_once "../class/tamu.php"; $obj = new tamu(); $tampil = $obj->viewTamubyId($_GET['idtamu']); extract($tampil); ?> <div class="panel-heading"> Data Tamu Restoran<?php echo $nama; ?> <a class="btn btn-default" href="addtamu.php"> <i class="fa fa-plus fa-fw"></i>Tambah Tamu</a> </div> <div class="row"> <div class="col-lg-6"> <div class="panel panel-default"> <div class="panel-heading"> View </div>
<table class="table table-bordered table-hover table-striped"> <thead> <tr> <th>No</th> <th>Nama Resto</th> <th>Tanggal Booking</th> <th>Jam Booking</th> <th>Tempat</th> <th>Jumlah Orang</th> <th>Status</th> <th>Aksi</th> </tr> </thead> <tbody> <?php $obj = new tamu(); $data = $obj->viewTamubyId($_SESSION['username']); extract($data); $no = 1; if ($obj->cekBooking($id_tamu)) { foreach ($obj->viewBooking($id_tamu) as $value) { extract($value); ?> <tr> <td><?php echo $no++; ?> </td> <td><?php echo $id_member; ?>
<?php if (isset($_GET['idtamu'])) { include_once "../class/tamu.php"; $tanggal = date("Y-m-d h:i:s"); $obj = new tamu(); if (isset($_POST['edit'])) { if ($obj->editTamu($_POST['fnama'], $_POST['fno'], $_POST['femail'], $_POST['fusername'], $_POST['fpassword'], $tanggal, $_POST['fid_tamu']) == true) { echo "<script>alert('edit berhasil!'); document.location=('tamu.php');</script>"; } else { echo "<script>alert('Gagal input!');</script>"; } } else { $tampil = $obj->viewTamubyId($_GET['idtamu']); extract($tampil); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>SB Admin 2 - Bootstrap Admin Theme</title> <!-- Bootstrap Core CSS -->