#echo "3"; } else { $f = $_FILES['image']; $imgdir = "Image/" . date("YmdHis") . $f['name']; $uploadOk = 1; copy($f['tmp_name'], "../" . $imgdir); #echo "4"; } if ($uploadOk == 1) { $Pelaporan->newReport($_POST['report'], $imgdir, $_COOKIE['id'], $_POST['cat'], $_POST['dep']); $msg['success'] = "Data Berhasil Di input.."; } } require_once '../models/kategori.php'; $Kategori = new Kategori(); $cat = $Kategori->getKategori(); require_once '../models/departemen.php'; $Departemen = new Departemen(); $dep = $Departemen->getDepartemen(); require_once 'header.php'; require_once 'sidebar.php'; ?> <div id="page-wrapper"> <div class="container-fluid"> <!-- Page Heading -->
</div> <a href="?p=kategori-tambah" class="btn btn-primary center-block">Tambah Kategori</a> <div class="panel-body"> <div class="table-responsive"> <table class="table table-striped table-bordered table-hover" id="dataTables-example"> <thead> <tr> <th>Nama Kategori</th> <th>Detail</th> <th>Aksi</th> </tr> </thead> <tbody> <?php $sql = "SELECT * FROM `kategori`"; $kategori = Kategori::getKategori($sql); foreach ($kategori as $data => $r) { echo "\n\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<td>{$r['1']}</td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td>{$r['2']}</td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td width=130px><a href='?p=kategori-edit-{$r['0']}' style='width: 60px' class='btn btn-success'>Edit</a> <a href='?p=kategori-delete-{$r['0']}' style='width: 60px' class='btn btn-danger'>Hapus</a> </td>\n\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t"; } ?> </tbody> </table> </div> </div> </div> <!--End Advanced Tables --> </div> </div> <?php
<?php $this->breadcrumbs = array('Bukus' => array('index'), $model->judul); $this->menu = array(array('label' => 'List Buku', 'url' => array('index')), array('label' => 'Create Buku', 'url' => array('create')), array('label' => 'Update Buku', 'url' => array('update', 'id' => $model->id)), array('label' => 'Delete Buku', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?')), array('label' => 'Manage Buku', 'url' => array('admin'))); ?> <h1><?php echo $model->judul; ?> </h1> <?php $this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'attributes' => array(array('type' => 'raw', 'value' => CHtml::image(YII::app()->request->baseUrl . '/photo/book/' . $model->cover, "cover", array("width" => 200))), 'judul', 'pengarang', 'penerbit', 'tahun_terbit', 'review', array('label' => 'kategori', 'type' => 'raw', 'value' => Kategori::getKategori($model->kategori)))));