Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. <?php
  2. $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");
  3. $total = $xml->companies->average->total_score;
  4. $aantalReviews = $xml->companies->average->reviews;
  5. $laatsteReview = $xml->reviews->review['0']->id;
  6.  
  7. ?>
  8. <head>
  9. <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i" rel="stylesheet">
  10. </head>
  11. <style>
  12. .kiyoh{
  13. width:350px;
  14. float:left;
  15. background-color: #121214;
  16. font-family: 'Open Sans', sans-serif;
  17. color:#fff;
  18. padding:30px;
  19. }
  20. .kiyoh__item{
  21. border-bottom:1px solid #fff;
  22. position:relative;
  23. width:100%;
  24. float:left;
  25. padding:20px 0;
  26. }
  27. .kiyoh__item__cijfer{
  28. float:left;
  29. background-color: #71c466;
  30. border-bottom:2px solid #529a49;
  31. padding:10px 0;
  32. border-radius:2px;
  33. vertical-align: middle;
  34. margin-top:7px;
  35. text-align:center;
  36. min-width:45px;
  37. }
  38. .kiyoh__item__content{
  39. vertical-align: middle;
  40. padding-left:10px;
  41. float:left;
  42. width:80%;
  43. }
  44. .kiyoh__item__bottom{
  45. position:absolute;
  46. bottom:5px;;
  47. right:0;
  48. font-size:10px;
  49. }
  50. </style>
  51. Klantenbeoordeling: <strong><?php echo $total ?> / 10</strong>
  52. <div class="kiyoh">
  53. <h3>Laatste reacties</h3>
  54. <?php
  55. $i = 1;
  56. foreach($xml->reviews->children() as $item) {
  57. if($item->total_score > 8 AND $item->positive != ""){
  58. ?><div class="kiyoh__item">
  59. <div class="kiyoh__item__cijfer">
  60. <?php echo number_format((float)$item->total_score, 1, '.', '');?>
  61. </div>
  62. <div class="kiyoh__item__content">
  63. <p><?php echo $item->positive; ?></p>
  64. </div>
  65. <div class="kiyoh__item__bottom">
  66. <?php
  67. if($item->customer->name != ""){
  68. echo $item->customer->name ."-";
  69. }
  70. else{
  71. ?>Anoniem -<?php
  72. }
  73. ?>
  74. <?php
  75. $date = date_create($item->date);
  76. echo date_format($date,"d/m/Y");
  77. ?>
  78. </div>
  79. <?php
  80. if ($i++ == 3) break;
  81. ?>
  82.  
  83. </div>
  84. <?php
  85. }
  86. }
  87. ?>
  88. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement