<?php session_start(); ?><!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<title>文件管理系統</title>
</head><body>
<table width="90%">
<tr><td align="left"><?php  
include("server1.php");
include("selyear.php");
if(isset($_GET['years']))
 $years=$_GET['years'];
else
 {
  $dateTime2 = new DateTime("now", new DateTimeZone('Asia/Taipei'));
  $years=$dateTime2->format("Y");             
 }                      
 ?></td><td>
 <form action="search1.php" method="post">
 搜尋<?php echo $years."年"; ?>
 關鍵字：<input type="search" name="search1">
 <input type="submit"><input type="reset">
 </form></td></tr></table>          
文件檔案紀錄：<?php  echo $years; ?>年
<a href="updata.php">新增文件記錄</a>
<?php 
if ($stmt = $mysqli2->prepare("select meetingid,num,docutitle from"
  . " document where years = ? " )) {
 $stmt->bind_param("i", $years);
 $stmt->execute();
 $stmt->bind_result($col1,$col2,$col3);
 ?>
<table>
<?php   
 $stmt->store_result();
 if($stmt->num_rows<1)
  die('<tr><td colspan="3">==沒有符合條件的文件資料==</td></tr></table>');
 else
  echo "<tr><td>期數</td><td>連結</td><td>管理</td></tr>";
 while ($stmt->fetch())
  {    ?><tr><td>
<?php  echo $col2; ?></td><td>
  <a href="report_show.php?meetingid=<?php  echo $col1; ?>&num=<?php  echo $col2; ?>" 
     target="_blank">
   <?php echo $col3;?></a></td><td>
  <a href="reportedit.php?meetingid=<?php  echo $col1; ?>">編輯</a>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <a href="reportdel.php?meetingid=<?php  echo $col1; ?>" 
  onClick="if(!confirm('注意：刪除後，無法救回喔！請再次確定是否刪除？'))
      {return false;}">刪除</a><br>						   
 </td></tr><?php
   } ?>
  </table><?php
 $stmt->close();	  
 }
 $mysqli2->close();    ?>            
</body></html>