Vous êtes sur la page 1sur 37

LAMPIRAN HALAMAN UTAMA Indexs.php <html> <head> <title>website smk bp talang</title> </head> <body bgcolor='#666666'> <?

php echo "<center><table id='table1' width='850' height='175' border='1' cellspacing=0 cellspadding=0> <tr> <td valign='top' colspan='6' width='100%'>"; ?> <? include 'header.php'?></td> <tr> <td valign="top" width="150" height="75" bgcolor="#C0C0C0"><? include "kiri.php"?></td> <td valign="top" width="700" height="75" bgcolor="white"><p align=justify> <?PHP if ($_REQUEST['fileid']==1) {include "tampil_home.php";} if ($_REQUEST['fileid']==2) {include "form_login.php";} if ($_REQUEST['fileid']==3) {include "tampil_kontak.php";} if ($_REQUEST['fileid']==4) {include "form_bukutamu.php";} if ($_REQUEST['fileid']==5) {include "sejarah.php";} if ($_REQUEST['fileid']==6) {include "tampil_misi.php";} if ($_REQUEST['fileid']==7) {include "tampil_struktur.php";} if ($_REQUEST['fileid']==8) {include "tampil_galeri.php";} if ($_REQUEST['fileid']==9) {include "tampil_kelas1.php";} if ($_REQUEST['fileid']==10) {include "tampil_kelas2.php";} if ($_REQUEST['fileid']==11)

