使用者登入頁面展示登入

使用者登入頁面展示

接著[PHP]實作管理員登入註冊功能來說,

#管理員登入後我們需要看到有哪些人在線上與離線並能執行對其他管理員資訊的修改與刪除

首先修改登入後的程式碼:

微信图片_20180307164621.png

做出登入後面的頁面,程式碼如下:

<!DOCTYPE html>
<html>
<head>
   <title>成员</title>
   <style>
   dl{
      text-align:center;
      border:2px solid #008800;
      margin-top:100px;
margin-bottom:100px;
margin-right:700px;
margin-left:700px;
   }
</style>
</head>
<body>
<dl>
<h1>成员管理</h1>
{volist name="list" id="vo"}
<dt>
   <h3>{$vo.user_id} 姓名:{$vo.user_name}{if $vo.status==1}</h3>
</dt>
{/volist}
   <form action="/public/index.php/index/login/logout" method="post">
      <p><input style="border: #008800" type="submit" value="注销"></p>
   </form>
</dl>
</body>
</html>

這時跳到一個空白頁面,我們需要查詢資料並透過assign輸出到頁面

在application/index/controller/Login.php裡面加入members()方法

<?php
public function members(){
    $view = new View();
    $list = User::all(function($query){
        $query->order('user_id','asc');
    });
    //设置变量输出
    $view->assign('list',$list);
    return $view->fetch('members');
}

執行結果如下所示:

微信图片_20180307165440.png

下一節
<?php echo "管理员登录后的页面展示";
章節課件