コード例 #1
0
ファイル: penindakan.php プロジェクト: teknomatika/monitor
" class="btn btn-primary btn-xs">Tindak</a></td>
		</tr>
		<?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) {
コード例 #2
0
ファイル: profil.php プロジェクト: teknomatika/monitor
    $db->select('users', '*', NULL, "username='******'", null);
    // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions
    $d = $db->getResult();
    if (isset($_POST['nama'])) {
        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">
コード例 #3
0
ファイル: siswa.php プロジェクト: AaEzha/Munawati
                echo "Processing...";
                $nama = mysql_real_escape_string($_POST['nama']);
                $jk = mysql_real_escape_string($_POST['jk']);
                $tempat = mysql_real_escape_string($_POST['tempat']);
                $tanggal = mysql_real_escape_string($_POST['tanggal']);
                $jurusan = mysql_real_escape_string($_POST['jurusan']);
                $kelas = mysql_real_escape_string($_POST['kelas']);
                // cari NIM
                $nis = getnis($jurusan);
                // end of cari NIM
                if (isset($_POST['id'])) {
                    $id = mysql_real_escape_string($_POST['id']);
                    $db->update('siswa', array('nama' => $nama, 'jk' => $jk, 'tempat' => $tempat, 'tanggal' => $tanggal, 'jurusan' => $jurusan, 'kelas' => $kelas, 'ubah' => wkt()), 'id="' . $id . '"');
                    eksyen('Data berhasil diubah', '?hal=siswa');
                } else {
                    $db->insert('siswa', array('nama' => $nama, 'nis' => $nis, 'jk' => $jk, 'tempat' => $tempat, 'tanggal' => $tanggal, 'jurusan' => $jurusan, 'kelas' => $kelas, 'buat' => wkt()));
                    $res = $db->getResult();
                    eksyen('Data berhasil diinput', '?hal=siswa');
                }
            }
            ?>
			<form action="" method="POST" class="form-horizontal" role="form">
				<?php 
            if (isset($_GET['id'])) {
                ?>
				<input type="hidden" name="id" id="inputId" class="form-control" value="<?php 
                echo $_GET['id'];
                ?>
">
				
				<div class="form-group">
コード例 #4
0
ファイル: sanksi.php プロジェクト: teknomatika/monitor
                }
                $d = $db->getResult();
            } else {
                echo '<h1 class="page-header">Tambah Data Sanksi <small>| <a href="?hal=sanksi">Kembali</a></small></h1>';
            }
            if (isset($_POST['nama'])) {
                echo "Processing...";
                $nama = $db->escapeString($_POST['nama']);
                $minimal = $db->escapeString($_POST['minimal']);
                $maksimal = $db->escapeString($_POST['maksimal']);
                if (isset($_POST['id'])) {
                    $id = mysql_real_escape_string($_POST['id']);
                    $db->update('sanksi', array('nama' => $nama, 'minimal' => $minimal, 'maksimal' => $maksimal, 'ubah' => wkt()), 'id="' . $id . '"');
                    eksyen('Data berhasil diubah', '?hal=sanksi');
                } else {
                    $db->insert('sanksi', array('nama' => $nama, 'minimal' => $minimal, 'maksimal' => $maksimal, 'ubah' => wkt()));
                    $res = $db->getResult();
                    eksyen('Data berhasil diinput', '?hal=sanksi');
                }
            }
            ?>
			<form action="" method="POST" class="form-horizontal" role="form">
				<?php 
            if (isset($_GET['id'])) {
                ?>
				<input type="hidden" name="id" id="inputId" class="form-control" value="<?php 
                echo $_GET['id'];
                ?>
">
				<?php 
            }
コード例 #5
0
ファイル: kelas.php プロジェクト: teknomatika/monitor
                    eksyen('Data tidak ditemukan', '?hal=kelas');
                }
                $d = $db->getResult();
            } else {
                echo '<h1 class="page-header">Tambah Data Kelas <small>| <a href="?hal=kelas">Kembali</a></small></h1>';
            }
            if (isset($_POST['nama'])) {
                echo "Processing...";
                $nama = $db->escapeString($_POST['nama']);
                $wali = $db->escapeString($_POST['wali']);
                if (isset($_POST['id'])) {
                    $id = mysql_real_escape_string($_POST['id']);
                    $db->update('kelas', array('nama' => $nama, 'wali_kelas' => $wali, 'ubah' => wkt()), 'id="' . $id . '"');
                    eksyen('Data berhasil diubah', '?hal=kelas');
                } else {
                    $db->insert('kelas', array('nama' => $nama, 'wali_kelas' => $wali, 'buat' => wkt()));
                    $res = $db->getResult();
                    eksyen('Data berhasil diinput', '?hal=kelas');
                }
            }
            ?>
			<form action="" method="POST" class="form-horizontal" role="form">
				<?php 
            if (isset($_GET['id'])) {
                ?>
				<input type="hidden" name="id" id="inputId" class="form-control" value="<?php 
                echo $_GET['id'];
                ?>
">
				<?php 
            }
コード例 #6
0
ファイル: tatatertib.php プロジェクト: teknomatika/monitor
                }
                $d = $db->getResult();
            } else {
                echo '<h1 class="page-header">Tambah Data Tata Tertib <small>| <a href="?hal=tatatertib">Kembali</a></small></h1>';
            }
            if (isset($_POST['nama'])) {
                echo "Processing...";
                $nama = $db->escapeString($_POST['nama']);
                $poin = $db->escapeString($_POST['poin']);
                $jenis = $db->escapeString($_POST['jenis']);
                if (isset($_POST['id'])) {
                    $id = mysql_real_escape_string($_POST['id']);
                    $db->update('tata_tertib', array('nama' => $nama, 'poin' => $poin, 'jenis' => $jenis, 'ubah' => wkt()), 'id="' . $id . '"');
                    eksyen('Data berhasil diubah', '?hal=tatatertib');
                } else {
                    $db->insert('tata_tertib', array('nama' => $nama, 'poin' => $poin, 'jenis' => $jenis, 'ubah' => wkt()));
                    $res = $db->getResult();
                    eksyen('Data berhasil diinput', '?hal=tatatertib');
                }
            }
            ?>
			<form action="" method="POST" class="form-horizontal" role="form">
				<?php 
            if (isset($_GET['id'])) {
                ?>
				<input type="hidden" name="id" id="inputId" class="form-control" value="<?php 
                echo $_GET['id'];
                ?>
">
				<?php 
            }
コード例 #7
0
ファイル: login.php プロジェクト: teknomatika/monitor
<?php

