-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.txt
executable file
·60 lines (59 loc) · 4.34 KB
/
test.txt
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
<ul>
<li class="review-comments-list-odd-layer">
<span class="review-comment-author"><b>John Doe</b> · <a class="review-comments-comment-button" href="javascript:void(0);" onclick="javascript:openCommentInput(this, false);" >Comment</a></span>
<span class="review-comment-text">Sloj 1 koji ima popunjene childove</span>
<div class="review-comments-input">
<span>Comment Text: </span><br>
<textarea rows="4" cols="50"></textarea>
<button href="javascript:void(0);" onclick="javascript:submitReviewComment(this, '<?php echo $_review->getId() ?>', '1');" class="action submit primary">Submit</button>
</div>
<ul>
<li class="review-comments-list-even-layer">
<span class="review-comment-author"><b>John Doe</b> · <a class="review-comments-comment-button" href="javascript:void(0);" onclick="javascript:openCommentInput(this, false);" >Comment</a></span>
<span class="review-comment-text">Sloj 1,1 koji ima popunjene childove</span>
<div class="review-comments-input">
<span>Comment Text: </span><br>
<textarea rows="4" cols="50"></textarea>
<button href="javascript:void(0);" onclick="javascript:submitReviewComment(this, '<?php echo $_review->getId() ?>', '1');" class="action submit primary">Submit</button>
</div>
<ul>
<li class="review-comments-list-odd-layer">
<span class="review-comment-author"><b>John Doe</b> · <a class="review-comments-comment-button" href="javascript:void(0);" onclick="javascript:openCommentInput(this);" >Comment</a></span>
<span class="review-comment-text">Sloj 1,1,1 koji ima popunjene childove</span>
</li>
<li class="review-comments-list-odd-layer">
<span class="review-comment-author"><b>John Doe</b> · <a class="review-comments-comment-button" href="javascript:void(0);" onclick="javascript:openCommentInput(this);" >Comment</a></span>
<span class="review-comment-text">Sloj 1,1,2 koji ima popunjene childove</span>
</li>
</ul>
</li>
<li class="review-comments-list-even-layer">
<span class="review-comment-author"><b>John Doe</b> · <a class="review-comments-comment-button" href="javascript:void(0);" onclick="javascript:openCommentInput(this);" >Comment</a></span>
<span class="review-comment-text">Sloj 1,2 koji ima popunjene childove</span>
</li>
<li class="review-comments-list-even-layer">
<span class="review-comment-author"><b>John Doe</b> · <a class="review-comments-comment-button" href="javascript:void(0);" onclick="javascript:openCommentInput(this, false);" >Comment</a></span>
<span class="review-comment-text">Sloj 1,3 koji ima popunjene childove</span>
</li>
</ul>
</li>
<li class="review-comments-list-odd-layer">
<span class="review-comment-author"><b>John Doe</b> · <a class="review-comments-comment-button" href="javascript:void(0);" onclick="javascript:openCommentInput(this);" >Comment</a></span>
<span class="review-comment-text">Sloj 1,2 koji ima popunjene childove</span>
</li>
<li class="review-comments-list-odd-layer">
<span class="review-comment-author"><b>John Doe</b> · <a class="review-comments-comment-button" href="javascript:void(0);" onclick="javascript:openCommentInput(this);" >Comment</a></span>
<span class="review-comment-text">Sloj 1,3 koji ima popunjene childove</span>
</li>
</ul>
---------------------------------------------------------
public function getReviewComments($reviewId, $storeId)
{
$connection = $this->getConnection();
$query = "SELECT l1.parent, l1.text AS lev1, l2.parent, l2.text as lev2, l3.parent, l3.text as lev3";
$query .= " FROM " . $this->getMainTable() . " AS l1";
$query .= " LEFT JOIN " . $this->getMainTable() . " AS l2 ON l2.parent = l1.comment_id";
$query .= " LEFT JOIN " . $this->getMainTable() . " AS l3 ON l3.parent = l2.comment_id";
$query .= " WHERE l1.review_id = '". $reviewId . "' AND l1.store_id = '" . $storeId . "' AND l1.parent IS NULL";
return $connection->fetchAll($query);
}