Informasi Berbasis Web SMP Negeri 5 Medan

LAMPIRAN LISTING PROGRAM Index.html

  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html ns="http://www.w3.org/1999/xhtml" xml:lang="EN" lang="EN" dir="ltr"> <head profile="http://gmpg.org/xfn/11"> <title>SMP Negeri 5 Medan | Beranda</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="imagetoolbar" content="no" /> <link rel="stylesheet" href="styles/layout.css" type="text/css" /> <script type="text/javascript" src="scripts/jquery-1.4.1.min.js"></script> <script type="text/javascript" src="scripts/jquery- slidedeck.pack.lite.js"></script> <style type="text/css"> <!-- .style1 {font-size: 10px}

  • > </style> </head> <body id="top"> <div class="wrapper row1"> <div id="header" class="clear">

  <div class="fl_left"> <h1><a href="index.html">SMP NEGERI 5 MEDAN</a></h1> <p class="style1">Jln. Stasiun Desa Besar Kel. Martubung Kec. Medan Labuhan, 20251</p> <p class="style1">Telp. 061-6852945 Email: <a href="yahoo.com">smpn5@disdikmedan.org</a> </p> </div> </div> </div> <!-- #################################################################--> <div class="wrapper row2"> <div id="topnav"> <ul> <li class="active"><a href="index.html">BERANDA</a></li> <li> <div align="center"><a href="profil.php">PROFIL</a></div>

  <ul> <li><a href="profil.php">Profil Sekolah</a></li> <li><a href="struktur.php">Struktur Organisasi</a></li> <li><a href="kepsek.php">Kepala Sekolah</a></li> <li><a href="wakepsek.php">Wakil Kepala Sekolah</a></li> <li><a href="guru_data.php">Data Guru</a></li>

  </ul> </li> <li><a href="berita.php">BERITA</a></li> <li><a href="siswa_data.php">AKADEMIK</a> <li><a href="ekstra.php">EKSTRAKURIKULER</a></li>

  <li><a href="#">Arsip</a> <ul>

  <li><a href="pr_alumni.php">Alumni</a></li> <li><a href="index_bukutamu.php">Buku Tamu</a></li>

  </ul> <li class="last"><a href="gallery.php">Gallery</a></li> </ul> <div class="clear"></div> </div> </div> <!-- ##################################################################--> <div class="wrapper row3"> <div id="featured_slide"> <!-- ##################################################################-->

  <dl class="slidedeck"> <dt>Welcome</dt>

  <dd><img src="images/depan.jpg" alt="" /></dd> <dt>SMP Negeri 5 Medan</dt>

  <dd><img src="images/lapangan.jpg" alt="" /></dd> <dt> </dt> <dd><img src="images/perpustakaan.jpg" alt="" /></dd> <dt> </dt> <dd><img src="images/denah.jpg" alt="denah" width="736" height="360" /></dd> <dt> </dt> <dd><img src="images/piala.jpg" alt="" /></dd> </dl> </div> <!-- #################################################################--> </div> <!-- ################################################################--> <div class="wrapper row4"> <div id="container" class="clear"> <!-- ##################################################################--> <div id="homepage" class="clear"> <div class="fl_left"> <div align="justify"> <h2 class="title">Kini Dilengkapin Dengan Absensi Finger Print dan Camera CCTV </h2> </div> <div id="hpage_gallery"> <ul class="clear"> <li><a href="cctv.php"><img src="images/DSC01569.JPG" alt="finger print" width="175" height="130" /></a></li> <li class="last"><a href="cctv.php"><img src="images/DSC01553.JPG" alt="cctv" width="175" height="130" /></a></li> </ul> </div> <div id="hpage_socialize"> <ul> <li></li> </ul> </div> </div> <!-- ############### --> <div class="fl_right"> <h2 class="title"> </h2> <div id="hpage_latestnews"> <ul> <li> <div class="imgl"><a href="kbm.php"><img src="images/SMPN-5- Medan.jpg" alt="kepsek" width="158" height="115" /></a></div> <p align="justify" class="latestnews">SMPN 5 Medan Tingkatkan Kualitas KBM. SMPN 5 Medan bertekad untuk meningkatkan kualitas proses belajar mengajar guna menghasilkan siswa-siswi berprestasi, berbudaya dan memiliki karakteristik sesuai dengan amanat yang tercantum dalam UUD 1945, Demikian dikatakan Kepala Sekolah SMPN 5 Medan</p><p class="readmore"><a href="kbm.php">Lihat Selengkapnya »</a></p> </li> </ul> </div> </div> </div>

  <div class="fl_right"> <div id="hpage_latestnews">

  <ul> <li> <div><strong><a href="login_admin.php">SIGN IN ADMIN</a></strong></div> </li> </ul> </div> </div>

  <!-- ##################################################################--> </div> </div> <!-- ##################################################################--> <div id="footer"> <img src="images/baseBar.jpg" alt="basebar" width="967" height="3" /> <div id="back">

  <a href="index.html"><img src="images/back.png" alt="back" width="11" height="11" />  back to SMP Negeri 5 home </a><br> <a href="index.html" onclick="var wind=window.open('index.php','rsswindow','status=yes,menubar= yes,scrollbars=yes,toolbar=yes,location=yes,resizable=yes');wind.focus();" style="text-decoration:none;border:none;color:#f0f0f0;" title="SMP Negeri 5 Medan"></a>

  <a href="https://twitter.com/#!/smpnegeri5medan" onclick="popup('http://www.twitter.com/smpnegeri5medan')" style="text- decoration:none;border:none;color:#f0f0f0;" title="Follow Us on Twitter"><img src="images/twitter_logo.gif" alt="twitter" width="27" height="25" /></a>

  <a href="http://www.facebook.com/#!/groups/166760590043176/" onclick="popup('http://www.facebook.com/#!/groups/166760590043176/')" style="text-decoration:none;border:none;color:#f0f0f0;" title="Become Fans on Facebook"><img src="images/fb_logo.gif" alt="fb" width="27" height="25" /></a></div>

  <div id="footLinks"> <!-- ##################################################################--> <div class="wrapper"> <div id="copyright" class="clear"> <p class="fl_left">Copyright © 2012 - Ismail 092406121</p> <p class="fl_right">Template by <a href="http://www.os-templates.com/" title="Free Website Templates">OS Templates</a></p> </div> </div> <script type="text/javascript">$('.slidedeck').slidedeck();</script> </body> </html>

Layout.css

  /* Template Name: Education Time File: Layout CSS Author: OS Templates Author URI: http://www.os-templates.com/ Licence: <a href="http://www.os-templates.com/template-terms">Website Template Licence</a>

  • / @import url(navi.css); @import url(forms.css); @import url(tables.css); @import url(homepage.css); @import url(gallery.css);

  @import url(featured_slide.css); body{ margin:0; padding:0; font-size:13px; font-family:Georgia, "Times New Roman", Times, serif; color:#F8F8F2; background-color:#03274B; } img{margin:0; padding:0; border:none;}

  .justify{text-align:justify;} .bold{font-weight:bold;} .center{text-align:center;} .right{text-align:right;}

  .clear:after{content:"."; display:block; height:0; clear:both; visibility:hidden; line-height:0;} .clear{display:inline-block;} html[ns] .clear{display:block;}

  • html .clear{height:1%;} a{outline:none; text-decoration:none;} .fl_left{float:left;} .fl_right{float:right;} .imgholder, .imgl, .imgr{padding:4px; border:1px solid #D7DBE0;} .imgl{float:left; margin:0 15px 15px 0; clear:left;} .imgr{float:right; margin:0 0 15px 15px; clear:right;}

  /* ----------------------------------------------Wrapper-------------------------

  • / div.wrapper{ display:block; width:100%; text-align:left; } div.wrapper h1, div.wrapper h2, div.wrapper h3, div.wrapper h4, div.wrapper h5, div.wrapper h6{ margin:0 0 15px 0; padding:0; font-size:20px; font-weight:normal; line-height:normal; }

  .row1{color:#5F8EC2; background-color:#03274B;} .row1 a{color:#F8F9F3; background-color:#03274B;} .row2{color:#F8F9F3; background-color:#072C53; border-top:1px solid #2B4D71; border-bottom:1px solid #2B4D71;} .row3{color:#777777; background:url("../images/featured_slide_bg.gif") top left repeat-x #F8F9F3;} .row4{color:#777777; background-color:#F8F9F3; border-bottom:2px solid #03274B;} .row5{padding:50px 0 30px 0; border-top:1px solid #F8F9F3;} /* ----------------------------------------------Generalise----------------------

  • / #header, #featured_slide, #container, #footer, #copyright{ position:relative; margin:0 auto 0; display:block; width:960px; }

  /* ----------------------------------------------Header--------------------------

  • / #header{ padding:25px 0 30px 0; }

  #header h1, #header p, #header ul{ margin:0; padding:0; list-style:none; line-height:normal; }

  #header h1{font-size:36px; font-variant:small-caps;} #header p{margin-top:4px;}

  /* ----------------------------------------------Content-------------------------

  • / #container{ padding:30px 0; }

  #container h1, #container h2, #container h3, #container h4, #container h5, #container h6{ color:#8199A9; background-color:#F8F9F3; }

  #container a{ color:#591F58; background-color:#F8F9F3; }

  #container .title{ display:block; width:100%; margin:0 0 20px 0; padding:0 0 8px 0; font-size:14px; text-transform:uppercase; border-bottom:5px solid #8199A9; }

  #content{ display:block; float:left; width:430px; }

  /* ------Comments-----*/ #comments{margin-bottom:40px;} #comments .commentlist{margin:0; padding:0;} #comments .commentlist ul{margin:0; padding:0; list-style:none;} #comments .commentlist li.comment_odd, #comments .commentlist li.comment_even{margin:0 0 10px 0; padding:15px; list-style:none;} #comments .commentlist li.comment_odd{color:#666666; background-color:#F7F7F7;} #comments .commentlist li.comment_odd a{color:#591F58; background-color:#F7F7F7;} #comments .commentlist li.comment_even{color:#666666; background-color:#E8E8E8;} #comments .commentlist li.comment_even a{color:#591F58; background- color:#E8E8E8;} #comments .commentlist .author .name{font-weight:bold;} #comments .commentlist .submitdate{font-size:smaller;} #comments .commentlist p{margin:10px 5px 10px 0; padding:0; font-weight:normal; text-transform:none;} #comments .commentlist li .avatar{float:right; border:1px solid #EEEEEE; margin:0 0 0 10px;} /* ----------------------------------------------Column--------------------------

  • / #column{ display:block; float:right; width:300px; }

  display:block; width:300px; margin-bottom:20px; }

  #column .holder h2.title{ display:block; width:100%; height:65px; margin:0; padding:15px 0 0 0; font-size:20px; text-transform:none; line-height:normal; border-bottom:1px dotted #999999; }

  #column .holder h2.title img{ float:left; margin:-15px 8px 0 0; padding:5px; border:1px solid #999999; }

  #column div.imgholder{ display:block; width:290px; margin:0 0 10px 0; }

  #column .holder p.readmore{ display:block; width:100%; font-weight:bold; text-align:right; line-height:normal; }

  /* Featured Block */ #column #featured ul, #column #featured h2, #column #featured p{ margin:0; padding:0; list-style:none; color:#666666; background-color:#F7F7F7; }

  #column #featured a{ color:#591F58; background-color:#F7F7F7; }

  #column #featured li{ display:block; width:250px; margin:0; padding:20px 25px; color:#666666; background-color:#F7F7F7; }

  #column #featured li p.imgholder{ display:block; width:240px; height:90px; margin:20px 0 15px 0; }

  #column #featured li h2{ padding:0 0 8px 0; font-weight:normal; font-family:Georgia, "Times New Roman", Times, serif; line-height:normal; border-bottom:1px dotted #999999; }

  #container #column .readmore a{ display:block; width:100%; margin-top:15px; height:auto; padding-left:0; font-weight:bold; text-align:right; line-height:normal; background:none; }

  #column .latestnews{ display:block; width:100%; margin:0; padding:0; list-style:none; }

  #column .latestnews li{ display:block; width:100%; height:99px; margin:0 0 11px 0; padding:0 0 21px 0; border-bottom:1px dotted #C7C5C8; overflow:hidden; }

  #column .latestnews li.last{ margin-bottom:0; }

  #column .latestnews p{ display:inline; }

  #column .latestnews img{ float:left; margin:0 10px 0 0; padding:4px; border:1px solid #C7C5C8; clear:left; }

  /* ----------------------------------------------Footer--------------------------

  • / #footer{ line-height:2em; background:url("../images/footer_bg.gif") 380px 0 repeat-y; }

  #footer, #footer a{ color:#F8F8F2; background-color:#03274B; }

  #footer h2, #footer p, #footer ul, #footer a, #footer address{ margin:0; padding:0; font-weight:normal; font-style:normal; }

  #footer h2{ margin:0 0 30px 0; padding:0; font-size:22px; color:#7F99A9; background-color:#03274B; }

  #footer .foot_contact{ display:block; float:left; width:380px; margin:0 40px 0 0; padding:0; }

  #footer .foot_contact address{ margin-bottom:30px; }

  #footer .footbox{ display:block; float:left; width:170px; margin:0 15px 0 0; padding:0; font-size:12px; }

  #footer .footbox h2{ margin-bottom:20px; font-size:14px; text-transform:uppercase; }

  #footer .last{ margin:0; }

  /* ----------------------------------------------Copyright-----------------------

  • / #copyright{ padding:15px 0; border-top:1px solid #2B4D71; }

  #copyright p{ margin:0; padding:0; }

  #copyright, #copyright a{ color:#7F99A9; background-color:#03274B; }

Login Admin.php

  <html> <form action="http://localhost/smpnegeri5medan/admin.php" method="post"> <html> <head> <title></title>

  <center> <tr><td><h1 align="center" class="style2"> </h1> <h1 align="center" class="style2">Administrator</h1></td></tr> <tr><td><h1 align="center" class="style2">SMP Negeri 5 Medan</h1></td></tr> <tr></tr> <form action="http://localhost/smpnegeri5medan/admin.php" method="post"> <td width="30" rowspan="4"> </td><p></p> <p align="center"><img src="images/Administrator.png" width="138" height="154" /></p> <td width="50"><b><li>Username :</li></b> </td> <td width="144"><input type="text" name="user" maxlength="40" /></td> </tr> <tr><p></p> <td width="50"><b><li>Password :</li></b></td> <td width="144"><input type="password" name="password" maxlength=40" />

  </td> </tr> <tr><td colspan="4"> </td>

  </tr> <tr><td colspan="3"> </td> <p> </p> <tr> <td><input type="submit" value="Sign in" /> <input type="reset" value="Hapus" />

  </td> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr><td><p style="text-align:right;"></td></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <table border="0" align="center"> </table> </form> </body> </html>

Server.php

  <?php $db = mysql_connect("localhost","root", "") or die("Koneksi gagal."); if(!$db) die("Tidak terkoneksi"); if(!mysql_select_db("admin_sekolah",$db)) die("Database tidak terseleksi.");

  ?>

Admin.php

  <?php $user = $_POST['user']; include ("server.php"); $hasil = mysql_query("select * from admin where user='$user' and password='$password'"); $row = mysql_fetch_array($hasil); if($row[user]==$user and $row[password]=$password) { session_start(); session_register("user"); session_register("password"); $id=$row[id]; $user=$row[user]; $password=$row[password]; if ($row[id]==$id)

  {header("location:./menuadmin.php"); exit; }

  } else { echo("<center><h1>PERINGATAN</h1><br>"); echo("<h3>Login gagal, Username dan password tidak benar <br>"); echo("<A href='login_admin.php'>Kembali</h3></a><br><br></center>");

  } ?>

Koneksi_pr_vii.php

  <?php $host = "localhost"; $user = "root";//adjust according to your mysql setting $pass = ""; //adjust according to your mysql setting, i use no password here $dbName = "data_registrasi"; mysql_connect('localhost','root',''); mysql_select_db($dbName) or die ("Connect Failed !! : ".mysql_error()); ?>

Pr_kelas_vii.php

  <html> <head> <form method="POST"> <center> <h3>Data Siswa Kelas VII-1</h3> </head> <body> <?php $sambung=mysql_connect('localhost','root',''); mysql_select_db('data_registrasi',$sambung); echo"<left>"; echo"<table border=1 width=500>"; echo"<tr> <th bgcolor='yellow'>Nama</th><th bgcolor='yellow'>Nis</th> <th bgcolor='yellow'>Kelas</th><th bgcolor='yellow'>Alamat</th><th bgcolor='yellow'>Tempat, Tanggal Lahir</th> <th bgcolor='yellow'>Agama</th><th bgcolor='yellow'>No. Telepon</th> </tr> <tr>"; $sql="select*from registrasi"; $a=mysql_query($sql); while($data=mysql_fetch_array($a)) { echo"<tr align=left>"; echo"<td>$data[nama]</td>"; echo"<td>$data[nis]</td>"; echo"<td>$data[kelas]</td>"; echo"<td>$data[alamat]</td>"; echo"<td>$data[tempat_tanggal_lahir]</td>"; echo"<td>$data[agama]</td>"; echo"<td>$data[no_telepon]</td>"; echo"</tr>"; } echo"</table></left>"; { echo "<center><p><p></p>

  <p></p><h2><a href=index.html></p></a></h2></center>"; } //{ echo "<center></center>"; } ?> <br /> <h4><a href="edit_pr_kelas_vii.php">Registrasi Data Siswa</a></h4> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br />

Edit_pr_kelas_vii.php

  <html> <form action="proses_form_insert_siswa_vii.php" method="post"> <html> <head> <title>Registrasi Siswa</title> <form method="POST"> <center><tr><td><h1>Registrasi Data Siswa</h1></td></tr></center> <?php $koneksi=mysql_connect("localhost","root",""); mysql_select_db("data_registrasi"); ?> <form action="proses_form_insert_siswa_vii.php" method="POST"> <table border="1" align="center"> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr><tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr><td>Nama</td><td><input type="text" name="nama" value=""></td></tr> <tr><td>NIS</td><td><input type="text" name="nis" value=""></td></tr> <tr><td>Kelas</td><td><input type="text" name="kelas" value=""></td></tr> <tr><td>Alamat</td><td><input type="text" name="alamat" value=""></td></tr> <tr><td>Tempat, Tanggal Lahir</td><td><input type="text" name="tempat_tanggal_lahir" value=""></td></tr> <tr><td>Agama</td><td><input type="text" name="agama" value=""></td></tr> <tr><td>No. Telepon</td><td><input type="text" name="no_telepon" value=""></td></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr>

  <tr><td><p style="text-align:right;"><input type="submit" name="submit" value="Registrasi"></td></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <table border="0" align="center"> </table> </form> <?php if($submit == "Registrasi") { $query=mysql_query("insert into registrasi values('$username','$nama','$nis','$kelas','$alamat','$tempat_tanggal_lahir','$ag ama','$no_telepon','$pass')"); } else {} ?> </body> </html>

Formupdate_pr_vii..php

  <?php include 'koneksi_pr_vii.php'; $nis = $_GET['nis']; //get the no which will updated $query = "SELECT * FROM registrasi WHERE nis = $nis"; //get the data that will be updated $hasil = mysql_query($query); $data = mysql_fetch_array($hasil); ?> <form method="post" action="proses_update_pr_vii.php"> <table width="500" border="0" cellpadding="2" cellspacing="2"> <tr bgcolor="yellow"> <td height="21" colspan="3"> <strong> Form Update</strong> </td> <tr> <td>Nama</td> <td>:</td> <td> <input type="text" name="nama" value="<?php echo $data['nama']; ?>"> </td> </tr> <tr> <td width="23%">NIS </td> <td width="2%">:</td> <td width="75%"> <input type="text" name="nis" disabled='disable' value="<?php echo $data['nis']; ?>"> </td> </tr> <tr> <td>Kelas</td> <td>:</td> <td> <input type="text" name="kelas" value="<?php echo $data['kelas']; ?>"> </td> </tr> <tr> <tr> <td>Alamat</td> <td>:</td> <td> <textarea name="alamat"><?php echo $data['alamat']; ?></textarea></td> </tr>

  <td>Tempat, Tanggal Lahir</td> <td>:</td> <td> <input type="text" name="tempat_tanggal_lahir" value="<?php echo $data['tempat_tanggal_lahir']; ?>"> </td> </tr> <tr> <td>Agama</td> <td>:</td> <td> <input type="text" name="agama" value="<?php echo $data['agama']; ?>"> </td> </tr> <tr> <td>No. Telepon</td> <td>:</td> <td> <input type="text" name="no_telepon" value="<?php echo $data['no_telepon']; ?>"> </td> </tr> <td></td> <td></td> <td> <input type="hidden" name="nis" value="<?php echo $data['nis']; ?>"> <input type="SUBMIT" name="SUBMIT" value="Save"></td> </tr> </table> </form>

Proses_hapus_pr_vii.php

  <?php include 'koneksi_pr_vii.php'; $nis = $_GET['nis']; //get the no which will delete $query = "SELECT * FROM registrasi WHERE nis = $nis"; //get the data that will be delete $hasil = mysql_query($query); $data = mysql_fetch_array($hasil); //query for delete data in database $query = "delete from registrasi where NIS = '$nis'"; $hasil = mysql_query($query); //see the result if ($hasil) { include "edit_pr_siswa_vii.php"; echo "<h4> Delete data success </h4>"; } ?>

Koneksi_nil_vii.php

  <?php $host = "localhost"; $user = "root";//adjust according to your mysql setting $pass = ""; //adjust according to your mysql setting, i use no password here $dbName = "nilai"; mysql_connect('localhost','root',''); mysql_select_db($dbName) or die ("Connect Failed !! : ".mysql_error()); ?>

  Kelas_vii.php

  <head> <form method="POST"> <center> <center><h3>Daftar Nilai Siswa<p> Kelas VII-1</h3></center> </head> <body> <?php $sambung=mysql_connect('localhost','root',''); mysql_select_db('nilai',$sambung); echo"<center>"; echo"<table border=1 width=500>"; echo"<tr> <th bgcolor='yellow'>NAMA</th><th bgcolor='yellow'>NIS</th><th bgcolor='yellow'>Agama</th> <th bgcolor='yellow'>PKN</th><th bgcolor='yellow'>B.Indo</th><th bgcolor='yellow'>B.Ing</th> <th bgcolor='yellow'>MTK</th><th bgcolor='yellow'>IPA</th><th bgcolor='yellow'>IPS</th> <th bgcolor='yellow'>A.Industri</th><th bgcolor='yellow'>S.Budaya</th> <th bgcolor='yellow'>Penjas</th><th bgcolor='yellow'>TIK</th></tr> <tr>"; $sql="select*from kelas_vii"; $a=mysql_query($sql); while($data=mysql_fetch_array($a)) { echo"<tr align=center>"; echo"<td>$data[nama]</td>"; echo"<td>$data[nis]</td>"; echo"<td>$data[agama]</td>"; echo"<td>$data[pkn]</td>"; echo"<td>$data[b_indo]</td>"; echo"<td>$data[b_ing]</td>"; echo"<td>$data[mtk]</td>"; echo"<td>$data[ipa]</td>"; echo"<td>$data[ips]</td>"; echo"<td>$data[a_industri]</td>"; echo"<td>$data[s_budaya]</td>"; echo"<td>$data[penjas]</td>"; echo"<td>$data[tik]</td>"; echo"</tr>"; } echo"</table></center>"; { echo "<center><p><p></p>

  <p></p><h2><a href=index.html></p></a></h2></center>"; } //{ echo "<center><h3></li></h3></center>"; } ?>

Edit_nil_vii.php

  <html> <form action="proses_nilai_vii.php" method="post"> <html> <head> <title><h4>Nilai Siswa SMP Negeri 5 Medan</h4></title> <form method="POST"> <tr><td><h3>Nilai Kelas VII-1</h3></td></tr> <?php $koneksi=mysql_connect("localhost","root",""); mysql_select_db("nilai"); ?> <form action="proses_nilai_vii.php" method="POST"> <table border="1" align="center"> <tr></tr> <tr></tr> <tr></tr>

  <tr></tr><tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr><td>Nama</td><td><input type="text" name="nama" value=""></td></tr> <tr><td>NIS</td><td><input type="text" name="nis" value=""></td></tr> <tr><td>Agama</td><td><input type="text" name="agama" value=""></td></tr> <tr><td>PKN</td><td><input type="text" name="pkn" value=""></td></tr> <tr><td>B.Indo</td><td><input type="text" name="b_indo" value=""></td></tr> <tr><td>B.Ing</td><td><input type="text" name="b_ing" value=""></td></tr> <tr><td>MTK</td><td><input type="text" name="mtk"></td></tr> <tr><td>IPA</td><td><input type="text" name="ipa"></td></tr> <tr><td>IPS</td><td><input type="text" name="ips"></td></tr> <tr><td>A.Industri</td><td><input type="text" name="a_industri"></td></tr> <tr><td>S.Budaya</td><td><input type="text" name="s_budaya"></td></tr> <tr><td>Penjas</td><td><input type="text" name="penjas"></td></tr> <tr><td>TIK</td><td><input type="text" name="tik"></td></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr><td><p style="text-align:right;"><input type="submit" name="Input Nilai" value="Input Nilai"></td></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <tr></tr> <table border="1" align="center"> </table> </form> <?php if($submit == "input_nilai") { $query=mysql_query("insert into kelas_vii values('$nama','$nis','$agama','$pkn','$b_indo','$b_ing','$mtk','$ipa','$ips','$a _industri','$s_budaya','$penjas','$tik')"); } else {} ?> </body> </html>

Formupdate_nil_vii.php

  <?php include 'koneksi_nil_vii.php'; $nis = $_GET['nis']; //get the no which will updated $query = "SELECT * FROM kelas_vii WHERE nis = $nis"; //get the data that will be updated $hasil = mysql_query($query); $data = mysql_fetch_array($hasil); ?> <form method="post" action="proses_update_nil_vii.php"> <table width="500" border="0" cellpadding="2" cellspacing="2"> <tr bgcolor="yellow"> <td height="21" colspan="3"> <strong> Form Update</strong> </td>

  <td>Nama</td> <td>:</td> <td> <input type="text" name="nama" value="<?php echo $data['nama']; ?>"> </td> </tr> <tr> <td width="23%">NIS </td> <td width="2%">:</td> <td width="75%"> <input type="text" name="nis" disabled='disable' value="<?php echo $data['nis']; ?>"> </td> </tr> <tr> <td>Agama</td> <td>:</td> <td> <input type="text" name="agama" value="<?php echo $data['agama']; ?>"> </td> </tr> <tr> <tr> <td>PKN</td> <td>:</td> <td> <input type="text" name="pkn" value="<?php echo $data['pkn']; ?>"> </td> </tr> <tr> <td>B.Indo</td> <td>:</td> <td> <input type="text" name="b_indo" value="<?php echo $data['b_indo']; ?>"> </td> </tr> <tr> <td>B_Ing</td> <td>:</td> <td> <input type="text" name="b_ing" value="<?php echo $data['b_ing']; ?>"> </td> </tr> <tr> <td>MTK</td> <td>:</td> <td> <input type="text" name="mtk" value="<?php echo $data['mtk']; ?>"> </td> </tr> <tr> <tr> <td>IPA</td> <td>:</td> <td> <input type="text" name="ipa" value="<?php echo $data['ipa']; ?>"> </td> </tr> <tr> <td>IPS</td> <td>:</td> <td> <input type="text" name="ips" value="<?php echo $data['ips']; ?>"> </td> </tr> <tr> <td>A.Industri</td> <td>:</td> <td> <input type="text" name="a_industri" value="<?php echo $data['a_industri']; ?>"> </td> </tr> <tr> <td>S.Budaya</td> <td>:</td> <td> <input type="text" name="s_budaya" value="<?php echo $data['s_budaya']; ?>"> </td> </tr> <tr> <tr> <td>Penjas</td> <td>:</td> <td> <input type="text" name="penjas" value="<?php echo $data['penjas']; ?>"> </td> </tr>

  <td>TIK</td> <td>:</td> <td> <input type="text" name="tik" value="<?php echo $data['tik']; ?>"> </td> </tr> <td></td> <td></td> <td> <input type="hidden" name="nis" value="<?php echo $data['nis']; ?>"> <input type="SUBMIT" name="SUBMIT" value="Save"></td> </tr> </table> </form>

Proses_hapus_nil_vii.php

  <?php include 'koneksi_nil_vii.php'; $nis = $_GET['nis']; //get the no which will delete $query = "SELECT * FROM kelas_vii WHERE nis = $nis"; //get the data that will be delete $hasil = mysql_query($query); $data = mysql_fetch_array($hasil); //query for delete data in database $query = "delete from kelas_vii where NIS = '$nis'"; $hasil = mysql_query($query); //see the result if ($hasil) { include "edit_nil_siswa_vii.php"; echo "<h4> Delete data success </h4>"; } ?>

Koneksi_guru.php

  <?php $host = "localhost"; $user = "root";//adjust according to your mysql setting $pass = ""; //adjust according to your mysql setting, i use no password here $dbName = "data_registrasi_guru"; mysql_connect('localhost','root',''); mysql_select_db($dbName) or die ("Connect Failed !! : ".mysql_error()); ?>