<?php
// ActivaStudio
$id = array ('');
$url = array ('http://graph.facebook.com/ActivaStudio');

// BankaMleka
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/BankaMleka');

// Frikomanija
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/frikomanija');

// RitamNereda
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/RitamNereda');

// PlayMedia
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/PlayMedia');

// RespectDJs
array_push ($id, 'http://graph.facebook.com/117372074942256');
array_push ($url, '');

// ZonaAdrenalina
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/ZonaAdrenalinaPaintball');

// LazinoTele
array_push ($id, 'http://graph.facebook.com/7150323323');
array_push ($url, '');

// Lockerz
array_push ($id, 'http://graph.facebook.com/311311427972');
array_push ($url, '');

// VitisVino
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/VitisVino');

// 10 Koncerata za 10 terena
array_push ($id, 'http://graph.facebook.com/364476425948');
array_push ($url, '');

// PanonijaRoadie
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/PanonijaRoadie');

// WayIDo
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/WayIDo');

// KlubHedonist
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/KlubHedonist');

// KosarkasiSrbije
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/KosarkasiSrbije');

// EdOn
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/edon.radionice');

// PuzzleGroup
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/puzzlegroup');

// C&C
array_push ($id, 'http://graph.facebook.com/116207401762818');
//array_push ($url, 'http://graph.facebook.com/CleanAndClear.Serbia');
array_push ($url, '');

// MicrosoftSinergija
//array_push ($id, 'http://graph.facebook.com/113159028031');
array_push ($id, 'http://graph.facebook.com/159848504043607');
array_push ($url, '');

// JobFair
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/jobfairrs');

// WebFest
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/wfest');

// happynovisad
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/happynovisad');

// KlubDvoriste
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/KlubDvoriste');

// GameLand
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/GameLand.igre');

// Hammer Production
array_push ($id, 'http://graph.facebook.com/159535384059571');
array_push ($url, '');

// Mobilni Shop
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/mobilnishop');

// A MODA online shop
//array_push ($id, 'http://graph.facebook.com/153122731385621');
//array_push ($url, '');

// Maticne celije
array_push ($id, 'http://graph.facebook.com/161467990549477');
array_push ($url, '');

// Bebac
//array_push ($id, 'http://graph.facebook.com/174381223277');
//array_push ($url, '');

// Koncert godine
array_push ($id, '');
array_push ($url, 'http://graph.facebook.com/KoncertGodine');



$fanCount = 0;

foreach ($id as $pageUrl) {
	
	if ($pageUrl != '') {
		
		// create curl resource
		$ch = curl_init();

		// set url
		curl_setopt($ch, CURLOPT_URL, $pageUrl);
		curl_setopt($ch,CURLOPT_HTTPHEADER,array ("Content-Type: text/xml; charset=utf-8"));
		//return the transfer as a string
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

		// $output contains the output string
		$output = curl_exec($ch);
		//$output = utf8_encode($output);
		//echo $output . "<br />";

		$param = json_decode($output, true);
		$fanCount += $param['fan_count'];
		
		// close curl resource to free up system resources
		curl_close($ch);   
	}
}

foreach ($url as $pageUrl) {
	
	if ($pageUrl != '') {
		
		// create curl resource
		$ch = curl_init();

		// set url
		curl_setopt($ch, CURLOPT_URL, $pageUrl);
		curl_setopt($ch,CURLOPT_HTTPHEADER,array ("Content-Type: text/xml; charset=utf-8"));
		//return the transfer as a string
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

		// $output contains the output string
		$output = curl_exec($ch);
		//$output = utf8_encode($output);
		//echo $output . "<br />";

		$param = json_decode($output, true);
		$fanCount += $param['fan_count'];
		
		// close curl resource to free up system resources
		curl_close($ch);   
	}
}

if ($fanCount == 0) {
	$fanCount = 908049;
}

////////////////////
// VALUE
////////////////////

//$fanCount;



?>