request->getParam('text'); $name = Yii::app()->request->getParam('name'); $phone = Yii::app()->request->getParam('phone'); $email = Yii::app()->request->getParam('email'); Yii::import('application.extensions.phpmailer.JPhpMailer'); $mail = new JPhpMailer; $mail->IsSMTP(); $mail->Host = 'smtp.gmail.com'; $mail->SMTPAuth = true; $mail->Username = 'dockdep@gmail.com'; $mail->Password = 'k0l0b04eg'; $mail->SetFrom('dockdep@gmail.com', 'Авто Лайв'); $mail->Subject = 'Расчет стоимости ТО'; $mail->AltBody = $text.'
Имя:'.$name.'
Телефон:'. $phone.'
Email:'. $email; $mail->MsgHTML('

JUST A TEST!

'); $mail->AddAddress('john.doe@otherdomain.com', 'John Doe'); $mail->Send(); } public function actionFilter(){ $post = Yii::app()->request->getParam('StoFilter'); if(!empty($post)){ $form = new StoFilter(); $form->attributes = Yii::app()->request->getParam('StoFilter'); $filter['model'] = $form->searchFilter('model'); $filter['engine'] = $form->searchFilter('engine'); $filter['drive_unit'] = $form->searchFilter('drive_unit'); $filter['transmission'] = $form->searchFilter('transmission'); $filter['fuel_type'] = $form->searchFilter('fuel_type'); if(!empty( $post['model']) && !empty( $post['engine']) && !empty( $post['drive_unit']) && !empty( $post['transmission'])&& !empty( $post['fuel_type'])){ foreach($form->searchFilter('id') as $key => $val){ $dist = new StoRequire(); $filter['mileage'] = $dist->searchFilter($key);; $filter['id'] = $key; } } $json = json_encode($filter); die($json); } } public function actionRenderPriceList(){ $id = Yii::app()->request->getParam('id'); $dist = Yii::app()->request->getParam('dist'); if(!empty($id) && !empty($dist)){ $names = new StoRequireName(); $items = new StoRequire(); $optionalModel = new StoOptionalItems(); $fields = Yii::app()->db->createCommand() ->select('*') ->from("{$names->tableName()} sn") ->rightJoin("{$items->tableName()} s", 'sn.id=s.sto_require_name_id') ->where('sn.sto_filter_id=:id AND s.dist=:dist', array(':id'=>$id,':dist' => $dist))->queryAll(); $optional = Yii::app()->db->createCommand() ->select('*') ->from("{$optionalModel->tableName()} sn") ->where('sto_filter_id=:id', array(':id'=>$id))->queryAll(); $this->renderPartial('/stoFilter/_priceList', array( 'fields' => $fields, 'optional' => $optional )); } } }