require_once('sitelutions.class.php');
$sl = new SitelutionsDNS('YOUREMAILADDRESS', 'YOURPASSWORD', 'https://api.sitelutions.com/soap-api','https://api.sitelutions.com/API');
$x=$sl->listDomains();
tableout($x);
foreach ($x as $domain){
  $y=$sl->listRRsByDomain($domain['id']);
  echo ''.$domain['name'].'
';
  tableout($y);
}
echo "getDomainByName";
tableout(array($sl->getDomainByName('YOURDOMAINNAME.TLD')));
echo "getDomainByID";
tableout(array($sl->getDomainByID(12345)));
$hostname='YOURHOSTNAME';
echo "ADDing RR $hostname";
$newrrid=$sl->addRR(12345, "1.1.1.1", 'a', $hostname, null, null);
echo "getRRbyID - added in last test added";
tableout(array($sl->getRRByID($newrrid)));
echo "updateDomain - change ttl";
$sl->updateDomain(12345, null, null, null, null, null, null, null, null, null, rand(28000,900000));
tableout(array($sl->getDomainByID(12345)));
echo "addDomain - displayed below";
$newdomainid=$sl->addDomain ('testdomain'.rand().".net");
tableout(array($sl->getDomainByID($newdomainid)));
echo "updateRR - recently added RR; random ttl";
$sl->updateRR($newrrid, rand(28000,90000));
echo "getRRByID - redently added RR";
tableout(array($sl->getRRByID($newrrid)));
echo "deleteRR - deleting recently added RR";
$sl->deleteRR($newrrid);
echo "deleteDomain - recently added domain";
$sl->deleteDomain($newdomainid, true);
function tableout($arr){
  if (count($arr) < 1 OR !is_array($arr) or !is_array($arr[0])) return "";
  echo "\n";
  foreach ($arr[0] AS $name=>$val){
    echo "| ".ucwords($name)."";
  }
  echo " | 
\n";
  foreach ($arr AS $record){
    echo "\n";
    foreach ($record AS $name=>$val){
      echo "| $val";
    }
    echo " | 
\n";
  }
  echo "
\n";
?>