233
level: { required: true,
} },
messages: { nama: {
required: Anda harus mengisi data nama, rangelength: Nama minimal 5 karakter
}, password: {
required: Anda harus mengisi password, minlength : password minimal 5 karakter
}, level: {
required: Anda harus memilih user level, }
} };
}; script
d. File daftar tes
?php echo pesan ? div class=page-header
h1Tes small - Daftar Tessmall a href=?page=kelolatesto=buat class=btn btn-
success pull-rightBuat Tesa h1
div --Menampilkan list tes dalam tabel--
table class=table table-hover tr
th style=width:20pxbNo.btd th
style=width:250pxbcenterNama Tescenterbtd
th style=width:100pxbcenterKode
Paket Soalcenterbtd
th style=width:70pxbcenterGrup
Pesertacenterbtd th
style=width:100pxbcenterDurasi Tes
menitcenterbtd th
style=width:100pxbcenterStatuscenterbtd th
style=width:100pxbcenterDaftar Soalcenterbtd
th style=width:30pxbcenterPembahasancenterb
td th
style=width:20pxbTindakanbtd tr
?php no = 1;
while row = mysql_fetch_arrayresult { ?
tr td?php echo no ?td
tdcenter?php
echo row[judul]
?centertd tdcenter?php
echo row[kd_paket_soal] ?centertd
tdcenter?php echo
row[nama_grup] ?centertd tdcenter?php
echo row[durasi] ?centertd
thcenter?php ifrow[tes_status]==1 {echotes aktif;} else {echotidak
aktif;}?centertd td
center a
href=?page=soalsoaltampil=paketdatasearch=?php echo row[kd_paket_soal]?judul=?php
echo row[judul]?dari=tes class=btn btn-infoLihat Soala
center td
thcenter?php ifrow[tes_bahas]==1
{echoya;} else
{echotidak;}?centertd td
?php echo
nbsp;nbsp;a style=vertical-align:text-bottom; class=icon- wrench
href=?page=kelolatesto=ubahkd={row[kd_judul_tes]} rel=tooltip title=ubaha;
echo nbsp;;
echo a
style=vertical-align:text-bottom; class=icon-trash
href=_ rel=tooltip
title=hapus onclick=hapusjs\{row[kd_judul_tes]}\a;
? td
tr ?php
no++; }
bila data tidak ada maka if no == 1 {
echo
trtd-tdtd-tdtd-tdtd- tdtd-tdtr;
} ?
table div class=modal hide fade
div class=modal-header button
type=button class=close
data- dismiss=modal aria-hidden=truetimes;button
div div class=modal-body
h4Apakah anda yakin ingin menghapus data tersebut?h4
div div class=modal-footer
form method=POST input name=kd_judul_tes type=hidden
a data-dismiss=modal class=btnTidaka button name=btnhapus type=submit class=btn
btn-dangerYabutton form
div div
script type=textjavascript function hapusjskd_judul_tes{
input[name=kd_judul_tes].attrvalue,kd_judul_tes;
234
.modal.modalshow; }
script ?php
pesan = ; if isset_POST[btnhapus] {
query
= DELETE
FROM un_daftar_tes
where kd_judul_tes={_POST[kd_judul_tes]};
result = mysql_queryquery; if result {
pesan = div class=alert alert-success button
type=button class=close
data- dismiss=alerttimes;button
strongBerhasilstrong Data
berhasil dihapusdiv;
} else { pesan = div class=alert alert-danger
button type=button
class=close data-
dismiss=alerttimes;button strongGagalstrong
Penghapusan data
gagal dilakukandiv;
} }
query = SELECT FROM un_daftar_tes join un_grup_peserta usingkd_grup;
result = mysql_queryquery; ?
e. File kelola daftar tes