1. Analisa Kebutuhan Data
- Aplikasi ini berfungsi untuk menyimpan data nilai mahasiswa tiap matakuliah yang telah ditempuh.
- Menghitung Nilai Akhir dan Grade yang diperoleh mahasiswa.
- Mempermudah dalam memasukan data:
- Data Fakultas
- Data Program Studi
- Data Matakuliah
- Data Mahasiswa
- Data Penilaian Mahasiswa
Perancangan Database :
1. Data Admin (Tabel: tbadmin)
- Username (Field: username, text, 50, Primary Key)
- Password (Field: passuser, text, 50)
- Nama Lengkap (Field: Nama, text, 100)
- E-mail(Field: email, text, 100)
- Telepon (Field: no_tlp, text, 20)
- Level User (Field: level, text, 20)
- Blokir (Field: blokir, enum, 'Y', 'N')
Fungsi : Untuk membatasi hak akses pengguna yang diperbolehkan mengakses aplikasi
2. Data Fakultas (Tabel: tbfakultas)
- Kode Fakultas (Field: KodeFakultas, text, 5, Primary Key)
- Nama Fakultas (Field: NamaFakultas, text, 50)
3. Data Program Studi (Tabel: tbprodi)
- Kode Program Studi (Field: KodeProdi, text, 5, Primary Key)
- Nama Program Studi (Field: NamaProdi, text, 50)
- Kode Fakultas (Field: KodeFakultas, text, 5)
4. Data Matakuliah (Tabel: tbmk)
- Kode Matakuliah (Field: KodeMK, text, 5, Primary Key)
- Nama Matakuliah (Field: NamaMK, text, 50)
- SKS (Field: SKS, numberic, 2)
- Semester (Field: Semester, numberic, 2)
5. Data Mahasiswa (Tabel: tbmahasiswa)
- NIM (Field: NIM, text, 16, Primary Key)
- Nama Mahasiswa (Field: NamaMahasiswa, text, 50)
- Alamat Mahasiswa (Field: AlamatMahasiswa, text, 50)
- Telepon Mahasiswa (Field: TlpMahasiswa, text, 50)
- Kode Program Studi (Field: KodeProdi, text, 5)
6. Data Penilaian (Tabel: tbnilai)
- NIM (Field: NIM, text, 16)
- Kode Matakuliah (Field: KodeMK, text, 5)
- Jumlah Pertemuan (Field: Pertemuan, numberic, 2)
- Jumlah Kehadiran (Field: Kehadiran, numberic, 2)
- Nilai Tugas (Field: NTugas, numberic, 2)
- Nilai Ujian Tengah Semester (Field: NUTS, numberic, 2)
- Nilai Ujian Akhir Semester (Field: NUAS, numberic, 2)
- Nilai Akhir (Field: NA, numberic, 5)
- Grade (Field: Grade, text, 1)
2. Perancangan Interface
http://localhost/akademik/paneladmin/index.php
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Ruang Administrator - Nilai Akademik</title>
<link rel="stylesheet" href="css_login/style.default.css" type="text/css" />
<link rel="stylesheet" href="css/style.shinyblue.css" type="text/css" />
<script type="text/javascript" src="js_login/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js_login/jquery-migrate-1.1.1.min.js"></script>
<script type="text/javascript" src="js_login/jquery-ui-1.9.2.min.js"></script>
<script type="text/javascript" src="js_login/modernizr.min.js"></script>
<script type="text/javascript" src="js_login/bootstrap.min.js"></script>
<script type="text/javascript" src="js_login/jquery.cookie.js"></script>
<script type="text/javascript" src="js_login/custom.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#login').submit(function(){
var u = jQuery('#username').val();
var p = jQuery('#password').val();
if(u == '' && p == '') {
jQuery('.login-alert').fadeIn();
return false;
}
});
});
</script>
</head>
<body class="loginpage" style="background:url(img/bg.png)">
<div class="loginpanel">
<div class="loginpanelinner">
<div class="logo animate0 bounceIn"><img src="img/logo.png" alt="" /></div>
<form id="login" action="cek_login.php" method="post">
<div class="inputwrapper login-alert">
<div class="alert alert-error">Username Dan Password Masih Kosong</div>
</div>
<div class="inputwrapper animate1 bounceIn">
<input type="text" name="username" id="username" placeholder="Username" />
</div>
<div class="inputwrapper animate2 bounceIn">
<input type="password" name="password" id="password" placeholder="Password" />
</div>
<div class="inputwrapper animate3 bounceIn">
<button name="submit">LOGIN</button>
</div>
</form>
</div><!--loginpanelinner-->
</div><!--loginpanel-->
<div class="loginfooter">
<p>2018. Aulia Ulfah. </p>
</div>
</body>
</html>
http://localhost/akademik/paneladmin/cek_login.php
<?php
include "../config/koneksi.php";
function antiinjection($data){
$filter_sql = mysql_real_escape_string(stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES))));
return $filter_sql;
}
$username = antiinjection($_POST['username']);
$passuser = antiinjection(md5($_POST['password']));
$login=mysql_query("SELECT * FROM admins WHERE username='$username' AND passuser='$passuser' AND blokir='N'");
$ketemu=mysql_num_rows($login);
$r=mysql_fetch_array($login);
// Apabila username dan password ditemukan
if ($ketemu > 0){
session_start();
$_SESSION[namauser] = $r[username];
$_SESSION[namalengkap] = $r[nama_lengkap];
$_SESSION[passuser] = $r[password];
$_SESSION[leveluser] = $r[level];
header('location:media.php?p=home');
}
else{
echo "<script>alert('Username Atau Password Anda Salah'); window.location = 'index.php'</script>";
}
?>
http://localhost/akademik/paneladmin/home.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php include "../config/koneksi.php"; ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div class="content">
<div class="breadLine">
<ul class="breadcrumb">
<li><a href="#">Simple Admin</a> <span class="divider">></span></li>
<li class="active">Dashboard</li>
</ul>
</div>
<div class="workplace">
<div class="row-fluid">
<div class="span12">
<div class='widgetButtons'>
<?php
$jmladmin=mysql_num_rows(mysql_query("select * from admins"));
?>
<div class='bb'>
<a href='#' class='tipb' title='Total Admin'><span class='ibw-user'></span></a>
<div class='caption red'><?php echo "$jmladmin"; ?></div>
</div>
<?php
$jmlfakultas=mysql_num_rows(mysql_query("select * from fakultas"));
?>
<div class='bb gray'>
<a href='#' class='tipb' title='Total Fakultas'><span class='ibw-mail'></span></a>
<div class='caption'><?php echo "$jmlfakultas"; ?></div>
</div>
<?php
$jmlprodi=mysql_num_rows(mysql_query("select * from prodi"));
?>
<div class='bb yellow'>
<a href='#' class='tipb' title='Total Program Studi'><span class='ibw-archive'></span></a>
<div class='caption green'><?php echo "$jmlprodi"; ?></div>
</div>
<?php
$jmlmk=mysql_num_rows(mysql_query("select * from mk"));
?>
<div class='bb red'>
<a href='#' class='tipb' title='Total Matakuliah'><span class='ibw-chats'></span></a>
<div class='caption blue'><?php echo "$jmlmk"; ?></div>
</div>
<?php
$jmlmahasiswa=mysql_num_rows(mysql_query("select * from mahasiswa"));
?>
<div class='bb green'>
<a href='#' class='tipb' title='Total Mahasiswa'><span class='ibw-users'></span></a>
<div class='caption yellow'><?php echo "$jmlmahasiswa"; ?></div>
</div>
<?php
$jmlnilai=mysql_result(mysql_query("SELECT * FROM nilai"), 0);
?>
<div class='bb blue'>
<a href='#' class='tipb' title='Total Nilai'><span class='ibw-calc'></span></a>
<div class='caption gray'><?php echo "$jmlnilai"; ?></div>
</div>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span4">
<div class="wBlock red clearfix">
<div class="dSpace">
<?php
$sorder=mysql_query("select * from mk");
$torder=mysql_num_rows($sorder);
?>
<h3>Matakuliah</h3>
<span class="mChartBar" sparkType="bar" sparkBarColor="white"><!--130,190,260,230,290,400,340,360,390--></span>
<span class="number"><?php echo"$torder"; ?></span>
</div>
<div class="rSpace">
<span><?php echo"$torder"; ?> <b>Total Matakuliah</b></span>
</div>
</div>
</div>
<div class="span4">
<?php
$aktif=mysql_query("select * from mahasiswa where status_mahasiswa='Aktif'");
$taktif=mysql_num_rows($aktif);
$cuti=mysql_query("select * from mahasiswa where status_mahasiswa='Cuti'");
$tcuti=mysql_num_rows($cuti);
$nonaktif=mysql_query("select * from mahasiswa where status_mahasiswa='Nonaktif'");
$tnonaktif=mysql_num_rows($nonaktif);
$tcus=mysql_query("select * from mahasiswa ");
$tjcus=mysql_num_rows($tcus);
?>
<div class="wBlock green clearfix">
<div class="dSpace">
<h3>Mahasiswa</h3>
<span class="mChartBar" sparkType="bar" sparkBarColor="white"></span>
<span class="number"><?php echo" $tjcus"; ?> </span>
</div>
<div class="rSpace">
<span><?php echo"$tjcus"; ?> <b>Total Mahasiswa</b></span>
<span><?php echo"$taktif"; ?> <b> Mahasiswa Aktif</b></span>
<span><?php echo"$tcuti"; ?> <b> Mahasiswa Cuti</b></span>
<span><?php echo"$tnonaktif"; ?> <b>Mahasiswa Nonaktif</b></span>
</div>
</div>
</div>
<div class="span4">
<?php
// Statistik user
// Statistik user
$qstatistik=mysql_num_rows(mysql_query("select * from modul where nama_modul='Statistik User' and publish='Y'"));
// Apabila modul Statistik diaktifkan Publish=Y, maka tampilkan modul Statistik
//if ($qstatistik > 0){
// echo "<hr color=#e0cb91 noshade=noshade /><br />
// <img src='$f[folder]/images/statistik.jpg' /><br />";
$ip = $_SERVER['REMOTE_ADDR']; // Mendapatkan IP komputer user
$tanggal = date("Ymd"); // Mendapatkan tanggal sekarang
$waktu = time(); //
// Mencek berdasarkan IPnya, apakah user sudah pernah mengakses hari ini
$s = mysql_query("SELECT * FROM statistik WHERE ip='$ip' AND tanggal='$tanggal'");
// Kalau belum ada, simpan data user tersebut ke database
if(mysql_num_rows($s) == 0){
mysql_query("INSERT INTO statistik(ip, tanggal, hits, online) VALUES('$ip','$tanggal','1','$waktu')");
}
else{
mysql_query("UPDATE statistik SET hits=hits+1, online='$waktu' WHERE ip='$ip' AND tanggal='$tanggal'");
}
$pengunjung = mysql_num_rows(mysql_query("SELECT * FROM statistik WHERE tanggal='$tanggal' GROUP BY ip"));
$totalpengunjung = mysql_result(mysql_query("SELECT COUNT(hits) FROM statistik"), 0);
$hits = mysql_fetch_assoc(mysql_query("SELECT SUM(hits) as hitstoday FROM statistik WHERE tanggal='$tanggal' GROUP BY tanggal"));
$totalhits = mysql_result(mysql_query("SELECT SUM(hits) FROM statistik"), 0);
$tothitsgbr = mysql_result(mysql_query("SELECT SUM(hits) FROM statistik"), 0);
$bataswaktu = time() - 300;
$pengunjungonline = mysql_num_rows(mysql_query("SELECT * FROM statistik WHERE online > '$bataswaktu'"));
$path = "counter/";
$ext = ".png";
$tothitsgbr = sprintf("%06d", $tothitsgbr);
for ( $i = 0; $i <= 9; $i++ ){
$tothitsgbr = str_replace($i, "<img src='$path$i$ext' alt='$i'>", $tothitsgbr);
}
?>
<div class="wBlock blue clearfix">
<div class="dSpace">
<h3>Total Penilaian</h3>
<span class="mChartBar" sparkType="bar" sparkBarColor="white"><!--240,234,150,290,310,240,210,400,320,198,250,222,111,240,221,340,250,190--></span>
<span class="number"><?php echo"$totalhits ";?></span>
</div>
<div class="rSpace">
<span><?php echo"$pengunjung ";?><b>Pengunjung Hari ini</b></span>
<span><?php echo"$totalpengunjung";?> <b> TotalPengunjung</b></span>
<span><?php echo"$pengunjungonline";?> <b>Pengunjung Online</b></span>
</div>
</div>
</div>
</div>
<div class="dr"><span></span></div>
<div class="row-fluid">
<div class="span4">
<div class="head clearfix">
<div class="isw-archive"></div>
<h1>Tabs</h1>
<ul class="buttons">
<li class="toggle"><a href="#"></a></li>
</ul>
</div>
<div class="block-fluid accordion">
<h3>Fakultas</h3>
<div>
<table cellpadding="0" cellspacing="0" width="100%" class="sOrders">
<thead>
<tr>
<th width="100">Kode Fakultas</th><th>Nama Fakultas</th>
</tr>
</thead>
<tbody>
<?php
$tampilfakultas=mysql_query("select * from fakultas order by kode_fakultas ASC limit 3");
while($fakultas=mysql_fetch_array($tampilfakultas))
{
echo"<tr>
<td><span class='date'>$fakultas[kode_fakultas]</span>
<td><a href='#'>$fakultas[nama_fakultas]</a></td>
</tr>";
}
?>
</tbody>
<tfoot>
<tr>
<td colspan="3" align="right"><a href="?p=fakultas"><button class="btn btn-small">More...</button></td></a>
</tr>
</tfoot>
</table>
</div>
<h3>Order</h3>
<div>
<table cellpadding="0" cellspacing="0" width="100%" class="sOrders">
<thead>
<tr>
<th width="60">Tanggal</th><th>Nama Kustomer</th><th width="60">Total</th>
</tr>
</thead>
<tbody>
<?php
$tampilorder=mysql_query("select * from orders order by id_orders ASC limit 3");
while($order=mysql_fetch_array($tampilorder))
{
echo "<tr>
<td><span class='date'>$order[tgl_order]</span><span class='time'>$order[jam_order]</span></td>";
$tampilkustomer=mysql_query("select * from kustomer order by id_kustomer='$order[id_kustomer]' ASC limit 3");
$kustomer=mysql_fetch_array($tampilkustomer);
echo"<td><a href='#'>$kustomer[nama_lengkap]</a></td>";
echo"<td><span class='price'>$order[status_order]</span></td>";
echo"</tr>";
}
?>
<tfoot>
<tr>
<td colspan="3" align="right"><button class="btn btn-small">More...</button></td>
</tr>
</tfoot>
</table>
</div>
<h3>Data Kota</h3>
<div>
<table cellpadding="0" cellspacing="0" width="100%" class="sOrders">
<thead>
<tr>
<th width="60">Paket</th><th>Nama Kota</th><th width="60">Ongkir</th>
</tr>
</thead>
<tbody>
<?php
$tampilkota=mysql_query("select * from kota limit 3");
while($kota=mysql_fetch_array($tampilkota))
{
$tampilshop=mysql_query("select * from shop_pengiriman where id_perusahaan='$kota[id_perusahaan]'");
$shop=mysql_fetch_array($tampilshop);
echo"<tr>
<td><span class='date'>$shop[nama_perusahaan]</span></td>
<td><a href='#'>$kota[nama_kota]</a></td>
<td><span class='price'>$kota[ongkos_kirim]</span></td>
</tr>";
}
?>
</tbody>
<tfoot>
<tr>
<td colspan="3" align="right"><button class="btn btn-small">More...</button></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div class="span4">
<div class="head clearfix">
<div class="isw-edit"></div>
<h1>Sekilas Info</h1>
<ul class="buttons">
<li class="toggle"><a href="#"></a></li>
</ul>
</div>
<div class="block news scrollBox">
<div class="scroll" style="height: 270px;">
<?php
$tampilsekilas=mysql_query("select * from sekilasinfo");
while($sekilas=mysql_fetch_array($tampilsekilas))
{
echo"<div class='item'>
<a href='#'></a>
<p>$sekilas[info]</p>
<span class='date'>$sekilas[tgl_posting]</span>
<div class='controls'>
<a href='#' class='icon-pencil tip' title='Edit'></a>
<a href='#' class='icon-trash tip' title='Remove'></a>
</div>
</div>";
}
?>
</div>
</div>
</div>
<div class="span4">
<div class="head clearfix">
<div class="isw-cloud"></div>
<h1>Kustomer</h1>
<ul class="buttons">
<li class="toggle"><a href="#"></a></li>
</ul>
</div>
<div class="block users scrollBox">
<div class="scroll" style="height: 270px;">
<?php
$tampilcus=mysql_query("select * from kustomer");
while($customer=mysql_fetch_array($tampilcus))
{
echo"<div class='item clearfix'>
<div class='image'><a href='#'><img src='img/users/aqvatarius_s.jpg' width='32'/></a></div>
<div class='info'>
<a href='#' class='name'>$customer[nama_lengkap]</a>
<div class='controls'>";
if ($customer[aktif]=="Y")
{
echo"<a href='#' class='icon-ok'></a>";
}
else
{
echo"<a href='#' class='icon-remove'></a>";
}
echo"</div>
</div>
</div>";
}
?>
</div>
</div>
</div>
</div>
<div class="dr"><span></span></div>
<div class="row-fluid">
<div class="span6">
<div class="head clearfix">
<div class="isw-chats"></div>
<h1>Komentar</h1>
<ul class="buttons">
<li class="toggle"><a href="#"></a></li>
</ul>
</div>
<div class="block messaging">
<?php
$tampilpesan=mysql_query("select * from komentar");
while ($pesan=mysql_fetch_array($tampilpesan))
{
$tgl=tgl_indo($pesan[tgl]);
echo"<div class='itemIn'>
<a href='#' class='image'><img src='img/users/olga.jpg' class='img-polaroid'/></a>
<div class='text'>
<div class='info clearfix'>
<span class='name'>$pesan[nama_komentar]</span>
<span class='date'>$tgl--$pesan[jam_komentar]</span>
</div>
$pesan[isi_komentar]
</div>
</div>";
}
?>
</div>
</div>
<div class="span6">
<div class="head clearfix">
<div class="isw-calendar"></div>
<h1>Calendar</h1>
</div>
<div class="block-fluid">
<div id="calendar" class="fc"></div>
</div>
</div>
</div>
<div class="dr"><span></span></div>
</div>
</div>
</body>
</html>
No comments:
Post a Comment