예제 #1
0
 case 'getOrganizations':
     if (isset($_GET['searchMode'])) {
         $searchMode = $_GET['searchMode'];
     } else {
         $searchMode = '';
     }
     if (isset($_GET['limit'])) {
         $limit = $_GET['limit'];
     } else {
         $limit = '';
     }
     $q = $_GET['q'];
     $q = str_replace(" ", "+", $q);
     $q = str_replace("&", "%", $q);
     $platform = new Platform();
     $orgArray = $platform->searchOrganizations($q);
     echo implode("\n", $orgArray);
     break;
     //used to verify organization name isn't already being used as it's added
 //used to verify organization name isn't already being used as it's added
 case 'getExistingOrganizationName':
     $shortName = $_GET['shortName'];
     $platform = new Platform();
     $orgArray = array();
     $exists = 0;
     foreach ($platform->getOrganizationList() as $orgArray) {
         if (strtoupper($orgArray['name']) == strtoupper($shortName)) {
             $exists = $orgArray['organizationID'];
         }
     }
     echo $exists;