Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $xml=simplexml_load_file("https://kiyoh.nl/xml/combined_company_reviews.xml?showextraquestions=true&reviewcount=all&type=combined&token=sNg6exkYwbNtfHFhBaXS3bMQz3C74KfJsQtZKxQb7Q5cazWdCR") or die("Error: Cannot create object");
- $total = $xml->companies->average->total_score;
- $aantalReviews = $xml->companies->average->reviews;
- $laatsteReview = $xml->reviews->review['0']->id;
- ?>
- <head>
- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i" rel="stylesheet">
- </head>
- <style>
- .kiyoh{
- width:350px;
- float:left;
- background-color: #121214;
- font-family: 'Open Sans', sans-serif;
- color:#fff;
- padding:30px;
- }
- .kiyoh__item{
- border-bottom:1px solid #fff;
- position:relative;
- width:100%;
- float:left;
- padding:20px 0;
- }
- .kiyoh__item__cijfer{
- float:left;
- background-color: #71c466;
- border-bottom:2px solid #529a49;
- padding:10px 0;
- border-radius:2px;
- vertical-align: middle;
- margin-top:7px;
- text-align:center;
- min-width:45px;
- }
- .kiyoh__item__content{
- vertical-align: middle;
- padding-left:10px;
- float:left;
- width:80%;
- }
- .kiyoh__item__bottom{
- position:absolute;
- bottom:5px;;
- right:0;
- font-size:10px;
- }
- </style>
- Klantenbeoordeling: <strong><?php echo $total ?> / 10</strong>
- <div class="kiyoh">
- <h3>Laatste reacties</h3>
- <?php
- $i = 1;
- foreach($xml->reviews->children() as $item) {
- if($item->total_score > 8 AND $item->positive != ""){
- ?><div class="kiyoh__item">
- <div class="kiyoh__item__cijfer">
- <?php echo number_format((float)$item->total_score, 1, '.', '');?>
- </div>
- <div class="kiyoh__item__content">
- <p><?php echo $item->positive; ?></p>
- </div>
- <div class="kiyoh__item__bottom">
- <?php
- if($item->customer->name != ""){
- echo $item->customer->name ."-";
- }
- else{
- ?>Anoniem -<?php
- }
- ?>
- <?php
- $date = date_create($item->date);
- echo date_format($date,"d/m/Y");
- ?>
- </div>
- <?php
- if ($i++ == 3) break;
- ?>
- </div>
- <?php
- }
- }
- ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement