<?php
   define('USER', 'inese.andersone@gatewaybaltic.com');
         define('TOKEN', 'F274va12MeWcTdUfPfB9r7X3=3b0naF9I7=003r0'); 
   require 'Solve360Service.php';
   
   $solve360Service = new Solve360Service(USER, TOKEN);

   $blogId=$_GET["p"];
   $blog = $solve360Service->getProjectblog($blogId);
   $comps[]="$blogId";
   foreach ($blog->relateditems->children() as $comp) {
      if ($comp->typeid==40) {
         $compId=$comp->id;
         $comps[]="$compId";
      }
   }
   
   echo json_encode($comps);
   //echo json_encode(array("name","array","background"));
?>