Exemplo n.º 1
0
<?php

/**
 * Created by PhpStorm.
 * User: ekobudisusilo
 * Date: 27 /07 /15
 * Time: 14.39
 */
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(-1);
include_once '/Applications/MAMP/htdocs/isias/classes/class.NilaiTest.php';
include_once '/Applications/MAMP/htdocs/isias/classes/paginator.class.php';
$nilai = new NilaiTest();
$stmt = $nilai->countAll();
$num_rows = $stmt->rowCount();
if ($num_rows > 0) {
    $pages = new Paginator($num_rows, 19);
    if (isset($_POST['cari'])) {
        $cari = $_POST['cari'];
        $stmt = $nilai->GetListNilaiTest($pages->limit_start, $pages->limit_end);
    } else {
        $stmt = $nilai->GetListNilaiTest($pages->limit_start, $pages->limit_end);
    }
}
?>
<div class="container">
    <div class="row">
        <a href="#myModal" role="button" class="btn btn-info btn-plus" data-toggle="modal" data-target="#add-Data">Entry Nilai Test Baru</a>
    </div>
</div>
Exemplo n.º 2
0
<?php

/**
 * Created by PhpStorm.
 * User: ekobudisusilo
 * Date: 28 /06 /15
 * Time: 00.52
 */
ob_start();
include 'class.NilaiTest.php';
$id_pk = htmlspecialchars($_POST['token_pk']);
$jenis_test = htmlspecialchars($_POST['jenis']);
$nilai_test = htmlspecialchars($_POST['nilai']);
$memo_test = htmlspecialchars($_POST['memo']);
$data = new NilaiTest();
switch ($_GET['p']) {
    case "add":
        $data->AddNilaiTest($id_pk, $jenis_test, $nilai_test, $memo_test);
        header('location: ../main.php?m=023');
        break;
    case "edit":
        $id = $_REQUEST['id'];
        $data->EditNilaiTest($id_pk, $jenis_test, $nilai_test, $memo_test);
        header('location: ../main.php?m=023');
        break;
    case "del":
        $id = $_REQUEST['id'];
        $data->AddDelete($id);
        header('location: ../main.php?m=023');
        break;
}