LAMPIRAN A : LISTING PROGRAM

  

LAMPIRAN A : LISTING PROGRAM

  ?php session_start(); ?><!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>SMA NEGERI 1 BABALAN</title> <meta name="keywords" content="fresh zone, free theme, free templates, templatemo, dualSlider, CSS, HTML" /> <meta name="description" content="Fresh Zone Theme, free CSS template provided by templatemo.com" /> <link href="css/templatemo_style.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" /> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/ddsmoothmenu.js"> /***********************************************

  • Smooth Navigational Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
  • This notice MUST stay intact for legal use
  • Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code

  • / </script> <script type="text/javascript"> ddsmoothmenu.init({ mainmenuid: "templatemo_menu", //menu DIV id orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v" classname: 'ddsmoothmenu', //class added to menu's outer DIV

  //customtheme: ["#1c5a80", "#18374a"], contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"] }) </script> <link rel="stylesheet" type="text/css" media="all" href="css/jquery.dualSlider.0.2.css" /> <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script> <script src="js/jquery.easing.1.3.js" type="text/javascript"></script> <script src="js/jquery.timers-1.2.js" type="text/javascript"></script> <script src="js/jquery.dualSlider.0.3.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $("#carousel").dualSlider({ auto:true, autoDelay: 6000, easingCarousel: "swing", easingDetails: "easeOutBack", durationCarousel: 1000, durationDetails: 600 }); }); </script> </head> <body> <?php include "header.php"; ?> <!-- END of templatemo_header_wrapper --> <!-- /details_wrapper --><br /> <?php $p=$_REQUEST['p']; if($p)

  { include "$p"; } else { include "content.php"; } ?> <!-- END of templatemo_main -->

  <div id="templatemo_footer_wrapper"> <div id="templatemo_footer">

  Copyright © 2048 <a href="#">Your Company Name</a> | Designed by <a href="http://www.templatemo.com" target="_parent">Free CSS Templates</a> </div> <!-- END of templatemo_footer -->

  </div> <!-- END of templatemo_footer_wrapper --> </body> </html>

  <?php include("admin/koneksi.php"); $username=$_REQUEST['username']; $password=$_REQUEST['password']; if($username!=''& $password!='') {

  $sql= "SELECT * FROM user where username='$username' AND password='$password'";

  $result = mysql_query($sql) or die (mysql_error()); $hasil= mysql_fetch_array($result); if($hasil['username']==$username &&

  $hasil['password']==$password) { session_start(); $_SESSION['pengguna']=$hasil['username'];

  $_SESSION['id']=$hasil['id_user']; header ("location:admin/index.php") } else {

  ?> <script type="text/javascript">

  <!-- alert("Your name or password is wrong..") window.location = "index.php"; //--> </script> <?php

  } } else {

  ?> <script type="text/javascript">

  <!-- alert("Silahkan Login.") window.location = "index.php?p=login.php"; //--> </script>

  <?php }?>

  3. Koneksi.php

  <?php $host="localhost"; $user="root"; $password=""; $koneksi=mysql_connect("$host","$user","$password"); $database=mysql_select_db("tugasakhir"); ?>

  4. Logout.php

  <?php session_start(); unset($_SESSION['pengguna']); session_destroy(); print ("<meta http-equiv=\"refresh\" content=\"0; url=../index.php\">"); ?>

  /* Credit: http://www.templatemo.com

  • / body { margin: 0; padding: 0; color: #6a6651; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 12px; line-height: 1.4em; background-color: #faf8ec;

  }

  a, a:link, a:visited { color: #d46643; font-weight: normal; text-decoration: none;

  } a:hover { text-decoration: underline;

  } p { margin: 0 0 20px 0; padding: 0;

  } img { border: none; } em { color: #d46643;

  } blockquote { font-style: italic; margin: 0 0 0 10px;

  } cite { font-weight: bold; color:#d46643;

  } cite a, cite a:link, cite a:visited { font-size: 12px; text-decoration: none; font-style: normal;

  } cite span { font-weight: 400; color: #a9a488;

  } .imgage-with-frame { padding: 4px; border: 1px solid #a6a28d;

  } .image_fl { float: left; margin: 3px 20px 5px 0;

  } .image_fr { float: right; margin: 3px 0 5px 20px; } h1, h2, h3, h4, h5, h6 { color: #333; font-weight: normal; font-family: Georgia, "Times New Roman", Times, serif } h1 { font-size: 48px; margin: 0 0 30px; padding: 5px 0 } h2 { font-size: 24px; margin: 0 0 25px; padding: 3px 0 } h3 { font-size: 20px; margin: 0 0 20px; padding: 0; } h4 { font-size: 18px; margin: 0 0 15px; padding: 0; } h5 { font-size: 16px; margin: 0 0 10px; padding: 0; } h6 { font-size: 12px; margin: 0 0 5px; padding: 0; } .cleaner { clear: both } .h10 { height: 10px } .h20 { height: 20px } .h30 { height: 30px } .h40 { height: 40px } .h50 { height: 50px } .mb10 { margin-bottom: 10px } .float_l { float: left } .float_r { float: right } .templatemo_list { margin: 10px 0 10px 10px; padding: 0; list-style: none;

  } .templatemo_list li { color:#58503f; margin: 0 0 10px ; padding: 0 5px 0 18px; background: url(../images/list-tick.png) no-repeat scroll 0 4px;

  }

  .templatemo_list li.flow { display: block; float: left; width: 180px; margin-right: 20px;

  } .templatemo_list li.nomr { margin-right: 0; } .templatemo_list li a { color: #58503f; font-weight: normal;

  } .templatemo_list li a:hover { color: #9e1906; } #templatemo_header_wrapper { width: 100%; height: 140px; background: url(../images/templatemo_header.jpg) repeat-x } #templatemo_header { width: 960px; padding: 0 10px; margin: 0 auto;

  } #templatemo_slider_wrapper { width: 100%; height: 446px; background: #aca177 url(../images/templatemo_slider.jpg) no-repeat center top }

  #templatemo_slider { width: 960px; padding: 33px 10px; height: 446px; margin: 0 auto; overflow: hidden;

  } #templatemo_main_wrapper { width: 100%; background: url(../images/templatemo_main.jpg) repeat-x top

  } #templatemo_main { width: 960px; padding: 60px 10px; margin: 0 auto;

  } #templatemo_footer_wrapper { width: 100%; background: #38362d; border-top: 5px solid #ffffff

  } #templatemo_footer { width: 960px; padding: 30px 10px; margin: 0 auto;

  } #site_title { float: left; } #site_title a { margin-top: 50px; display: block; font-size: 12px; font-family: Georgia, "Times New Roman", Times, serif; width: 240px; height: 54px; color: #acacac; text-indent: -10000px; background: url(../images/templatemo_logo.png) no- repeat center left; } #templatemo_menu { float: right } .homepage_post { margin-bottom: 40px; } .homepage_post h2 { margin-bottom: 0; } .homepage_post .post_meta { font-style: italic; font-size: 11px; margin-bottom: 20px;

  } #food-gallery img, #food-gallery h5 { margin-bottom: 20px; } .testimonial { padding: 0 0 20px; margin-bottom: 30px; border-bottom: 1px dotted #bfb7a8; display: block;

  } .testimonial p { margin-bottom: 5px; } .gallery_box { float: left; width: 220px; margin: 0 20px 20px 0; text-align: center;

  } .gallery_box img { margin-bottom: 10px; } .gallery_box h5 { font-size: 12px; font-weight: 700; margin-bottom:0;

  } .gallery_box p { font-size: 11px; } .post { margin-bottom: 60px; } .post .post_image { width: 600px; position: relative; padding: 4px; border: 1px solid #a6a28d; margin-bottom: 20px;

  } .post .post_image .date { position: absolute; width: 114px; height: 40px; top: 10px; left: -7px; background: url(../images/date.png) no-repeat left; font-size: 11px; line-height: 32px; color: #fff; font-weight: 700; text-align: center;

  } #comment_section { clear: both; margin-bottom: 60px; width: 590px;

  } .first_level { margin: 0; padding: 0; } .comments { list-style: none; } .comments li { margin-bottom: 10px; list-style:none;

  } .comments li .commentbox1 { border-bottom: 1px solid #ccc; } .comments li .commentbox2 { border-bottom: 1px solid #ccc; }

  .comments li .comment_box { clear: both; width:100%; padding: 10px 0 20px 0; margin-bottom: 40px;

  } .comment_box .gravatar { float: left; width: 75px; margin-right: 30px;

  } .comment_box .gravatar img { width: 75px; height: 75px;

  } .comment_box .comment_text { } .comment_box .comment_text p { margin: 0; } .comment_text .comment_author { font-size: 14px; font-weight: bold; color: #d46643; margin-bottom: 10px;

  } .comment_text .date { font-size: 12px; font-weight: normal; color: #7b7b7b; padding-left: 10px;

  }

  .comment_text .time { font-size: 12px; font-weight: normal; color: #7b7b7b; padding-left: 10px;

  } .comment_text .reply a { display: block; clear: both; float: right; color: #000; font-weight: 700;

  } #comment_form { clear: both; } #comment_form h3 { font-size: 20px; border-bottom: 1px solid #ccc; margin-bottom: 15px; padding-bottom: 10px;

  } #comment_form form { } #comment_form textarea { color: #666; background:#fff; border: 1px solid #ccc; height:150px; padding:5px; width: 380px; font-size: 12px; font-family: Tahoma, Geneva, sans-serif; margin-top: 5px; } #comment_form .form_row { width: 100%; margin-bottom: 15px;

  } #comment_form form input { color: #666; padding: 5px; width: 250px; background:#fff; border: 1px solid #ccc; font-size: 12px; font-family: Tahoma, Geneva, sans-serif; margin-top: 5px;

  } #comment_form .submit_btn { display: block; width: 70px; height: 30px; padding: 5px 8px; text-align: center; text-decoration: none; font-weight: bold; background-color: #fff; border: 1px solid #ded6c6; color: #222; font-size:11px;

  } .popular_post { margin: 0; padding: 0; list-style: none;

  } .popular_post li { margin-bottom: 30px; } .popular_post li a { display: block;

  } #contact_form { padding: 0; width: 410px; margin-bottom: 40px;

  } #contact_form form { margin: 0px; padding: 0px;

  } #contact_form form .input_field { width: 270px; padding: 5px; color: #222; background: #fff; border: 1px solid #ded6c6; font-size: 12px; font-family: Tahoma, Geneva, sans-serif; margin-top: 5px;

  } #contact_form form label { display: block; width: 100px; margin-right: 12px; font-size: 12px;

  } #contact_form form textarea { width: 398px; height: 200px; padding: 5px; color: #222; background: #fff; border: 1px solid #ded6c6; font-size: 12px; font-family: Tahoma, Geneva, sans-serif; margin-top: 5px;

  } #contact_form form .submit_btn { padding: 5px 14px; font-weight: bold; background: #fff; border: 1px solid #ded6c6; color: #222; font-size:12px; margin-top: 10px;

  } .map { padding: 4px; border: 1px solid #9c9880;

  } .col { float: left; margin: 0 20px 20px 0 } .half { width: 460px } #sidebar, .one_third { width: 300px } #content, .two-third { width: 620px } .padding_right { padding-right: 20px } .one_fourth { width: 220px } .no_margin_right { margin-right: 0 } .last_box { margin-bottom: 0; background: none } .pagging { margin: 0 0 20px; padding: 0;

  } .pagging ul { margin: 0; padding: 0; list-style: none; } .pagging ul li { margin: 0; padding: 0; display: inline;

  } .pagging ul li a { float: left; display: block; color: #333; text-decoration: none; margin-right: 5px; padding: 5px 10px; background: #fff; border: 1px solid #d9d0be;

  } .pagging ul li a:hover { background: #f7b634; border: 1px solid #fff; color: #fff;

  } #templatemo_footer { color: #ada278; text-align: center

  } #templatemo_footer a { color: #faf8ec }

  <form action="proses_olah_pegawai.php" method="get"> <table border="0" cellspacing="0" cellpadding="10"> <tr>

  <td>NIP</td> <td>:</td> <td><input type="varchar" name="nip_pegawai"/></td> </tr> <tr>

  <td>Nama Pegawai</td> <td>:</td> <td><input type="text" name="nama_pegawai"/></td> </tr> <tr>

  <td>Tempat/Tanggal Lahir</td> <td>:</td> <td><input type="varchar" name="ttl"/></td> </tr> <tr>

  <td>Alamat</td> <td>:</td> <td><input type="varchar" name="alamat_pegawai"/></td> </tr><tr>

  <td>Jenis Kelamin</td> <td>:</td> <td><input type="radio" name="radio" value="P"/>P<input type="radio" name="radio" value="W"/>W</td> </tr><tr>

  <td>Pendidikan Terakhir</td> <td>:</td> <td><input type="text" name="pend_terakhir"/></td> </tr>

  <tr> <td>Golongan</td>

  <td>:</td> <td><input type="varchar" name="golongan"/></td> </tr> <tr>

  <td>Jabatan</td> <td>:</td> <td><input type="varchar" name="jabatan"/></td> </tr> <tr>

  <td>No HP</td> <td>:</td> <td><input type="varchar" name="no_hp"/></td> </tr> <tr>

  <td>Status</td> <td>:</td> <td><input type="text" name="status"/></td> </tr> </table> <input type="submit" value="simpan"/> </form> <?php include "koneksi.php"; $sql = mysql_query("SELECT * FROM pegawai"); ?><script type="text/JavaScript"> <!-- function MM_popupMsg(msg) { //v1.0 alert(msg); } function MM_goToURL() { //v3.0 var i, args=MM_goToURL.arguments; document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'"); } //--> </script> <?php //menentukan batas, cek dan posisi data $batas=5; $halaman = $_REQUEST['halaman']; if(empty($halaman)){

  $posisi=0; $halaman = 1; } else { $posisi = ($halaman-1) * $batas; } //sesuaikan perintah SQL dengan posisi dan batas $sql= "SELECT * FROM pegawai ORDER BY nip_pegawai DESC LIMIT $posisi,$batas"; $result = mysql_query($sql); $test=mysql_num_rows($result); if ($test!=0) { $no=$posisi+1; echo" <table width='800' bordercolordark='#000000' cellpadding='1' cellspacing='1' bordercolor='#000000' border='0' style='color:#000000'>"; echo"<tr align='center' bgcolor='#663' style='color:#999'>"; echo "<th>NO</th>"; echo "<th>NIP</th>"; echo "<th>Nama Pegawai</th>"; echo "<th>Tempat tanggal lahir</th>"; echo "<th>Alamat</th>"; echo "<th>Jenis kelamin</th>"; echo "<th>Pendidikan Terakhir</th>"; echo "<th>Golongan</th>"; echo "<th>Jabatan</th>"; echo "<th>No HP</th>"; echo "<th>Status</th>"; echo "<th>Action</th></tr>"; while($row=mysql_fetch_array($result)) { //pemberian warna berbeda pada tiap baris tampilan if (($no % 2)==0)

  { $warna="#DBDBDB"; } else { $warna="#ffffff";} $id= $row['nip_pegawai']; echo "<tr bgcolor=$warna align='center' ><td>"; echo $no; echo "</td><td width=''>"; echo $row['nip_pegawai']; echo "</td><td width=''>"; echo $row['nama_pegawai']; echo "</td><td width=''>"; echo $row['ttl']; echo "</td><td width=''>"; echo $row['alamat_pegawai']; echo "</td><td width=''>"; echo $row['jk']; echo "</td><td width=''>"; echo $row['pend_terakhir']; echo "</td><td width=''>"; echo $row['golongan']; echo "</td><td width=''>"; echo $row['jabatan']; echo "</td><td width=''>"; echo $row['no_hp']; echo "</td><td width=''>"; echo $row['status']; echo "</td><td width=''>"; echo "<a href='deletepegawai.php?id=$row[nip_pegawai]' onClick=\"return confirm('Apakah Anda benar-benar akan menghapus data ini?')\"><acronym title='Hapus data'><img src='images/delete.png' width='20' height='20' alt='delete'></a>   "; ?> <acronym title="Edit Data"><img src="images/edit.png" width=20 height=20 alt="show" onClick="MM_goToURL('parent','index.php?p=edit_guru.php&a mp;id=<?php echo $id; ?>');return document.MM_returnValue" /></acronym>   <style type="text/css"> <!-- a:link { text-decoration: none;

  } a:visited { text-decoration: none;

  } a:hover { text-decoration: none;

  } a:active { text-decoration: none;

  }

  • > </style> <?php $no++; } echo "</table><table width='500' align='left' id='tabel_show' cellpadding='1' cellspacing='1'><tr><td></td><td>"; $sql2 = mysql_query("select * from pegawai");

  $result=mysql_num_rows($sql2); $jmlhalaman=ceil($result/$batas); /* bangun Previous link */ if($halaman > 1){ $prev = ($halaman - 1);

  ?> <a href="index.php?p=pegawai.php&halaman=1">

  << First </a> | <a href="index.php?p=pegawai.php&<? echo

  "halaman=$prev"; ?>"> <<Previous  </a> <?php } else { echo "<p>First| < Previous "; } //tampilkan link halaman 1,2,3... for($i = 1; $i <= $jmlhalaman; $i++){ if($i == $halaman){ echo "$i "; } else { ?> <a href="index.php?p=pegawai.php&<? echo "halaman=$i"; ?>"><? echo $i; ?></a> <?php }

  } /* bangun Next link */ if($halaman < $jmlhalaman){ $next = $halaman + 1;

  ?> <a href="index.php?p=pegawai.php&<? echo "halaman=$next"; ?>">Next> |</a> <a href="index.php?p=pegawai.php&<? echo "halaman=$jmlhalaman"; ?>">Last >></a> <?php } echo "</td></tr></table>"; }//akhir dari kondisi bahwa data tidak kosong else { echo "<p>TIDAK ADA DATA DALAM DATABASE "; } ?><br />

  <form action="proses_olah_guru.php" method="get"> <table border="0" cellspacing="0" cellpadding="10"> <tr>

  <td>NIP</td> <td>:</td> <td><input type="varchar" name="nip_guru"/></td> </tr> <tr>

  <td>Nama Guru</td> <td>:</td> <td><input type="text" name="nama_guru"/></td> </tr> <tr>

  <td>Tempat/Tanggal Lahir</td> <td>:</td> <td><input type="varchar" name="ttl"/></td>

  </tr> <tr>

  <td>Alamat</td> <td>:</td> <td><input type="varchar" name="alamat_guru"/></td> </tr><tr>

  <td>Jenis Kelamin</td> <td>:</td> <td><input type="radio" name="radio" value="P"/>P<input type="radio" name="radio" value="W"/>W</td> </tr><tr>

  <td>Pendidikan Terakhir</td> <td>:</td> <td><input type="text" name="pend_terakhir"/></td> </tr> <tr>

  <td>Golongan</td> <td>:</td> <td><input type="varchar" name="golongan"/></td> </tr> <tr>

  <td>Wali Kelas</td> <td>:</td> <td><input type="varchar" name="wali_kelas"/></td> </tr> <tr>

  <td>No HP</td> <td>:</td> <td><input type="varchar" name="no_hp"/></td> </tr> </table> <input type="submit" value="simpan"/>

  </form><br /> <?php include "koneksi.php"; $sql = mysql_query("SELECT * FROM guru"); ?><script type="text/JavaScript"> <!-- function MM_popupMsg(msg) { //v1.0 alert(msg); } function MM_goToURL() { //v3.0 var i, args=MM_goToURL.arguments; document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'"); } //--> </script> <?php //menentukan batas, cek dan posisi data $batas=5; $halaman = $_REQUEST['halaman']; if(empty($halaman)){

  $posisi=0; $halaman = 1; } else { $posisi = ($halaman-1) * $batas; } //sesuaikan perintah SQL dengan posisi dan batas $sql= "SELECT * FROM guru ORDER BY nip_guru DESC LIMIT $posisi,$batas"; $result = mysql_query($sql); $test=mysql_num_rows($result); if ($test!=0) { $no=$posisi+1; echo" <table width='1000' bordercolordark='#000000' cellpadding='1' cellspacing='1' bordercolor='#000000' border='0' style='color:#000000'>"; echo" <tr align='center' bgcolor='#663' style='color:#999'>"; echo "<th>NO</th>"; echo "<th>NIP</th>"; echo "<th>Nama Guru</th>"; echo "<th>Tempat tanggal lahir</th>"; echo "<th>Alamat</th>"; echo "<th>Jenis kelamin</th>"; echo "<th>Pendidikan Terakhir</th>"; echo "<th>Golongan</th>"; echo "<th>Wali Kelas</th>"; echo "<th>No HP</th>"; echo "<th>Action</th></tr>"; while($row=mysql_fetch_array($result)) { //pemberian warna berbeda pada tiap baris tampilan if (($no % 2)==0)

  { $warna="#DBDBDB"; } else { $warna="#ffffff";} $id= $row['nip_guru']; echo "<tr bgcolor=$warna align='center' ><td>"; echo $no; echo "</td><td width=''>"; echo $row['nip_guru']; echo "</td><td width=''>"; echo $row['nama_guru']; echo "</td><td width=''>"; echo $row['ttl']; echo "</td><td width=''>"; echo $row['alamat_guru']; echo "</td><td width=''>"; echo $row['jk']; echo "</td><td width=''>"; echo $row['pend_terakhir']; echo "</td><td width=''>"; echo $row['golongan']; echo "</td><td width=''>"; echo $row['wali_kelas']; echo "</td><td width=''>"; echo $row['no_hp']; echo "</td><td width=''>"; echo "<a href='delete_category_soal.php?id=$row[id_category_soal]' onClick=\"return confirm('Apakah Anda benar-benar akan menghapus data ini?')\"><acronym title='Hapus data'><img src='images/delete.png' width='20' height='20' alt='delete'></a>   "; ?> <acronym title="Edit Data"><img src="images/edit.png" width=20 height=20 alt="show" onClick="MM_goToURL('parent','index.php?p=edit_guru.php&a mp;id=<?php echo $id; ?>');return document.MM_returnValue" /></acronym>   <style type="text/css"> <!-- a:link { text-decoration: none;

  } a:visited { text-decoration: none; } a:hover { text-decoration: none;

  } a:active { text-decoration: none;

  }

  • > </style> <?php $no++; } echo "</table><table width='500' align='left' id='tabel_show' cellpadding='1' cellspacing='1'><tr><td></td><td>"; $sql2 = mysql_query("select * from guru");

  $result=mysql_num_rows($sql2); $jmlhalaman=ceil($result/$batas); /* bangun Previous link */ if($halaman > 1){ $prev = ($halaman - 1);

  ?> <a href="index.php?p=guru.php&halaman=1">

  << First </a> | <a href="index.php?p=guru.php&<? echo

  "halaman=$prev"; ?>"> <<Previous  </a> <?php } else { echo "<p>First| < Previous "; } //tampilkan link halaman 1,2,3... for($i = 1; $i <= $jmlhalaman; $i++){ if($i == $halaman){ echo "$i "; } else { ?> <a href="index.php?p=guru.php&<? echo "halaman=$i"; ?>"><? echo $i; ?></a> <?php } } /* bangun Next link */ if($halaman < $jmlhalaman){ $next = $halaman + 1;

  ?> <a href="index.php?p=guru.php&<? echo "halaman=$next"; ?>">Next> |</a> <a href="index.php?p=guru.php&<? echo "halaman=$jmlhalaman"; ?>">Last >></a> <?php } echo "</td></tr></table>"; }//akhir dari kondisi bahwa data tidak kosong else { echo "<p>TIDAK ADA DATA DALAM DATABASE "; } ?><br />

  <form action="proses_olah_siswa_x.php" method="get"> <table border="0" cellspacing="0" cellpadding="10"> <tr>

  <td>NIS</td> <td>:</td> <td><input type="varchar" name="nis_siswa"/></td>

  </tr> <tr>

  <td>Nama Siswa</td> <td>:</td> <td><input type="text" name="nama_siswa"/></td> </tr> <tr>

  <td>Tempat/Tanggal Lahir</td> <td>:</td> <td><input type="varchar" name="ttl"/></td> </tr> <tr>

  <td>Jenis Kelamin</td> <td>:</td> <td><input type="radio" name="radio" value="P"/>P<input type="radio" name="radio" value="W"/>W</td> </tr> <tr>

  <td>Alamat</td> <td>:</td> <td><textarea name="alm_siswa"></textarea></td> </tr><tr>

  <td>No Telepon</td> <td>:</td> <td><input type="text" name="no_telepon"/></td> </tr> <tr>

  <td>Kelas</td> <td>:</td> <td><input type="text" name="kelas" readonly="readonly" value="<?php echo $_GET['kelas'];?>"/></td>

  </tr> <tr>

  <td>Tahun Masuk</td> <td>:</td> <td><input type="varchar" name="tahun_masuk"/></td> </tr> <tr>

  <td>Nama Ayah</td> <td>:</td> <td><input type="varchar" name="nama_ayah"/></td> </tr> <tr>

  <td>Nama Ibu</td> <td>:</td> <td><input type="varchar" name="nama_ibu"/></td> </tr> <tr>

  <td>Pekerjaan Ayah</td> <td>:</td> <td><input type="varchar" name="pekerjaan_ayah"/></td> </tr> <tr>

  <td>Pekerjaan Ibu</td> <td>:</td> <td><input type="varchar" name="pekerjaan_ibu"/></td> </tr> <tr>

  <td>Alamat Orang Tua</td> <td>:</td> <td><textarea name="alamat"></textarea></td> </tr>

  </table> <input type="submit" value="simpan"/> </form><br /> <?php include "koneksi.php"; $sql = mysql_query("SELECT * FROM siswa"); ?><script type="text/JavaScript"> <!-- function MM_popupMsg(msg) { //v1.0 alert(msg); } function MM_goToURL() { //v3.0 var i, args=MM_goToURL.arguments; document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'"); } //--> </script> <?php //menentukan batas, cek dan posisi data $batas=5; $halaman = $_REQUEST['halaman']; if(empty($halaman)){

  $posisi=0; $halaman = 1; } else { $posisi = ($halaman-1) * $batas; } //sesuaikan perintah SQL dengan posisi dan batas $sql= "SELECT * FROM siswa where kelas='$_GET[kelas]' ORDER BY nis_siswa DESC LIMIT $posisi,$batas"; $result = mysql_query($sql);

  $test=mysql_num_rows($result); if ($test!=0) { $no=$posisi+1; echo" <table width='1000' bordercolordark='#000000' cellpadding='1' cellspacing='1' bordercolor='#000000' border='0' style='color:#000000'>"; echo"<tr align='center' bgcolor='#663' style='color:#999'>"; echo "<th>NO</th>"; echo "<th>NIS</th>"; echo "<th>Nama Siswa</th>"; echo "<th>Tempat tanggal lahir</th>"; echo "<th>Jenis Kelamin</th>"; echo "<th>Alamat</th>"; echo "<th>No. Telepon</th>"; echo "<th>Kelas</th>"; echo "<th>Tahun Masuk</th>"; echo "<th>Nama Ayah</th>"; echo "<th>Nama Ibu</th>"; echo "<th>Pekerjaan Ayah</th>"; echo "<th>Pekerjaan Ibu</th>"; echo "<th>Alamat Orang Tua</th>"; echo "<th>Action</th></tr>"; while($row=mysql_fetch_array($result)) { //pemberian warna berbeda pada tiap baris tampilan if (($no % 2)==0)

  { $warna="#DBDBDB"; } else { $warna="#ffffff";} $id= $row['nis_siswa']; echo "<tr bgcolor=$warna align='center' ><td>"; echo $no; echo "</td><td width=''>"; echo $row['nis_siswa']; echo "</td><td width=''>"; echo $row['nama_siswa']; echo "</td><td width=''>"; echo $row['ttl']; echo "</td><td width=''>"; echo $row['jk']; echo "</td><td width=''>"; echo $row['alamat_siswa']; echo "</td><td width=''>"; echo $row['no_telepon']; echo "</td><td width=''>"; echo $row['kelas']; echo "</td><td width=''>"; echo $row['tahun_masuk']; echo "</td><td width=''>"; echo $row['nama_ayah']; echo "</td><td width=''>"; echo $row['nama_ibu']; echo "</td><td width=''>"; echo $row['pekerjaan_ayah']; echo "</td><td width=''>"; echo $row['pekerjaan_ibu']; echo "</td><td width=''>"; echo $row['alamat_ortu']; echo "</td><td width=''>"; echo "<a href='delete_category_soal.php?id=$row[id_category_soal]' onClick=\"return confirm('Apakah Anda benar-benar akan menghapus data ini?')\"><acronym title='Hapus data'><img

src='images/delete.png' width='20' height='20' alt='delete'></a>   "; ?> <acronym title="Edit Data"><img src="images/edit.png" width=20 height=20 alt="show" onClick="MM_goToURL('parent','index.php?p=edit_guru.php&a mp;id=<?php echo $id; ?>');return document.MM_returnValue" /></acronym>   <style type="text/css"> <!-- a:link { text-decoration: none;

  } a:visited { text-decoration: none;

  } a:hover { text-decoration: none;

  } a:active { text-decoration: none;

  }

  • > </style> <?php $no++; } echo "</table><table width='500' align='left' id='tabel_show' cellpadding='1' cellspacing='1'><tr><td></td><td>"; $sql2 = mysql_query("select * from siswa where

  kelas='$_GET[kelas]'");

  $result=mysql_num_rows($sql2); $jmlhalaman=ceil($result/$batas); /* bangun Previous link */ if($halaman > 1){ $prev = ($halaman - 1);

  ?> <a href="index.php?p=siswa_x.php&halaman=1">

  << First </a> | <a href="index.php?p=siswa_x.php&<? echo

  "halaman=$prev"; ?>"> <<Previous  </a> <?php } else { echo "<p>First| < Previous "; } //tampilkan link halaman 1,2,3... for($i = 1; $i <= $jmlhalaman; $i++){ if($i == $halaman){ echo "$i "; } else { ?> <a href="index.php?p=siswa_x.php&<? echo "halaman=$i"; ?>"><? echo $i; ?></a> <?php } } /* bangun Next link */ if($halaman < $jmlhalaman){ $next = $halaman + 1;

  ?> <a href="index.php?p=siswa_x.php&<? echo "halaman=$next"; ?>">Next> |</a> <a href="index.php?p=siswa_x.php&<? echo "halaman=$jmlhalaman"; ?>">Last >></a> <?php } echo "</td></tr></table>"; }//akhir dari kondisi bahwa data tidak kosong else { echo "<p>TIDAK ADA DATA DALAM DATABASE "; } ?>

  <form action="proses_jadwal.php" method="post"> <table border="0" cellspacing="0" cellpadding="10">

  <tr> <td>Hari</td> <td>:</td> <td><select name="hari">

  <option value="Senin">Senin</option> <option value="Selasa">Selasa</option> <option value="Rabu">Rabu</option> <option value="Kamis">Kamis</option> <option value="Jumat">Jumat</option> <option value="Sabtu">Sabtu</option> </select></td>

  </tr> <tr>

  <td>Jam</td> <td>:</td> <td><select name="jam"> <option value="14.30-18.00">14.30-18.00</option> <option value="14.30-18.00">14.30-18.00</option> <option value="14.30-18.00">14.30-18.00</option> <option value="14.30-18.00">14.30-18.00</option> <option value="14.30-18.00">14.30-18.00</option> </select></td>

  </tr> <tr>

  <td>Ekskul</td>

  <td>:</td> <td><?php include "koneksi.php"; $sql=mysql_query("select * from mapel");?> <select name="nama_mapel"> <?php while ($h=mysql_fetch_array($sql)) {?> <option value="<?php echo

  $h['id_mapel'];?>"><?php echo $h['nama_mapel']; ?> </option> <?php } ?> </select></td>

  </tr> <tr>

  <td>Kelas</td> <td>:</td> <td><?php include "koneksi.php";

  $sql=mysql_query("select * from kelas");?> <select name="nama_kelas"> <?php while ($h=mysql_fetch_array($sql)) {?> <option value="<?php echo

  $h['id_kelas'];?>"><?php echo $h['nama_kelas']; ?> </option> <?php } ?> </select></td>

  </tr> <tr>

  <td>Guru Pembimbing</td> <td>:</td> <td><?php include ("koneksi.php");

  $sql=mysql_query("select * from guru"); ?>

  <select name="guru1">

  <?php while ($h=mysql_fetch_array($sql)) {?>

  <option value="<?php echo $h['nip_guru'];?>"><?php echo $h['nama_guru']; ?> </option> <?php } ?> </select></td>

  </tr> </table> <input type="submit" value="masuk"/> </form> <script type="text/JavaScript"> <!-- function MM_popupMsg(msg) { //v1.0 alert(msg); } function MM_goToURL() { //v3.0 var i, args=MM_goToURL.arguments; document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'"); } //--> </script> <?php //menentukan batas, cek dan posisi data $batas=5; $halaman = $_REQUEST['halaman']; if(empty($halaman)){

  $posisi=0; $halaman = 1; } else {

  $posisi = ($halaman-1) * $batas; } //sesuaikan perintah SQL dengan posisi dan batas $sql= "SELECT * FROM jadwal j, mapel m where j.id_mapel=m.id_mapel ORDER BY j.id_jadwal DESC LIMIT $posisi,$batas"; $result = mysql_query($sql); $test=mysql_num_rows($result); if ($test!=0) { $no=$posisi+1; echo" <table width='850' bordercolordark='#000000' cellpadding='1' cellspacing='1' bordercolor='#000000' border='0' style='color:#000000'>"; echo"<tr align='center' bgcolor='#663' style='color:#999'>"; echo "<th>NO</th>"; echo "<th>Hari</th>"; echo "<th>Jam</th>"; echo "<th>Ekskul</th>"; echo "<th>Kelas</th>"; echo "<th>Guru Pembimbing</th>"; echo "<th>Action</th></tr>"; while($row=mysql_fetch_array($result)) { //pemberian warna berbeda pada tiap baris tampilan if (($no % 2)==0)