• Tidak ada hasil yang ditemukan

LAMPIRAN A : LISTING PROGRAM

N/A
N/A
Protected

Academic year: 2019

Membagikan "LAMPIRAN A : LISTING PROGRAM"

Copied!
64
0
0

Teks penuh

(1)

LAMPIRAN A : LISTING PROGRAM

1.

Index.php

?php session_start();

?><!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=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

(2)

***********************************************/ </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() {

(3)

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>

(4)

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

</body> </html>

2.

Cek.php

<?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 {

?>

(5)

<!--

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"); ?>

(6)

session_start();

unset($_SESSION['pengguna']); session_destroy();

print ("<meta http-equiv=\"refresh\" content=\"0; url=../index.php\">");

?>

5.

Style.css

/*

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;

(7)

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; }

(8)

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;

(9)

.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

(10)

#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 {

(11)

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;

}

(12)

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;

}

(13)

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 {

(14)

.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;

(15)

.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;

(16)

margin-top: 5px; }

#comment_form .form_row { width: 100%;

margin-bottom: 15px; }

(17)

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; }

(18)

}

#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;

(19)

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;

}

(20)

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 }

(21)

<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>

(22)

<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);

(23)

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'>";

(24)

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'];

(25)

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>&nbsp;&nbsp;&nbsp;"; ?>

<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>&nbsp;&nbsp; <style type="text/css">

<!-- a:link {

text-decoration: none; }

a:visited {

text-decoration: none; }

a:hover {

text-decoration: none; }

a:active {

(26)

-->

</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&amp;halaman=1"> &lt;&lt; First </a> |

<a href="index.php?p=pegawai.php&amp;<? echo "halaman=$prev"; ?>"> &lt;&lt;Previous &nbsp;</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&amp;<? echo "halaman=$i"; ?>"><? echo $i; ?></a>

(27)

}

/* bangun Next link */

if($halaman < $jmlhalaman){ $next = $halaman + 1;

?>

<a href="index.php?p=pegawai.php&amp;<? echo "halaman=$next"; ?>">Next&gt; |</a>

<a href="index.php?p=pegawai.php&amp;<? 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 />

7.

Guru.php

<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>

(28)

</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>

(29)

</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";

(30)

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;

(31)

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>&nbsp;&nbsp;&nbsp;";

?>

<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>&nbsp;&nbsp; <style type="text/css">

<!-- a:link {

(32)

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&amp;halaman=1"> &lt;&lt; First </a> |

<a href="index.php?p=guru.php&amp;<? echo "halaman=$prev"; ?>"> &lt;&lt;Previous &nbsp;</a> <?php }

else {

(33)

for($i = 1; $i <= $jmlhalaman; $i++){ if($i == $halaman){

echo "$i "; }

else { ?>

<a href="index.php?p=guru.php&amp;<? echo "halaman=$i"; ?>"><? echo $i; ?></a>

<?php } }

/* bangun Next link */

if($halaman < $jmlhalaman){ $next = $halaman + 1;

?>

<a href="index.php?p=guru.php&amp;<? echo "halaman=$next"; ?>">Next&gt; |</a>

<a href="index.php?p=guru.php&amp;<? 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 />

8.

Siswa.php

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

<td>NIS</td> <td>:</td>

(34)

</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>

(35)

</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>

(36)

</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";

(37)

$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'];

(38)

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

(39)

src='images/delete.png' width='20' height='20' alt='delete'></a>&nbsp;&nbsp;&nbsp;";

?>

<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>&nbsp;&nbsp; <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>";

(40)

$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&amp;halaman=1"> &lt;&lt; First </a> |

<a href="index.php?p=siswa_x.php&amp;<? echo "halaman=$prev"; ?>"> &lt;&lt;Previous &nbsp;</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&amp;<? echo "halaman=$i"; ?>"><? echo $i; ?></a>

<?php } }

/* bangun Next link */

if($halaman < $jmlhalaman){ $next = $halaman + 1;

?>

<a href="index.php?p=siswa_x.php&amp;<? echo "halaman=$next"; ?>">Next&gt; |</a>

<a href="index.php?p=siswa_x.php&amp;<? echo "halaman=$jmlhalaman"; ?>">Last >></a>

(41)

echo "</td></tr></table>";

}//akhir dari kondisi bahwa data tidak kosong

else { echo "<p>TIDAK ADA DATA DALAM DATABASE "; } ?>

9.

Jadwal(ekstrakurikuler).php

<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>

(42)

<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"); ?>

(43)

<?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)){

(44)

$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)) {

(45)

{ $warna="#DBDBDB"; } else { $warna="#ffffff";}

$id= $row['id_jadwal'];

echo "<tr bgcolor=$warna align='center' ><td>"; echo $no;

echo "</td><td width=''>"; echo $row['hari'];

echo "</td><td width=''>"; echo $row['jam'];

echo "</td><td width=''>"; echo $row['nama_mapel']; echo "</td><td width=''>"; echo $row['id_kelas']; echo "</td><td width=''>"; echo $row['nip_guru']; echo "</td><td width=''>";

echo "<a href='delete_contact.php?id=$id'

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>&nbsp;&nbsp;&nbsp;";

?>

<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>&nbsp;&nbsp; <style type="text/css">

(46)

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 jadwal j,mapel m where j.id_mapel=m.id_mapel");

$result=mysql_num_rows($sql2); $jmlhalaman=ceil($result/$batas); /* bangun Previous link */

if($halaman > 1){

$prev = ($halaman - 1); ?>

<a href="index.php?p=jadwal.php&amp;halaman=1"> &lt;&lt; First </a> |

(47)

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=jadwal.php&amp;<? echo "halaman=$i"; ?>"><? echo $i; ?></a>

<?php } }

