コード例 #1
0
ファイル: Institutes.php プロジェクト: edwinraycom/vals-soc
 public static function getInstance()
 {
     if (is_null(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
コード例 #2
0
             $jTableResult['TotalRecordCount'] = Institutes::getInstance()->getInstitutesRowCountBySearchCriteria($instName);
             $jTableResult['Records'] = Institutes::getInstance()->getInstitutesBySearchCriteria($instName, $_GET["jtSorting"], $_GET["jtStartIndex"], $_GET["jtPageSize"]);
         }
         print json_encode($jTableResult);
     } catch (Exception $ex) {
         //Return error message
         $jTableResult = array();
         $jTableResult['Result'] = "ERROR";
         $jTableResult['Message'] = $ex->getMessage();
         print json_encode($jTableResult);
     }
     break;
 case 'detail':
     if (isset($_GET['instid'])) {
         try {
             $institutions = Institutes::getInstance()->getInstituteById($_GET['instid']);
             echo $institutions ? jsonGoodResult($institutions[0]) : jsonBadResult(t('Could not find the institution'));
         } catch (Exception $e) {
             echo jsonBadResult($e->getMessage());
         }
     } else {
         echo jsonBadResult(t("No institution identifier submitted!"));
     }
     break;
 case 'list_search_proposal_count_student':
     $group = null;
     if (isset($_POST['group']) && $_POST['group']) {
         $group = $_POST['group'];
     }
     if (isset($_GET['mine_only']) && $_GET['mine_only']) {
         $mine_only = true;