{include "tampil_kelas3.php";} if ($_REQUEST['fileid']==12) {include "form_siswa.php";} if ($_REQUEST['fileid']==13) {include "selamat_login.php";} if ($_REQUEST['fileid']==14) {include "konfirmasi_akses.php";} ?></td> </tr> <tr> <td colspan="3" valign="top"><? require ("footer.php")?></td></tr> </table> </body> </html> Index.php <?php header('location:indexs.php?fileid=1'); ?> Header.php <style type="text/css"> menu_atas { font-family: Verdana, Geneva, sans-serif; background-color: #C00; text-decoration: blink; font-size: 16px; font-style: normal; line-height: normal; } tebal { font-weight: bold; } kk { font-weight: bold; } </style> <?php echo"<table id='table1' width='850' height='232' border='0' cellspacing=0 cellspadding=0> <tr> <td width='800' height='184' valign='top'><img src='images/Header.jpg' width='850' height='190'></td> </tr>

<tr> <td valign='top' height='23' topmargin='0'> <table border='0' bgcolor='#FFCC66' width='100%' height='36' topmargin='0'> <tr> <td><table width='100%' height='28' border='1'> <tr> <td width='16%' onmouseover='className='menu_atas';'><a href='indexs.php?fileid=1'>HOME </a></td> <td width='16%'><a href='indexs.php?fileid=2'>LOGIN </a></td> <td width='18%'><a href='indexs.php?fileid=3'>KONTAK </a></td> <td width='19%'> <a href='indexs.php?fileid=4'>BUKU TAMU</a></td> <td width='31%'>&nbsp;</td> </tr> </table></td> </tr></table> </td></tr> </table>"; ?> Kiri.php <html> <head> <script src='../Scripts/swfobject_modified.js' type='text/javascript'></script> </head> <style type='text/css'> A:link, A:active{ font-family: verdana, arial, helvetica, geneva, sans-serif; font-size: 12px; color : blue; text-decoration :none; } A:vlink { font-family: verdana, arial, helvetica, geneva, sans-serif; color : red; font-size: 12px; text-decoration :none; } A:visited { font-family: verdana, arial, helvetica, geneva, sans-serif; font-size: 12px; color : blue; text-decoration :none; }

A:hover { text-decoration: underline; font-weight : bold; font-size: 12px; color : red; } .a { color: #F00; } .a { color: #F00; } </style> <body> <?php echo"<table width='156' height='175' border='0' cellspacing=0 cellspadding=0> <tr> <td valign='top' width='150' height='75' bgcolor='#FFFFFF'> <table border='0' width='100%'> <tr> <td bgcolor='#CCCCCC'><strong class='a'>MENU UTAMA</strong></td></tr> <tr> <td> + <a href='indexs.php?fileid=1'>Home</a><br> + <a href='indexs.php?fileid=5'>Sejarah</a><br> + <a href='indexs.php?fileid=6'>Visi dan misi</a><br> + <a href='indexs.php?fileid=7'>Struktur Organisasi</a><br> </tr> <tr> </tr> </table><br><hr /> <table border='0' width='100%'> <tr> <td bgcolor='#CCCCCC'><strong class='a'>DOWNLOAD MATERI</strong></td></tr> <tr> <td> + <a href='indexs.php?fileid=14'>kelas 1</a><br> + <a href='indexs.php?fileid=14'>kelas 2</a><br> + <a href='indexs.php?fileid=14'>kelas 3</a><br> <tr> <td></td></table>

</td> </tr>";?> <tr> <td valign='top' height='75' bgcolor='#FFFFFF'><table border='0' width='32%'> <tr> <td> <? include 'form_loginmember.php'?><hr /></td> </tr> <tr><td><object id='FlashID' classid='clsid:D27CDB6E-AE6D-11cf-96B8444553540000' width='100%' height='100%'> <param name='movie' value='catur/anaclock.swf' /> <param name='quality' value='high' /> <param name='wmode' value='opaque' /> <param name='swfversion' value='6.0.65.0' /> <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don't want users to see the prompt. --> <param name='expressinstall' value='../Scripts/expressInstall.swf' /> <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. --> <!--[if !IE]>--> <object type='application/x-shockwave-flash' data='catur/anaclock.swf' width='150' height='150'> <!--<![endif]--> <param name='quality' value='high' /> <param name='wmode' value='opaque' /> <param name='swfversion' value='6.0.65.0' /> <param name='expressinstall' value='../Scripts/expressInstall.swf' /> <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. --> <div> <h4>Content on this page requires a newer version of Adobe Flash Player.</h4> <p><a href='http://www.adobe.com/go/getflashplayer'><img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif ' alt='Get Adobe Flash player' /></a></p> </div> <!--[if !IE]>--> </object> <!--<![endif]--> </object></td></tr> </table> <p>&nbsp;</p></td> </tr> </table>

</body> </body> </html> Footer.php <?php echo "<table> <tr> <td width='850' height='57' valign='top' bgcolor=#C0C0C0><p align=center> copyright &copy; SMK BP TALANG-TEGAL<BR>2011</td> </tr> </table>"; ?> Tampil_home.php <?PHP include "config/koneksi.php"; $sql="SELECT * from utama"; echo " <table width='100%' cellpadding='2' cellspacing='2' border='0'>"; $mq=mysql_query($sql) or die(mysql_error()); while($aql=mysql_fetch_array($mq)) { echo "<tr> <td colspan=6 align='justify'>".$aql['isi_utama']."</td> </tr> <tr> <td class='td'>&nbsp;</td> </tr>"; } ?> </table> Form_login.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>login</title> <script language="javascript"> function validasi(form){

if (form.username.value == ""){ alert("Anda belum mengisikan Username."); form.username.focus(); return (false); } if (form.password.value == ""){ alert("Anda belum mengisikan Password."); form.password.focus(); return (false); } return (true); } </script> <style type="text/css"> <!-.style2 { font-size: 24px; color: #265180; } --> </style> </head> <body> <?php echo "<form action='cek_login.php' method='POST' onSubmit='return validasi(this)'> <table width='374' height='146' border='0' align='center' style='border:solid #00FFFF'> <tr> <td colspan='3' style='border-bottom:solid #0000CC'><span class='style2'>Login</span></td> </tr> <tr> <td width='114' rowspan='3' align='center'><img src='images/loginwelcome.gif' width='61' height='63' /></td> <td width='71'>Username</td> <td width='167'> : <input type='text' name='username' /></td> </tr> <tr> <td>Password</td> <td> : <input type='password' name='password' /></td> </tr>

<tr> <td height='26' colspan='2'><input type='submit' name='Submit' value='Login' /> </td> </tr> </table> </form>"; ?> </body> </html> Cek_login.php <?php include "config/koneksi.php"; function antiinjection($data){ $filter_sql = mysql_real_escape_string(stripslashes(strip_tags(htmlspecialchars($data,ENT_Q UOTES)))); return $filter_sql; } $username = antiinjection($_POST[username]); $pass = antiinjection(md5($_POST[password])); $login=mysql_query("SELECT * FROM guru"); $login=mysql_query("SELECT * FROM users WHERE username='$username' AND password='$pass'"); $ketemu=mysql_num_rows($login); $r=mysql_fetch_array($login); // Apabila username dan password ditemukan if ($ketemu > 0){ session_start(); session_register("namauser"); session_register("nama"); session_register("passuser"); session_register("leveluser"); $_SESSION[namauser] = $r[username]; $_SESSION[nama] = $r[nama]; $_SESSION[passuser] = $r[password]; $_SESSION[leveluser] = $r[level]; if ($_SESSION[leveluser]=='admin'){ header('location:admin/home.php?fileid=18'); }

else if ($_SESSION[leveluser]=='guru'){ header('location:guru/home.php?fileid=5'); } } else{ echo "<link href=../config/adminstyle.css rel=stylesheet type=text/css>"; echo "<center>LOGIN GAGAL! <br> Username atau Password Anda tidak benar.<br> Atau account Anda sedang diblokir.<br>"; echo "<a href=indexs.php?fileid=5><b>ULANGI LAGI</b></a></center>"; } ?> Tampil_kontak.php <?PHP include "config/koneksi.php"; $sql="SELECT * from kontak"; echo " <table width='100%' cellpadding='2' cellspacing='2' border='0'>"; $mq=mysql_query($sql) or die(mysql_error()); while($aql=mysql_fetch_array($mq)) { echo "<tr> <td colspan=6 align='justify'>".$aql['isi_kontak']."</td> </tr> <tr> <td class='td'>&nbsp;</td> </tr>"; } ?> </table>

Bukutamu.php <script language="javascript"> function validasi(form){ if (form.nama.value == ""){ alert("Anda belum mengisikan nama."); form.nama.focus(); return (false); } if (form.email.value == ""){ alert("Anda belum mengisikan email."); form.email.focus();

return (false); } if (form.pesan.value == ""){ alert("Anda belum mengisikan pesan."); form.pesan.focus(); return (false); } return (true); } </script> <style type="text/css"> <!-.td { padding-top: 2px; padding-bottom: 2px; padding-left: 3px; padding-right: 3px; } .style4 {font-size: 12px; font-weight: bold; } .style5 { font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; } .style6 {padding-top: 2px; padding-bottom: 2px; padding-left: 3px; padding-right: 3px; font-weight: bold; } --> </style> <title>Buku tamu</title> <link rel="shortcut icon" href="icon.png" /> <form action="simpan_bukutamu.php" method="post" onSubmit='return validasi(this)'> <table width="94%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td class="td" colspan=3><h3 align="center"><strong>Buku Tamu</strong></h3></td> </tr> <tr> <td width="191" class="style6">Nama</td> <td class="td" colspan=2><input name="nama" type="text" size="25" maxlength="25" /></td> </tr> <tr> <td width="191" class="style6">E-Mail</td>

<td class="td" colspan=2><input name="email" type="text" size="25" maxlength="25" /> </td> </tr> <tr> <td class="style6">Pesan</td> <td class="td" colspan=2> <textarea name="pesan" rows="5" cols="50"></textarea> </td> </tr> <tr> <td height="56" colspan="3" rowspan="" align="center" class="td"> <input name="submit" type="submit" value="Simpan"> <input name="reset" type="reset" value="Batal"> </td> </tr> </table> </form> <?PHP include "config/koneksi.php"; $sql="SELECT * from bukutamu"; echo " <h2 align='center'> Buku tamu </h2><br>"; echo " <table width='100%' cellpadding='2' cellspacing='2' border='0'>"; $mq=mysql_query($sql) or die(mysql_error()); while($aql=mysql_fetch_array($mq)) { echo "<tr> <td class='td' width='100' bgcolor='#CCCCCC'>Nama</td> <td colspan=6 bgcolor='#EEEEEE'>".$aql['nama']."</td> </tr> <tr> <td class='td' bgcolor='#CCCCCC'>E-Mail</td> <td colspan=6 bgcolor='#EEEEEE'>".$aql['email']."</td> </tr> <tr> <td class='td' bgcolor='#CCCCCC'>Pesan</td> <td colspan=6 bgcolor='#EEEEEE'>".$aql['pesan']."</td> </tr> <tr> <td class='td'>&nbsp;</td> </tr>"; } ?> </table> Simpan_bukutamu.php <?

include "config/koneksi.php"; $id=$_REQUEST['id']; $nama=$_REQUEST["nama"]; $email=$_REQUEST["email"]; $pesan=$_REQUEST["pesan"]; $sql="insert bukutamu values('$id','$nama','$email','$pesan')"; mysql_query($sql) or die (mysql_error()); mysql_close(); header("location:indexs.php?fileid=4") ?> Sejarah.php <?PHP include "config/koneksi.php"; $sql="SELECT * from sejarah"; echo " <table width='100%' cellpadding='2' cellspacing='2' border='0'>"; $mq=mysql_query($sql) or die(mysql_error()); while($aql=mysql_fetch_array($mq)) { echo "<tr> <td colspan=6 align='justify'>".$aql['isi_sejarah']."</td> </tr> <tr> <td class='td'>&nbsp;</td> </tr>"; } ?> </table> Visimisi.php <?PHP include "config/koneksi.php"; $sql="SELECT * from visi_misi"; echo " <table width='100%' cellpadding='2' cellspacing='2' border='0'>"; $mq=mysql_query($sql) or die(mysql_error()); while($aql=mysql_fetch_array($mq)) { echo "<tr> <td colspan=6 align='justify'>".$aql['isi_visi']."</td> </tr> <tr>

<td class='td'>&nbsp;</td> </tr>"; } ?> </table> Tampil_struktur.php <?PHP include "config/koneksi.php"; $sql="SELECT * from struktur"; echo " <center><table alingwidth='100%' cellpadding='2' cellspacing='2' border='0'>"; $mq=mysql_query($sql) or die(mysql_error()); while($aql=mysql_fetch_array($mq)) { echo "<tr> <td colspan=6><h2 align='center'>".$aql['id_judul']."</h2></td> </tr><tr> <td rowspan=9 width='202' bgcolor='#CCCCCC'><img src='photo/$aql[isi_struktur]'></td> </tr> <tr> <td class='td'>&nbsp;</td> </tr>"; } ?> </table> Form_loginmember.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>login</title> <script language="javascript"> function validasi(form){ if (form.username.value == ""){ alert("Anda belum mengisikan Username."); form.username.focus(); return (false); }

if (form.password.value == ""){ alert("Anda belum mengisikan Password."); form.password.focus(); return (false); } return (true); } </script> <style type="text/css"> <!-.style2 { font-size: 24px; color: #F00; } .a { color: #F00; font-weight: bold; } --> </style> </head> <body> <?php echo "<form action='cek_loginsiswa.php' method='POST' onSubmit='return validasi(this)'> <table width='130' height='120' border='0' align='center' > <tr><hr> <td colspan='3' class='a' bgcolor='#CCCCCC' >LOGIN MEMBER</td> </tr> <tr> <td>Username :</td></tr> <tr> <td><input type='text' name='username' /></td> </tr> <tr> <td>Password :</td></tr> <tr> <td><input type='password' name='password' /></td> </tr> <tr> <td height='26' colspan='2'><center><input type='submit' name='Submit' value='Login' /> </td> </tr> <tr>

<td height='26' colspan='2'><a href='indexs.php?fileid=12'>Daftar Jadi Member?</a></td> </tr> </table> </form>"; ?> </body> </html> Cek_loginsiswa.php <?php include "config/koneksi.php"; $pass = md5($_POST[password]); $login = mysql_query("SELECT * FROM siswa WHERE username='$_POST[username]' AND password='$pass'"); $ketemu = mysql_num_rows($login); $r = mysql_fetch_array($login); // Apabila username dan password ditemukan if ($ketemu > 0){ session_start(); session_register("namauser"); session_register("passuser"); $_SESSION[namauser]=$r[username]; $_SESSION[passuser]=$r[password]; header('location:siswa/home.php?fileid=12'); } else{ echo "<center>Login gagal! username & password tidak benar<br>"; echo "<a href=indexs.php?fileid=5><b>ULANGI LAGI</b></a></center>"; } ?> Form_siswa.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>form user</title> <script language="javascript"> function validasi(form){ if (form.username.value == ""){

alert("Anda belum mengisikan Username."); form.username.focus(); return (false); } if (form.password.value == ""){ alert("Anda belum mengisikan Password."); form.password.focus(); return (false); } if (form.nama.value == ""){ alert("data nama masih kosong."); form.nama.focus(); return (false); } if (form.email.value == ""){ alert("data email masih kosong."); form.email.focus(); return (false); } return (true); } </script> <style type="text/css"> <!-.style2 { color: #0000FF; font-size: 18px; font-weight: bold; } --> </style> </head> <body> <p>&nbsp;</p> <form action="input_usersiswa.php" method="post" onSubmit='return validasi(this)'><center> <table width="343" border="0" style="border:solid #00FFFF"> <tr> <td colspan="2" style="border-bottom:solid #0000FF"><span class="style2">Isikan Formulir dibawah ini</span> </td> </tr> <tr> <td width="104">Username</td> <td width="229"><input type="text" name="username" size="15"></td>

</tr> <tr> <td>Password</td> <td><input type="text" name="password" size="15"></td> </tr> <tr> <td>Nama</td> <td><input type="text" name="nama" size="30"></td> </tr> <tr> <td>E-mail</td> <td><input type="text" name="email" size="30"></td> </tr> <tr align="center"> <td colspan="2" style="border-top: solid #0000FF"><input type="submit" name="Submit" value="daftar" />&nbsp;&nbsp; <input type="reset" name="reset" value="Batal" onclick=self.history.back()> </td> </tr> </table> </form> </body> </html> Input_usersiswa.php <? include "config/koneksi.php"; $username=$_REQUEST['username']; $pass=md5($_POST[password]); $nama=$_REQUEST['nama']; $email=$_REQUEST['email']; $sql="insert siswa values('$username','$pass','$nama','$email')"; mysql_query($sql) or die (mysql_error()); mysql_close(); header('location:indexs.php?fileid=13'); ?> HALAMAN ADMIN Index.php <script language="javascript"> function validasi(form){

if (form.username.value == ""){ alert("Anda belum mengisikan Username."); form.username.focus(); return (false); } if (form.password.value == ""){ alert("Anda belum mengisikan Password."); form.password.focus(); return (false); } return (true); } </script> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body><center> <div id="header"><tr> <td><div id="content" > <h2 align="center">Login</h2> <?php echo "<form action='cek_login.php' method='POST' onSubmit='return validasi(this)'> <table width='374' height='146' border='0' align='center' style='border:solid #00FFFF'> <tr> <td colspan='3' style='border-bottom:solid #0000CC'><span class='style2'>Login</span></td> </tr> <tr> <td width='114' rowspan='3' align='center'><img src='images/loginwelcome.gif' width='61' height='63' /></td> <td width='71'>Username</td> <td width='167'> : <input type='text' name='username' /></td> </tr> <tr> <td>Password</td> <td> : <input type='password' name='password' /></td> </tr> <tr> <td height='26' colspan='2'><input type='submit' name='Submit' value='Login' /> </td> </tr> </table>

</form>"; ?> <p>&nbsp;</p> </div> </div> Home.php <?php session_start(); if (empty($_SESSION[namauser]) AND empty($_SESSION[passuser])){ echo "<link href='../config/adminstyle.css' rel='stylesheet' type='text/css'> <center>Untuk mengakses modul, Anda harus login <br>"; echo "<a href=form_login.php><b>LOGIN</b></a></center>"; } else{ ?> <body bgcolor='#666666'> <?php echo "<center><table id='table1' width='850' height='175' border='1' cellspacing=0 cellspadding=0> <tr> <td valign='top' colspan='6' width='100%'>"; ?> <? include "header.php"?></td> </tr> <tr> <td valign="top" width="150" height="75" bgcolor="#C0C0C0"><? include "kiri.php"?></td> <td valign="top" width="700" height="75" bgcolor="white"><p align=justify> <?PHP if ($_REQUEST['fileid']==1) {include "form_utama.php";} elseif ($_REQUEST['fileid']==2) {include "form_sejarah.php";} elseif ($_REQUEST['fileid']==3) {include "form_visi.php";} elseif ($_REQUEST['fileid']==4) {include "form_struktur.php";} elseif ($_REQUEST['fileid']==6) {include "form_kontak.php";} elseif ($_REQUEST['fileid']==7) {include "tampil_materi1.php";} elseif ($_REQUEST['fileid']==71) {include "form_materi1.php";}

elseif ($_REQUEST['fileid']==8) {include "tampil_materi2.php";} elseif ($_REQUEST['fileid']==81) {include "form_materi2.php";} elseif ($_REQUEST['fileid']==9) {include "tampil_materi3.php";} elseif ($_REQUEST['fileid']==91) {include "form_materi3.php";} elseif ($_REQUEST['fileid']==13) {include "tampil_user.php";} elseif ($_REQUEST['fileid']==131) {include "form_user.php";} elseif ($_REQUEST['fileid']==132) {include "edit_user.php";} elseif ($_REQUEST['fileid']==14) {include "tampil_guru.php";} elseif ($_REQUEST['fileid']==141) {include "form_guru.php";} elseif ($_REQUEST['fileid']==142) {include "edit1_guru.php";} elseif ($_REQUEST['fileid']==143) {include "detail_guru.php";} elseif ($_REQUEST['fileid']==144) {include "cari_guru.php";} elseif ($_REQUEST['fileid']==15) {include "tampil_membersiswa.php";} elseif ($_REQUEST['fileid']==151) {include "edit_polling.php";} elseif ($_REQUEST['fileid']==16) {include "tampilin_bukutamu.php";} elseif ($_REQUEST['fileid']==18) {include "homes.php";} ?></td> </tr> <tr> <td bgcolor=#C0C0C0 colspan="3" valign="top"><? require ("footer.php")? ></td></tr> </table> <? } ?> </body> Kiri.php <html> <head></head>

<style type="text/css"> A:link, A:active{ font-family: verdana, arial, helvetica, geneva, sans-serif; font-size: 12px; color : blue; text-decoration :none; } A:vlink { font-family: verdana, arial, helvetica, geneva, sans-serif; color : red; font-size: 12px; text-decoration :none; } A:visited { font-family: verdana, arial, helvetica, geneva, sans-serif; font-size: 12px; color : blue; text-decoration :none; } A:hover { text-decoration: underline; font-weight : bold; font-size: 12px; color : red; } .a { color: #F00; } .a { color: #F00; } </style> <body> <?php echo"<table width='156' height='175' border='0' cellspacing=0 cellspadding=0> <tr> <td valign='top' width='150' height='75' bgcolor='#FFFFFF'> <table border='0' width='100%'> <tr> <td bgcolor='#CCCCCC'><strong class='a'>OLAH ARTIKEL</strong></td></tr> <tr> <td> + <a href='home.php?fileid=1'>Home</a><br> + <a href='home.php?fileid=2'>Sejarah</a><br>

+ <a href='home.php?fileid=3'>Visi dan misi</a><br> + <a href='home.php?fileid=4'>Struktur Organisasi</a><br> + <a href='home.php?fileid=6'>Kontak</a><br> </tr> <tr> </tr> </table><br><hr /> <table border='0' width='100%'> <tr> <td bgcolor='#CCCCCC'><strong class='a'>OLAH MATERI</strong></td></tr> <tr> <td> + <a href='home.php?fileid=7'>kelas 1</a><br> + <a href='home.php?fileid=8'>kelas 2</a><br> + <a href='home.php?fileid=9'>kelas 3</a><br> </table><br /><hr /> <table border='0' width='100%'> <tr> <td bgcolor='#CCCCCC'><strong class='a'>OLAH USER</strong></td></tr> <tr> <td> + <a href='home.php?fileid=13'>User</a><br> + <a href='home.php?fileid=14'>Guru</a><br> + <a href='home.php?fileid=15'>Siswa</a><br> + <a href='home.php?fileid=16'>Buku Tamu</a><br> + <a href=logout.php>Keluar</a><br> </table> </td> </tr>";?> </table> </body> </body> </html> Form_utama.php <style type="text/css"> <!-.td { padding-top: 2px; padding-bottom: 2px; padding-left: 3px; padding-right: 3px; } .style4 {font-size: 12px; font-weight: bold; } .style5 {

font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; } .style6 {padding-top: 2px; padding-bottom: 2px; padding-left: 3px; padding-right: 3px; font-weight: bold; } --> </style> <head> <title>halaman utama</title> <link rel="shortcut icon" href="favicon.ico" /> <!-- TinyMCE --> <script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,i nsertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality, fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups" , // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,j ustifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,inde nt,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate ,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,me dia,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym ,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example word content CSS (should be your site CSS) this one removes paragraph margins content_css : "css/word.css",

// Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> <!-- /TinyMCE --> <body> <?php echo "<form action='simpan_utama.php' method='post'> <table width='100%' border='1' align='center' cellpadding='0' cellspacing='0'> <tr> <td class='td' colspan=3><h3 align='center'><strong>Isikan Halaman utama</strong></h3></td> </tr> <tr> <td class='td' colspan=2><textarea name='isi_utama' rows='15' cols='75'></textarea></td> </tr> <tr> <td height='56' colspan='3' rowspan='' align='center' class='td'> <input name='submit' type='submit' value='Simpan'> <input name='reset' type='reset' value='Batal'> </td> </tr> </table> </form>"; ?> <?PHP include "../config/koneksi.php"; $sql="SELECT * from utama"; echo " <h2 align='center'> halaman utama </h2><br>"; echo " <table width='100%' cellpadding='2' cellspacing='2' border='0'>"; $mq=mysql_query($sql) or die(mysql_error()); while($aql=mysql_fetch_array($mq)) { echo "<tr> <td class='td' width='150' bgcolor='#CCCCCC'>id</td>

<td colspan=6 bgcolor='#EEEEEE'>".$aql['id_utama']."</td> </tr> <tr> <td class='td' bgcolor='#CCCCCC'>halaman utama</td> <td colspan=6 bgcolor='#EEEEEE'>".$aql['isi_utama']."</td> </tr> <tr> <td class='td'>&nbsp;</td> <td class='td' align='right'><a href='hapus_utama.php? id_utama=$aql[0]' onClick=\"return confirm('Apakah Anda benar-benar akan menghapus isi halaman utama ini?')\"><input type=submit value='hapus'></a></td> </tr>"; } ?> </table> </body> Form_materi.php <script language="javascript"> function validasi(form){ if (form.TxtNmFile.value == ""){ alert("Anda belum mengisikan materi."); form.TxtNmFile.focus(); return (false); } if (form.TxtJudul.value == ""){ alert("Anda belum mengisikan judul."); form.TxtJudul.focus(); return (false); } if (form.TxtKet.value == ""){ alert("data keterangan masih kosong."); form.TxtKet.focus(); return (false); } return (true); } </script> <?php echo "<form action='simpan_upload1.php' method='post' enctype='multipart/form-data' name='uploadform' target='_self' onSubmit='return validasi(this)'> <table width='425' border='0' cellpadding='1' cellspacing='1'> <tr bgcolor='#FFFFCC'>

<td colspan='2' bgcolor='#00FFFF'> <b>Upload File Materi Kelas 1 Ke Database</b></td> </tr> <tr> <td width='102'><b>File </b></td> <td width='316'><input name='TxtNmFile' type='file' size='32'></td> </tr> <tr> <td><strong>MaPel</strong> </td> <td><input name='TxtJudul' type='text' size='45' maxlength='100'></td> </tr> <tr> <td><b>Keterangan</b></td> <td><textarea name='TxtKet' cols='35' rows='4'></textarea></td> </tr> <tr> <td>&nbsp;</td> <td><input name='simpan' type='submit' value=' Simpan '></td> </tr> </table> </form>"; ?> Simpan_upload1.php <?php $NamaFile = $_FILES['TxtNmFile']['name']; $TmpNama = $_FILES['TxtNmFile']['tmp_name']; $UkuranFile = $_FILES['TxtNmFile']['size']; $TipeFile = $_FILES['TxtNmFile']['type']; $TxtJudul =$_POST['TxtJudul']; $TxtKet =$_POST['TxtKet']; $BukaFile = fopen($TmpNama, 'r'); $IsiFile = fread($BukaFile, $UkuranFile); fclose($BukaFile); if(!get_magic_quotes_gpc()){ $NamaFile = addslashes($NamaFile); } include "../config/koneksi.php";

$sql_upload = "INSERT INTO upload_kelas1 (judul, namafile, tipe, ukuran, keterangan) ". "VALUES ('$TxtJudul','$NamaFile', '$TipeFile', '$UkuranFile', '$TxtKet')"; mysql_query($sql_upload) or die('Gagal menyimpan'); mysql_close(); header("location:home.php?fileid=7") ?> Tampil_materi1.php <?php include "../config/koneksi.php"; echo " <h2>DATA MATERI KELAS 1</h2> <form method=POST action='home.php?fileid=71'> <input type=submit value='Tambah materi'></form> <table width=100%> <tr><th bgcolor='#CCCCCC'>no</th> <th bgcolor='#CCCCCC'>judul</th> <th bgcolor='#CCCCCC'>isi file</th> <th bgcolor='#CCCCCC'>keterangan</th> <th colspan=2 bgcolor='#CCCCCC'>aksi</th></tr>"; $tampil=mysql_query("SELECT * FROM upload_kelas1 ORDER BY id_upload"); while ($r=mysql_fetch_array($tampil)){ echo "<tr><td bgcolor='#EEEEEE'>$r[id_upload]</td> <td bgcolor='#EEEEEE'>$r[judul]</td> <td bgcolor='#EEEEEE'>$r[namafile]</td> <td bgcolor='#EEEEEE'>$r[keterangan]</td> <td bgcolor='#EEEEEE' align='center'><a href=hapus_materi1.php? id_upload=$r[id_upload] onClick=\"return confirm('Apakah Anda benar-benar akan menghapus $aql[id_upload]?')\"><input type=submit value='hapus'></a></td> </tr>"; } echo "</table>"; ?> Tampil_guru.php <?PHP include "../config/koneksi.php"; include "../config/fungsi_indotgl.php"; $sql="SELECT * from guru ORDER BY nip";

echo " <h3 align='center'>DATA GURU</h3> <table> <tr> <td><form method=POST action=home.php?fileid=141> <input type=submit value='Tambah Guru'></form></td> </tr> </table> <table width='100%' align='center' cellpadding='2' cellspacing='2' border='0'> <th class='td' width='70' bgcolor='#CCCCCC'>Nip</th> <th class='td' bgcolor='#CCCCCC'>Nama</th> <th class='td' width='100' bgcolor='#CCCCCC'>Jenis Kelamin</th> <th class='td' width='130' bgcolor='#CCCCCC'>Tanggal Lahir</th> <th class='td' bgcolor='#CCCCCC'>Keterangan</th> <th class='td' width='50' bgcolor='#CCCCCC' colspan=3>Pilih</th></tr> "; $mql=mysql_query($sql) or die(mysql_error()); {if ($mfa[2]==0) $sex="Laki-Laki"; else $sex="Perempuan";} while($aql=mysql_fetch_array($mql)) { if ($aql[2]==0){ $jns_kel="Laki-Laki"; } else { $jns_kel="Perempuan"; } $tanggal=tgl_indo($aql['tgl_lhr']); echo "<tr> <td class='td' align='center' bgcolor='#EEEEEE'>". $aql['nip']."</td> <td class='td' bgcolor='#EEEEEE'>".$aql['nama']."</td> <td class='td' align='center' bgcolor='#EEEEEE'>$jns_kel</td> <td class='td' align='center' bgcolor='#EEEEEE'>$tanggal</td> <td class='td' bgcolor='#EEEEEE'>".$aql['ket']."</td> <td align='center' width='40' bgcolor='#EEEEEE'><a href='home.php?fileid=143&nip=$aql[0]'><input type=submit value='detail'></a></td> <td align='center' width='40' bgcolor='#EEEEEE'><a href='home.php?fileid=142&nip=$aql[0]'><input type=submit value='edit'></a></td>

<td align='center' width='40' bgcolor='#EEEEEE'><a href='hapus_guru.php?nip=$aql[0]' onClick=\"return confirm('Apakah Anda benar-benar akan menghapus $aql[nama]?')\"><input type=submit value='hapus'></a></td> </tr>"; } ?></table> Form_guru.php <script language="javascript"> function validasi(form){ if (form.nip.value == ""){ alert("Anda belum mengisikan NIP."); form.nip.focus(); return (false); } if (form.nama.value == ""){ alert("Anda belum mengisikan nama."); form.nama.focus(); return (false); } if (form.alamat.value == ""){ alert("data alamat masih kosong."); form.alamat.focus(); return (false); } if (form.kota.value == ""){ alert("data kota masih kosong."); form.kota.focus(); return (false); } if (form.telp.value == ""){ alert("data telepon masih kosong."); form.telp.focus(); return (false); } if (form.ket.value == ""){ alert("data keterangan masih kosong."); form.ket.focus(); return (false); } return (true); } </script> <style type="text/css">

<!-.td { padding-top: 2px; padding-bottom: 2px; padding-left: 3px; padding-right: 3px; } .style4 {font-size: 12px; font-weight: bold; } .style5 { font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; } .style6 {padding-top: 2px; padding-bottom: 2px; padding-left: 3px; padding-right: 3px; font-weight: bold; } --> </style> <title>Input Data Guru</title> <link rel="shortcut icon" href="favicon.ico" /> <form action="simpan_guru.php" method="post" enctype="multipart/form-data" onSubmit='return validasi(this)'> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE"> <tr> <td class="td" colspan=3><h3 align="center"><strong>INPUT DATA GURU</strong></h3></td> </tr> <tr> <td width="191" class="style6">NIP</td> <td class="td" colspan=2><input name="nip" type="text" size="10" maxlength="10" /></td> </tr> <tr> <td width="191" class="style6">Nama</td> <td class="td" colspan=2><input name="nama" type="text" size="25" maxlength="25" /> </td> </tr> <tr> <td class="td" ><strong>Jenis Kelamin</strong></td> <td colspan=2><input type="radio" name="jns_kel" value="0"/> <span class="style5">Laki-laki</span> <input type="radio" name="jns_kel" value="1"/> <span class="style5">Perempuan</span> </td> </tr> <tr> <td width="191" class="style6">Tempat & Tanggal Lahir</td>

<td width="105" class="td"><input name="tmpt_lhr" type="text" size="15" maxlength="15" /></td> <td width="454" class="td"><select name="tanggal"> <option value="0" selected>Tanggal <?PHP for ($tgl=1; $tgl<32; $tgl++) echo ("<option value=\"$tgl\">$tgl"); ?> </option></select> <select name="bulan"> <option value="0" selected>Bulan <?php $nama_bln=array(1=> "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"); for ($bln=1; $bln<13; $bln++) echo ("<option value=\"$bln\">$nama_bln[$bln]"); ?> </option></select> <select name="tahun"> <option value="0" selected>Tahun <?PHP $thn_skrg=date("Y"); for ($thn=1970;$thn<=$thn_skrg;$thn++) echo ("<option value=\"$thn\">$thn"); ?> </option></select> </td> </tr> <tr> <td width="191" class="style6">Alamat</td> <td class="td" colspan=2><input name="alamat" type="text" size="35" maxlength="50" /> </td> </tr> <tr> <td width="191" class="style6">Kota</td> <td class="td" colspan=2><input name="kota" type="text" size="15" maxlength="15" /> </td> </tr> <tr> <td width="191" class="style6">No Telpon</td> <td class="td" colspan=2><input name="telp" type="text" size="12" maxlength="12" /> </td> </tr>

<tr> <td class="style6">Photo</td> <td class="td" colspan=2><input type="file" name="photo" /></td> </tr> <tr> <td class="style6">Keterangan</td> <td class="td" colspan=2> <textarea name="ket" rows="5" cols="50"></textarea> </tr> <tr> <td height="56" colspan="3" rowspan="" align="center" class="td"> <input name="submit" type="submit" value="Simpan"> <input name="reset" type="reset" value="Batal" onclick=self.history.back()> </td> </tr> </table> </form> Simpan_guru.php <? include "../config/koneksi.php"; $nip=$_REQUEST["nip"]; $nama=$_REQUEST["nama"]; $jns_kel=$_REQUEST["jns_kel"]; $tmpt_lhr=$_REQUEST["tmpt_lhr"]; $tanggal=$_REQUEST['tanggal']; $bulan=$_REQUEST['bulan']; $tahun=$_REQUEST['tahun']; $tgl_lhr=sprintf("%02d/%02d/%02d",$tahun,$bulan,$tanggal); $alamat=$_REQUEST["alamat"]; $kota=$_REQUEST["kota"]; $telp=$_REQUEST["telp"]; $ket=$_REQUEST["ket"]; $photo=$_FILES['photo']['name']; //$tipe_file=$_FILES['photo']['type']; $lokasi_file=$_FILES['photo']['tmp_name']; //if ($tipe_file != "image/gif" AND //$tipe_file != "image/jpeg" AND //$tipe_file != "image/pjpeg" AND //$tipe_file != "image/png"){ //echo "Upload Gagal !!! <br> //Tipe file <b>$nama_file</b> : $tipe_file <br> //Tipe file yang boleh di upload: gif, jpg dan png.";

</td>

//$direktori="photo/$photo"; move_uploaded_file($lokasi_file,"../photo/$photo"); $sql="insert into guru values('$nip','$nama','$jns_kel','$tmpt_lhr','$tgl_lhr','$alamat','$kota','$telp','$phot o','$ket')"; mysql_query($sql) or die (mysql_error()); mysql_close(); header("location:home.php?fileid=14") ?> HALAMAN SISWA Home.php <?php session_start(); if (empty($_SESSION[namauser]) AND empty($_SESSION[passuser])){ echo "<link href='../config/adminstyle.css' rel='stylesheet' type='text/css'> <center>Untuk mengakses modul, Anda harus login <br>"; echo "<a href=../form_loginmember.php><b>LOGIN</b></a></center>"; } else{ ?> <body bgcolor='#666666'> <?php echo "<center><table id='table1' width='850' height='175' border='1' cellspacing=0 cellspadding=0> <tr> <td valign='top' colspan='6' width='100%'>"; ?> <? include "header.php"?></td> </tr> <tr> <td valign="top" width="150" height="75" bgcolor="#C0C0C0"><? include "kiri.php"?></td> <td valign="top" width="700" height="75" bgcolor="white"><p align=justify> <?PHP if ($_REQUEST['fileid']==1) {include "tampil_home.php";} if ($_REQUEST['fileid']==2) {include "tampil_membersiswa.php";} if ($_REQUEST['fileid']==3) {include "tampil_kontak.php";} if ($_REQUEST['fileid']==4)

{include "form_bukutamu.php";} if ($_REQUEST['fileid']==5) {include "sejarah.php";} if ($_REQUEST['fileid']==6) {include "tampil_misi.php";} if ($_REQUEST['fileid']==7) {include "tampil_struktur.php";} if ($_REQUEST['fileid']==8) {include "tampil_galeri.php";} if ($_REQUEST['fileid']==9) {include "download_materi1.php";} if ($_REQUEST['fileid']==10) {include "download_materi2.php";} if ($_REQUEST['fileid']==11) {include "download_materi3.php";} if ($_REQUEST['fileid']==12) {include "homes.php";} ?></td> </tr> <tr> <td bgcolor=#C0C0C0 colspan="3" valign="top"><? require ("../footer.php")? ></td></tr> </table> <? } ?> </body> Kiri.php <html> <head></head> <style type="text/css"> A:link, A:active{ font-family: verdana, arial, helvetica, geneva, sans-serif; font-size: 12px; color : blue; text-decoration :none; } A:vlink { font-family: verdana, arial, helvetica, geneva, sans-serif; color : red; font-size: 12px; text-decoration :none; } A:visited { font-family: verdana, arial, helvetica, geneva, sans-serif;

font-size: 12px; color : blue; text-decoration :none; } A:hover { text-decoration: underline; font-weight : bold; font-size: 12px; color : red; } .a { color: #F00; } .a { color: #F00; } </style> <body> <?php echo"<table width='156' height='175' border='0' cellspacing=0 cellspadding=0> <tr> <td valign='top' width='150' height='75' bgcolor='#FFFFFF'> <table border='0' width='100%'> <tr> <td bgcolor='#CCCCCC'><strong class='a'>MENU UTAMA</strong></td></tr> <tr> <td> + <a href='home.php?fileid=1'>Home</a><br> + <a href='home.php?fileid=5'>Sejarah</a><br> + <a href='home.php?fileid=6'>Visi dan misi</a><br> + <a href='home.php?fileid=7'>Struktur Organisasi</a><br> </tr> <tr> </tr> </table><br><hr /> <table border='0' width='100%'> <tr> <td><strong class='a'>DOWNLOAD MATERI</strong></td></tr> <tr> <td> + <a href='home.php?fileid=9'>kelas 1</a><br> + <a href='home.php?fileid=10'>kelas 2</a><br> + <a href='home.php?fileid=11'>kelas 3</a><br><br> <tr>

<td><a href='logout.php'>keluar</a></td></tr> </table> </td> </tr> </table>";?> </body> </body> </html> Download_materi1.php <html> <head> <title></title> </head> <body> <table width="400" border="0"> <tr> <td colspan="2" bgcolor="#00FFFF"> <strong>Daftar File Materi Kelas 1 </strong></td> </tr> <?php include "../config/koneksi.php"; $sql_upload = "SELECT * FROM upload_kelas1 ORDER BY id_upload"; $qry_upload = mysql_query($sql_upload) or die('Gagal query'.mysql_error()); while($data = mysql_fetch_array($qry_upload)) { ?> <tr> <td width="108">Judul File </td> <td width="282"><?php echo $data['judul']; ?></td> </tr> <tr> <td>Nama File </td> <td><?php echo $data['namafile']; ?></td> </tr> <tr> <td>Keterangan</td> <td><?php echo $data['keterangan']; ?></td> </tr> <tr> <td>&nbsp;</td> <td>[ <a href="dbs_download.php?iddata=<?php echo $data['id_upload']; ? >">Download </a> ]</td>

</tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <?php } mysql_close(); ?> </table> </body> </html> Tampil_membersiswa.php <?php include "../config/koneksi.php"; echo "<h2><center>Daftar Siswa yang Jadi Member</h2> <table width=100%> <tr><th bgcolor='#CCCCCC'>no</th> <th bgcolor='#CCCCCC'>username</th> <th bgcolor='#CCCCCC'>nama lengkap</th> <th bgcolor='#CCCCCC'>e-mail</th> </tr>"; $tampil=mysql_query("SELECT * FROM siswa ORDER BY username"); $no=1; while ($r=mysql_fetch_array($tampil)){ echo "<tr><td bgcolor='#EEEEEE'>$no</td> <td bgcolor='#EEEEEE'>$r[username]</td> <td bgcolor='#EEEEEE'>$r[nama]</td> <td bgcolor='#EEEEEE'><a href=mailto: $r[email]>$r[email]</a></td> </tr>"; $no++; } echo "</table>"; ?>

Vous aimerez peut-être aussi