Anda di halaman 1dari 79

Laporan Pemrograman Berbasis Web

1

PEMROGRAMAN BERBASIS WEB
Sistem Informasi Akademik (Kartu Rencana Studi)








Oleh
Firdaus Zulkarnain
1210651100



PROGRAM STUDI TEKNIK INFORMATIKA
FAKULTAS TEKNIK
UNIVERSITAS MUHAMMADIYAH JEMBER
2014/2015
Laporan Pemrograman Berbasis Web
2

Kata Pengantar
Assalamualaikum Wr.Wb.
Laporan ini dibuat sebagai modul penjelasan dalam pembuatan sebuah Sistem
Informasi Akademik sederhana. Studi kasus dalam hal ini hanyalah sistem pengambilan KRS (
Kartu Rencana Studi ).Pembahasan fokusnya kepada :
1. Pembuatan database.
2. Pembuatan tabel.
3. Proses input data ke database.
4. Proses edit data.
5. Proses penghapusan data.
6. Pembuatan daftar list.
Tabel yang ada antara lain mahasiswa,matakuliah,user dan krs dengan menerapkan fitur
select,update,insert dan delete. Pembuatan sistem informasi akademik ini sendiri diharapkan
dapat mempermudah pengolahan data mahasiswa. Banyak aplikasi yang tersedia dalam
menjalankan Apache dan MySql yang dalam contoh pembuatan aplikasi sistem informasi
sederhana ini saya menggunakan XAMPP. Penjelasan secara rincinya adalah sebagai berikut :
1. Pembuatan Database
Kita buat terlebih dahulu database untuk menampung data yang akan kita simpan.
Database pada studi kasus ini saya beri nama CRUD. Seperti pada gambar dibawah ini pada
kolom Create Database kita ketikkan nama database yang akan kita buat (contoh : crud)
kemudian klik Create.

Akan muncul pemberitahuan jika sudah membuat databasenya :

Laporan Pemrograman Berbasis Web
3

Tampilan daftar database yang sudah dibuat :

Pada gambar di atas yang dicentang adalah database yang sudah dibuat. Selanjutnya kita buat
tabel-tabelnya.
2. Pembuatan Table
Table yang akan kita buat yaitu mahasiswa,jadwal_mk dan krs.
A. Table Mahasiswa

Struktur dari tabel mahasiswa :

Laporan Pemrograman Berbasis Web
4

B. Table Jadwal Matakuliah

Struktur dari tabel jadwal matakuliah :

C. Table Kartu Rencana Studi (KRS)

Struktur dari tabel krs :

Tambahan kita buat tabel user untuk membedakan user dan admin untuk halaman login
masing-masing.
Laporan Pemrograman Berbasis Web
5


Struktur dari table user :

Daftar tabel-tabel yang sudah dibuat :

3. Pembuatan Koneksi Ke Database
Yang utama dalam setiap membuat sistem informasi adalah kita buat penghubung
antara sistem informasi itu dengan database yang sudah kita buat tadi dimana bahasa yang
digunakan dalam penghubungan tersebut kita gunakan script PHP.
<?php
$konek=mysql_connect("localhost","root","");
$db=mysql_select_db("crud",$konek);
?>
Pada script diatas localhost sebagai Hostname,root sebagai username dan yang bagian
akhir yang dikosongi adalah password. mysql_connect() adalah perintah koneksi ke mysql dan
mysql_select_db untuk memilih database yang akan digunakan yaitu database crud.
4. Pembuatan Form
Konten pertama yang akan dipanggil oleh web broser adalah index.php ,berikut script
dari index.php
Laporan Pemrograman Berbasis Web
6

a. index.php
<?php
session_start();
include"koneksi.php";
include"atas.php";
?>
<table class="tabel" align="center" cellpadding="2" cellspacing="5">
<tr>
<td><center>
<p class="td">
<legend>
SELAMAT DATANG DI SISTEM INFORMASI
AKADEMIK
</legend>
<img src="img/beranda-1.png" class="img-
polaroid" style="height: 100px; width:100px;"/>
<img src="img/beranda-2.png" class="img-
polaroid" style="height: 100px; width:100px;"/>
</p>
<p class="td">Mahasiswa - Dosen</p>
</center>
</td>
</tr>
</table>
<?php
include"bawah.php";
?>

Laporan Pemrograman Berbasis Web
7

b. atas.php
<?php
include"koneksi.php";
?>
<head>
<title>Sistem Informasi Akademik</title>
<link href="css/bootstrap.css" rel="stylesheet"/>
<link href="css/bootstrap-responsive.css" rel="stylesheet"/>
<link rel="shortcut icon" href="img/shortcut.png">
<style type="text/css">
.tabel{
border-spacing: 3px;
padding-top: 0px;
padding-bottom: 0px;
padding-right: 0px;
}
.tr{
font-family: Calibri;
color: white;
}
.td{
font-family: Calibri;
color: black;
}
body{
padding-top: 10px;
}
Laporan Pemrograman Berbasis Web
8

