亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

網(wǎng)站後臺(tái)的模組介紹--使用者資訊管理

網(wǎng)站後臺(tái)包含哪些模組?下面我就來(lái)具體說(shuō)一下

微信截圖_20170713091749.png

如上圖所示,後臺(tái)模組包含基本設(shè)定(網(wǎng)站設(shè)定、修改密碼),導(dǎo)航管理(分類管理、使用者資訊管理) ,欄位管理(內(nèi)容管理、新增內(nèi)容),新書管理(新書清單)。

前面的課程已經(jīng)講解了網(wǎng)站的設(shè)定和修改密碼,今天我來(lái)為大家講解一下使用者的資訊管理。

目前臺(tái)的用戶註冊(cè)後,他們的資訊想要保存下來(lái),這時(shí)候你就要用到用戶的資訊管理了

第一步:先在資料庫(kù)建立一個(gè)用戶信息表,如圖:

微信截圖_20170713102359.png

這裡面我就寫了4個(gè)簡(jiǎn)單的欄位。

在admin下方建立一個(gè)usermessage.php,取得資料庫(kù)裡面的信息,將他展示在後臺(tái),具體實(shí)作程式碼如下:

<?php 
  session_start (); 
  require_once("../config/config.php");
  $sql = "SELECT * FROM user"; 
$result = mysql_query($sql); //執(zhí)行SQL語(yǔ)句,獲得結(jié)果集 
    if ($result && mysql_num_rows($result)) {
      while ($row = mysql_fetch_assoc($result)) {
        $data[] = $row;
      }
    }
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="style/css/pintuer.css">
<link rel="stylesheet" href="style/css/admin.css">
<script src="style/js/jquery.js"></script>
<script src="style/js/pintuer.js"></script>
</head>
<body>
<form method="post" action="" id="listform">
  <div class="panel admin-panel">
    <div><strong> 用戶列表</strong></div>
    <div class="padding border-bottom">
      <ul style="padding-left:10px;">
        <li> <a class="button border-main icon-plus-square-o" href="adduser.html">添加用戶</a> </li>
       
          <input type="text" placeholder="請(qǐng)輸入搜索關(guān)鍵字" name="keywords" style="width:250px; line-height:17px;display:inline-block" />
          <a href="javascript:void(0)" class="button border-main icon-search" onclick="changesearch()" > 搜索</a></li>
      </ul>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th width="100" style="text-align:left; padding-left:20px;">ID</th>
        <th width="10%">用戶名</th>
        <th>密碼</th>
        <th width="30%">qq</th>
        <th width="310">操作</th>
      </tr>
      <?php
          
            foreach ($data as $v){
      ?>
       
        <tr>
        <td style="text-align:left; padding-left:20px;"><input type="checkbox" name="id" value="ar" />
           <?php echo $v['id']?></td>
          <td><?php echo $v['username']?></td>
          <td><?php echo $v['password']?></td>
          <td><?php echo $v['qq']?></td>
          
          <td><div> 
          <a class="button border-main" href="edit.php<?php echo '?id='.$v['id']?>"><span></span> 修改</a> 
          <a class="button border-red" href="delete.php<?php echo '?id='.$v['id']?>" onclick="return del(1,1,1)"><span></span> 刪除</a> </div></td>
        </tr>
        <?php
             }
        ?>
        
        <td style="text-align:left; padding:19px 0;padding-left:20px;"><input type="checkbox" id="checkall"/>
          全選 </td>
        <td colspan="7" style="text-align:left;padding-left:20px;"><a href="javascript:void(0)" class="button border-red icon-trash-o" style="padding:5px 15px;" onclick="DelSelect()"> 刪除</a> 
          
         </td>
    
      <tr>
        <td colspan="8"><div> <a href="">上一頁(yè)</a> <span>1</span><a href="">2</a><a href="">3</a><a href="">下一頁(yè)</a><a href="">尾頁(yè)</a> </div></td>
      </tr>
    </table>
  </div>
