public function saveDb($id) { if ($id != "") { $model = BookService::model()->findByAttributes(array('id' => $id)); } else { $model = new BookService(); } $model->airport = $this->airport; $model->date = $this->date; $model->flight_time = $this->flight_time; $model->flight_number = $this->flight_number; $model->name = $this->name; $model->add1 = $this->add1; $model->type = $this->type; // $model->add2 = $this->add2; // $model->add3 = $this->add3; $model->city = $this->city; // $model->province = $this->province; // $model->country = $this->country; $model->post_code = $this->postCode; $model->email = $this->email; $model->contact_num = $this->contact_num; $model->contact_num_2 = $this->contact_num_2; $model->size = $this->size; $model->save(FALSE); }
public function actionReject() { $request = Yii::app()->request; if (isset($_GET)) { $id = Yii::app()->request->getQuery('id'); $order = BookService::model()->findByAttributes(array('id' => $id)); $order->status = 5; $this->sendMailSorry($order->email); $order->save(FALSE); Yii::app()->user->setFlash('success', "Order rejected !"); $this->redirect(Yii::app()->createUrl('admin/staff')); } }
public function SendMailConfirm() { try { $data = BookService::model()->findByAttributes(array('id' => Yii::app()->session['order_id'])); $this->title = "Mail test"; $mail = new YiiMailer(); $mail->setView('confirm'); $mail->setData(array('data' => $data)); $mail->setFrom('*****@*****.**', 'John Doe'); $mail->setSubject('Confirm your order'); $mail->setTo($data->email); $mail->send(); var_dump($mail->getError()); } catch (Exception $e) { var_dump($e->getMessage()); } }