Exemplo n.º 1
0
 public function actionMyFriends()
 {
     //Filter and order criterias
     if (isset($_GET['idCategory'])) {
         Yii::app()->session['idCategoryFriends'] = $_GET['idCategory'];
     }
     if (isset($_GET['idGender'])) {
         Yii::app()->session['idGenderFriends'] = $_GET['idGender'];
     }
     $friendsRequest = Friend::getFriendRequests(Yii::app()->user->getId());
     $friends = Friend::getFriends(Yii::app()->user->getId(), 1, 'username', 'ASC', Yii::app()->session['idGenderFriends'], Yii::app()->session['idCategoryFriends']);
     $categories = CHtml::listData(Category::model()->findAll(), 'idCategory', 'category');
     $genders = array('0' => 'Female', '1' => 'Male');
     $this->render('myFriends', array('categories' => $categories, 'idCategory' => Yii::app()->session['idCategoryFriends'], 'genders' => $genders, 'idGender' => Yii::app()->session['idGenderFriends'], 'friends' => $friends, 'friendsRequest' => $friendsRequest));
 }