/* bangun Next link */

if($halaman < $jmlhalaman){ $next = $halaman + 1;

?>

<a href="index.php?p=jadwal.php&amp;<? echo "halaman=$next"; ?>">Next&gt; |</a>

<a href="index.php?p=jadwal.php&amp;<? 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 />

10.

contact.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

(48)

<html xmlns="http://www.w3.org/1999/xhtml"> <head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Fresh Zone Theme - Contact Page</title>

<meta name="keywords" content="fresh zone, contact page, location maps, free templates, CSS" />

<meta name="description" content="Fresh Zone, Contact Page, Location Maps, free CSS template 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

(49)

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>

</head>

<body><!-- END of templatemo_header_wrapper --> <div id="templatemo_main_wrapper">

<div id="templatemo_main">

<h2>Contact Information</h2> <div class="half float_l">

<h4>Send us a message now!</h4>

<p>Fusce lorem velit, rhoncus et varius a, consequat eget ligula. Ut eu ante tortor, vitae porttitor eros. Validate <a

href="http://validator.w3.org/check?uri=referer" rel="nofollow"><strong>XHTML</strong></a> &amp; <a

href="http://jigsaw.w3.org/css-validator/check/referer" rel="nofollow"><strong>CSS</strong></a>.</p>

<div id="contact_form">

(50)

<label

for="author">Name:</label> <input type="text" id="author" name="nama" class="required input_field" />

<div class="cleaner h10"></div> <label

for="email">Email:</label> <input type="text"

class="validate-email required input_field" name="email" id="email" />

<div class="cleaner h10"></div>

<label

for="subject">Subject:</label> <input type="text" class="validate-subject required input_field"

name="subject" id="subject"/>

<div class="cleaner h10"></div>

<label

for="text">Message:</label> <textarea id="text" name="text" rows="0" cols="0"

class="required"></textarea>

<div class="cleaner h10"></div>

<input type="submit"

value="Send" id="submit" name="submit" class="submit_btn float_l" />

<input type="reset"

value="Reset" id="reset" name="reset" class="submit_btn float_r" />

</form> </div>

</div>

<div class="cleaner h40"></div>

(51)

</div> <!-- END of templatemo_main --> </body>

</html>

11.

Profil Pegawai.php

<?php

include "admin/koneksi.php";

$x = mysql_query("select * from pegawai where nip_pegawai='$_GET[nip]'");

while($y = mysql_fetch_array($x)){ ?>

<center>

<table border="0" cellspacing="0" cellpadding="10" width="600">

<tr>

<td>NIP</td> <td>:</td>

<td><?php echo $y['nip_pegawai'];?></td> </tr>

<tr>

<td>Nama Pegawai</td> <td>:</td>

<td><?php echo $y['nama_pegawai'];?></td> </tr>

<tr>

<td>Tempat/Tanggal Lahir</td> <td>:</td>

<td><?php echo $y['ttl'];?></td> </tr>

<tr>

(52)

<td><?php echo $y['alamat_pegawai'];?></td> </tr>

<tr>

<td>Jenis Kelamin</td> <td>:</td>

<td><?php echo $y['jk'];?></td> </tr><tr>

<td>Penddikan Terakhir</td> <td>:</td>

<td><?php echo $y['pend_terakhir'];?></td> </tr>

<tr>

<td>Golongan</td> <td>:</td>

<td><?php echo $y['golongan'];?></td> </tr>

<tr>

<td>Jabatan</td> <td>:</td>

<td><?php echo $y['jabatan'];?></td> </tr>

<tr>

<td>No HP</td> <td>:</td>

<td><?php echo $y['no_hp'];?></td> </tr>

<tr>

<td>Status</td> <td>:</td>

<td><?php echo $y['status'];?></td> </tr>

(53)

12.

Profil Guru.php

<?php

include "admin/koneksi.php";

$x = mysql_query("select * from guru where nip_guru='$_GET[nip]'");

while($y = mysql_fetch_array($x)){ ?>

<center>

<table border="0" cellspacing="0" cellpadding="10" width="600">

<tr>

<td>NIP</td> <td>:</td>

<td><?php echo $y['nip_guru'];?></td> </tr>

<tr>

<td>Nama Guru</td> <td>:</td>

<td><?php echo $y['nama_guru'];?></td> </tr>

<tr>

<td>Tempat/Tanggal Lahir</td> <td>:</td>

<td><?php echo $y['ttl'];?></td> </tr>

<tr>

<td>Jenis Kelamin</td> <td>:</td>

<td><?php echo $y['jk'];?></td> </tr>

<tr>

(54)

<td>:</td>

<td><?php echo $y['alamat_guru'];?></td> </tr><tr>

<td>No Telepon</td> <td>:</td>

<td><?php echo $y['no_hp'];?></td> </tr>

<tr>

<td>Golongan</td> <td>:</td>

<td><?php echo $y['golongan'];?></td> </tr>

<tr>

<td>Wali Kelas</td> <td>:</td>

<td><?php echo $y['wali_kelas'];?></td> </tr>

<tr>

<td>No HP</td> <td>:</td>

<td><?php echo $y['no_hp'];?></td> </tr>

</table></center> <?php }?>

13.

Lihat Siswa(Kelas X).php

<?php

include "admin/koneksi.php";

$x = mysql_query("select * from siswa,guru where

(55)

while($y = mysql_fetch_array($x)){ ?>

<center>

<table border="0" cellspacing="0" cellpadding="10" width="600">

<tr>

<td>NIS</td> <td>:</td>

<td><?php echo $y['nis_siswa'];?></td> </tr>

<tr>

<td>Nama Siswa</td> <td>:</td>

<td><?php echo $y['nama_siswa'];?></td> </tr>

<tr>

<td>Tempat/Tanggal Lahir</td> <td>:</td>

<td><?php echo $y['ttl'];?></td> </tr>

<tr>

<td>Jenis Kelamin</td> <td>:</td>

<td><?php echo $y['jk'];?></td> </tr>

<tr>

<td>Alamat</td> <td>:</td>

<td><?php echo $y['alamat_siswa'];?></td> </tr><tr>

(56)

<td><?php echo $y['no_telepon'];?></td> </tr>

<tr>

<td>Kelas</td> <td>:</td>

<td><?php echo $y['kelas'];?></td> </tr>

<tr>

<td>Tahun Masuk</td> <td>:</td>

<td><?php echo $y['tahun_masuk'];?></td> </tr>

<tr>

<td>Nama Ayah</td> <td>:</td>

<td><?php echo $y['nama_ayah'];?></td> </tr>

<tr>

<td>Nama Ibu</td> <td>:</td>

<td><?php echo $y['nama_ibu'];?></td> </tr>

<tr>

<td>Pekerjaan Ayah</td> <td>:</td>

<td><?php echo $y['pekerjaan_ayah'];?></td> </tr>

<tr>

<td>Pekerjaan Ibu</td> <td>:</td>

<td><?php echo $y['pekerjaan_ibu'];?></td> </tr>

(57)

<td>Alamat Orang Tua</td> <td>:</td>

<td><?php echo $y['alamat_ortu'];?></td> </tr>

<tr>

<td>Wali Kelas</td> <td>:</td>

<td><?php echo $y['nama_guru'];?></td> </tr>

</table></center> <?php }?>

14.

Lihat Jadwal.php

<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">

(58)

<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>

(59)

</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]+"'"); }

