白云图书馆管理系统 —— 课程作业项目
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.
 
 
 
 

56 lines
2.7 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-category?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>ID</td>
<td>分类名</td>
<td class="text-right">操作</td>
</tr>
</thead>
<tbody class="p-2 leading-loose text-sm">
<?php if (isset($categories[0]['cid'])) {
foreach ($categories as $category) { ?><tr class="border-b">
<td class="py-2"><?=$category['cid']?></td>
<td class="py-2"><?=$category['name']?></td>
<td class="py-2 text-right">
<a href="/admin/update-category?page=<?=$page?>&cid=<?=$category['cid']?>" 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-category?page=<?=$page?>&cid=<?=$category['cid']?>" 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/books'; require(APP_ROOT.'/src/template/admins/page_switch.php'); ?>
</div>
</div>
</div>
</div>