public function index() { parent::userauth2(60); $sid = I('get.sid', ''); $menu = D('Dmenu'); import('ORG.Util.Page'); // 导入分页类 if ($sid != '') { $where['Sid'] = $sid; } else { $where['Sid'] = 0; } $count = $menu->where($where)->count(); //总记录数 $Page = new Page($count, 15); //实例化分页类 传入总记录数和每页显示的记录数 $Page->setConfig('header', '条记录'); $Page->setConfig('prev', '<img src="__IMAGE__/prev.gif" border="0" title="上一页" />'); $Page->setConfig('next', '<img src="__IMAGE__/next.gif" border="0" title="下一页" />'); $Page->setConfig('first', '<img src="__IMAGE__/first.gif" border="0" title="第一页" />'); $Page->setConfig('last', '<img src="__IMAGE__/last.gif" border="0" title="最后一页" />'); $show = $Page->show(); //分页显示输出 $volist = $menu->relation(true)->where($where)->order('Sortid asc')->limit($Page->firstRow . ',' . $Page->listRows)->select(); $list = $menu->where('Sid = 0')->order('Sortid asc')->select(); $this->assign('volist', $volist); $this->assign('list', $list); $this->assign('sid', $sid); $this->assign('page', $show); //输出分页 $this->co = $count; $this->display('System/dmenu'); }
public function index() { parent::userauth2(2); $keyword = I('get.keyword', '', 'htmlspecialchars'); $user = D('User'); import('ORG.Util.Page'); // 导入分页类 $where['Username'] = $keyword; $count = $user->where($where)->count(); //总记录数 $Page = new Page($count, 15); //实例化分页类 传入总记录数和每页显示的记录数 $Page->setConfig('header', '条记录'); $Page->setConfig('prev', '<img src="__IMAGE__/prev.gif" border="0" title="上一页" />'); $Page->setConfig('next', '<img src="__IMAGE__/next.gif" border="0" title="下一页" />'); $Page->setConfig('first', '<img src="__IMAGE__/first.gif" border="0" title="第一页" />'); $Page->setConfig('last', '<img src="__IMAGE__/last.gif" border="0" title="最后一页" />'); $show = $Page->show(); //分页显示输出 $volist = $user->relation(true)->where($where)->order('Dtime desc')->limit($Page->firstRow . ',' . $Page->listRows)->select(); $this->assign('volist', $volist); $this->assign('page', $show); //输出分页 $this->assign('keyword', $keyword); $this->co = $count; $this->display(); }
public function index() { parent::userauth2(12); $co = M('competence'); $keyword = I('get.keyword', '', 'htmlspecialchars'); import('ORG.Util.Page'); // 导入分页类 $where['Sid&Cname'] = array('0', array('LIKE', "%{$keyword}%"), '_multi' => true); //多条件查询 $count = $co->where($where)->count(); //总记录数 $Page = new Page($count, 4); //实例化分页类 传入总记录数和每页显示的记录数 $Page->setConfig('header', '条记录'); $Page->setConfig('prev', '<img src="__IMAGE__/prev.gif" border="0" title="上一页" />'); $Page->setConfig('next', '<img src="__IMAGE__/next.gif" border="0" title="下一页" />'); $Page->setConfig('first', '<img src="__IMAGE__/first.gif" border="0" title="第一页" />'); $Page->setConfig('last', '<img src="__IMAGE__/last.gif" border="0" title="最后一页" />'); $show = $Page->show(); //分页显示输出 $volist = $co->where($where)->order('Dtime')->limit($Page->firstRow . ',' . $Page->listRows)->select(); $sidlist = $co->where('Sid<>0')->order('Dtime')->select(); $this->assign('volist', $volist); $this->assign('sidlist', $sidlist); $this->assign('page', $show); $this->assign('keyword', $keyword); $this->co = $count; $this->display(); }
public function index() { parent::userauth2(7); $Role = M('role'); $volist = $Role->order('Dtime')->getField('ID,Rolename,Description,Status,Dtime'); $this->assign('volist', $volist); $co = count($volist); $this->co = $co; $this->display(); }
public function index() { parent::userauth2(82); $keyword = I('get.keyword', '', 'htmlspecialchars'); $Url = I('get.Url', '', 'htmlspecialchars'); $Ip = I('get.Ip', '', 'htmlspecialchars'); $Uid = I('get.Uid', '', 'htmlspecialchars'); $Status = I('get.Status', '', 'htmlspecialchars'); $operating = D('Operating'); import('ORG.Util.Page'); // 导入分页类 if ($keyword != '') { $where['Description'] = $keyword; } else { $where['Description'] = ''; } if ($Url != '') { $where['Url'] = $Url; } if ($Ip != '') { $where['Ip'] = $Ip; } if ($Uid != '') { $where['Uid'] = intval($Uid); } if ($Status != '') { $where['Status'] = intval($Status); } $count = $operating->where($where)->count(); //总记录数 $Page = new Page($count, 15); //实例化分页类 传入总记录数和每页显示的记录数 $Page->setConfig('header', '条记录'); $Page->setConfig('prev', '<img src="__IMAGE__/prev.gif" border="0" title="上一页" />'); $Page->setConfig('next', '<img src="__IMAGE__/next.gif" border="0" title="下一页" />'); $Page->setConfig('first', '<img src="__IMAGE__/first.gif" border="0" title="第一页" />'); $Page->setConfig('last', '<img src="__IMAGE__/last.gif" border="0" title="最后一页" />'); $show = $Page->show(); //分页显示输出 $volist = $operating->relation(true)->where($where)->order('Dtime desc')->limit($Page->firstRow . ',' . $Page->listRows)->select(); //标注时间和颜色 if (count($volist) > 0) { $public = A('Public'); for ($i = 0; $i < count($volist); $i++) { //将搜索的标为红色 $volist[$i]['Dtime'] = $public->Beautifytime($volist[$i]['Dtime']); if ($keyword != '') { $volist[$i]['Description'] = str_replace($keyword, '<font>' . $keyword . '</font>', $volist[$i]['Description']); //描述 } } } if (isset($where['Status'])) { $Status = $where['Status']; } else { $Status = 2; } $this->assign('volist', $volist); $this->assign('page', $show); //输出分页 $this->assign('keyword', $keyword); $this->assign('Status', $Status); $this->co = $count; $this->display('Public:operatinglog'); }
public function edit_do() { parent::userauth2(50); if ($this->isPost()) { $data = array(); $data['ID'] = $_POST['ID']; $data['Sid'] = $_POST['Sid']; $data['Title'] = htmlspecialchars($_POST['Title']); $data['Aliases'] = htmlspecialchars($_POST['Aliases']); $data['Sortid'] = $_POST['Sortid']; $data['Description'] = htmlspecialchars($_POST['Description']); $data['Content'] = $_POST['Content']; $news = D('News'); //自动创建并验证数据 if ($news->create($data)) { $news->save(); parent::operating(__ACTION__, 0, '更新成功'); $this->success('修改成功', __APP__ . '/News/news', 3); } else { parent::operating(__ACTION__, 1, '更新失败:' . $news->getError()); $this->error($news->getError()); } } else { parent::operating(__ACTION__, 1, '非法请求'); $this->error('非法请求'); } }
public function systemwebsite_do() { //验证用户权限 parent::userauth2(53); if ($this->isPost()) { $config = $_POST; $settingstr = "<?php \n return array(\n"; foreach ($config as $key => $val) { $settingstr .= "\t'" . $key . "'=>'" . $val . "',\n"; } $settingstr .= "\n);\n?>"; if (file_put_contents(CONF_PATH . 'webconfig.php', $settingstr, FILE_USE_INCLUDE_PATH)) { parent::operating(__ACTION__, 0, '网站配置文件修改成功'); $this->success('修改成功', 'systemwebsite', 2); } else { parent::operating(__ACTION__, 1, '网站配置文件修改失败'); $this->error('修改失败,可能是由于没有写入权限导致。'); } } else { parent::operating(__ACTION__, 1, '非法请求'); $this->error('非法请求'); } }
public function uploadfile() { parent::userauth2(40); $sid = I('get.sid', ''); $sid = intval($sid); $type = explode('|', C('UPLOAD_FILE_FILE_TYPE')); $filetype = ''; foreach ($type as $val) { $filetype .= '*.' . $val . ";"; } $fileclass = M('fileclass'); $list = $fileclass->where('Uid=' . $_SESSION['ThinkUser']['ID'])->order('Sortid asc')->getField('ID,Sid,ClassName,Sortid'); if (count($list) > 0) { $arr = $this->classid($list); } else { $arr = array(); } $this->assign('filetype', $filetype); $this->assign('list', $arr); $this->assign('sid', $sid); $this->assign('filesize', C('UPLOAD_FILE_FILE_SIZE')); $this->display('uploadfile'); }
public function with() { //权限验证 parent::userauth2(78); $this->display('Client/with'); }
public function recycle() { parent::userauth2(74); $this->display(); }