beoordelingen

{source}<?php

/*
* Variables à renseigner pour le Camping Lac Panthier
*/
$token = 'sESJL48Ol3jvrHb5';
$guestappEstablishmentId = 3077;

/*
* Init API url
*/
$urlReviews = 'https://guestapp.me/rest/reviews.json?access_token='.$token;
$urlEstablishment = 'https://guestapp.me/rest/establishment.json?access_token='.$token.'&establishment_id_guestapp='.$guestappEstablishmentId;

/*
* Fetch reviews
* (Display reviews)
*/
$data = file_get_contents($urlReviews);

if (empty($data)) {
return;
}

$reviewsData = json_decode($data);

/*
* Fetch establishment data
* (Display information and review aggregate)
*/
$dataEstablishment = file_get_contents($urlEstablishment);
$establishementData = json_decode($dataEstablishment);

/*
* Available languages
*/
$available_language = array();

foreach($reviewsData->reviews as $reviewCount => $review) {
array_push($available_language, strtolower($review->language_code));
}

$available_language = array_unique($available_language);

/*
* Config
*/
$displayLanguage = ''; // Display all reviews if empty
$defaultLanguage = 'nl'; // Never empty (fr/de/es/it/nl/en)

?>
<!-- Don't forget to initialize the CSS files -->
<!-- <link rel="stylesheet" type="text/css" href="/css/guestapp.css"> -->

<!-- Guest App -->
<div id="guestapp-reviews" class="guestapp-widget-bright" data-display-lang="<?php echo $displayLanguage ?>">

<!-- Establishment -->
<div class="guestapp-aggregate" itemscope itemtype="http://schema.org/LodgingBusiness">

<!-- Establishment name & informations -->
<div class="guestapp-establishment">

<!-- Global average -->
<?php if($establishementData->average_rate != null): ?>
<div class="guestapp-average">
<div class="guestapp-big3"><?php echo round($establishementData->average_rate, 1) ?></div>
<div class="guestapp-mb3">
<span class="guestapp-scale">10</span>
</div>
</div>
<?php endif; ?>
<!-- End of global average -->

<div class="guestapp-infos guestapp-title guestapp-center">
<h1 itemprop="name">
<?php echo $establishementData->establishment_name ?>
</h1>

<!-- Number of reviews -->
<?php if($establishementData->total_reviews > 0): ?>
<p class="">
Gemiddelde rente op <span class="guestapp-bold"><?php echo $establishementData->total_reviews ?></span> beoordelingen
</p>
<?php if($establishementData->average_ratings): ?>
<!-- End of Number of reviews -->
<button id="guestapp-show-globals-criterias" class="guestapp-show-globals-criterias">beoordelingscriteria</button>
<?php else: ?>
<br>
<?php endif; ?>
<?php endif; ?>
</div>

<?php if ($establishementData->total_reviews > 0) : ?>
<!-- Sort by language -->
<select id="guestapp-language" class="guestapp-language">
<option value="">taal</option>
<?php
/*
* Loop to display language selector
*/
foreach($available_language as $lang) :
?>
<option value="<?php echo $lang ?>" <?php if ($lang == $displayLanguage) { ?> selected="selected" <?php } ?>><?php echo $lang ?></option>
<?php endforeach; ?>
</select>
<!-- End of sort by language -->
<?php endif; ?>

</div>

<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<meta itemprop="ratingValue" content="<?php echo $establishementData->average_rate ?>" />
<meta itemprop="worstRating" content="0">
<meta itemprop="bestRating" content="10">
<meta itemprop="ratingCount" content="<?php echo $establishementData->total_reviews ?>">
</div>
<!-- End of Establishment name & informations -->

