/** fungsi dibawah berfungsi untuk membaca link dan mendapatkan controller,action dan query */ private function linkReader($link) { $exp_ = array_filter(explode("/", $link)); //dipecah berdasar tanda / $exp_link = array(); foreach ($exp_ as $val) { $exp_link[] = $val; } if (count($exp_link) > 0) { $controller = $exp_link[0] . "Controller"; $controller_path = __WEBSITE__ . "system/controller/{$controller}.php"; if (__ROADMIN__ && $exp_link[0] == "ro-admin") { RO::lib("admin_superAdmin"); $this->controller = "admin_superAdmin"; } elseif (file_exists($controller_path)) { require_once __WEBSITE__ . "system/controller/{$controller}.php"; if (class_exists($controller)) { $this->controller = $controller; } } else { $this->controller = __MAINCONT__; require_once __WEBSITE__ . "system/controller/{$this->controller}.php"; } if (!empty($exp_link[1])) { $this->action = "action" . ucfirst($exp_link[1]); } // kemungkinan memiliki query atau tidak $query = array_slice($exp_link, 2); if (sizeof($query > 0)) { $this->queryMaker($query); } } else { $this->controller = __MAINCONT__; require_once __WEBSITE__ . "system/controller/{$this->controller}.php"; } }
public function controllerVal($id) { $tipe = RO::lib("access_tipeUser"); $tipe->_GET = array(str_replace(":", "", $id)); $admin = $tipe->fetch("id", "WHERE id = {$id} AND nama = 'superAdmin'"); if ($admin) { $this->actionFind("admin_superAdmin"); } else { $this->list["admin_superAdmin"] = array("actionIndex"); } $this->mulai(); return $this->list; }
<h1 class="f29 d-uitalic mb10">Acces User</h1> <a class="btn-1 pad5" onclick="showAddUser()">add</a> <a href="RefreshAccess" class="btn-2 pad5">refresh</a> <form id="addTypeUser" method="post" action="addTypeUser"> <h3 class="f13 mt10">Tambah Tipe User</h3> <input name="nama" /> <input type="submit" name="submit" value="Tambah" class="btn-1 pad220" /> </form> <?php $a = RO::lib("access_tipeUser"); $data = $a->listTipeUser(); $view = RO::lib("view_grid"); $view->gridView($data, array(array("header" => "No", "value" => 'no'), array("header" => "Nama", "value" => '\'<a onclick="listAccessUser(\'.$data["id"].\')">\'.$data["nama"].\'</a>\'')), array('update' => false, 'delete_link' => 'deleteTypeUser')); ?> <div> <br /> <table> <tr> <td>Tanggal</td> <td>:<input style="width: 90%;" type="date" /></td> </tr> <tr> <td>Keterangan :</td> <td>:<textarea style="width: 90%;"></textarea></td> </tr> </table> </div> <div id="listAkses">
public function actionUpdateTypeUser() { $tipe = RO::lib("access_tipeUser"); $tipe->postReader(); $query = $tipe->updateQuery("nama = '" . $tipe->data['nama'] . "'", "WHERE id =" . $tipe->data['id']); print_r($query); $tipe->execute($query); header("location: admin"); }
/** berfungsi mengeset properties pada class jika kosong diset sesuai default*/ private function loadLib() { foreach ($this->lib as $key => $lib) { $this->{$key} = RO::lib($lib); } }
public function lib($lib = array()) { foreach ($lib as $key => $lib) { $this->{$key} = $this->{$key} = RO::lib($lib, $this); } }