<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link href="css/bootstrap.css" rel="stylesheet">
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="ico/favicon.png">
</head>
<body>
<!-- NAVBAR
================================================== -->
<div class="navbar-wrapper">
<!-- Wrap the .navbar in .container to center it within the absolutely positioned parent. -->
<div class="container">
<div class="navbar navbar-inverse">
<div class="navbar-inner">
<!-- Responsive Navbar Part 1: Button for triggering responsive navbar (not covered in tutorial). Include responsive CSS to utilize. -->
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">Informasi</a>
<!-- Responsive Navbar Part 2: Place all navbar contents you want collapsed withing .navbar-collapse.collapse. -->
<div class="nav-collapse collapse">
<ul class="nav">
<li class="active"><a href="http://localhost/presentasipwd/">Home</a></li>
<li><a href="http://localhost/presentasipwd/about.php">About.php</a></li>
<li><a href="http://localhost/presentasipwd/contact.php">Contact.php</a></li>
<!-- Read about Bootstrap dropdowns at http://twitter.github.com/bootstrap/javascript.html#dropdowns -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li class="nav-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!-- /.navbar-inner -->
</div><!-- /.navbar -->
</div> <!-- /.container -->
</div><!-- /.navbar-wrapper -->
<div class="container-fluid">
<div class="row-fluid">
<div class="span3">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Sidebar</li>
<li class="active">
<p align="center"><a href="http://localhost/presentasipwd/list_berita.php">List Berita </a></p>
<p align="center"><a href="http://localhost/presentasipwd/form_tambah_berita.php">Tambah Berita</a></p>
<p align="center"><a href="http://localhost/presentasipwd/form_tambah_user.php">Tambah User</a></p>
<p align="center"><a href="logout.php">LOGOUT</a>
</ul>
</div><!--/.well -->
</div><!--/span-->
<div class="span9">
<div class="row-fluid">
<div class="span4">
<?php
include 'koneksi.php';
@session_start();
if (!$_SESSION['login_status'])
echo '<script> alert("anda harus login terlebih dahulu"); location.href="login.php"</script>';
if(isset($_POST['id_berita']) && isset($_POST['isi'])):
$status= mysql_query("UPDATE berita SET `judul` = '$_POST[judul]' ,
`isi` = '$_POST[isi]' WHERE id_berita=$_POST[id_berita]");
if($status): echo '<script>location.href="list_berita.php";</script>';
else: echo '<script>alert("gagal");location.href="list_berita.php";</script>'; endif;
endif;
if(isset($_GET['id_berita'])):
$result =mysql_query ("SELECT * FROM berita where id_berita=" .$_GET['id_berita']);
$berita =mysql_fetch_object($result);
?>
<form method="post" action="edit_berita.php">
<input type="hidden" name="id_berita" value="<?php echo $berita->id_berita;?>">
<label> JUDUL</label><input type="text" name="judul" value="<?php echo $berita->judul; ?>" ><br>
<label> KONTEN</label><textarea name="isi"><?php echo $berita->isi; ?></textarea><br>
<input type="submit" value="simpan">
</form>
<?php endif; ?>
</div><!--/span-->
</div><!--/span-->
</div><!--/row-->
</div><!--/span-->
</div><!--/row-->
</body>
</html>
hasil:edit berita
Continue reading →
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link href="css/bootstrap.css" rel="stylesheet">
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="ico/favicon.png">
</head>
<body>
<!-- NAVBAR
================================================== -->
<div class="navbar-wrapper">
<!-- Wrap the .navbar in .container to center it within the absolutely positioned parent. -->
<div class="container">
<div class="navbar navbar-inverse">
<div class="navbar-inner">
<!-- Responsive Navbar Part 1: Button for triggering responsive navbar (not covered in tutorial). Include responsive CSS to utilize. -->
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">Informasi</a>
<!-- Responsive Navbar Part 2: Place all navbar contents you want collapsed withing .navbar-collapse.collapse. -->
<div class="nav-collapse collapse">
<ul class="nav">
<li class="active"><a href="http://localhost/presentasipwd/">Home</a></li>
<li><a href="http://localhost/presentasipwd/about.php">About.php</a></li>
<li><a href="http://localhost/presentasipwd/contact.php">Contact.php</a></li>
<!-- Read about Bootstrap dropdowns at http://twitter.github.com/bootstrap/javascript.html#dropdowns -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li class="nav-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!-- /.navbar-inner -->
</div><!-- /.navbar -->
</div> <!-- /.container -->
</div><!-- /.navbar-wrapper -->
<div class="container-fluid">
<div class="row-fluid">
<div class="span3">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Sidebar</li>
<li class="active">
<p align="center"><a href="http://localhost/presentasipwd/list_berita.php">List Berita </a></p>
<p align="center"><a href="http://localhost/presentasipwd/form_tambah_berita.php">Tambah Berita</a></p>
<p align="center"><a href="http://localhost/presentasipwd/form_tambah_user.php">Tambah User</a></p>
<p align="center"><a href="logout.php">LOGOUT</a>
</ul>
</div><!--/.well -->
</div><!--/span-->
<div class="span9">
<div class="row-fluid">
<div class="span4">
<?php
include 'koneksi.php';
@session_start();
if (!$_SESSION['login_status'])
echo '<script> alert("anda harus login terlebih dahulu"); location.href="login.php"</script>';
if(isset($_POST['id_berita']) && isset($_POST['isi'])):
$status= mysql_query("UPDATE berita SET `judul` = '$_POST[judul]' ,
`isi` = '$_POST[isi]' WHERE id_berita=$_POST[id_berita]");
if($status): echo '<script>location.href="list_berita.php";</script>';
else: echo '<script>alert("gagal");location.href="list_berita.php";</script>'; endif;
endif;
if(isset($_GET['id_berita'])):
$result =mysql_query ("SELECT * FROM berita where id_berita=" .$_GET['id_berita']);
$berita =mysql_fetch_object($result);
?>
<form method="post" action="edit_berita.php">
<input type="hidden" name="id_berita" value="<?php echo $berita->id_berita;?>">
<label> JUDUL</label><input type="text" name="judul" value="<?php echo $berita->judul; ?>" ><br>
<label> KONTEN</label><textarea name="isi"><?php echo $berita->isi; ?></textarea><br>
<input type="submit" value="simpan">
</form>
<?php endif; ?>
</div><!--/span-->
</div><!--/span-->
</div><!--/row-->
</div><!--/span-->
</div><!--/row-->
</body>
</html>
hasil:edit berita