You are on page 1of 21

Alur1.

php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
font-family: verdana;
font-weight: bold;
font-size: 18px;
color: #000000;
}
-->
</style>
</head>

<body>
<div align="center">
<p><a href="alur_image.php"><img src="Image/alur.jpg" width="589"
height="418" border="0" /></a></p>
</div>
</body>
</html>

Alur.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Puskesmas Swakelola Sekip</title>
<link ilo-full-src="bakti.jpg" rel="SHORTCUT ICON" href="Image/bakti.jpg"
type="x-icon">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {
font-family: verdana;
font-weight: bold;
font-size: 16px;
}
.style2 {font-family: verdana; font-weight: bold; font-size: 18px; }
.style3 {font-size: 18px}
-->
</style>
</head>

<body bgcolor="#FFFFFF">

<div align="center">
<table width="809" border="0">
<tr>
<td colspan="2"><div align="center"></div> <?php Include
"atas.php";?></td>
</tr>
<tr>
<td rowspan="2" align="left" valign="top"><?php Include
"alur1.php";?></td>
<td width="155" height="146" align="center" valign="top"><table
width="200" border="0" align="center">
<tr>
<td><div align="center" class="style2">
<embed src="jam digital.swf" width="160" height="25"></embed>
</div></td>
</tr>
</table>
<p align="center" class="style1">
<embed src="anaclock.swf" width="130" height="130"
bgcolor="#FFFFFF"></embed>
</p>
<p align="center" class="style1">
<embed src="digiclock.swf" width="70" height="22"
bgcolor="#FFFFFF"></embed>
</p></td>
</tr>
<tr valign="top">
<td height="153" align="center" valign="top"><div align="center"
class="style1 style3">
<embed src="kalender.swf" width="160" height="25"></embed>
</div>
<p>
<?php Include "calendar.php";?>
</p></td>
</tr>
<tr>
<td colspan="2"><?php Include "bawah.php";?></td>
</tr>
</table>
<p>&nbsp;</p>
</div>
</body>
</html>

Config.php
<?php
mysql_connect("localhost","","");
mysql_select_db("puskesmas");
?>

Hapus.php
<?php
include "config.php";

$hapus="delete from berita where no_berita='$no_berita'";


mysql_query("$hapus");
header("location:hapus_berita.php");
?>

Calendar.php
<?
if(ereg("calendar.php",$PHP_SELF))
{header("location:index.php");
die;
}
?>

<div align="right">
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
monthnames = new Array(
"Januari",
"Februari",
"Maret",
"April",
"Mei",
"Juni",
"Juli",
"Agustus",
"September",
"Oktober",
"Nopember",
"Desember");
var linkcount=0;
function addlink(month, day, href) {
var entry = new Array(3);
entry[0] = month;
entry[1] = day;
entry[2] = href;
this[linkcount++] = entry;
}
Array.prototype.addlink = addlink;
linkdays = new Array();
monthdays = new Array(12);
monthdays[0]=31;
monthdays[1]=28;
monthdays[2]=31;
monthdays[3]=30;
monthdays[4]=31;
monthdays[5]=30;
monthdays[6]=31;
monthdays[7]=31;
monthdays[8]=30;
monthdays[9]=31;
monthdays[10]=30;
monthdays[11]=31;

<?
$saiki = date("d M Y");
?>;
saiki="<? echo $saiki ?>";

todayDate=new Date(saiki);

