Esempio n. 1
0
     try {
         $model = ProOpportunity::GetBySlug($slug);
         if (is_null($model)) {
             throw new Exception('Invalid Request');
         }
         $this->pageTitle = 'View Job - ' . Yii::app()->params['title'];
         $this->render('career/View_job', array('model' => $model));
     } catch (Exception $exc) {
         throw new CHttpException(404, $exc->getMessage());
     }
 }
 public function actionResume()
 {
     $model = new ProResume();
     $flag = false;
     $this->pageTitle = 'Submit Resume - ' . Yii::app()->params['title'];
     if (isset($_POST['ProResume'])) {
         $model->attributes = $_POST['ProResume'];
         $model->file_resume = CUploadedFile::getInstance($model, 'file_resume');
         $model->validate();
         if (!$model->hasErrors()) {
             if ($model->save()) {
                 //file_resule
                 if (!is_null($model->file_resume)) {
                     ProResume::save_upload_file_resume($model);
                 }
                 $flag = true;
                 Yii::app()->user->setFlash('success', "Your Resume has been uploaded!");
                 //gui mail
Esempio n. 2
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     try {
         $model = ProResume::model()->findByPk($id);
         if ($model === null) {
             Yii::log("The requested page does not exist.");
             throw new CHttpException(404, 'The requested page does not exist.');
         }
         return $model;
     } catch (Exception $e) {
         Yii::log("Exception " . print_r($e, true), 'error');
         throw new CHttpException("Exception " . print_r($e, true));
     }
 }