<?php
   define('USER', 'jesse.turner@gatewaybaltic.com');
   define('TOKEN', 'reNaj8P1B4r3y9=fD8RaM0a4Lf30sdBda1d210we'); 
   require 'Solve360Service.php';
   
   $solve360Service = new Solve360Service(USER, TOKEN);
	
	$startDate=$_GET["startDate"];
	$startDateNum=intval($startDate,10);
		
   $cons = $solve360Service->getAllContacts();
   
   $contacts=array();

   foreach ($cons->children() as $ch) {
      $conId=$ch->id;
      $conName=$ch->name;
      $conDate=$ch->created;
      $conDateStr=substr($conDate,0,4).substr($conDate,5,2).substr($conDate,8,2);
      $conDateNum=intval($conDateStr,10);
      if (strlen($conName)>0 && $startDateNum<=$conDateNum) $contacts[]=array("$conId","$conName","$conDateStr",0);
   }
      
   echo json_encode($contacts);
?>
