<?php include "config.php"; include "pdo.class.php"; $pdo = Db::singleton(); require_once "Services/HighriseAPI.class.php"; $highrise = new HighriseAPI(); $highrise->debug = false; $highrise->setAccount($highrise_account); $highrise->setToken($highrise_apikey); $people = $highrise->findPeopleBySearchCriteria(array('phone' => $_REQUEST['From'])); if (count($people)) { $p = $people[0]; $name = $p->getFirstName() . ' ' . $p->getLastName(); $now = time(); $sql = "INSERT INTO calls SET caller_name='{$name}',caller='{$_REQUEST['From']}', call_time='{$now}'"; $pdo->exec($sql); } else { $now = time(); $sql = "INSERT INTO calls SET caller='{$_REQUEST['From']}', call_time='{$now}'"; $pdo->exec($sql); } header('Content-type: text/xml'); echo '<?xml version="1.0" encoding="UTF-8"?>'; ?> <Response> <Gather action="input.php" numDigits="1"> <Say>Welcome to my pretend company.</Say> <Say>For store hours, press 1.</Say> <Say>For directions, press 2</Say> <Say>To speak to an agent, press 3.</Say>
die("Invalid number of twitter accounts"); } if ($person->web_addresses[0]->getUrl() != "http://john.wordpress.com" || $person->web_addresses[0]->getLocation() != "Personal") { die("Invalid Personal Web Address"); } if ($person->web_addresses[1]->getUrl() != "http://corporation.com/~john" || $person->web_addresses[1]->getLocation() != "Work") { die("Invalid Work Web Address"); } // Delete Person $person->delete(); } $people = $hr->findPeopleBySearchTerm("John Test Doe"); print count($people) . " matched search term John Test after deletion.\n"; die; $person = $hr->findPersonByID(64751412); print "Find By Title\n\n"; $people = $hr->findPeopleByTitle("Test CEO"); print_r($people); print "Find By Company ID\n\n"; $people = $hr->findPeopleByCompanyId(64755398); print_r($people); print "Find By Search Term\n\n"; $people = $hr->findPeopleBySearchTerm("Test"); print_r($people); print "Find By Search Criteria\n\n"; $people = $hr->findPeopleBySearchCriteria(array("email" => "*****@*****.**", "phone" => "111-111-1111")); print_r($people); // Update Person $person->setLastName("Person Test"); $person->setBackground("We are overriding the background here"); $person->save();