Beispiel #1
0
 public function excute()
 {
     $loginUser = Lib_User::NeedLogin();
     $pageSize = 20;
     $searchUser = new Search_User();
     $count = $searchUser->getCount();
     $pageInfo = Page::GetPageInfo($pageSize, $count);
     $searchUser->size = $pageSize;
     $searchUser->offset = $pageInfo['offset'];
     $users = $searchUser->getList();
     foreach ($users as $index => $user) {
         $user['create_date'] = date('Y-m-d H:i:s', $user['create_time']);
         $user['login_date'] = date('Y-m-d H:i:s', $user['login_time']);
         $users[$index] = $user;
     }
     $tableObj = new Html_Table($users);
     $keyMap = array('id' => '用户ID', 'username' => '用户名', 'create_date' => '注册时间', 'register_ip' => '注册IP', 'login_date' => '最后登陆时间', 'login_ip' => '最后登录IP');
     $tableObj->setTableInfo($keyMap);
     $tableHtml = $tableObj->createHtml();
     $param = array('loginUser' => $loginUser, 'tableHtml' => $tableHtml, 'pageStr' => $pageInfo['page_str']);
     $this->show($param);
 }
 public static function table(array $items = array(), array $rpoperties = array(), array $atrs = array())
 {
     return Html_Table::forge($items, $rpoperties, $atrs);
 }
 static function test_me()
 {
     $cn = new Database(Dossier::id());
     $order = " order by f_id desc ";
     $url = HtmlInput::get_to_string(array("gDossier", "test_select"));
     if (isset($_GET['sb'])) {
         $order = " order by f_id";
         $img = "image/select1.gif";
     } else {
         $url = $url . "&sb=as";
         $img = "image/select2.gif";
     }
     $sql = "select f_id,name,quick_code from vw_client  {$order} limit 10";
     echo $sql;
     echo Html_Table::sql2table($cn, array(array('name' => 'N° de fiche', 'style' => 'text-align:right', 'link' => $url, 'image' => $img), array('name' => 'Nom', 'style' => 'text-align:right'), array('name' => 'QuickCode')), $sql);
 }