Source Code
Halaman Index.php
<?php
session_start();
header('Cache-control: private');
include 'config.php'; $nim = $_POST['nim'];
$password = $_POST['password']; if(isset($_GET['login'])){
if(isset($nim) && isset($password)){
$sql = "SELECT b.username, b.id_data, a.nim, b.password FROM data_diri b, identitas a WHERE a.id_nim=b.id_nim and nim='$nim' and
password='$password'";
$query = mysql_query($sql);
$array = mysql_fetch_array($query);
if($nim == $array['nim'] && $password == $array['password']){
$_SESSION['access'] = true;
$_SESSION['id_data'] = $array['id_data']; $_SESSION['nim'] = $array['nim'];
$_SESSION['username'] = $array['username'];
header('location:home.php?username=' . $_SESSION['username']);
} else {
$_SESSION['access'] = FALSE; $_SESSION['nim'] = null;
header('Location: 401.php'); }
} else {
$_SESSION['access'] = FALSE; $_SESSION['nim'] = null;
exit(); }
else if(isset($_GET['logout'])){
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time() - 42000, '/'); }
$_SESSION = array(); session_unset(); session_destroy();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title>
<script type="text/javascript" src="js/jquery-1.4.3.min.js"></script> <script type="text/javascript">
$(document).ready(function(){
//prepend span tag
$(".jquery h1").prepend("<span></span>");
});
</script>
<script type="text/javascript" src="js/captcha.js"> </script>
<script type="text/javascript"> $(document).ready(function() {
{
var X=$(this).attr('id');
if(X=='signup') {
$("#login").removeClass('select'); $("#signup").addClass('select'); $("#loginbox").slideUp(); $("#signupbox").slideDown();
$("#panel").css({ height:800
}); } else {
$("#signup").removeClass('select'); $("#login").addClass('select');
$("#signupbox").slideUp(); $("#loginbox").slideDown(); $("#panel").css({ height:300})
} }); }); </script> </script>
<style type="text/css">
html {
background:url(images/blue_background_abstract-wide.jpg) no-repeat center center fixed;
}
#container {
width:500px; padding-top:90px; padding-left: 400px; }
#tabbox {
height:40px }
img#refresh{ float:left;
margin-top:30px; margin-left:4px; cursor:pointer; }
#panel {
height:300px; width: 500px; }
.tab {
background: #dedede;display: block;height: 40px; line-height: 40px;text-align: center;
width: 80px;float: right;font-weight: bold; -webkit-border-top-left-radius: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius: 4px 4px 0px 0px; }
a {
color: #000; margin: 0; padding: 0;
.signup
background-color:#FFF; }
.tab1 {background: #dedede;display: block;height: 40px; line-height: 40px;text-align: center;
width: 80px;float: right;font-weight: bold; -webkit-border-top-left-radius: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius: 4px 4px 0px 0px; }
.tab2 {background: #dedede;display: block;height: 40px; line-height: 40px;text-align: center;
}
#username {
border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none;
font-family: Verdana, Geneva, sans-serif; font-size: 14px;
font-style: normal; color:#FFF;
text-transform: none; font-weight: normal; position: relative; }
.texbox {
width: 300px;
border: medium double #000; }
.daftar {
background-color: #093;
font-family: Verdana, Geneva, sans-serif; color: #FFF;
cursor:pointer;
border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; width: 190px;
height: 39px; text-align: center; font-size: 16px; }
.Batal {
background-color: #09F;
color: #FFF;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; color: #006400;
}
.boxtex {
height: 20px;
0 5px 0 #999, 0 6px 1px #000, 0 0px 3px #000, 0 1px 3px #000, 0 3px 5px #000,
0 5px 10px #000, 0 5px 20px #000;} #apDiv4 {
position:absolute; width:200px; height:114px; z-index:1; left: 16px; top: 473px; }
</style> </head>
<body>
<h1><span></span>KOMUNITAS D3 TEKNIK INFORMATIKA USU<br /> </h1>
<div id="container">
<div id="apDiv4"><img src="images/usu.png" width="151" height="151" /></div> <div id="tabbox"> <a href="#" id="signup" class="tab signup">Signup</a> <a href="#" id="login" class="tab select">Login</a></div>
<div id="panel">
<div id="loginbox">
<form action=" <?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>?login" method="post">
<label for="username3"> <p>
<label id="username"> NIM </label> </p>
<p>
<input name="nim" type="text" class="texbox" id="nim" required="required"/> </p>
<p>
</label> </p> <p>
<input name="password" type="password" class="texbox" id="password" required="required"/>
</p>
<p> </p> <p>
<input type="submit" class="login" value="Log In"/> </p>
</form> </div>
<div id="signupbox">
<form method="post" action="register.php">
<table width="100%" cellpadding="10" cellspacing="10"> <tr>
<td><label id="username">NIM</label></td>
<td width="64%"><input name="nim" type="text" class="boxtex" id="nim" size="35"></td>
</tr> <tr>
<td><label id="username">Username</label></td>
<td width="64%"><input name="username2" type="text" class="boxtex" id="username2" size="40" /></td>
</tr>
<tr>
<td><label id="username">Nama Lengkap</label></td>
<td width="64%"><input name="nama_lengkap" type="text" class="boxtex" id="nama_lengkap" size="45"></td>
</tr>
<tr>
<td><label id="username">Password</label></td>
<td width="64%"><input name="password" type="password" class="boxtex" id="password" size="35"></td>
</tr>
<td><label id="username">Ulangi Password</label></td>
<td width="64%"><input name="cpassword" type="password" class="boxtex" id="cpassword" size="35" /></td>
</tr>
<tr>
<td><label id="username">Kategori</label></td>
<td width="64%"><select name="kategori" id="kategori" class="boxtex"> <option value="">Jenis Kategori</option>
<option value="A">Alumni</option> <option value="M">Mahasiswa</option>
</select></td> </tr>
<tr>
<td><label id="username">Email</label></td>
<td width="64%"><input name="email" type="text" class="boxtex" id="email" size="36"> </td>
</tr>
<tr>
<td><label id="username">HP/Telepon</label></td> <td width="64%">
<select name="kode" class="boxtex"> <option value="+62">+62 </option> </select>
<input type="text" name="telepon" id="telepon" class="boxtex">
</td> </tr>
<tr>
<td><label id="username">Birthday</label></td> <td width="64%"><?php
$months = array(1 => 'Januari', 'Februari' , 'Maret',
$days = range(1,31); $years = range(1930,2030);
echo '<select name="months" id="months" class="boxtex">'; foreach($months as $key => $value){
echo "<option value=\"$key\">$value</option>\n"; }
echo '</select>';
echo '<select name="days" id="days" class="boxtex">'; foreach($days as $value){
echo "<option value=\"$value\">$value</option>\n"; }
echo '</select>';
echo '<select name="years" id="years" class="boxtex">'; foreach($years as $value){
echo "<option value=\"$value\">$value</option>\n"; }
echo '</select>'; ?> </td>
</tr>
<tr>
<td><label id="username">Masukkan Text yang anda lihat</label> </td> <td width="64%">
<img src="captcha.php" alt="" id="captcha2" />
<input name="captcha" type="text" id="captcha" class="boxtex"> <img src="gambar/refresh.jpg" width="25" alt="" id="refresh" />
</td>
<td width="0%"></td>
</tr>
<tr>
<td colspan="2"><input name="setuju" type="checkbox" checked="checked" value="setuju" class="boxtex"><b>I agree to the above terms</b>
<tr>
<td colspan="2"><input name="submit" type="submit" class="daftar" value="Daftar Sekarang">
<input name="submit2" type="reset" class="Batal" value="Batal Daftar" /></td> </tr>
</table> </form> </div></div>
</body> </html>
Halaman Balas.php
<?php
include('config.php'); if($_POST)
{
$isi_balasan=$_POST['isi_balasan']; $id_pesan=$_POST['id_pesan']; $pengirim=$_POST['pengirim']; $dari=$_POST['dari'];
$waktu = date("H:i d M Y");
mysql_query("INSERT INTO balas_pesan VALUES
('','$id_pesan','$waktu','$isi_balasan','$pengirim','$dari', 'N')");
}
else { }
?>
<li class="box">
</li>
Halaman cari.php
<?php
include 'config.php';
if($_POST['search'] == ''){
echo "Anda Tidak Mengisi Kata Apapun"; } else {
$search = $_POST['search']; $id = $_GET['id'];
$sql = "SELECT a.*, b.nim from data_diri a, identitas b where a.id_nim=b.id_nim and a.nama_lengkap like '%$search%'";
$query = mysql_query($sql) or die(mysql_error()); $array = mysql_fetch_array($query);
?>
<style type="text/css"> a:hover img{
-webkit-transform:scale(1.5) translate(20px, 40px); -moz-transform:scale(1.5) translate(20px, 40px); -O-transform:scale(1.5) translate(20px, 40px);
}
ul.galery li{ float:left; margin:0 10px; padding:10px; list-style:none;
border:1px solid #ddd; }
</style>
echo "<center>Hasil Pencarian Untuk Kata <strong>$search</strong><Br><br></center>";
$sql2 = mysql_query("select b.*, a.nama_gambar from gambar a,data_diri b where a.id_data=b.id_data and a.status='foto_profile' and b.nama_lengkap like
'%$search%'") or die(mysql_error());
while($array2 = mysql_fetch_array($sql2)){
if(strlen($array2[nama_gambar])<=0) echo"<ul><li>
<a href='#'><img src=\"gambar/no_disp.jpg\" class='small_face' height='50px' width='50px'></a></li></ul><br>";
else echo"<ul class='galery'><li>
<a href='#'><img src=\"foto/$array2[nama_gambar]\" height='200px' width='200px'></a></li></ul>";
if($array['kategori'] == "M"){ $kategori = "Mahasiswa"; } else {
$kategori = "Alumni"; }
echo "NIM : " . $array['nim']. "<br><br>";
echo "Nama Lengkap : " . $array['nama_lengkap']. "<br><br>"; echo "Email : " . $array['email']. "<br><br>";
echo "<br><br><br><br><br><br><br><br><br><br>"; }
} ?>
Halaman loginexex.php
<?php
session_start();
include 'config.php'; $nim = $_POST['nim'];
$password = $_POST['password']; if(isset($nim) && isset($password)){
$sql = "SELECT b.username, b.id_data, a.nim, b.password FROM data_diri b, identitas a WHERE a.id_nim=b.id_nim and nim='$nim' and
password='$password'";
$query = mysql_query($sql);
$array = mysql_fetch_array($query);
if($nim == $array['nim'] && $password == $array['password']){
$_SESSION['access'] = true;
$_SESSION['id_data'] = $array['id_data']; $_SESSION['nim'] = $array['nim'];
$_SESSION['username'] = $array['username'];
header('location:home.php?id_data=' . $_SESSION['id_data']);
} else {
$_SESSION['access'] = FALSE; $_SESSION['nim'] = null;
echo "anda salah"; }
} else {
$_SESSION['access'] = FALSE; $_SESSION['nim'] = null;
echo "anda salah"; }
exit();
?>
Halaman load_messages.php
$(document).ready(function(){$("#stexpand<?php echo
$id_informasi;?>").oembed("<?php echo $array['isi']; ?>",{maxWidth: 400, maxHeight: 300});});
</script>
<style type="text/css"> .morebox
{
font-weight:bold; color:#333333; text-align:center;
border:solid 1px #333333; padding:8px;
margin-top:8px; margin-bottom:8px;
-moz-border-radius: 6px;-webkit-border-radius: 6px; }
.morebox a{ color:#333333; text-decoration:none} .morebox a:hover{ color:#333333; text-decoration:none} </style>
<?php
include_once 'includes/time_stamp.php'; include_once 'includes/session.php';
include 'config.php';
include_once 'includes/tolink.php'; if(isset($_GET['id'])){
$id=$_GET['id'];
echo '<div id="updates">';
$sql = mysql_query("select b.username, a.id_informasi, a.up, a.down, a.id_data, a.isi, a.time from informasi a, data_diri b where a.id_data=b.id_data and b.id_data='$id' order by a.id_informasi desc LIMIT 4") or die(mysql_error());
} else {
echo '<div id="updates">';
$sql = mysql_query("select b.username, a.id_informasi, a.up, a.down, a.id_data, a.isi, a.time from informasi a, data_diri b where a.id_data=b.id_data order by
}
while($array = mysql_fetch_array($sql)){ $id_informasi = $array['id_informasi']; $pecahisi= explode("-",$array['isi']); $isi=$pecahisi[1];
$gambar=$pecahisi[0]; $up=$array['up']; $down=$array['down'];
?>
<div class="stbody" id="stbody<?php echo $id_informasi;?>">
<div class="stimg"> <?php
$sql2 = mysql_query("select a.nama_gambar, b.username from gambar a,data_diri b where a.id_data=b.id_data and a.status='foto_profile' and
a.id_data='$array[id_data]'");
$array2 = mysql_fetch_array($sql2);
if(strlen($array2[nama_gambar])<=0) echo"<img src=\"gambar/no_disp.jpg\" class='small_face' height='50px' width='50px'><br>";
else echo"<img src=\"foto/$array2[nama_gambar]\" height='50px' width='50px'>";
?>
</div>
<div class="sttext">
<b><a href="home.php?page=profile&id=<?php echo $array['id_data'];?>"><?php echo $array['username'];?></a></b>
<div class="readmore"><?php
if(strlen($isi) != "" AND strlen($gambar) == "") { echo tolink($isi);
else if(strlen($isi) != "" AND strlen($gambar) != "") { echo tolink($isi) . "<br>";
echo "<img src=\"uploads/$gambar\" border=0 width=\"200\" height=\"200\">"; }
else if(strlen($gambar) != "" AND strlen($isi) == "") {
echo "<img src=\"uploads/$gambar\" border=0 width=\"200\" height=\"200\">"; }
?>
</div> <?php
if($id_data==$array['id_data']){ ?>
<span class="delete_button"><a href="#" id="<?php echo $id_informasi;?>" class="delete_update">Delete</a></span>
<?php } else { ?>
<a href="#" id="<?php echo $id_informasi;?>" class="delete_update"></a> <?php
}?>
<div class="sttime"><?php time_stamp($array['time']);?> | <a href='#'
class='commentopen' id='<?php echo $id_informasi;?>' title='Comment'>Comment </a>
<div class='up'>
<a href='' class='vote' id='<?php echo $id_informasi; ?>' name='up'><?php echo $up; ?></a> Suka </div>
<div class='down'><a href='' class='vote' id='<?php echo $id_informasi; ?>' name='down'><?php echo $down; ?></a> Tidak Suka</div>
<div id="stexpandbox">
<div id="stexpand<?php echo $id_informasi;?>"></div> </div>
<div class="commentcontainer" id="commentload<?php echo $id_informasi;?>">
<?php include('load_comments.php') ?>
</div>
<div class="commentupdate" style='display:none' id='commentbox<?php echo $id_informasi;?>'>
<div class="stcommentimg">
<?php
$sql4 = mysql_query("select a.nama_gambar, b.username from gambar a,data_diri b where a.id_data=b.id_data and a.status='foto_profile' and a.id_data='$id_data'");
$array4 = mysql_fetch_array($sql4);
if(strlen($array4[nama_gambar])<=0) echo"<img src=\"gambar/no_disp.jpg\" class='small_face' height='50px' width='50px'><br>";
else echo"<img src=\"foto/$array4[nama_gambar]\" height='50px' width='50px'>";
?> </div>
<div class="stcommenttext" > <form method="post" action="">
<input type="hidden" name="id_data" id="id_data" value="<?php echo $id_data;?>" />
<textarea name="comment" class="comment" maxlength="200" id="ctextarea<?php echo $id_informasi;?>"></textarea>
<br />
<input type="submit" value=" Comment " id="<?php echo $id_informasi;?>" class="comment_button"/>
</div> </div>
</div>
</div>
<?php
} ?>
</div> <?php
if($_GET['id']){ }else{
?>
<div id="more<?php echo $id_informasi ; ?>" class="morebox<?php echo $id ; ?>">
<a href="#" class="more<?php echo $id ; ?>" id="<?php echo $id_informasi ; ?>">more</a>
</div> <?php } ?>
Halaman load_comments.php
<?php
include 'config.php';
$sql2 = mysql_query("select a.kom_id, a.id_informasi,a.id_data, a.isi_komentar, b.username, a.date from komentar a, data_diri b where a.id_data=b.id_data and a.id_informasi = '$id_informasi' order by a.kom_id asc") or die(mysql_error());
while($array2 = mysql_fetch_array($sql2)){ $kom_id = $array2['kom_id'];
?>
<div class="stcommentbody" id="stcommentbody<?php echo $kom_id; ?>"> <div class="stcommentimg">
<?php
$sql3 = mysql_query("select a.nama_gambar, b.username from gambar a,data_diri b where a.id_data=b.id_data and a.status='foto_profile' and
a.id_data='$array2[id_data]'");
$array3 = mysql_fetch_array($sql3);
if(strlen($array3[nama_gambar])<=0)
echo"<img src=\"gambar/no_disp.jpg\" class='small_face' height='50px' width='50px'><br>";
else echo"<img src=\"foto/$array3[nama_gambar]\" height='50px' width='40px'>";
?> </div>
<div class="stcommenttext">
<b><?php echo $array2['username']; ?></b> <?php echo tolink($array2['isi_komentar']); ?>
<div class="stcommenttime"><?php time_stamp($array2['date']); ?></div> </div>
</div> <?php } ?>
<?php
if($_POST['submit']){ include 'config.php'; include 'functions.php';
$post = (!empty($_POST)) ? true : false;
if($post){ $error = '';
if(strlen($_POST['username2']) < 4 || strlen($_POST['username2']) > 32){ $error .= 'Username harus diantara 3 dan 32 karakter.<br />';
}
if($_POST['cpassword'] != $_POST['password']){
$error .= 'Password di bawah harus sama dengan password di atas.<br />'; }
if(!chekLen('kategori')){
$error .= 'Anda Tidak Memilih Pekerjaan Anda.<br />'; }
$sql_check = mysql_query("SELECT a.nim, b.username FROM data_diri b, identitas a WHERE a.id_nim=b.id_nim and a.nim='" . $_POST['nim'] . "'");
if(mysql_num_rows($sql_check)) {
$error .= $_POST['nim'] . "udah ada yang punya.<br>"; }
$nim = "SELECT id_nim, nim from identitas WHERE nim=" . $_POST['nim']; $nim_query = mysql_query($nim);
$cocok = mysql_fetch_array($nim_query);
if($_POST['nim'] == $cocok['nim']){ $id_nim = $cocok['id_nim']; } else {
}
if(empty($error)){
$username = $_POST['username2']; $password = $_POST['password'];
$nama_lengkap = $_POST['nama_lengkap']; $kategori = $_POST['kategori'];
$no_telepon = $_POST['kode'] . "-" . $_POST['telepon'];
$birthday = $_POST['months'] . "-" . $_POST['days'] . "-" . $_POST['years'];
$email = $_POST['email'];
$insert = "INSERT INTO data_diri VALUES ('', '$id_nim', '$username', '$password', '$nama_lengkap', '$kategori', '$email', '$no_telepon', '$birthday' )";
$query_insert = mysql_query($insert);
$update = "update identitas set active='Y' where nim='" . $_POST['nim'] . "'"; $query_update = mysql_query($update);
if($query_insert){
echo "Anda Terdaftar Sebagai Mahasiswa/Alumni D3 Ilmu Komputer";
$tampilid = mysql_query("select id_data from data_diri order by id_data DESC limit 1");
$arrayid = mysql_fetch_array($tampilid); $id_data = $arrayid['id_data'];
$insertfoto = "INSERT INTO gambar VALUES ('', '$id_data', 'no_disp.jpg', 'foto_profile')";
$queryfoto = mysql_query($insertfoto);
}
else {
echo '<div class="notification_error">'.$error.'</div>'; }
}
} ?>
Halaman homeadmin.php
<?php session_start(); include '../config.php';
include '../includes/tolink.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" /> <title>IN ADMIN PANEL | Powered by INDEZINER</title>
<link rel="stylesheet" type="text/css" href="style.css" /> <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="ddaccordion.js"></script> <script type="text/javascript">
ddaccordion.init({
contentclass: "submenu", //Shared CSS class name of contents group revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: true, //persist state of opened contents within browser session? toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["suffix", "<img src='images/plus.gif' class='statusicon' />", "<img src='images/minus.gif' class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing },
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
//do nothing }
})
</script>
<script src="jquery.jclock-1.2.0.js.txt" type="text/javascript"></script> <script type="text/javascript" src="jconfirmaction.jquery.js"></script> <script type="text/javascript">
</script>
<script type="text/javascript"> $(function($) {
$('.jclock').jclock(); });
</script>
<script language="javascript" type="text/javascript" src="niceforms.js"></script> <link rel="stylesheet" type="text/css" media="all" href="niceforms-default.css" />
</head> <body>
<div id="main_container">
<div class="header">
<div class="right_header">Welcome <?php echo
$_SESSION['username'];?>,<a href="logout.php" class="logout">Logout</a></div> <div class="jclock"></div>
</div>
<div class="main_content">
<div class="menu"> <ul>
<li><a class="current" href="index.html">Admin Home</a></li> <li><a href="login.html">Manage Users<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]--> <ul>
<li><a href="homeadmin.php?page=nim" title="">Input NIM</a></li> <li><a href="homeadmin.php?page=mahasiswa"
title="">Alumni/Mahasiswa</a></li>
<!--[if lte IE 6]><table><tr><td><![endif]--> </ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--> </li>
<li><a href="#">Manage Informasi</a> <ul>
<li><a href="homeadmin.php?page=informasi" title="">Informasi</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--> </li>
<li><a href="">Manage Admin<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]-->
<ul>
<li><a href="homeadmin.php?page=inputadmin" title="">Input Admin</a></li>
<li><a href="homeadmin.php?page=dataadmin" title="">Data Admin</a></li>
</ul> </div>
<div class="center_content">
<div class="left_content">
<div class="sidebar_box"> <div class="sidebar_box_top"></div> <div class="sidebar_box_content"> <h3>Alumni/Mahasiswa</h3>
<img src="images/info.png" alt="" title="" class="sidebar_icon_right" /> <?php
$aktif = mysql_query("select count(*) AS aktif from identitas where active = 'Y'"); $jum_aktif = mysql_fetch_array($aktif);
$inaktif = mysql_query("select count(*) AS inaktif from identitas where active = 'N'");
$jum_inaktif = mysql_fetch_array($inaktif);
?>
<p>
<?php echo "NIM Yang Sudah Aktif : " . $jum_aktif['aktif'] . "<br>";
</p> </div>
<div class="sidebar_box_bottom"></div> </div>
<div class="sidebar_box">
<div class="sidebar_box_top"></div> <div class="sidebar_box_content"> <h4>Posting Terbaru</h4>
<img src="images/notice.png" alt="" title="" class="sidebar_icon_right" /> <p>
<?php
$informasi = mysql_query("SELECT a.id_data, a.username, b.time, b.isi,
b.id_informasi FROM data_diri a, informasi b where a.id_data=b.id_data ORDER BY b.id_informasi DESC LIMIT 5") or die(mysql_error());
while($row=mysql_fetch_array($informasi)){
$isi_berita = nl2br($row['isi']); // membuat paragraf pada isi $isi = substr($isi_berita,0,50); // ambil sebanyak 900 karakter
echo $isi . ".... Oleh <strong>" . $row['username'] . "</strong><br><br>"; }
?> </p> </div>
<div class="sidebar_box_bottom"></div> </div>
<div class="sidebar_box">
<div class="sidebar_box_top"></div> <div class="sidebar_box_content"> <h5>Posting Paling Dibahas</h5>
<img src="images/photo.png" alt="" title="" class="sidebar_icon_right" /> <p>
<?php
$dibahas = mysql_query(" select a.id_informasi, count(a.id_informasi) as jum_komen, b.isi from komentar a, informasi b where a.id_informasi=b.id_informasi GROUP BY a.id_informasi DESC LIMIT 5");
$isi_berita2 = nl2br($dibahas_row['isi']); // membuat paragraf pada isi $isi2 = substr($isi_berita,0,50); // ambil sebanyak 900 karakter
echo $isi2 . "... ($jum_komen Komentar) " . $dibahas_row['username'] . "<br>";
}
?> </p> </div>
<div class="sidebar_box_bottom"></div> </div>
</div>
<div class="right_content">
<?php
if(isset($_GET['page'])){
$page=htmlentities($_GET['page']); }else{
$page="artikel"; }
$file="$page.php"; $cek=strlen($page);
if($cek>30 || !file_exists($file) || empty($page)){ include ("index2.php");
}else{
include ($file); }
?>
</div><!-- end of right content-->
<div class="clear"></div>
</div> <!--end of main content-->
<div class="footer">
<div class="left_footer">IN ADMIN PANEL | Powered by <a href="http://indeziner.com">INDEZINER</a></div>
<div class="right_footer"><a href="http://indeziner.com"><img src="images/indeziner_logo.gif" alt="" title="" border="0" /></a></div>
</div>