Example #1
0
 public function actionindex()
 {
     $model = new Feedback();
     if (isset($_POST['Feedback'])) {
         $model->attributes = $_POST['Feedback'];
         if ($model->validate()) {
             $imagePath = ImageUtils::uploadImage($model, 'image');
             if ($imagePath) {
                 $model->image = FeedbackImagesApi::addImage($imagePath);
             }
             if ($model->save()) {
                 EmailApi::sendEmail($model->email_id, "FEEDBACK.SUCCESS");
                 $this->redirect('/feedback/thanks');
             }
         }
     }
     $feedbackTopics = new FeedbackTopic();
     $this->renderPartial('index', array('model' => $model, 'feedbackTopics' => $feedbackTopics));
 }
Example #2
0
 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     $feedBack = FeedbackApi::getFeedbackById($_GET['id']);
     $url = FeedbackImagesApi::getImage($feedBack->image);
     $this->render('view', array('model' => $this->loadModel($id), 'url' => $url));
 }