-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblogContent.php
executable file
·346 lines (310 loc) · 13.9 KB
/
blogContent.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
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
<?php
try {
//先取得planNo
require_once("connectDb.php");
$planNo = $_REQUEST['planNo'];
//內容
$sql="SELECT * FROM `plan` as p JOIN `member` as m ON p.memNo = m.memNo where planNo=:planNo";
$blogContent = $pdo -> prepare($sql);
$blogContent -> bindColumn("planPhoto",$planPhoto);
$blogContent -> bindColumn("planList",$planList);
$blogContent -> bindColumn("noteName",$noteName);
$blogContent -> bindColumn("noteContent",$noteContent);
$blogContent -> bindColumn("noteLikeTime",$noteLikeTime);
$blogContent -> bindColumn("noteMsgTime",$noteMsgTime);
$blogContent -> bindColumn("noteDate",$noteDate);
$blogContent -> bindColumn("memNo",$memNo);
$blogContent -> bindColumn("memId",$memId);
$blogContent -> bindColumn("memImg",$memImg);
$blogContent ->bindValue(':planNo',$planNo);
$blogContent ->execute();
//留言
// $sqlMsg="SELECT * FROM `noteComment` n join `member` m on n.memNo = m.memNo where n.planNo = :planNo";
// $msg = $pdo -> prepare($sqlMsg);
// $msg ->bindColumn('noteCommTit',$noteCommTit);
// $msg ->bindColumn('noteCommContent',$noteCommContent);
// $msg ->bindColumn('noteCommDate',$noteCommDate);
// $msg -> bindColumn("memId",$memId);
// $msg -> bindColumn("memImg",$memImg);
// $msg ->bindValue(':planNo',$planNo);
// $msg ->execute();
} catch (PDOException $e) {
echo "錯誤 : ", $e -> getMessage(), "<br>";
echo "行號 : ", $e -> getLine(), "<br>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/svg_style.css">
<link rel="stylesheet" href="css/blogContent.css">
<link rel="stylesheet" href="css/header.css">
<link rel="stylesheet" href="css/robot.css">
<link rel="stylesheet" href="css/bee.css">
<link rel="Shortcut Icon" type="image/x-icon" href="images/new/favicon.png" />
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/hbgClick.js"></script>
<!-- <script src="js/blogContent.js"></script> -->
<!-- <script src="js/copyLink.js"></script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/parallax/3.1.0/parallax.min.js"></script>
<title>森存者|手札內頁</title>
</head>
<body>
<!-- header -->
<!-- <?php include 'header.php';?> -->
<!-- <?php require_once("header.php");?> -->
<!-- header -->
<div class="wrap">
<!-- bg fly -->
<div id="scene1">
<div data-depth="0.5" class="fly1"><img src="images/blog/drop.png" alt="蝴蝶"></div>
</div>
<script>
parallaxInstance = new Parallax( document.getElementById( "scene1" ));
</script>
<?php
while($blogContent->fetch(PDO::FETCH_ASSOC)){
?>
<div class="blogContent">
<div class="blogContent-heading">
<h2><?php echo $noteName;?></h2>
</div>
<div class="blogContent-info">
<div class="blogContent-author">
<!-- <img src="images/blog/big_head1.png" alt="大頭貼"> -->
<img src="images/member/<?php echo $memImg;?>" alt="大頭貼">
<span><?php echo $memId;?></span>
<span><?php echo $noteDate;?></span>
</div>
<!-- <div class="blogContent-share">
<input type="text" id="copyurl" value="blogContent.php?planNo=<?php echo $planNo;?>" >
<img src="images/blog/Share.png" alt="分享" id="copybtn">
</div> -->
</div>
<script>
var copybtn=document.getElementById("copybtn");
copybtn.addEventListener("click",function(){
var copyurl = document.getElementById("copyurl");
copyurl.select();
document.execCommand("copy");
document.getElementById("copyok").style.display="inline-block";
setTimeout(function(){ document.getElementById("copyok").style.display="none"; }, 3000);
});
</script>
<!-- 內文 -->
<div class="blogContent-photo">
<!-- <img src="images/event/Best-Survival-Schools.jpg" alt="手札圖片"> -->
<img src="images/plan/<?php echo $planPhoto;?>" alt="手札圖片">
</div>
<div class="blogContent-wrap">
<div class="blogContent-content">
<p><?php echo $noteContent;?></p>
</div>
<div class="blogContent-graphic">
<!-- event -->
<div class="blogContent-event-wrap">
<?php
$eventArr = explode(",",$planList);
for($i=0;$i<count($eventArr);$i++){
$sqlevent ="SELECT * FROM `event` where entNo =$eventArr[$i]";
$event = $pdo -> query($sqlevent);
$event -> bindColumn("entNo",$entNo);
$event -> bindColumn("entName",$entName);
$event -> bindColumn("entPhoto",$entPhoto);
$event -> bindColumn("entDate",$entDate);
$event -> bindColumn("entPrice",$entPrice);
$event -> bindColumn("entSco",$entSco);
$event -> bindColumn("entSurVal",$entSurVal);
$event -> bindColumn("entHanVal",$entHanVal);
$event -> bindColumn("entPcVal",$entPcVal);
$event -> bindColumn("entLoc",$entLoc);
$event ->fetch(PDO::FETCH_ASSOC)
?>
<div class="blogContent-event">
<input type="hidden" value="<?php echo $entNo;?>" class="eventNo" name="eventNo">
<!-- <img src="images/event/Basic-Survival-Skills-Every-Man-Should-Know.jpg" alt="活動圖片"> -->
<img src="images/event/<?php echo $entPhoto;?>" alt="活動圖片">
<div class="blogContent-event-info">
<h3 class="event-name"><?php echo $entName;?></h3>
<span class="event-hr"><?php echo $entDate;?>小時</span>
<div class="event-value">
<table class="event-value-table">
<tr>
<td><img src="images/blog/value_family.png" alt="親子值"></td>
<td><?php echo $entPcVal;?></td>
<td><img src="images/blog/value_handmade.png" alt="手作值"></td>
<td><?php echo $entHanVal;?></td>
<td><img src="images/blog/value_survive.png" alt="生存值"></td>
<td><?php echo $entSurVal;?></td>
</tr>
</table>
</div>
<div class="avgScore">
<span>平均</span>
<?php
for($j=0;$j<$entSco;$j++){
?>
<img src="images/blog/fire.png" alt="評分火數">
<?php
}
?>
</div>
<div class="event-price">$<?php echo $entPrice;?></div>
</div>
</div>
<!-- <script>
var globalVariable = <?php echo $entLoc;?>
</script> -->
<?php
}
?>
</div>
<!-- 活動座標 -->
<?php
$sql2 = "SELECT entNo,entLoc FROM `event` where entNo in ($planList)";
$entLoc = $pdo->query($sql2);
?>
<script>
var globalVariable = <?php echo json_encode( $entLoc -> fetchAll());?>
</script>
<h3 class="entHeading">活動座標</h3>
<div class="blogContent-location" id="mapboard">
<img src="images/blog/island-map.png" alt="地圖" class="map">
</div>
</div>
</div>
<div class="blogContent-btnContainer">
<div class="blogLikeBtn">
<img src="images/blog/愛心.png" class="like" id="like<?php echo "|".$planNo?>">
<span id="likeNum<?php echo $planNo;?>"><?php echo $noteLikeTime;?></span>
</div>
<?php
// $sqlMsg = "SELECT COUNT(noteCommNo) FROM noteComment WHERE noteCommStatus=1 AND planNo = $planNo";
// $noteMsgTime = $pdo -> query($sqlMsg);
$con =mysqli_connect("localhost","cd106g2","cd106g2","cd106g2");
$sqlMsg = "SELECT COUNT(noteCommNo) FROM noteComment WHERE noteCommStatus=1 AND planNo = $planNo";
$result = mysqli_query($con,$sqlMsg);
$noteMsgTime = mysqli_fetch_array($result);
?>
<div class="blogCommentBtn">
<img src="images/blog/留言.png" alt="comment">
<span class="commNum" id="commNum"><?php echo $noteMsgTime[0];?></span>
</div>
<button id="addCheck">加入我的行程</button>
<div id="addPlanArea" style="display:none;">
<div id="close"></div>
<h2>加入的行程將會存入會員中心</h2>
<form action="addPlan.php" method="post">
<input type="text" name="planName" placeholder="輸入行程名稱" id="addplanName">
<input type="hidden" name="planList" value="<?php echo $planList?>">
<input type="hidden" name="planPhoto" value="cover_family_big.jpg">
<br>
<input type="submit" value="加入行程" id="planSub">
</form>
</div>
</div>
<!-- </div> -->
<?php
}
?>
<script>
$("#close").click(function(){
$("#addPlanArea").hide();
});
</script>
<!-- bg fly -->
<div id="scene2">
<div data-depth="0.5" class="fly1"><img src="images/blog/fly1.gif" alt="蝴蝶"></div>
</div>
<script>
parallaxInstance = new Parallax( document.getElementById( "scene2" ));
</script>
<div class="comment">
<?php
$sqlMsg="SELECT * FROM `noteComment` n join `member` m on n.memNo = m.memNo where n.planNo = :planNo and noteCommStatus = 1 order by noteCommNo desc";
$msg = $pdo -> prepare($sqlMsg);
$msg ->bindColumn('noteCommNo',$noteCommNo);
$msg ->bindColumn('noteCommTit',$noteCommTit);
$msg ->bindColumn('noteCommContent',$noteCommContent);
$msg ->bindColumn('noteCommDate',$noteCommDate);
$msg -> bindColumn("memNo",$memNo);
$msg -> bindColumn("memId",$memId);
$msg -> bindColumn("memImg",$memImg);
$msg ->bindValue(':planNo',$planNo);
$msg ->execute();
if($noteCommNo = null){
echo '目前沒有留言,快去下面留言吧';
}
else{
while($msg ->fetch(PDO::FETCH_ASSOC)){
?>
<div class="comment-item">
<div class="comment-author">
<!-- <img src="images/blog/big_head2.png" alt="大頭貼"> -->
<img src="images/member/<?php echo $memImg;?>" alt="大頭貼">
<div><?php echo $memId;?></div>
</div>
<div class="comment-SendContent">
<div><?php echo $noteCommContent;?></div>
<div class="comment-date"><?php echo $noteCommDate;?></div>
</div>
<!-- <a href="notecommReport.php?planNo=<?php echo $planNo;?>¬eCommNo=<?php echo $noteCommNo;?>"><img src="images/game/alert.png" alt="檢舉" class="commentRep"></a> -->
<img src="images/game/alert.png" alt="檢舉" class="commentRep" id="commentRep<?php echo "|".$noteCommNo?>">
</div>
<?php
}}
?>
<div class="comment-input">
<form action="noteComment.php" method="get" id="noteCommentForm">
<input type="hidden" value="<?php echo $planNo;?>" name="planNo">
<textarea name="noteCommContent" placeholder="輸入你的留言" maxlength="250"></textarea>
<button id="commSubmit" type="submit" form="noteCommentForm">留言</button>
</form>
</div>
</div>
<div class="blogContent-seemore">
<!-- bg fly -->
<div id="scene3">
<div data-depth="0.5" class="fly1"><img src="images/blog/fly1.gif" alt="蝴蝶"></div>
</div>
<script>
parallaxInstance = new Parallax( document.getElementById( "scene3" ));
</script>
<!-- <button>加入我的行程</button> -->
<button id="readMoreBlog"><a href="blog.php"> 看看其他手札</a></button>
</div>
</div>
</div>
<!-- event lightbo -->
<div id="infoContainer"></div>
<!-- copylink lightbox -->
<div id="copyok">
<p>複製成功3秒後關閉。</p>
</div>
<div class="reportArea" id="reportArea">
<div id="closeRep"></div>
<h2>檢舉原因</h2>
<form action="notecommReport.php" method="get" id="noteCommReportForm">
<input type="hidden" value="" name="noteCommNo" id="hiddennoteCommNo">
<textarea id="noteCommRepReason" name="noteCommRepReason"cols="30" rows="7" maxlength="150" placeholder="輸入檢舉原因"></textarea>
<button id="repSubmit" type="submit" form="noteCommReportForm">確認送出</button>
</form>
</div>
<!-- footer -->
<?php include 'footer.php';?>
<!-- footer -->
<script>
$("#closeRep").click(function(){
$(".reportArea").hide();
});
$(".commentRep").click(function(){
$(".reportArea").show();
});
</script>
</body>
<script src="js/blogContent.js"></script>
<script src="js/sessionPage.js"></script>
</html>