#!/usr/bin/php -c /home/awilliam/workspace/pogi
<?PHP

  $GLOBALS["OGoTrace"] = 1;

  // Include The File
  include("OGoAppointment.inc");
  
  // Create The Server Object - hostname, uri, port number
  $server = new OGoServer("kohocton", "/RPC2", 80);

  // Set you user credentials - username, password

  $server->login("adam", "*********");

  // Create A Task Manager Object
  $appointmentManager = new OGoAppointmentManager($server);

  $appointment = $appointmentManager->getById('78920');
  print "------------------------------------------------\n";
  print "ID: " . $appointment->getId() . "\n";
  print "------------------------------------------------\n";
  print "Comment: " . $appointment->getComment() . "\n";
  print "Title: " . $appointment->getTitle() . "\n";
  print "Location: " . $appointment->getLocation() . "\n";
  print "\n";
  
  $appointments = $appointmentManager->getBetween('2004-01-01', '2004-12-31');
  print "Account Objects " . count($appointments[$i]) . "\n";
  for ($i = 0; $i < count($appointments); $i++) {
    print "------------------------------------------------\n";
    print "ID: " . $appointments[$i]->getId() . "\n";
    print "------------------------------------------------\n";
    print "Comment: " . $appointments[$i]->getComment() . "\n";
    print "\n";
   }

  $appointments = $appointmentManager->getByComparison('title like \'*\'');
  print "Account Objects " . count($appointments[$i]) . "\n";
  for ($i = 0; $i < count($appointments); $i++) {
    print "------------------------------------------------\n";
    print "ID: " . $appointments[$i]->getId() . "\n";
    print "------------------------------------------------\n";
    print "Comment: " . $appointments[$i]->getComment() . "\n";
    print "\n";
   }
?>