(60)

//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>";

(61)

while($row=mysql_fetch_array($result)) {

//pemberian warna berbeda pada tiap baris tampilan if (($no % 2)==0)

{ $warna="#DBDBDB"; } else { $warna="#ffffff";} $id= $row['id_jadwal'];

echo "<tr bgcolor=$warna align='center' ><td>"; echo $no;

echo "</td><td width=''>"; echo $row['hari'];

echo "</td><td width=''>"; echo $row['jam'];

echo "</td><td width=''>"; echo $row['nama_mapel']; echo "</td><td width=''>"; echo $row['id_kelas']; echo "</td><td width=''>"; echo $row['nip_guru']; echo "</td><td width=''>";

echo "<a href='delete_contact.php?id=$id'

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>&nbsp;&nbsp;&nbsp;"; ?>

<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

(62)

<!-- 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 jadwal j,mapel m where j.id_mapel=m.id_mapel");

$result=mysql_num_rows($sql2); $jmlhalaman=ceil($result/$batas);

/* bangun Previous link */ if($halaman > 1){

$prev = ($halaman - 1); ?>

(63)

<a href="index.php?p=jadwal.php&amp;<? echo "halaman=$prev"; ?>"> &lt;&lt;Previous &nbsp;</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=jadwal.php&amp;<? echo "halaman=$i"; ?>"><? echo $i; ?></a>

<?php } }

