public function actionFavSelected() { if (isset($_POST) && isset($_POST['stu_job_id']) && !empty($_POST['stu_job_id'])) { $unFavResumes = FavoriteStudentJobTitle::getUnFavResumes($_POST['stu_job_id'], Yii::app()->user->id); if (count($unFavResumes) > 0) { try { if (FavoriteStudentJobTitle::saveResumes($unFavResumes, Yii::app()->user->id)) { $this->renderPartial('//common/_alerts', array('type' => 'success', 'msg' => Yii::t('app', 'msg.success.fav_resumes'))); } echo CHtml::hiddenField('favorited-resumes', implode(',', $unFavResumes)); } catch (Exception $e) { $this->renderPartial('//common/_alerts', array('type' => 'danger', 'msg' => Yii::t('app', 'msg.error.fav_resumes'))); } } else { $this->renderPartial('//common/_alerts', array('type' => 'warning', 'msg' => Yii::t('app', 'msg.alert.no_fav_resumes'))); } } else { $this->renderPartial('//common/_alerts', array('type' => 'danger', 'msg' => Yii::t('app', 'msg.error.resumes_not_found'))); } }