</form>
<script type="text/javascript">
//搜索
function changesearch(){  
    
}
//單個(gè)刪除
function del(id,mid,iscid){
  if(confirm("您確定要?jiǎng)h除嗎?")){
    
  }
}
//全選
$("#checkall").click(function(){ 
  $("input[name='id[]']").each(function(){
    if (this.checked) {
      this.checked = false;
    }
    else {
      this.checked = true;
    }
  });
})
//批量刪除
function DelSelect(){
  var Checkbox=false;
   $("input[name='id[]']").each(function(){
    if (this.checked==true) {   
    Checkbox=true;  
    }
  });
  if (Checkbox){
    var t=confirm("您確認(rèn)要?jiǎng)h除選中的內(nèi)容嗎?");
    if (t==false) return false;   
    $("#listform").submit();    
  }
  else{
    alert("請(qǐng)選擇您要?jiǎng)h除的內(nèi)容!");
    return false;
  }
}
</script>
</body>
</html>

這樣,使用者的所有資訊就顯示出來(lái)了,是不是很簡(jiǎn)單,感謝大家的關(guān)注,下節(jié)我們將會(huì)教大家在後臺(tái)添加用戶。

繼續(xù)學(xué)習(xí)
||
<?php session_start (); require_once("../config/config.php"); $sql = "SELECT * FROM user"; $result = mysql_query($sql); //執(zhí)行SQL語(yǔ)句,獲得結(jié)果集 if ($result && mysql_num_rows($result)) { while ($row = mysql_fetch_assoc($result)) { $data[] = $row; } } ?> <!DOCTYPE html> <html lang="zh-cn"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta name="renderer" content="webkit"> <title></title> <link rel="stylesheet" href="style/css/pintuer.css"> <link rel="stylesheet" href="style/css/admin.css"> <script src="style/js/jquery.js"></script> <script src="style/js/pintuer.js"></script> </head> <body> <form method="post" action="" id="listform"> <div class="panel admin-panel"> <div class="panel-head"><strong class="icon-reorder"> 用戶列表</strong></div> <div class="padding border-bottom"> <ul class="search" style="padding-left:10px;"> <li> <a class="button border-main icon-plus-square-o" href="adduser.html">添加用戶</a> </li> <input type="text" placeholder="請(qǐng)輸入搜索關(guān)鍵字" name="keywords" class="input" style="width:250px; line-height:17px;display:inline-block" /> <a href="javascript:void(0)" class="button border-main icon-search" onclick="changesearch()" > 搜索</a></li> </ul> </div> <table class="table table-hover text-center"> <tr> <th width="100" style="text-align:left; padding-left:20px;">ID</th> <th width="10%">用戶名</th> <th>密碼</th> <th width="30%">qq</th> <th width="310">操作</th> </tr> <?php foreach ($data as $v){ ?> <tr> <td style="text-align:left; padding-left:20px;"><input type="checkbox" name="id" value="ar" /> <?php echo $v['id']?></td> <td><?php echo $v['username']?></td> <td><?php echo $v['password']?></td> <td><?php echo $v['qq']?></td> <td><div class="button-group"> <a class="button border-main" href="edit.php<?php echo '?id='.$v['id']?>"><span class="icon-edit"></span> 修改</a> <a class="button border-red" href="delete.php<?php echo '?id='.$v['id']?>" onclick="return del(1,1,1)"><span class="icon-trash-o"></span> 刪除</a> </div></td> </tr> <?php } ?> <td style="text-align:left; padding:19px 0;padding-left:20px;"><input type="checkbox" id="checkall"/> 全選 </td> <td colspan="7" style="text-align:left;padding-left:20px;"><a href="javascript:void(0)" class="button border-red icon-trash-o" style="padding:5px 15px;" onclick="DelSelect()"> 刪除</a> </td> <tr> <td colspan="8"><div class="pagelist"> <a href="">上一頁(yè)</a> <span class="current">1</span><a href="">2</a><a href="">3</a><a href="">下一頁(yè)</a><a href="">尾頁(yè)</a> </div></td> </tr> </table> </div> </form> <script type="text/javascript"> //搜索 function changesearch(){ } //單個(gè)刪除 function del(id,mid,iscid){ if(confirm("您確定要?jiǎng)h除嗎?")){ } } //全選 $("#checkall").click(function(){ $("input[name='id[]']").each(function(){ if (this.checked) { this.checked = false; } else { this.checked = true; } }); }) //批量刪除 function DelSelect(){ var Checkbox=false; $("input[name='id[]']").each(function(){ if (this.checked==true) { Checkbox=true; } }); if (Checkbox){ var t=confirm("您確認(rèn)要?jiǎng)h除選中的內(nèi)容嗎?"); if (t==false) return false; $("#listform").submit(); } else{ alert("請(qǐng)選擇您要?jiǎng)h除的內(nèi)容!"); return false; } } </script> </body> </html>
提交重置程式碼