LAMPIRAN LISTING PROGRAM WEBSITE 1. Halaman Home (index.php) $judul_hal=home; function isi() include("koneksi.php"); <style type="text/css"> <!--.PENGUMUMAN color: #FFFFFF; font-weight: bold;.style1 color: #FFFFFF --> </style> include ("koneksi.php"); $artikel= mysql_query("select * from berita where sts='1' ORDER BY id DESC LIMIT 3"); while($r=mysql_fetch_array($artikel))
echo "<a href='berita_lengkap.php?id=$r[id]' title='$r[judul]'><b>$r[judul]</b></a><br>"; echo "<small>posted by <b>admin</b> $r[tgl] </small><br><br>"; if ($r[gambar]=="") echo ""; else echo "<img src ='gambar/$r[gambar]' width='60' height='60' align='left'>"; $isi_berita=strip_tags(nl2br(stripslashes($r[isi]))); $kalimat=substr("$isi_berita",0,300); echo $kalimat; echo "<p class='date'>posted by Admin <img src='images/more.gif' alt='' />"; echo "<a href='berita_lengkap.php?id=$r[id]'>read more</a> </p><br />"; include("tema.php") 2. Berita.php
$judul_hal=berita; function isi() include("koneksi.php"); $hal = $_GET[hal]; if(!isset($_get['hal'])) $page = 1; else $page = $_GET['hal']; $max_results = 2; $from = (($page * $max_results) - $max_results); $data=mysql_query("select * from berita where sts='1' ORDER BY id DESC LIMIT $from, $max_results"); while($baris=mysql_fetch_array($data)) $kata=trim("$baris[isi]"); echo "$baris[judul]<br>"; echo "<small>post by : $baris[editor] $baris[tgl]</small><br>";
$gambar=$baris[gambar]; if ($gambar=="") echo ""; else align=left>"; echo"<img src='gambar/$baris[gambar]' height=100 width=100 $kalimat=strtok($kata," "); for ($i=1;$i<=100;$i++) echo ("$kalimat"); echo (" "); $kalimat=strtok(" "); />"; echo "<p class='date'>posted by Admin <img src='images/more.gif' alt='' echo "<a href='berita_lengkap.php?id=$baris[id]'>read more</a> </p><br />"; $total_results = mysql_result(mysql_query("select COUNT(*) as Num FROM berita where sts='1' "),0);
$total_pages = ceil($total_results / $max_results); echo "<center>halaman :"; if($hal > 1) $prev = ($page - 1); echo "<a href=$_server[php_self]?hal=$prev> <-Sebelumnya </a> "; for($i = 1; $i <= $total_pages; $i++) if(($hal) == $i) echo "$i "; else echo "<a href=$_server[php_self]?hal=$i>$i</a> "; if($hal < $total_pages) $next = ($page + 1); echo "<a href=$_server[php_self]?hal=$next>selanjutnya-></a></center>"; include("tema.php");
3. Berita_lengkap.php function isi() include("koneksi.php"); $id=$_get[id]; $data=mysql_query("select * from berita where id=$id"); while($baris=mysql_fetch_array($data)) echo "<div align='justify'><b>$baris[judul]</b><hr>"; $gambar=$baris[gambar]; if ($gambar=="") echo ""; else align=left>"; echo"<img src='gambar/$baris[gambar]' height=150 width=150 $isi=nl2br(stripslashes($baris['isi'])); echo "$isi </div>";
include("tema.php"); 4. Cek_pass_t.php $username_t=$_post['username_t']; $password_t=$_post['password_t']; $username_d=$_post['username_t']; $password_d=$_post['password_d']; if ($username_t == "" $password_t == "") header("location: index.php?&fail=1#login"); echo"<script>alert('maaf, userid atau password anda masih kosong',document.location.href='javascript:history.back(0)')</script>"; echo "Data Login Tidak Lengkap"; else $host="localhost"; $user="root";
$pass="" ; $db="nilai"; $konek=mysql_connect("$host","$user","$pass") ; $konekdb=mysql_select_db("$db") or die ("gagal koneksi ke database"); $sql_siswa="select * from siswa where (user_siswa = '$username_t') and (pass_siswa = '$password_t')"; $sql_guru="select * from guru where (user_guru = '$username_t') and (pass_guru = '$password_t')"; $log_siswa=mysql_num_rows(mysql_query("$sql_siswa")); $log_guru=mysql_num_rows(mysql_query("$sql_guru")); $rowsiswa=mysql_fetch_array(mysql_query($sql_siswa)); $rowguru=mysql_fetch_array(mysql_query($sql_guru)); if(($log_siswa==1) and ($log_guru==0)) session_start(); session_register("username_t"); session_register("password_t"); $username_t $password_t =$rowsiswa[user_siswa]; =$rowsiswa[pass_siswa]; header("location:siswa/index.php");
elseif(($log_siswa==0) and ($log_siswa==1)) session_start(); session_register("username_d"); session_register("password_d"); $username_d $password_d =$rowguru[user_guru]; =$rowguru[pass_guru]; header("location:guru/index.php"); else header("location: index.php?&fail=2#login"); echo"<script>alert('maaf, lg=$logadmin $username1 $password1 User ID dan Password anda salah silahkan login kembali dengan benar',document.location.href='javascript:history.back(0)')</script>"; echo "User dan Password Masih Salah"; 5. fasilitas.php $judul_hal="fasilitas Sekolah"; function isi()
include("koneksi.php"); $data=mysql_query("select * from fasilitas"); echo "<ol>"; while($baris=mysql_fetch_array($data)) $nm_fas=$baris[nm_fas]; echo "<li><b> $nm_fas </b> <br>"; $isi=nl2br(stripslashes($baris['ket'])); echo "$isi </li><br>"; echo "</ol>"; include("tema.php"); 6. m koneksi.php $host="localhost"; $user="root"; $pass="" ; $db="nilai"; $konek=mysql_connect("$host","$user","$pass") ; $konekdb=mysql_select_db("$db") or die ("gagal koneksi ke database");
7. login.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="autor" content="ade iskandar" /> <meta name="copyright" content="ade iskandar 2010" /> <meta name="description" content="" /> <link rel="shortcut icon" href="images/man.jpg" /> <meta name="keywords" content="" /> <title>login Administrator</title> <link href="css/default.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!--.style1 color: #FFFFFF --> </style> <link href="images/style.css" rel="stylesheet" type="text/css" /> </head> <body> <p> </p>
<p> </p> <p> </p> <table width="400" border="0" align="center"> <td width="394" align="center" valign="bottom"><h3 class="subheader style1"><em>sistem Informasi Nilai Madrasah Aliyah Negeri Barus</em></h3> $fail=$_get['fail']; if ($fail==1) $pesan='login Gagal...!!!, username atau password anda masih kosong'; elseif($fail==2) $pesan='username atau password anda masih salah, Silahkan Login Kembali'; else $pesan=''; <br /> <span class="style1">login ADMINISTRATOR </span><br /> <form id="form1" method="post" action="admin/cekpass.php"> <table width="200" border="0">
<td><table width="265" border="0" align="center" bgcolor="#cccccc"> <td height="18" colspan="2" bgcolor="#999999"> </td> <td width="91" height="40">username</td> </td> <td width="164"><input name="username" type="text" id="username" /> <td>password</td> </td> <td><input name="password" type="password" id="password" /> <td height="49"> </td> <td align="right" valign="bottom"><input type="submit" name="submit" value="submit" /> <input type="reset" name="submit2" value="reset" /></td> <td height="23" colspan="2" align="right"><a href="index.php">kembali </a></td> </table></td> </table>
</form> <p align="center"> echo"<font color='red' > $pesan</font>" </td> </table> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </body> </html> 8. logout.php session_start(); session_destroy(); header("location:index.php"); 9. profil.php $judul_hal=profil; function isi()
include("koneksi.php"); $profil=mysql_query("select * from profil"); while($bprofil=mysql_fetch_array($profil)) $gambar=$bprofil[gambar]; echo "<b>$bprofil[judul]<br><br></b>"; if ($gambar=="") echo ""; else echo"<img src='gambar/$bprofil[gambar]' height=150 width=150 align=left > "; $isi=nl2br(stripslashes($bprofil['isi'])); echo "$isi"; include("tema.php"); 10. siswa.php
$judul_hal="data Siswa"; function isi() include("koneksi.php"); $cr_kelas=mysql_query("select * from kelas"); while($dt_kelas=mysql_fetch_array($cr_kelas)) <table width="454" border="0" align="center" bgcolor="#cccccc"> <td colspan="4" align="center"> echo "Kelas $dt_kelas[kd_kls]" ; </td> <td width="24" bordercolor="#000000" bgcolor="#ffffff">no </td> <td width="121" bordercolor="#000000" bgcolor="#ffffff">nis</td> <td width="151" bordercolor="#000000" bgcolor="#ffffff">nama</td> <td width="60" bordercolor="#000000" bgcolor="#ffffff">gender</td> $cr_siswa=mysql_query("select * from siswa where kd_kls='$dt_kelas[kd_kls]'"); while($dt_siswa=mysql_fetch_array($cr_siswa))
$no=@$no+1; <td bordercolor="#000000" bgcolor="#ffffff"> echo $no </td> <td bordercolor="#000000" bgcolor="#ffffff"> echo $dt_siswa[nis] </td> <td bordercolor="#000000" bgcolor="#ffffff"> echo $dt_siswa[nm_siswa] </td> <td bordercolor="#000000" bgcolor="#ffffff"> echo $dt_siswa[jk] </td> $no=0; <td bordercolor="#000000" bgcolor="#ffffff"> </td> <td bordercolor="#000000" bgcolor="#ffffff"> </td> <td bordercolor="#000000" bgcolor="#ffffff"> </td> <td bordercolor="#000000" bgcolor="#ffffff"> </td> </table> include("tema.php");
SURAT KETERANGAN Hasil Uji Program Tugas Akhir Yang bertanda tangan di bawah ini, menerangkan bahwa Mahasiswa Tugas Akhir Program D-III Teknik Informatika : Nama : M. ADHA RAFLI NIM : 112406002 Program Studi : D-III Teknik Informatika Judul Tugas Akhir : SISTEM INFORMASI NILAI MADRASAH ALIYAH NEGERI BERBASIS WEB MENGGUNAKAN PHP DAN MYSQL telah melakukan test program Tugas Akhir Mahasiswa tersebut di atas pada tanggal.../06/2014. Dengan hasil : SUKSES / GAGAL Demikian diterangkan untuk digunakan melengkapi Syarat Pendaftaran Meja Hijau Tugas Akhir Mahasiswa bersangkutan di Departemen Matematika FMIPA USU Medan. Medan, Juni 2014 Dosen Pembimbing Program D-III Teknik Informatika Drs. Marihat Situmorang, M.Kom NIP 19631214 198903 1 001
KARTU BIMBINGAN TUGAS AKHIR MAHASISWA Nama Mahasiswa : MUHAMMAD ADHA RAFLI Nomor Stambuk : 112406002 Judul Tugas Akhir : SISTEM INFORMASI NILAI MADRASAH ALIYAH NEGERI BERBASIS WEB MENGGUNAKAN PHP DAN MYSQL Dosen Pembimbing : Drs. Marihat Situmorang, M.Kom. Tanggal Mulai Bimbingan : Tanggal Selesai Bimbingan : No. Tanggal Pembahasan pada Paraf Dosen Keterangan Asisten Bimbingan Asistensi Mengenai, pada Bab : Pembimbing 1. Pengajuan Judul 2. ACC Judul Tugas Akhir 3. Uji Program 4. Pengajuan Bab 1 5 5. ACC Bab 1 5 6. ACC Tugas Akhir Kartu ini harap dikembalikan ke Departemen Matematika bila bimbingan telah selesai. Diketahui, Ketua Prodi D3 Teknik Informatika Disetujui, Pembimbing Utama Dr. Elly Rosmaini, M.Si Drs. Marihat Situmorang, M.Kom. NIP 196005201 98503 2 002 NIP 19631214 198903 1 001