public function getContents() { $table = new MultiModelTable(null); $table->setParams(array('fields' => array('system.audit_trail.audit_trail_id', 'system.audit_trail.audit_date', 'system.audit_trail.description', 'system.audit_trail.item_type'), 'conditions' => "user_id = '{$_SESSION['user_id']}'", 'sort_field' => 'audit_trail_id DESC')); $table->useAjax = true; return $table->render(); }
public function render() { if (count($this->listFields) > 0) { $fieldNames = $this->listFields; } else { $fieldNames = $this->getDefaultFieldNames(); } foreach ($fieldNames as $i => $fieldName) { $fieldNames[$i] = substr($fieldName, 0, 1) == "." ? $this->redirectedPackage . $fieldName : $fieldName; } $this->setupList(); $params["fields"] = $fieldNames; $params["page"] = 0; $params["sort_field"] = array(array("field" => end(explode('.', reset($fieldNames))), "type" => "DESC")); $params['hardConditions'] = $this->listConditions; $this->table->setParams($params); return $this->toolbar->render() . $this->table->render(); }
public function table() { global $redirectedPackage; $params = json_decode($_REQUEST["params"], true); $redirectedPackage = $params['redirected_package']; $modelTable = new MultiModelTable($prefix); $modelTable->setOperations($params["operations"]); $modelTable->setParams($params); $table = $modelTable->render(false); $footer = $modelTable->renderFooter(); $operations = $modelTable->getOperations(); echo json_encode(array("tbody" => $table, "footer" => $footer, "operations" => $operations)); die; }
public function audit($params) { $table = new MultiModelTable(null); if (count($this->historyModels) > 0) { $models = implode("', '", $this->historyModels); } else { $models = $this->modelName; } $table->setParams(array('fields' => array('system.audit_trail.audit_trail_id', 'system.audit_trail.audit_date', 'system.audit_trail.description', 'system.users.user_name', 'system.users.first_name', 'system.users.last_name', 'system.users.other_names'), 'filter' => "item_id = ? AND item_type in (?)", 'bind' => [$params[0], $models], 'sort_field' => 'audit_trail_id DESC')); $table->useAjax = true; return $table->render(); }