コード例 #1
0
 public function save()
 {
     $model = new ConsultationRequest();
     $model->email = $this->email;
     $model->name = $this->name;
     $model->phone = $this->phone;
     $model->skype = $this->skype;
     $model->text = $this->text;
     if ($model->save(FALSE)) {
         $this->emailSubject = 'Замовлення консультації з сайту РЕЗИДЕНТ';
         $this->receiverEmail = Yii::app()->params['emails']['notificationReceiver'];
         $this->emailViewFile = 'consultation';
         $this->emailParams = array('name' => $model->getName(), 'email' => $model->getEmail(FALSE, TRUE), 'message' => $model->getText(), 'phone' => $this->phone, 'skype' => $this->skype);
         $this->senderEmail = Yii::app()->params['emails']['defaultSender'];
         if ($this->sendEmail()) {
             if (!empty($this->email)) {
                 $this->notificationSubject = 'Повідомлення від сайту http://rezydent.com.ua';
                 $this->notificationViewFile = 'sender-notification';
                 $this->notificationParams = array();
                 $this->notificationReceiver = $this->email;
                 $this->notificationSender = Yii::app()->params['emails']['defaultSender'];
                 $this->sendSenderNotification();
             }
         }
     }
 }
コード例 #2
0
 public function actionView()
 {
     /** @var $messageModel ContactMessage */
     $messageModel = ConsultationRequest::model()->findByPk(getParam('id'));
     $messageModel->is_new = 0;
     $messageModel->save();
     $this->render('view', array('model' => $messageModel));
 }
コード例 #3
0
 function testUnclosed()
 {
     $y = ConsultationRequest::unclosed();
     $this->assertType('array', $y);
     $this->assertEquals(2, count($y));
     $z = array_shift($y);
     $this->assertType('ConsultationRequest', $z);
     $this->assertEquals(2, $z->id);
 }
コード例 #4
0
ファイル: Consultation.php プロジェクト: songwork/songwork
 function request()
 {
     return ConsultationRequest::for_consultation($this->id);
 }
コード例 #5
0
ファイル: Teacher.php プロジェクト: songwork/songwork
 function consultation_requests()
 {
     return ConsultationRequest::for_teacher($this->id);
 }
コード例 #6
0
 static function for_consultation($consultation_id)
 {
     return ConsultationRequest::for_query(sprintf("SELECT * FROM consultation_requests WHERE consultation_id=%d ORDER BY id DESC", $teacher_id));
 }
コード例 #7
0
ファイル: Student.php プロジェクト: songwork/songwork
 function consultation_requests()
 {
     return ConsultationRequest::for_student($this->id);
 }