Commit 9f7a304b by Andry F. Hutapea
parents 6e612877 c57ef439
<link href="css/animate1.css" rel='stylesheet' type='text/css' />
<ul class="tp-hd-lft wow fadeInDown animated" data-wow-delay="0.5s">
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="tiket"; // Database name
$tbl_name="fapply"; // Table name
// Connect to server and select databse.
$conn = mysqli_connect("$host", "$username", "$password")or die("cannot connect");
mysqli_select_db($conn,"$db_name")or die("cannot select DB");
// Get value of id that sent from hidden field
$id=$_GET['id'];
// Find highest answer number.
$sql="SELECT MAX(a_id) AS Maxa_id FROM $tbl_name WHERE question_id='$id'";
$result=mysqli_query($conn,$sql);
$rows=mysqli_fetch_array($result);
// add + 1 to highest answer number and keep it in variable name "$Max_id". if there no answer yet set it = 1
if ($rows) {
$Max_id = $rows['Maxa_id']+1;
}
else {
$Max_id = 1;
}
// get values that sent from form
$a_name=$_POST['a_name'];
$a_email=$_POST['a_email'];
$a_answer=$_POST['a_answer'];
$datetime=date("d/m/y H:i:s"); // create date and time
// Insert answer
$sql2="INSERT INTO fapply(question_id, a_id, a_name, a_email, a_answer, a_datetime)VALUES('$id', '$Max_id', '$a_name', '$a_email', '$a_answer', '$datetime')";
$result2=mysqli_query($conn,$sql2);
if($result2){
echo "Successful<BR>";
echo "<a href='view_pemesanan.php?id=".$id."'>View your answer</a>";
// If added new answer, add value +1 in reply column
$tbl_name2="fpemesanan";
$sql3="UPDATE $tbl_name2 SET reply='$Max_id' WHERE id='$id'";
$result3=mysqli_query($conn,$sql3);
}
else {
echo $result2;
echo $id."<br>";
echo $a_name."<br>";
echo $a_email."<br>";
echo $a_answer."<br>";
echo $Max_id."<br>";
echo "ERROR";
}
// Close connection
//mysql_close();
?>
</ul>
\ No newline at end of file
<!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>TB SILALAHI CENTER</title>
<!-- Bootstrap Core CSS/dipake -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- MetisMenu CSS -->
<link href="vendor/metisMenu/metisMenu.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="dist/css/sb-admin-2.css" rel="stylesheet">
<link href="css/animate1.css" rel='stylesheet' type='text/css' />
<!-- Custom Fonts -->
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-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="admin.php">Halaman Admin</a>
</div>
<!-- /.navbar-header -->
<ul class="nav navbar-top-links navbar-right">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="../login.php"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
</li>
</ul>
<!-- /.dropdown-user -->
</li>
<!-- /.dropdown -->
</ul>
<!-- /.navbar-top-links -->
<div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav navbar-collapse">
<ul class="nav" id="side-menu">
<li>
<a href="admin.php"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="main_forum.php"></i><i class="fa fa-sign-out fa-fw"></i>Daftar Komentar</a>
</li>
<li>
<a href="koleksi.php"></i><i class="fa fa-sign-out fa-fw"></i>Daftar koleksi</a>
</li>
<li>
<a href="apply_tiket.php"></i><i class="fa fa-sign-out fa-fw"></i>Daftar Pemesan</a>
</li>
</ul>
</div>
<!-- /.sidebar-collapse -->
</div>
<!-- /.navbar-static-side -->
</nav>
<ul class="tp-hd-lft wow fadeInDown animated" data-wow-delay="0.5s">
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Halaman Admin TB SILALAHI CENTER</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<div>
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="tbc"; // Database name
$tbl_name="fpemesanan"; // Table name
// Connect to server and select databse.
$conn = mysqli_connect("$host", "$username", "$password")or die("cannot connect");
mysqli_select_db($conn,"$db_name")or die("cannot select DB");
$sql="SELECT * FROM $tbl_name ORDER BY id DESC";
// OREDER BY id DESC is order result by descending
$result=mysqli_query($conn,$sql);
$no=0;
?>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="10%" align="center" bgcolor="#E6E6E6"><strong>No</strong></td>
<td width="10%" align="center" bgcolor="#E6E6E6"><strong>Jumlah Pesanan</strong></td>
<td width="15%" align="center" bgcolor="#E6E6E6"><strong>Nama Pemesan</strong></td>
<td width="15%" align="center" bgcolor="#E6E6E6"><strong>Kategori</strong></td>
<td width="13%" align="center" bgcolor="#E6E6E6"><strong>Replies</strong></td>
<td width="13%" align="center" bgcolor="#E6E6E6"><strong>Date/Time</strong></td>
</tr>
<?php
// Start looping table row
while($rows = mysqli_fetch_array($result)){
?>
<tr>
<td align="center" bgcolor="#FFFFFF"><?php echo ++$no;; ?></td>
<td align="center" bgcolor="#FFFFFF"><a href="tiket_admin.php?id=<?php echo $rows['id']; ?>"><?php echo $rows['topic']; ?></a><BR></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $rows['name']; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $rows['detail']; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $rows['reply']; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $rows['datetime']; ?></td>
</tr>
<?php
// Exit looping and close connection
}
//mysql_close();
?>
</table>
</div>
</div>
</div>
<!-- /#wrapper -->
<!-- jQuery -->
<script src="vendor/jquery/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!-- Metis Menu Plugin JavaScript -->
<script src="vendor/metisMenu/metisMenu.min.js"></script>
</BR>
</ul>
</body>
</html>
......@@ -12,6 +12,7 @@ open_page('booking');
<link href="css/metro-bootstrap-responsive.css" rel="stylesheet">
<link href="css/iconFont.css" rel="stylesheet">
<link href="css/docs.css" rel="stylesheet">
<link href="css/animate1.css" rel="stylesheet" type="text/css">
<!-- Load JavaScript Libraries -->
......@@ -43,36 +44,74 @@ open_page('booking');
.submitbtn{font-size:1.5em;display:inline-block;padding:10px;border:1px solid #ddd;background:#eee;color:#000;text-decoration:none;margin:0.5em 0 0 8em;};
</style>
<title>Booking Paket</title>
<title>Pesan tiket</title>
</head>
<ul class="tp-hd-lft wow fadeInDown animated" data-wow-delay="0.5s">
<body class="metro">
<ul class="tp-hd-lft wow fadeInDown animated" data-wow-delay="0.5s">
<header class="bg-darkCobalt" data-load="atasan.php"></header>
<div id="wrapshopcart">
<div class="col-md-6">
<h1>Form Pemesanan Tiket</h1>
<p>Silakan lengkapi form di bawah ini untuk melakukan pemesanan tiket: </p>
<form action="bookingprocess.php" method="POST">
<label>Nama Lengkap : </label><input type="text" name="nama"/><br />
<label>Alamat : </label><input type="text" name="alamat"/><br />
<label>Email : </label><input type="text" name="email" /><br />
<label>Kategori Tiket</label>
<select name="kategori_tiket">
<option value="Pilih kategori">---Pilih Kategori---
<option value="DEWASA">DEWASA
<option value="ANAK-ANAK">ANAK-ANAK
</select><br />
<label>Jumlah Tiket</label><input type="number" name="jumlah_tiket"><br />
<label>Jadwal Kunjungan : </label>
<input type="date" name="jadwal_berkunjung" placeholder="Date" onfocus="(this.type='date')" ></input><br />
<input type="submit" name="action" value="Pesan"> </form>
</div>
</div>
<footer class="dark" data-load="bawahan.html"></footer>
</body>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form id="form1" name="form1" method="post" action="berita_pemesanan.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3" bgcolor="#E6E6E6"><strong>Pemesanan Tiket</strong> </td>
<td colspan="3" bgcolor="#E6E6E6"> <a href="pemesanan_tiket.php"><strong>Daftar Pesanan</strong> </td>
</tr>
<tr>
<td width="14%"><strong>Jummlah Tiket</strong></td>
<td width="2%">:</td>
<td width="84%"><input name="topic" type="text" id="topic" size="50" /></td>
</tr>
<tr>
<td valign="top"><strong>Kategori</strong></td>
<td valign="top">:</td>
<td><textarea name="detail" cols="50" rows="3" id="detail"></textarea></td>
</tr>
<tr>
<td><strong>Name</strong></td>
<td>:</td>
<td><input name="name" type="text" id="name" size="50" /></td>
</tr>
<tr>
<td><strong>Email</strong></td>
<td>:</td>
<td><input name="email" type="text" id="email" size="50" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><input type="submit" name="Submit" value="Submit" />
<input type="reset" name="Submit2" value="Reset" /></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
</body>
</html>
<br><br>
</div>
<footer class="dark" data-load="bawahan.php"></footer>
</html>
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="tbc"; // Database name
$tbl_name="fpemesanan"; // Table name
// Connect to server and select databse.
$conn = mysqli_connect("$host", "$username", "$password")or die("cannot connect");
mysqli_select_db($conn,"$db_name")or die("cannot select DB");
$sql="SELECT * FROM $tbl_name ORDER BY id DESC";
// OREDER BY id DESC is order result by descending
$result=mysqli_query($conn,$sql);
$no=0;
?>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="10%" align="center" bgcolor="#E6E6E6"><strong>No</strong></td>
<td width="10%" align="center" bgcolor="#E6E6E6"><strong>Jumlah Pesanan</strong></td>
<td width="15%" align="center" bgcolor="#E6E6E6"><strong>Nama Pemesan</strong></td>
<td width="15%" align="center" bgcolor="#E6E6E6"><strong>Kategori</strong></td>
<td width="13%" align="center" bgcolor="#E6E6E6"><strong>Replies</strong></td>
<td width="13%" align="center" bgcolor="#E6E6E6"><strong>Date/Time</strong></td>
</tr>
<?php
// Start looping table row
while($rows = mysqli_fetch_array($result)){
?>
<tr>
<td align="center" bgcolor="#FFFFFF"><?php echo ++$no;; ?></td>
<td align="center" bgcolor="#FFFFFF"><a href="view_pemesanan.php?id=<?php echo $rows['id']; ?>"><?php echo $rows['topic']; ?></a><BR></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $rows['name']; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $rows['detail']; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $rows['reply']; ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $rows['datetime']; ?></td>
</tr>
<?php
// Exit looping and close connection
}
//mysql_close();
?>
<tr>
<td colspan="5" align="right" bgcolor="#E6E6E6"><a href="booking.php"><strong>Pesan Tiket</strong> </a></td>
</tr>
</table>
<?php
session_start();
include_once('config/koneksi.php');
open_page('booking');
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/metro-bootstrap.css" rel="stylesheet">
<link href="css/metro-bootstrap-responsive.css" rel="stylesheet">
<link href="css/iconFont.css" rel="stylesheet">
<link href="css/docs.css" rel="stylesheet">
<link href="css/animate1.css" rel="stylesheet" type="text/css">
<!-- Load JavaScript Libraries -->
<script src="js/jquery/jquery.min.js"></script>
<script src="js/jquery/jquery.widget.min.js"></script>
<script src="js/jquery/jquery.mousewheel.js"></script>
<!-- Metro UI CSS JavaScript plugins -->
<script src="js/load-metro.js"></script>
<!-- Local JavaScript -->
<script src="js/docs.js"></script>
<style type="text/css">
body{background:#efefef;font-family:arial;}
#wrapshopcart{width:70%;margin:3em auto;padding:30px;background:#fff;box-shadow:0 0 15px #ddd;}
h1{margin:0;padding:0;font-size:2.5em;font-weight:bold;}
p{font-size:1em;margin:0;}
table{margin:2em 0 0 0; border:1px solid #eee;width:100%; border-collapse: separate;border-spacing:0;}
table th{background:#fafafa; border:none; padding:20px ; font-weight:normal;text-align:left;}
table td{background:#fff; border:none; padding:12px 20px; font-weight:normal;text-align:left; border-top:1px solid #eee;}
table tr.total td{font-size:1.5em;}
.btnsubmit{display:inline-block;padding:10px;border:1px solid #ddd;background:#eee;color:#000;text-decoration:none;margin:2em 0;}
form{margin:2em 0 0 0;}
label{display:inline-block;width:12em;}
input[type=text]{border:1px solid #bbb;padding:10px;width:30em;}
textarea{border:1px solid #bbb;padding:10px;width:30em;height:5em;vertical-align:text-top;margin:0.3em 0 0 0;}
.submitbtn{font-size:1.5em;display:inline-block;padding:10px;border:1px solid #ddd;background:#eee;color:#000;text-decoration:none;margin:0.5em 0 0 8em;};
</style>
<title>Pesan tiket</title>
</head>
<ul class="tp-hd-lft wow fadeInDown animated" data-wow-delay="0.5s">
<body class="metro">
<header class="bg-darkCobalt" data-load="atasan.php"></header>
</body>
<?php
require_once(dirname(__FILE__).'/daftar_pesanan.php');
?>
<br>
</div>
<footer class="dark" data-load="bawahan.php"></footer>
</html>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form id="form1" name="form1" method="post" action="berita_pemesanan.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3" bgcolor="#E6E6E6"><strong>Pemesanan Tiket</strong> </td>
</tr>
<tr>
<td width="14%"><strong>Jumlah Tiket</strong></td>
<td width="2%">:</td>
<td width="84%"><input name="topic" type="text" id="topic" size="50" /></td>
</tr>
<tr>
<td valign="top"><strong>Kategori</strong></td>
<td valign="top">:</td>
<td><textarea name="detail" cols="50" rows="3" id="detail"></textarea></td>
</tr>
<tr>
<td><strong>Name</strong></td>
<td>:</td>
<td><input name="name" type="text" id="name" size="50" /></td>
</tr>
<tr>
<td><strong>Email</strong></td>
<td>:</td>
<td><input name="email" type="text" id="email" size="50" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><input type="submit" name="Submit" value="Submit" />
<input type="reset" name="Submit2" value="Reset" /></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
</body>
</html>
\ No newline at end of file
<!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>TB SILALAHI CENTER</title>
<!-- Bootstrap Core CSS/dipake -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- MetisMenu CSS -->
<link href="vendor/metisMenu/metisMenu.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="dist/css/sb-admin-2.css" rel="stylesheet">
<link href="css/animate1.css" rel='stylesheet' type='text/css' />
<!-- Custom Fonts -->
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-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="admin.php">Halaman Admin</a>
</div>
<!-- /.navbar-header -->
<ul class="nav navbar-top-links navbar-right">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="login.php"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
</li>
</ul>
<!-- /.dropdown-user -->
</li>
<!-- /.dropdown -->
</ul>
<!-- /.navbar-top-links -->
<div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav navbar-collapse">
<ul class="nav" id="side-menu">
<li>
<a href="admin.php"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="main_forum.php"></i><i class="fa fa-sign-out fa-fw"></i>Daftar Komentar</a>
</li>
<li>
<a href="koleksi.php"></i><i class="fa fa-sign-out fa-fw"></i>Daftar koleksi</a>
</li>
<li>
<a href="apply_tiket.php"></i><i class="fa fa-sign-out fa-fw"></i>Daftar Pemesan</a>
</li>
</ul>
</div>
<!-- /.sidebar-collapse -->
</div>
<!-- /.navbar-static-side -->
</nav>
<ul class="tp-hd-lft wow fadeInDown animated" data-wow-delay="0.5s">
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Halaman Admin TB SILALAHI CENTER</h1>
</div>
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="tiket"; // Database name
$tbl_name="fpemesanan"; // Table name
// Connect to server and select databse.
$conn = mysqli_connect("$host", "$username", "$password")or die("cannot connect");
mysqli_select_db($conn,"$db_name")or die("cannot select DB");
// get value of id that sent from address bar
$id=$_GET['id'];
$sql="SELECT * FROM $tbl_name WHERE id='$id'";
$result=mysqli_query($conn,$sql);
$rows=mysqli_fetch_array($result);
?>
<center><h1>Apply Tiket</h1></center>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td><table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolor="1" bgcolor="#ffffff">
<tr>
<td colspan="4" bgcolor="#ffffff"><strong><?php echo $rows['topic']; ?></strong></td>
</tr>
<tr>
<td colspan="4" bgcolor="#ffffff"><?php echo $rows['detail']; ?></td>
</tr>
<tr>
</tr>
<tr>
</tr>
</td>
</tr>
</table>
<BR>
<?php
$tbl_name2="fapply"; // Switch to table "forum_answer"
$sql2="SELECT * FROM $tbl_name2 WHERE question_id='$id'";
$result2=mysqli_query($conn,$sql2);
while($rows=mysqli_fetch_array($result2)){
?>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#F8F7F1">
<tr>
<td width="77%" bgcolor="#F8F7F1" colspan="3"><strong>Name : </strong><?php echo $rows['a_name']; ?><br><strong>Email : </strong><?php echo $rows['a_email']; ?></td>
</tr>
<tr>
<td bgcolor="#F8F7F1" colspan="3"></td>
</tr>
<tr>
<td bgcolor="#F8F7F1" colspan="3"><strong>Berita Tiket : </strong><br><?php echo $rows['a_answer']; ?></td>
</tr>
<tr>
<td bgcolor="#F8F7F1" colspan="3" style="text-align: right"><?php echo $rows['a_datetime']; ?></td>
</tr>
</td>
</tr>
</table><br>
<?php
}
$sql3="SELECT view FROM $tbl_name WHERE id='$id'";
$result3=mysqli_query($conn,$sql3);
$rows=mysqli_fetch_array($result3);
$view=$rows['view'];
// if have no counter value set counter = 1
if(empty($view)){
$view=1;
$sql4="INSERT INTO $tbl_name(view) VALUES('$view') WHERE id='$id'";
$result4=mysqli_query($conn,$sql4);
}
// count more value
$addview=$view+1;
$sql5="update $tbl_name set view='$addview' WHERE id='$id'";
$result5=mysqli_query($conn,$sql5);
?>
<BR>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="add_apply.php?<?php echo 'id='.$id; ?>">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="2" width="18%"><strong>Name</strong></td>
</tr>
<tr>
<td colspan="2" width="79%"><input name="a_name" type="text" id="a_name" size="45"></td>
</tr>
</tr>
<tr>
<td colspan="2"><strong>Email</strong></td>
</tr>
<tr>
<td colspan="2"><input name="a_email" type="text" id="a_email" size="45"></td>
</tr>
</tr>
<tr>
<td colspan="2" valign="top"><strong>Answer</strong></td>
</tr>
<tr>
<td colspan="2"><textarea name="a_answer" cols="47" rows="3" id="a_answer"></textarea></td>
</tr>
</tr>
<tr>
<td><input name="id" type="hidden" value="<?php echo $id; ?>"></td>
<td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
</div>
</div>
</div>
<!-- /#wrapper -->
<!-- jQuery -->
<script src="vendor/jquery/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!-- Metis Menu Plugin JavaScript -->
<script src="vendor/metisMenu/metisMenu.min.js"></script>
</ul>
</body>
</html>
<?php
session_start();
include_once('config/koneksi.php');
open_page('booking');
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/metro-bootstrap.css" rel="stylesheet">
<link href="css/metro-bootstrap-responsive.css" rel="stylesheet">
<link href="css/iconFont.css" rel="stylesheet">
<link href="css/docs.css" rel="stylesheet">
<!-- Load JavaScript Libraries -->
<script src="js/jquery/jquery.min.js"></script>
<script src="js/jquery/jquery.widget.min.js"></script>
<script src="js/jquery/jquery.mousewheel.js"></script>
<!-- Metro UI CSS JavaScript plugins -->
<script src="js/load-metro.js"></script>
<!-- Local JavaScript -->
<script src="js/docs.js"></script>
<title>Booking Paket</title>
</head>
<body class="metro">
<header class="bg-darkCobalt" data-load="atasan.php"></header>
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="tiket"; // Database name
$tbl_name="fpemesanan"; // Table name
// Connect to server and select databse.
$conn = mysqli_connect("$host", "$username", "$password")or die("cannot connect");
mysqli_select_db($conn,"$db_name")or die("cannot select DB");
// get value of id that sent from address bar
$id=$_GET['id'];
$sql="SELECT * FROM $tbl_name WHERE id='$id'";
$result=mysqli_query($conn,$sql);
$rows=mysqli_fetch_array($result);
?>
<BR>
<?php
$tbl_name2="fapply"; // Switch to table "forum_answer"
$sql2="SELECT * FROM $tbl_name2 WHERE question_id='$id'";
$result2=mysqli_query($conn,$sql2);
while($rows=mysqli_fetch_array($result2)){
?>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#F8F7F1">
<tr>
<td width="77%" bgcolor="#F8F7F1" colspan="3"><strong>Name : </strong><?php echo $rows['a_name']; ?><br><strong>Email : </strong><?php echo $rows['a_email']; ?></td>
</tr>
<tr>
<td bgcolor="#F8F7F1" colspan="3"></td>
</tr>
<tr>
<td bgcolor="#F8F7F1" colspan="3"><?php echo $rows['a_answer']; ?></td>
</tr>
<tr>
<td bgcolor="#F8F7F1" colspan="3" style="text-align: right"><?php echo $rows['a_datetime']; ?></td>
</tr>
</td>
</tr>
</table><br>
<?php
}
$sql3="SELECT view FROM $tbl_name WHERE id='$id'";
$result3=mysqli_query($conn,$sql3);
$rows=mysqli_fetch_array($result3);
$view=$rows['view'];
// if have no counter value set counter = 1
if(empty($view)){
$view=1;
$sql4="INSERT INTO $tbl_name(view) VALUES('$view') WHERE id='$id'";
$result4=mysqli_query($conn,$sql4);
}
// count more value
$addview=$view+1;
$sql5="update $tbl_name set view='$addview' WHERE id='$id'";
$result5=mysqli_query($conn,$sql5);
?>
</BR></td></tr></table></center>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</div></div>
<footer class="dark" data-load="bawahan.php"></footer>
</body>
</html>
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