thisday=todayDate.getDay();
thismonth=todayDate.getMonth();
thisdate=todayDate.getDate();
thisyear=todayDate.getYear();
thisyear = thisyear % 100;
thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear));
if (((thisyear % 4 == 0)
&& !(thisyear % 100 == 0))
||(thisyear % 400 == 0)) monthdays[1]++;
startspaces=thisdate;
while (startspaces > 7) startspaces-=7;
startspaces = thisday - startspaces + 1;
if (startspaces < 0) startspaces+=7;
document.write("<table border=0 cellspacing=1 cellpadding=0 ");
document.write("bordercolor=#666666 width=100%><font color=black>");
document.write("<tr><td colspan=7><center><strong><font size=2>"
+ monthnames[thismonth] + " " + thisyear
+ "</font></strong></center></font></td></tr>");
document.write("<tr>");
document.write("<td align=center><font size=2 color=red>M</font></td>");
document.write("<td align=center><font size=2>S</font></td>");
document.write("<td align=center><font size=2>S</font></td>");
document.write("<td align=center><font size=2>R</font></td>");
document.write("<td align=center><font size=2>K</font></td>");
document.write("<td align=center><font size=2 color=green>J</font></td>");
document.write("<td align=center><font size=2>S</font></td>");
document.write("</tr>");
document.write("<tr>");
for (s=0;s<startspaces;s++) {
document.write("<td> </td>");
}
count=1;
while (count <= monthdays[thismonth]) {
for (b = startspaces;b<7;b++) {
linktrue=false;
document.write("<td align=center><font size=1>");
for (c=0;c<linkdays.length;c++) {
if (linkdays[c] != null) {
if ((linkdays[c][0]==thismonth + 1) &&
(linkdays[c][1]==count)) {
document.write("<a href=\"" +
linkdays[c][2] + "\">");
linktrue=true;
}
}
}
if (count <= monthdays[thismonth]) {
if (b==0) {
document.write("<font color=red>");}
if (b==5) {
document.write("<font color=green>");}
if (count==thisdate) {
document.write("<font size=2
color=blue><strong>");}

document.write(count);

if (count==thisdate) {
document.write("</strong></font>");}

if (b==0){
document.write("</font>");}
if (b==5){
document.write("</font>");}
}
else {
document.write(" ");
}
if (linktrue)
document.write("</a>");
document.write("</font></td>");
count++;
}
document.write("</tr>");
document.write("<tr>");
startspaces=0;
}
document.write("</table>");
// End -->
</SCRIPT>
</div>

Berita_sukses1.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Puskesmas Swakelola Sekip</title>
<link ilo-full-src="bakti.jpg" rel="SHORTCUT ICON" href="Image/bakti.jpg"
type="x-icon">
</head>

<body bgcolor="#FFFFFF">
<table width="636" border="0" align="center">
<tr>
<td colspan="3"><div align="left"><?php Include
"atas_admin.php";?></div></td>
</tr>
<tr>
<td width="160" valign="top"><?php Include "Menu.php";?></td>
<td width="466" colspan="2" rowspan="2" align="left" valign="top"><?php
Include "berita_sukses.php";?></td>
</tr>
<tr>
<td align="center" valign="top"><p>
<embed src="kalender.swf" width="160" height="25"></embed>
</p>
<p><?php Include "calendar.php";?></p></td>
</tr>
<tr>
<td colspan="3"><div align="center"></div> <?php Include
"bawah.php";?></td>
</tr>
</table>
<div align="left"></div>
</body>
</html>

Home_admin1.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>

<table width="316" border="0" align="center">


<tr>
<td></td>
</tr>
<tr>
<td width="310"><p align="center"><font color="#000000"
size="2"><strong><font size="5" face="Tahoma">Admin
!!!!!</font></strong></font></p>
<p align="center"><font color="#000000" size="3"
face="Tahoma"><strong>Selamat Datang di Website Puskesmas Swakelola Sekip
</strong></font></p>
<p align="center"><font color="#000000" size="2" face="Tahoma"> Ini
adalah tempat untuk mengupdate websites. Bagi anda yang telah menjadi
anggota kami, silahkan mengupdate dengan baik.</font></p>
</td>
</tr>
<tr>
<td height="230"><div align="center">
<h3 align="center"><font color="#000000" size="3" face="Tahoma">Tata
Cara mengedit website !!!</font></h3>
<h3 align="center"><font color="#000000" size="3" face="Tahoma">Setiap
Adminstrator harus mematuhi peraturan ini : </font> </h3>
<li>
<div align="center"><font color="#000000" size="2" face="Tahoma">
Administrator harus mendapat izin dari atasan.</font></div>
</li>
<li>
<div align="center"><font color="#000000" size="2"
face="Tahoma">Mengeditlah dengan baik &amp; benar </font></div>
</li>
<li>
<div align="center"><font color="#000000" size="2" face="Tahoma">
Menyiapkan materi yang akan di ubah.</font></div>
</li>
<li>
<div align="center"><font color="#000000" size="2" face="Tahoma">
Jangan lupa setelah selesai, tekan <strong>LOGOUT</strong>.</font></div>
</li>
<div align="center"><font color="#000000">
</p>
</font></div>
</div></td>
</tr>
</table>
</body>
</html>

Detail_berita.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Puskesmas Swakelola Sekip</title>
<link ilo-full-src="bakti.jpg" rel="SHORTCUT ICON" href="Image/bakti.jpg"
type="x-icon">
<style type="text/css">
<!--
.style1 {
font-family: "20th Century Font";
font-size: 24px;
}
.style4 {font-family: verdana; font-size: 14px; }
.style5 {
font-family: verdana;
font-size: 12px;
}
-->
</style>
</head>
<body text="#000000">
<table width="622" border="0" align="center">
<tr>
<td width="616" height="40">&nbsp;</td>
</tr>
<tr>
<td><div align="justify">
<table width="618" border="0">
<?php
include("config.php");
$hasil = mysql_query("select * from berita order by no_berita desc")
or die(mysql_error());
$totalrecord = mysql_num_rows($hasil);
if ($totalrecord == 0) {
echo ("<br>");
echo("Berita Masih Kosong");
} else {
while ($baris = mysql_fetch_row($hasil)) {
?>
<tr>
<td><span class="style4"><?php echo($baris[6]);?> ||| <?php
echo($baris[7]);?> ||| <?php echo($baris[8]);?> WIB</span> <div
align="center" class="style4">
<div align="justify"></div>
</div></td>
</tr>
<tr>
<td><span class="style4"><b><?php echo($baris[3]);?></b> ,
<b><?php echo($baris[4]);?></b></span>
<div align="center" class="style4">
<div align="justify"></div>
</div> <b><span class="style4"></b></td>
</tr>
<tr>
<td><?php echo($baris[5]);?>
<div align="center" class="style4">
<div align="justify"></div>
</div></td>
</tr>
<tr>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<td><hr /></td>
</tr>
<?php
} //end while
} // end if
?>
</table>
</div></td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>

Edit_bukutamu.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Puskesmas Swakelola Sekip</title>
<link ilo-full-src="TVRI.jpg" rel="SHORTCUT ICON" href="TVRI.jpg"
type="x-icon">
<style type="text/css">
<!--
.style1 {
font-family: "20th Century Font";
font-size: 24px;
}
.style4 {font-family: verdana; font-size: 14px; }
.style5 {
font-family: verdana;
font-size: 12px;
}
-->
</style>
</head>

<body bgcolor="#FFFFFF">
<table width="809" border="0" align="center">
<tr>
<td><?php Include("atas_admin.php");?></td>
</tr>
<tr>
<td><div align="center" class="style1">BUKU TAMU</div></td>
</tr>
<tr>
<td><div align="justify" class="style5">Klik <a
href="Home_admin.php">DISINI</a> untuk kembali ke Home Admin
</div></td>
</tr>
<tr>
<td><div align="justify">
<table width="810" border="0">
<?php
include("config.php");
$hasil = mysql_query("select * from tamu order by id desc")
or die(mysql_error());
$totalrecord = mysql_num_rows($hasil);
if ($totalrecord == 0) {
echo ("<br>");
echo("Buku Tamu Kosong !!!!");
} else {
while ($baris = mysql_fetch_row($hasil)) {
?>
<tr>
<td width="91"><span class="style4">Tanggal</span></td>
<td width="10"><div align="center" class="style4">:</div></td>
<td width="695"><?php echo($baris[1]);?></td>
</tr>
<tr>
<td><span class="style4">Nama</span></td>
<td><div align="center" class="style4">:</div></td>
<td><?php echo($baris[2]);?></td>
</tr>
<tr>
<td><span class="style4">Email</span></td>
<td><div align="center" class="style4">:</div></td>
<td><?php echo($baris[3]);?></td>
</tr>
<tr>
<td valign="top"><span class="style4">Komentar</span></td>
<td valign="top"><div align="center" class="style4">:</div></td>
<td><?php echo($baris[4]);?></td>
</tr>
<tr>
<td colspan="3">
<?php
echo "<a href=\"delete_tamu.php?id=$baris[0]\">Delete</a>";
?><hr />
</td>
</tr>
<?php
} //end while
} // end if
?>
</table>
</div></td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>

Delete_tamu.php
<title>Puskesmas Swakelola Sekip</title>
<link ilo-full-src="bakti.jpg" rel="SHORTCUT ICON" href="Image/bakti.jpg"
type="x-icon">
<body bgcolor="#FFFFFF">
<?php
include ("config.php");
$id = $_GET['id'];
mysql_query("DELETE from tamu where id='$id'");
?>
<table width="809" border="0" align="center">
<tr>
<td><?php Include ("atas_admin.php");?></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><a href="edit_bukutamu.php">Lihat Buku Tamu</a></td>
</tr>
</table>

Berita_sukses.php
<title>Puskesmas Swakelola Sekip</title>
<link ilo-full-src="bakti.jpg" rel="SHORTCUT ICON" href="Image/bakti.jpg"
type="x-icon">
<?

//Mendapatkan Hari ini dalam bahasa Indonesia


$seminggu=array("Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu");
$hr=date("w");
$hari=$seminggu[$hr];

//Mendapatkan tanggal dan jam saat ini


$tgl_berita=date("Ymd");
$jam_berita=date("H:i:s");

include "config.php";
$input="INSERT INTO
berita(no_kategori,username,judul_berita,headline_berita,isi_berita,hari,tgl_berita,
jam_berita)
VALUES('$no_kategori','$namauser','$judul_berita','$headline_berita','$isi_berita'
,'$hari','$tgl_berita','$jam_berita')";
$hasil=mysql_query($input);
if ($hasil)
{
echo "Proses Input Berita & Informasi Sukses<BR>";
echo "<A HREF=berita_admin.php>Input Berita Lagi</A><BR>";
echo "<A HREF=Home_admin.php>Kembali ke Home Admin</A>";
}
else
{
echo "Proses Input Berita Gagal";
}

?>

Index.php
<?php
header("location:Home.php");
?>

Form_berita.php
<body text="#000000">
<?
echo "<H3>INPUT BERITA & INFORMASI</H3>
<FORM METHOD=POST ACTION=berita_sukses1.php>
Judul: <INPUT TYPE=TEXT SIZE=40 NAME=judul_berita><BR>
Kategori: <SELECT NAME=no_kategori>
<OPTION VALUE=0 SELECTED>-- Pilih Kategori --";

include "config.php";
$tampil="SELECT * FROM kategori ORDER BY nama_kategori";
$hasil=mysql_query($tampil);
while($data=mysql_fetch_array($hasil))
{
echo "<OPTION VALUE=$data[no_kategori]>$data[nama_kategori]";
}
echo "</OPTION></SELECT><BR>
Headline Berita:<BR>
<TEXTAREA NAME=headline_berita cols=30 rows=5></TEXTAREA><BR>
Isi Berita:<BR>
<TEXTAREA NAME=isi_berita cols=35 rows=10></TEXTAREA><BR>
<INPUT TYPE=SUBMIT VALUE=Tambah>
</FORM>";

?>

Informasi.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Puskesmas Swakelola Sekip</title>
<link ilo-full-src="bakti.jpg" rel="SHORTCUT ICON" href="Image/bakti.jpg"
type="x-icon">
<style type="text/css">
<!--
.style1 {
font-family: "20th Century Font";
font-size: 24px;
}
.style4 {font-family: verdana; font-size: 14px; }
.style5 {
font-family: verdana;
font-size: 12px;
}
-->
</style>
</head>

<body>
<table width="622" border="0" align="center">

<tr>
<td width="616"><div align="justify" class="style5"></div></td>
</tr>

<tr>
<td><div align="justify">
<table width="618" border="0">
<?php
include("config.php");
$hasil = mysql_query("select * from berita order by no_berita desc")
or die(mysql_error());
$totalrecord = mysql_num_rows($hasil);
if ($totalrecord == 0) {
echo ("<br>");
echo("Berita Masih Kosong");
} else {
while ($baris = mysql_fetch_row($hasil)) {
?>
<tr>
<td><span class="style4"><?php echo($baris[6]);?>|<?php
echo($baris[7]);?>|<?php echo($baris[8]);?> WIB</span> <div
align="center" class="style4">
<div align="justify"></div>
</div></td>
</tr>
<tr>
<td><span class="style4"><b><?php echo($baris[3]);?></b> ,
<b><?php echo($baris[4]);?></b></span>
<div align="center" class="style4">
<div align="justify"></div>
</div> <b><span class="style4"></b></td>
</tr>
<tr>
<td>
<?php
$view=substr($baris[5],0,strpos("$baris[5]","."));
echo "$view.....<a href=\"detail.php\">Selengkapnya</a>" ?> <div
align="center" class="style4">
<div align="justify"></div>
</div></td>
</tr>
<tr>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<td><hr /></td>
</tr>
<?php
} //end while
} // end if
?>
</table>

</div></td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>
Judul_berita.php
<?
include "config.php";

$sqli="select no_berita, judul_berita from berita order by no_berita asc";


$hasil=mysql_query($sqli);
?>

<?
while($data=mysql_fetch_array($hasil))
{
echo("<a href=hapus.php?no_berita=$data[no_berita] onclick=\"return
confirm('Anda Yakin Berita Ini Dihapus ??')\">$data[judul_berita]</a><br>");
}
?>

Lihat.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Puskesmas Swakelola Sekip</title>
<link ilo-full-src="bakti.jpg" rel="SHORTCUT ICON" href="Image/bakti.jpg"
type="x-icon">
<style type="text/css">
<!--
.style1 {
font-family: "20th Century Font";
font-size: 24px;
color: #000000;
}
.style4 {font-family: verdana; font-size: 14px; }
.style5 {
font-family: verdana;
font-size: 12px;
color: #000000;
}
.style7 {color: #000000}
-->
</style>
</head>

<body bgcolor="#FFFFFF">
<table width="816" border="0" align="center">
<tr>
<td width="810"><span class="style7">
<?php Include("atas.php");?>
</span></td>
</tr>
<tr>
<td height="48"><div align="center" class="style1">BUKU
TAMU</div></td>
</tr>
<tr>
<td><div align="justify" class="style5">Klik <a
href="Home.php">DISINI</a> untuk kembali ke Home </div></td>
</tr>
<tr>
<td><div align="justify" class="style7">
<table width="811" border="0">
<?php
include("config.php");
$hasil = mysql_query("select * from tamu order by id desc")
or die(mysql_error());
$totalrecord = mysql_num_rows($hasil);
if ($totalrecord == 0) {
echo ("<br>");
echo("Buku Tamu masih kosong, silahkan diisi terlebih dahulu
!!!");
} else {
while ($baris = mysql_fetch_row($hasil)) {
?>
<tr>
<td width="91"><span class="style4">Tanggal</span></td>
<td width="10"><div align="center" class="style4">:</div></td>
<td width="695"><?php echo($baris[1]);?></td>
</tr>
<tr>
<td><span class="style4">Nama</span></td>
<td><div align="center" class="style4">:</div></td>
<td><?php echo($baris[2]);?></td>
</tr>
<tr>
<td><span class="style4">Email</span></td>
<td><div align="center" class="style4">:</div></td>
<td><?php echo($baris[3]);?></td>
</tr>
<tr>
<td valign="top"><span class="style4">Komentar</span></td>
<td valign="top"><div align="center" class="style4">:</div></td>
<td><?php echo($baris[4]);?></td>
</tr>
<tr>
<td colspan="3"><hr /></td>
</tr>
<?php
} //end while
} // end if
?>
</table>

</div></td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>

Logout.php
<?php
setcookie("nama","");
header("Location: Home.php");
?>

Proses_register.php
<?php
if(empty($username) or empty($email) or empty($password) or
empty($c_password)){
echo"<script>alert(\"Data Tidak Lengkap!\");window.history.go(-1);</script>";
exit();
}

if(!ereg("^.+@.+\\..+$", $email)){
echo"<script>alert(\"Isi email dengan benar!\");window.history.go(-
1);</script>";
exit();
}

if($password != $c_password){
echo "<script>alert('Password tidak Sama');window.history.go(-
1);</script>";
exit();
}
include"config.php";
$username=strip_tags($username);
$password=strip_tags($password);
$email=strip_tags($email);
$sql="insert into members (id,username,password, email)".
"values('', '$username', '$password', '$email')";
//echo $sql; exit();

if(mysql_query($sql))
{
echo("<font face='arial' color='black' size='2'>Anda telah terdaftar sebagai
Admin kami<b> $username</b><br>");
echo("<font face='arial' color='black' size='2'><a
href=Home_admin.php>Kembali</font></a></font><br>");
}else{
echo mysql_error();
}
?>

Proses_login1.php
<?php

session_start();
include "config.php" ;

$username = $_POST['username'];
$password = $_POST['password'];
$passwordhash = md5($password); // mengenkripsikannya untuk dicocokan
dengan database

$perintahnya = "select username, password from members where username =


'$username' and password = '$password'";
$jalankanperintahnya = mysql_query($perintahnya);

$ada_apa_enggak = mysql_num_rows($jalankanperintahnya);

if ($ada_apa_enggak >= 1 )
{
$_SESSION['username'] = $username;
header("location: Home_admin.php");
}
else
header("location: cpanel1.php");
?>

Tanggal.php
<?php
echo '<B><font face="Verdana" size="2" color="#000000"></B>';
function tanggal_hari_ini(){
$hari=date(w,time());
$tanggal=date(d,time());
$bulan=date(m,time());
$tahun=date(Y,time());
switch ($hari) {
case 0: $hari="Minggu";
break;
case 1: $hari="Senin";
break;
case 2: $hari="Selasa";
break;
case 3: $hari="Rabu";
break;
case 4: $hari="Kamis";
break;
case 5: $hari="Jum'at";
break;
case 6: $hari="Sabtu";
break;
}
switch ($bulan) {
case 01: $bulan="Januari";
break;
case 02: $bulan="Februari";
break;
case 03: $bulan="Maret";
break;
case 04: $bulan="April";
break;
case 05: $bulan="Mei";
break;
case 06: $bulan="Juni";
break;
case 07: $bulan="Juli";
break;
case 08: $bulan="Agustus";
break;
case 09: $bulan="September";
break;
case 10: $bulan="Oktober";
break;
case 11: $bulan="November";
break;
case 12: $bulan="Desember";
break;
}
echo "$hari, $tanggal $bulan $tahun";
}
tanggal_hari_ini();
?>

Tamu_save.php
<?php
$nama = $_POST["nama"];
$email = $_POST["email"];
$komentar = $_POST["komentar"];
$tgl = date("d/m/y H:i");
include("config.php");
mysql_query("insert into tamu (tgl, nama, email, komentar) values ('$tgl',
'$nama', '$email', '$komentar')") or die(mysql_error());
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {font-family: "20th Century Font"}
.style2 {
font-family: verdana;
font-size: 12px;
}
-->
</style>
</head>

<body>
<table width="459" border="0">
<tr>
<td width="453">&nbsp;</td>
</tr>
<tr>
<td><p class="style1"><span class="style2">Terima Kasih Saudara/i<b>
<?php echo($nama); ?></b> telah mengisi buku tamu kami.</span></p>
<p class="style1"><span class="style2"><br />
<a href="Lihat.php">&raquo;Lihat Buku Tamu</a></span></p></td>
</tr>
</table>
<p class="style1">&nbsp;</p>
<p class="style1"><br />
</p>
</body>
</html>

You might also like