/* bangun Next link */

if($halaman < $jmlhalaman){ $next = $halaman + 1;

?>

<a href="index.php?p=jadwal.php&amp;<? echo "halaman=$next"; ?>">Next&gt; |</a>

<a href="index.php?p=jadwal.php&amp;<? echo "halaman=$jmlhalaman"; ?>">Last >></a>

<?php }

echo "</td></tr></table>";

}//akhir dari kondisi bahwa data tidak kosong

(64)

Referensi

Dokumen terkait

Melakukan penilaian terhadap kegiatan usaha dan atau tindakan pelaku usaha yang dapat mengakibatkan terjadinya praktek monopoli dan atau persaingan usaha tidak

Demikian juga dengan kepemimpinan manajer yang menunjukkan kategori kurang baik dengan persentase 70%.Hasil penelitian ini juga menunjukkan bahwa adanya hubungan yang

Meskipun demikian, pengaruh ini dapat dihilangkan karena studi di Turki, pada subjek usia 6-60 bulan dengan diare akut, kadar zinc serum baru meningkat secara ber- makna

tersebut berdampak pada proses kegiatan belajar mengajar dan juga berdampak pada prestasi siswa banyak yang mendapat nilai kurang baik atau tidak mencapai KKM. Dari hasil

kendaraan tersebut berhasil menempuh jarak 15 km, pada hari kedua 25 km, hari ketiga 35 km dan seterusnya membentuk pola aritmatika.. Pada zaman dahulu hiduplah seorang kakek dengan

2 Keluarga Bapak Nurati merupakan salah satu dari sekian keluarga miskin atau rumah tangga miskin (RTM) yang berada di Desa Manduang. Ia tinggal bersama istri dan satu anak

Alhamdulillahirobbil’alamin, puji syukur kehadirat Allah SWT yang telah melimpahkan rahmat dan karunia-Nya sehingga penulis dapat menyusun dan menyelesaikan skripsi ini

MURID L MURID P JUM MURID JUM GURU 549 JBA8024 SK TAMAN SRI PULAI JKR 5534, JALAN BATAI 3, TAMAN SRI PULAI..