Commit 10ec2a3b1b4e5eb1f0d5cfa29c7be3579671a86d
1 parent
d866a1ad
feedback
Showing
9 changed files
with
669 additions
and
481 deletions
Show diff stats
backend/controllers/FeedbackController.php
@@ -44,12 +44,9 @@ | @@ -44,12 +44,9 @@ | ||
44 | 'index' => [ | 44 | 'index' => [ |
45 | 'class' => Index::className(), | 45 | 'class' => Index::className(), |
46 | 'columns' => [ | 46 | 'columns' => [ |
47 | - 'name' => [ | 47 | + 'phone' => [ |
48 | 'type' => Index::ACTION_COL, | 48 | 'type' => Index::ACTION_COL, |
49 | ], | 49 | ], |
50 | - 'email' => [ | ||
51 | - 'type' => Index::STRING_COL | ||
52 | - ], | ||
53 | 'status' => [ | 50 | 'status' => [ |
54 | 'type' => Index::STATUS_COL, | 51 | 'type' => Index::STATUS_COL, |
55 | ], | 52 | ], |
@@ -74,22 +71,10 @@ | @@ -74,22 +71,10 @@ | ||
74 | ], | 71 | ], |
75 | 'fields' => [ | 72 | 'fields' => [ |
76 | [ | 73 | [ |
77 | - 'name' => 'name', | ||
78 | - 'type' => Form::STRING, | ||
79 | - ], | ||
80 | - [ | ||
81 | - 'name' => 'email', | ||
82 | - 'type' => Form::STRING, | ||
83 | - ], | ||
84 | - [ | ||
85 | 'name' => 'phone', | 74 | 'name' => 'phone', |
86 | 'type' => Form::STRING, | 75 | 'type' => Form::STRING, |
87 | ], | 76 | ], |
88 | [ | 77 | [ |
89 | - 'name' => 'message', | ||
90 | - 'type' => Form::TEXTAREA, | ||
91 | - ], | ||
92 | - [ | ||
93 | 'name' => 'ip', | 78 | 'name' => 'ip', |
94 | 'type' => Form::STRING, | 79 | 'type' => Form::STRING, |
95 | ], | 80 | ], |
backend/views/feedback/_form.php
@@ -11,12 +11,19 @@ | @@ -11,12 +11,19 @@ | ||
11 | <div class="feedback-form"> | 11 | <div class="feedback-form"> |
12 | 12 | ||
13 | <?php $form = ActiveForm::begin(); ?> | 13 | <?php $form = ActiveForm::begin(); ?> |
14 | - | ||
15 | - <?= $form->field($model, 'name') | ||
16 | - ->textInput([ 'maxlength' => true ]) ?> | ||
17 | - | ||
18 | - <?= $form->field($model, 'email') | ||
19 | - ->textInput([ 'maxlength' => true ]) ?> | 14 | + <?php |
15 | + switch ($model->time){ | ||
16 | + case 1: | ||
17 | + echo "<p>В течении 30 минут</p>"; | ||
18 | + break; | ||
19 | + case 2: | ||
20 | + echo "<p>C 9.00 до 12.00</p>"; | ||
21 | + break; | ||
22 | + case 3: | ||
23 | + echo "<p>C 12.00 до 18.00</p>"; | ||
24 | + break; | ||
25 | + } | ||
26 | + ?> | ||
20 | 27 | ||
21 | <?= $form->field($model, 'phone') | 28 | <?= $form->field($model, 'phone') |
22 | ->textInput([ 'maxlength' => true ]) ?> | 29 | ->textInput([ 'maxlength' => true ]) ?> |
common/models/Feedback.php
@@ -26,9 +26,16 @@ | @@ -26,9 +26,16 @@ | ||
26 | const SCENARIO_FEEDBACK = 'feedback'; | 26 | const SCENARIO_FEEDBACK = 'feedback'; |
27 | const SCENARIO_CALLBACK = 'callback'; | 27 | const SCENARIO_CALLBACK = 'callback'; |
28 | 28 | ||
29 | + const DURING_30_MIN = '1'; | ||
30 | + | ||
31 | + const FROM_9_12 = '2'; | ||
32 | + | ||
33 | + const FROM_12_18 = '3' ; | ||
29 | 34 | ||
30 | public $returnUrl; | 35 | public $returnUrl; |
31 | 36 | ||
37 | + public $agree; | ||
38 | + | ||
32 | /** | 39 | /** |
33 | * @inheritdoc | 40 | * @inheritdoc |
34 | */ | 41 | */ |
@@ -53,9 +60,9 @@ | @@ -53,9 +60,9 @@ | ||
53 | 'returnUrl', | 60 | 'returnUrl', |
54 | ], | 61 | ], |
55 | self::SCENARIO_CALLBACK => [ | 62 | self::SCENARIO_CALLBACK => [ |
56 | - 'name', | ||
57 | 'phone', | 63 | 'phone', |
58 | - 'message', | 64 | + 'time', |
65 | + 'agree', | ||
59 | 'returnUrl', | 66 | 'returnUrl', |
60 | ], | 67 | ], |
61 | ] | 68 | ] |
@@ -120,7 +127,6 @@ | @@ -120,7 +127,6 @@ | ||
120 | [ | 127 | [ |
121 | [ | 128 | [ |
122 | 'phone', | 129 | 'phone', |
123 | - 'name', | ||
124 | ], | 130 | ], |
125 | 'required', | 131 | 'required', |
126 | 'on' => self::SCENARIO_CALLBACK, | 132 | 'on' => self::SCENARIO_CALLBACK, |
@@ -151,7 +157,7 @@ | @@ -151,7 +157,7 @@ | ||
151 | ], | 157 | ], |
152 | [ | 158 | [ |
153 | [ | 159 | [ |
154 | - 'status', | 160 | + 'status' |
155 | ], | 161 | ], |
156 | 'boolean', | 162 | 'boolean', |
157 | ], | 163 | ], |
@@ -159,6 +165,17 @@ | @@ -159,6 +165,17 @@ | ||
159 | 'returnUrl', | 165 | 'returnUrl', |
160 | 'safe', | 166 | 'safe', |
161 | ], | 167 | ], |
168 | + [ | ||
169 | + [ 'time' ], 'integer' | ||
170 | + ], | ||
171 | + [ | ||
172 | + [ | ||
173 | + 'agree', | ||
174 | + ], | ||
175 | + 'in', | ||
176 | + 'range' => [ 1 ], | ||
177 | + 'allowArray' => false, | ||
178 | + ], | ||
162 | ]; | 179 | ]; |
163 | } | 180 | } |
164 | 181 |
common/models/Visit.php
console/migrations/m180613_101610_alter_package_table.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +use yii\db\Migration; | ||
4 | + | ||
5 | +/** | ||
6 | + * Class m180613_101610_alter_package_table | ||
7 | + */ | ||
8 | +class m180613_101610_alter_package_table extends Migration | ||
9 | +{ | ||
10 | + /** | ||
11 | + * {@inheritdoc} | ||
12 | + */ | ||
13 | + public function safeUp() | ||
14 | + { | ||
15 | + $this->addColumn('package', 'service_id', $this->integer()); | ||
16 | + | ||
17 | + $this->addForeignKey('package_service_fk', | ||
18 | + 'package', | ||
19 | + 'service_id', | ||
20 | + 'service', | ||
21 | + 'id', | ||
22 | + 'SET NULL', | ||
23 | + 'CASCADE'); | ||
24 | + } | ||
25 | + | ||
26 | + /** | ||
27 | + * {@inheritdoc} | ||
28 | + */ | ||
29 | + public function safeDown() | ||
30 | + { | ||
31 | + $this->dropForeignKey('package_service_fk', 'package'); | ||
32 | + $this->dropColumn('service_id', 'package'); | ||
33 | + } | ||
34 | + | ||
35 | + /* | ||
36 | + // Use up()/down() to run migration code without a transaction. | ||
37 | + public function up() | ||
38 | + { | ||
39 | + | ||
40 | + } | ||
41 | + | ||
42 | + public function down() | ||
43 | + { | ||
44 | + echo "m180613_101610_alter_package_table cannot be reverted.\n"; | ||
45 | + | ||
46 | + return false; | ||
47 | + } | ||
48 | + */ | ||
49 | +} |
console/migrations/m180712_081623_alter_table_visit.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +use yii\db\Migration; | ||
4 | + | ||
5 | +/** | ||
6 | + * Class m180712_081623_alter_table_visit | ||
7 | + */ | ||
8 | +class m180712_081623_alter_table_visit extends Migration | ||
9 | +{ | ||
10 | + /** | ||
11 | + * {@inheritdoc} | ||
12 | + */ | ||
13 | + public function safeUp() | ||
14 | + { | ||
15 | + $this->addColumn('feedback', 'time', $this->integer()); | ||
16 | + } | ||
17 | + | ||
18 | + /** | ||
19 | + * {@inheritdoc} | ||
20 | + */ | ||
21 | + public function safeDown() | ||
22 | + { | ||
23 | + $this->dropColumn('feedback', 'time'); | ||
24 | + } | ||
25 | + | ||
26 | + /* | ||
27 | + // Use up()/down() to run migration code without a transaction. | ||
28 | + public function up() | ||
29 | + { | ||
30 | + | ||
31 | + } | ||
32 | + | ||
33 | + public function down() | ||
34 | + { | ||
35 | + echo "m180712_081623_alter_table_visit cannot be reverted.\n"; | ||
36 | + | ||
37 | + return false; | ||
38 | + } | ||
39 | + */ | ||
40 | +} |
frontend/controllers/SiteController.php
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | namespace frontend\controllers; | 3 | namespace frontend\controllers; |
4 | 4 | ||
5 | use artbox\core\models\Alias; | 5 | use artbox\core\models\Alias; |
6 | - use artbox\core\models\Feedback; | 6 | + use common\models\Feedback; |
7 | use artbox\core\models\Language; | 7 | use artbox\core\models\Language; |
8 | use common\models\Comment; | 8 | use common\models\Comment; |
9 | use common\models\Package; | 9 | use common\models\Package; |
@@ -176,6 +176,17 @@ | @@ -176,6 +176,17 @@ | ||
176 | return $this->renderFile($meta[ 'uri' ]); | 176 | return $this->renderFile($meta[ 'uri' ]); |
177 | } | 177 | } |
178 | 178 | ||
179 | + public function actionCallback(){ | ||
180 | + \Yii::$app->response->format = Response::FORMAT_JSON; | ||
181 | + $model = new Feedback(); | ||
182 | + $model->scenario = Feedback::SCENARIO_CALLBACK; | ||
183 | + if ($model->load(\Yii::$app->request->post()) && $model->save()){ | ||
184 | + return ['success' => true]; | ||
185 | + }else{ | ||
186 | + return ['success' => false, 'errors' => $model->errors]; | ||
187 | + } | ||
188 | + } | ||
189 | + | ||
179 | public function actionFeedback() | 190 | public function actionFeedback() |
180 | { | 191 | { |
181 | Yii::$app->response->format = Response::FORMAT_JSON; | 192 | Yii::$app->response->format = Response::FORMAT_JSON; |
frontend/views/layouts/main.php
1 | <?php | 1 | <?php |
2 | - | 2 | + |
3 | /** | 3 | /** |
4 | * @var View $this | 4 | * @var View $this |
5 | * @var string $content | 5 | * @var string $content |
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | use artbox\core\helpers\ImageHelper; | 13 | use artbox\core\helpers\ImageHelper; |
14 | use artbox\core\helpers\Url; | 14 | use artbox\core\helpers\Url; |
15 | use artbox\core\models\Alias; | 15 | use artbox\core\models\Alias; |
16 | - use artbox\core\models\Feedback; | 16 | + use common\models\Feedback; |
17 | use artbox\core\models\Language; | 17 | use artbox\core\models\Language; |
18 | use artbox\core\models\PageCategory; | 18 | use artbox\core\models\PageCategory; |
19 | use artbox\core\models\User; | 19 | use artbox\core\models\User; |
@@ -31,9 +31,9 @@ | @@ -31,9 +31,9 @@ | ||
31 | use yii\helpers\Url as DefaultUrl; | 31 | use yii\helpers\Url as DefaultUrl; |
32 | use frontend\microdata\MicrodataFabric; | 32 | use frontend\microdata\MicrodataFabric; |
33 | use frontend\assets\MapAsset; | 33 | use frontend\assets\MapAsset; |
34 | - | ||
35 | - | ||
36 | -AppAsset::register($this); | 34 | + use yii\widgets\ActiveForm; |
35 | + | ||
36 | + AppAsset::register($this); | ||
37 | SliderAsset::register($this); | 37 | SliderAsset::register($this); |
38 | MapAsset::register($this); | 38 | MapAsset::register($this); |
39 | $user = \Yii::$app->user->identity; | 39 | $user = \Yii::$app->user->identity; |
@@ -54,207 +54,232 @@ AppAsset::register($this); | @@ -54,207 +54,232 @@ AppAsset::register($this); | ||
54 | [ | 54 | [ |
55 | 'language.alias', | 55 | 'language.alias', |
56 | 'services' => function (ActiveQuery $query) { | 56 | 'services' => function (ActiveQuery $query) { |
57 | - $query->where(['status' => true])->with( | ||
58 | - [ | ||
59 | - 'language.alias', | ||
60 | - 'services' => function (ActiveQuery $query) { | ||
61 | - $query->where(['status' => true])->with(['language.alias']); | ||
62 | - }, | ||
63 | - ] | ||
64 | - ); | 57 | + $query->where([ 'status' => true ]) |
58 | + ->with( | ||
59 | + [ | ||
60 | + 'language.alias', | ||
61 | + 'services' => function (ActiveQuery $query) { | ||
62 | + $query->where([ 'status' => true ]) | ||
63 | + ->with([ 'language.alias' ]); | ||
64 | + }, | ||
65 | + ] | ||
66 | + ); | ||
65 | }, | 67 | }, |
66 | ] | 68 | ] |
67 | - )->orderBy('sort') | 69 | + ) |
70 | + ->orderBy('sort') | ||
68 | ->all(); | 71 | ->all(); |
69 | - | ||
70 | - | ||
71 | -# для автоматической генерации SEO параметров (title/description) в ситуациях, когда этих параметров нету | ||
72 | -# мне нужно будет автоматически их подгенеривать, поэтому вместо $seo->title, которые является readOnly я использую эту переменную | ||
73 | -$seoTitleName = $seo->title; | ||
74 | -if ($seo->title == '' | ||
75 | - && \Yii::$app->controller->id == 'site' | ||
76 | - && \Yii::$app->controller->action->id == 'comments' | ||
77 | -) { | ||
78 | - $currentServiceId = (!empty(\Yii::$app->request->get('service_id'))) ? \Yii::$app->request->get('service_id') : 0; | ||
79 | - $serviceModel = new Service(['id' => $currentServiceId]); | ||
80 | - if ($currentServiceId !== 0) { | ||
81 | - $serviceName = $serviceModel->language->title; | ||
82 | - $seoTitleName = $this->params['breadcrumbs'][0] . ' - ' . $serviceName . ' - ' . \Yii::t('app', 'ABC short reverse'); | ||
83 | - } else $seoTitleName = $this->params['breadcrumbs'][0] . ' - ' . \Yii::t('app', 'General callbacks') . ' - ' . \Yii::t('app', 'ABC short reverse'); | ||
84 | - | ||
85 | -} | ||
86 | - | ||
87 | - | ||
88 | -//----------------------------------------------------------------------------------------------------------------------- | ||
89 | -// Блок с микроразметкой для FB | ||
90 | - | 72 | + |
73 | + # для автоматической генерации SEO параметров (title/description) в ситуациях, когда этих параметров нету | ||
74 | + # мне нужно будет автоматически их подгенеривать, поэтому вместо $seo->title, которые является readOnly я использую эту переменную | ||
75 | + $seoTitleName = $seo->title; | ||
76 | + if ($seo->title == '' && \Yii::$app->controller->id == 'site' && \Yii::$app->controller->action->id == 'comments') { | ||
77 | + $currentServiceId = ( !empty(\Yii::$app->request->get('service_id')) ) ? \Yii::$app->request->get( | ||
78 | + 'service_id' | ||
79 | + ) : 0; | ||
80 | + $serviceModel = new Service([ 'id' => $currentServiceId ]); | ||
81 | + if ($currentServiceId !== 0) { | ||
82 | + $serviceName = $serviceModel->language->title; | ||
83 | + $seoTitleName = $this->params[ 'breadcrumbs' ][ 0 ] . ' - ' . $serviceName . ' - ' . \Yii::t( | ||
84 | + 'app', | ||
85 | + 'ABC short reverse' | ||
86 | + ); | ||
87 | + } else { | ||
88 | + $seoTitleName = $this->params[ 'breadcrumbs' ][ 0 ] . ' - ' . \Yii::t( | ||
89 | + 'app', | ||
90 | + 'General callbacks' | ||
91 | + ) . ' - ' . \Yii::t('app', 'ABC short reverse'); | ||
92 | + } | ||
93 | + | ||
94 | + } | ||
95 | + | ||
96 | + //----------------------------------------------------------------------------------------------------------------------- | ||
97 | + // Блок с микроразметкой для FB | ||
98 | + | ||
91 | # $property нужно для property="og:type" FB | 99 | # $property нужно для property="og:type" FB |
92 | - switch (\Yii::$app->controller->id) | ||
93 | - { | 100 | + switch (\Yii::$app->controller->id) { |
94 | case "site": | 101 | case "site": |
95 | - $property='website'; | 102 | + $property = 'website'; |
96 | break; | 103 | break; |
97 | case "blog": | 104 | case "blog": |
98 | - $property='article'; | 105 | + $property = 'article'; |
99 | break; | 106 | break; |
100 | case 'service': | 107 | case 'service': |
101 | - $property='product'; | 108 | + $property = 'product'; |
102 | break; | 109 | break; |
103 | default: | 110 | default: |
104 | - $property='website'; | 111 | + $property = 'website'; |
105 | break; | 112 | break; |
106 | } | 113 | } |
107 | - | ||
108 | -$this->registerMetaTag( | ||
109 | - [ | ||
110 | - 'property'=>'og:description', | ||
111 | - 'content' => $seo->desc, | ||
112 | - ] | ||
113 | -); | ||
114 | -$this->registerMetaTag( | ||
115 | - [ | ||
116 | - 'property'=>"og:type", | ||
117 | - 'content' => $property, | ||
118 | - ] | ||
119 | -); | ||
120 | -$this->registerMetaTag( | ||
121 | - [ | ||
122 | - 'property'=>"og:url", | ||
123 | - 'content' => Url::current(), | ||
124 | - ] | ||
125 | -); | ||
126 | -$this->registerMetaTag( | ||
127 | - [ | ||
128 | - 'property'=>"og:title", | ||
129 | - 'content' =>$seo->title, | ||
130 | - ] | ||
131 | -); | ||
132 | -$this->registerMetaTag( | ||
133 | - [ | ||
134 | - 'name' => 'description', | ||
135 | - 'content' => (\Yii::$app->controller->id == 'site' && \Yii::$app->controller->action->id == 'comments' && $seo->desc == null) ? $seoTitleName : $seo->desc, | ||
136 | - ] | ||
137 | -); | ||
138 | - | ||
139 | -//---------------------------------------------------------------------------------------------------------------------- | ||
140 | - | ||
141 | - | 114 | + |
115 | + $this->registerMetaTag( | ||
116 | + [ | ||
117 | + 'property' => 'og:description', | ||
118 | + 'content' => $seo->desc, | ||
119 | + ] | ||
120 | + ); | ||
121 | + $this->registerMetaTag( | ||
122 | + [ | ||
123 | + 'property' => "og:type", | ||
124 | + 'content' => $property, | ||
125 | + ] | ||
126 | + ); | ||
127 | + $this->registerMetaTag( | ||
128 | + [ | ||
129 | + 'property' => "og:url", | ||
130 | + 'content' => Url::current(), | ||
131 | + ] | ||
132 | + ); | ||
133 | + $this->registerMetaTag( | ||
134 | + [ | ||
135 | + 'property' => "og:title", | ||
136 | + 'content' => $seo->title, | ||
137 | + ] | ||
138 | + ); | ||
139 | + $this->registerMetaTag( | ||
140 | + [ | ||
141 | + 'name' => 'description', | ||
142 | + 'content' => ( \Yii::$app->controller->id == 'site' && \Yii::$app->controller->action->id == 'comments' && $seo->desc == null ) ? $seoTitleName : $seo->desc, | ||
143 | + ] | ||
144 | + ); | ||
145 | + | ||
146 | + //---------------------------------------------------------------------------------------------------------------------- | ||
147 | + | ||
142 | $this->registerMetaTag( | 148 | $this->registerMetaTag( |
143 | [ | 149 | [ |
144 | 'name' => 'robots', | 150 | 'name' => 'robots', |
145 | -// 'content' => $seo->robots, | 151 | + // 'content' => $seo->robots, |
146 | 'content' => 'noindex,nofollow', | 152 | 'content' => 'noindex,nofollow', |
147 | ] | 153 | ] |
148 | ); | 154 | ); |
149 | $module = \Yii::$app->getModule('feedback'); | 155 | $module = \Yii::$app->getModule('feedback'); |
150 | - $aliases = Alias::find()->where(['route' => '{"0":"site/questions"}'])->indexBy('route')->andWhere(['language_id' => Language::getCurrent()->id])->asArray()->all(); | ||
151 | -$commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id":0}'])->indexBy('route')->andWhere(['language_id' => Language::getCurrent()->id])->asArray()->all(); | ||
152 | - | ||
153 | - | ||
154 | - | 156 | + $aliases = Alias::find() |
157 | + ->where([ 'route' => '{"0":"site/questions"}' ]) | ||
158 | + ->indexBy('route') | ||
159 | + ->andWhere([ 'language_id' => Language::getCurrent()->id ]) | ||
160 | + ->asArray() | ||
161 | + ->all(); | ||
162 | + $commentUrl = Alias::find() | ||
163 | + ->where([ 'route' => '{"0":"site/comments","service_id":0}' ]) | ||
164 | + ->indexBy('route') | ||
165 | + ->andWhere([ 'language_id' => Language::getCurrent()->id ]) | ||
166 | + ->asArray() | ||
167 | + ->all(); | ||
155 | 168 | ||
156 | ?> | 169 | ?> |
157 | 170 | ||
158 | <?php $this->beginPage() ?> | 171 | <?php $this->beginPage() ?> |
159 | <!DOCTYPE html > | 172 | <!DOCTYPE html > |
160 | <html xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html" lang="<?= \Yii::$app->language ?>"> | 173 | <html xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html" lang="<?= \Yii::$app->language ?>"> |
161 | - <head> | ||
162 | - | ||
163 | - <script type="text/javascript"> | ||
164 | - WebFontConfig = { | ||
165 | - google: {families: [ 'Ubuntu:400,500,700' ]} | ||
166 | - }; | ||
167 | - (function() { | ||
168 | - var wf = document.createElement('script'); | ||
169 | - wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js'; | ||
170 | - wf.type = 'text/javascript'; | ||
171 | - wf.async = 'true'; | ||
172 | - var s = document.getElementsByTagName('script')[ 0 ]; | ||
173 | - s.parentNode.insertBefore(wf, s); | ||
174 | - })(); </script> | ||
175 | - | ||
176 | - | ||
177 | - <!-- Global site tag (gtag.js) - Google Analytics --> | ||
178 | - <script async src="https://www.googletagmanager.com/gtag/js?id=UA-120861020-1"></script> | ||
179 | - <script> | ||
180 | - window.dataLayer = window.dataLayer || []; | ||
181 | - function gtag(){dataLayer.push(arguments);} | ||
182 | - gtag('js', new Date()); | ||
183 | - | ||
184 | - gtag('config', 'UA-120861020-1'); | ||
185 | - </script> | ||
186 | - <!-- Google Tag Manager --> | ||
187 | - <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | ||
188 | - new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | ||
189 | - j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | ||
190 | - 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | ||
191 | - })(window,document,'script','dataLayer','GTM-N6R7982');</script> | ||
192 | - <!-- End Google Tag Manager --> | ||
193 | - <meta charset="<?= \Yii::$app->charset ?>"> | ||
194 | - <meta name="viewport" content="width=device-width"> | ||
195 | - <link type="image/x-icon" href="favicon.ico" rel="icon"> | ||
196 | - <?= Html::csrfMetaTags() ?> | ||
197 | - | ||
198 | - | ||
199 | - | ||
200 | - | 174 | + <head> |
175 | + | ||
176 | + <script type="text/javascript"> | ||
177 | + WebFontConfig = { | ||
178 | + google: {families: [ 'Ubuntu:400,500,700' ]} | ||
179 | + }; | ||
180 | + (function() { | ||
181 | + var wf = document.createElement('script'); | ||
182 | + wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js'; | ||
183 | + wf.type = 'text/javascript'; | ||
184 | + wf.async = 'true'; | ||
185 | + var s = document.getElementsByTagName('script')[ 0 ]; | ||
186 | + s.parentNode.insertBefore(wf, s); | ||
187 | + })(); </script> | ||
188 | + | ||
189 | + | ||
190 | + <!-- Global site tag (gtag.js) - Google Analytics --> | ||
191 | + <script async src="https://www.googletagmanager.com/gtag/js?id=UA-120861020-1"></script> | ||
192 | + <script> | ||
193 | + window.dataLayer = window.dataLayer || []; | ||
194 | + function gtag() { | ||
195 | + dataLayer.push(arguments); | ||
196 | + } | ||
197 | + gtag('js', new Date()); | ||
198 | + | ||
199 | + gtag('config', 'UA-120861020-1'); | ||
200 | + </script> | ||
201 | + <!-- Google Tag Manager --> | ||
202 | + <script>(function(w, d, s, l, i) { | ||
203 | + w[ l ] = w[ l ] || []; | ||
204 | + w[ l ].push({ | ||
205 | + 'gtm.start': new Date().getTime(), | ||
206 | + event: 'gtm.js' | ||
207 | + }); | ||
208 | + var f = d.getElementsByTagName(s)[ 0 ], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; | ||
209 | + j.async = true; | ||
210 | + j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; | ||
211 | + f.parentNode.insertBefore(j, f); | ||
212 | + })(window, document, 'script', 'dataLayer', 'GTM-N6R7982');</script> | ||
213 | + <!-- End Google Tag Manager --> | ||
214 | + <meta charset="<?= \Yii::$app->charset ?>"> | ||
215 | + <meta name="viewport" content="width=device-width"> | ||
216 | + <link type="image/x-icon" href="favicon.ico" rel="icon"> | ||
217 | + <?= Html::csrfMetaTags() ?> | ||
218 | + | ||
219 | + | ||
201 | <title><?= Html::encode($seoTitleName); ?></title> | 220 | <title><?= Html::encode($seoTitleName); ?></title> |
202 | - <?php $this->head() ?> | ||
203 | - </head> | 221 | + <?php $this->head() ?> |
222 | + </head> | ||
204 | <body id="body"> | 223 | <body id="body"> |
205 | - <!-- Google Tag Manager (noscript) --> | ||
206 | - <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-N6R7982" | ||
207 | - height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> | ||
208 | - <!-- End Google Tag Manager (noscript) --> | 224 | + <!-- Google Tag Manager (noscript) --> |
225 | + <noscript> | ||
226 | + <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-N6R7982" | ||
227 | + height="0" width="0" style="display:none;visibility:hidden"></iframe> | ||
228 | + </noscript> | ||
229 | + <!-- End Google Tag Manager (noscript) --> | ||
209 | <?php $this->beginBody() ?> | 230 | <?php $this->beginBody() ?> |
210 | <!-- Google Tag Manager (noscript) --> | 231 | <!-- Google Tag Manager (noscript) --> |
211 | - <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-N6R7982" | ||
212 | - height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> | 232 | + <noscript> |
233 | + <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-N6R7982" | ||
234 | + height="0" width="0" style="display:none;visibility:hidden"></iframe> | ||
235 | + </noscript> | ||
213 | <!-- End Google Tag Manager (noscript) --> | 236 | <!-- End Google Tag Manager (noscript) --> |
214 | - <div class="transition-loader"> | ||
215 | - <div class="transition-loader-inner"> | ||
216 | - <label></label> | ||
217 | - <label></label> | ||
218 | - <label></label> | ||
219 | - <label></label> | ||
220 | - <label></label> | ||
221 | - <label></label> | ||
222 | - </div> | ||
223 | - </div> | 237 | + <div class="transition-loader"> |
238 | + <div class="transition-loader-inner"> | ||
239 | + <label></label> | ||
240 | + <label></label> | ||
241 | + <label></label> | ||
242 | + <label></label> | ||
243 | + <label></label> | ||
244 | + <label></label> | ||
245 | + </div> | ||
246 | + </div> | ||
224 | <header id="header_" class="section-box-header"> | 247 | <header id="header_" class="section-box-header"> |
225 | <div class="section-box-header-columns"> | 248 | <div class="section-box-header-columns"> |
226 | <div class="container"> | 249 | <div class="container"> |
227 | <div class="row"> | 250 | <div class="row"> |
228 | <div class="col-xs-7 col-sm-3 col-md-2 col-lg-2 logo-wrapp"> | 251 | <div class="col-xs-7 col-sm-3 col-md-2 col-lg-2 logo-wrapp"> |
229 | - | ||
230 | - <a itemprop="url" content="<?=\Yii::$app->homeUrl;?>" | ||
231 | - <?php if(DefaultUrl::current()!=='/site/index'): ?> | ||
232 | - href= "<?php echo \frontend\helpers\Url::home(); ?>"> | 252 | + |
253 | + <a itemprop="url" content="<?= \Yii::$app->homeUrl; ?>" | ||
254 | + <?php if ( DefaultUrl::current() !== '/site/index' ): ?> | ||
255 | + href="<?php echo \frontend\helpers\Url::home(); ?>"> | ||
233 | <?php else: ?> | 256 | <?php else: ?> |
234 | - > | ||
235 | - <?php endif;?> | ||
236 | - | 257 | + > |
258 | + <?php endif; ?> | ||
259 | + | ||
237 | <?php | 260 | <?php |
238 | - if ($settings->logo != null){ | ||
239 | - echo | ||
240 | - "<img src='/storage/logo/".$settings->logo."' alt='".\Yii::t('app','ABC short')."' | ||
241 | - title='".\Yii::t('app','ABC short')."' | 261 | + if ($settings->logo != null) { |
262 | + echo "<img src='/storage/logo/" . $settings->logo . "' alt='" . \Yii::t( | ||
263 | + 'app', | ||
264 | + 'ABC short' | ||
265 | + ) . "' | ||
266 | + title='" . \Yii::t('app', 'ABC short') . "' | ||
242 | >"; | 267 | >"; |
243 | - }else{ | ||
244 | - echo ImageHelper::set(null) | ||
245 | - ->setHeight(44) | ||
246 | - ->renderImage( | ||
247 | - [ | ||
248 | - 'alt' => $settings->name, | ||
249 | - #'alt'=>\Yii::t('app','ABC short'), | ||
250 | - 'title'=>\Yii::t('app','ABC short'), | ||
251 | - ] | ||
252 | - ); | ||
253 | - } | ||
254 | - | 268 | + } else { |
269 | + echo ImageHelper::set(null) | ||
270 | + ->setHeight(44) | ||
271 | + ->renderImage( | ||
272 | + [ | ||
273 | + 'alt' => $settings->name, | ||
274 | + #'alt'=>\Yii::t('app','ABC short'), | ||
275 | + 'title' => \Yii::t('app', 'ABC short'), | ||
276 | + ] | ||
277 | + ); | ||
278 | + } | ||
279 | + | ||
255 | ?> | 280 | ?> |
256 | - | ||
257 | - | 281 | + |
282 | + | ||
258 | </a> | 283 | </a> |
259 | </div> | 284 | </div> |
260 | <div class="col-sm-9 col-md-10 col-lg-10 header-col"> | 285 | <div class="col-sm-9 col-md-10 col-lg-10 header-col"> |
@@ -270,17 +295,17 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | @@ -270,17 +295,17 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | ||
270 | <td> | 295 | <td> |
271 | <div class="phone-header new-phone-header"> | 296 | <div class="phone-header new-phone-header"> |
272 | <?= $settings->phone ?> | 297 | <?= $settings->phone ?> |
273 | - | ||
274 | - <?php | ||
275 | - # если указаны дополнительные телефоны, указываем их в выпадающем меню | ||
276 | - if (!empty($settings->phone2)):?> | ||
277 | - <?php $phones2 = explode(';', $settings->phone2); ?> | ||
278 | - <div class="hidden-header-phone"> | ||
279 | - <?php foreach ($phones2 as $soloPhone2): ?> | ||
280 | - <?= Html::tag('p', $soloPhone2); ?> | ||
281 | - <?php endforeach; ?> | ||
282 | - </div> | ||
283 | - <?php endif; ?> | 298 | + |
299 | + <?php | ||
300 | + # если указаны дополнительные телефоны, указываем их в выпадающем меню | ||
301 | + if (!empty($settings->phone2)):?> | ||
302 | + <?php $phones2 = explode(';', $settings->phone2); ?> | ||
303 | + <div class="hidden-header-phone"> | ||
304 | + <?php foreach ($phones2 as $soloPhone2): ?> | ||
305 | + <?= Html::tag('p', $soloPhone2); ?> | ||
306 | + <?php endforeach; ?> | ||
307 | + </div> | ||
308 | + <?php endif; ?> | ||
284 | </div> | 309 | </div> |
285 | </td> | 310 | </td> |
286 | </tr> | 311 | </tr> |
@@ -293,23 +318,26 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | @@ -293,23 +318,26 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | ||
293 | </div> | 318 | </div> |
294 | 319 | ||
295 | <div class="hidden-xs btn-header-wr"> | 320 | <div class="hidden-xs btn-header-wr"> |
296 | - <span class="btn_ modal-link" data-form="write-to"><?=\Yii::t('app', 'Make an appointment') ?></span> | 321 | + <span class="btn_ modal-link" data-form="write-to"><?= \Yii::t('app', 'Make an appointment') ?></span> |
297 | </div> | 322 | </div> |
298 | - | 323 | + |
299 | <ul class="hidden-xs hidden-sm"> | 324 | <ul class="hidden-xs hidden-sm"> |
300 | - <li><a href="/vtoroe-mnenie" class="new"><span> <?=\Yii::t('app','Second thing')?> </span></a></li> | ||
301 | - <li> | ||
302 | - <a href="<?= (isset($aliases['{"0":"site/questions"}'])) ? Url::to(['alias' => $aliases['{"0":"site/questions"}']]) : | ||
303 | - Url::to(['site/questions']) ?>"><?= \Yii::t('app', 'Quest/Answer') ?></a></li> | ||
304 | - <li> | ||
305 | - <a href="<?= (isset($commentUrl['{"0":"site/comments","service_id":0}'])) ? Url::to(['/' . $commentUrl['{"0":"site/comments","service_id":0}']['value']]) : | ||
306 | - Url::to(['site/comments']) ?>"><?= \Yii::t('app', 'Callbacks') ?></a></li> | 325 | + <li><a href="/vtoroe-mnenie" class="new"><span> <?= \Yii::t('app', 'Second thing') ?> </span></a> |
326 | + </li> | ||
327 | + <li> | ||
328 | + <a href="<?= ( isset($aliases[ '{"0":"site/questions"}' ]) ) ? Url::to( | ||
329 | + [ 'alias' => $aliases[ '{"0":"site/questions"}' ] ] | ||
330 | + ) : Url::to([ 'site/questions' ]) ?>"><?= \Yii::t('app', 'Quest/Answer') ?></a></li> | ||
331 | + <li> | ||
332 | + <a href="<?= ( isset($commentUrl[ '{"0":"site/comments","service_id":0}' ]) ) ? Url::to( | ||
333 | + [ '/' . $commentUrl[ '{"0":"site/comments","service_id":0}' ][ 'value' ] ] | ||
334 | + ) : Url::to([ 'site/comments' ]) ?>"><?= \Yii::t('app', 'Callbacks') ?></a></li> | ||
307 | </ul> | 335 | </ul> |
308 | -<!-- --> | ||
309 | -<!-- <div class="lang-sep-wr hidden-xs hidden-sm">--> | ||
310 | -<!-- --> | ||
311 | -<!-- --><?php //echo LanguageWidget::widget() ?> | ||
312 | -<!-- </div>--> | 336 | + <!-- --> |
337 | + <!-- <div class="lang-sep-wr hidden-xs hidden-sm">--> | ||
338 | + <!-- --> | ||
339 | + <!-- --><?php //echo LanguageWidget::widget() ?> | ||
340 | + <!-- </div>--> | ||
313 | 341 | ||
314 | <div class="hidden-sm hidden-md hidden-lg icon_phone-header-mob btn_call"></div> | 342 | <div class="hidden-sm hidden-md hidden-lg icon_phone-header-mob btn_call"></div> |
315 | 343 | ||
@@ -334,22 +362,19 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | @@ -334,22 +362,19 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | ||
334 | ]; | 362 | ]; |
335 | } | 363 | } |
336 | $items[] = [ | 364 | $items[] = [ |
337 | - 'label' => \Yii::t('app', 'Prices'), | ||
338 | - 'url' => Url::to(['site/prices']), | 365 | + 'label' => \Yii::t('app', 'Prices'), |
366 | + 'url' => Url::to([ 'site/prices' ]), | ||
339 | 'options' => [ | 367 | 'options' => [ |
340 | - 'class' => 'active' | ||
341 | - ] | 368 | + 'class' => 'active', |
369 | + ], | ||
342 | ]; | 370 | ]; |
343 | $items[] = [ | 371 | $items[] = [ |
344 | 'label' => \Yii::t('app', 'Package offerings'), | 372 | 'label' => \Yii::t('app', 'Package offerings'), |
345 | - 'url' => Url::to(['package/index']), | 373 | + 'url' => Url::to([ 'package/index' ]), |
346 | ]; | 374 | ]; |
347 | - | ||
348 | - | ||
349 | - | ||
350 | - | 375 | + |
351 | ?> | 376 | ?> |
352 | - | 377 | + |
353 | <?php echo Nav::widget( | 378 | <?php echo Nav::widget( |
354 | [ | 379 | [ |
355 | 'items' => $items, | 380 | 'items' => $items, |
@@ -359,7 +384,7 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | @@ -359,7 +384,7 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | ||
359 | </nav> | 384 | </nav> |
360 | <div class="mobile-menu-hidden" style="display: none;"> | 385 | <div class="mobile-menu-hidden" style="display: none;"> |
361 | <div class="close-lang-mob"> | 386 | <div class="close-lang-mob"> |
362 | - | 387 | + |
363 | <div class="close-mobile-menu"></div> | 388 | <div class="close-mobile-menu"></div> |
364 | </div> | 389 | </div> |
365 | <div class="mobi-menu-catalog"> | 390 | <div class="mobi-menu-catalog"> |
@@ -367,12 +392,12 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | @@ -367,12 +392,12 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | ||
367 | $itemsMobile = []; | 392 | $itemsMobile = []; |
368 | foreach ($services as $service) { | 393 | foreach ($services as $service) { |
369 | /** | 394 | /** |
370 | - * @var Service $service; | 395 | + * @var Service $service ; |
371 | */ | 396 | */ |
372 | $servicesChild = []; | 397 | $servicesChild = []; |
373 | foreach ($service->services as $item) { | 398 | foreach ($service->services as $item) { |
374 | $level = []; | 399 | $level = []; |
375 | - foreach ($item->services as $child){ | 400 | + foreach ($item->services as $child) { |
376 | $level[] = [ | 401 | $level[] = [ |
377 | 'label' => $child->title, | 402 | 'label' => $child->title, |
378 | 'url' => Url::to([ 'alias' => $child->language->alias ]), | 403 | 'url' => Url::to([ 'alias' => $child->language->alias ]), |
@@ -391,15 +416,15 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | @@ -391,15 +416,15 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | ||
391 | ]; | 416 | ]; |
392 | } | 417 | } |
393 | $itemsMobile[] = [ | 418 | $itemsMobile[] = [ |
394 | - 'label' => \Yii::t('app', 'Prices'), | ||
395 | - 'url' => Url::to(['site/prices']), | 419 | + 'label' => \Yii::t('app', 'Prices'), |
420 | + 'url' => Url::to([ 'site/prices' ]), | ||
396 | 'options' => [ | 421 | 'options' => [ |
397 | - 'class' => 'active' | ||
398 | - ] | 422 | + 'class' => 'active', |
423 | + ], | ||
399 | ]; | 424 | ]; |
400 | $itemsMobile[] = [ | 425 | $itemsMobile[] = [ |
401 | 'label' => \Yii::t('app', 'Package offerings'), | 426 | 'label' => \Yii::t('app', 'Package offerings'), |
402 | - 'url' => Url::to(['package/index']), | 427 | + 'url' => Url::to([ 'package/index' ]), |
403 | ] | 428 | ] |
404 | ?> | 429 | ?> |
405 | <?php echo Nav::widget( | 430 | <?php echo Nav::widget( |
@@ -413,11 +438,12 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | @@ -413,11 +438,12 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | ||
413 | </div> | 438 | </div> |
414 | <div class="menu-second-mob"> | 439 | <div class="menu-second-mob"> |
415 | <ul class="footer-menu"> | 440 | <ul class="footer-menu"> |
416 | - | 441 | + |
417 | <li><a href="<?= Url::to([ 'site/contact' ]) ?>"><?= \Yii::t('app', 'Contacts') ?></a></li> | 442 | <li><a href="<?= Url::to([ 'site/contact' ]) ?>"><?= \Yii::t('app', 'Contacts') ?></a></li> |
418 | <li><a href="/vtoroe-mnenie" class="new"><span><?= \Yii::t('app', 'Second thing') ?></span></a></li> | 443 | <li><a href="/vtoroe-mnenie" class="new"><span><?= \Yii::t('app', 'Second thing') ?></span></a></li> |
419 | - <li><a href="<?=(isset($aliases['{"0":"site/questions"}'])) ? | ||
420 | - Url::to(['alias' => $aliases['{"0":"site/questions"}']]) : Url::to(['site/questions'])?>"> | 444 | + <li><a href="<?= ( isset($aliases[ '{"0":"site/questions"}' ]) ) ? Url::to( |
445 | + [ 'alias' => $aliases[ '{"0":"site/questions"}' ] ] | ||
446 | + ) : Url::to([ 'site/questions' ]) ?>"> | ||
421 | <?= \Yii::t('app', 'Quest/Answer') ?></a></li> | 447 | <?= \Yii::t('app', 'Quest/Answer') ?></a></li> |
422 | <li><a href="#"><?= \Yii::t('app', 'Callbacks') ?></a></li> | 448 | <li><a href="#"><?= \Yii::t('app', 'Callbacks') ?></a></li> |
423 | </ul> | 449 | </ul> |
@@ -425,78 +451,80 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | @@ -425,78 +451,80 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | ||
425 | 451 | ||
426 | <div class="mob-menu-btns"> | 452 | <div class="mob-menu-btns"> |
427 | <div class="style mob-menu-write"> | 453 | <div class="style mob-menu-write"> |
428 | - <span class="btn_ modal-link" data-form="write-to"><?= \Yii::t('app', 'Make an appointment') ?></span> | 454 | + <span class="btn_ modal-link" data-form="write-to"><?= \Yii::t('app', 'Make an appointment') ?></span> |
429 | </div> | 455 | </div> |
430 | <div class="style mob-menu-callback"> | 456 | <div class="style mob-menu-callback"> |
431 | <p><?= $settings->phone ?></p> | 457 | <p><?= $settings->phone ?></p> |
432 | - <span class="modal-link" data-form="callback"><?=\Yii::t('app','Callback');?></span> | 458 | + <span class="modal-link" data-form="callback"><?= \Yii::t('app', 'Callback'); ?></span> |
433 | </div> | 459 | </div> |
434 | </div> | 460 | </div> |
435 | </div> | 461 | </div> |
436 | </header> | 462 | </header> |
437 | - | ||
438 | - <?php #content должен быть в main.php ?> | 463 | + |
464 | + <?php #content должен быть в main.php ?> | ||
439 | <div id="content_" class="section-box-content"> | 465 | <div id="content_" class="section-box-content"> |
440 | <!-- start breadcrumbs --> | 466 | <!-- start breadcrumbs --> |
441 | - <?php if (!empty($this->params['breadcrumbs'])) {?> | ||
442 | - <section class="section-breadcrumb"> | ||
443 | - <div class="container"> | ||
444 | - <div class="row"> | ||
445 | - <div class="col-xs-12 col-sm-12 breadcrumb-wrapp"> | ||
446 | - <?=SeoBreadcrumbs::widget([ | ||
447 | - 'links' => isset($this->params[ 'breadcrumbs' ]) ? $this->params[ 'breadcrumbs' ] : [], | ||
448 | - ])?> | ||
449 | - </div> | ||
450 | - </div> | ||
451 | - </section> | ||
452 | - <?php }?> | 467 | + <?php if (!empty($this->params[ 'breadcrumbs' ])) { ?> |
468 | + <section class="section-breadcrumb"> | ||
469 | + <div class="container"> | ||
470 | + <div class="row"> | ||
471 | + <div class="col-xs-12 col-sm-12 breadcrumb-wrapp"> | ||
472 | + <?= SeoBreadcrumbs::widget( | ||
473 | + [ | ||
474 | + 'links' => isset($this->params[ 'breadcrumbs' ]) ? $this->params[ 'breadcrumbs' ] : [], | ||
475 | + ] | ||
476 | + ) ?> | ||
477 | + </div> | ||
478 | + </div> | ||
479 | + </section> | ||
480 | + <?php } ?> | ||
453 | <?php #если не главная выводить сюда | 481 | <?php #если не главная выводить сюда |
454 | - # end breadcrumbs ?> | ||
455 | - | ||
456 | - <?php #start content ?> | ||
457 | - | 482 | + # end breadcrumbs ?> |
483 | + | ||
484 | + <?php #start content ?> | ||
485 | + | ||
458 | <?= $content ?> | 486 | <?= $content ?> |
459 | <?php # end content ?> | 487 | <?php # end content ?> |
460 | - | ||
461 | - | ||
462 | - <div class="section-box-6"> | ||
463 | - <div id="map_canvas"></div> | ||
464 | - <div style="display: none" class="adress-map" data-zoom="14" data-start-lat="<?=$settings->lat?>" data-start-lng="<?=$settings->lon?>"> | ||
465 | - <span data-lat="<?=$settings->lat?>" data-lng="<?=$settings->lon?>"></span> | ||
466 | - </div> | ||
467 | - <div class="container"> | ||
468 | - <div class="row"> | ||
469 | - <div class="col-xs-12 col-sm-5 col-sm-offset-7 col-md-4 col-md-offset-8 contacts-mobile-fix" style="display: table"> | ||
470 | - <div class="map-info-wrapp"> | ||
471 | - <div class="map-adress"><?=$settings->address;?></div> | ||
472 | - <?php if (!empty($settings->phone) or !empty($settings->phone2)){ | ||
473 | - $phones = array_merge(explode(';', $settings->phone2) , [$settings->phone]); | ||
474 | - ?> | ||
475 | - <div class="ico-map"> | ||
476 | - <img src="/images/map/phone-map.svg" alt=""> | ||
477 | - <img class="mob-ico-map" style="display: none" src="/images/map/phone-map-1-grey.svg" alt=""> | ||
478 | - </div> | ||
479 | - <div class="map-phone"> | ||
480 | - <?php foreach ($phones as $phone){?> | ||
481 | - <p><?=$phone?></p> | ||
482 | - <?php }?> | ||
483 | - </div> | ||
484 | - <?php } ?> | ||
485 | - <?php if (!empty($settings->email)){?> | ||
486 | - <div class="ico-map ico-map-mail"> | ||
487 | - <img src="/images/map/mail-map.svg" alt=""> | ||
488 | - <img class="mob-ico-map" style="display: none" src="/images/map/mail-map-1-grey.svg" alt=""> | ||
489 | - </div> | ||
490 | - <div class="map-mail"> | ||
491 | - <a href="mailto:<?=$settings->email?>"><?=$settings->email?></a> | ||
492 | - </div> | ||
493 | - <?php } ?> | ||
494 | - </div> | 488 | + |
489 | + | ||
490 | + <div class="section-box-6"> | ||
491 | + <div id="map_canvas"></div> | ||
492 | + <div style="display: none" class="adress-map" data-zoom="14" data-start-lat="<?= $settings->lat ?>" data-start-lng="<?= $settings->lon ?>"> | ||
493 | + <span data-lat="<?= $settings->lat ?>" data-lng="<?= $settings->lon ?>"></span> | ||
494 | + </div> | ||
495 | + <div class="container"> | ||
496 | + <div class="row"> | ||
497 | + <div class="col-xs-12 col-sm-5 col-sm-offset-7 col-md-4 col-md-offset-8 contacts-mobile-fix" style="display: table"> | ||
498 | + <div class="map-info-wrapp"> | ||
499 | + <div class="map-adress"><?= $settings->address; ?></div> | ||
500 | + <?php if (!empty($settings->phone) or !empty($settings->phone2)) { | ||
501 | + $phones = array_merge(explode(';', $settings->phone2), [ $settings->phone ]); | ||
502 | + ?> | ||
503 | + <div class="ico-map"> | ||
504 | + <img src="/images/map/phone-map.svg" alt=""> | ||
505 | + <img class="mob-ico-map" style="display: none" src="/images/map/phone-map-1-grey.svg" alt=""> | ||
495 | </div> | 506 | </div> |
496 | - </div> | 507 | + <div class="map-phone"> |
508 | + <?php foreach ($phones as $phone) { ?> | ||
509 | + <p><?= $phone ?></p> | ||
510 | + <?php } ?> | ||
511 | + </div> | ||
512 | + <?php } ?> | ||
513 | + <?php if (!empty($settings->email)) { ?> | ||
514 | + <div class="ico-map ico-map-mail"> | ||
515 | + <img src="/images/map/mail-map.svg" alt=""> | ||
516 | + <img class="mob-ico-map" style="display: none" src="/images/map/mail-map-1-grey.svg" alt=""> | ||
517 | + </div> | ||
518 | + <div class="map-mail"> | ||
519 | + <a href="mailto:<?= $settings->email ?>"><?= $settings->email ?></a> | ||
520 | + </div> | ||
521 | + <?php } ?> | ||
522 | + </div> | ||
497 | </div> | 523 | </div> |
524 | + </div> | ||
498 | </div> | 525 | </div> |
499 | - | 526 | + </div> |
527 | + | ||
500 | </div> | 528 | </div> |
501 | 529 | ||
502 | <footer id="footer_" class="section-box-footer"> | 530 | <footer id="footer_" class="section-box-footer"> |
@@ -506,18 +534,19 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | @@ -506,18 +534,19 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | ||
506 | <div class="row"> | 534 | <div class="row"> |
507 | <div class="col-xs-12 hidden-sm hidden-md hidden-lg" style="text-align: center; margin-bottom: 8px"> | 535 | <div class="col-xs-12 hidden-sm hidden-md hidden-lg" style="text-align: center; margin-bottom: 8px"> |
508 | <div class="btn-footer-wr"> | 536 | <div class="btn-footer-wr"> |
509 | - <span class="btn_ modal-link" data-form="write-to"><?= \Yii::t('app', 'Make an appointment') ?></span> | 537 | + <span class="btn_ modal-link" data-form="write-to"><?= \Yii::t('app', 'Make an appointment') ?></span> |
510 | </div> | 538 | </div> |
511 | </div> | 539 | </div> |
512 | 540 | ||
513 | <div class="col-xs-9 col-sm-2"> | 541 | <div class="col-xs-9 col-sm-2"> |
514 | <ul class="footer-menu"> | 542 | <ul class="footer-menu"> |
515 | - <li><a href="<?=Url::to(['site/about'])?>"><?=\Yii::t('app','About us')?></a></li> | ||
516 | - <li><a href="<?= Url::to([ 'site/contact' ]);?>" ><?=\Yii::t('app','Contacts');?></a></li> | ||
517 | - <li><a href="/vtoroe-mnenie" class="new"><span><?=\Yii::t('app','Second thing');?></span></a></li> | ||
518 | - <li><a href="<?=(isset($aliases['{"0":"site/questions"}'])) ? | ||
519 | - Url::to(['alias' => $aliases['{"0":"site/questions"}']]) : Url::to(['site/questions'])?>"><?=\Yii::t('app','Quest/Answer');?></a></li> | ||
520 | - <li><a href="<?=Url::to(['site/comments'])?>"><?=\Yii::t('app','Callbacks');?></a></li> | 543 | + <li><a href="<?= Url::to([ 'site/about' ]) ?>"><?= \Yii::t('app', 'About us') ?></a></li> |
544 | + <li><a href="<?= Url::to([ 'site/contact' ]); ?>"><?= \Yii::t('app', 'Contacts'); ?></a></li> | ||
545 | + <li><a href="/vtoroe-mnenie" class="new"><span><?= \Yii::t('app', 'Second thing'); ?></span></a></li> | ||
546 | + <li><a href="<?= ( isset($aliases[ '{"0":"site/questions"}' ]) ) ? Url::to( | ||
547 | + [ 'alias' => $aliases[ '{"0":"site/questions"}' ] ] | ||
548 | + ) : Url::to([ 'site/questions' ]) ?>"><?= \Yii::t('app', 'Quest/Answer'); ?></a></li> | ||
549 | + <li><a href="<?= Url::to([ 'site/comments' ]) ?>"><?= \Yii::t('app', 'Callbacks'); ?></a></li> | ||
521 | </ul> | 550 | </ul> |
522 | </div> | 551 | </div> |
523 | 552 | ||
@@ -542,23 +571,25 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | @@ -542,23 +571,25 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | ||
542 | 571 | ||
543 | <div class="col-xs-3 col-sm-3"> | 572 | <div class="col-xs-3 col-sm-3"> |
544 | <ul class="seti-list"> | 573 | <ul class="seti-list"> |
545 | - <?php if (!empty($settings->facebook)){?> | ||
546 | - <li><a target="_blank" href="<?=$settings->facebook?>"><img src="/images/s-1.svg" alt=""></a></li> | ||
547 | - <?php } ?> | ||
548 | - <?php if (!empty($settings->google)){?> | ||
549 | - <li><a target="_blank" href="<?=$settings->google?>"><img src="/images/s-2.svg" alt=""></a></li> | ||
550 | - <?php } ?> | ||
551 | - <?php if (!empty($settings->twitter)){?> | ||
552 | - <li><a target="_blank" href="<?=$settings->twitter ?>"><img src="/images/s-3.svg" alt=""></a></li> | ||
553 | - <?php }?> | 574 | + <?php if (!empty($settings->facebook)) { ?> |
575 | + <li><a target="_blank" href="<?= $settings->facebook ?>"><img src="/images/s-1.svg" alt=""></a> | ||
576 | + </li> | ||
577 | + <?php } ?> | ||
578 | + <?php if (!empty($settings->google)) { ?> | ||
579 | + <li><a target="_blank" href="<?= $settings->google ?>"><img src="/images/s-2.svg" alt=""></a></li> | ||
580 | + <?php } ?> | ||
581 | + <?php if (!empty($settings->twitter)) { ?> | ||
582 | + <li><a target="_blank" href="<?= $settings->twitter ?>"><img src="/images/s-3.svg" alt=""></a> | ||
583 | + </li> | ||
584 | + <?php } ?> | ||
554 | </ul> | 585 | </ul> |
555 | </div> | 586 | </div> |
556 | </div> | 587 | </div> |
557 | <div class="row"> | 588 | <div class="row"> |
558 | <div class="col-xs-12 col-sm-12 studio-wrapp"> | 589 | <div class="col-xs-12 col-sm-12 studio-wrapp"> |
559 | - <div class="all-rights-txt">© <?=\Yii::t('app','All rights reserved');?> , 2018. ABClinic</div> | 590 | + <div class="all-rights-txt">© <?= \Yii::t('app', 'All rights reserved'); ?> , 2018. ABClinic</div> |
560 | <div class="link-studio"> | 591 | <div class="link-studio"> |
561 | - <a href="http://artweb.ua"><?=\Yii::t('app','Creating sites');?></a> | 592 | + <a href="http://artweb.ua"><?= \Yii::t('app', 'Creating sites'); ?></a> |
562 | </div> | 593 | </div> |
563 | </div> | 594 | </div> |
564 | </div> | 595 | </div> |
@@ -569,182 +600,212 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | @@ -569,182 +600,212 @@ $commentUrl = Alias::find()->where(['route' => '{"0":"site/comments","service_id | ||
569 | <div style="display: none;" class="btn_up"></div> | 600 | <div style="display: none;" class="btn_up"></div> |
570 | <div style="display: none" class="btn_call_close"></div> | 601 | <div style="display: none" class="btn_call_close"></div> |
571 | </footer> | 602 | </footer> |
572 | -<?php if (!empty($settings->phone) or !empty($settings->phone2)){ | ||
573 | - $phones = array_merge(explode(';', $settings->phone2) , [$settings->phone]); ?> | ||
574 | - <div class="call-mobile-wr" style="display: none;"> | ||
575 | - <div class="call-mobile"> | ||
576 | - <div class="call-mobile-td"> | ||
577 | - <?php foreach ($phones as $phone){?> | ||
578 | - <div class="button-call-mob"> | ||
579 | - <a class="button-call_" href="tel:<?= $settings->phone ?>"> | ||
580 | - <span><?= $phone ?></span> | ||
581 | - </a> | ||
582 | - </div> | ||
583 | - <?php } ?> | ||
584 | - | ||
585 | - <div class="button-call-mob"> | ||
586 | - <a class="call-sms" href="sms:<?= $settings->phone ?>"><?=\Yii::t('app','Send SMS');?></a> | 603 | + <?php if (!empty($settings->phone) or !empty($settings->phone2)) { |
604 | + $phones = array_merge(explode(';', $settings->phone2), [ $settings->phone ]); ?> | ||
605 | + <div class="call-mobile-wr" style="display: none;"> | ||
606 | + <div class="call-mobile"> | ||
607 | + <div class="call-mobile-td"> | ||
608 | + <?php foreach ($phones as $phone) { ?> | ||
609 | + <div class="button-call-mob"> | ||
610 | + <a class="button-call_" href="tel:<?= $settings->phone ?>"> | ||
611 | + <span><?= $phone ?></span> | ||
612 | + </a> | ||
613 | + </div> | ||
614 | + <?php } ?> | ||
615 | + | ||
616 | + <div class="button-call-mob"> | ||
617 | + <a class="call-sms" href="sms:<?= $settings->phone ?>"><?= \Yii::t('app', 'Send SMS'); ?></a> | ||
618 | + </div> | ||
619 | + <div class="button-call-mob"> | ||
620 | + <a class="call-contact" href="/contacts/abclinic.vcf"><?= \Yii::t('app', 'Add to contacts'); ?></a> | ||
621 | + </div> | ||
622 | + </div> | ||
587 | </div> | 623 | </div> |
588 | - <div class="button-call-mob"> | ||
589 | - <a class="call-contact" href="/contacts/abclinic.vcf"><?=\Yii::t('app','Add to contacts');?></a></div> | ||
590 | </div> | 624 | </div> |
591 | - </div> | ||
592 | - </div> | ||
593 | - <?php }?> | 625 | + <?php } ?> |
594 | <div id="overlay" style="display: none;"></div> | 626 | <div id="overlay" style="display: none;"></div> |
595 | 627 | ||
596 | -<!-- --><?php | ||
597 | -// $module = \Yii::$app->getModule('feedback'); | ||
598 | -// ArtboxModalWidget::begin([ | ||
599 | -// 'modalTagOptions' => [ | ||
600 | -// 'id' => 'callback' | ||
601 | -// ], | ||
602 | -// 'titleTagOptions' => [ | ||
603 | -// 'class' => 'style form-title' | ||
604 | -// ], | ||
605 | -// 'headerText' => \Yii::t('app', 'Callback'), | ||
606 | -// 'closeTagButton' => 'span', | ||
607 | -// 'closeTagContent' => '', | ||
608 | -// 'closeButtonOptions' => [ | ||
609 | -// 'id' => 'modal_close' | ||
610 | -// ] | ||
611 | -// ]); | ||
612 | -// | ||
613 | -// $module->renderForm($this); | ||
614 | -// | ||
615 | -// ArtboxModalWidget::end(); | ||
616 | -// ?> | ||
617 | - | ||
618 | - <div id="callback" class=" forms_ " style="display: none;"> | 628 | + <!-- --><?php |
629 | + // $module = \Yii::$app->getModule('feedback'); | ||
630 | + // ArtboxModalWidget::begin([ | ||
631 | + // 'modalTagOptions' => [ | ||
632 | + // 'id' => 'callback' | ||
633 | + // ], | ||
634 | + // 'titleTagOptions' => [ | ||
635 | + // 'class' => 'style form-title' | ||
636 | + // ], | ||
637 | + // 'headerText' => \Yii::t('app', 'Callback'), | ||
638 | + // 'closeTagButton' => 'span', | ||
639 | + // 'closeTagContent' => '', | ||
640 | + // 'closeButtonOptions' => [ | ||
641 | + // 'id' => 'modal_close' | ||
642 | + // ] | ||
643 | + // ]); | ||
644 | + // | ||
645 | + // $module->renderForm($this); | ||
646 | + // | ||
647 | + // ArtboxModalWidget::end(); | ||
648 | + // ?> | ||
649 | + | ||
650 | + <div id="callback" class=" forms_ " style="display: none;"> | ||
619 | <div class="style title-callback">Записаться на прием</div> | 651 | <div class="style title-callback">Записаться на прием</div> |
620 | - <form action=""> | ||
621 | - <div class="input-wr phones_mask required"> | ||
622 | - <label class="control-label" for="feedback-phone">Телефон</label> | ||
623 | - <input type="text" id="feedback-phone" placeholder="+38(0__)___-__-__"> | ||
624 | - </div> | ||
625 | - <div class="input-wr"> | ||
626 | - <div class="style callback-params-title">Когда вам удобно перезвонить?</div> | ||
627 | - <div class="style radio_custom"> | ||
628 | - <input type="radio" id="order-delivery_id1" name="qwerty" value="1" checked=""> | ||
629 | - <label for="order-delivery_id1">В течение 30 минут</label> | ||
630 | - </div> | ||
631 | - | ||
632 | - <div class="style radio_custom"> | ||
633 | - <input type="radio" id="order-delivery_id2" name="qwerty" value="1"> | ||
634 | - <label for="order-delivery_id2">с 9:00 до 12:00</label> | ||
635 | - </div> | ||
636 | - | ||
637 | - <div class="style radio_custom"> | ||
638 | - <input type="radio" id="order-delivery_id3" name="qwerty" value="1"> | ||
639 | - <label for="order-delivery_id3">с 12:00 до 18:00</label> | ||
640 | - </div> | ||
641 | - | ||
642 | - <div class="style radio-callback-border"></div> | ||
643 | - </div> | ||
644 | - <div class="input-wr sidebar_checks"> | ||
645 | - <input type="checkbox" id="loginform-rememberme" name="LoginForm[rememberMe]" value="1" checked=""> | ||
646 | - <label class="control-label" for="loginform-rememberme">Даю согласие на хранение и обработку персональных данных</label> | ||
647 | - </div> | ||
648 | - <div class="button-wr"> | ||
649 | - <div class="close-callback"><span id="modal_close">Закрыть окно</span></div> | ||
650 | - <button type="submit">Отправить</button> | ||
651 | - </div> | ||
652 | - </form> | ||
653 | - </div> | ||
654 | - | ||
655 | - <?php | ||
656 | - /* @var \artbox\core\forms\Module $moduleVisit*/ | ||
657 | - $moduleVisit = \Yii::$app->getModule('visit'); | ||
658 | - if (isset($this->params['entity']) and isset($this->params['entity_id'])){ | ||
659 | - $moduleVisit->inputOptions = array_merge($moduleVisit->inputOptions, ['entity' => [ | ||
660 | - 'type' => 'hiddenInput', | ||
661 | - 'options' => ['value' => $this->params['entity']], | ||
662 | - ], | ||
663 | - 'entity_id' => [ | ||
664 | - 'type' => 'hiddenInput', | ||
665 | - 'options' => ['value' => $this->params['entity_id']], | ||
666 | - ] | ||
667 | - ]); | ||
668 | - } | ||
669 | - ArtboxModalWidget::begin([ | ||
670 | - 'modalTagOptions' => [ | ||
671 | - 'id' => 'write-to' | ||
672 | - ], | ||
673 | - 'titleTagOptions' => [ | ||
674 | - 'class' => 'style form-title' | ||
675 | - ], | ||
676 | - 'headerText' => \Yii::t('app', 'Make an appointment'), | ||
677 | - 'closeTagButton' => 'span', | ||
678 | - 'closeTagContent' => '', | ||
679 | - 'closeButtonOptions' => [ | ||
680 | - 'id' => 'modal_close' | ||
681 | - ] | ||
682 | - ]); | ||
683 | - | ||
684 | - $moduleVisit->renderForm($this); | ||
685 | - | ||
686 | - ArtboxModalWidget::end(); | ||
687 | - ?> | 652 | + <?php |
653 | + $model = new Feedback(['agree' => 1, 'time' => 1]); | ||
654 | + $model->scenario = Feedback::SCENARIO_CALLBACK; | ||
655 | + $form = ActiveForm::begin([ 'action' => 'site/callback', 'id' => 'callback-form' ]); ?> | ||
656 | + <div class="input-wr phones_mask required"> | ||
657 | + <?= $form->field($model, 'phone') | ||
658 | + ->textInput([ 'placeholder' => '+38(0__)___-__-__' ]) | ||
659 | + ->label('Телефон') ?> | ||
660 | + </div> | ||
661 | + <div class="input-wr"> | ||
662 | + <div class="style callback-params-title">Когда вам удобно перезвонить?</div> | ||
663 | + <?= $form->field($model, 'time') | ||
664 | + ->radioList( | ||
665 | + [ | ||
666 | + Feedback::DURING_30_MIN => 'В течение 30 минут', | ||
667 | + Feedback::FROM_9_12 => 'с 9:00 до 12:00', | ||
668 | + Feedback::FROM_12_18 => 'с 12:00 до 18:00', | ||
669 | + ], | ||
670 | + [ | ||
671 | + 'item' => function ($index, $label, $name, $checked, $value) { | ||
672 | + $check = $checked ? ' checked="checked"' : ''; | ||
673 | + return '<div class="style radio_custom"><input id="time_'.$value.'" type="radio" name="'.$name.'" value="'.$value.'" '.$check.'><label for="time_'.$value.'">'.$label.'</label></div>'; | ||
674 | + }, | ||
675 | + ] | ||
676 | + )->label(false); ?> | ||
677 | + | ||
678 | + <!-- <div class="style radio_custom">--> | ||
679 | + <!-- <input type="radio" id="order-delivery_id1" name="qwerty" value="1" checked="">--> | ||
680 | + <!-- <label for="order-delivery_id1">В течение 30 минут</label>--> | ||
681 | + <!-- </div>--> | ||
682 | + <!----> | ||
683 | + <!-- <div class="style radio_custom">--> | ||
684 | + <!-- <input type="radio" id="order-delivery_id2" name="qwerty" value="1">--> | ||
685 | + <!-- <label for="order-delivery_id2">с 9:00 до 12:00</label>--> | ||
686 | + <!-- </div>--> | ||
687 | + <!----> | ||
688 | + <!-- <div class="style radio_custom">--> | ||
689 | + <!-- <input type="radio" id="order-delivery_id3" name="qwerty" value="1">--> | ||
690 | + <!-- <label for="order-delivery_id3">с 12:00 до 18:00</label>--> | ||
691 | + <!-- </div>--> | ||
692 | + | ||
693 | + <div class="style radio-callback-border"></div> | ||
694 | + </div> | ||
688 | 695 | ||
696 | + <div class="input-wr sidebar_checks"> | ||
697 | + <?= $form->field( | ||
698 | + $model, | ||
699 | + 'agree', | ||
700 | + [ | ||
701 | + 'template' => '{input}{label}', | ||
702 | + ] | ||
703 | + ) | ||
704 | + ->checkbox([], false) | ||
705 | + ->label(\Yii::t('app', 'Даю согласие на хранение и обработку персональных данных')); ?> | ||
706 | +<!-- <input type="checkbox" id="loginform-rememberme" name="LoginForm[rememberMe]" value="1" checked="">--> | ||
707 | +<!-- <label class="control-label" for="loginform-rememberme">Даю согласие на хранение и обработку персональных данных</label>--> | ||
708 | + </div> | ||
709 | + <div class="button-wr"> | ||
710 | + <div class="close-callback"><span id="modal_close">Закрыть окно</span></div> | ||
711 | + <button type="submit">Отправить</button> | ||
712 | + </div> | ||
713 | + <?php ActiveForm::end() ?> | ||
714 | + </div> | ||
715 | + | ||
716 | + <?php | ||
717 | + /* @var \artbox\core\forms\Module $moduleVisit */ | ||
718 | + $moduleVisit = \Yii::$app->getModule('visit'); | ||
719 | + if (isset($this->params[ 'entity' ]) and isset($this->params[ 'entity_id' ])) { | ||
720 | + $moduleVisit->inputOptions = array_merge( | ||
721 | + $moduleVisit->inputOptions, | ||
722 | + [ | ||
723 | + 'entity' => [ | ||
724 | + 'type' => 'hiddenInput', | ||
725 | + 'options' => [ 'value' => $this->params[ 'entity' ] ], | ||
726 | + ], | ||
727 | + 'entity_id' => [ | ||
728 | + 'type' => 'hiddenInput', | ||
729 | + 'options' => [ 'value' => $this->params[ 'entity_id' ] ], | ||
730 | + ], | ||
731 | + ] | ||
732 | + ); | ||
733 | + } | ||
734 | + ArtboxModalWidget::begin( | ||
735 | + [ | ||
736 | + 'modalTagOptions' => [ | ||
737 | + 'id' => 'write-to', | ||
738 | + ], | ||
739 | + 'titleTagOptions' => [ | ||
740 | + 'class' => 'style form-title', | ||
741 | + ], | ||
742 | + 'headerText' => \Yii::t('app', 'Make an appointment'), | ||
743 | + 'closeTagButton' => 'span', | ||
744 | + 'closeTagContent' => '', | ||
745 | + 'closeButtonOptions' => [ | ||
746 | + 'id' => 'modal_close', | ||
747 | + ], | ||
748 | + ] | ||
749 | + ); | ||
750 | + | ||
751 | + $moduleVisit->renderForm($this); | ||
752 | + | ||
753 | + ArtboxModalWidget::end(); | ||
754 | + ?> | ||
755 | + | ||
689 | <div id="success_form" style="display: none;"> | 756 | <div id="success_form" style="display: none;"> |
690 | <span id="modal_close"></span> | 757 | <span id="modal_close"></span> |
691 | - <div class="txt-success"><span><?=\Yii::t('app','Thanks for request')?></span> | ||
692 | - <p><?=Yii::t('app','We`ll call you later')?>.</p></div> | 758 | + <div class="txt-success"><span><?= \Yii::t('app', 'Thanks for request') ?></span> |
759 | + <p><?= Yii::t('app', 'We`ll call you later') ?>.</p></div> | ||
693 | </div> | 760 | </div> |
694 | - <?php | ||
695 | - //---------------------------------------------------------------------------------------- | ||
696 | - // микроразметка организации | ||
697 | - | ||
698 | - | ||
699 | - /** | ||
700 | - * <script type="application/ld+json"> | ||
701 | - { | ||
702 | - "@context": "http://schema.org", | ||
703 | - "@type": "Organization", | ||
704 | - "url": "http://www.your-company-site.com", | ||
705 | - "logo": "http://www.example.com/logo.png", | ||
706 | - "contactPoint": [{ | ||
707 | - "@type": "ContactPoint", | ||
708 | - "telephone": "+1-401-555-1212", | ||
709 | - "contactType": "customer service" | ||
710 | - }] | ||
711 | - } | ||
712 | - </script> | ||
713 | - */ | ||
714 | - | ||
715 | - $layoutMicrodata= | ||
716 | - [ | ||
717 | - 'context'=> 'http://schema.org/', | ||
718 | - 'type'=> 'Organization', | ||
719 | - 'url'=>Url::home(true), | ||
720 | - #'logo'=>'http://www.example.com/logo.png', | ||
721 | - 'logo'=>Url::home(true)."storage/logo/".$settings->logo, | ||
722 | - 'contactPoint'=>[ | ||
723 | - '@type'=>'ContactPoint', | ||
724 | - 'contactType'=>"customer service" | ||
725 | - ], | ||
726 | - | ||
727 | - ]; | ||
728 | - | ||
729 | - if(isset($phones[0])) { | ||
730 | - $layoutMicrodata['contactPoint']['telephone'] = "+38" . $phones[0]; | ||
731 | - } | ||
732 | - | ||
733 | - | ||
734 | - | ||
735 | - $settings->email; | ||
736 | - $microdata=new MicrodataFabric(); | ||
737 | - $pageMicrodata=$microdata::createJsonFromOrganization($layoutMicrodata)->toJson(); | ||
738 | - echo $pageMicrodata | ||
739 | - | ||
740 | - | ||
741 | - | ||
742 | - | ||
743 | - ?> | ||
744 | - | ||
745 | - <?php # выводить если главная страница ?> | ||
746 | - | ||
747 | - | 761 | + <?php |
762 | + //---------------------------------------------------------------------------------------- | ||
763 | + // микроразметка организации | ||
764 | + | ||
765 | + /** | ||
766 | + * <script type="application/ld+json"> | ||
767 | + * { | ||
768 | + * "@context": "http://schema.org", | ||
769 | + * "@type": "Organization", | ||
770 | + * "url": "http://www.your-company-site.com", | ||
771 | + * "logo": "http://www.example.com/logo.png", | ||
772 | + * "contactPoint": [{ | ||
773 | + * "@type": "ContactPoint", | ||
774 | + * "telephone": "+1-401-555-1212", | ||
775 | + * "contactType": "customer service" | ||
776 | + * }] | ||
777 | + * } | ||
778 | + * </script> | ||
779 | + */ | ||
780 | + | ||
781 | + $layoutMicrodata = [ | ||
782 | + 'context' => 'http://schema.org/', | ||
783 | + 'type' => 'Organization', | ||
784 | + 'url' => Url::home(true), | ||
785 | + #'logo'=>'http://www.example.com/logo.png', | ||
786 | + 'logo' => Url::home(true) . "storage/logo/" . $settings->logo, | ||
787 | + 'contactPoint' => [ | ||
788 | + '@type' => 'ContactPoint', | ||
789 | + 'contactType' => "customer service", | ||
790 | + ], | ||
791 | + | ||
792 | + ]; | ||
793 | + | ||
794 | + if (isset($phones[ 0 ])) { | ||
795 | + $layoutMicrodata[ 'contactPoint' ][ 'telephone' ] = "+38" . $phones[ 0 ]; | ||
796 | + } | ||
797 | + | ||
798 | + $settings->email; | ||
799 | + $microdata = new MicrodataFabric(); | ||
800 | + $pageMicrodata = $microdata::createJsonFromOrganization($layoutMicrodata) | ||
801 | + ->toJson(); | ||
802 | + echo $pageMicrodata | ||
803 | + | ||
804 | + ?> | ||
805 | + | ||
806 | + <?php # выводить если главная страница ?> | ||
807 | + | ||
808 | + | ||
748 | <?php $this->endBody() ?> | 809 | <?php $this->endBody() ?> |
749 | </body> | 810 | </body> |
750 | </html> | 811 | </html> |
frontend/web/js/script.js
@@ -485,7 +485,24 @@ $(document).ready(function() { | @@ -485,7 +485,24 @@ $(document).ready(function() { | ||
485 | } | 485 | } |
486 | }); | 486 | }); |
487 | 487 | ||
488 | + $(document).on('submit', '#callback-form', function(e) { | ||
489 | + e.preventDefault(); | ||
490 | + e.stopImmediatePropagation(); | ||
491 | + $.post($(this) | ||
492 | + .attr("action"), $(this) | ||
493 | + .serialize(), function(data) { | ||
494 | + document.getElementById("callback-form") | ||
495 | + .reset(); | ||
496 | + var data_ = $("#callback-form") | ||
497 | + .data('yiiActiveForm'); | ||
498 | + data.validated = false; | ||
499 | + success() | ||
500 | + }) | ||
501 | + .fail(); | ||
502 | + }); | ||
488 | }); | 503 | }); |
504 | + | ||
505 | + | ||
489 | jQuery.fn.load = function(callback) { | 506 | jQuery.fn.load = function(callback) { |
490 | $(window).on("load", callback) | 507 | $(window).on("load", callback) |
491 | }; | 508 | }; |