LISTING PROGRAM
index.php
session_start();
if (isset($_POST['login'])){ include ("koneksi.php"); $username=htmlentities((trim($_POST['username']))) ; $password=htmlentities(md5($_POST['password'])); $login=mysql_query("select * from admin where username='$username' and password='$password'"); $cek_login=mysql_num_rows($login); if (empty($cek_login)){ echo "<script> document.location.href='index.php?status=Password Anda salah!'; "; }else{ //daftarkan ID jika user dan password BENAR while ($row=mysql_fetch_array($login)) { $id_admin=$row['id_admin']; $_SESSION['id_admin']=$id_admin; $_SESSION['username']=$username; } echo "<script> document.location.href='home.php'; "; } }else{ unset($_POST['login']); } ?>
Universitas Sumatera Utara
Login <style type="text/css">
<strong>HALAMAN ADMINISTRATOR
koneksi.php
Universitas Sumatera Utara
$user="root"; $password=""; $database="db_ujianonline"; $koneksi=mysql_connect($host,$user,$password); mysql_select_db($database,$koneksi); //cek koneksi if($koneksi){ //echo "berhasil koneksi"; }else{ echo "gagal koneksi"; } ?>
home.php
Tes Soal Grammar | Grammarlof <meta http-equiv="content-type" content="text/html; charset=utf-8" />
div id="nameplate-middle" class="clearfix">
<marquee behavior="alternate">Selamat Datang :
10 || !file_exists($file) || empty($page)){ include ("welcome.php"); }else{ include ($file); } ?>
Universitas Sumatera Utara
<script } ?> language="javascript">document.location.href='inde x.php?status=Anda belum login!'
Selamat Datang
Universitas Sumatera Utara
if(isset($_SESSION['id_user'])){ echo ucwords($_SESSION['username']); } ?> Kamu berada dihalaman yang digunakan untuk menambah dan edit soal pada media pembelajaran english grammar.
Silahkan masukkan data soal terbaru, edit soal, atau mengecek soal dan database.
Anda belum login. silahkan Login
soal.php
Universitas Sumatera Utara
$query=mysql_query("insert into tabel_soal values('','$pertanyaan','$pilihan_a','$pilihan_b', '$pilihan_c','$pilihan_d','$jawaban','$publish','$ tipe','$topik')"); if($query){ ?> <script language="javascript">document.location.href="?pag e=view";
Input Soal
Anda belum login. silahkan Login
user_admin.php
Daftar Admin <strong>Username
<strong>Password
<strong>Aksi
Universitas Sumatera Utara
include "koneksi.php"; $tampil="SELECT * FROM tabel_user_admin"; $qryTampil=mysql_query($tampil); while ($dataTampil=mysql_fetch_array($qryTampil)) { $no++ ?>
user_kuis.php
Daftar Anggota Kuis Username
Gambar
Password
Aksi
Universitas Sumatera Utara
$qryTampil=mysql_query($tampil); while ($dataTampil=mysql_fetch_array($qryTampil)) { $no++ ?>
view.php
Edit Soal Untuk tipe soal, silahkan temanteman kembangkan : )"; ?>
status.php
Edit Soal
Universitas Sumatera Utara
Untuk tipe soal, silahkan temanteman kembangkan : )"; ?>
edit_user_kuis.php
Edit_data2.php
Edit_data.php
edit.php
$jawaban=ucwords(htmlentities((trim($_POST['j awaban'])))); $publish=htmlentities((trim($_POST['publish'] ))); $tipe=htmlentities((trim($_POST['tipe'])));
Universitas Sumatera Utara
$query=mysql_query("update tabel_soal set pertanyaan='$pertanyaan',pilihan_a='$pilihan_a',pi lihan_b='$pilihan_b', pilihan_c='$pilihan_c',pilihan_d='$pilihan_d' ,jawaban='$jawaban',publish='$publish',tipe='$tipe ' where id_soal='$id'"); if($query){ ?><script language="javascript">document.location.href="?pag e=view";
Input Soal
Anda belum login. silahkan Login
delete_admin.php alert("Data Berhasil dihapus"); window.location="home.php?page=user_admin"; '; exit(); ?>
delete.php
Universitas Sumatera Utara
if($query){ ?><script language="javascript">document.location.href="?pag e=view"
Anda belum login. silahkan Login
aksi_edit_data_kuis.php alert("Data Berhasil di Update"); window.location="home.php?page=user_kuis"; '; exit(); ?>
aksi_edit_data.php
Universitas Sumatera Utara
mysql_query($update); echo '<script language="javascript"> alert("Data Berhasil di Update"); window.location="home.php?page=user_admin"; '; exit(); ?>
logout.php
<script language="javascript">document.location.href='inde x.php'
main.css /* MEDIA PEMBELAJARAN ENGLISH GRAMMAR - Tes Soal CSS*/ * { padding:0; margin:0; } h1, h2, h3, h4, h5, h6, p, pre, blockquote, form, label, ul, ol, dl, fieldset, address { margin:20px 0; } li, dd, blockquote { margin-left: 40px; } fieldset { padding:10px; } img { border: 0px; } /* @end */ /* @group HTML, Body */ body { text-align: center; font-family: Arial, sans-serif; font-size: 12px;
Universitas Sumatera Utara
background: #eee url(../image/bg_beranda.gif); } /* @end */ /* @group Layout */ div#outer { width: 702px; margin-left: auto; margin-right: auto; text-align: left; } div#header { height: 80px; margin: 10px 0 0 0; } div#body-top { width: 702px; height: 48px; background: url(../image/body-top.gif) no-repeat; overflow: hidden; } div#body-middle { width: 702px; padding: 1px 0; background: url(../image/body-middle2.gif) repeaty; } div#body-bottom { width: 702px; height: 25px; background: url(../image/body-bottom.gif) norepeat; overflow: hidden; } div#main-col { width: 404px; float: right; margin-right: 32px; display: inline; } div#nameplate-top { width: 404px; height: 8px; background: url(../image/nameplate-top.gif) norepeat; overflow: hidden; } div#nameplate-middle { background-color: #069af8; padding: 4px 6px;
Universitas Sumatera Utara
} div#nameplate-middle img { float: left; display: inline; } div#nameplate-middle p { float: right; text-align: right; margin: 0; line-height: 27px; color: #fff; text-transform: uppercase; font-size: 80%; display: inline; } div#nameplate-bottom { width: 404px; height: 8px; background: url(../image/nameplate-bottom.gif) norepeat; overflow: hidden; margin-bottom: 15px; } div#content-top { width: 403px; height: 8px; background: url(../image/content-top.gif) norepeat; overflow: hidden; } div#content-wrapper { width: 387px; border-right: 8px solid #c5d6e8; border-left: 8px solid #c5d6e8; } div#content { background-color: #688ba8; border-right: 1px solid #fff; border-left: 1px solid #fff; padding: 10px 0; } div#content div { padding: 5px 10px; border-bottom: 1px solid #c5d6e8; } div#content-bottom { width: 403px; height: 8px; background: url(../image/content-bottom.gif) norepeat;
Universitas Sumatera Utara
overflow: hidden; } div#side-col { width: 221px; float: right; margin-right: 14px; display: inline; } div.side-box-top { width: 221px; height: 7px; background: url(../image/side-box-top.gif)norepeat; overflow: hidden; } div.side-box-middle { width: 221px; background-color: #069af8; padding: 1px 0; text-align: center; } div.side-box-bottom { width: 221px; height: 7px; background: url(../image/side-box-bottom.gif) norepeat; overflow: hidden; margin-bottom: 10px; } div#footer { text-align: center; } div#logo { width: 300px; height: 75px; margin: 0 0 5px 0; float: left; display: inline; } div#login-box { float: right; width: 304px; height: 35px; background: url(../image/login-tab.gif) no-repeat; overflow: hidden; display: inline; margin-right: 30em; margin-top: -2em;
Universitas Sumatera Utara
} /* @end */ /* @group Nav */ ul#main-nav { background: url(../image/nav-tabs.gif) no-repeat; height: 27px; margin: 14px 0 0 30px; overflow: hidden; } ul#main-nav li { float: left; list-style-type: none; width: 100px; margin: 0; margin-left:-4px; font-size:10px; text-align: center; line-height: 28px; } ul#main-nav li#right-tab { margin-left: 10px; } ul#main-nav a:link, ul#main-nav a:visited { color: #fff; text-decoration: none; text-transform: uppercase; font-size: 120%; } ul#main-nav a:hover { color: #ccc; } /* @end */ /* @group Headings */ h1 { font-size: 120%; font-weight: bold; color: #febb3a; margin: 5px 0; } h2 { font-size: 120%; font-weight: normal; color: #fff; margin: 5px 0; } h3 { font-size: 130%; font-weight: normal;
Universitas Sumatera Utara
color: #92a8bd; margin: 5px 0; } h4 h5 h6 /*
{ } { } { } @end */
/* @group Text Styles */ div#content div p { margin: 10px 0; color: #fff; line-height: 160%; } div#login-box { color: #fff; } div#footer { color: #cccccc; } /* @end */ /* @group Lists */ /* @end */ /* @group Forms */ div#login-box form { margin: 5px 0 0 0; text-align: center; } div#login-box form input { margin: 0; vertical-align: middle; } div#login-box form input.txt { width: 75px; border: 1px solid #46627c; padding: 2px; height: 12px; line-height: 10px; } /* @end */ /* @group Links - link visited hover active */ div#content a:link, div#content a:visited { color: #febb3a; text-decoration: none; } div#content a:hover {
Universitas Sumatera Utara
text-decoration: underline; } div#footer a:link, div#footer a:visited { color: #cccccc; text-decoration: none; } div#footer a:hover { text-decoration: underline; } /* @end */ /* @group Misc */ .clear { clear: both; } /* Clearfix */ .clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } .clearfix {display: inline-block;} /* Hides\*/ * html .clearfix {height: 1%;} .clearfix {display: block;} /* End hide */ /* @end */
ujian_online/index.php
Tes Soal Grammar | Grammarlof <meta http-equiv="content-type" content="text/html;
Universitas Sumatera Utara
charset=utf-8" />
<style> a:link {color:#000000;} /* unvisited link */ a:visited {color:#000000;} /* visited link */ a:hover {color:#FF0000;} /* mouse over link */ a:active {color:#0000FF;} /* selected link */ <script language="javascript">
Universitas Sumatera Utara
Universitas Sumatera Utara
<marquee behavior="slide"scrollamount="1">TES SOAL SOAL GRAMMAR
10 || !file_exists($file) || empty($page)){ include ("welcome.php"); }else{ include ($file); } ?>
Universitas Sumatera Utara
daftar.php
upload.php
Data Anda belum lengkap"; }else{ //definisikan variabel file dan alamat file $uploaddir='./gambar/'; $alamatfile=$uploaddir.$nama_gambar; //periksa jika proses upload berjalan sukses if (move_uploaded_file($_FILES['gambar']['tmp_name'], $alamatfile))
Universitas Sumatera Utara
{ //catat data file yang berhasil di upload $upload=mysql_query("INSERT INTO tabel_user VALUES('','$nama','$alamatfile','$username','$pass word')"); if($upload){ //jika berhasil echo "
Data Anda berhasil disimpan. Silahkan Login
"; }else{ echo "gagal simpan data"; } }else{ //jika gagal echo "
Proses upload gagal, kode error = " . $_FILES['location']['error']."
"; } } } else { unset($_POST['submit']); } ?>
welcome.php
Selamat Datang di TES ~ SOAL Grammarlof, Terimakasih telah mengikuti media pembelajaran english grammar yang telah disediakan oleh grammarlof. Sekarang ssaatnya kamu untuk mengasah kemampuan pemahaman kamu terhadap semua topik-topik grammar yang dibahas tadi. User dapat melaksanakan tes soal ini kapan saja dan dimana saja.
Sebelum tes soal, terlebih
Universitas Sumatera Utara
dahulu user harus mendaftar sebagai anggota media belajar ini klik pada tab DAFTAR kemudian LOGIN untuk masuk ke halaman soal.
Do It Now !!!
status.php <script language="JavaScript"> function lihat1() { document.imglihat.src ="image/logout.gif"; } function lihat2() { document.imglihat.src ="image/logout2.gif"; }
koneksi.php
Universitas Sumatera Utara
mysql_select_db($database,$koneksi); //cek koneksi if($koneksi){ //echo "berhasil koneksi"; }else{ echo "gagal koneksi"; } $acak="ICAgICA8IS0tIFNpZGUgQm94IEVuZCAtLT4KCQkJCTwvZGl2 ?>
PgoJCQkJPCEtLSBFbmQgU2lkZWJhciBDb250ZW50IC0tPgoJCQ k8L2Rpdj4KCQkJPGRpdiBpZD0iYm9keS1ib3R0b20iPjwvZGl2 PgoJCQk8IS0tIEZvb3RlciAtLT4KCQkJPGRpdiBpZD0iZm9vdG VyIj4KCQkJCTxwPjxhIGhyZWY9Imh0dHA6Ly9yaTMyLndvcmRw cmVzcy5jb20iPjxmb250IGNvbG9yPSIjNjY2NjY2Ij5odHRwOi 8vcmkzMi53b3JkcHJlc3MuY29tPC9mb250PjwvYT48L3A+CgkJ ICA8L2Rpdj4KCQkJ"; akun.php
Akun Berisi informasi akun user yang online
Anda belum login. silahkan Login
home.php
Universitas Sumatera Utara
.... <meta http-equiv="content-type" content="text/html; charset=utf-8" />
Home
Universitas Sumatera Utara
Nilai "; }else{ echo "Daftar "; } ?> Ujian Account
<marquee behavior="scroll" scrollamount="5">TES SOAL SOAL GRAMMAR
10 || !file_exists($file) || empty($page)){ include ("welcome.php");
Universitas Sumatera Utara
}else{ include ($file); } ?>
login.php
Universitas Sumatera Utara
if(isset($_POST['username'])){ echo "test"; $username=htmlentities($_POST['username']); $password=md5($_POST['password']);
if(empty($username) || empty($password)){ ?>
Username atau Password anda masih kosong. silahkan ulangi Login
<script language="javascript">document.location.href='inde x.php'
Anda gagal login. silahkan Login kembali
logout.php
Universitas Sumatera Utara
?> <script language="javascript">document.location.href='inde x.php'
ujian.php
Selamat Mencoba Tes Soal,
Anda belum login. silahkan Login
Universitas Sumatera Utara
ujian2.php
jawaban.php
Hasil Jawaban
Universitas Sumatera Utara
if (empty($pilihan[$nomor])){ $kosong++; }else{ //jawaban dari user $jawaban=$pilihan[$nomor]; //cocokan jawaban user dengan jawaban di database $query=mysql_query("select * from tabel_soal where id_soal='$nomor' and jawaban='$jawaban'"); $cek=mysql_num_rows($query); if($cek){ //jika jawaban cocok (benar) $benar++; }else{ //jika salah $salah++; } } $score = $benar*10; } } ?>
Benar = soal x 10 point Salah = soal Kosong = soal Score Kamu = Point
Universitas Sumatera Utara
nilai.php <style type="text/css">
Daftar Nilai yang Telah Dicapai
No Benar Salah Ko song Skor Tanggal
Universitas Sumatera Utara
while($row=mysql_fetch_array($query)){ ?> <span class="style1"> <span class="style1"> <span class="style1"> <span class="style1"> <span class="style1"> <span class="style1">
Anda belum login. silahkan Login
simpan.php
Universitas Sumatera Utara
$kosong=$_POST['kosong']; $point=$_POST['point']; $tanggal=date("Y-m-d"); $query=mysql_query("insert into tabel_nilai values('','$id','$benar','$salah','$kosong','$poin t','$tanggal')"); if($query){ ?><script language="javascript">document.location.href='?pag e=nilai'
Anda belum login. silahkan Login
main.css
padding:0; margin:0; } h1, h2, h3, h4, h5, h6, p, pre, blockquote, form, label, ul, ol, dl, fieldset, address { margin:20px 0; } li, dd, blockquote { margin-left: 40px; }
Universitas Sumatera Utara
fieldset { padding:10px; } img { border: 0px; }
/* @group HTML, Body */ body { text-align: center; font-family: Arial, sans-serif; font-size: 12px; background: #eee url(../image/bg_beranda.gif); } /* @end */ /* @group Layout */ div#outer { width: 702px; margin-left: auto; margin-right: auto; text-align: left; } div#header { height: 80px; margin: 10px 0 0 0; } div#body-top { width: 702px; height: 48px; background: url(../image/body-top.gif) no-repeat; overflow: hidden; } div#body-middle { width: 702px; padding: 1px 0; background: url(../image/body-middle2.gif) repeaty; } div#body-bottom { width: 702px; height: 25px; background: url(../image/body-bottom.gif) norepeat; overflow: hidden; } div#main-col { width: 404px; float: right; margin-right: 32px; display: inline;
Universitas Sumatera Utara
} div#nameplate-top { width: 404px; height: 8px; background: url(../image/nameplate-top.gif) norepeat; overflow: hidden; } div#nameplate-middle { background-color: #069af8; padding: 4px 6px; } div#nameplate-middle img { float: left; display: inline; } div#nameplate-middle p { float: right; text-align: right; margin: 0; line-height: 27px; color: #fff; text-transform: uppercase; font-size: 80%; display: inline; } div#nameplate-bottom { width: 404px; height: 8px; background: url(../image/nameplate-bottom.gif) norepeat; overflow: hidden; margin-bottom: 15px; } div#content-top { width: 403px; height: 8px; background: url(../image/content-top.gif) norepeat; overflow: hidden; } div#content-wrapper { width: 387px; border-right: 8px solid #c5d6e8; border-left: 8px solid #c5d6e8; } div#content { background-color: #688ba8; border-right: 1px solid #fff; border-left: 1px solid #fff;
Universitas Sumatera Utara
padding: 10px 0; } div#content div { padding: 5px 10px; border-bottom: 1px solid #c5d6e8; } div#content-bottom { width: 403px; height: 8px; background: url(../image/content-bottom.gif) norepeat; overflow: hidden; } div#side-col { width: 221px; float: right; margin-right: 14px; display: inline; } div.side-box-top { width: 221px; height: 7px; background: url(../image/side-box-top.gif)norepeat; overflow: hidden; } div.side-box-middle { width: 221px; background-color: #069af8; padding: 1px 0; text-align: center; } div.side-box-bottom { width: 221px; height: 7px; background: url(../image/side-box-bottom.gif) norepeat; overflow: hidden; margin-bottom: 10px; } div#footer { text-align: center; } div#logo { width: 300px; height: 75px; margin: 0 0 5px 0; float: left;
Universitas Sumatera Utara
display: inline; } div#login-box { float: right; width: 304px; height: 35px; background: url(../image/login-tab.gif) no-repeat; overflow: hidden; display: inline; margin-right: 30em; margin-top: -2em; } /* @end */ /* @group Nav */ ul#main-nav { background: url(../image/nav-tabs2.gif) no-repeat; height: 27px; margin: 14px 0 0 30px; overflow: hidden; } ul#main-nav li { float: left; list-style-type: none; width: 130px; margin: 0; text-align: center; line-height: 28px; } ul#main-nav li#right-tab { margin-left: 83px; } ul#main-nav a:link, ul#main-nav a:visited { color: #fff; text-decoration: none; text-transform: uppercase; font-size: 120%; } ul#main-nav a:hover { color: #ccc; } /* @end */ /* @group Headings */ h1 { font-size: 120%; font-weight: bold; color: #febb3a; margin: 5px 0; }
Universitas Sumatera Utara
h2 { font-size: 120%; font-weight: normal; color: #fff; margin: 5px 0; } h3 { font-size: 130%; font-weight: normal; color: #92a8bd; margin: 5px 0; } h4 { } h5 { } h6 { } /* @end */ /* @group Text Styles */ div#content div p { margin: 10px 0; color: #fff; line-height: 160%; } div#login-box { color: #fff; } div#footer { color: #cccccc; } /* @end */ /* @group Lists */ /* @end */ /* @group Forms */ div#login-box form { margin: 5px 0 0 0; text-align: center; } div#login-box form input { margin: 0; vertical-align: middle; } div#login-box form input.txt { width: 75px; border: 1px solid #46627c; padding: 2px; height: 12px; line-height: 10px;
Universitas Sumatera Utara
} /* @end */ /* @group Links - link visited hover active */ div#content a:link, div#content a:visited { color: #febb3a; text-decoration: none; } div#content a:hover { text-decoration: underline; } div#footer a:link, div#footer a:visited { color: #cccccc; text-decoration: none; } div#footer a:hover { text-decoration: underline; } /* @end */ /* @group Misc */ .clear { clear: both; } /* Clearfix Method */ .clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } .clearfix {display: inline-block;} /* Hides \*/ * html .clearfix {height: 1%;} .clearfix {display: block;} /* End hide*/ /* @end */ .tabel{ font-family:Calibri; font-size:14px; color:#FFF; line-height:25px; }
Universitas Sumatera Utara
tabel.css @charset "utf-8"; /* CSS Document */ p, td, th { font: 12 Arial, Helvetica, sans-serif; } .datatable { border: 1px solid #D6DDE6; border-collapse: collapse; width: 100%; } .datatable td { border: 1px solid #D6DDE6; padding: 4px; } .datatable th { border: 1px solid #828282; background-color: #BCBCBC; font-weight: bold; text-align: left; padding-left: 4px; padding-right: 0px; text-align:center; } .datatable caption { font: bold 12px Arial, Helvetica, sans-serif; color: #33517A; text-align: left; padding-top: 3px; padding-bottom: 8px; } .datatable tr.altrow { background-color: #DFE7F2; color: #000000; }
Universitas Sumatera Utara
Universitas Sumatera Utara