/** * 显示信息 * @param type $backurl * @param type $message */ function showMessage($backurl, $message) { Doo::loadController('DooController'); $dc = new DooController(); $data = array('backurl' => $backurl, 'sec' => Doo::conf()->SEC, 'message' => $message, 'rootUrl' => Doo::conf()->APP_URL); $dc->renderc('admin/msg', $data); exit; }
<?php Doo::loadController('__auth'); class __category extends __auth { private $ch = array(); /* * 入口 */ public function index() { $action = Lua::get_post('action'); $action = $action ? $action : 'home'; $rs = $this->acl()->process($this->user['perm'], '__category', $action); if ($rs) { return $rs; } if (method_exists($this, $action)) { $this->ch = Lua::get_one("select * from lua_channel where path='" . SYSNAME . "'"); $this->{$action}(); } else { Lua::e404(); } } /* * 栏目列表 */ private function home() { $mods = $this->_models($this->ch); $list = $cate = $this->_tree(0, 0, ' ');
/** * short hand of Doo::loadController() * @param string $class_name */ public function controller($class_name) { Doo::loadController($class_name); }
<?php Doo::loadController('ApplicationController'); /** * 修改密码 * @author xinkq */ class UserModPasswordController extends ApplicationController { /** * 修改密码 */ public static $modPasswordUrl = NULL; public function init() { UserModPasswordController::$modPasswordUrl = adminAppUrl('system/userModPassword/modPassword?id='); } //修改密码 public function modPassword() { $userInfo = $this->_user->getUserInfo(); //D($userInfo); $uid = $userInfo['uid']; if ($uid == 0 && isset($uid)) { $this->alert('参数错误'); return; } if ($this->isAjax() && $_POST) { $v = Doo::loadHelper('DooValidator', true); $success = true; $errors = array();
<?php Doo::loadController("ApplicationController"); /** * 门店列表 * @author xinkq */ class MapController extends ApplicationController { public static $dataTableUrl = NULL; public static $addUrl = NULL; public static $modUrl = NULL; public static $delUrl = NULL; public static $status = array('0' => '正常', '1' => '失效'); public static $city = array(); public function init() { MapController::$dataTableUrl = adminAppUrl('operation/map/dataTable'); MapController::$addUrl = adminAppUrl('operation/map/add'); MapController::$modUrl = adminAppUrl('operation/map/mod?id='); MapController::$delUrl = adminAppUrl('operation/map/del?id='); MapController::$city = DBproxy::getProcedure('Manage')->setDimension(2)->getCityList(); } public function dataTable() { Doo::loadClassAt('html/DataTable', 'default'); $dt = new DataTable(); function table_button($row, $rowData, $val) { $a = '<a class="btn blue-stripe mini" href="' . MapController::$modUrl . $rowData['id'] . '">' . '编辑</a>'; $a .= ' <a href="' . MapController::$delUrl . $rowData['id'] . '" class="red-stripe btn mini js-datatable-del">删除</a>';
<?php /** * Description of ErrorController * * @author darkredz */ Doo::loadController('I18nController'); class ErrorController extends I18nController { function index() { $data['header'] = 'header'; $data['nav'] = 'nav'; $data['title'] = 'ERROR 404'; $data['content'] = 'This is a cool message.'; $data['baseurl'] = Doo::conf()->APP_URL; $this->view()->render($_COOKIE['lang'] . '/template', $data); } }
<?php Doo::loadController('MainController'); /** * 验证码 * 2015.6.01 * @author xinkq */ class CaptchaController extends MainController { /** * 验证码 * @return [type] [description] */ public function index() { //定义图片的长宽 $img_width = 80; $img_height = 25; $safe_code = ''; //生产验证码字符 //$char = '0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z'; $char = '1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,J,K,M,N,P,R,S,T,U,V,W,X,Y'; $len = count(explode(',', $char)) - 1; $list = explode(',', $char); for ($i = 0; $i < 4; $i++) { $rand_num = rand(0, $len); $safe_code .= $list[$rand_num]; } //把验证码字符保存到session $_SESSION['safe_code'] = $safe_code;