<?php $model_admin_user_obj = new Model_Admin_User(); $model_admin_user = $model_admin_user_obj->get_auth_user_info(); ?> <div id="navbar" class="navbar navbar-default"> <script type="text/javascript"> try{ace.settings.check('navbar' , 'fixed')}catch(e){} </script> <div class="navbar-container" id="navbar-container"> <button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar"> <span class="sr-only">Toggle sidebar</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <div class="navbar-header pull-left"> <a href="/admin/index" class="navbar-brand"> <small> <i class="fa fa-leaf"></i> 易衫网 </small> </a> </div> <div class="navbar-buttons navbar-header pull-right" role="navigation"> <ul class="nav ace-nav"> <li class="light-blue"> <a data-toggle="dropdown" href="#" class="dropdown-toggle"> <img class="nav-user-photo" src="/ace/assets/avatars/user.jpg" alt="Jason's Photo" />
static function table_list() { $table_alias = $table = self::$table = "et_user"; $table_alias = 'u'; $join = ''; if (empty($table_alias)) { throw new ErrorException("table is not defined"); } //$request = http_request("rows","page","sidx","sord"); $request = PtLib\http_request("rows", "page", "sidx", "sord", "mobile", "nick_name"); $limit = $request['rows']; $page = $request['page']; $sort = $request['sidx']; $sort_type = $request['sord']; //fields $select_fields = " u.*"; if (empty($limit)) { $limit = 20; } if (empty($page)) { $page = 1; } if (empty($sort)) { $sort = "id"; $sort_type = "desc"; } else { if (empty($sort_type)) { $sort_type = "desc"; } } //where $args = array(); $where = " where 1=1 "; if ($request['mobile']) { $where .= " and u.mobile = ?"; $args[] = $request['mobile']; } if ($request['nick_name']) { $where .= " and u.nick_name = ?"; $args[] = $request['nick_name']; } //order $order = ""; if ($sort) { $order = "order by {$table_alias}." . addslashes($sort) . " " . $sort_type; } $sql = "select count({$table_alias}.id) as total from {$table} as {$table_alias} {$join} {$where} "; //$count_res = db()->select_row($sql,$args); $count_res = PtLib\db()->select_row($sql, $args); $records = $count_res['total']; $response = new stdClass(); $response->page = $page; //cur page if ($records > 0) { $total_pages = ceil($records / $limit); } else { $total_pages = 1; } if ($page > $total_pages) { $page = $total_pages; } $response->total = $total_pages; //total pages $response->records = $records; //count $skip = ($page - 1) * $limit; $sql = "select {$select_fields} from {$table} as {$table_alias} {$join} {$where} {$order} limit {$skip},{$limit} "; //$rows = db()->select_rows($sql,$args); $rows = PtLib\db()->select_rows($sql, $args); foreach ($rows as $row) { $response->rows[] = array('id' => $row['id'], "cell" => $row); } return $response; }