Example #1
0
include_once '/Applications/MAMP/htdocs/isias/classes/class.Identitas.php';
include_once '/Applications/MAMP/htdocs/isias/classes/paginator.class.php';
$unit = new UnitSekolah();
$stmt = $unit->countAll();
$num_rows = $stmt->rowCount();
if ($num_rows > 0) {
    $pages = new Paginator($num_rows, 19);
    if (isset($_POST['cari'])) {
        $cari = $_POST['cari'];
        $stmt = $unit->GetListUnitSekolah($pages->limit_start, $pages->limit_end);
    } else {
        $stmt = $unit->GetListUnitSekolah($pages->limit_start, $pages->limit_end);
    }
}
$info = new Identitas();
$stmt_info = $info->getIdentitas();
$page = isset($_GET['p']) ? $_GET['p'] : null;
switch ($page) {
    default:
        echo "<div class='container'>\n                <div class='row'>\n                    <input class='btn btn-info' onclick=\"window.location.href='?m=005&p=new';\" value='Unit Sekolah Baru'></input>\n                </div>\n            </div>";
        //<!-- Table Content -->
        echo "</br>\n            <div class='box box-info'>\n                <div class='box-header'>\n                    <h3 class='box-title'>Daftar Unit Sekolah</h3>\n                    <div class='box-tools'>\n                        <div class='input-group' style='width: 150px;'>\n                          <input type='text' name='table_search' class='form-control input-sm pull-right' placeholder='Search' />\n                          <div class='input-group-btn'>\n                            <button class='btn btn-sm btn-default'><i class='fa fa-search'></i></button>\n                          </div>\n                        </div>\n                    </div>\n                </div>\n                <div class='box-body table-responsive'>\n                    <table class='table no-margin'>\n                        <thead>\n                        <tr>\n                            <th style='width:240px'>Nama Sekolah</th>\n                            <th style='width:100px'>Unit</th>\n                            <th style='width:120px'>Keterangan</th>\n                            <th style='width:70px'>Status</th>\n                            <th style='width:40px'></th>\n                        </tr>\n                        </thead>\n                        <tbody id='pageData'>";
        while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
            extract($row);
            echo "<tr>\n                            <td>{$nama_sekolah}</td>\n                            <td>{$unit_name}</td>\n                            <td>{$unit_desc}</td>";
            if ($unit_status == 1) {
                echo "<td>Suspended</td>";
            } else {
                echo "<td>Actived</td>";
            }
            echo "<td style='text-align:center;width:160px'>\n                                <a class='btn btn-xs btn-warning' href='?m=005&p=change&id={$id}'><i class='glyphicon glyphicon-pencil'></i></a>\n                                <a class='btn btn-xs btn-danger' href='javascript:;' data-id='{$id}' data-toggle='modal' data-target='#modal-konfirmasi'>\n                                <span class='glyphicon glyphicon-trash' aria-hidden='true'></span>\n                            </td>";
Example #2
0
<?php

include_once '/Applications/MAMP/htdocs/isias/classes/class.Identitas.php';
include_once '/Applications/MAMP/htdocs/isias/classes/class.Yayasan.php';
$yys = new Yayasan();
$y = $yys->getYayasan();
$jml_rows = $y->rowCount();
$info = new Identitas();
$stmt = $info->getIdentitas();
$nums = $stmt->rowCount();
if ($nums > 0) {
    while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
        extract($row);
        ?>
    <div class='box box-info'>
        <div class='box-body'>
            <div class='row'>
                <form role='form' method='post' enctype='multipart/form-data' action='classes/crud_identitas.php?p=edit'>
                    <div class='col-md-12'>
                        <div class='alert alert-info col-md-12'>
                            <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>
                            Selamat Datang, Silahkan Edit data Identitas sekolah ini dengan data yang sebenar-benarnya.
                        </div>
                        <div class='well well-sm'><strong><span class='glyphicon glyphicon-asterisk'></span> Required Field</strong></div>
                        <div class='form-group'>
                            <label>Nama Yayasan</label>
                            <div class='input-group'>
                                <select class="form-control input-md col-md-8" name="yayasan" id="yayasan">
                                <?php 
        $id_sekolah = $sekolah_pk;
        while ($n = $y->fetch(PDO::FETCH_ASSOC)) {