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

65 lines
3.3 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 onClick="javascript:history.back(-1);" class="no-underline cursor-pointer 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="hidden js-mobile-hidden">ISBN</td>
<td class="text-center hidden js-mobile-hidden">受损程度</td>
<td class="text-center">借阅状态</td>
<td class="text-right">操作</td>
</tr>
</thead>
<tbody class="p-2 leading-loose text-sm">
<?php if (isset($books[0]['bid'])) {
foreach ($books as $book) { ?><tr class="border-b">
<td class="py-2"><?=$book['name']?></td>
<td class="py-2 hidden js-mobile-hidden"><?=$book['place']?></td>
<td class="py-2 hidden js-mobile-hidden"><?=$book['isbn']?></td>
<td class="py-2 text-center hidden js-mobile-hidden"><?=$book['health']?($book['health']==2?'破损':'中等'):'正常'?></td>
<td class="py-2 text-center"><?=$book['state']?'借出':'在馆'?></td>
<td class="py-2 text-right">
<?php if ($book['state']) { ?>
<a class="no-underline bg-grey text-white text-sm px-1 transition-normal hover:shadow hover:translate-y-1 active:translate-y-1 focus:outline-none">借阅</a>
<?php } else { ?>
<a href="/user/update-stock?page=<?=$page?>&sid=<?=$book['sid']?>&bid=<?=$book['bid']?>" 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>
<?php } ?>
</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"><?=$stock?></p>
</div>
<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>
<div class="pt-6">
<?php $path = '/admin/books'; require(APP_ROOT.'/src/template/admins/page_switch.php'); ?>
</div>
</div>
</div>
</div>