In Progress

parent 206f7cbe
<?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