-
Notifications
You must be signed in to change notification settings - Fork 0
/
mypage.php
54 lines (50 loc) · 1.47 KB
/
mypage.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
require_once("config.php");
require_once("check_login.php");
include("header.php");
?>
<?php
if ($_COOKIE['user_id'] == 'admin') {
exit("admin can't see message list");
}
$stmt = $pdo->prepare("select * from supports where user_id=?");
$stmt->execute(array($_COOKIE['user_id']));
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<section class="section">
<div class="container">
<h1 class="title">Mypage</h1>
<hr>
<div class="columns">
<div class="column is-10 is-offset-1">
<div class="box">
Last view: <?php echo $_COOKIE['last_view_title']; ?><br />
My Id: <?php echo $_COOKIE['user_id']; ?><br /><br />
<table class="table">
<thead>
<tr>
<th><abbr title="Position">Pos</abbr></th>
<th>Title</th>
</tr>
</thead>
<tbody>
<?php
foreach ($rows as $r) {
?>
<tr>
<th><?php echo $r['idx']; ?></th>
<td><a href='read.php?idx_token=<?php echo $r['idx_token']; ?>'><?php echo $r['title']; ?></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
<?php
include("footer.php");
?>