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
2.2 KiB

<?php
include "header.php";
$id = isset($_GET['id']) ? $_GET['id'] : die('ERROR: Record ID not found.');
$db_query = "select * from notice where id = '$id'";
$data = mysqli_query($link, $db_query);
// 進入等於已讀
// $sql = "
// UPDATE notice SET
// haveread = 1
// WHERE id = '$id'
// ";
// mysqli_query($link, $sql);
foreach ($data as $data) :
?>
<style>
.nextline {
width: 100%;
height: 0;
}
</style>
<script>
$(function() {
$('#btn').click(function() {
history.go(-1);
});
});
</script>
<div class="container">
<form class="form-inline" method="post" action="#">
<div>
<label for="title">標題</label>
<input type="text" name="title" disabled id="title" size="30" maxlength="25" value="<?php echo $data['title']; ?>" required>
</div>
<div class="nextline"></div>
<div>
<label for="content">內容</label><br>
<div>
<?php echo nl2br(str_replace("{token_link}", $token_link, $data['content'])); ?>
<?php if(!empty($data['url'])): ?>
<br />
<a href="./<?php echo $data['url'] ?>&<?php echo $token_link; ?>">前往查看</a>
<?php endif; ?>
</div>
<!-- <textarea class="form-control2" name="content" id="content" rows="8" cols="100" required><?php echo $data['content']; ?></textarea> -->
</div>
<div class="nextline"></div>
<div>
<br>
<a class="btn btn-info " type="button" name="btn" id="btn">回上頁</a>
<a href="notice-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-info " onClick="return confirm('確認關閉通知嗎?')">
已讀
</a>
</div>
<input type="hidden" name="id" value="<?php echo $id; ?>">
</form>
</div>
<?php
endforeach;
include "footer.php";
?>