<?php session_start();?><html><head>
<title>更新會議檔案</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body><div>
 <?php
 include("server1.php");//主機連線資訊   
 if(!isset($_GET['meetingid']))
 {
  ?>
  <script>
    alert('請查察閱清單');
    location.href="view.php";
  </script>
  <?php
  exit();   
 }  
 if($_GET['meetingid']=="")
 {
  ?>
  <script>
    alert('沒有資料');
    location.href="view.php";
  </script>
  <?php
  exit();   
 }  
  $meetingid=$_GET['meetingid']; 
  $_SESSION['meetingid']=$_GET['meetingid'];
  if ($stmt = $mysqli2->prepare("select years,num,search1,docutitle from document where meetingid = ? " )) {
   $stmt->bind_param("i", $meetingid);
   $stmt->execute();
   $stmt->bind_result($col1,$col2,$col3,$col4);         
  while ($stmt->fetch())
   {
    ?>
<form  action="updata3.php" method="post" 
       enctype="multipart/form-data">
 請輸入年份(西元年份)：
 <input type="number" name="years" 
        value="<?php echo $col1; ?>" required><br>
 請輸入月份：
 <input type="number" name="months" 
        value="<?php echo $col2; ?>" required><br>
 請輸入文件主題：
 <input type="text" name="docutitle" 
        value="<?php echo $col4; ?>" required ><br> 
 請輸入關鍵字/全文(提供檢索查詢)：<br>
 <textarea name="keywords" cols="50" rows="10" >
 <?php echo $col3; ?></textarea> <p>
 選擇檔案： <input name="userfile" type="file"><br>
 (如果不提供檔案則檔案不做更新，請查閱之前
 <a href="report_show.php?
 meetingid=<?php  echo $meetingid; ?>&num=<?php  echo $col2; ?>"
 target="_blank">舊的檔案：<?php echo $col4; ?></a> )<br>
 <input type="submit" value="送出">
 <input type="reset" value="取消">
 </form>              
     <?php       
     }  
    $stmt->close();	  
   }
  $mysqli2->close();	                              
 ?>        
</div></body>
</html>