Commit 7b70215a1e5f4f84621cb843635567ce70f92114
1 parent
f7ab6e26
15.04.16 seo widget
Showing
1 changed file
with
11 additions
and
1 deletions
Show diff stats
frontend/controllers/SiteController.php
| @@ -94,16 +94,26 @@ class SiteController extends Controller | @@ -94,16 +94,26 @@ class SiteController extends Controller | ||
| 94 | 94 | ||
| 95 | 95 | ||
| 96 | public function actionMail(){ | 96 | public function actionMail(){ |
| 97 | - $num = Yii::$app->request->post('num'); | 97 | + |
| 98 | $type = Yii::$app->request->post('type'); | 98 | $type = Yii::$app->request->post('type'); |
| 99 | 99 | ||
| 100 | switch ($type) { | 100 | switch ($type) { |
| 101 | case 'call_me': | 101 | case 'call_me': |
| 102 | + $num = Yii::$app->request->post('num'); | ||
| 102 | if(!empty($num)){ | 103 | if(!empty($num)){ |
| 103 | return json_encode(Mailer::widget(['text' => $num, 'subject' => 'Обратный звонок'])); | 104 | return json_encode(Mailer::widget(['text' => $num, 'subject' => 'Обратный звонок'])); |
| 104 | } | 105 | } |
| 105 | 106 | ||
| 106 | break; | 107 | break; |
| 108 | + case "consultation": | ||
| 109 | + $num = Yii::$app->request->post('num'); | ||
| 110 | + $name = Yii::$app->request->post('name'); | ||
| 111 | + | ||
| 112 | + if(!empty($num)){ | ||
| 113 | + return json_encode(Mailer::widget(['text' => "Номер телефона".$num.";<br>Имя:".$name, 'subject' => 'Обратный звонок'])); | ||
| 114 | + } | ||
| 115 | + break; | ||
| 116 | + | ||
| 107 | 117 | ||
| 108 | } | 118 | } |
| 109 | } | 119 | } |