예제 #1
0
 * Time: 00.23
 */
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(-1);
include_once '/Applications/MAMP/htdocs/isias/classes/class.UnitSekolah.php';
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>";