-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomment.php
More file actions
173 lines (131 loc) · 5.71 KB
/
comment.php
File metadata and controls
173 lines (131 loc) · 5.71 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?
@session_start();
require_once "service/service.php";
require_once "creation/creation.init.php";
$data = $ojc->LoadMatch($_GET['matchID']);
$cnt = $ojc->LoadCount('comment','matchID',$_GET['matchID']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>แสดงความคิดเห็น</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" href="css/bootstrap.comment.css" media="screen">
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a href="javascript:;" class="navbar-brand">ความคิดเห็น [ <font color="#E8A317"><?php echo number_format($cnt);?></font> รายการ ]</a>
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse" id="navbar-main">
<ul class="nav navbar-nav">
</ul>
<ul class="nav navbar-nav navbar-right">
<?php if($_SESSION[MEMBER]['LOGIN'] == "ON") {?>
<li><a href="comment.php?matchID=<?php echo $_GET['matchID'];?>&userID=<?php echo $_SESSION[MEMBER]['DATA']['code'];?>" target="_self">ความคิดเห็นของ <font color="#4CC417"><?php echo $_SESSION[MEMBER]['DATA']['username'];?></font></a></li>
<li><a href="comment.php?matchID=<?php echo $_GET['matchID'];?>" target="_self">ดูความคิดเห็นทั้งหมด</a></li>
<?php } ?>
</ul>
</div>
</div>
</div>
<div class="container">
<!-- Tables
================================================== -->
<div class="bs-docs-section">
<br/><br/><br/>
<div class="row">
<div class="col-xs-6">
<div class="alert alert-dismissible alert-success" align="center">
<h3><?php echo $data['HomeName'];?></h3>
</div>
</div>
<div class="col-xs-6">
<div class="alert alert-dismissible alert-warning" align="center">
<h3><?php echo $data['AwayName'];?></h3>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<h5 class="text-success" align="center"><?php echo $data['LeagueEngName'];?> - <?php $new_time = strtotime($data['Date']); echo date('H:i', $new_time);?> น.</h5>
<?php if($_SESSION[MEMBER]['LOGIN'] == "ON") {?>
<p class="bs-component">
<a href="addComment.php?matchID=<?php echo $_GET['matchID'];?>" class="btn btn-primary pull-right" >เพิ่มความคิดเห็น</a>
</p><br/><br/>
<?php } ?>
<div class="bs-component" style="padding-top:10px;">
<table class="table table-striped table-hover ">
<thead>
<tr>
<th>#</th>
<th>ความเห็น</th>
<th width="20%">วัน/เวลา</th>
<th width="10%">สมาชิก</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($_GET['userID'])){
$where = ' AND memberID = "'.$_SESSION[MEMBER]['DATA']['code'].'" ';
}
$sql="
SELECT
*
FROM
comment
WHERE
matchID = '".$_GET['matchID']."'
$where
ORDER BY
code
ASC
;";
// echo $sql;
$query=mysql_query($sql);
$loop ='';
while($row=mysql_fetch_assoc($query)){
$loop++;
?>
<tr>
<td><?php echo $loop;?></td>
<td><?php echo $row['msg'];?>
<?php if($_SESSION[MEMBER]['DATA']['code'] == $row['memberID']) { ?>
<br/><a href="editComment.php?id=<?php echo $row['code'];?>&matchID=<?php echo $_GET['matchID'];?>" class="btn btn-primary btn-xs">แก้ไขข้อความ</a> <a href="delcomment.php?id=<?php echo $row['code'];?>&matchID=<?php echo $_GET['matchID'];?>" onClick="return confirm('ยืนยันการลบข้มูล ?')" class="btn btn-danger btn-xs">ลบข้อความ</a>
<?php } ?>
</td>
<td class="text-success"><?php echo DateTimeDisplay($row['date_create'],9);?></td>
<td class="text-warning"><?php echo $row['user_create'];?></td>
</tr>
<?php
}
mysql_free_result($query);
?>
<tr>
</tbody>
</table>
</div><!-- /example -->
</div>
</div>
</div>
<footer>
<div class="row">
<div class="col-lg-12">
<ul class="list-unstyled">
<li class="pull-right"><a href="#top">Back to top</a></li>
</ul>
</div>
</div>
</footer>
</div>
</html>