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
|
<?php
$comments = Comment::whereRaw("deleted=? and status=?", array(0, 1))->orderBy('sort', 'ASC')->get();
if (isset($first_site)){ $comments = Comment::whereRaw("deleted=? and status=? and location_id=?", array(0, 1, $first_site['location_id']))->orderBy('sort', 'ASC')->get(); }
if (isset($_GET['id'])){ $id = $_GET['id']; $selected_shop = Shop::whereRaw("deleted=? and status=? and id=?", array(0, 1, $id))->orderBy('sort', 'ASC')->first(); $comments = Comment::whereRaw("deleted=? and status=? and location_id=?", array(0, 1, $selected_shop['location_id']))->orderBy('sort', 'ASC')->get(); }
?> <div class="commentSection" style="background-image:url(../images/background/commentBG.jpg)"> <div class="container"> <div class="row"> <div class="CommentTitle"> <h1 class="headTitle"><img src="../images/title/whiteLeft.png">口碑<img src="../images/title/whiteRight.png"></h1> </div> <div id="myCarousel" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators"> <?php $counter = 0; foreach ($comments as $comment) { ?> <li data-target="#myCarousel" data-slide-to="<?= $counter ?>" <?php if($counter == 0) echo 'class="active"'; ?>></li> <?php $counter++;
} ?> </ol>
<div class="carousel-inner">
<?php $counter = 0; foreach ($comments as $comment) {
$profile = Image::whereRaw("imageable_type=? and imageable_id=? and deleted=?", array('Comment', $comment['id'], 0))->orderBy('sort', 'ASC')->first();
$comment_location = Location::whereRaw("deleted=? and status=? and id=?", array(0, 1, $comment['location_id']))->first();
$location_link = "../".$current_directory."/location.php?id=".$comment_location['id']; ?>
<div class="item <?php if($counter == 0) echo 'active'; ?>"> <div class="col-md-12" id="Comment"> <img src="<?= $profile['path'].$profile['src'] ?>" class="img-circle"> <br> <div class="commentIcon"> <img src="../images/comment/commentIcon.png"> </div> <div class="commentPar"> <?= nl2br(_h($comment['desc_tc'])) ?> </div>
<div class="commentBy"> <img src="../images/comment/img-1.png"> <img src="../images/comment/img-2.png"> <?= _h($comment['name_tc']) ?> , FROM <a href="<?= $location_link ?>"><?= _h($comment_location['name_en']) ?></a> </div>
</div> </div>
<?php $counter++;
} ?> </div>
</div> </div> </div> </div>
|