Skip to content

Commit

Permalink
Update user_list.php
Browse files Browse the repository at this point in the history
  • Loading branch information
zhblue committed Sep 29, 2024
1 parent 58f8ba7 commit 17e2f8c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions trunk/web/admin/user_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,18 @@
$sid = ($page-1)*$idsperpage;
$sql = "";
$gkeyword="";
$trash="";
if(isset($_GET['keyword']) && $_GET['keyword']!=""){
$gkeyword = $_GET['keyword'];
$keyword = "%$gkeyword%";
$sql = "SELECT `user_id`,`nick`,email,`accesstime`,`reg_time`,`ip`,`school`,`group_name`,`defunct` FROM `users` WHERE (user_id LIKE ?) OR (nick LIKE ?) OR (school LIKE ?) or (ip like ?) ORDER BY `user_id` DESC";
$result = pdo_query($sql,$keyword,$keyword,$keyword,$keyword);
}else if(isset($_GET['trash'])){
$trash="&trash";
$sql = "SELECT `user_id`,`nick`,email,`accesstime`,`reg_time`,`ip`,`school`,`group_name`,`defunct` FROM `users` where defunct='Y' ORDER BY `accesstime` DESC LIMIT $sid, $idsperpage";
$result = pdo_query($sql);
}else{
$sql = "SELECT `user_id`,`nick`,email,`accesstime`,`reg_time`,`ip`,`school`,`group_name`,`defunct` FROM `users` ORDER BY `accesstime` DESC LIMIT $sid, $idsperpage";
$sql = "SELECT `user_id`,`nick`,email,`accesstime`,`reg_time`,`ip`,`school`,`group_name`,`defunct` FROM `users` where defunct='N' ORDER BY `accesstime` DESC LIMIT $sid, $idsperpage";
$result = pdo_query($sql);
}
?>
Expand All @@ -48,6 +53,7 @@
<input type="text" name="keyword" value="<?php echo htmlentities($gkeyword,ENT_QUOTES) ?>" class="form-control search-query" placeholder="<?php echo $MSG_USER_ID.', '.$MSG_NICK.', '.$MSG_SCHOOL?>">
<button type="submit" class="form-control"><?php echo $MSG_SEARCH?></button>
</form>
<a href="user_list.php?trash">垃圾箱</a>
</center>

<center>
Expand Down Expand Up @@ -102,13 +108,13 @@
echo "<div style='display:inline;'>";
echo "<nav class='center'>";
echo "<ul class='pagination pagination-sm'>";
echo "<li class='page-item'><a href='user_list.php?page=".(strval(1))."'>&lt;&lt;</a></li>";
echo "<li class='page-item'><a href='user_list.php?page=".($page==1?strval(1):strval($page-1))."'>&lt;</a></li>";
echo "<li class='page-item'><a href='user_list.php?page=".(strval(1))."$trash'>&lt;&lt;</a></li>";
echo "<li class='page-item'><a href='user_list.php?page=".($page==1?strval(1):strval($page-1))."$trash'>&lt;</a></li>";
for($i=$spage; $i<=$epage; $i++){
echo "<li class='".($page==$i?"active ":"")."page-item'><a title='go to page' href='user_list.php?page=".$i."'>".$i."</a></li>";
echo "<li class='".($page==$i?"active ":"")."page-item'><a title='go to page' href='user_list.php?page=".$i."$trash'>".$i."</a></li>";
}
echo "<li class='page-item'><a href='user_list.php?page=".($page==$pages?strval($page):strval($page+1))."'>&gt;</a></li>";
echo "<li class='page-item'><a href='user_list.php?page=".(strval($pages))."'>&gt;&gt;</a></li>";
echo "<li class='page-item'><a href='user_list.php?page=".($page==$pages?strval($page):strval($page+1))."$trash'>&gt;</a></li>";
echo "<li class='page-item'><a href='user_list.php?page=".(strval($pages))."$trash'>&gt;&gt;</a></li>";
echo "</ul>";
echo "</nav>";
echo "</div>";
Expand Down

0 comments on commit 17e2f8c

Please sign in to comment.