今天要来弄,进到审核画面所需要的东西
资料表详见:
https://ithelp.ithome.com.tw/articles/10270360
先把欲审核之学生资料列印出来(用昨天建立的session)
https://ithelp.ithome.com.tw/articles/10273817
<td>
<?php
if(isset($_SESSION['auth2']))
{
echo $_SESSION['auth_user2']['user_year2'];//学年
}
?>
<?php
if(isset($_SESSION['auth2']))
{
echo $_SESSION['auth_user2']['user_role2'];//学制
}
?>
</td>
<td>
<?php
if(isset($_SESSION['auth2']))
{
echo $_SESSION['auth_user2']['user_id2']; //学号(帐号)
}
?>
</td>
<td>
<?php
if(isset($_SESSION['auth2']))
{
echo $_SESSION['auth_user2']['staff_name2']; //姓名
}
?>
</td>
再来,做个返回按钮(虽然浏览去有"上一页"可以用,但还是做一个按钮顺便把SESSION清掉比较好)
<form action="" method="POST" >
<button type="submit" name="not_check2" >
不储存返回
</button>
</form>
<?php
if(isset($_POST['not_check2']))
{
header("Location: tea_check.php");
unset($_SESSION['auth2']);
unset($_SESSION['auth_user2']);
exit(0);
}
?>
再来是文件审核,因为弹跳视窗会出现BUG(只会修改ID最大的),所以还是用a标签来做。
(某种逃避问题的感觉xD)
先列印文件(只列出两个栏位,其他栏位方法差不多,看情况在自己调整即可)
<?php
if(isset($_SESSION['auth2']))
{
//用 SESSION 来"记录"现在ID是哪个
$idd = $_SESSION['auth_user2']['user_id2'];
//搜寻符合该学生之ID的文件
$query = "SELECT * FROM document WHERE id = '$idd' ";
}
$query_run = mysqli_query($con,$query);
?>
<table>
<thead>
<tr style="text-align:center;">
<th>文件状态</th>
<th>审核</th>
</tr>
</thead>
<tbody>
<form action="" method="POST">
<?php
if(mysqli_num_rows($query_run) > 0)
{
foreach($query_run as $row)
{
?>
<tr style="text-align:center; ">
<td style="font-size: 20px;">
<?php
//表【document】中,用来表示文件是否通过的栏位(INT 长度1),
//需藉由DS.php来做修改
if($row['doc_pass'] =='1')
{
echo '<font color="BLUE" style="font-weight:bold;">通过</font>';
}
elseif($row['doc_pass'] =='0')
{
echo '<font color="RED" style="font-weight:bold;">不通过</font>';
}
else
{
echo '<font color="GRAY" style="font-weight:bold;">
审核中
</font>';
}
?>
</td>
<td style="font-size: 20px;">
<!--明天再写 DS.php的内容-->
<a href="DS.php?DS=<?php echo $row['doc_id'];?>"
class="badge badge-info">
审核档案
</a>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
忘记之前有没有讲,那就是 echo 的语法,
如果用单引号>> echo''; 里面就只能用双引号(就像上面的内容);反之,外双内单。
那都想用单引或双引,那要用跳脱字元【\】,用法如下
echo '<font color=\'GRAY\'></font>';
("每个引号前面"都要加反斜线)
明天接续DS.php的内容(审核文件按钮)。
今天先这样,下次见。
>>: Day15 [实作] 使用 Socket.io 建立聊天室
What is management? 如果有人问你,「一个主管的工作到底是什麽?」,你会怎麽说? ...
“He is terribly afraid of dying because he hasn’t...
前言 上次我们提到原始文本往往夹带大量无意义的字符,於是我们利用了正则表达式来清理资料。然而此时的文...
前言 这篇主要以抓「台湾证券交易所」的「除权除息计算结果表」为主 取得「除权除息计算结果表」CSV ...
前言 在 ES6 中新增了 Class(类别),可以视为建构函式的语法糖,究竟是裹上怎样的糖衣呢?让...