Esempio n. 1
0
             $title_avis = 'Beoordelingen';
             break;
         case 'EN':
             $title_avis = 'Reviews';
             break;
     }
 }
 // requete reviews
 $reviews_result = file_get_contents('http://resto.fr/api/business/getReviews/v1/?apiToken=' . _apiToken . '&language=' . $language . '&businessId=' . $token_resto . '');
 $reviews_xml = simplexml_load_string($reviews_result);
 $reviews_xml = json_decode(json_encode((array) simplexml_load_string($reviews_result)), 1);
 if (isset($reviews_xml['reviews']['review'])) {
     $reviews = $reviews_xml['reviews']['review'];
 }
 // print_r($reviews_xml[0]);
 header('Content-Disposition: attachment; filename="' . $cleanbusinessName . '-' . og_clean_url($language) . '.xml"');
 //header('Content-type: text/xml');
 // echo $businessType; // 1 restaurant, 2 caterer, 5 luxuryfood
 switch ($businessType) {
     case '1':
         $businessTypeName = 'restaurant';
         break;
     case '2':
         $businessTypeName = 'caterer';
         break;
     default:
         $businessTypeName = 'luxuryfood';
         break;
 }
 $url_restoBe = 'http://www.resto.fr/' . $businessTypeName . '/' . $region . '/' . $zip . '-' . $city . '/' . $token_resto . '-' . $cleanbusinessName . '/';
 // echo $url_restoBe;
     if (!isset($review_en[0])) {
         $temp = array();
         $temp[] = $review_en;
         $review_en = $temp;
     }
     $sorted = array_merge($sorted, $review_en);
 }
 $sorted = array_orderby($sorted, 'reviewId', SORT_DESC);
 $reviews = $sorted;
 $result = file_get_contents('http://resto.fr/api/business/getDetails/v1/?apiToken=' . _apiToken . '&language=nl&businessId=' . $id_resto . '');
 $xml = simplexml_load_string($result);
 $xml = json_decode(json_encode((array) simplexml_load_string($result)), 1);
 $details = $xml['businesses']['business'];
 // print_r($details);
 $businessName = $details['businessName'];
 $cleanbusinessName = og_clean_url($businessName);
 $businessType = $details['businessTypeId'];
 switch ($businessType) {
     case '1':
         $businessTypeName = 'restaurant';
         break;
     case '2':
         $businessTypeName = 'caterer';
         break;
     default:
         $businessTypeName = 'luxuryfood';
         break;
 }
 $zip = strtolower($details['zip']);
 $city = strtolower($details['city']);
 $region = strtolower($details['region']);