session_start();
include 'db.php';
include 'fungsi.php';
$db = new Database();
$db->connect();
$user = $db->escapeString($_POST['user']);
$pass = $db->escapeString($_POST['pass']);
$md5pass = md5($pass);
$db->select('users', '*', NULL, "username='******' and password='******'");
$data = $db->getResult();
if ($data) {
    $db->update('users', array('terakhir_login' => wkt()), "username='******' and password='******'");
    $_SESSION['username'] = $data[0]['username'];
    $_SESSION['userid'] = $data[0]['id'];
    switch ($data[0]['level']) {
        case 'Admin':
            $_SESSION['level'] = 'Admin';
            break;
        case 'Kepsek':
            $_SESSION['level'] = 'Kepsek';
            break;
        default:
            unset($_SESSION['username']);
            unset($_SESSION['userid']);
            unset($_SESSION['level']);
            break;
    }
    eksyen('Selamat datang, ' . $data[0]['username'] . ' sebagai ' . $data[0]['level'], '.');
} else {
コード例 #8
0
ファイル: siswa.php プロジェクト: teknomatika/monitor
                            $dir = "images/fotosiswa/" . $_nis . "-" . $img_name;
                            if (move_uploaded_file($tmp_name, "../" . $dir)) {
                                echo "<b>Upload Foto sukses!</b>";
                                $db->update('siswa', array('foto' => $dir), 'id="' . $id . '"');
                            } else {
                                echo "<b>Upload Foto gagal!</b>";
                            }
                        }
                        eksyen('Data berhasil diubah', '?hal=siswa');
                    } else {
                        eksyen('Data gagal diubah', '?hal=siswa');
                    }
                } else {
                    $q = $db->insert('siswa', array('nama' => $nama, 'nis' => $nis, 'jk' => $jk, 'alamat' => $alamat, 'tempat' => $tempat, 'tanggal' => $tanggal, 'jurusan' => $jurusan, 'kelas' => $kelas, 'tapel' => $tapel, 'nama_ortu' => $nama_ortu, 'hp_ortu' => $hp_ortu, 'buat' => wkt()));
                    if ($q) {
                        $db->insert('poin', array('nis' => $nis, 'poin' => '0', 'ubah' => wkt()));
                        eksyen('Data berhasil diinput', '?hal=siswa');
                    } else {
                        eksyen('Data gagal diinput', '?hal=siswa');
                    }
                }
            }
            ?>
			<form action="" method="POST" class="form-horizontal" role="form" enctype="multipart/form-data">
			  <div class="col-lg-8">
				<?php 
            if (isset($_GET['id'])) {
                ?>
				<input type="hidden" name="id" id="inputId" class="form-control" value="<?php 
                echo $_GET['id'];
                ?>
コード例 #9
0
ファイル: pengguna.php プロジェクト: teknomatika/monitor
                    // password
                    if ($_POST['password'] != "") {
                        // kalau tidak kosong, maka dijalankan
                        $password = md5(mysql_real_escape_string($_POST['password']));
                        $q = $db->update('users', array('password' => $password), 'id="' . $id . '"');
                    }
                    // users
                    $q = $db->update('users', array('nama' => $nama, 'level' => $level, 'jurusan' => $jurusan), 'id="' . $id . '"');
                    if ($q) {
                        eksyen('Data berhasil diubah', '?hal=pengguna');
                    } else {
                        eksyen('Data gagal diubah', '?hal=pengguna');
                    }
                } else {
                    $password = md5(mysql_real_escape_string($_POST['password']));
                    $q = $db->insert('users', array('nama' => $nama, 'level' => $level, 'jurusan' => $jurusan, 'username' => $username, 'password' => $password, 'tanggal_registrasi' => wkt()));
                    if ($q) {
                        eksyen('Data berhasil diinput', '?hal=pengguna');
                    } else {
                        eksyen('Data gagal diinput', '?hal=pengguna');
                    }
                }
            }
            ?>
			<form action="" method="POST" class="form-horizontal" role="form" enctype="multipart/form-data">
				<?php 
            if (isset($_GET['id'])) {
                ?>
				<input type="hidden" name="id" id="inputId" class="form-control" value="<?php 
                echo $_GET['id'];
                ?>
コード例 #10
0
ファイル: jurusan.php プロジェクト: teknomatika/monitor
                    eksyen('Data tidak ditemukan', '?hal=jurusan');
                }
                $d = $db->getResult();
            } else {
                echo '<h1 class="page-header">Tambah Data Jurusan <small>| <a href="?hal=jurusan">Kembali</a></small></h1>';
            }
            if (isset($_POST['nama'])) {
                echo "Processing...";
                $nama = $db->escapeString($_POST['nama']);
                $kode = $db->escapeString($_POST['kode']);
                if (isset($_POST['id'])) {
                    $id = mysql_real_escape_string($_POST['id']);
                    $db->update('jurusan', array('nama' => $nama, 'kode_jurusan' => $kode, 'ubah' => wkt()), 'id="' . $id . '"');
                    eksyen('Data berhasil diubah', '?hal=jurusan');
                } else {
                    $db->insert('jurusan', array('nama' => $nama, 'kode_jurusan' => $kode, 'buat' => wkt()));
                    $res = $db->getResult();
                    eksyen('Data berhasil diinput', '?hal=jurusan');
                }
            }
            ?>
			<form action="" method="POST" class="form-horizontal" role="form">
				<?php 
            if (isset($_GET['id'])) {
                ?>
				<input type="hidden" name="id" id="inputId" class="form-control" value="<?php 
                echo $_GET['id'];
                ?>
">
				<?php 
            }
コード例 #11
0
ファイル: index.php プロジェクト: teknomatika/kursus
            case 'Admin':
                $_SESSION['level'] = 'Admin';
                break;
            case 'Direktur':
                $_SESSION['level'] = 'Direktur';
                break;
            case 'Pegawai':
                $_SESSION['level'] = 'Pegawai';
                break;
            default:
                unset($_SESSION['nama']);
                unset($_SESSION['id']);
                unset($_SESSION['level']);
                break;
        }
        $db->update('users', array('login' => wkt(), 'logged' => '1'), "email='{$username}'");
        eksyen('Selamat datang, ' . $data[0]['nama'] . ' sebagai ' . $data[0]['level'], 'admin/');
    } else {
        eksyen('User tidak ditemukan', '');
    }
}
?>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">