<?php /** * Created by PhpStorm. * User: ekobudisusilo * Date: 24 /07 /15 * Time: 23.15 */ ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(-1); include_once '/Applications/MAMP/htdocs/isias/classes/class.BeliFormulir.php'; include_once '/Applications/MAMP/htdocs/isias/classes/paginator.class.php'; $data = new PembelianFormulir(); $stmt = $data->countAll(); $num_rows = $stmt->rowCount(); if ($num_rows > 0) { $pages = new Paginator($num_rows, 19); if (isset($_POST['cari'])) { $cari = $_POST['cari']; $stmt = $data->GetListPembelianFormulir($pages->limit_start, $pages->limit_end); } else { $stmt = $data->GetListPembelianFormulir($pages->limit_start, $pages->limit_end); } } $page = isset($_GET['p']) ? $_GET['p'] : null; switch ($page) { default: echo "\n <div class='container'>\n <div class='row'>\n <input class='btn btn-info' onclick=\"window.location.href='?m=020&p=new';\" value='Formulir Baru'></input>\n <div class='input-prepend pull-right'>\n <span class='add-on'><i class='icon-search'></i></span>\n <input class='span2' id='prependedInput' type='text' name='cari' placeholder='Pencarian..'>\n\n </div>\n </div>\n </div>\n </br>\n <div class='box box-info'>\n <div class='box-body'>\n <div class='table-responsive'>\n <table class='table no-margin'>\n <thead>\n <tr>\n <th style='width:220px'>Tahun Angkatan</th>\n <th style='width:80px'>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);
<?php /** * Created by PhpStorm. * User: ekobudisusilo * Date: 24 /07 /15 * Time: 23.08 */ ob_start(); include 'class.BeliFormulir.php'; $token_id = ''; $thn_angkatan = htmlspecialchars($_POST['kode_jur']); $nama = htmlspecialchars($_POST['nama_jur']); $no_telp = htmlspecialchars($_POST['keahlian']); $keterangan = htmlspecialchars($_POST['kompetisi']); $email = htmlspecialchars($_POST['spesial']); $data = new PembelianFormulir(); switch ($_GET['p']) { case "add": $stmt = $data->AddPembelianFormulir($token_id, $thn_angkatan, $nama, $no_telp, $keterangan, $email); header('location:../main.php?m=004'); break; case "edit": break; case "del": $id = htmlspecialchars($_REQUEST['id']); $stmt = $data->DelPembelianFormulir($id); header('location:../main.php?m=004'); break; } ob_end_flush();