<?php if ($establishementData->total_reviews > 0) : ?>
<div class="guestapp-details">
<!-- Display ratings criterias -->
<div class="guestapp-center guestapp-criterias">
<table id="guestapp-globals-criterias" class="guestapp-globals-criterias">
<tbody>
<?php
/*
* Loop to display ratings criterias
*/
foreach($establishementData->average_ratings as $key => $value ) {
?>

<tr>
<td style="width:33%;">
<?php if($value->{$defaultLanguage}) : ?>
<?php echo $value->{$defaultLanguage}; ?>
<?php else : ?>
<?php echo $key; ?>
<?php endif; ?>
</td>
<td style="width:33%;">
<span class="guestapp-bar">
<span class="guestapp-progress" style="width:<?php echo $value->value*10 ?>%;" title="<?php echo $value->value ?>/10"></span>
</span>
</td>
<td class="guestapp-right" style="width:33%;">
<strong><?php echo $value->value ?></strong>/10
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<!-- End of ratings criterias -->

</div>
<?php endif; ?>

</div>
<!-- End of establishment -->

<?php if ($establishementData->total_reviews > 0) : ?>
<!-- Reviews Content -->
<div class="guestapp-content-reviews">
<?php
/*
* Loop to display reviews
*/
foreach($reviewsData->reviews as $reviewCount => $review) :

?>

<?php
$styles = "";
if ( $displaylanguage != '' && strtolower($review->language_code) != strtolower($displaylanguage)) {
$styles = "display:none;";
}
?>

<!-- Review -->
<div class="guestapp-review" itemscope itemtype="http://schema.org/Review" data-lang="<?php echo strtolower($review->language_code) ?>" style="<?php echo $styles ?>">
<meta content="<?php echo $review->establishment_name ?>" itemprop="itemReviewed">
<meta content="<?php echo $review->comment ?>" itemprop="reviewBody">
<meta content="<?php echo $review->creation_date ?>" itemprop="datePublished">

<table>
<tbody>
<tr>
<td style="width:45px !important;">

<!-- Global rate -->
<div class="guestapp-rating">
<span class="guestapp-big3 guestapp-rate"><?php echo $review->global_rate ?></span>
<span class="guestapp-scale guestapp-big2">
10
</span>
</div>
<!-- End of Global rate -->

</td>
<td>
<p>
<strong itemprop="author">
<?php echo $review->user_name; ?>
</strong>
<?php if ($review->type) : ?>
&nbsp;-&nbsp;<i><?php echo $review->type; ?></i>
<?php endif; ?>
<i style="float:right;"><img style="width: 20px; opacity: 0.7;" src="https://guestapp.me/bundles/guestapp/img/flag/<?php echo strtolower($review->language_code) ?>.png?v1"></i>
</p>
<!-- Review comment -->
<p class="guestapp-comment" itemprop="description">
<?php echo $review->comment ?></a>
</p>
<!-- End of review comment -->

<i><?php echo Date('d/m/Y', $review->creation_date_timestamp) ?></i>
<?php if($review->ratings_by_language): ?>
<strong class="guestapp-see-more">(meer)</strong>
<?php endif; ?>

</td>
</tr>
<?php if($review->ratings_by_language): ?>
<tr class="guestapp-criterias-rating">
<td style="width:45px !important;"></td>
<td>
<br>
<!-- Ratings -->
<div itemscope itemprop="reviewRating" itemtype="http://schema.org/Rating">
<meta content="<?php echo $review->global_rate ?>" itemprop="ratingValue">
<meta content="0" itemprop="worstRating">
<meta content="10" itemprop="bestRating">

<!-- Review ratings criterias -->
<div>
<table>
<?php foreach($review->ratings_by_language as $key => $value) { ?>
<tr>
<td style="width:33%;">
<?php if ($value->{$defaultLanguage}) : ?>
<?php echo $value->{$defaultLanguage}; ?>
<?php else : ?>
<?php echo $key; ?>
<?php endif; ?>
</td>
<td style="width:33%;">
<span class="guestapp-bar">
<span class="guestapp-progress" style="width:<?php echo $value->value*10 ?>%;" title="<?php echo $value->value ?>/10"></span>
</span>
</td>
<td class="guestapp-right" style="width:33%;">
<strong><?php echo $value->value ?></strong>/10
</td>
</tr>
<?php } ?>
</table>
</div>
<!-- End of review ratings criterias -->

</div>
<!-- End of Rating -->
<br>
</td>
</tr>
<?php endif; ?>
<tr class="guestapp-authenticity">
<td colspan="2">
<?php if($review->authenticity_url): ?>
<a class="guestapp-link" href="/<?php echo $review->authenticity_url ?>" target="_blank">
Geverifieërd door
<img src="http://guestapp.me/bundles/guestfront/img/logo.png?v18" alt="Guest App" title="Guest App">
</a>
<?php else: ?>
<img src="http://guestapp.me/bundles/guestfront/img/logo.png?v18" alt="Guest App" title="Guest App">
<?php endif; ?>
</td>
</tr>
</tbody>
</table>

</div>
<!-- End of review -->

<?php endforeach; ?>

</div>
<!-- End of reviews content -->
<?php else : ?>
<br>
<div class="guestapp-center guestapp-no-reviews">
No review avalaible...
</div>
<br>
<?php endif; ?>

<!-- Guest app footer -->
<div class="guestapp-footer guestapp-center">
<p>Geverifieërd door</p>
<a href="https://guestapp.me/confiance" target="_blank">
<img src="http://guestapp.me/bundles/guestfront/img/logo.png?v18" alt="Guest App" title="Guest App">
</a>
</div>
<!-- End of Guest App footer -->

<br>
</div>
<!-- End of Guest App -->

<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function(event) {

// Listener to display review by language
var language = document.getElementById('guestapp-language');
language.onchange = function() {
displayReviewsByLanguage(language.value);
};

// Listener to display global ratings criterias
var globalCriterias = document.getElementById('guestapp-show-globals-criterias');
globalCriterias.onclick = function() {
var table = document.getElementById('guestapp-globals-criterias');
if(table.classList.contains('open')) {
table.classList.remove('open');
} else {
table.classList.add('open');
}
}

// Listener to display rating criterias of review
var seeMore = document.getElementsByClassName('guestapp-see-more');
for (var i=0; i< seeMore.length; i++) {
var link = seeMore[i];
link.onclick = function(event) {
var _self = event.target;
var criterias = _self.parentNode.parentNode.parentNode.getElementsByClassName('guestapp-criterias-rating');
if(criterias[0].classList.contains('open')) {
criterias[0].classList.remove('open');
_self.innerHTML = '(Voir plus)';
} else {
criterias[0].classList.add("open");
_self.innerHTML = '(Voir moins)';
}
}
}
});

// Display reviews with selected language
var displayReviewsByLanguage = function(lang) {
var elements = document.getElementsByClassName('guestapp-review');
for (var i=0; i < elements.length; i++) {
var _self = elements[i];
if (!(_self.getAttribute('data-lang') == lang) && lang != '') {
_self.style.display = 'none';
} else {
_self.style.display = 'block';
}
}
}
</script>
{/source}

Camping Lac de Panthier

1, Chemin du Lac
21320 Vandenesse-en-Auxois
Tél : +33 (0) 3 80 49 21 94
Fax : +33 (0) 3 80 49 25 80

partners

Volg ons !

uw mening

Camping Lac de Panthier
8.01 / 10 | 421 avis
© 2020 Camping Lac de Panthier. Alle rechten voorbehouden.