function hitungpoin($nis, $idpel, $opsi) { // ambil poin dari pelanggaran $q = mysql_query("select t.poin as poin from pelanggaran p join tata_tertib t on t.id=p.idtata where p.id='{$idpel}'"); $d = mysql_fetch_array($q); $poin = $d['poin']; // tambah/kurangkan poin ke tabel poin berdasarkan nis if ($opsi == "tambah") { mysql_query("update poin set poin=poin+'{$poin}', ubah=now() where nis='{$nis}'"); } elseif ($opsi == "kurang") { mysql_query("update poin set poin=poin-'{$poin}', ubah=now() where nis='{$nis}'"); } else { eksyen('Salah Fungsi!', 'index.php'); } }
// nomor surat $nomorsurat = "{$kodeunit}/{$nomorurut}/" . date('Y'); // input ke table LETTER mysql_query("insert into letter(GUID,NOMOR,IR_ID,JENIS,DTMCRT,USRCRT) values(uuid(),'{$nomorsurat}','" . $rijek[$y] . "','REJECTED',now(),'" . $_SESSION['firstname'] . "')"); // untuk email $_SESSION['namanya'] = data_user_detail($iduserdetail[$y], "FIRSTNAME") . " " . data_user_detail($iduserdetail[$y], "LASTNAME"); $_SESSION['emailnya'] = data_user_detail($iduserdetail[$y], "EMAIL"); include 'email/rejection.php'; } } } // konfirmasi kalau quota sudah habis if ($dcq[$qw] == '0') { eksyen('Sorry! Your weekly quota is up', "?p=intern_pending"); } eksyen('Saved!', 'home.php#internship'); } ?> <form action="" method="post"> <table class="table table-condensed" id="tbl"> <thead> <tr> <th class="col-md-1 text-center">No</th> <th class="col-md-2 text-center">Nama</th> <th class="col-md-2 text-center">Program</th> <th class="text-center">Topik/Referensi</th> <th class="col-md-2 text-center">Detail</th> <th class="col-md-1 text-center">Accept</th> <th class="col-md-1 text-center">Reject</th> </tr> </thead>
<label class="col-sm-2 control-label">Sequence</label> <div class="col-sm-2"> <input type="text" class="form-control" name="seq" placeholder="Sequence" maxlength="2" value="<?php echo $d['SEQUENCE']; ?> " required> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-success">Save</button> <button type="reset" class="btn btn-warning">Reset</button> </div> </div> </form> <?php break; case 'delete': $guid = mysql_real_escape_string($_GET['guid']); if ($guid == "") { eksyen('', '?p=aspect'); } else { mysql_query("delete from assessment_aspect where GUID='{$guid}'"); eksyen('', '?p=aspect'); } break; default: # code... break; } }
<div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-success">Save & Activate</button> <button type="reset" class="btn btn-warning">Reset</button> </div> </div> </form> <?php break; case 'delete': $guid = mysql_real_escape_string($_GET['guid']); if ($guid == "") { eksyen('', '?p=user'); } else { $iduserdetail = data_user_detail_user($guid, 'GUID'); // hapus member_of_group mysql_query("delete from member_of_group where USER_DETAIL_ID='{$iduserdetail}'"); // hapus user_education mysql_query("delete from user_education where USER_DETAIL_ID='{$iduserdetail}'"); // hapus user_detail mysql_query("delete from user_detail where GUID='{$iduserdetail}'"); // hapus user mysql_query("delete from user where GUID='{$guid}'"); eksyen('', '?p=user'); } break; default: # code... break; } }
<?php session_start(); include "db_connection.php"; $n = $_POST['jum']; $bulan = $_POST['bulan']; $tahun = $_POST['tahun']; echo "<h1>Processing data...</h1>"; for ($i = 1; $i <= $n; $i++) { $uid = $_POST['userid' . $i]; $w1 = $_POST['w1' . $i]; $w2 = $_POST['w2' . $i]; $w3 = $_POST['w3' . $i]; $w4 = $_POST['w4' . $i]; $w5 = $_POST['w5' . $i]; $q = mysql_query("update quota set WEEK1='{$w1}', WEEK2='{$w2}', WEEK3='{$w3}', WEEK4='{$w4}', WEEK5='{$w5}' where USER_DETAIL_ID='{$uid}' and MONTH='{$bulan}' and YEAR='{$tahun}'"); if ($q) { echo "Data {$i} succeeded<br>"; } else { echo "Data {$i} failed<br>"; } } eksyen('', 'home.php?p=quota');
echo "Processing..."; $nama = mysql_real_escape_string($_POST['nama']); $username = mysql_real_escape_string($_POST['username']); $level = mysql_real_escape_string($_POST['level']); // password if ($_POST['password'] != "") { // kalau tidak kosong, maka dijalankan $password = md5(mysql_real_escape_string($_POST['password'])); $q = $db->update('users', array('password' => $password), 'username="******"'); } // users $q = $db->update('users', array('nama' => $nama, 'level' => $level, 'ubah' => wkt()), 'username="******"'); if ($q) { eksyen('Data berhasil diubah', '?hal=profil'); } else { eksyen('Data gagal diubah', '?hal=profil'); } } ?> <div class="col-lg-12"> <h1 class="page-header">Ubah Profil</h1> </div> <form action="" method="POST" class="form-horizontal" role="form" enctype="multipart/form-data"> <div class="form-group"> <label for="inputNama" class="col-sm-2 control-label">Nama Guru :</label> <div class="col-sm-10"> <input type="text" name="nama" id="inputNama" class="form-control" value="<?php echo $d[0]['nama']; ?> " required="required" maxlength="50">
<?php } ?> </tbody> </table> <div class="alert alert-info" role="alert">Klik pada nama siswa atau NIS untuk melihat daftar peringatan.</div> <?php } else { if (isset($_POST['idtindak'])) { $idtindak = $db->escapeString($_POST['idtindak']); $status = $db->escapeString($_POST['status']); $db->update('tindak', array('tindak' => $status, 'ubah' => wkt(), 'idguru' => $_SESSION['userid']), "id='{$idtindak}'"); echo "Processing..."; eksyen('Data berhasil diubah', '?hal=penindakan'); } $id = mysql_real_escape_string($_GET['detail']); $db->select('tindak', '*', null, "id='{$id}'"); $res = $db->getResult(); foreach ($res as $d) { ?> <div class="col-lg-12"> <h1 class="page-header">Detail Tindakan <small>| <a href="?hal=penindakan">Kembali</a></small></h1> </div> <form action="" method="post"> <fieldset <?php if ($d['tindak'] == 1) { echo "disabled"; }
if ($_FILES['pengantar']['name'] != "") { $tmp_name = $_FILES['pengantar']['tmp_name']; //nama local temp file di server $file_size = $_FILES['pengantar']['size']; //ukuran file (dalam bytes) $file_type2 = $_FILES['pengantar']['type']; $tipe = array("application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/pdf", "image/jpeg", "image/png", "image/gif"); if (!in_array($file_type2, $tipe)) { eksyen('Improper File Type for CV. Use DOC/DOCX/PDF/Image only.', 'home.php#mastersetting'); } $fp = fopen($tmp_name, 'r'); // open file (read-only, binary) $pengantar = fread($fp, $file_size) or die("Tidak dapat membaca source file"); // read file $pengantar = mysql_real_escape_string($pengantar) or die("Tidak dapat membaca source file"); // parse image ke string fclose($fp); // tutup file mysql_query("update internship_registration set COVER_LETTER='{$pengantar}' where GUID='{$guid}'"); } //--------------------------cv----------------------------------// $iduserdetail = $_SESSION['iddetail']; // UPDATE into user // $q = mysql_query("update internship_registration set MASTER_TOPIC_ID='{$topik}', PROGRAM_ID='{$program}', INTERNSHIP_PROJECT_ID='{$projek}', START_DATE='{$mulai}', END_DATE='{$selesai}', DTMUPD=now(), USRUPD='{$usrcrt}' where GUID='{$guid}'"); // OK if ($q) { eksyen('Pendaftaran Internship berhasil! Tunggu konfirmasinya via email Anda', 'home.php'); } else { eksyen('Pendaftaran Internship gagal! Hubungi Administrator', 'index.php'); } }
</div> </div> <?php break; case 'save': if (isset($_POST['judul'])) { $judul = mysql_real_escape_string($_POST['judul']); $pesan = mysql_real_escape_string($_POST['pesan']); $idpesan = mysql_real_escape_string($_POST['idpesan']); $iduser = mysql_real_escape_string($_POST['iduser']); $idunit = mysql_real_escape_string($_POST['idunit']); $idinternt = mysql_real_escape_string($_POST['idinternt']); $idsender = mysql_real_escape_string($_POST['idsender']); if ($iduser != $idsender) { $status = "Replied"; } else { $status = "Waiting reply"; } $q = mysql_query("insert into message(GUID,UNIT_ID,INTERN_ID,TITLE,SENDER_ID,MESSAGE_ID,MESSAGE,DTMCRT,STATUS) values(uuid(),'{$idunit}','{$idinternt}','{$judul}','{$iduser}','{$idpesan}','{$pesan}',now(),'{$status}')"); if ($q) { eksyen('', 'inside.php#comment'); } else { eksyen('Error!', 'inside.php#comment'); } } break; default: # code... break; } }
<?php if (isset($_POST['username'])) { $username = $db->escapeString($_POST['username']); $nama = $db->escapeString($_POST['nama']); $jurusan = $db->escapeString($_POST['jurusan']); $db->select('users', '*', NULL, "username='******' and nama='{$nama}' and jurusan='{$jurusan}'", null); $data = $db->getResult(); if ($data) { $str = 'abcdef1234567890'; $shuffled = str_shuffle($str); $md5pass = md5($shuffled); $db->update('users', array('password' => $md5pass), "username='******' and nama='{$nama}' and jurusan='{$jurusan}'"); echo 'Selamat, Anda berhasil mengubah password Anda. Password baru Anda adalah ' . $shuffled; } else { eksyen('Maaf, data tidak ditemukan', 'index.php'); } } ?> <form action="" method="POST" class="form-horizontal" role="form"> <div class="form-group"> <label for="inputUsername" class="col-sm-2 control-label">Username:</label> <div class="col-sm-10"> <input type="text" name="username" id="inputUsername" class="form-control" value="" required="required"> </div> </div> <div class="form-group"> <label for="inputNama" class="col-sm-2 control-label">Nama:</label> <div class="col-sm-10">
/> <label for="wil2">Wilayah II</label></p> </div> </div> <button type="submit" class="btn waves-effect waves-light">Simpan</button> </form> </div> <?php break; case 'hapus': if (!isset($_GET['i']) or $_GET['i'] == '') { eksyen('', '?hal=daerah'); } $id = $_GET['i']; // cek anggota kelurahan $qkel = $db->query("select id from kelurahan where idkecamatan='{$id}'"); $dkel = $qkel->fetch_array(); $idkel = $dkel['id']; // hapus desa berdasarkan id kelurahan $db->query("delete from desa where idkelurahan='{$idkel}'"); // hapus kelurahan berdasarkan id kecamatan $db->query("delete from kelurahan where idkecamatan='{$id}'"); // hapus kecamatannya $db->query("delete from kecamatan where id='{$id}'"); eksyen('', '?hal=daerah'); break; default: # code... break; } }
<div class="row"> <form class="col s12" action="" method="post"> <div class="row"> <div class="input-field col s12"> <input id="teks" name="teks" type="text" class="validate" value="<?php if ($a == 'ubah') { echo $d['nama']; } ?> " required> <label for="teks">Nama Desa</label> </div> </div> <button type="submit" class="btn waves-effect waves-light">Simpan</button> </form> </div> <?php break; case 'hapus': if (!isset($_GET['i']) or $_GET['i'] == '') { eksyen('', '?hal=desa'); } $id = $_GET['i']; $db->query("delete from desa where id='{$id}'"); eksyen('Data berhasil dihapus', '?hal=desa&kel=' . $kel . '&kec=' . $_SESSION['kec']); break; default: # code... break; } }
<label class="col-sm-2 control-label">Program Name</label> <div class="col-sm-4"> <input type="text" class="form-control" name="code" placeholder="Program Name" maxlength="100" value="<?php echo $d['PROGRAM']; ?> " autofocus> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-success">Save</button> <button type="reset" class="btn btn-warning">Reset</button> </div> </div> </form> <?php break; case 'delete': $guid = mysql_real_escape_string($_GET['guid']); if ($guid == "") { eksyen('', '?p=internprogram'); } else { mysql_query("delete from internship_program where guid='{$guid}'"); eksyen('', '?p=internprogram'); } break; default: # code... break; } }
} if (isset($_POST['rijek'])) { $rijek = $_POST['rijek']; for ($y = 0; $y < count($rijek); $y++) { mysql_query("update internship_registration set DTMUPD=now(), USRUPD='" . $_SESSION['username'] . "', STATUS='REJECTED', UNIT_ID='{$unitid}' where GUID='" . $rijek[$y] . "'"); } } /* foreach ($_POST['intern'] as $intern) { mysql_query("update internship_registration set STATUS='APPROVED', UNIT_ID='$unitid' where GUID='$intern'"); } foreach ($_POST['iduserdetail'] as $iduserdetail) { mysql_query("update user_detail set UNIT_ID='$unitid' where GUID='$iduserdetail'"); } */ eksyen('Saved!', 'inside.php#internship'); } ?> <form action="" method="post"> <table class="table table-condensed" id="tbl"> <thead> <tr> <th class="col-md-1 text-center">No</th> <th class="col-md-2 text-center">Nama</th> <th class="col-md-2 text-center">Program</th> <th class="text-center">Topik/Referensi</th> <th class="col-md-2 text-center">Periode</th> <th class="col-md-1 text-center">Accept</th> <th class="col-md-1 text-center">Reject</th> </tr> </thead>
<label class="col-sm-1 control-label">End</label> <div class="col-sm-2"> <input type="text" class="form-control" name="end" placeholder="Year" maxlength="4" onkeypress="return isNumber(event)" value="<?php echo $dx['END']; ?> " required> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-success">Save</button> <button type="reset" class="btn btn-warning">Reset</button> </div> </div> </form> <?php break; case 'delete': $guid = mysql_real_escape_string($_GET['guid']); if ($guid == "") { eksyen('', '?p=unit'); } else { mysql_query("delete from unit where guid='{$guid}'"); eksyen('', '?p=unit'); } break; default: # code... break; } }
</div> <div class="col-sm-2"> <input type="text" class="form-control input-sm" name="me" placeholder="" maxlength="4" onkeypress="return isNumber(event)" value="<?php echo $d['MOU_END']; ?> "> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-success">Save</button> <button type="reset" class="btn btn-warning">Reset</button> </div> </div> </form> <?php break; case 'delete': $guid = mysql_real_escape_string($_GET['guid']); if ($guid == "") { eksyen('', '?p=institute'); } else { mysql_query("delete from institute where guid='{$guid}'"); eksyen('', '?p=institute'); } break; default: # code... break; } }
</div> <!-- /.sidebar-collapse --> </div> <!-- /.navbar-static-side --> </nav> <!-- Page Content --> <div id="page-wrapper"> <div class="container-fluid"> <div class="row"> <?php if (isset($_GET['p'])) { if (file_exists($_GET['p'] . '.php')) { include $_GET['p'] . '.php'; } else { eksyen('Halaman tidak ditemukan', 'index.php'); } } else { ?> <h1>Admin Panel</h1> <?php } ?> </div> <!-- /.row --> </div> <!-- /.container-fluid --> </div> <!-- /#page-wrapper --> </div>
<br><h1>Percakapan</h1> <?php $id = $_GET['i']; $unit = $_GET['u']; if (isset($_POST['internid'])) { $internid = mysql_real_escape_string($_POST['internid']); $pesan = mysql_real_escape_string($_POST['pesan']); $userid = mysql_real_escape_string($_POST['internid']); $uid = $_SESSION['iddetail']; $q = mysql_query("insert into message(GUID,UNIT_ID,INTERN_ID,SENDER_ID,MESSAGE,DTMCRT) values(uuid(),'{$unit}','{$id}','{$uid}','{$pesan}',now())"); eksyen('', 'inside.php'); } ?> <form class="form-horizontal" action="" method="post"> <input type="hidden" name="internid" id="inputInternid" class="form-control" value="<?php echo $id; ?> "> <div class="form-group"> <label for="inputPesan" class="col-sm-2 control-label">Pesan</label> <div class="col-sm-5"> <textarea name="pesan" id="inputPesan" class="form-control" rows="3" required="required"></textarea> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-primary">Submit</button> </div> </div> </form> <h3>Histori Percakapan</h3>
<?php session_start(); include "db_connection.php"; if (isset($_SESSION['username'])) { header("location:home.php"); } // cek if (isset($_SESSION['bikinsekolah'])) { eksyen('Please complete your college detail', 'add-college.php'); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset=utf-8> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>IMAS - Internship Management Application System</title> <!-- Bootstrap CSS and bootstrap datepicker CSS used for styling the demo pages--> <link rel="stylesheet" href="css/datepicker.css"> <link rel="stylesheet" href="css/bootstrap.css"> <!-- Load css styles --> <link rel="stylesheet" type="text/css" href="css/bootstrap-responsive.css" /> <link rel="stylesheet" type="text/css" href="css/style - Copy.css" /> <link rel="stylesheet" type="text/css" href="css/imas.css" /> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="css/imas-ie7.css" /> <![endif]-->
<?php $iduser = $_SESSION['iduser']; tabel(); $_a = mysql_query("select * from user_detail where USER_ID='{$iduser}'"); $_b = mysql_fetch_array($_a); if ($_b['LASTNAME'] == '') { eksyen('Fill in the blanks', '?p=profil_user'); } ?> <!-- Start home section --> <div id="home"> <!-- Start cSlider --> <div id="da-slider" class="da-slider"> <div class="triangle"></div> <!-- mask elemet use for masking background image --> <div class="mask"></div> <!-- All slides centred in container element --> <div class="container"> <!-- Start first slide --> <div class="da-slide"> <div class="span5 contact-form centered"> <h3>Welcome, <?php print $_SESSION['firstname']; ?> </h3> <?php $sesuser = $_SESSION['iddetail']; echo "<img width='200' height='150' src='tampil.php?u={$sesuser}'>"; ?> <table width="280" border="0" cellspacing="0" cellpadding="0">
<?php session_start(); include "db_connection.php"; $username = mysql_real_escape_string($_POST['username']); $passwords = mysql_real_escape_string($_POST['password']); $password = md5($passwords); // cek login $q = mysql_query("select guid as iduser, username, password, verified from user where username='******' and password='******'"); $c = mysql_num_rows($q); if ($c == 1) { // ambil sesinya $d = mysql_fetch_array($q); // cek verified if ($d['verified'] == '0') { eksyen('Sorry, you are not authorized', 'index.php'); } $_SESSION['iduser'] = $d['iduser']; $_SESSION['username'] = $d['username']; $_username = $d['username']; // ambil data user_detail $qud = mysql_query("select firstname,guid as iddetail from user_detail where user_id='{$d['iduser']}'"); $dud = mysql_fetch_array($qud); $_SESSION['firstname'] = $dud['firstname']; $_SESSION['iddetail'] = $dud['iddetail']; // ambil grup user $qg = mysql_query("select mg.group_name\n\t\t\t\t\t\t\tfrom ms_group as mg\n\t\t\t\t\t\t\tjoin member_of_group as mog\n\t\t\t\t\t\t\tjoin user_detail as ud\n\t\t\t\t\t\t\ton mg.guid = mog.ms_group_id\n\t\t\t\t\t\t\tand ud.guid = mog.user_detail_id\n\t\t\t\t\t\t\twhere ud.user_id = '{$_SESSION['iduser']}'"); $dqg = mysql_fetch_array($qg); $_SESSION['grup'] = $dqg['group_name']; // update status login & last login mysql_query("update user set ISLOGIN='******', LASTLOGIN=now() where username='******'");
<div class="col-sm-2"> <input type="text" class="form-control" name="seq" placeholder="Sequence" maxlength="2" value="<?php echo $d['SEQUENCE']; ?> " required> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-success">Save</button> <button type="reset" class="btn btn-warning">Reset</button> </div> </div> </form> <?php break; case 'delete': $guid = mysql_real_escape_string($_GET['guid']); if ($guid == "") { eksyen('', '?p=assesment'); } else { mysql_query("delete from assessment_aspect where ASSESSMENT_ELEMENT_ID='{$guid}'"); mysql_query("delete from assessment_element where GUID='{$guid}'"); eksyen('', '?p=assesment'); } break; default: # code... break; } }
<input id="urutan" name="urutan" type="text" class="validate" maxlength="3" length="3" value="<?php if ($a == 'ubah') { echo $d['urutan']; } ?> " required <?php echo isnumber(); ?> > <label for="urutan">Urutan</label> </div> </div> </div> <button type="submit" class="btn waves-effect waves-light">Simpan</button> </form> </div> <?php break; case 'hapus': if (!isset($_GET['i']) or $_GET['i'] == '') { eksyen('', '?hal=link'); } $id = $_GET['i']; $db->query("delete from tautan where id='{$id}'"); eksyen('Data berhasil dihapus', '?hal=link'); break; default: # code... break; } }
<?php $q = mysql_query("select * from settings where S_TYPE='letter_pic'"); $d = mysql_fetch_array($q); $j = mysql_num_rows($q); if ($j == 0) { mysql_query("insert into settings(S_TYPE,S_NAME,S_VALUE) values('letter_pic','','')"); eksyen('', '?p=letter'); } if (isset($_POST['nama'])) { $tipe = mysql_real_escape_string($_POST['tipe']); $nama = mysql_real_escape_string($_POST['nama']); $rank = mysql_real_escape_string($_POST['rank']); mysql_query("update settings set S_NAME='{$nama}', S_VALUE='{$rank}' where S_TYPE='{$tipe}'"); eksyen('', '?p=letter'); } ?> <h1>Letter <small>Configuration</small></h1> <form class="form-horizontal" action="" method="post"> <input type="hidden" name="tipe" value="letter_pic"> <div class="form-group"> <label class="col-sm-2 control-label">PIC Name</label> <div class="col-sm-4"> <input type="text" class="form-control input-sm" name="nama" placeholder="PIC Name" maxlength="35" value="<?php echo $d['S_NAME']; ?> "> </div> </div> <div class="form-group">
$user = $_SESSION['username']; $array = $_POST['topik']; $sql = "insert into selected_topic (GUID,UNIT_ID,MASTER_TOPIC_ID,DTMCRT,USRCRT) values "; $it = new ArrayIterator($array); $cit = new CachingIterator($it); foreach ($cit as $value) { $sql .= "(uuid(),'{$unit}','" . $cit->current() . "',now(),'{$user}')"; if ($cit->hasNext()) { $sql .= ","; } } $a = mysql_query($sql); if ($a) { eksyen('Sukses', '?p=topics'); } else { eksyen('Gagal', 'inside.php#mastersetting'); } } ?> <form action="" method="post"> <div class="row"> <div class="col-md-12"> <?php $q = mysql_query("select GUID,TOPIC_NAME from master_topic order by TOPIC_NAME asc"); while ($d = mysql_fetch_array($q)) { $idtopik = $d['GUID']; $query = mysql_query("select MASTER_TOPIC_ID from selected_topic where MASTER_TOPIC_ID='{$idtopik}' and UNIT_ID='{$unit}'"); $data = mysql_fetch_array($query); ?> <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3"> <input type="checkbox" name="topik[]" value="<?php
// parse image ke string fclose($fp); // tutup file mysql_query("update user_detail set CV='{$cv}', MIME_CV='{$file_type}' where USER_ID='{$iduser}'"); //--------------------------cv----------------------------------// } // password if ($_POST['pw'] != "") { $pw = mysql_real_escape_string($_POST['pw']); mysql_query("update user set PASSWORD=md5('{$pw}') where GUID='{$iduser}'"); } $q = mysql_query("update user_detail set FIRSTNAME='{$namadepan}', LASTNAME='{$namabelakang}', ID_CARD='{$noid}', NIM_NIS='{$nims}', EMAIL='{$email}', PLACE_OF_BIRTH='{$tempatlahir}', DATE_OF_BIRTH='{$tanggallahir}', GENDER='{$jk}', USER_ADDRESS='{$alamat}', HOBBY='{$hobi}', PHONE1='{$tel1}', PHONE2='{$tel2}', DTMUPD=now(), USRUPD='{$userr}' where USER_ID='{$iduser}'"); if ($q) { eksyen('Registration saved!', '?p=profil_user'); } else { eksyen('Error!', '?p=profil_user'); } } ?> <h1>Edit Profile</h1> <script type="text/javascript" src="js/isNumber.js"></script> <form class="form-horizontal" action="" method="post" id="myform" enctype="multipart/form-data"> <div class="form-group" style="background:#333"> <label class="col-sm-2 control-label">Nomor Identitas</label> <div class="col-sm-4"> <input type="text" name="noid" id="inputNoid" class="form-control" value="<?php echo $d['ID_CARD']; ?> " required="required" maxlength="25"> </div> <label class="col-sm-2 control-label">NIM/NIS</label>
$biaya = $db->escapeString($_POST['total' . $i]); $sql .= "('" . id() . "','{$idprogram}','{$tahap}','{$biaya}')"; if ($i < $total) { $sql .= ","; } } $db->sql($sql); eksyen('', '?p=biaya&program=' . $idprogram . '&x=' . base64_encode($total)); } else { // update for ($i = 1; $i <= $total; $i++) { $tahap = $db->escapeString($_POST['tahap' . $i]); $biaya = $db->escapeString($_POST['total' . $i]); $db->update('tahap', array('biaya' => $biaya), "idprogram='{$idprogram}' and tahap='{$tahap}'"); } eksyen('', '?p=biaya&program=' . $idprogram . '&x=' . base64_encode($total)); } } $db->select('program', '*', NULL, "id='{$id}'", null); $d = $db->getResult(); foreach ($d as $d) { ?> <div class="col-lg-12"> <h1 class="page-header">Biaya Program Reguler</h1> </div> <form action="" method="POST" class="form-horizontal" role="form"> <input type="hidden" name="idprogram" id="inputIdprogram" class="form-control" value="<?php echo $id; ?> "> <div class="form-group">
<label class="col-sm-2 control-label">Sequence</label> <div class="col-sm-2"> <input type="text" class="form-control" name="seq" placeholder="Sequence" maxlength="2" value="<?php echo $d['SEQUENCE']; ?> " required> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-success">Save</button> <button type="reset" class="btn btn-warning">Reset</button> </div> </div> </form> <?php break; case 'delete': $guid = mysql_real_escape_string($_GET['guid']); if ($guid == "") { eksyen('', '?p=education-level'); } else { mysql_query("delete from education_level where guid='{$guid}'"); eksyen('', '?p=education-level'); } break; default: # code... break; } }
<label class="col-sm-2 control-label">Major Name</label> <div class="col-sm-4"> <input type="text" class="form-control" name="code" placeholder="Major Name" maxlength="5" value="<?php echo $d['MAJOR_NAME']; ?> "> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-success">Save</button> <button type="reset" class="btn btn-warning">Reset</button> </div> </div> </form> <?php break; case 'delete': $guid = mysql_real_escape_string($_GET['guid']); if ($guid == "") { eksyen('', '?p=major'); } else { mysql_query("delete from major where guid='{$guid}'"); eksyen('', '?p=major'); } break; default: # code... break; } }
include 'db_connection.php'; // hapus tabel-tabel mysql_query("truncate assessment"); mysql_query("truncate guestbook"); mysql_query("truncate institute"); mysql_query("truncate internship_registration"); mysql_query("truncate member_of_group"); mysql_query("truncate message"); mysql_query("truncate message_notif"); mysql_query("truncate quota"); mysql_query("truncate quota_per_unit"); mysql_query("truncate selected_topic"); mysql_query("truncate testimonial"); mysql_query("truncate unit_leader"); mysql_query("truncate user"); mysql_query("truncate user_detail"); mysql_query("truncate user_education"); // uuid user $a = mysql_query("select uuid() as iduser"); $aa = mysql_fetch_array($a); $iduser = $aa['iduser']; mysql_query("insert into user values('{$iduser}','aa',md5('aa'),'','1',now(),now(),now(),'admin')"); // uuid user_detail $ab = mysql_query("select uuid() as iduser"); $aab = mysql_fetch_array($ab); $iddetail = $aab['iduser']; mysql_query("insert into user_detail(GUID,USER_ID,FIRSTNAME,DTMCRT,USRCRT) values('{$iddetail}','{$iduser}','Admin',now(),'Admin')"); // member of group mysql_query("insert into member_of_group values(uuid(),'3c806e53-3dcf-11e5-901c-00ff7f4e65c4','{$iddetail}',now(),'Admin',now(),'Admin')"); eksyen('Selesai', 'index.php');