function display() { $this->view->assign('activeskin', $this->getActiveSkin()); $viewName = $this->getViewName(); if (empty($viewName)) { $this->view->assign('view.name', 'Dashboard'); $this->view->setView('dashboard'); } else { $this->view->setView($viewName); } parent::display(); }
function display() { $this->view->assign('view.name', 'Dashboard'); $this->view->setView('dashboard'); parent::display(); }
<?php require "lib/controller.class.php"; $app = new Controller(); $app->display("header"); ?> <table id="tabdata"> <tr> <th>Iterations</th> <th>Start MSE</th> <th>End MSE</th> <th>Date</th> <th><abbr title="In seconds">Exec Time</abbr></th> <th class="end"><abbr title="yes/no">Off-line</abbr></th> </tr> <?php $app->model->get("epochs")->listAllHistory($_GET['n']); ?> </table> <?php $app->display("footer");
} // build css if there is a newer less version require "classes/less/lessc.inc.php"; $less = new lessc(); $less->setFormatter("compressed"); try { $less->checkedCompile("css/less/wuza.less", "css/wuza.css"); } catch (exception $e) { echo '<div class="text-danger bg-danger small-padding">fatal error: ' . $e->getMessage() . '</div>'; } // allow GZIP Compression ob_start("ob_gzhandler"); session_start(); // incude classes include 'classes/controller.php'; include 'classes/model.php'; include 'classes/view.php'; include 'classes/uri.php'; // $_SESSION, $_GET and $_POST - no $_COOKIE but config values $request = array_merge($_SESSION, $_GET, $_POST, $config); // add values from fancy url $url = new URI("wuza"); $request["view"] = $url->shouldShow404("view") ? "404" : strtolower($url->getVar("view")); // allowed url slash vars - but prefer get params if there are some foreach (array('file') as $vari) { $request[$vari] = $request[$vari] ?: $url->getVar($vari); } // create controller $controller = new Controller($request); echo $controller->display(); $controller->update_session();
/** * Displays the view. * * @param string $view View id. * @param array $vars Variables for in the View. * @param boolean $exit Exit PHP process when done? * @return mixed Rendered content or nothing when $exit is true. */ public function display($view, $vars = array(), $exit = true) { if (defined('CMS_BACKEND')) { return parent::display($view, $vars, $exit); } else { $this->content = $this->render($view, $vars); $this->executeFrontendLayout(); if ($exit) { exit; } } }
<?php /** * Main admin page * @author Louis Stowasser */ require "lib/controller.class.php"; $app = new Controller(); $app->assign("nlist", $app->model->get("network")->listNetworks()); $data = $app->model->get("network")->getStats($_SESSION['id']); $app->map($data); $app->assign("auth", md5($_SESSION['name'])); $app->display("main");
<?php /** * Exports training set * @author Louis Stowasser */ require "lib/controller.class.php"; $app = new Controller(); set_time_limit(300); if (!$_POST['file']) { die("No Post Data!"); } $app->display("header"); $q = db::init()->query("pattern.getAll", array("id" => $_POST['id'])); file_put_contents("lib/cache/" . $_POST['file'] . ".nms", ""); //clear file while ($row = $q->fetch(PDO::FETCH_ASSOC)) { //Append data to file file_put_contents("lib/cache/" . $_POST['file'] . ".nms", $row['pattern'] . ":" . $row['output'] . "\n", FILE_APPEND); } $app->assign("file", $_POST['file']); $app->display("export"); $app->display("footer");
public function _404() { //寻找走失儿童404页面 parent::display('404.html'); exit; }
<?php require "lib/controller.class.php"; $app = new Controller(); if (isset($_POST['user']) && isset($_POST['pass'])) { if ($app->model->get("users")->login($_POST['user'], $_POST['pass'])) { Model::direct("nm-main.php"); } else { throw new Exception("User not found!"); } } $app->assign("label", "Login"); $app->display("login");
<?php /** * Network main page * @author Louis Stowasser */ require "lib/controller.class.php"; $app = new Controller(); $app->inc("nmesh"); $app->assign("assets", array("global.css", "main.js")); $app->display("header"); $data = $app->model->get("network")->get($_GET['n']); $nn = $app->model->get("network")->nn; ?> <div id="tree"> <?php echo "<div>Inputs: <span class='number'>" . $nn->inputs . "</span><br />"; echo "Outputs: <span class='number'>" . $nn->outputs . "</span></div>"; $tree = $app->model->get("cache")->getCache($_GET['n'] . "tree"); echo $tree === null ? $app->model->get("network")->buildTree($_GET['n'], $nn) : $tree; ?> </div> <?php $app->assign("n", $_GET['n']); $app->assign("authkey", $data['authkey']); $app->assign("layer", model::$LAYER); $app->assign("neuron", model::$NEURON); $app->assign("input", model::$INPUT); $app->assign("output", model::$OUTPUT);
<?php /** * Lists training sets * @author Louis Stowasser */ require "lib/controller.class.php"; $app = new Controller(); $app->display("header", false); ?> <div id="tools"> <fieldset> <legend>New Training Set</legend> <form action="nm-manage-set.php?action=new" method="post"> <input type="text" name="label" /> <input type="hidden" name="n" value="<?php echo $_GET['n']; ?> " /> <input type="submit" value="Add" /> </form> </fieldset> </div> <table id="tabdata"> <tr><th>Training Set Name</th><th></th></tr> <?php $app->model->get("train")->listTrainingSets($_GET['n']); //list sets in network ?> </table>