In Progress

parent 5357efac
<!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>
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