Пример #1
0
 /**
  * [welcome 后台欢迎界面]
  * @Author   Rukic
  * @DateTime 2015-11-25T20:57:53+0800
  * @return   [type]                   [description]
  */
 public function welcome()
 {
     $data = K('AdminUser')->get_admin($_SESSION['uid']);
     $welcome = array('OS' => get_os(), 'browser' => browser_info(), 'PHPV' => phpversion(), 'MYPHPV' => MYPHP_VERSION, 'admin_user' => $_SESSION['uname'], 'id' => $_SESSION['uid'], 'login_time' => $data['admin_logintime'], 'login_ip' => ntoip($data['admin_loginip']));
     $this->assign('w', $welcome);
     $this->display();
 }
Пример #2
0
 public function user()
 {
     // p(__ACTION__);exit;
     $db = M('user');
     $total = $db->count();
     $params = array('total_rows' => $total, 'method' => '', 'parameter' => 'index.php?p=?', 'now_page' => $_GET['p'], 'list_rows' => 5);
     $page = new Page($params);
     $now = ((int) $_GET['p'] - 1) * (int) $params['list_rows'];
     $end = $params['list_rows'];
     $data = $db->order('id desc')->limit($now . ',' . $end)->all();
     // p($data);die;
     $arr = array();
     foreach ($data as $v) {
         // p($v);die;
         $v['admin_loginip'] = ntoip($v['admin_loginip']);
         // p($v);die;
         $arr[] = $v;
     }
     // p($arr);die;
     $this->assign('user', $arr);
     $this->assign('page', $page->show(1));
     $this->display();
 }