<?php

include "../../CLASS/kriteria.class.php";
session_start();
if (empty($_SESSION['username']) and empty($_SESSION['passuser'])) {
    echo '<link href="style/bootstrap.css" rel="stylesheet">';
    echo "<link href='style/style.css' rel='stylesheet'>";
    echo "</head><body><div class='admin-form'><div class='hero-unit'>\n              <div align='center'>\n              <h2>ANDA TIDAK MENDAPATKAN AKSES</h2>\n              <img src='img/lock.png' class='offset'>\n              <p>Untuk mengakses aplikasi, Anda harus login terlebih dahulu</p>\n              <p><a class='btn btn-primary btn-large' href='admin-login.php'>Ulangi Lagi</a></p></div>\n              </div></div>";
} else {
    if ($_SESSION['leveluser'] == 'admin') {
        $id = $_POST['id'];
        $db = new kriteria();
        $ada = $db->hapus_data_kriteria($id);
        echo $ada;
    }
}
session_start();
if (empty($_SESSION['username']) and empty($_SESSION['passuser'])) {
    echo '<link href="style/bootstrap.css" rel="stylesheet">';
    echo "<link href='style/style.css' rel='stylesheet'>";
    echo "</head><body><div class='admin-form'><div class='hero-unit'>\n              <div align='center'>\n              <h2>ANDA TIDAK MENDAPATKAN AKSES</h2>\n              <img src='img/lock.png' class='offset'>\n              <p>Untuk mengakses aplikasi, Anda harus login terlebih dahulu</p>\n              <p><a class='btn btn-primary btn-large' href='admin-login.php'>Ulangi Lagi</a></p></div>\n              </div></div>";
} else {
    if ($_SESSION['leveluser'] == 'admin') {
        $mode = $_POST['mode'];
        $id = "";
        $id_tmp = "";
        $kategori = "- Pilih Kriteria -";
        $nama = "";
        $judul = "TAMBAH DATA KRITERIA CALON PASANGAN";
        if ($mode == "modeEDIT") {
            $id_tmp = $_POST['id_tmp'];
            $db = new kriteria();
            $data = $db->ambil_data_kriteria("id_kriteria", $id_tmp);
            if (sizeof($data) == 1) {
                $id = $data[0][0];
                $kategori = $data[0][1];
                $nama = $data[0][2];
                $judul = "EDIT DATA KRITERIA CALON PASANGAN";
            }
        }
        ?>
        <!-- Page heading -->
        <div class="page-head">
            <!-- Page heading -->
            <h2 class="pull-left">FORM KRITERIA
                <!-- page meta -->
                <span class="page-meta">Halaman form master data kriteria untuk calon pasangan</span>
<?php

include "../../CLASS/kriteria.class.php";
session_start();
if (empty($_SESSION['username']) and empty($_SESSION['passuser'])) {
    echo '<link href="style/bootstrap.css" rel="stylesheet">';
    echo "<link href='style/style.css' rel='stylesheet'>";
    echo "</head><body><div class='admin-form'><div class='hero-unit'>\n              <div align='center'>\n              <h2>ANDA TIDAK MENDAPATKAN AKSES</h2>\n              <img src='img/lock.png' class='offset'>\n              <p>Untuk mengakses aplikasi, Anda harus login terlebih dahulu</p>\n              <p><a class='btn btn-primary btn-large' href='admin-login.php'>Ulangi Lagi</a></p></div>\n              </div></div>";
} else {
    if ($_SESSION['leveluser'] == 'admin') {
        $id = $_POST['id'];
        $id_tmp = $_POST['id_tmp'];
        $nama = $_POST['nama'];
        $kategori = $_POST['kategori'];
        $mode = $_POST['mode'];
        $db = new kriteria();
        $db->set_id_kriteria(preg_replace('/\\s+/', '', $id));
        $db->set_nama_kriteria($nama);
        $db->set_kategori_kriteria($kategori);
        if ($mode == "modeADD") {
            $ada = $db->cek_data_kriteria($id);
            if ($ada == 1) {
                echo 3;
            } else {
                $ret = $db->simpan_data_kriteria();
                echo $ret;
            }
        } else {
            if ($mode == "modeEDIT") {
                $ret = $db->edit_data_kriteria($id_tmp);
                echo $ret;
<?php

include "../../CLASS/kriteria.class.php";
session_start();
if (empty($_SESSION['username']) and empty($_SESSION['passuser'])) {
    echo '<link href="style/bootstrap.css" rel="stylesheet">';
    echo "<link href='style/style.css' rel='stylesheet'>";
    echo "</head><body><div class='admin-form'><div class='hero-unit'>\n              <div align='center'>\n              <h2>ANDA TIDAK MENDAPATKAN AKSES</h2>\n              <img src='img/lock.png' class='offset'>\n              <p>Untuk mengakses aplikasi, Anda harus login terlebih dahulu</p>\n              <p><a class='btn btn-primary btn-large' href='admin-login.php'>Ulangi Lagi</a></p></div>\n              </div></div>";
} else {
    if ($_SESSION['leveluser'] == 'admin') {
        $db = new kriteria();
        ?>
        <!-- Page heading -->
        <div class="page-head">
            <!-- Page heading -->
            <h2 class="pull-left">KRITERIA CALON PASANGAN 
                <!-- page meta -->
                <span class="page-meta">Halaman Untuk Manajemen master data kriteria untuk calon pasangan</span>
            </h2>
            <!-- Breadcrumb -->
            <div class="bread-crumb pull-right">
                <a href="#"><i class="icon-home"></i> Home</a> 
                <!-- Divider -->
                <span class="divider">/</span> 
                <a href="#" class="bread-current">Daftar Kriteria</a>
            </div>
            <div class="clearfix"></div>

        </div>
        <!-- Page heading ends -->