forked from gburton/CE-Phoenix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reviews.php
90 lines (74 loc) · 3.43 KB
/
reviews.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
<?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2018 osCommerce
Released under the GNU General Public License
*/
require('includes/application_top.php');
require('includes/languages/' . $language . '/reviews.php');
$breadcrumb->add(NAVBAR_TITLE, tep_href_link('reviews.php'));
require('includes/template_top.php');
?>
<h1 class="display-4"><?php echo HEADING_TITLE; ?></h1>
<div class="contentContainer">
<?php
$reviews_query_raw = "select r.reviews_id, SUBSTRING_INDEX(rd.reviews_text, ' ', 20) as reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, p.products_image, r.customers_name from reviews r, reviews_description rd, products p, products_description pd where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and rd.languages_id = '" . (int)$languages_id . "' and reviews_status = 1 order by r.reviews_rating DESC";
$reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
if ($reviews_split->number_of_rows > 0) {
if ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')) {
?>
<div class="row">
<div class="col-sm-6 pagenumber d-none d-sm-block">
<span class="align-middle"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></span>
</div>
<div class="col-sm-6">
<?php echo $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?>
</div>
</div>
<?php
}
?>
<div class="row">
<?php
$reviews_query = tep_db_query($reviews_split->sql_query);
while ($reviews = tep_db_fetch_array($reviews_query)) {
echo '<div class="col-sm-6">' . PHP_EOL;
echo '<blockquote class="blockquote">';
echo '<p>' . tep_image('images/' . tep_output_string_protected($reviews['products_image']), htmlspecialchars($reviews['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, null, null, 'rounded float-left') . tep_output_string_protected($reviews['reviews_text']) . ' ... </p>';
$reviews_name = tep_output_string_protected($reviews['customers_name']);
echo '<div class="w-100"></div><footer class="blockquote-footer">' . sprintf(REVIEWS_TEXT_RATED, tep_draw_stars($reviews['reviews_rating']), $reviews_name, $reviews_name) . '</footer>' . PHP_EOL;
echo '<div class="w-100"></div><p><a class="btn btn-light btn-sm btn-block" href="' . tep_href_link('product_reviews.php', 'products_id=' . (int)$reviews['products_id']) . '">' . REVIEWS_TEXT_READ_MORE . '</a></p>';
echo '</blockquote>' . PHP_EOL;
echo '</div>' . PHP_EOL;
}
?>
</div>
<div class="w-100"></div>
<?php
} else {
?>
<div class="alert alert-info" role="alert">
<?php echo TEXT_NO_REVIEWS; ?>
</div>
<?php
}
if (($reviews_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
<div class="row">
<div class="col-sm-6 pagenumber d-none d-sm-block">
<span class="align-middle"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></span>
</div>
<div class="col-sm-6">
<?php echo $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?>
</div>
</div>
<?php
}
?>
</div>
<?php
require('includes/template_bottom.php');
require('includes/application_bottom.php');
?>