ОТЗЫВЫ
Здесь вы можете оставить отзыв о нашей компании

 

    '; $range = 1; if ($currentPage > 1) { $output .= '
  • <
  • '; } for ($i = 1; $i <= $totalPages; $i++) { if ($i == 1 || $i == $totalPages || ($i >= $currentPage - $range && $i <= $currentPage + $range)) { $class = ($currentPage == $i) ? 'active' : ''; $output .= '
  • ' . $i . '
  • '; } } if ($currentPage < $totalPages) { $output .= '
  • >
  • '; } $output .= '
'; return $output; } function getUniqueExcursions($reviews) { $excursions = []; foreach ($reviews as $review) { if (!in_array($review['excursion'], $excursions)) { $excursions[] = $review['excursion']; } } return $excursions; } $excursions = getUniqueExcursions($reviews); function createReviewHTML($review, $bgClass, $id) { $reviewPhotosHtml = ''; if (!empty($review['photos'])) { foreach ($review['photos'] as $index => $photo) { $photoId = "photo_" . $index . "_" . $id ; $reviewPhotosHtml .= ' '; } } return '

' . htmlspecialchars($review['review']) . '

' . $reviewPhotosHtml . '

Экскурсия:' . htmlspecialchars($review['excursion']) . '

'; } $output = ''; $id = 0; $index = 0; foreach ($reviews as $review) { $id++; $bgClass = $index % 2 == 0 ? 'bg-light' : 'bg-white'; $output .= createReviewHTML($review, $bgClass, $id); $index++; } // echo $output; echo displayReviews($reviews, $page, $perPage); echo paginate($totalPages, $page); ?>
Made on
Tilda