白云图书馆管理系统 —— 课程作业项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

64 lines
3.4 KiB

<!-- Content -->
<div class="flex flex-1 flex-col md:px-6 pt-10" id="content">
<!-- Title -->
<div class="px-6 md:px-0 flex justify-between items-center -order-1">
<div>
<h2 class="font-normal">用户管理</h2>
</div>
<a href="/admin/add-user?page=<?=$page?>" class="no-underline bg-indigo-dark hover:bg-indigo-darker text-white text-sm py-2 px-4 rounded-full transition-normal hover:shadow hover:translate-y-1 active:translate-y-1 focus:outline-none">添加用户</a>
</div>
<div class="px-6 md:px-0 mt-4 md:flex flex-wrap order-1 md:-order-1 md:shadow-md">
<div class="p-4 px-6 w-full md:w-1/2 rounded md:rounded-r-none bg-white shadow-md md:shadow-none">
<h4>用户列表</h4>
<table class="mt-4 w-full">
<thead class="p-2 text-sm leading-loose border-b text-indigo">
<tr>
<td>用户名</td>
<td class="hidden js-mobile-hidden">性别</td>
<td class="text-center hidden js-mobile-hidden">生日</td>
<td class="text-center hidden js-mobile-hidden">身份证</td>
<td class="text-right hidden js-mobile-hidden">借书配额</td>
<td class="text-right">用户类型</td>
<td class="text-right">操作</td>
</tr>
</thead>
<tbody class="p-2 leading-loose text-sm">
<?php if (isset($users[0]['uid'])) {
foreach ($users as $user) { ?><tr class="border-b">
<td class="py-2"><?=$user['username']?></td>
<td class="py-2 hidden js-mobile-hidden"><?=$user['sex']?'男':'女'?></td>
<td class="py-2 text-center hidden js-mobile-hidden"><?=$user['birthday']?></td>
<td class="py-2 text-center hidden js-mobile-hidden"><?=$user['id_card']?></td>
<td class="py-2 text-right hidden js-mobile-hidden"><?=$user['borrow_num']?></td>
<td class="py-2 text-right"><?=$user['type']?'管理员':'普通用户'?></td>
<td class="py-2 text-right">
<a href="/admin/update-user?page=<?=$page?>&uid=<?=$user['uid']?>" class="no-underline bg-indigo-dark hover:bg-indigo-darker text-white text-sm px-1 transition-normal hover:shadow hover:translate-y-1 active:translate-y-1 focus:outline-none">更新</a>
<a href="/admin/delete-user?page=<?=$page?>&uid=<?=$user['uid']?>" class="no-underline bg-magenta-dark hover:bg-magenta-darker text-white text-sm px-1 transition-normal hover:shadow hover:translate-y-1 active:translate-y-1 focus:outline-none">删除</a>
</td>
</tr>
<?php }
} else { ?>
<tr class="border-b">
<td class="py-2">没有用户</td>
</td>
<?php } ?>
</tbody>
</table>
</div>
<div class="w-full md:w-1/2 p-4 md:pt-12 md:pl-1 mt-4 md:mt-0 lg:pt-12 lg:pl-8 rounded md:rounded-r-none bg-white shadow-md md:shadow-none">
<div class="flex">
<div class="w-1/2">
<p class="text-indigo text-sm p-2">用户数量</p>
<p class="font-medium text-sm pl-2"><?=$count?></p>
</div>
<div class="w-1/2">
<p class="text-indigo text-sm p-2">借出书籍</p>
<p class="font-medium text-sm pl-2"><?=$stock?></p>
</div>
</div>
<div class="pt-6">
<?php $path = '/admin/users'; require(APP_ROOT.'/src/template/admins/page_switch.php'); ?>
</div>
</div>
</div>
</div>