Commit d6f1f6b3 by Andry F. Hutapea
parents 8ec71a24 de47c8e9
<?php
session_start();
include_once('config/koneksi.php');
// retrieve posted form data
$id = $_POST['id'];
$nama = $_POST['nama'];
$desc = $_POST['desc'];
$image = $_POST['image'];
$database = new mysqli('localhost', 'root', '', 'tb silalahi');
$delete = "DELETE FROM koleksi WHERE id='$id'";
$id = $_GET['id'];
$statement = $database->prepare($delete);
$statement->bind_param('iissdss', $id, $author_id, $publisher_id, $isbn, $title, $price, $year, $description);
$statement->execute();
redirect('koleksi.php');
?>
\ No newline at end of file
<!DOCTYPE html>
<html>
<html lang="en">
<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="scroll-persen.css" rel="stylesheet">
<!-- Load JavaScript Libraries -->
<script src="js/move-top.js"></script>
<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>
<script src="scroll-persen.js"></script>
<!-- Metro UI CSS JavaScript plugins -->
<script src="js/load-metro.js"></script>
<script src="js/docs.js"></script>
<style>
</style>
<title>Selamat Datang di Website Kami</title>
<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">
<!-- Custom Fonts -->
<link href="../vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
</head>
<body class="metro"><div id="scroll"></div>
<header class="bg-darkCobalt" data-load="atasan.php"></header>
<div class="" data-load="sampul.html"></div>
<br />
<footer class="dark" data-load="bawahan.html"></footer>
<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="index.html">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.html"><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 class="sidebar-search">
<div class="input-group custom-search-form">
<input type="text" class="form-control" placeholder="Search...">
<span class="input-group-btn">
<button class="btn btn-default" type="button">
<i class="fa fa-search"></i>
</button>
</span>
</div>
<!-- /input-group -->
</li>
<li>
<a href="index.html"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="#"></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 Pemesan</a>
</li>
</ul>
</div>
<!-- /.sidebar-collapse -->
</div>
<!-- /.navbar-static-side -->
</nav>
<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>
</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>
</body>
</html>
<!DOCTYPE html>
<html>
<?php
include_once('config/koneksi.php');
open_page('koleksi');
?>
<!DOCTYPE html>
<html lang="en">
<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="scroll-persen.css" rel="stylesheet">
<!-- Load JavaScript Libraries -->
<script src="js/move-top.js"></script>
<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>
<script src="scroll-persen.js"></script>
<!-- Metro UI CSS JavaScript plugins -->
<script src="js/load-metro.js"></script>
<script src="js/docs.js"></script>
<style>
</style>
<title>Selamat Datang di Website Kami</title>
<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">
<!-- Custom Fonts -->
<link href="../vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
</head>
<body class="metro"><div id="scroll"></div>
<header class="bg-darkCobalt" data-load="atasan.php"></header>
<div class="" data-load="sampul.php"></div>
<br />
<div class="container" data-load="beranda.php"></div>
<footer class="dark" data-load="bawahan.php"></footer>
<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="index.html">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.html"><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="index.php"><i class="fa fa-dashboard fa-fw"></i> Daftar Koleksi</a>
</li>
<li>
<a href="koleksi.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 Pemesan</a>
</li>
</ul>
</div>
<!-- /.sidebar-collapse -->
</div>
<!-- /.navbar-static-side -->
</nav>
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<?php
include_once('config/koneksi.php');
open_page('koleksi');
$database = new mysqli('localhost', 'root', '', 'tb silalahi');
$query = 'SELECT * FROM koleksi';
$result_set = $database->query($query);
echo('<table
border="1">');
echo('<tr>');
echo('<td>Id</td>');
echo('<td>Nama</td>');
echo('<td>Description</td>');
echo('<td>Image</td>');
echo('</tr>');
while($row = $result_set->fetch_assoc()){
echo'<tr>';
echo '<tr>';echo '<td>'.$row['id'].'</td>'; //menampilkan data nis dari database
echo '<td>'.$row['nama'].'</td>'; //menampilkan data nama lengkap dari database
echo '<td>'.$row['desc'].'</td>'; //menampilkan data kelas dari database
echo '<td><img src="img/"'.$row['image'].'" ></td>'; //menampilkan gambar sesuai dengan url dari database
}
echo('</tr>');
echo('</table>');
?>
</div>
<!-- /.col-lg-12 -->
</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>
</body>
</html>
</html>
......@@ -64,7 +64,7 @@ echo '<td>'.$row['nama'].'</td>'; //menampilkan data nama lengkap dari database
echo '<td>'.$row['desc'].'</td>'; //menampilkan data kelas dari database
echo '<td><img src="image/"'.$row['image'].'" alt="" style="width:204px;height:228px;"></td>'; //menampilkan gambar sesuai dengan url dari database
echo('<td> <a href ="update.php?id='.$row['id'].'"> Update</a> </td>');
echo('<<td> <a href ="Delete.php?id='.$row['id'].'">Delete</a> </td>');
echo('<<td> <a href ="delete_process.php?id='.$row['id'].'">Delete</a> </td>');
}
echo('</tr>');
echo('</table>');
......
<?php
session_start();
include_once('config/koneksi.php');
if(isset($_SESSION['is_logged_in'])){
redirect('index.php');
}
open_page('login');
?>
<!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="../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">
<!-- Custom Fonts -->
<link href="../vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4">
<div class="login-panel panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Please Sign In</h3>
</div>
<div class="panel-body">
<form action="login_process.php">
<fieldset>
<div class="form-group">
<input class="form-control" placeholder="E-mail" name="email" type="email" autofocus>
</div>
<div class="form-group">
<input class="form-control" placeholder="Password" name="password" type="password" value="">
</div>
<div class="checkbox">
<label>
<input name="remember" type="checkbox" value="Remember Me">Remember Me
</label>
</div>
<!-- Change this to a button or input when using this as a form -->
<button type="submit" name="action" value="login">Sign In</button>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- 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>
<!-- Custom Theme JavaScript -->
<script src="../dist/js/sb-admin-2.js"></script>
</body>
</html>
......@@ -7,11 +7,11 @@ $data_password=$_POST['password'];
$host = "localhost";
$user = "root";
$password = "";
$db_name = "percobaan";
$db_name = "tb silalahi";
$connection = mysqli_connect($nama, $username, $password, $db_name);
$query = "select * form tbc where username ='$user' and password = '$password'";
$query = "select * form tb silalahi where username ='$user' and password = '$password'";
$exce = mysqli_query($connection, $db_name);
......@@ -28,6 +28,6 @@ if($data_username==$user_konfirmasi && $data_password==$password_konfirmasi){
$_SESSION["username"] = $data_username;
$_SESSION["password"]= $data_password;
//
$new_location = "admin.php";
$new_location = "index.php";
header('Location: '.$new_location);
?>
\ No newline at end of file
<?php
session_start();
include_once('config/koneksi.php');
open_page('update');
$database = new mysqli('localhost', 'root', '', 'tb silalahi');
$query = "SELECT * FROM koleksi ";
$result_set = $database->query($query);
while ($query = $result_set->fetch_assoc()){
?>
<form action="update_process.php" method="post">
<table border="1">
<tr>
<td>id</td>
<td>:</td>
<td><input type="text" value="<?php echo $query['id']?>" name="id"></td>
</tr>
<tr>
<td>Nama</td>
<td>:</td>
<td><input type="text" value="<?php echo $query['nama']?>" name="nama"></td>
</tr>
<tr>
<td>Description</td>
<td>:</td>
<td><input type="text"value="<?php echo $query['desc']?>" name="description"></td>
</tr>
<tr>
<td>Image</td>
<td>:</td>
<td><input type="file" name="image" <?php echo $query['image']?>" name="title"></td>
</tr>
<tr><td colspan="3"><input type="submit" name="action"
value="update"></td></tr>
</table>
</form>
<?php
}
close_page();
?>
\ No newline at end of file
<?php
session_start();
include_once('config/koneksi.php');
// retrieve posted form data
$id = $_POST['id'];
$nama = $_POST['nama'];
$desc = $_POST['desc'];
$image = $_POST['image'];
$database = new mysqli('localhost', 'root', '', 'tb silalahi');
$query = "UPDATE koleksi SET id = '$id', nama = '$nama', desc = '$desc', image = '$image' WHERE id = '$id'";
if($database->query($query) == TRUE){
redirect('koleksi.php');
}else{
echo "Error update book.";
}
?>
\ No newline at end of file
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