.navbar{
padding-bottom: 0px;
padding-right: 4px;
}
.font-nav{
font-family: 10px Calibri;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-inner" style="padding-top: 4px; padding-left: 4px; padding-
bottom: 1px;">
<div class="navbar-inner">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-
target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<b class="navbar-text pull-right">Sistem Infromasi Akademik</b>
<div class="nav-collapse collapse">
<ul class="nav">
<li><a href="index.php"><i class="icon-home"
title="Beranda"></i></a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Login <b
class="caret"></b></a>
Laporan Pemrograman Berbasis Web
9

<ul class="dropdown-menu">
<li><a href="login-admin.php">
Admin</a>
</li>
<li><a href="login-mahasiswa.php">
Mahasiswa</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<br/>
c. bawah.php
<footer class="well" >
<div><center><i>Created by : <a href="#" target="_blank">Firdaus
Zulkarnain</a>&copy; 2014.</i></center></div>
</footer>
</div>
</div>
</body>
d. login-admin.php
<?php
include"atas.php";
?>
<form action="cek-login-admin.php?cek=in" method="post">
<table class="table-condensed tabel" align="center" width="400px"
cellpadding="2" cellspacing="5">
Laporan Pemrograman Berbasis Web
10


<tr align="center" class="tr">
<td colspan="3" bgcolor="#0079ff">Halaman Akses Administrator
<i class="icon-white icon-exclamation-sign"></i></td>
</tr>
<tr>
<td class="td" rowspan="3" style="padding-top: 8px;padding-
bottom: 8px;"><center><img src="img/login-index.png"></center></td>
<td class="td" colspan="2">
</td>
</tr>
<tr>
<td class="td" bgcolor="#0079ff" style="color:
white;"><center>Username</center></td>
<td class="td" bgcolor="#0079ff" style="color:
white;"><center>Password</center></td>
</tr>
<tr>
<td>
<input type="hidden" value="admin" name="level"/>
<center><input type="text" name="username" value="<?php
echo $_GET['username']; ?>" class="span2" placeholder=" username"
autofocus="true"/></center></td>
<td><center><input type="password" name="pass" class="span2"
placeholder=" password"/></center></td>
</tr>
<tr>
<td colspan="3">

Laporan Pemrograman Berbasis Web
11

<p align="right" style="padding-right: 12px;">
<button type="submit" class="btn btn-success btn-small"><i
class="icon-white icon-user"></i>&nbsp;Masuk</button>
<button type="reset" class="btn btn-danger btn-small"><i
class="icon-white icon-refresh"></i>&nbsp;Batal</button>
</p>
<center><hr width="400px" style=" border-bottom-style: none; border-top-color:
#0079ff;"></center>
</td>
</tr>
</table>
</form>
<?php
include"bawah.php";
?>
e. login-mahasiswa.php
<?php
include"atas.php";
?>
<form action="cek-login-mahasiswa.php?cek=in" method="post">
<table class="table-condensed tabel" align="center" width="400px"
cellpadding="2" cellspacing="5">

<tr align="center" class="tr">
<td colspan="3" bgcolor="#0079ff">Halaman Akses Mahasiswa <i
class="icon-white icon-exclamation-sign"></i></td>
</tr>
<tr>
Laporan Pemrograman Berbasis Web
12

<td class="td" rowspan="3" style="padding-top: 8px;padding-
bottom: 8px;"><center><img src="img/login-index.png"></center></td>
<td class="td" colspan="2">
</td>
</tr>
<tr>
<td class="td" bgcolor="#0079ff" style="color:
white;"><center>Username</center></td>
<td class="td" bgcolor="#0079ff" style="color:
white;"><center>Password</center></td>
</tr>
<tr>
<td>
<input type="hidden" value="mahasiswa" name="level"/>
<center><input type="text" name="username" value="<?php
echo $_GET['username']; ?>" class="span2" placeholder=" username"
autofocus="true"/></center></td>
<td><center><input type="password" name="pass" class="span2"
placeholder=" password"/></center></td>
</tr>
<tr>
<td colspan="3">

<p align="right" style="padding-right: 12px;">
<button type="submit" class="btn btn-success btn-small"><i
class="icon-white icon-user"></i>&nbsp;Masuk</button>
<button type="reset" class="btn btn-danger btn-small"><i
class="icon-white icon-refresh"></i>&nbsp;Batal</button>
</p>
Laporan Pemrograman Berbasis Web
13

<center><hr width="400px" style=" border-bottom-style: none; border-top-color:
#0079ff;"></center>
</td>
</tr>
</table>
</form>
<?php
include"bawah.php";
?>
f. index-admin.php
<?php
session_start();
include"koneksi.php";
include"atas-admin.php";
?>
<p><center>
<h3 class="selamat">Selamat datang dihalaman administrator</h3>
</center>
</p>
<?php
include"bawah.php";
?>
g. atas-admin.php
<?php
session_start();
include"koneksi.php";
$query=mysql_query("select * from user where username='$_SESSION[username]'");
Laporan Pemrograman Berbasis Web
14

?>
<head>
<title>Sistem Informasi Akademik</title>
<link href="css/bootstrap.css" rel="stylesheet"/>
<link href="css/bootstrap-responsive.css" rel="stylesheet"/>
<link href="css/docs.css" rel="stylesheet"/>
<link rel="shortcut icon" href="img/shortcut.png">
<style type="text/css">
.tabel{
border-spacing: 2px;
}
.tr{
color: white;
background-color: #afd0fe;
}
.td{
font-family: 10px Calibri;
color: white;
background-color: #0079ff;
}
body{
padding-top: 10px;
}
.navbar{
padding-bottom: 0px;
padding-right: 4px;
}
Laporan Pemrograman Berbasis Web
15

.font-nav{
font-family: 10px Calibri;
}
a{
color: #0079ff;
}
a:hover{
color: #0079ff;
}
.selamat{
padding: 30px;
background-color: #afd0fe;
text-align: center;
color: #02249b;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-inner" style="padding-top: 4px; padding-left: 4px; padding-
bottom: 1px;">
<div class="navbar-inner">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-
target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
Laporan Pemrograman Berbasis Web
16

<b class="navbar-text pull-right">Selamat datang |
<a href="#" title="Anda login sebagai <?php echo
$_SESSION['username']; ?>"><?php echo $_SESSION['username']; ?></a> | <img
src="img/admin.png"/></b>
<div class="nav-collapse collapse">
<ul class="nav">
<li><a href="index-admin.php"><i class="icon-home"
title="Beranda"></i></a></li>
<li>
<a href="index.php?cek=out" title="Logout">Logout</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-
toggle="dropdown">Master <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="matakuliah.php">Form
Matakuliah</a></li>
<li><a href="mahasiswa.php">Form
Mahasiswa</a></li>
<li class="divider"></li>
<li><a href="tabel-matakuliah-admin.php">Tabel
Matakuliah</a></li>
<li><a href="tabel-mahasiswa-admin.php">Tabel
Mahasiswa</a></li>
</ul>
</li>
</ul>
</div>
</div>
<br/>
Laporan Pemrograman Berbasis Web
17

h. login-admin.php
<?php
include"atas.php";
?>
<form action="cek-login-admin.php?cek=in" method="post">
<table class="table-condensed tabel" align="center" width="400px"
cellpadding="2" cellspacing="5">

<tr align="center" class="tr">
<td colspan="3" bgcolor="#0079ff">Halaman Akses Administrator
<i class="icon-white icon-exclamation-sign"></i></td>
</tr>
<tr>
<td class="td" rowspan="3" style="padding-top: 8px;padding-
bottom: 8px;"><center><img src="img/login-index.png"></center></td>
<td class="td" colspan="2">
</td>
</tr>
<tr>
<td class="td" bgcolor="#0079ff" style="color:
white;"><center>Username</center></td>
<td class="td" bgcolor="#0079ff" style="color:
white;"><center>Password</center></td>
</tr>
<tr>
<td>
<input type="hidden" value="admin" name="level"/>
Laporan Pemrograman Berbasis Web
18

<center><input type="text" name="username" value="<?php
echo $_GET['username']; ?>" class="span2" placeholder=" username"
autofocus="true"/></center></td>
<td><center><input type="password" name="pass" class="span2"
placeholder=" password"/></center></td>
</tr>
<tr>
<td colspan="3">

<p align="right" style="padding-right: 12px;">
<button type="submit" class="btn btn-success btn-small"><i
class="icon-white icon-user"></i>&nbsp;Masuk</button>
<button type="reset" class="btn btn-danger btn-small"><i
class="icon-white icon-refresh"></i>&nbsp;Batal</button>
</p>
<center><hr width="400px" style=" border-bottom-style: none; border-top-color:
#0079ff;"></center>
</td>
</tr>
</table>
</form>
<?php
include"bawah.php";
?>
i. cek-login-admin.php
<?php
session_start();
include"koneksi.php";

Laporan Pemrograman Berbasis Web
19

$level=$_POST['level'];
$user = $_POST['username'];
$pass=$_POST['pass'];
$cek=$_GET['cek'];

if ($cek=="in"){
$query=mysql_query("select * from user where level='$level' and username='$user' and
pass='$pass'");
if(mysql_num_rows($query)==1){
$sambung=mysql_fetch_array($query);
$_SESSION['level']=$sambung['level'];
$_SESSION['username']=$sambung['username'];
$_SESSION['pass']=$sambung['pass'];
}if($sambung['level']=="admin"){
echo"<script>alert('Selamat datang di halaman
admin.');window.location='index-admin.php'</script>";
}else{
echo"<script>alert('Kata sandi tidak cocok
!!');window.location='login-admin.php?username=$user'</script>";
}
}elseif($cek=="out"){
unset($_SESSION['level']);
unset($_SESSION['username']);
unset($_SESSION['pass']);
echo"<script>alert('Anda telah Logout');window.location='index.php'</script>";
}
?>

Laporan Pemrograman Berbasis Web
20

j. index-mahasiswa.php
<?php
session_start();
include"koneksi.php";
include"atas-mahasiswa.php";
?>
<p><center>
<h3 class="selamat">Selamat datang dihalaman mahasiswa</h3>
</center>
</p><?php
include"bawah.php";
?>
k. atas-mahasiswa.php
<?php
include"koneksi.php";
$query=mysql_query("select * from user where level='$_SESSION[level]' AND
username='$_SESSION[username]'");
?>
<head>
<title>Sistem Informasi Akademik</title>
<link href="css/bootstrap.css" rel="stylesheet"/>
<link href="css/bootstrap-responsive.css" rel="stylesheet"/>
<link rel="shortcut icon" href="img/shortcut.png">
<style type="text/css">
.tabel{
border-spacing: 2px;
padding-top: 0px;
Laporan Pemrograman Berbasis Web
21

padding-bottom: 0px;
padding-right: 0px;
}
.tr{
font-family: 14px Calibri;
color: white;
}
.td{
font-family: Calibri;
color: black;
}
body{
padding-top: 10px;
}
.navbar{
padding-bottom: 0px;
padding-right: 4px;
}
.font-nav{
font-family: 10px Calibri;
}
.selamat{
padding: 30px;
background-color: #b3fd99;
text-align: center;
color: #06a626;
}
Laporan Pemrograman Berbasis Web
22

</style>
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-inner" style="padding-top: 4px; padding-left: 4px; padding-
bottom: 1px;">
<div class="navbar-inner">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-
target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<b class="navbar-text pull-right">Selamat datang |
<a href="#" title="Anda login sebagai <?php echo $_SESSION['level']; ?>
dengan nim <?php echo $_SESSION['username']; ?>"><?php echo $_SESSION['username'];
?></a> | <img src="img/mahasiswa.png"></b>
<div class="nav-collapse collapse">
<ul class="nav">
<li><a href="index-mahasiswa.php"><i class="icon-home"
title="Beranda"></i></a></li>
<li>
<a href="index.php?cek=out" title="Logout">Logout</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Ambil <b
class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="mahasiswa-krs.php">
Laporan Pemrograman Berbasis Web
23

Kartu Rencana Studi (KRS)</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<br/>
l. login-mahasiswa.php
<?php
include"atas.php";
?>
<form action="cek-login-mahasiswa.php?cek=in" method="post">
<table class="table-condensed tabel" align="center" width="400px"
cellpadding="2" cellspacing="5">

<tr align="center" class="tr">
<td colspan="3" bgcolor="#0079ff">Halaman Akses Mahasiswa <i
class="icon-white icon-exclamation-sign"></i></td>
</tr>
<tr>
<td class="td" rowspan="3" style="padding-top: 8px;padding-
bottom: 8px;"><center><img src="img/login-index.png"></center></td>
<td class="td" colspan="2">
</td>
</tr>
<tr>
Laporan Pemrograman Berbasis Web
24

<td class="td" bgcolor="#0079ff" style="color:
white;"><center>Username</center></td>
<td class="td" bgcolor="#0079ff" style="color:
white;"><center>Password</center></td>
</tr>
<tr>
<td>
<input type="hidden" value="mahasiswa" name="level"/>
<center><input type="text" name="username" value="<?php
echo $_GET['username']; ?>" class="span2" placeholder=" username"
autofocus="true"/></center></td>
<td><center><input type="password" name="pass" class="span2"
placeholder=" password"/></center></td>
</tr>
<tr>
<td colspan="3">

<p align="right" style="padding-right: 12px;">
<button type="submit" class="btn btn-success btn-small"><i
class="icon-white icon-user"></i>&nbsp;Masuk</button>
<button type="reset" class="btn btn-danger btn-small"><i
class="icon-white icon-refresh"></i>&nbsp;Batal</button>
</p>
<center><hr width="400px" style=" border-bottom-style: none; border-top-color:
#0079ff;"></center>
</td>
</tr>
</table>
</form>
<?php
Laporan Pemrograman Berbasis Web
25

include"bawah.php";
?>
m. cek-login-mahasiswa.php
<?php
session_start();
include"koneksi.php";

$level=$_POST['level'];
$user = $_POST['username'];
$pass=$_POST['pass'];
$cek=$_GET['cek'];

if ($cek=="in"){
$query=mysql_query("select * from user where level='$level' and username='$user' and
pass='$pass'");
if(mysql_num_rows($query)==1){
$sambung=mysql_fetch_array($query);
$_SESSION['level']=$sambung['level'];
$_SESSION['username']=$sambung['username'];
$_SESSION['pass']=$sambung['pass'];
}if($sambung['level']=="mahasiswa"){
echo"<script>alert('Selamat datang di halaman
mahasiswa.');window.location='index-mahasiswa.php'</script>";
}else{
echo"<script>alert('Kata sandi tidak cocok
!!');window.location='login-mahasiswa.php?username=$user'</script>";
}
}elseif($cek=="out"){
Laporan Pemrograman Berbasis Web
26

unset($_SESSION['level']);
unset($_SESSION['username']);
unset($_SESSION['pass']);
echo"<script>alert('Anda telah Logout');window.location='index.php'</script>";
}
?>
n. matakuliah.php
<?php
include"atas-admin.php";
?>
<form action="simpan-matakuliah.php" method="post">
<table class="table-condensed tabel" border="0" align="center" width="600px"
cellpadding="2" cellspacing="5">
<tr>
<td colspan="4">
<h4 style="font-family: Calibri;color: #fed101;"><i class="icon-
bookmark"></i> Matakuliah</h4>
</td>
</tr>
<tr>
<td colspan="4">
<div class="progress progress-striped">
<div class="bar" style="width: 100%;"></div>
</div>
</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Kode Mk</td>
Laporan Pemrograman Berbasis Web
27

<td><input type="text" name="kd_mk" class="span2" placeholder="kode
matakuliah" value="<?php echo $_GET['kd_mk']; ?>"/></td>
<td style="font-family: Calibri;text-align: right;">Semester</td>
<td>
<?php
echo "<select name='semester' class='input-small'>";
echo "<option value='-'>- Pilih -</option>";
for($smst = 1; $smst <= 8 ; $smst++){
echo "<option value=$smst>$smst</option>";
}
echo "</select>";
?>
</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Mata Kuliah</td>
<td><input type="text" name="mata_kuliah" placeholder="nama
matakuliah" value="<?php echo $_GET['mata_kuliah']; ?>"/></td>
<td style="font-family: Calibri;text-align: right;">SKS</td>
<td>
<?php
echo "<select name='sks' class='input-small'>";
echo "<option value='-'>- Pilih -</option>";
for($a = 1; $a <= 5 ; $a++){
echo "<option value=$a>$a</option>";
}
echo "</select>"
?>
Laporan Pemrograman Berbasis Web
28

</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Dosen Pengajar</td>
<td><input type="text" name="nama_dosen" placeholder="nama dosen"
value="<?php echo $_GET['nama_dosen']; ?>"/></td>
<td style="font-family: Calibri;text-align: right;">Hari</td>
<td>
<select name="hari" class="input-small">
<option value="-">- Pilih -</option>
<option value="Senin">Senin</option>
<option value="Selasa">Selasa</option>
<option value="Rabu">Rabu</option>
<option value="Kamis">Kamis</option>
<option value="Jumat">Jum'at</option>
<option value="Sabtu">Sabtu</option>
</select>
</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Ruang</td>
<td>
<input type="text" name="ruang" placeholder="ruang B-2.4"
value="<?php echo $_GET['ruang']; ?>"/>
</td>
<td style="font-family: Calibri;text-align: right;">Jam</td>
<td style="font-family: Calibri;">
Laporan Pemrograman Berbasis Web
29

<input type="text" name="jam1" class="span1" placeholder="
00:00" value="<?php echo $_GET['jam1']; ?>"/>
<input type="hidden" name="jam2" value=" - ">
-
<input type="text" name="jam3" class="span1" placeholder="
00:00" value="<?php echo $_GET['jam3']; ?>">
</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td><button type="submit" class="btn btn-success btn-small"
title="Simpan data ?"><i class="icon-white icon-file"></i>&nbsp;Simpan</button>
<button type="reset" class="btn btn-danger btn-small" title="Reset data
?"><i class="icon-white icon-refresh"></i> reset</button>
</td>
</tr>
<tr>
<td colspan="4">
<div class="progress progress-striped">
<div class="bar" style="width: 100%;"></div>
</div>
</td>
</tr>
</table>
</form>
<?php
Laporan Pemrograman Berbasis Web
30

include"bawah.php";
?>
o. tabel-matakuliah-admin.php
<?php
include"koneksi.php";
include"atas-admin.php";
$query=mysql_query("select * from jadwal_mk order by kd_mk ASC");
$jumlah = mysql_num_rows($query);
?>
<center>
<form class="form-horizontal" action="tabel-matakuliah-admin-cari.php" method="post">
<table class="table-bordered tabel" border="0" align="center" width="600px"
cellpadding="2" cellspacing="5">
<tr>
<td style="padding:5px; background-color:silver; font-family: 10px
Calibri;"><center><b style="color:white;">Filter</b>
</td>
<td style="padding:5px; background-color:silver; font-family: 10px Calibri;">
<center>
<select name="berdasar" class="span2" autofocus="true">
<option value="-">- Berdasarkan -</option>
<option value="kd_mk">Kode Mk
<option value="semester">Semester
<option value="jumlah_sks">Sks
</select>
<input type="text" name="cari" class="span2"/>
</center>
</td>
Laporan Pemrograman Berbasis Web
31

<td style="padding:5px; background-color:silver; font-family: 10px Calibri;">
<center>
<button type="submit" class="btn btn-success btn-mini" title="Cari data ?"><i
class="icon-white icon-search"></i> Cari</button>
<a href="tabel-matakuliah-admin.php"><button type="button" class="btn btn-
inverse btn-mini" title="Refresh data ?"><i class="icon-white icon-refresh"></i>
Segarkan</button></a>
</center>
</td>
</tr>
</table>
</form>
</center>
<table class="table-bordered tabel" border="0" align="center" width="1000px"
cellpadding="2" cellspacing="5">
<tr>
<td colspan="10" style="background-color:silver; font-family:Calibri;"><font
color="red">* </font><i>Data yang ada sebanyak</i> <b><?php echo $jumlah; ?></b>
<i>baris.</i> </td>
</tr>
<tr class="tr" style="font-family: Calibri;">
<td><center>No</center></td>
<td><center>Kode Mk</center></td>
<td><center>Matakuliah</center></td>
<td><center>Semester</center></td>
<td><center>Dosen Pengajar</center></td>
<td><center>SKS</center></td>
<td><center>Hari</center></td>
<td><center>Jam</center></td>
Laporan Pemrograman Berbasis Web
32

<td><center>Ruang</center></td>
<td><center>Operasi</center></td>
</tr>
<?php
$no=0;
while($row=mysql_fetch_array($query)){
$no++;
$warna=($no % 2 == 0)?"#efefef":"#fafafa";
?>
<tr style="font-family: Calibri;">
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $no;
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['kd_mk'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['nama_mk'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['semester'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo
$row['nama_dosen']; ?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['jumlah_sks'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['hari'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['jam'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['ruang'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center>
Laporan Pemrograman Berbasis Web
33

<a href="edit-matakuliah-admin.php?id=<?php echo $row['id'];
?>"><button type="button" class="btn btn-success btn-mini" title="Perbarui data ?"><i
class="icon-white icon-pencil"></i>&nbsp;Edit</button></a>
<a href="hapus-list-mk-admin.php?id=<?php echo $row['id'];
?>"><button class="btn btn-danger btn-mini" title="Hapus data ?"><i class="icon-white
icon-trash"></i>&nbsp;Hapus</button></a>
</center>
</td>
</tr>
<?php
}
?>
</table>
<br/>
<?php
include"bawah.php";
?>
p. tabel-matakuliah-admin-cari.php
<?php
include"koneksi.php";
include"atas-admin.php";
$berdasar=$_POST['berdasar'];
$cari=$_POST['cari'];
$query=mysql_query("select * from jadwal_mk where $berdasar LIKE '%$cari%' order by
kd_mk ASC");
$jumlah = mysql_num_rows($query);
?>
<center>
<form class="form-horizontal" action="tabel-matakuliah-admin-cari.php" method="post">
Laporan Pemrograman Berbasis Web
34

<table class="table-bordered tabel" border="0" align="center" width="600px"
cellpadding="2" cellspacing="5">
<tr>
<td style="padding:5px; background-color:silver; font-family: 10px
Calibri;"><center><b style="color:white;">Filter</b>
</td>
<td style="padding:5px; background-color:silver; font-family: 10px Calibri;">
<center>
<select name="berdasar" class="span2" autofocus="true">
<option value="-">- Berdasarkan -</option>
<option value="kd_mk">Kode Mk</option>
<option value="semester">Semester</option>
<option value="jumlah_sks">Sks</option>
</select>
<input type="text" name="cari" class="span2"/>
</center>
</td>
<td style="padding:5px; background-color:silver; font-family: 10px Calibri;">
<center>
<button type="submit" class="btn btn-success btn-mini" title="Cari data ?"><i
class="icon-white icon-search"></i> Cari</button>
<a href="tabel-matakuliah-admin.php"><button type="button" class="btn btn-
inverse btn-mini" title="Refresh data ?"><i class="icon-white icon-refresh"></i>
Segarkan</button></a>
</center>
</td>
</tr>
</table>
</form>
Laporan Pemrograman Berbasis Web
35

</center>
<table class="table-bordered tabel" border="0" align="center" width="1000px"
cellpadding="2" cellspacing="5">
<tr>
<td colspan="10" style="background-color:silver; font-family:Calibri;"><font
color="red">* </font> <?php
if($jumlah==0){
echo "<font style='color:red;'>Data tidak ditemukan !!</font>";
}else{
echo "<i>Data yang ditemukan sebanyak</i> <b>".$jumlah."</b>
<i>baris.</i>";
}
?>
</td>
</tr>
<tr class="tr" style="font-family: Calibri;">
<td><center>No</center></td>
<td><center>Kode Mk</center></td>
<td><center>Matakuliah</center></td>
<td><center>Semester</center></td>
<td><center>Dosen Pengajar</center></td>
<td><center>SKS</center></td>
<td><center>Hari</center></td>
<td><center>Jam</center></td>
<td><center>Ruang</center></td>
<td><center>Operasi</center></td>
</tr>
<?php
Laporan Pemrograman Berbasis Web
36

$no=0;
while($row=mysql_fetch_array($query)){
$no++;
$warna=($no % 2 == 0)?"#efefef":"#fafafa";
?>
<tr style="font-family: Calibri;">
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $no;
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['kd_mk'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['nama_mk'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['semester'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo
$row['nama_dosen']; ?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['jumlah_sks'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['hari'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['jam'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['ruang'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center>
<a href="edit-matakuliah-admin.php?id=<?php echo $row['id'];
?>"><button type="button" class="btn btn-success btn-mini" title="Perbarui data ?"><i
class="icon-white icon-pencil"></i>&nbsp;Edit</button></a>
<a href="hapus-list-mk-admin.php?id=<?php echo $row['id'];
?>"><button class="btn btn-danger btn-mini" title="Hapus data ?"><i class="icon-white
icon-trash"></i>&nbsp;Hapus</button></a>
Laporan Pemrograman Berbasis Web
37

</center>
</td>
</tr>
<?php
}
?>
</table>
<br/>
<?php
include"bawah.php";
?>
q. mahasiswa.php
<?php
include"koneksi.php";
include"atas-admin.php";
?>
<form method="post" action="simpan-mahasiswa.php">
<table class="table-condensed tabel" border="0" align="center" width="850px"
cellpadding="2" cellspacing="5">
<tr>
<td colspan="4">
<h4 style="font-family: Calibri;color: #fed101;"><i class="icon-
bookmark"></i> Data Mahasiswa</h4>
</td>
</tr>
<tr>
<td colspan="4">
<div class="progress progress-striped">
Laporan Pemrograman Berbasis Web
38

<div class="bar" style="width: 100%;"></div>
</div>
</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Nim</td>
<td><input type="text" name="nim" class="span2" maxlength="10"
placeholder="nim" autofocus="true" value="<?php echo $_GET['nim']; ?>"/></td>
<td style="font-family: Calibri;text-align: right;">Angkatan</td>
<td>
<?php
echo "<select name='angkatan' class='input-small'>";
echo "<option value='-'>- Pilih -</option>";
for($angk = 2000; $angk <= 2020 ; $angk++){
echo "<option value=$angk>$angk</option>";
}
echo "</select>"
?>
</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Nama</td>
<td><input type="text" name="nama" placeholder="nama lengkap"
class="span3" value="<?php echo $_GET['nama']; ?>"/></td>
<td style="font-family: Calibri;text-align: right;">Program Studi</td>
<td>
<select name="nama_prodi" class="span2">
<option value="-">- Pilih -</option>
Laporan Pemrograman Berbasis Web
39

<?php
include"koneksi.php";
$ambil=mysql_query("select nama_prodi from
program_studi ORDER BY nama_prodi ASC");
while($row=mysql_fetch_row($ambil)){
echo"<option value='$row[0]'>$row[0]</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Tempat Lahir</td>
<td><input type="text" name="tempat_lahir" placeholder="tempat lahir"
class="span2" value="<?php echo $_GET['tempat_lahir']; ?>"/></td>
<td rowspan="2" style="font-family: Calibri;text-align:
right;">Alamat</td>
<td rowspan="2"><textarea rows="3" cols="4" name="alamat"
placeholder="alamat lengkap" ><?php echo $_GET['alamat']; ?></textarea></td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Tanggal Lahir</td>
<td>
<?php
echo "<select name='tanggal' class='span1'>";
echo "<option value='## '>tanggal</option>";
for($tgl = 1; $tgl <= 31 ; $tgl++){
echo "<option value=$tgl>$tgl</option>";
Laporan Pemrograman Berbasis Web
40

}
echo "</select>";
?>
<input type="hidden" name="separator1" value=" - "/>
<select name="bulan" class="input-small">
<option value=" ## ">bulan</option>
<option value="Januari">Januari</option>
<option value="Februari">Februari</option>
<option value="Maret">Maret</option>
<option value="April">April</option>
<option value="Mei">Mei</option>
<option value="Juni">Juni</option>
<option value="Juli">Juli</option>
<option value="Agustus">Agustus</option>
<option value="September">September</option>
<option value="Oktober">Oktober</option>
<option value="November">November</option>
<option value="Desember">Desember</option>
</select>
<?php
echo "<select name='tahun' class='span1'>";
echo "<option value='####'>tahun</option>";
for($thn = 1980; $thn <= 2015 ; $thn++){
echo "<option value=$thn>$thn</option>";
}
echo "</select>";
?>
Laporan Pemrograman Berbasis Web
41

</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Jenis Kelamin</td>
<td style="font-family: Calibri;">
&nbsp;
<input type="radio" name="jenis_kelamin" value="Laki-
laki">&nbsp;Laki-laki
&nbsp;&nbsp;
<input type="radio" name="jenis_kelamin"
value="Perempuan">&nbsp;Perempuan
</td>
<td style="font-family: Calibri;text-align: right;">Program
Pendidikan</td>
<td style="font-family: Calibri;">
&nbsp;
<input type="radio" name="prog_pendidikan" value="Regular
Pagi"/>&nbsp;Regular Pagi
&nbsp;&nbsp;
<input type="radio" name="prog_pendidikan" value="Regular
Sore"/>&nbsp;Regular Sore
</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">No.Telephone</td>
<td><input type="text" name="no_telepon" class="span2"
placeholder="nomer telepon" value="<?php echo $_GET['no_telepon']; ?>"></td>
<td style="font-family: Calibri;text-align: right;">Dosen Pembimbing</td>
Laporan Pemrograman Berbasis Web
42

<td><input type="text" name="dosen_pa" placeholder="nama dosen"
value="<?php echo $_GET['dosen_pa']; ?>"/></td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Agama</td>
<td>
<select name="agama" class="span2">
<option value="-">- Pilih -</option>
<option value="Islam">Islam</option>
<option value="Kristen">Kristen</option>
<option value="Katolik">Katolik</option>
<option value="Hindu">Hindu</option>
<option value="Bhuda">Bhuda</option>
<option value="Konguchu">Konguchu</option>
</select>
</td>

<!-- HIDDEN -->
<input type="hidden" name="status" value="Bukan User"/>
<!-- HIDDEN -->

<td></td>
<td>
<button type="submit" class="btn btn-success btn-small"
title="Simpan data ?"><i class="icon-white icon-file"></i> Simpan</button>
<button type="reset" class="btn btn-danger btn-small"
title="Reset data ??"><i class="icon-white icon-refresh"></i> Reset</button>
</td>
Laporan Pemrograman Berbasis Web
43

</tr>
<tr>
<td colspan="4">
<div class="progress progress-striped">
<div class="bar" style="width: 100%;"></div>
</div>
</td>
</tr>
</table>
</form>
<?php
include"bawah.php";
?>
r. tabel-mahasiswa-admin.php
<?php
include"koneksi.php";
include"atas-admin.php";
$query=mysql_query("select * from mahasiswa order by nim ASC");
$jumlah = mysql_num_rows($query);
?>
<center>
<form class="form-horizontal" action="tabel-mahasiswa-admin-cari.php" method="post">
<table class="table-bordered tabel" border="0" align="center" width="600px"
cellpadding="2" cellspacing="5">
<tr>
<td style="padding:5px; background-color:silver; font-family: 10px
Calibri;"><center><b style="color:white;">Filter</b>
</td>
Laporan Pemrograman Berbasis Web
44

<td style="padding:5px; background-color:silver; font-family: 10px Calibri;">
<center>
<select name="berdasar" class="span2" autofocus="true">
<option value="-">- Berdasarkan -</option>
<option value="nim">Nim</option>
<option value="nama">Nama mahasiswa</option>
<option value="angkatan">Tahun angkatan</option>
<option value="program_studi">Prodi</option>
</select>
<input type="text" name="cari" class="span2"/>
</center>
</td>
<td style="padding:5px; background-color:silver; font-family: 10px Calibri;">
<center>
<button type="submit" class="btn btn-success btn-mini" title="Cari data ?"><i
class="icon-white icon-search"></i> Cari</button>
<a href="tabel-mahasiswa-admin.php"><button type="button" class="btn btn-
inverse btn-mini" title="Refresh data ?"><i class="icon-white icon-refresh"></i>
Segarkan</button></a>
</center>
</td>
</tr>
</table>
</form>
</center>
<table class="table-bordered tabel" border="0" align="center" width="1190px"
cellpadding="2" cellspacing="5">
<tr>
Laporan Pemrograman Berbasis Web
45

<td colspan="13" style="background-color:silver; font-family:Calibri;"><font
color="red">* </font><i>Data yang ada sebanyak</i> <b><?php echo $jumlah; ?></b>
<i>baris.</i> </td>
</tr>
<tr class="tr" style="font-family: Calibri;">
<td><center>Nim</center></td>
<td><center>Nama</center></td>
<td><center>TTL</center></td>
<td><center>Agama</center></td>
<td><center>No.Telepon</center></td>
<td><center>Jenis Kelamin</center></td>
<td><center>Alamat</center></td>
<td><center>Angkatan</center></td>
<td><center>Prodi</center></td>
<td><center>Program Pendidikan</center></td>
<td><center>Dosen Pembimbing</center></td>
<td></td>
</tr>
<?php
while($row=mysql_fetch_array($query)){
if($row['status']=="Bukan User"){
$warna_nim="red";
}elseif($row['status']=="User"){
$warna_nim="#04fb30";
}else{
$warna=($no % 2 == 0)?"#efefef":"#fafafa";
}
?>
Laporan Pemrograman Berbasis Web
46

<tr style="font-family: Calibri;">
<td bgcolor="<?php echo $warna_nim; ?>"><center>
<?php
if($row['status']=="Bukan User"){
echo "<font color='white'><i>".$row['nim']."</i> -
<b>".$row['status']."</b></font>";
}elseif($row['status']=="User"){
echo "<font color='white'><i>".$row['nim']."</i> -
<b>".$row['status']."</b></font>";
}else{
echo"Gagal.";
}
?>
</center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['nama'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo
$row['tempat_lahir'].", ".$row['tanggal_lahir']; ?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['agama'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['no_telepon'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo
$row['jenis_kelamin']; ?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['alamat'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['angkatan'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo
$row['program_studi']; ?></center></td>
Laporan Pemrograman Berbasis Web
47

<td bgcolor="<?php echo $warna; ?>"><center><?php echo
$row['program_pendidikan']; ?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo
$row['dosen_pembimbing']; ?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center>
<a href="edit-mahasiswa-admin.php?id=<?php echo $row['id'];
?>"><button type="button" class="btn btn-success btn-mini" title="Perbarui data ?"><i
class="icon-white icon-pencil"></i>&nbsp;Edit</button></a>
<a href="hapus-list-mahasiswa-admin.php?id=<?php echo $row['id'];
?>&nim=<?php echo $row['nim']; ?>"><button class="btn btn-danger btn-mini"
title="Hapus data ?"><i class="icon-white icon-trash"></i>&nbsp;Hapus</button></a>
<a href="tambahkan-user.php?nim=<?php echo $row['nim'];
?>"><button type="button" class="btn btn-inverse btn-mini" title="Tambahkan nim <?php
echo $row['nim']; ?> untuk menjadi user."><i class="icon-white icon-off"></i>
Tambah</button></a>
</center>
</td>
</tr>
<?php
}
?>
</table>
<br/>
<?php
include"bawah.php";
?>
s. tabel-mahasiswa-admin-cari.php
<?php
include"koneksi.php";
include"atas-admin.php";
Laporan Pemrograman Berbasis Web
48

$berdasar=$_POST['berdasar'];
$cari=$_POST['cari'];
$query=mysql_query("select * from mahasiswa where $berdasar LIKE '%$cari%' order by
nim ASC");
$jumlah = mysql_num_rows($query);
?>
<center>
<form class="form-horizontal" action="tabel-mahasiswa-admin-cari.php" method="post">
<table class="table-bordered tabel" border="0" align="center" width="600px"
cellpadding="2" cellspacing="5">
<tr>
<td style="padding:5px; background-color:silver; font-family: 10px
Calibri;"><center><b style="color:white;">Filter</b>
</td>
<td style="padding:5px; background-color:silver; font-family: 10px Calibri;">
<center>
<select name="berdasar" class="span2" autofocus="true">
<option value="-">- Berdasarkan -</option>
<option value="nim">Nim</option>
<option value="nama">Nama mahasiswa</option>
<option value="angkatan">Tahun angkatan</option>
<option value="nama_prodi">Prodi</option>
</select>
<input type="text" name="cari" class="span2"/>
</center>
</td>
<td style="padding:5px; background-color:silver; font-family: 10px Calibri;">
<center>
Laporan Pemrograman Berbasis Web
49

<button type="submit" class="btn btn-success btn-mini" title="Cari data ?"><i
class="icon-white icon-search"></i> Cari</button>
<a href="tabel-mahasiswa-admin.php"><button type="button" class="btn btn-
inverse btn-mini" title="Refresh data ?"><i class="icon-white icon-refresh"></i>
Segarkan</button></a>
</center>
</td>
</tr>
</table>
</form>
</center>
<table class="table-bordered tabel" border="0" align="center" width="1190px"
cellpadding="2" cellspacing="5">
<tr>
<td colspan="13" style="background-color:silver; font-family:Calibri;"><font
color="red">* </font> <?php
if($jumlah==0){
echo "<font style='color:red;'>Data tidak ditemukan !!</font>";
}else{
echo "<i>Data yang ditemukan sebanyak</i> <b>".$jumlah."</b>
<i>baris.</i>";
}
?>
</td>
</tr>
<tr class="tr" style="font-family: Calibri;">
<td><center>No</center></td>
<td><center>Nim</center></td>
<td><center>Nama</center></td>
Laporan Pemrograman Berbasis Web
50

<td><center>TTL</center></td>
<td><center>Agama</center></td>
<td><center>No.Telepon</center></td>
<td><center>Jenis Kelamin</center></td>
<td><center>Alamat</center></td>
<td><center>Angkatan</center></td>
<td><center>Prodi</center></td>
<td><center>Program Pendidikan</center></td>
<td><center>Dosen Pembimbing</center></td>
<td></td>
</tr>
<?php
while($row=mysql_fetch_array($query)){
if($row['status']=="Bukan User"){
$warna_nim="red";
}elseif($row['status']=="User"){
$warna_nim="#04fb30";
}else{
$warna=($no % 2 == 0)?"#efefef":"#fafafa";
}
?>
<tr style="font-family: Calibri;">
<td bgcolor="<?php echo $warna_nim; ?>"><center>
<?php
if($row['status']=="Bukan User"){
echo "<font color='white'><i>".$row['nim']."</i> -
<b>".$row['status']."</b></font>";
Laporan Pemrograman Berbasis Web
51

}elseif($row['status']=="User"){
echo "<font color='white'><i>".$row['nim']."</i> -
<b>".$row['status']."</b></font>";
}else{
echo"Gagal.";
}
?>
</center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['nama'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo
$row['tempat_lahir'].", ".$row['tanggal_lahir']; ?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['agama'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['no_telepon'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo
$row['jenis_kelamin']; ?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['alamat'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['angkatan'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo
$row['program_studi']; ?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo
$row['program_pendidikan']; ?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo
$row['dosen_pembimbing']; ?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center>
Laporan Pemrograman Berbasis Web
52

<a href="edit-mahasiswa-admin.php?id=<?php echo $row['id'];
?>"><button type="button" class="btn btn-success btn-mini" title="Perbarui data ?"><i
class="icon-white icon-pencil"></i>&nbsp;Edit</button></a>
<a href="hapus-list-mahasiswa-admin.php?id=<?php echo $row['id'];
?>&nim=<?php echo $row['nim']; ?>"><button class="btn btn-danger btn-mini"
title="Hapus data ?"><i class="icon-white icon-trash"></i>&nbsp;Hapus</button></a>
<a href="tambahkan-user.php?nim=<?php echo $row['nim'];
?>"><button type="button" class="btn btn-inverse btn-mini" title="Tambahkan nim <?php
echo $row['nim']; ?> untuk menjadi user."><i class="icon-white icon-off"></i>
Tambah</button></a>
</center>
</td>
</tr>
<?php
}
?>
</table>
<br/>
<?php
include"bawah.php";
?>
t. simpan-matakuliah.php
<?php
include"koneksi.php";
$kd_mk = $_POST['kd_mk'];
$nm_mk = $_POST['mata_kuliah'];
$smster = $_POST['semester'];
$nm_dosen = $_POST['nama_dosen'];
$sks = $_POST['sks'];
Laporan Pemrograman Berbasis Web
53

$hari = $_POST['hari'];
$jam1 = $_POST['jam1'];
$jam2 = $_POST['jam2'];
$jam3 = $_POST['jam3'];
$sum = $jam1.$jam2.$jam3;
$ruang = $_POST['ruang'];
$cek=mysql_fetch_array(mysql_query("select kd_mk,hari,jam,ruang from jadwal_mk
WHERE kd_mk='$kd_mk' && hari='$hari' && jam='$sum' && ruang='$ruang'"));
if(!empty($cek['kd_mk']) && !empty($cek['hari']) && !empty($cek['jam']) &&
!empty($cek['ruang'])){
echo"<script>alert('Kode matakuliah, hari, jam dan ruangan ada yang sama
!!');window.location='matakuliah.php?&kd_mk=$kd_mk&mata_kuliah=$nm_mk&nama_do
sen=$nm_dosen&sks=$sks&hari=$hari&jam1=$jam1&jam3=$jam3&ruang=$ruang'</script>
";
}elseif($query=mysql_query("insert into jadwal_mk
values('','$kd_mk','$nm_mk','$smster','$nm_dosen','$sks','$hari','$sum','$ruang')")){
echo"<script>alert('Data berhasil
disimpan.');window.location='matakuliah.php?act=matakuliah'</script>";
}else{
echo"<script>alert('Data gagal disimpan
!!');window.location='matakuliah.php?act=matakuliah'</script>";
}
?>
u. simpan-mahasiswa.php
<?php
include"koneksi.php";
$nim = $_POST['nim'];
$nama = $_POST['nama'];
$tempat_lahir = $_POST['tempat_lahir'];
$tgl = $_POST['tanggal'];
Laporan Pemrograman Berbasis Web
54

$separator1 = $_POST['separator1'];
$bulan =$_POST['bulan'];
$tahun = $_POST['tahun'];
$sum = $tgl.$separator1.$bulan.$separator1.$tahun;
$agama = $_POST['agama'];
$no_telp = $_POST['no_telepon'];
$jk = $_POST['jenis_kelamin'];
$alamat = $_POST['alamat'];
$angkatan = $_POST['angkatan'];
$nama_prodi = $_POST['nama_prodi'];
$prog_pendidikan = $_POST['prog_pendidikan'];
$dosen_pa = $_POST['dosen_pa'];
$status = $_POST['status'];
$cek=mysql_fetch_array(mysql_query("select nim from mahasiswa WHERE nim='$nim'"));
if(!empty($cek['nim'])){
echo"<script>alert('Nim sudah ada di database
!!');window.location='mahasiswa.php?&nim=$nim&tempat_lahir=$tempat_lahir&nama=$n
ama&no_telepon=$no_telp&alamat=$alamat&dosen_pa=$dosen_pa'</script>";
}elseif($query=mysql_query("insert into mahasiswa
values('','$nim','$nama','$tempat_lahir','$sum','$agama','$no_telp','$jk','$alamat','$angkata
n','$nama_prodi','$prog_pendidikan','$dosen_pa','$status')")){
echo"<script>alert('Data berhasil disimpan.');window.location='tabel-mahasiswa-
admin.php'</script>";
}else{
echo"<script>alert('Data gagal disimpan
?');window.location='mahasiswa.php'</script>";
}
?>

Laporan Pemrograman Berbasis Web
55

v. tambahkan-user.php
<?php
session_start();
include"koneksi.php";
include"atas-admin.php";
?>
<form action="simpan-tambahkan-user.php?nim=<?php echo $_GET['nim']; ?>"
method="post">
<table align="center" width="330px" cellpadding="2" cellspacing="5" border="0">
<tr>
<td colspan="2" bgcolor="#0079ff" style="text-align:center;
color:white;font-family: Calibri;">Tambah User <i class="icon-white icon-exclamation-
sign"></i></td>
</tr>
<tr>
<td style="font-family: Calibri;">Nim</td>
<td style="font-family: Calibri;font-weight: bold;font-style: italic;text-
align: left;">&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $_GET['nim']; ?>
<input type="hidden" name="username" value="<?php echo
$_GET['nim']; ?>"/></b>
</td>
</tr>
<tr>
<input type="hidden" name="level" value="mahasiswa"/>
<td style="font-family: Calibri;">Password</td>
<td><input type="password" name="pass" class="span2"
autofocus="true"/></td>
</tr>
<tr>
Laporan Pemrograman Berbasis Web
56

<td style="font-family: Calibri;">Confirm Password</td>
<td><input type="password" name="pass2" class="span2"/></td>
</tr>
<tr>
<td></td>
<td>
<center><button type="submit" class="btn btn-success btn-mini"
title="Simpan user ?"><i class="icon-white icon-file"></i> Simpan</button></center>
</td>
</tr>
<tr>
<td colspan="2"><center><hr width="330px" style=" border-bottom-
style: none; border-top-color: #0079ff;"></center></td>
</tr>
</table>
</form>
<?php
include"bawah.php";
?>
w. edit-matakuliah-admin.php
<?php
include"koneksi.php";
include"atas-admin.php";
$id = $_GET['id'];
$query=mysql_query("select * from jadwal_mk where id='$id'");
?>
<form action="simpan-edit-matakuliah.php" method="post">
<?php
Laporan Pemrograman Berbasis Web
57

while($row=mysql_fetch_array($query)){
?>
<input type="hidden" name="id" value="<?php echo $id; ?>"/>
<table class="table-condensed tabel" border="0" align="center" width="600px"
cellpadding="2" cellspacing="5">
<tr>
<td colspan="4">
<h4 style="font-family: Calibri;color: #fed101;"><i class="icon-
bookmark"></i> Edit Matakuliah</h4>
</td>
</tr>
<tr>
<td colspan="4">
<div class="progress progress-striped">
<div class="bar" style="width: 100%;"></div>
</div>
</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Kode Mk</td>
<td><input type="text" name="kd_mk" class="span2" placeholder="kode
matakuliah" value="<?php echo $row['kd_mk']; ?>"/></td>
<td style="font-family: Calibri;text-align: right;">Semester</td>
<td>
<input type="text" name="semester" class="span1" value="<?php
echo $row['semester']; ?>"/>
</td>
</tr>
Laporan Pemrograman Berbasis Web
58

<tr>
<td style="font-family: Calibri;text-align: right;">Mata Kuliah</td>
<td><input type="text" name="mata_kuliah" placeholder="nama
matakuliah" value="<?php echo $row['nama_mk']; ?>"/></td>
<td style="font-family: Calibri;text-align: right;">SKS</td>
<td>
<input type="text" name="sks" class="span1" value="<?php echo
$row['jumlah_sks']; ?>"/>
</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Dosen Pengajar</td>
<td><input type="text" name="nama_dosen" placeholder="nama dosen"
value="<?php echo $row['nama_dosen']; ?>"/></td>
<td style="font-family: Calibri;text-align: right;">Hari</td>
<td>
<input type="text" name="hari" class="input-small" value="<?php
echo $row['hari']; ?>"/>
</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Ruang</td>
<td>
<input type="text" name="ruang" placeholder="ruang B-2.4"
value="<?php echo $row['ruang']; ?>"/>
</td>
<td style="font-family: Calibri;text-align: right;">Jam</td>
<td style="font-family: Calibri;">
Laporan Pemrograman Berbasis Web
59

<input type="text" name="jam" class="input-small" placeholder="
00:00" value="<?php echo $row['jam']; ?>"/>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td colspan="2"><button type="submit" class="btn btn-success btn-
small" title="Perbarui data ?"><i class="icon-white icon-file"></i>&nbsp;Simpan</button>
<a href="tabel-matakuliah-admin.php"><button type="button"
class="btn btn-danger btn-small"title="Batal edit data ?"><i class="icon-white icon-
refresh"></i> Batal</button></a>
</td>
</tr>
<tr>
<td colspan="4">
<div class="progress progress-striped">
<div class="bar" style="width: 100%;"></div>
</div>
</td>
</tr>
</table>
</form>
<?php
}
include"bawah.php";
?>

Laporan Pemrograman Berbasis Web
60

x. simpan-edit-matakuliah.php
<?php
include"koneksi.php";
$id=$_POST['id'];
$kd_mk = $_POST['kd_mk'];
$nm_mk = $_POST['mata_kuliah'];
$smster = $_POST['semester'];
$nm_dosen = $_POST['nama_dosen'];
$sks = $_POST['sks'];
$hari = $_POST['hari'];
$jam = $_POST['jam'];
$ruang = $_POST['ruang'];
if($query=mysql_query("update jadwal_mk set
kd_mk='$kd_mk',nama_mk='$nm_mk',semester='$smster',nama_dosen='$nm_dosen',juml
ah_sks='$sks',hari='$hari',jam='$jam',ruang='$ruang' where id='$id'")){
echo"<script>alert('Data berhasil diperbarui.');window.location='tabel-matakuliah-
admin.php'</script>";
}else{
echo"<script>alert('Data gagal diperbarui.');window.location='tabel-matakuliah-
admin.php'</script>";
}
?>
y. edit-mahasiswa-admin.php
<?php
include"koneksi.php";
include"atas-admin.php";
$id = $_GET['id'];
$query=mysql_query("select * from mahasiswa where id='$id'");
Laporan Pemrograman Berbasis Web
61

?>
<form action="simpan-edit-mahasiswa.php" method="post">
<?php
while($row=mysql_fetch_array($query)){
?>
<input type="hidden" name="id" value="<?php echo $id; ?>"/>
<table class="table-condensed tabel" border="0" align="center" width="850px"
cellpadding="2" cellspacing="5">
<tr>
<td colspan="4">
<h4 style="font-family: Calibri;color: #fed101;"><i class="icon-
bookmark"></i>Edit Data Mahasiswa</h4>
</td>
</tr>
<tr>
<td colspan="4">
<div class="progress progress-striped">
<div class="bar" style="width: 100%;"></div>
</div>
</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Nim</td>
<td><input type="text" name="nim" class="span2" value="<?php echo
$row['nim']; ?>"/></td>
<td style="font-family: Calibri;text-align: right;">Angkatan</td>
<td>
Laporan Pemrograman Berbasis Web
62

<input type="text" name="angkatan" class="span1" value="<?php echo
$row['angkatan'];?>"/>
</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Nama</td>
<td><input type="text" name="nama" value="<?php echo $row['nama'];
?>"/></td>
<td style="font-family: Calibri;text-align: right;">Program Studi</td>
<td>
<input type="text" name="prodi" value="<?php echo
$row['program_studi'];?>"/>
</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Tempat Lahir</td>
<td><input type="text" name="tempat_lahir" value="<?php echo
$row['tempat_lahir']; ?>"/></td>
<td rowspan="2" style="font-family: Calibri;text-align: right;">Alamat</td>
<td rowspan="2"><textarea rows="3" cols="4" name="alamat"
placeholder="alamat lengkap" ><?php echo $row['alamat'];?></textarea></td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Tanggal Lahir</td>
<td>
<input type="text" name="tanggal_lahir" value="<?php echo
$row['tanggal_lahir'];?>"/>
</td>
</tr>
Laporan Pemrograman Berbasis Web
63

<tr>
<td style="font-family: Calibri;text-align: right;">Jenis Kelamin</td>
<td style="font-family: Calibri;">
<input type="text" name="jenis_kelamin" class="span2"
value="<?php echo $row['jenis_kelamin'];?>"/>
</td>
<td style="font-family: Calibri;text-align: right;">Program
Pendidikan</td>
<td style="font-family: Calibri;">
<input type="text" name="program_pendidikan" value="<?php
echo $row['program_pendidikan'];?>"/>
</td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">No.Telephone</td>
<td><input type="text" name="no_telepon" class="span2" value="<?php
echo $row['no_telepon'];?>"/></td>
<td style="font-family: Calibri;text-align: right;">Dosen Pembimbing</td>
<td><input type="text" name="dosen_pembimbing" value="<?php echo
$row['dosen_pembimbing'];?>"/></td>
</tr>
<tr>
<td style="font-family: Calibri;text-align: right;">Agama</td>
<td>
<input type="text" name="agama" class="span2" value="<?php
echo $row['agama'];?>"/>
</td>
<td></td>
<td>
Laporan Pemrograman Berbasis Web
64

<button type="submit" class="btn btn-success btn-small"
title="Perbarui data ?"><i class="icon-white icon-file"></i> Simpan</button>
<a href="tabel-mahasiswa-admin.php"><button type="button"
class="btn btn-danger btn-small" title="Batal edit data ??"><i class="icon-white icon-
refresh"></i> Batal</button></a>
</td>
</tr>
<tr>
<td colspan="4">
<div class="progress progress-striped">
<div class="bar" style="width: 100%;"></div>
</div>
</td>
</tr>
</table>
</form>
<br>
<?php
}
include"bawah.php";
?>
z. simpan-edit-mahasiswa.php
<?php
include"koneksi.php";
$id = $_POST['id'];
$nim = $_POST['nim'];
$angkatan = $_POST['angkatan'];
$nama = $_POST['nama'];
Laporan Pemrograman Berbasis Web
65

$prodi = $_POST['prodi'];
$tempat_lahir = $_POST['tempat_lahir'];
$alamat = $_POST['alamat'];
$tanggal_lahir = $_POST['tanggal_lahir'];
$jenis_kelamin = $_POST['jenis_kelamin'];
$program_pendidikan = $_POST['program_pendidikan'];
$no_telepon = $_POST['no_telepon'];
$dosen_pembimbing = $_POST['dosen_pembimbing'];
$agama = $_POST['agama'];
if(($nim=="") or ($angkatan=="") or ($nama=="") or ($prodi=="") or ($tempat_lahir=="") or
($alamat=="") or ($tanggal_lahir=="") or ($jenis_kelamin=="") or
($program_pendidikan=="") or ($no_telepon=="") or ($dosen_pembimbing=="") or
($agama=="")){
echo"<script>alert('Data tidak boleh kosong !!');window.location='tabel-mahasiswa-
admin.php'</script>";
}elseif($query=mysql_query("update mahasiswa set
nim='$nim',nama='$nama',tempat_lahir='$tempat_lahir',tanggal_lahir='$tanggal_lahir',aga
ma='$agama',no_telepon='$no_telepon',jenis_kelamin='$jenis_kelamin',alamat='$alamat',a
ngkatan='$angkatan',program_studi='$prodi',program_pendidikan='$program_pendidikan',
dosen_pembimbing='$dosen_pembimbing' where id='$id'")){
echo"<script>alert('Data berhasil diperbarui.');window.location='tabel-mahasiswa-
admin.php'</script>";
}else{
echo"<script>alert('Data gagal diperbarui !!');window.location='tabel-mahasiswa-
admin.php'</script>";
}
?>
aa. mahasiswa-krs.php
<?php
session_start();
Laporan Pemrograman Berbasis Web
66

include"koneksi.php";
include"atas-mahasiswa.php";
$ambil=mysql_query("select
mahasiswa.nama,mahasiswa.nim,mahasiswa.dosen_pembimbing,mahasiswa.program_pen
didikan,mahasiswa.program_studi,mahasiswa.angkatan,user.username from mahasiswa
inner join user on mahasiswa.nim=user.username where nim='$_SESSION[username]'");
$query=mysql_query("select
k.id,jm.kd_mk,jm.nama_mk,jm.semester,jm.semester,jm.nama_dosen,jm.jumlah_sks,jm.ha
ri,jm.jam,jm.ruang from krs k, jadwal_mk jm where k.id=jm.id and
k.nim='$_SESSION[username]'");

?>
<table align="center" border="1" width="800px" cellpadding="2" cellspacing="5">
<tr>
<td colspan="6" style="font-family:Calibri; font-weight: bold; text-align: center;
background-color: silver;">Data Diri</td>
</tr>
<?php
while($baris=mysql_fetch_array($ambil)){
?>
<tr style="font-family: Calibri;">
<td><i>Nama</i></td>
<td><center>:</center></td>
<td><b><?php echo $baris['nama']; ?></b></td>
<td><i>Program Studi</i></td>
<td><center>:</center></td>
<td><b><?php echo $baris['program_studi']; ?></b></td>
</tr>
<tr style="font-family: Calibri;">
Laporan Pemrograman Berbasis Web
67

<td><i>Nim</i></td>
<td><center>:</center></td>
<td><b><?php echo $baris['nim']; ?></b></td>
<td><i>Prog Pendidikan</i></td>
<td><center>:</center></td>
<td><b><?php echo $baris['program_pendidikan']; ?></b></td>
</tr>
<tr style="font-family: Calibri;">
<td><i>Dosen PA</i></td>
<td><center>:</center></td>
<td><b><?php echo $baris['dosen_pembimbing']; ?></b></td>
<td><i>Tahun Angkatan</i></td>
<td><center>:</center></td>
<td><b><?php echo $baris['angkatan']; ?></b></td>
</tr>
<?php
}
?>
<tr>
<td colspan="6" style="font-family:Calibri; font-weight: bold; text-align:
center;background-color: silver;"></td>
</tr>
</table>
<br/>
<table align="center" border="0" width="800px" cellpadding="2" cellspacing="5">
<tr>
<td>
Laporan Pemrograman Berbasis Web
68

<a href="ambil-matakuliah-krs.php" target="_parent">
&nbsp;<button type="submit" class="btn btn-primary btn-mini"
title="Ambil matakuliah ?"><i class="icon-white icon-plus"></i> Ambil Mk</button>
</a>
</td>
</tr>
</table>
<table align="center" border="1" width="800px" cellpadding="2" cellspacing="5">
<tr style="font-family: Calibri; background-color: silver;font-weight: bold;">
<td><center>Kode Mk</center></td>
<td><center>Matakuliah</center></td>
<td><center>Sks</center></td>
<td><center>Nama Dosen</center></td>
<td><center>Hari</center></td>
<td><center>Jam</center></td>
<td><center>Ruang</center></td>
<td></td>
</tr>
<?php
while($row=mysql_fetch_array($query)){
?>
<tr style="font-family: Calibri;">
<td><center><?php echo $row['kd_mk']; ?></center></td>
<td><?php echo $row['nama_mk']; ?></td>
<td><center><?php echo $row['jumlah_sks']; ?></center></td>
<td><?php echo $row['nama_dosen']; ?></td>
<td><center><?php echo $row['hari']; ?></center></td>
Laporan Pemrograman Berbasis Web
69

<td><center><?php echo $row['jam']; ?></center></td>
<td><center><?php echo $row['ruang']; ?></center></td>
<td><center>
<a href="hapus-krs-mahasiswa.php?id=<?php echo $row['id'];
?>"><button type="submit" class="btn btn-danger btn-mini" title="Hapus ?"><i class="icon-
white icon-remove"></i></button></a>
</center>
</td>
</tr>
<?php
}
?>
</table>
<br/>
<?php
include"bawah.php";
?>
bb. ambil-matakuliah-krs.php
<?php
session_start();
include"koneksi.php";
include"atas-mahasiswa.php";
$query=mysql_query("select * from jadwal_mk order by kd_mk ASC");
?>
<center>
<form class="form-horizontal" action="ambil-matakuliah-cari-krs.php" method="post">
<table class="table-bordered tabel" border="0" align="center" width="600px"
cellpadding="2" cellspacing="5">
Laporan Pemrograman Berbasis Web
70

<tr>
<td style="padding:5px; background-color:silver; font-family: 10px
Calibri;"><center><b style="color:white;">Filter</b>
</td>
<td style="padding:5px; background-color:silver; font-family: 10px Calibri;">
<center>
<select name="berdasar" class="span2" autofocus="true">
<option value="-">- Berdasarkan -</option>
<option value="kd_mk">Kode matakuliah</option>
<option value="semester">Semester</option>
<option value="jumlah_sks">Sks</option>
</select>
<input type="text" name="cari" class="span2"/>
</center>
</td>
<td style="padding:5px; background-color:silver; font-family: 10px Calibri;">
<center>
<button type="submit" class="btn btn-success btn-mini" title="Cari data ?"><i
class="icon-white icon-search"></i> Cari</button>
<a href="ambil-matakuliah-krs.php"><button type="button" class="btn btn-
inverse btn-mini" title="Refresh data ?"><i class="icon-white icon-refresh"></i>
Segarkan</button></a>
</center>
</td>
</tr>
</table>
</form>

Laporan Pemrograman Berbasis Web
71

</center>
<form action="simpan-krs-mahasiswa.php" method="post">
<table class="table-bordered tabel" border="0" align="center" width="1000px"
cellpadding="2" cellspacing="5">
<tr>
<td colspan="9" style="background-color: silver;">&nbsp;&nbsp;&nbsp;<button
type="submit" class="btn btn-primary btn-mini" title="Ambil matakuliah ?"><i class="icon-
white icon-plus"></i> Ambil</button></td>
</tr>
<tr style="font-family: Calibri; background-color: #afd0fe;color: white;">
<td><center>No</center></td>
<td><center>Kode Mk</center></td>
<td><center>Matakuliah</center></td>
<td><center>Semester</center></td>
<td><center>Dosen Pengajar</center></td>
<td><center>SKS</center></td>
<td><center>Waktu</center></td>
<td><center>Ruang</center></td>
<td><center></center></td>
</tr>
<?php
$no=0;
while($row=mysql_fetch_array($query)){
$no++;
$warna=($no % 2 == 0)?"#efefef":"#fafafa";
?>
<tr style="font-family: Calibri;">
Laporan Pemrograman Berbasis Web
72

<td bgcolor="<?php echo $warna; ?>"><center><?php echo $no;
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['kd_mk'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['nama_mk'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['semester'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo
$row['nama_dosen']; ?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['jumlah_sks'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['hari'].",
".$row['jam']; ?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['ruang'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center>
<input type="radio" name="id" value="<?php echo $row['id']; ?>"/>
Ambil
</center>
</td>
</tr>
<tr>
<td><input type="hidden" name="nim" value="<?php echo
$_SESSION['username']; ?>"/></td>
<td><input type="hidden" name="kd_mk" value="<?php echo $row['kd_mk'];
?>"/></td>
</tr>
<?php
}
?>
Laporan Pemrograman Berbasis Web
73

</table>
</form>
<br/>
<?php
include"bawah.php";
?>
cc. ambil-matakuliah-cari-krs.php
<?php
session_start();
include"koneksi.php";
include"atas-mahasiswa.php";
$query=mysql_query("select * from jadwal_mk order by kd_mk ASC");
?>
<center>
<form class="form-horizontal" action="ambil-matakuliah-cari-krs.php" method="post">
<table class="table-bordered tabel" border="0" align="center" width="600px"
cellpadding="2" cellspacing="5">
<tr>
<td style="padding:5px; background-color:silver; font-family: 10px
Calibri;"><center><b style="color:white;">Filter</b>
</td>
<td style="padding:5px; background-color:silver; font-family: 10px Calibri;">
<center>
<select name="berdasar" class="span2" autofocus="true">
<option value="-">- Berdasarkan -</option>
<option value="kd_mk">Kode matakuliah</option>
<option value="semester">Semester</option>
<option value="jumlah_sks">Sks</option>
Laporan Pemrograman Berbasis Web
74

</select>
<input type="text" name="cari" class="span2"/>
</center>
</td>
<td style="padding:5px; background-color:silver; font-family: 10px Calibri;">
<center>
<button type="submit" class="btn btn-success btn-mini" title="Cari data ?"><i
class="icon-white icon-search"></i> Cari</button>
<a href="ambil-matakuliah-krs.php"><button type="button" class="btn btn-
inverse btn-mini" title="Refresh data ?"><i class="icon-white icon-refresh"></i>
Segarkan</button></a>
</center>
</td>
</tr>
</table>
</form>

</center>
<form action="simpan-krs-mahasiswa.php" method="post">
<table class="table-bordered tabel" border="0" align="center" width="1000px"
cellpadding="2" cellspacing="5">
<tr>
<td colspan="9" style="background-color: silver;">&nbsp;&nbsp;&nbsp;<button
type="submit" class="btn btn-primary btn-mini" title="Ambil matakuliah ?"><i class="icon-
white icon-plus"></i> Ambil</button></td>
</tr>
<tr style="font-family: Calibri; background-color: #afd0fe;color: white;">
<td><center>No</center></td>
<td><center>Kode Mk</center></td>
Laporan Pemrograman Berbasis Web
75

<td><center>Matakuliah</center></td>
<td><center>Semester</center></td>
<td><center>Dosen Pengajar</center></td>
<td><center>SKS</center></td>
<td><center>Waktu</center></td>
<td><center>Ruang</center></td>
<td><center></center></td>
</tr>
<?php
$no=0;
while($row=mysql_fetch_array($query)){
$no++;
$warna=($no % 2 == 0)?"#efefef":"#fafafa";
?>
<tr style="font-family: Calibri;">
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $no;
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['kd_mk'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['nama_mk'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['semester'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo
$row['nama_dosen']; ?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['jumlah_sks'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['hari'].",
".$row['jam']; ?></center></td>
Laporan Pemrograman Berbasis Web
76

<td bgcolor="<?php echo $warna; ?>"><center><?php echo $row['ruang'];
?></center></td>
<td bgcolor="<?php echo $warna; ?>"><center>
<input type="radio" name="id" value="<?php echo $row['id']; ?>"/>
Ambil
</center>
</td>
</tr>
<tr>
<td><input type="hidden" name="nim" value="<?php echo
$_SESSION['username']; ?>"/></td>
<td><input type="hidden" name="kd_mk" value="<?php echo $row['kd_mk'];
?>"/></td>
</tr>
<?php
}
?>
</table>
</form>
<br/>
<?php
include"bawah.php";
?>
dd. hapus-list-mk-admin.php
<?php
include"koneksi.php";
$id = $_GET['id'];
if($query=mysql_query("delete from jadwal_mk where id='$id'")){
Laporan Pemrograman Berbasis Web
77

echo"<script>alert('Data berhasil dihapus.');window.location='tabel-matakuliah-
admin.php'</script>";
}else{
echo"<script>alert('Data gagal dihapus !!');window.location='tabel-matakuliah-
admin.php'</script>";
}
?>
ee. hapus-list-mahasiswa-admin.php
<?php
include"koneksi.php";
$nim = $_GET['nim'];
$id = $_GET['id'];
if((mysql_query("delete from mahasiswa where id='$id'")) && (mysql_query("delete from
user where username='$nim'"))){
echo"<script>alert('Data berhasil dihapus.');window.location='tabel-mahasiswa-
admin.php'</script>";
}else{
echo"<script>alert('Data gagal dihapus !!');window.location='tabel-mahasiswa-
admin.php'</script>";
}
?>
ff. hapus-krs-mahasiswa.php
<?php
include"koneksi.php";
$id = $_GET['id'];
if($query=mysql_query("delete from krs where id='$id'")){
echo"<script>alert('Data berhasil dihapus.');window.location='mahasiswa-
krs.php'</script>";
}else{
Laporan Pemrograman Berbasis Web
78

echo"<script>alert('Data gagal dihapus !!');window.location='mahasiswa-
krs.php'</script>";
}
?>
5. Tampilan Sistem Iinformasi
a. index

b. login-admin

c.login-mahasiswa



Laporan Pemrograman Berbasis Web
79

d.index-admin

e.index-mahasiswa

Sekian modul ini saya buat.
Selamat mencoba.