Commit 7754a925b9c9e48706e1813e626c2589fe7477a1
1 parent
f1a1680e
Отправка сообщений (1)
Showing
9 changed files
with
110 additions
and
28 deletions
Show diff stats
common/config/main.php
@@ -52,5 +52,17 @@ | @@ -52,5 +52,17 @@ | ||
52 | 'useFilename' => true, | 52 | 'useFilename' => true, |
53 | 'absoluteUrl' => false, | 53 | 'absoluteUrl' => false, |
54 | ], | 54 | ], |
55 | + 'mailer' => [ | ||
56 | + 'class' => 'yii\swiftmailer\Mailer', | ||
57 | + 'viewPath'=>'@common/mail', | ||
58 | + 'transport' => [ | ||
59 | + 'class' => 'Swift_SmtpTransport', | ||
60 | + 'host' => 'smtp.gmail.com', | ||
61 | + 'username' => 'kbenergy.kiev@gmail.com', | ||
62 | + 'password' => '', | ||
63 | + 'port' => '587', | ||
64 | + 'encryption' => 'tls', | ||
65 | + ], | ||
66 | + ], | ||
55 | ], | 67 | ], |
56 | ]; | 68 | ]; |
common/config/settings.php
@@ -5,7 +5,7 @@ return [ | @@ -5,7 +5,7 @@ return [ | ||
5 | 'phone' => '+38 (068) 380-39-82', | 5 | 'phone' => '+38 (068) 380-39-82', |
6 | 'phone2' => '', | 6 | 'phone2' => '', |
7 | 'skype' => '', | 7 | 'skype' => '', |
8 | - 'email' => 'zhegal@gmail.com', | 8 | + 'email' => 'kbenergy.kiev@gmail.com', |
9 | 'house' => '1-М', | 9 | 'house' => '1-М', |
10 | 'street' => 'пр. М. Бажана', | 10 | 'street' => 'пр. М. Бажана', |
11 | 'office' => '25', | 11 | 'office' => '25', |
1 | +<?php | ||
2 | + | ||
3 | +/** | ||
4 | + * @var \common\models\Feedback $model | ||
5 | + */ | ||
6 | + | ||
7 | +?> | ||
8 | + | ||
9 | +<table> | ||
10 | + <tr> | ||
11 | + <td colspan="2"><?php echo $model->title; ?></td> | ||
12 | + </tr> | ||
13 | + <tr> | ||
14 | + <td><hr/></td> | ||
15 | + </tr> | ||
16 | + <tr> | ||
17 | + <td><b>Имя: </b></td> | ||
18 | + <td><?php echo $model->name; ?></td> | ||
19 | + </tr> | ||
20 | + <tr> | ||
21 | + <td><b>Email: </b></td> | ||
22 | + <td><?php echo $model->email; ?></td> | ||
23 | + </tr> | ||
24 | + <tr> | ||
25 | + <td><b>Телефон: </b></td> | ||
26 | + <td><?php echo $model->phone; ?></td> | ||
27 | + </tr> | ||
28 | + <tr> | ||
29 | + <td><b>Текст сообщения: </b></td> | ||
30 | + <td><?php echo $model->message; ?></td> | ||
31 | + </tr> | ||
32 | +</table> |
common/models/Feedback.php
@@ -12,6 +12,7 @@ use yii\db\ActiveRecord; | @@ -12,6 +12,7 @@ use yii\db\ActiveRecord; | ||
12 | * | 12 | * |
13 | * @property integer $id | 13 | * @property integer $id |
14 | * @property string $name | 14 | * @property string $name |
15 | + * @property string $title | ||
15 | * @property string $email | 16 | * @property string $email |
16 | * @property string $phone | 17 | * @property string $phone |
17 | * @property string $message | 18 | * @property string $message |
frontend/controllers/SiteController.php
1 | <?php | 1 | <?php |
2 | namespace frontend\controllers; | 2 | namespace frontend\controllers; |
3 | - | ||
4 | - use artbox\core\models\Feedback; | 3 | + |
4 | + use common\models\Feedback; | ||
5 | use common\models\Settings; | 5 | use common\models\Settings; |
6 | use Yii; | 6 | use Yii; |
7 | use yii\web\BadRequestHttpException; | 7 | use yii\web\BadRequestHttpException; |
@@ -106,6 +106,11 @@ | @@ -106,6 +106,11 @@ | ||
106 | } else { | 106 | } else { |
107 | $model = new Feedback(); | 107 | $model = new Feedback(); |
108 | if ($model->load(Yii::$app->request->post()) && $model->save()) { | 108 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
109 | + Yii::$app->mailer->compose('feedback.php', ['model' => $model]) | ||
110 | + ->setFrom('zhegal@gmail.com') | ||
111 | + ->setTo($model->email) | ||
112 | + ->setSubject($model->title) | ||
113 | + ->send(); | ||
109 | return [ | 114 | return [ |
110 | 'success' => true, | 115 | 'success' => true, |
111 | 'message' => 'Success message', | 116 | 'message' => 'Success message', |
frontend/views/layouts/main.php
@@ -306,19 +306,19 @@ _________________________________________________________ --> | @@ -306,19 +306,19 @@ _________________________________________________________ --> | ||
306 | 'items' => [ | 306 | 'items' => [ |
307 | [ | 307 | [ |
308 | 'label' => \Yii::t('app', 'Чому ми'), | 308 | 'label' => \Yii::t('app', 'Чому ми'), |
309 | - 'url' => [ '#section1' ], | 309 | + 'url' => [ '../#section1' ], |
310 | ], | 310 | ], |
311 | [ | 311 | [ |
312 | 'label' => \Yii::t('app', 'Наші проекти'), | 312 | 'label' => \Yii::t('app', 'Наші проекти'), |
313 | - 'url' => [ '#section2' ], | 313 | + 'url' => [ '../#section2' ], |
314 | ], | 314 | ], |
315 | [ | 315 | [ |
316 | 'label' => \Yii::t('app', '10 кроків до енергонезалежності'), | 316 | 'label' => \Yii::t('app', '10 кроків до енергонезалежності'), |
317 | - 'url' => [ '#section3' ], | 317 | + 'url' => [ '../#section3' ], |
318 | ], | 318 | ], |
319 | [ | 319 | [ |
320 | 'label' => \Yii::t('app', 'Контакти'), | 320 | 'label' => \Yii::t('app', 'Контакти'), |
321 | - 'url' => [ '#section4' ], | 321 | + 'url' => [ '../#section4' ], |
322 | ], | 322 | ], |
323 | ], | 323 | ], |
324 | 'options' => [ | 324 | 'options' => [ |
@@ -379,6 +379,9 @@ _________________________________________________________ --> | @@ -379,6 +379,9 @@ _________________________________________________________ --> | ||
379 | ] | 379 | ] |
380 | ); ?> | 380 | ); ?> |
381 | 381 | ||
382 | + <?= $form->field($feedback, 'title') | ||
383 | + ->hiddenInput(); ?> | ||
384 | + | ||
382 | <?= $form->field($feedback, 'name') | 385 | <?= $form->field($feedback, 'name') |
383 | ->textInput(); ?> | 386 | ->textInput(); ?> |
384 | 387 | ||
@@ -479,7 +482,7 @@ _________________________________________________________ --> | @@ -479,7 +482,7 @@ _________________________________________________________ --> | ||
479 | <?php | 482 | <?php |
480 | } | 483 | } |
481 | ?> | 484 | ?> |
482 | - <a href="#" class="btn btn-template-transparent-primary" data-toggle="modal" data-target="#feedback-modal">Напишіть нам</a> | 485 | + <a href="#" class="btn btn-template-transparent-primary modaled" data-title="Зворотній зв'язок" data-toggle="modal" data-target="#feedback-modal">Напишіть нам</a> |
483 | </div> | 486 | </div> |
484 | 487 | ||
485 | <div class="col-md-4 col-sm-12 col-md-offset-2"> | 488 | <div class="col-md-4 col-sm-12 col-md-offset-2"> |
frontend/views/site/index.php
@@ -202,15 +202,15 @@ $this->registerJs($js, View::POS_END); | @@ -202,15 +202,15 @@ $this->registerJs($js, View::POS_END); | ||
202 | </div> | 202 | </div> |
203 | </div> | 203 | </div> |
204 | <div class="head_video_buttons"> | 204 | <div class="head_video_buttons"> |
205 | - <a href="#" class="btn button1 icon_phone" data-toggle="modal" data-target="#feedback-modal" style="width: 200px;">Замовити <span>консультацію</span></a> | ||
206 | - <a href="#" class="btn button2 right" data-toggle="modal" data-target="#feedback-modal">Розрахувати <span>вартість проекту</span></a> | 205 | + <a href="#" class="btn button1 icon_phone modaled" data-title="Замовити консультацію" data-toggle="modal" data-target="#feedback-modal" style="width: 200px;">Замовити <span>консультацію</span></a> |
206 | + <a href="#" class="btn button2 right modaled" data-title="Розрахувати вартість проекту" data-toggle="modal" data-target="#feedback-modal">Розрахувати <span>вартість проекту</span></a> | ||
207 | </div> | 207 | </div> |
208 | </div> | 208 | </div> |
209 | </div> | 209 | </div> |
210 | </div> | 210 | </div> |
211 | </section> | 211 | </section> |
212 | 212 | ||
213 | -<section class="bar background-kben block-why"> | 213 | +<section class="bar background-kben block-why" id="section1"> |
214 | <div class="container"> | 214 | <div class="container"> |
215 | <div class="col-md-12"> | 215 | <div class="col-md-12"> |
216 | <div class="heading text-left"><h2>Чому ми</h2></div> | 216 | <div class="heading text-left"><h2>Чому ми</h2></div> |
@@ -242,7 +242,7 @@ $this->registerJs($js, View::POS_END); | @@ -242,7 +242,7 @@ $this->registerJs($js, View::POS_END); | ||
242 | <div class="box-simple"> | 242 | <div class="box-simple"> |
243 | <div class="icon icon_why" id="icon04"></div> | 243 | <div class="icon icon_why" id="icon04"></div> |
244 | <h3>Енергоаудит</h3> | 244 | <h3>Енергоаудит</h3> |
245 | - <p>перед встановленням ми робимо повний аналіз вашої домашньої енергосистеми</p> | 245 | + <p>перед встановленням ми робимо повний аналіз вашої енергосистеми</p> |
246 | </div> | 246 | </div> |
247 | </div> | 247 | </div> |
248 | <div class="col-md-4"> | 248 | <div class="col-md-4"> |
@@ -255,14 +255,14 @@ $this->registerJs($js, View::POS_END); | @@ -255,14 +255,14 @@ $this->registerJs($js, View::POS_END); | ||
255 | </div> | 255 | </div> |
256 | <div class="row"> | 256 | <div class="row"> |
257 | <div class="col-md-12" style="text-align:center;"> | 257 | <div class="col-md-12" style="text-align:center;"> |
258 | - <a href="#" class="btn button1 icon_phone" data-toggle="modal" data-target="#feedback-modal">Замовити <span>консультацію</span></a> | 258 | + <a href="#" class="btn button1 icon_phone modaled" data-title="Замовити консультацію" data-toggle="modal" data-target="#feedback-modal">Замовити <span>консультацію</span></a> |
259 | </div> | 259 | </div> |
260 | </div> | 260 | </div> |
261 | </div> | 261 | </div> |
262 | </div> | 262 | </div> |
263 | </section> | 263 | </section> |
264 | 264 | ||
265 | -<section class="bar background-white"> | 265 | +<section class="bar background-white" id="section2"> |
266 | <div class="container"> | 266 | <div class="container"> |
267 | <div class="col-md-12"> | 267 | <div class="col-md-12"> |
268 | <div class="heading text-left"> | 268 | <div class="heading text-left"> |
@@ -289,23 +289,23 @@ $this->registerJs($js, View::POS_END); | @@ -289,23 +289,23 @@ $this->registerJs($js, View::POS_END); | ||
289 | </div> | 289 | </div> |
290 | <div class="col-md-4"> | 290 | <div class="col-md-4"> |
291 | <div class="col-md-12 row project-right"> | 291 | <div class="col-md-12 row project-right"> |
292 | - <a href="#" class="open_gal" id="gal01"> | ||
293 | - <p class="pr_title">Освітлення Харківського шосе</p> | ||
294 | - <div class="pr_cover"><img src="../img/pic02.jpg"></div> | 292 | + <a href="#" class="open_gal" id="gal02"> |
293 | + <p class="pr_title">Металоконструкція. Власне виробництво</p> | ||
294 | + <div class="pr_cover"><img src="../img/pic01.jpg"></div> | ||
295 | </a> | 295 | </a> |
296 | <div class="buttons text-right row"> | 296 | <div class="buttons text-right row"> |
297 | - <a href="#" class="open_gal sqre_btn blue_arrow" id="gal01"></a> | ||
298 | - <a href="#" class="btn sqre_btn yellow_calc" data-toggle="modal" data-target="#feedback-modal"></a> | 297 | + <a href="#" class="open_gal sqre_btn blue_arrow" id="gal02"></a> |
298 | + <a href="#" class="btn sqre_btn yellow_calc modaled" data-title="Металоконструкція. Розрахувати вартість проекту" data-toggle="modal" data-target="#feedback-modal"></a> | ||
299 | </div> | 299 | </div> |
300 | </div> | 300 | </div> |
301 | <div class="col-md-12 row project-right"> | 301 | <div class="col-md-12 row project-right"> |
302 | - <a href="#" class="open_gal" id="gal02"> | ||
303 | - <p class="pr_title">Металоконструкція. Власне виробництво</p> | ||
304 | - <div class="pr_cover"><img src="../img/pic01.jpg"></div> | 302 | + <a href="#" class="open_gal" id="gal01"> |
303 | + <p class="pr_title">Освітлення Харківського шосе</p> | ||
304 | + <div class="pr_cover"><img src="../img/pic02.jpg"></div> | ||
305 | </a> | 305 | </a> |
306 | <div class="buttons text-right row"> | 306 | <div class="buttons text-right row"> |
307 | - <a href="#" class="open_gal sqre_btn blue_arrow" id="gal02"></a> | ||
308 | - <a href="#" class="btn sqre_btn yellow_calc" data-toggle="modal" data-target="#feedback-modal"></a> | 307 | + <a href="#" class="open_gal sqre_btn blue_arrow" id="gal01"></a> |
308 | + <a href="#" class="btn sqre_btn yellow_calc modaled" data-title="Освітлення Харківського шосе. Розрахувати вартість проекту" data-toggle="modal" data-target="#feedback-modal"></a> | ||
309 | </div> | 309 | </div> |
310 | </div> | 310 | </div> |
311 | <div class="col-md-12 row project-right"> | 311 | <div class="col-md-12 row project-right"> |
@@ -316,7 +316,7 @@ $this->registerJs($js, View::POS_END); | @@ -316,7 +316,7 @@ $this->registerJs($js, View::POS_END); | ||
316 | </a> | 316 | </a> |
317 | <div class="buttons text-right row"> | 317 | <div class="buttons text-right row"> |
318 | <a href="#" class="open_gal sqre_btn blue_arrow" id="gal03"></a> | 318 | <a href="#" class="open_gal sqre_btn blue_arrow" id="gal03"></a> |
319 | - <a href="#" class="btn sqre_btn yellow_calc" data-toggle="modal" data-target="#feedback-modal"></a> | 319 | + <a href="#" class="btn sqre_btn yellow_calc modaled" data-title="Укртрансгаз. Розрахувати вартість проекту" data-toggle="modal" data-target="#feedback-modal"></a> |
320 | </div> | 320 | </div> |
321 | </div> | 321 | </div> |
322 | </div> | 322 | </div> |
@@ -325,7 +325,7 @@ $this->registerJs($js, View::POS_END); | @@ -325,7 +325,7 @@ $this->registerJs($js, View::POS_END); | ||
325 | </div> | 325 | </div> |
326 | </section> | 326 | </section> |
327 | 327 | ||
328 | -<section class="bar background-kben no-mb"> | 328 | +<section class="bar background-kben no-mb" id="section3"> |
329 | <div class="container"> | 329 | <div class="container"> |
330 | <div class="row showcase"> | 330 | <div class="row showcase"> |
331 | <div class="col-md-3 col-sm-6"> | 331 | <div class="col-md-3 col-sm-6"> |
@@ -362,7 +362,7 @@ $this->registerJs($js, View::POS_END); | @@ -362,7 +362,7 @@ $this->registerJs($js, View::POS_END); | ||
362 | <!-- /.container --> | 362 | <!-- /.container --> |
363 | </section> | 363 | </section> |
364 | 364 | ||
365 | -<section class="bar background-white"> | 365 | +<section class="bar background-white" id="section4"> |
366 | <div class="container"> | 366 | <div class="container"> |
367 | <div class="col-md-12"> | 367 | <div class="col-md-12"> |
368 | <div class="heading text-left"> | 368 | <div class="heading text-left"> |
@@ -455,7 +455,7 @@ $this->registerJs($js, View::POS_END); | @@ -455,7 +455,7 @@ $this->registerJs($js, View::POS_END); | ||
455 | <p class="text-center">Або звернутись до нас та</p> | 455 | <p class="text-center">Або звернутись до нас та</p> |
456 | </div> | 456 | </div> |
457 | <div class="col-md-12" style="text-align:center;"> | 457 | <div class="col-md-12" style="text-align:center;"> |
458 | - <a href="#" class="btn button1 icon_stat" data-toggle="modal" data-target="#feedback-modal">Замовити <span>електростанцію</span></a> | 458 | + <a href="#" class="btn button1 icon_stat modaled" data-title="Замовити електростанцію" data-toggle="modal" data-target="#feedback-modal">Замовити <span>електростанцію</span></a> |
459 | </div> | 459 | </div> |
460 | </div> | 460 | </div> |
461 | </div> | 461 | </div> |
frontend/web/css/style.css
@@ -167,4 +167,10 @@ a.sqre_btn { | @@ -167,4 +167,10 @@ a.sqre_btn { | ||
167 | display: inline-block; | 167 | display: inline-block; |
168 | position: relative; | 168 | position: relative; |
169 | width: 100%; | 169 | width: 100%; |
170 | +} | ||
171 | +.field-feedback-title{display:none!important;} | ||
172 | +#footer { | ||
173 | + background: #0080ca; | ||
174 | + padding: 50px 0; | ||
175 | + color: #ffffff; | ||
170 | } | 176 | } |
171 | \ No newline at end of file | 177 | \ No newline at end of file |
frontend/web/js/script.js
@@ -178,6 +178,24 @@ $( | @@ -178,6 +178,24 @@ $( | ||
178 | w: 960, | 178 | w: 960, |
179 | h: 535, | 179 | h: 535, |
180 | title: 'Нами розроблена металоконструкція для встановлення сонячних панелей для наземних сонячних електростанцій, яка може застосовуватися як для промислових об\'єктів так і для приватних домоволодінь.', | 180 | title: 'Нами розроблена металоконструкція для встановлення сонячних панелей для наземних сонячних електростанцій, яка може застосовуватися як для промислових об\'єктів так і для приватних домоволодінь.', |
181 | + }, | ||
182 | + { | ||
183 | + src: '../img/galpics/15.jpg', | ||
184 | + w: 1398, | ||
185 | + h: 790, | ||
186 | + title: 'Нами розроблена металоконструкція для встановлення сонячних панелей для наземних сонячних електростанцій, яка може застосовуватися як для промислових об\'єктів так і для приватних домоволодінь.', | ||
187 | + }, | ||
188 | + { | ||
189 | + src: '../img/galpics/16.jpg', | ||
190 | + w: 1054, | ||
191 | + h: 790, | ||
192 | + title: 'Нами розроблена металоконструкція для встановлення сонячних панелей для наземних сонячних електростанцій, яка може застосовуватися як для промислових об\'єктів так і для приватних домоволодінь.', | ||
193 | + }, | ||
194 | + { | ||
195 | + src: '../img/galpics/17.jpg', | ||
196 | + w: 1054, | ||
197 | + h: 790, | ||
198 | + title: 'Нами розроблена металоконструкція для встановлення сонячних панелей для наземних сонячних електростанцій, яка може застосовуватися як для промислових об\'єктів так і для приватних домоволодінь.', | ||
181 | } | 199 | } |
182 | ]; | 200 | ]; |
183 | 201 | ||
@@ -233,5 +251,10 @@ $( | @@ -233,5 +251,10 @@ $( | ||
233 | return false; | 251 | return false; |
234 | }); | 252 | }); |
235 | 253 | ||
254 | + | ||
255 | + $(".modaled").on('click', function(){ | ||
256 | + $(".modal-title#Login").text($(this).data('title')); | ||
257 | + $(".field-feedback-title #feedback-title").val($(this).data('title')); | ||
258 | + }); | ||
236 | } | 259 | } |
237 | ); | 260 | ); |
238 | \ No newline at end of file | 261 | \ No newline at end of file |