File: /home/api/public_html/nashville/get-office-agents.php
<?php
$aOfficeIDs = false;
$iLimit = false;
foreach ( $_GET as $k => $v )
{
switch( strtolower( $k ) )
{
case "officeid":
if ( preg_match( "@^[[:alnum:],]+$@", $v ) === 1 )
{
$aOfficeIDs = explode( ",", $v );
}
break;
case "limit":
if ( is_numeric( $v ) )
$iLimit = $v;
}
}
require( "php/config.php" );
$oRes = new Result( "OfficeAgents" );
if ( ! $aOfficeIDs )
$oRes->FatalError( "OfficeID is not valid" );
foreach ( $aOfficeIDs as &$sOI )
$sOI = "RTC" . $sOI;
$oRes->addData( $oMLS->getOfficeAgents( $aOfficeIDs ) );
$oMLS->finish( "nashville", "office-agents", json_encode( $_GET ) );
print $oRes->getJSON();