當前位置: 首頁>>代碼示例>>PHP>>正文


PHP School::getAllSchools方法代碼示例

本文整理匯總了PHP中School::getAllSchools方法的典型用法代碼示例。如果您正苦於以下問題:PHP School::getAllSchools方法的具體用法?PHP School::getAllSchools怎麽用?PHP School::getAllSchools使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在School的用法示例。


在下文中一共展示了School::getAllSchools方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionView

 public function actionView()
 {
     if (isset($_GET['user'])) {
         $username = $_GET['user'];
     } else {
         $username = Yii::app()->user->name;
     }
     $user = User::model()->find("username=:username", array(':username' => $username));
     $saveQ = SavedQuery::model()->findAll("FK_userid=:id", array(':id' => $user->id));
     if ($user->FK_usertype == 2) {
         $this->actionViewEmployer();
         return;
     }
     //Get all schools
     $allSchools = School::getAllSchools();
     // Get Resume
     $resume = Resume::model()->findByPk($user->id);
     $videoresume = VideoResume::model()->findByPk($user->id);
     // 		print "<pre>"; print_r($videoresume->video_path);print "</pre>";return;
     $this->render('View', array('user' => $user, 'allSchools' => $allSchools, 'resume' => $resume, 'videoresume' => $videoresume, 'saveQ' => $saveQ));
 }
開發者ID:erick305,項目名稱:testing,代碼行數:21,代碼來源:ProfileController.php

示例2: actionEmployersearch

 public function actionEmployersearch()
 {
     $srch_keyword = $_POST['skillkeyword'];
     // Get skill keyword to search
     $pieces = trim($srch_keyword);
     $pieces = explode(" ", $pieces);
     // split words to search
     $count = sizeof($pieces);
     // get number of word to search
     $query = '';
     for ($i = 0; $i < $count; $i++) {
         if ($i == $count - 1) {
             $query = $query . 'name like \'%' . $pieces[$i] . '%\'';
         } else {
             $query = $query . 'name like \'%' . $pieces[$i] . '%\' OR ';
         }
     }
     $criteria = new CDbCriteria();
     $criteria->condition = $query;
     $results = array();
     if ($srch_keyword != null) {
         $skillsArray = Skillset::model()->findAll($criteria);
         foreach ($skillsArray as $sk) {
             $student_ids = StudentSkillMap::model()->findAllByAttributes(array('skillid' => $sk->id));
             // search student skill map for students with that skill
             foreach ($student_ids as $tmp) {
                 $duplicate = 0;
                 if (sizeof($results) > 0) {
                     foreach ($results as $t) {
                         if ($t->id == $tmp->userid) {
                             $duplicate = 1;
                         }
                     }
                 }
                 if ($duplicate == 0) {
                     $results[] = User::model()->findByAttributes(array('id' => $tmp->userid));
                 }
             }
         }
         $school_id = School::model()->findAll($criteria);
         // get school ID
         foreach ($school_id as $si) {
             $student_ids = Education::model()->findAllByAttributes(array('FK_school_id' => $si->id));
             // search educations with school ID
             foreach ($student_ids as $tmp) {
                 $duplicate = 0;
                 if (sizeof($results) > 0) {
                     foreach ($results as $t) {
                         if ($t->id == $tmp->FK_user_id) {
                             $duplicate = 1;
                         }
                     }
                 }
                 if ($duplicate == 0) {
                     $results[] = User::model()->findByAttributes(array('id' => $tmp->FK_user_id));
                 }
             }
         }
     }
     if (isset($_GET['user'])) {
         $username = $_GET['user'];
     } else {
         $username = Yii::app()->user->name;
     }
     $user = User::model()->find("username=:username", array(':username' => $username));
     // pass user
     $skills = Skillset::getNames();
     // pass skills
     $universites = School::getAllSchools();
     // pass companies
     // 		foreach ($results as $tr){
     // 			print "<pre>"; print_r($tr->attributes);print "</pre>";
     // 		}
     // 		return;
     $this->render('employerSearchResults', array('results' => $results, 'skills' => $skills, 'universities' => $universites, 'user' => $user));
 }
開發者ID:erick305,項目名稱:testing,代碼行數:76,代碼來源:HomeController.php


注:本文中的School::getAllSchools方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。