Commit 4bf420368019289fb7233365d6bfc45f8432b04d

Authored by Alexey Boroda
1 parent eb56e5f2

-Modals ready

.htaccess
... ... @@ -88,73 +88,73 @@ AddDefaultCharset utf-8
88 88  
89 89 </IfModule>
90 90  
91   -#для возможности загрузки файлов парсера
92   -<IfModule mod_php5.c>
93   - php_value upload_max_filesize 20M
94   - php_value post_max_size 30M
95   -</IfModule>
96   -
97   -
98   -# кеширование в браузере на стороне пользователя
99   -
100   -<IfModule mod_expires.c>
101   - ExpiresActive On
102   - ExpiresDefault "access 7 days"
103   - ExpiresByType application/javascript "access plus 1 year"
104   - ExpiresByType text/javascript "access plus 1 year"
105   - ExpiresByType text/css "access plus 1 year"
106   - ExpiresByType text/html "access plus 7 day"
107   - ExpiresByType text/x-javascript "access 1 year"
108   - ExpiresByType image/gif "access plus 1 year"
109   - ExpiresByType image/jpeg "access plus 1 year"
110   - ExpiresByType image/png "access plus 1 year"
111   - ExpiresByType image/jpg "access plus 1 year"
112   - ExpiresByType image/x-icon "access 1 year"
113   - ExpiresByType application/x-shockwave-flash "access 1 year"
114   - </IfModule>
115   -<IfModule mod_deflate.c>
116   -AddOutputFilterByType DEFLATE text/plain
117   -AddOutputFilterByType DEFLATE text/html
118   -AddOutputFilterByType DEFLATE text/xml
119   -AddOutputFilterByType DEFLATE text/css
120   -AddOutputFilterByType DEFLATE application/xml
121   -AddOutputFilterByType DEFLATE application/xhtml+xml
122   -AddOutputFilterByType DEFLATE application/rss+xml
123   -AddOutputFilterByType DEFLATE application/javascript
124   -AddOutputFilterByType DEFLATE application/x-javascript
125   -BrowserMatch ^Mozilla/4 gzip-only-text/html
126   -BrowserMatch ^Mozilla/4\.0[678] no-gzip
127   -BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
128   -Header append Vary User-Agent
129   -RewriteEngine On
130   -AddEncoding gzip .gz
131   -RewriteCond %{HTTP:Accept-encoding} gzip
132   -RewriteCond %{REQUEST_FILENAME}.gz -f
133   -RewriteRule ^(.*)$ $1.gz [QSA,L]
134   -</IfModule>
135   -# Cache-Control
136   -<ifModule mod_headers.c>
137   -# 30 дней
138   - <filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
139   - Header set Cache-Control "max-age=2592000, public"
140   - </filesMatch>
141   - # 30 дней
142   - <filesMatch "\.(css|js)$">
143   - Header set Cache-Control "max-age=2592000, public"
144   - </filesMatch>
145   - # 2 дня
146   - <filesMatch "\.(xml|txt)$">
147   - Header set Cache-Control "max-age=172800, public, must-revalidate"
148   - </filesMatch>
149   - # 1 день
150   - <filesMatch "\.(html|htm|php)$">
151   - Header set Cache-Control "max-age=172800, private, must-revalidate"
152   - </filesMatch>
153   -</ifModule>
154   -
155   -#Запрет отдачи HTTP-заголовков Vary браузерам семейства MSIE
156   -<IfModule mod_setenvif.c>
157   -BrowserMatch "MSIE" force-no-vary
158   -BrowserMatch "Mozilla/4.[0-9]{2}" force-no-vary
159   -</IfModule>
  91 +##для возможности загрузки файлов парсера
  92 +#<IfModule mod_php5.c>
  93 +# php_value upload_max_filesize 20M
  94 +# php_value post_max_size 30M
  95 +#</IfModule>
  96 +#
  97 +#
  98 +## кеширование в браузере на стороне пользователя
  99 +#
  100 +#<IfModule mod_expires.c>
  101 +# ExpiresActive On
  102 +# ExpiresDefault "access 7 days"
  103 +# ExpiresByType application/javascript "access plus 1 year"
  104 +# ExpiresByType text/javascript "access plus 1 year"
  105 +# ExpiresByType text/css "access plus 1 year"
  106 +# ExpiresByType text/html "access plus 7 day"
  107 +# ExpiresByType text/x-javascript "access 1 year"
  108 +# ExpiresByType image/gif "access plus 1 year"
  109 +# ExpiresByType image/jpeg "access plus 1 year"
  110 +# ExpiresByType image/png "access plus 1 year"
  111 +# ExpiresByType image/jpg "access plus 1 year"
  112 +# ExpiresByType image/x-icon "access 1 year"
  113 +# ExpiresByType application/x-shockwave-flash "access 1 year"
  114 +# </IfModule>
  115 +#<IfModule mod_deflate.c>
  116 +#AddOutputFilterByType DEFLATE text/plain
  117 +#AddOutputFilterByType DEFLATE text/html
  118 +#AddOutputFilterByType DEFLATE text/xml
  119 +#AddOutputFilterByType DEFLATE text/css
  120 +#AddOutputFilterByType DEFLATE application/xml
  121 +#AddOutputFilterByType DEFLATE application/xhtml+xml
  122 +#AddOutputFilterByType DEFLATE application/rss+xml
  123 +#AddOutputFilterByType DEFLATE application/javascript
  124 +#AddOutputFilterByType DEFLATE application/x-javascript
  125 +#BrowserMatch ^Mozilla/4 gzip-only-text/html
  126 +#BrowserMatch ^Mozilla/4\.0[678] no-gzip
  127 +#BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  128 +#Header append Vary User-Agent
  129 +#RewriteEngine On
  130 +#AddEncoding gzip .gz
  131 +#RewriteCond %{HTTP:Accept-encoding} gzip
  132 +#RewriteCond %{REQUEST_FILENAME}.gz -f
  133 +#RewriteRule ^(.*)$ $1.gz [QSA,L]
  134 +#</IfModule>
  135 +## Cache-Control
  136 +#<ifModule mod_headers.c>
  137 +## 30 дней
  138 +# <filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
  139 +# Header set Cache-Control "max-age=2592000, public"
  140 +# </filesMatch>
  141 +# # 30 дней
  142 +# <filesMatch "\.(css|js)$">
  143 +# Header set Cache-Control "max-age=2592000, public"
  144 +# </filesMatch>
  145 +# # 2 дня
  146 +# <filesMatch "\.(xml|txt)$">
  147 +# Header set Cache-Control "max-age=172800, public, must-revalidate"
  148 +# </filesMatch>
  149 +# # 1 день
  150 +# <filesMatch "\.(html|htm|php)$">
  151 +# Header set Cache-Control "max-age=172800, private, must-revalidate"
  152 +# </filesMatch>
  153 +#</ifModule>
  154 +#
  155 +##Запрет отдачи HTTP-заголовков Vary браузерам семейства MSIE
  156 +#<IfModule mod_setenvif.c>
  157 +#BrowserMatch "MSIE" force-no-vary
  158 +#BrowserMatch "Mozilla/4.[0-9]{2}" force-no-vary
  159 +#</IfModule>
160 160  
... ...
common/widgets/Mailer.php
... ... @@ -25,20 +25,19 @@ class Mailer extends Widget{
25 25  
26 26 $mail->IsSMTP();
27 27 $mail->CharSet = 'UTF-8';
28   -// $mail->SMTPDebug = 1;
  28 +// $mail->SMTPDebug = 2;
29 29 $mail->SMTPAuth = true;
30 30 $mail->SMTPSecure = 'ssl';
31 31 $mail->Host = "smtp.gmail.com";
32   - $mail->Port = 465; // or 587
33   - $mail->IsHTML(true);
34   - $mail->Username = "login@gmail.com"; // Google email account
35   - $mail->Password = "password"; // Password to this account
  32 + $mail->Port = 465; // 465 or 587
  33 + $mail->Username = "nissanleaf17@gmail.com"; // Google email account
  34 + $mail->Password = "parol123"; // Password to this account
36 35 $mail->SetFrom("leaf@electrocars.ua");
37 36 $mail->isHTML(true);
38 37 $mail->Subject = $this->subject;
39 38 $mail->Body = $this->render($this->type, ['params' => $this->params]);
40   - $mail->AddAddress('zhegal@gmail.com');
41   - $mail->AddAddress('pmartweb1@gmail.com');
  39 + $mail->AddAddress('kennen.md@gmail.com');
  40 +// $mail->AddAddress('pmartweb1@gmail.com');
42 41 if(!$mail->Send()) {
43 42 echo "Mailer Error: " . $mail->ErrorInfo;
44 43 } else {
... ...
common/widgets/views/buy.php
  1 +<?php
  2 +
  3 + use common\models\Car;
  4 +
  5 + $model = Car::findOne($params['model']);
  6 +?>
  7 +
1 8 Name: <?= $params['username'] ?><br/>
2 9 Phone: <?= $params['phone'] ?><br/>
3 10 Email: <?= $params['email'] ?><br/>
4   -Model: <?= $params['model_name'] ?><br/>
5   -Year: <?= $params['model_color'] ?><br/>
6   -Color: <?= $params['model_year'] ?>
7 11 \ No newline at end of file
  12 +Model: <?= $model->model ?><br/>
  13 +Year: <?= $model->year ?><br/>
  14 +Color: <?= $model->color ?>
8 15 \ No newline at end of file
... ...
composer.lock
... ... @@ -9,20 +9,20 @@
9 9 "packages": [
10 10 {
11 11 "name": "bower-asset/bootstrap",
12   - "version": "v3.3.5",
  12 + "version": "v3.3.7",
13 13 "source": {
14 14 "type": "git",
15 15 "url": "https://github.com/twbs/bootstrap.git",
16   - "reference": "16b48259a62f576e52c903c476bd42b90ab22482"
  16 + "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86"
17 17 },
18 18 "dist": {
19 19 "type": "zip",
20   - "url": "https://api.github.com/repos/twbs/bootstrap/zipball/16b48259a62f576e52c903c476bd42b90ab22482",
21   - "reference": "16b48259a62f576e52c903c476bd42b90ab22482",
  20 + "url": "https://api.github.com/repos/twbs/bootstrap/zipball/0b9c4a4007c44201dce9a6cc1a38407005c26c86",
  21 + "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86",
22 22 "shasum": ""
23 23 },
24 24 "require": {
25   - "bower-asset/jquery": ">=1.9.1"
  25 + "bower-asset/jquery": ">=1.9.1,<=3"
26 26 },
27 27 "type": "bower-asset-library",
28 28 "extra": {
... ... @@ -114,16 +114,16 @@
114 114 },
115 115 {
116 116 "name": "bower-asset/jquery.inputmask",
117   - "version": "3.2.7",
  117 + "version": "3.3.4",
118 118 "source": {
119 119 "type": "git",
120   - "url": "https://github.com/RobinHerbots/jquery.inputmask.git",
121   - "reference": "5a72c563b502b8e05958a524cdfffafe9987be38"
  120 + "url": "https://github.com/RobinHerbots/Inputmask.git",
  121 + "reference": "8a882bc471ba4077c4f8ecbe3d9d61c7558f3ef2"
122 122 },
123 123 "dist": {
124 124 "type": "zip",
125   - "url": "https://api.github.com/repos/RobinHerbots/jquery.inputmask/zipball/5a72c563b502b8e05958a524cdfffafe9987be38",
126   - "reference": "5a72c563b502b8e05958a524cdfffafe9987be38",
  125 + "url": "https://api.github.com/repos/RobinHerbots/Inputmask/zipball/8a882bc471ba4077c4f8ecbe3d9d61c7558f3ef2",
  126 + "reference": "8a882bc471ba4077c4f8ecbe3d9d61c7558f3ef2",
127 127 "shasum": ""
128 128 },
129 129 "require": {
... ... @@ -132,7 +132,14 @@
132 132 "type": "bower-asset-library",
133 133 "extra": {
134 134 "bower-asset-main": [
135   - "./dist/inputmask/inputmask.js"
  135 + "./dist/inputmask/inputmask.dependencyLib",
  136 + "./dist/inputmask/inputmask",
  137 + "./dist/inputmask/inputmask.extensions",
  138 + "./dist/inputmask/inputmask.date.extensions",
  139 + "./dist/inputmask/inputmask.numeric.extensions",
  140 + "./dist/inputmask/inputmask.phone.extensions",
  141 + "./dist/inputmask/inputmask.regex.extensions",
  142 + "./dist/inputmask/jquery.inputmask"
136 143 ],
137 144 "bower-asset-ignore": [
138 145 "**/*",
... ... @@ -226,12 +233,12 @@
226 233 "source": {
227 234 "type": "git",
228 235 "url": "https://github.com/cebe/markdown.git",
229   - "reference": "04bfcaa26356cf86c6c4a2420eb95857a86e03ab"
  236 + "reference": "8287ddea024caa2a79f59077b3db50d4ff0c65ad"
230 237 },
231 238 "dist": {
232 239 "type": "zip",
233   - "url": "https://api.github.com/repos/cebe/markdown/zipball/04bfcaa26356cf86c6c4a2420eb95857a86e03ab",
234   - "reference": "04bfcaa26356cf86c6c4a2420eb95857a86e03ab",
  240 + "url": "https://api.github.com/repos/cebe/markdown/zipball/8287ddea024caa2a79f59077b3db50d4ff0c65ad",
  241 + "reference": "8287ddea024caa2a79f59077b3db50d4ff0c65ad",
235 242 "shasum": ""
236 243 },
237 244 "require": {
... ... @@ -278,20 +285,20 @@
278 285 "markdown",
279 286 "markdown-extra"
280 287 ],
281   - "time": "2016-06-20 21:09:53"
  288 + "time": "2016-12-11 13:37:11"
282 289 },
283 290 {
284 291 "name": "ezyang/htmlpurifier",
285   - "version": "v4.7.0",
  292 + "version": "v4.8.0",
286 293 "source": {
287 294 "type": "git",
288 295 "url": "https://github.com/ezyang/htmlpurifier.git",
289   - "reference": "ae1828d955112356f7677c465f94f7deb7d27a40"
  296 + "reference": "d0c392f77d2f2a3dcf7fcb79e2a1e2b8804e75b2"
290 297 },
291 298 "dist": {
292 299 "type": "zip",
293   - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/ae1828d955112356f7677c465f94f7deb7d27a40",
294   - "reference": "ae1828d955112356f7677c465f94f7deb7d27a40",
  300 + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/d0c392f77d2f2a3dcf7fcb79e2a1e2b8804e75b2",
  301 + "reference": "d0c392f77d2f2a3dcf7fcb79e2a1e2b8804e75b2",
295 302 "shasum": ""
296 303 },
297 304 "require": {
... ... @@ -322,7 +329,7 @@
322 329 "keywords": [
323 330 "html"
324 331 ],
325   - "time": "2015-08-05 01:03:42"
  332 + "time": "2016-07-16 12:58:58"
326 333 },
327 334 {
328 335 "name": "kartik-v/bootstrap-fileinput",
... ... @@ -330,12 +337,12 @@
330 337 "source": {
331 338 "type": "git",
332 339 "url": "https://github.com/kartik-v/bootstrap-fileinput.git",
333   - "reference": "8dd9021a6678d176bdbcd1e7cbb8c8b4169e50e8"
  340 + "reference": "18b3f68ac20f0db91cf4f4aee852d98f4f4ca9b0"
334 341 },
335 342 "dist": {
336 343 "type": "zip",
337   - "url": "https://api.github.com/repos/kartik-v/bootstrap-fileinput/zipball/8dd9021a6678d176bdbcd1e7cbb8c8b4169e50e8",
338   - "reference": "8dd9021a6678d176bdbcd1e7cbb8c8b4169e50e8",
  344 + "url": "https://api.github.com/repos/kartik-v/bootstrap-fileinput/zipball/18b3f68ac20f0db91cf4f4aee852d98f4f4ca9b0",
  345 + "reference": "18b3f68ac20f0db91cf4f4aee852d98f4f4ca9b0",
339 346 "shasum": ""
340 347 },
341 348 "type": "library",
... ... @@ -375,7 +382,7 @@
375 382 "progress",
376 383 "upload"
377 384 ],
378   - "time": "2016-07-11 09:07:59"
  385 + "time": "2016-12-28 01:34:20"
379 386 },
380 387 {
381 388 "name": "kartik-v/yii2-krajee-base",
... ... @@ -383,12 +390,12 @@
383 390 "source": {
384 391 "type": "git",
385 392 "url": "https://github.com/kartik-v/yii2-krajee-base.git",
386   - "reference": "473fb568ff1144dc49bdb74f40a5d7f025fc72e4"
  393 + "reference": "52e623e54d06b853fda01a6529ccca93ed2a7f66"
387 394 },
388 395 "dist": {
389 396 "type": "zip",
390   - "url": "https://api.github.com/repos/kartik-v/yii2-krajee-base/zipball/473fb568ff1144dc49bdb74f40a5d7f025fc72e4",
391   - "reference": "473fb568ff1144dc49bdb74f40a5d7f025fc72e4",
  397 + "url": "https://api.github.com/repos/kartik-v/yii2-krajee-base/zipball/52e623e54d06b853fda01a6529ccca93ed2a7f66",
  398 + "reference": "52e623e54d06b853fda01a6529ccca93ed2a7f66",
392 399 "shasum": ""
393 400 },
394 401 "require": {
... ... @@ -426,7 +433,7 @@
426 433 "widget",
427 434 "yii2"
428 435 ],
429   - "time": "2016-06-02 16:20:24"
  436 + "time": "2016-11-26 09:53:44"
430 437 },
431 438 {
432 439 "name": "kartik-v/yii2-widget-fileinput",
... ... @@ -434,12 +441,12 @@
434 441 "source": {
435 442 "type": "git",
436 443 "url": "https://github.com/kartik-v/yii2-widget-fileinput.git",
437   - "reference": "b0fb41e4290fc4aa35a49a977bf4484cb30f8ff9"
  444 + "reference": "744e12c1f5be45357ec50eea6f678ecc9ba67dc2"
438 445 },
439 446 "dist": {
440 447 "type": "zip",
441   - "url": "https://api.github.com/repos/kartik-v/yii2-widget-fileinput/zipball/b0fb41e4290fc4aa35a49a977bf4484cb30f8ff9",
442   - "reference": "b0fb41e4290fc4aa35a49a977bf4484cb30f8ff9",
  448 + "url": "https://api.github.com/repos/kartik-v/yii2-widget-fileinput/zipball/744e12c1f5be45357ec50eea6f678ecc9ba67dc2",
  449 + "reference": "744e12c1f5be45357ec50eea6f678ecc9ba67dc2",
443 450 "shasum": ""
444 451 },
445 452 "require": {
... ... @@ -481,20 +488,20 @@
481 488 "widget",
482 489 "yii2"
483 490 ],
484   - "time": "2016-07-06 19:27:12"
  491 + "time": "2016-10-18 06:35:15"
485 492 },
486 493 {
487 494 "name": "phpmailer/phpmailer",
488   - "version": "v5.2.16",
  495 + "version": "v5.2.19",
489 496 "source": {
490 497 "type": "git",
491 498 "url": "https://github.com/PHPMailer/PHPMailer.git",
492   - "reference": "1d85f9ef3ecfc42bbc4f3c70d5e37ca9a65f629a"
  499 + "reference": "9e4b8fb3deb7d9cfa515c04cec41f71bc37ce9a9"
493 500 },
494 501 "dist": {
495 502 "type": "zip",
496   - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/1d85f9ef3ecfc42bbc4f3c70d5e37ca9a65f629a",
497   - "reference": "1d85f9ef3ecfc42bbc4f3c70d5e37ca9a65f629a",
  503 + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9e4b8fb3deb7d9cfa515c04cec41f71bc37ce9a9",
  504 + "reference": "9e4b8fb3deb7d9cfa515c04cec41f71bc37ce9a9",
498 505 "shasum": ""
499 506 },
500 507 "require": {
... ... @@ -541,7 +548,7 @@
541 548 }
542 549 ],
543 550 "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
544   - "time": "2016-06-06 09:09:37"
  551 + "time": "2016-12-26 10:09:10"
545 552 },
546 553 {
547 554 "name": "swiftmailer/swiftmailer",
... ... @@ -549,12 +556,12 @@
549 556 "source": {
550 557 "type": "git",
551 558 "url": "https://github.com/swiftmailer/swiftmailer.git",
552   - "reference": "17ba8f8fc03074f90771e52b226698e37bc2c115"
  559 + "reference": "3547577659c1a035093b70fce5ae393b3c94f44e"
553 560 },
554 561 "dist": {
555 562 "type": "zip",
556   - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/17ba8f8fc03074f90771e52b226698e37bc2c115",
557   - "reference": "17ba8f8fc03074f90771e52b226698e37bc2c115",
  563 + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/3547577659c1a035093b70fce5ae393b3c94f44e",
  564 + "reference": "3547577659c1a035093b70fce5ae393b3c94f44e",
558 565 "shasum": ""
559 566 },
560 567 "require": {
... ... @@ -594,7 +601,7 @@
594 601 "mail",
595 602 "mailer"
596 603 ],
597   - "time": "2016-07-09 18:06:48"
  604 + "time": "2016-12-20 05:27:43"
598 605 },
599 606 {
600 607 "name": "yiisoft/yii2",
... ... @@ -602,17 +609,17 @@
602 609 "source": {
603 610 "type": "git",
604 611 "url": "https://github.com/yiisoft/yii2-framework.git",
605   - "reference": "8c276b391701c3b5edfebc126da4e5361cfa0f01"
  612 + "reference": "c637e494ebb0cfa404a2475f95135bdaac826a78"
606 613 },
607 614 "dist": {
608 615 "type": "zip",
609   - "url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/8c276b391701c3b5edfebc126da4e5361cfa0f01",
610   - "reference": "8c276b391701c3b5edfebc126da4e5361cfa0f01",
  616 + "url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/c637e494ebb0cfa404a2475f95135bdaac826a78",
  617 + "reference": "c637e494ebb0cfa404a2475f95135bdaac826a78",
611 618 "shasum": ""
612 619 },
613 620 "require": {
614 621 "bower-asset/jquery": "2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable",
615   - "bower-asset/jquery.inputmask": "~3.2.2",
  622 + "bower-asset/jquery.inputmask": "~3.2.2 | ~3.3.3",
616 623 "bower-asset/punycode": "1.3.*",
617 624 "bower-asset/yii2-pjax": "~2.0.1",
618 625 "cebe/markdown": "~1.0.0 | ~1.1.0",
... ... @@ -688,7 +695,7 @@
688 695 "framework",
689 696 "yii2"
690 697 ],
691   - "time": "2016-07-14 09:38:26"
  698 + "time": "2016-12-27 20:35:45"
692 699 },
693 700 {
694 701 "name": "yiisoft/yii2-bootstrap",
... ... @@ -696,17 +703,17 @@
696 703 "source": {
697 704 "type": "git",
698 705 "url": "https://github.com/yiisoft/yii2-bootstrap.git",
699   - "reference": "a7a9282477c9e5f0d63c16b94652fd0fe039e79e"
  706 + "reference": "bd2427e162226297891670c77be286385ca4805c"
700 707 },
701 708 "dist": {
702 709 "type": "zip",
703   - "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/a7a9282477c9e5f0d63c16b94652fd0fe039e79e",
704   - "reference": "a7a9282477c9e5f0d63c16b94652fd0fe039e79e",
  710 + "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/bd2427e162226297891670c77be286385ca4805c",
  711 + "reference": "bd2427e162226297891670c77be286385ca4805c",
705 712 "shasum": ""
706 713 },
707 714 "require": {
708 715 "bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*",
709   - "yiisoft/yii2": ">=2.0.6"
  716 + "yiisoft/yii2": "~2.0.6"
710 717 },
711 718 "type": "yii2-extension",
712 719 "extra": {
... ... @@ -738,7 +745,7 @@
738 745 "bootstrap",
739 746 "yii2"
740 747 ],
741   - "time": "2016-07-12 10:21:49"
  748 + "time": "2016-12-19 12:53:18"
742 749 },
743 750 {
744 751 "name": "yiisoft/yii2-composer",
... ... @@ -746,17 +753,20 @@
746 753 "source": {
747 754 "type": "git",
748 755 "url": "https://github.com/yiisoft/yii2-composer.git",
749   - "reference": "e882cc327a6935a41f2e8665b9ef0317f6852d4d"
  756 + "reference": "b2590a802a6f747a034893f8bfbeac57fc9ffa77"
750 757 },
751 758 "dist": {
752 759 "type": "zip",
753   - "url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/e882cc327a6935a41f2e8665b9ef0317f6852d4d",
754   - "reference": "e882cc327a6935a41f2e8665b9ef0317f6852d4d",
  760 + "url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/b2590a802a6f747a034893f8bfbeac57fc9ffa77",
  761 + "reference": "b2590a802a6f747a034893f8bfbeac57fc9ffa77",
755 762 "shasum": ""
756 763 },
757 764 "require": {
758 765 "composer-plugin-api": "^1.0"
759 766 },
  767 + "require-dev": {
  768 + "composer/composer": "^1.0"
  769 + },
760 770 "type": "composer-plugin",
761 771 "extra": {
762 772 "class": "yii\\composer\\Plugin",
... ... @@ -785,7 +795,7 @@
785 795 "extension installer",
786 796 "yii2"
787 797 ],
788   - "time": "2016-06-05 20:34:32"
  798 + "time": "2016-12-20 13:33:37"
789 799 },
790 800 {
791 801 "name": "yiisoft/yii2-jui",
... ... @@ -793,17 +803,17 @@
793 803 "source": {
794 804 "type": "git",
795 805 "url": "https://github.com/yiisoft/yii2-jui.git",
796   - "reference": "1612593ac710975c235e75708b69fa9ee375ab46"
  806 + "reference": "8c239b90f7f74d2c1d2d4b493c494287ea435ec7"
797 807 },
798 808 "dist": {
799 809 "type": "zip",
800   - "url": "https://api.github.com/repos/yiisoft/yii2-jui/zipball/1612593ac710975c235e75708b69fa9ee375ab46",
801   - "reference": "1612593ac710975c235e75708b69fa9ee375ab46",
  810 + "url": "https://api.github.com/repos/yiisoft/yii2-jui/zipball/8c239b90f7f74d2c1d2d4b493c494287ea435ec7",
  811 + "reference": "8c239b90f7f74d2c1d2d4b493c494287ea435ec7",
802 812 "shasum": ""
803 813 },
804 814 "require": {
805 815 "bower-asset/jquery-ui": "1.11.*@stable",
806   - "yiisoft/yii2": ">=2.0.4"
  816 + "yiisoft/yii2": "~2.0.4"
807 817 },
808 818 "type": "yii2-extension",
809 819 "extra": {
... ... @@ -835,7 +845,7 @@
835 845 "jQuery UI",
836 846 "yii2"
837 847 ],
838   - "time": "2016-06-11 22:54:20"
  848 + "time": "2016-12-27 11:19:15"
839 849 },
840 850 {
841 851 "name": "yiisoft/yii2-swiftmailer",
... ... @@ -843,17 +853,17 @@
843 853 "source": {
844 854 "type": "git",
845 855 "url": "https://github.com/yiisoft/yii2-swiftmailer.git",
846   - "reference": "163b9c6273e133c43a596aef46a9f5b1537731f9"
  856 + "reference": "c86c5ee2464ebf8c9f9adc2978193a9a2771b9c9"
847 857 },
848 858 "dist": {
849 859 "type": "zip",
850   - "url": "https://api.github.com/repos/yiisoft/yii2-swiftmailer/zipball/163b9c6273e133c43a596aef46a9f5b1537731f9",
851   - "reference": "163b9c6273e133c43a596aef46a9f5b1537731f9",
  860 + "url": "https://api.github.com/repos/yiisoft/yii2-swiftmailer/zipball/c86c5ee2464ebf8c9f9adc2978193a9a2771b9c9",
  861 + "reference": "c86c5ee2464ebf8c9f9adc2978193a9a2771b9c9",
852 862 "shasum": ""
853 863 },
854 864 "require": {
855 865 "swiftmailer/swiftmailer": "~5.0",
856   - "yiisoft/yii2": ">=2.0.4"
  866 + "yiisoft/yii2": "~2.0.4"
857 867 },
858 868 "type": "yii2-extension",
859 869 "extra": {
... ... @@ -885,7 +895,7 @@
885 895 "swiftmailer",
886 896 "yii2"
887 897 ],
888   - "time": "2016-04-14 08:50:13"
  898 + "time": "2016-11-30 11:55:45"
889 899 }
890 900 ],
891 901 "packages-dev": [
... ... @@ -922,12 +932,12 @@
922 932 "source": {
923 933 "type": "git",
924 934 "url": "https://github.com/fzaninotto/Faker.git",
925   - "reference": "039eeba8a61788df89c7800eccb2c56723a0db34"
  935 + "reference": "56ff6fa72a0678ff48df610e5637ca6b15c5444f"
926 936 },
927 937 "dist": {
928 938 "type": "zip",
929   - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/039eeba8a61788df89c7800eccb2c56723a0db34",
930   - "reference": "039eeba8a61788df89c7800eccb2c56723a0db34",
  939 + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/56ff6fa72a0678ff48df610e5637ca6b15c5444f",
  940 + "reference": "56ff6fa72a0678ff48df610e5637ca6b15c5444f",
931 941 "shasum": ""
932 942 },
933 943 "require": {
... ... @@ -964,7 +974,7 @@
964 974 "faker",
965 975 "fixtures"
966 976 ],
967   - "time": "2016-07-11 08:36:05"
  977 + "time": "2016-12-21 09:03:27"
968 978 },
969 979 {
970 980 "name": "phpspec/php-diff",
... ... @@ -1010,12 +1020,12 @@
1010 1020 "source": {
1011 1021 "type": "git",
1012 1022 "url": "https://github.com/yiisoft/yii2-codeception.git",
1013   - "reference": "572a6d46d942cc5733c45931fdbd1d60228f3c89"
  1023 + "reference": "76fdd689b7ec49c3c57db6137ae5ea536fa8f16d"
1014 1024 },
1015 1025 "dist": {
1016 1026 "type": "zip",
1017   - "url": "https://api.github.com/repos/yiisoft/yii2-codeception/zipball/572a6d46d942cc5733c45931fdbd1d60228f3c89",
1018   - "reference": "572a6d46d942cc5733c45931fdbd1d60228f3c89",
  1027 + "url": "https://api.github.com/repos/yiisoft/yii2-codeception/zipball/76fdd689b7ec49c3c57db6137ae5ea536fa8f16d",
  1028 + "reference": "76fdd689b7ec49c3c57db6137ae5ea536fa8f16d",
1019 1029 "shasum": ""
1020 1030 },
1021 1031 "require": {
... ... @@ -1047,7 +1057,8 @@
1047 1057 "codeception",
1048 1058 "yii2"
1049 1059 ],
1050   - "time": "2016-04-14 08:46:27"
  1060 + "abandoned": "codeception/codeception",
  1061 + "time": "2016-10-20 13:07:49"
1051 1062 },
1052 1063 {
1053 1064 "name": "yiisoft/yii2-debug",
... ... @@ -1055,17 +1066,17 @@
1055 1066 "source": {
1056 1067 "type": "git",
1057 1068 "url": "https://github.com/yiisoft/yii2-debug.git",
1058   - "reference": "07ad6f410eb60c57345e4c687e53b097c40b4a6c"
  1069 + "reference": "fa4156df93910f59662a2c1ca0d138803807ade6"
1059 1070 },
1060 1071 "dist": {
1061 1072 "type": "zip",
1062   - "url": "https://api.github.com/repos/yiisoft/yii2-debug/zipball/07ad6f410eb60c57345e4c687e53b097c40b4a6c",
1063   - "reference": "07ad6f410eb60c57345e4c687e53b097c40b4a6c",
  1073 + "url": "https://api.github.com/repos/yiisoft/yii2-debug/zipball/fa4156df93910f59662a2c1ca0d138803807ade6",
  1074 + "reference": "fa4156df93910f59662a2c1ca0d138803807ade6",
1064 1075 "shasum": ""
1065 1076 },
1066 1077 "require": {
1067   - "yiisoft/yii2": ">=2.0.4",
1068   - "yiisoft/yii2-bootstrap": "*"
  1078 + "yiisoft/yii2": "~2.0.4",
  1079 + "yiisoft/yii2-bootstrap": "~2.0.0"
1069 1080 },
1070 1081 "type": "yii2-extension",
1071 1082 "extra": {
... ... @@ -1094,7 +1105,7 @@
1094 1105 "debugger",
1095 1106 "yii2"
1096 1107 ],
1097   - "time": "2016-06-06 19:17:49"
  1108 + "time": "2016-12-15 14:50:58"
1098 1109 },
1099 1110 {
1100 1111 "name": "yiisoft/yii2-faker",
... ... @@ -1102,17 +1113,17 @@
1102 1113 "source": {
1103 1114 "type": "git",
1104 1115 "url": "https://github.com/yiisoft/yii2-faker.git",
1105   - "reference": "6e6eb430809e3f9c05e367303909a05a4912d4c0"
  1116 + "reference": "8a406289c3af4da5e0092a96b37734dc1a16a43b"
1106 1117 },
1107 1118 "dist": {
1108 1119 "type": "zip",
1109   - "url": "https://api.github.com/repos/yiisoft/yii2-faker/zipball/6e6eb430809e3f9c05e367303909a05a4912d4c0",
1110   - "reference": "6e6eb430809e3f9c05e367303909a05a4912d4c0",
  1120 + "url": "https://api.github.com/repos/yiisoft/yii2-faker/zipball/8a406289c3af4da5e0092a96b37734dc1a16a43b",
  1121 + "reference": "8a406289c3af4da5e0092a96b37734dc1a16a43b",
1111 1122 "shasum": ""
1112 1123 },
1113 1124 "require": {
1114 1125 "fzaninotto/faker": "~1.4",
1115   - "yiisoft/yii2": "*"
  1126 + "yiisoft/yii2": "~2.0.0"
1116 1127 },
1117 1128 "type": "yii2-extension",
1118 1129 "extra": {
... ... @@ -1141,7 +1152,7 @@
1141 1152 "faker",
1142 1153 "yii2"
1143 1154 ],
1144   - "time": "2016-04-14 08:47:34"
  1155 + "time": "2016-12-02 21:11:03"
1145 1156 },
1146 1157 {
1147 1158 "name": "yiisoft/yii2-gii",
... ... @@ -1149,18 +1160,18 @@
1149 1160 "source": {
1150 1161 "type": "git",
1151 1162 "url": "https://github.com/yiisoft/yii2-gii.git",
1152   - "reference": "4f7bece043b6e60571ad855cd937bf0e07e1891d"
  1163 + "reference": "e28ccc70fe052187c2d060f67241d05e95ff5eae"
1153 1164 },
1154 1165 "dist": {
1155 1166 "type": "zip",
1156   - "url": "https://api.github.com/repos/yiisoft/yii2-gii/zipball/4f7bece043b6e60571ad855cd937bf0e07e1891d",
1157   - "reference": "4f7bece043b6e60571ad855cd937bf0e07e1891d",
  1167 + "url": "https://api.github.com/repos/yiisoft/yii2-gii/zipball/e28ccc70fe052187c2d060f67241d05e95ff5eae",
  1168 + "reference": "e28ccc70fe052187c2d060f67241d05e95ff5eae",
1158 1169 "shasum": ""
1159 1170 },
1160 1171 "require": {
1161 1172 "bower-asset/typeahead.js": "0.10.* | ~0.11.0",
1162 1173 "phpspec/php-diff": ">=1.0.2",
1163   - "yiisoft/yii2": ">=2.0.4",
  1174 + "yiisoft/yii2": "~2.0.4",
1164 1175 "yiisoft/yii2-bootstrap": "~2.0"
1165 1176 },
1166 1177 "type": "yii2-extension",
... ... @@ -1194,7 +1205,7 @@
1194 1205 "gii",
1195 1206 "yii2"
1196 1207 ],
1197   - "time": "2016-07-07 16:09:06"
  1208 + "time": "2016-12-21 16:50:20"
1198 1209 }
1199 1210 ],
1200 1211 "aliases": [],
... ...
console/migrations/m160714_132243_change_build_format.php renamed to console/migrations/m161228_142205_buys.php 100755 → 100644
... ... @@ -2,15 +2,23 @@
2 2  
3 3 use yii\db\Migration;
4 4  
5   -class m160714_132243_change_build_format extends Migration
  5 +class m161228_142205_buys extends Migration
6 6 {
7 7 public function up()
8 8 {
9   - $this->alterColumn('car', 'build', $this->string());
  9 + $this->createTable('buys', [
  10 + 'id' => $this->primaryKey(),
  11 + 'username' => $this->string(),
  12 + 'email' => $this->string(),
  13 + 'phone' => $this->string(),
  14 + 'model_name' => $this->string(),
  15 + 'model_year' => $this->string(),
  16 + 'model_color' => $this->string(),
  17 + ]);
10 18 }
11 19  
12 20 public function down()
13 21 {
14   - $this->alterColumn('car', 'build', $this->integer());
  22 + $this->dropTable('buys');
15 23 }
16 24 }
... ...
console/migrations/m160714_124817_create_car.php renamed to console/migrations/m161228_142558_car.php 100755 → 100644
1 1 <?php
2   -
3   - use yii\db\Migration;
4   -
5   - class m160714_124817_create_car extends Migration
  2 +
  3 +use yii\db\Migration;
  4 +
  5 +class m161228_142558_car extends Migration
  6 +{
  7 + public function up()
6 8 {
7   -
8   - public function up()
9   - {
10   - $this->createTable('car', [
11   - 'car_id' => $this->primaryKey(),
12   - 'model' => $this->string()
13   - ->notNull(),
14   - 'year' => $this->integer()
15   - ->notNull(),
16   - 'image' => $this->string(),
17   - 'color' => $this->string(),
18   - 'mileage' => $this->float(),
19   - 'build' => $this->integer(),
20   - 'option' => $this->text(),
21   - 'price' => $this->float(),
22   - ]);
23   - }
24   -
25   - public function down()
26   - {
27   - $this->dropTable('car');
28   - }
  9 + $this->createTable('car', [
  10 + 'car_id' => $this->primaryKey(),
  11 + 'model' => $this->string(),
  12 + 'year' => $this->integer(),
  13 + 'image' => $this->string(),
  14 + 'color' => $this->string(),
  15 + 'mileage' => $this->double(),
  16 + 'build' => $this->string(),
  17 + 'option' => $this->text(),
  18 + 'price' => $this->double(),
  19 + ]);
29 20 }
  21 +
  22 + public function down()
  23 + {
  24 + $this->dropTable('car');
  25 + }
  26 +}
... ...
console/migrations/m161228_143104_emails.php 0 → 100644
  1 +<?php
  2 +
  3 +use yii\db\Migration;
  4 +
  5 +class m161228_143104_emails extends Migration
  6 +{
  7 + public function up()
  8 + {
  9 + $this->createTable('emails', [
  10 + 'id' => $this->primaryKey(),
  11 + 'username' => $this->string(),
  12 + 'email' => $this->string(),
  13 + 'phone' => $this->string(),
  14 + 'message' => $this->text(),
  15 + 'date_from' => $this->integer(),
  16 + 'date_to' => $this->integer(),
  17 + 'date_count' => $this->integer(),
  18 + ]);
  19 + }
  20 +
  21 + public function down()
  22 + {
  23 + $this->dropTable('emails');
  24 + }
  25 +}
... ...
console/migrations/m161228_143500_language.php 0 → 100644
  1 +<?php
  2 +
  3 +use yii\db\Migration;
  4 +
  5 +class m161228_143500_language extends Migration
  6 +{
  7 + public function up()
  8 + {
  9 + $this->createTable('language', [
  10 + 'language_id' => $this->primaryKey(),
  11 + 'url' => $this->string(),
  12 + 'local' => $this->string(),
  13 + 'name' => $this->string(),
  14 + 'default' => $this->boolean(),
  15 + 'date_create' => $this->integer(),
  16 + 'date_update' => $this->integer(),
  17 + ]);
  18 + }
  19 +
  20 + public function down()
  21 + {
  22 + $this->dropTable('language');
  23 + }
  24 +}
... ...
frontend/assets/AppAsset.php
... ... @@ -23,7 +23,6 @@
23 23 'js/firstSlider.js',
24 24 'js/pushy.js',
25 25 'js/owl.carousel.min.js',
26   - 'js/script2.js',
27 26 'http://code.jquery.com/ui/1.11.4/jquery-ui.js'
28 27 ];
29 28 public $depends = [
... ...
frontend/controllers/SiteController.php
... ... @@ -19,7 +19,9 @@
19 19 use frontend\models\SignupForm;
20 20 use frontend\models\ContactForm;
21 21 use common\widgets\Mailer;
22   -
  22 + use yii\web\Response;
  23 + use yii\web\ResponseFormatterInterface;
  24 +
23 25 /**
24 26 * Site controller
25 27 */
... ... @@ -245,16 +247,19 @@
245 247  
246 248 public function actionTestdrive()
247 249 {
248   - echo Mailer::widget([ 'type' => 'test',
  250 + \Yii::$app->response->format = Response::FORMAT_JSON;
  251 + Mailer::widget([ 'type' => 'test',
249 252 'subject' => 'Запись на тест-драйв',
250 253 'params' => Yii::$app->request->post('TestdriveForm'),
251 254 ]);
252 255 $model = new Emails();
253 256  
254 257 $model->load(Yii::$app->request->post(), 'TestdriveForm');
255   - $model->save();
256   -
257   - die();
  258 + if ($model->save()) {
  259 + return [
  260 + 'success' => true,
  261 + ];
  262 + }
258 263 }
259 264  
260 265 /**
... ... @@ -262,19 +267,28 @@
262 267 */
263 268 public function actionBuy()
264 269 {
  270 + \Yii::$app->response->format = Response::FORMAT_JSON;
265 271 Mailer::widget([ 'type' => 'buy',
266 272 'subject' => 'Покупка автомобиля',
267 273 'params' => Yii::$app->request->post('OrderForm'),
268 274 ]);
269 275 $model = new Buys();
  276 + $car = Car::findOne(Yii::$app->request->post('OrderForm')['model']);
270 277  
271   - $model->load(Yii::$app->request->post(), 'OrderForm');
272   - $model->save();
  278 + $model->model_name = $car->model;
  279 + $model->model_year = $car->year;
  280 + $model->model_color = $car->color;
273 281  
274   - die();
  282 + $model->load(Yii::$app->request->post(), 'OrderForm');
  283 + if ($model->save()) {
  284 + return [
  285 + 'success' => true,
  286 + ];
  287 + }
275 288 }
276 289 public function actionQuestion()
277 290 {
  291 + \Yii::$app->response->format = Response::FORMAT_JSON;
278 292 Mailer::widget([ 'type' => 'question',
279 293 'subject' => 'Вопросы',
280 294 'params' => Yii::$app->request->post('QuestionForm'),
... ... @@ -284,12 +298,15 @@
284 298 ]);
285 299  
286 300 $model->load(Yii::$app->request->post(), 'QuestionForm');
287   - $model->save();
288   -
289   - die();
  301 + if ($model->save()) {
  302 + return [
  303 + 'success' => true,
  304 + ];
  305 + }
290 306 }
291 307 public function actionBooking()
292 308 {
  309 + \Yii::$app->response->format = Response::FORMAT_JSON;
293 310 Mailer::widget([ 'type' => 'booking',
294 311 'subject' => 'Бронирование авто',
295 312 'params' => Yii::$app->request->post('BookingForm'),
... ... @@ -299,11 +316,15 @@
299 316 ]);
300 317  
301 318 $model->load(Yii::$app->request->post(), 'BookingForm');
302   - $model->save();
303   - die();
  319 + if ($model->save()) {
  320 + return [
  321 + 'success' => true,
  322 + ];
  323 + }
304 324 }
305 325 public function actionKeytokey()
306 326 {
  327 + \Yii::$app->response->format = Response::FORMAT_JSON;
307 328 Mailer::widget([ 'type' => 'keytokey',
308 329 'subject' => 'Акция Ключ-на-ключ',
309 330 'params' => Yii::$app->request->post('KeytokeyForm'),
... ... @@ -313,8 +334,10 @@
313 334 ]);
314 335  
315 336 $model->load(Yii::$app->request->post(), 'KeytokeyForm');
316   - $model->save();
317   -
318   - die();
  337 + if ($model->save()) {
  338 + return [
  339 + 'success' => true,
  340 + ];
  341 + }
319 342 }
320 343 }
... ...
frontend/views/site/index.php
... ... @@ -48,182 +48,6 @@
48 48 <!-- Site Overlay -->
49 49 <div class="site-overlay"></div>
50 50  
51   -<!-- Modal Записаться на тест-драйв -->
52   -<div class="modal fade" id="test_drive" tabindex="-1" role="dialog" aria-labelledby="test_drive" aria-hidden="true">
53   - <div class="modal-dialog modal-lg" role="document">
54   - <div class="modal-content">
55   - <div class="modal-header">
56   - <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
57   - <h4><?= Yii::t('app', 'enroll')?></h4>
58   - </div>
59   - <div class="modal-body">
60   - <?php $model = new TestdriveForm();
61   - $form = ActiveForm::begin([
62   - 'id' => 'form_testdrive',
63   - 'action' => 'site/testdrive',
64   - ]); ?>
65   - <div class="form-group">
66   - <?= $form->field($model, 'username')->textInput([ 'autofocus' => true,'class' => 'form-control custom-input-2' ]) ?>
67   - </div>
68   - <div class="form-group danger-text">
69   - <?= $form->field($model, 'phone')->textInput(['class' => 'form-control custom-input-2' ])?>
70   - </div>
71   - <div class="form-footer button-wrapper">
72   - <?= Html::submitButton(Yii::t('app', 'send'), [ 'class' => 'btn' ], [ 'name' => 'signup-button' ]) ?>
73   - </div>
74   -
75   - <?php ActiveForm::end(); ?>
76   - </div>
77   - </div>
78   - </div>
79   -</div>
80   -
81   -<!-- Модальное окно Остались вопросы? -->
82   -<div class="modal fade" id="questions" tabindex="-1" role="dialog" aria-labelledby="questions" aria-hidden="true">
83   - <div class="modal-dialog modal-lg" role="document">
84   - <div class="modal-content">
85   - <div class="modal-header">
86   - <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
87   - <h4><?= Yii::t('app', 'questions')?></h4>
88   - </div>
89   - <div class="modal-body">
90   - <?php $model = new QuestionForm();
91   - $form = ActiveForm::begin([
92   - 'id' => 'form_question',
93   - 'action' => 'site/question',
94   - ]); ?>
95   -
96   - <div class="form-group"><?= $form->field($model, 'username')
97   - ->textInput([ 'autofocus' => true,'class' => 'form-control custom-input-2' ]) ?></div>
98   - <div class="form-group danger-text"><?= $form->field($model, 'phone')
99   - ->textInput(['class' => 'form-control custom-input-2' ]) ?></div>
100   - <div class="form-group danger-text"><?= $form->field($model, 'email')
101   - ->textInput(['class' => 'form-control custom-input-2' ]) ?></div>
102   - <div class="form-group"><?= $form->field($model, 'message')
103   - ->textarea(['class' => 'form-control custom-input-2' ]) ?></div>
104   -
105   - <div class="form-footer button-wrapper">
106   - <?= Html::submitButton(Yii::t('app', 'send'), [ 'class' => 'btn' ], [ 'name' => 'signup-button' ]) ?>
107   - </div>
108   -
109   - <?php ActiveForm::end(); ?>
110   - </div>
111   - </div>
112   - </div>
113   -</div>
114   -
115   -<!-- Модальное окно Оставить заявку? -->
116   -<div class="modal fade" id="zayavka" tabindex="-1" role="dialog" aria-labelledby="zayavka" aria-hidden="true">
117   - <div class="modal-dialog modal-lg" role="document">
118   - <div class="modal-content">
119   - <div class="modal-header">
120   - <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
121   - <h4><?= Yii::t('app', 'keytokey')?></h4>
122   - </div>
123   - <div class="modal-body">
124   - <?php $model = new KeytokeyForm();
125   - $form = ActiveForm::begin([
126   - 'id' => 'form_keytokey',
127   - 'action' => 'site/keytokey',
128   - ]); ?>
129   - <div class="form-group">
130   - <?= $form->field($model, 'username')->textInput([ 'autofocus' => true,'class' => 'form-control custom-input-2' ]) ?>
131   - </div>
132   - <div class="form-group danger-text">
133   - <?= $form->field($model, 'phone')->textInput(['class' => 'form-control custom-input-2' ]) ?>
134   - </div>
135   - <div class="form-group danger-text">
136   - <?= $form->field($model, 'email')->textInput(['class' => 'form-control custom-input-2' ]) ?>
137   - </div>
138   - <div class="form-group"><?= $form->field($model, 'date_count')->dropDownList([
139   - '3' => '3 '.Yii::t('app', 'days'),
140   - '5' => '5 '.Yii::t('app', 'days')], ['class' => 'custom-input-2 form-control']) ?>
141   - </div>
142   -
143   - <div class="form-footer button-wrapper">
144   - <?= Html::submitButton(Yii::t('app', 'send'), [ 'class' => 'btn' ], [ 'name' => 'signup-button' ]) ?>
145   - </div>
146   -
147   - <?php ActiveForm::end(); ?>
148   - </div>
149   - </div>
150   - </div>
151   -</div>
152   -
153   -<!-- Модальное окно Оставить заявку? -->
154   -<div class="modal fade" id="application" tabindex="-1" role="dialog" aria-labelledby="application" aria-hidden="true">
155   - <div class="modal-dialog modal-lg" role="document">
156   - <div class="modal-content">
157   - <div class="modal-header">
158   - <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
159   - <h4>Заявка на прокат авто</h4>
160   - </div>
161   - <div class="modal-body">
162   - <?php $model = new BookingForm();
163   - $form = ActiveForm::begin([
164   - 'id' => 'form_booking',
165   - 'action' => 'site/booking',
166   - ]); ?>
167   -
168   - <div class="form-group"><?= $form->field($model, 'username')->textInput([ 'autofocus' => true,'class' => 'form-control custom-input-2' ]) ?></div>
169   - <div class="form-group danger-text"><?= $form->field($model, 'phone')->textInput(['class' => 'form-control custom-input-2' ]) ?></div>
170   - <div class="form-group danger-text"><?= $form->field($model, 'email')->textInput(['class' => 'form-control custom-input-2' ]) ?></div>
171   -
172   - <div class="input-blocks datepicker_ required">
173   - <div class="datepicker_title"><?= Yii::t('app', 'bron')?>:</div>
174   - <div class="form-group-2-l danger-text">
175   - <?= $form->field($model, 'date_from')
176   - ->textInput(['class' => 'form-control']) ?>
177   - <?= $form->field($model, 'date_to')
178   - ->textInput(['class' => 'form-control']) ?>
179   - </div>
180   - </div>
181   - <div class="form-footer button-wrapper">
182   - <?= Html::submitButton(Yii::t('app', 'comment'), [ 'class' => 'btn' ], [ 'name' => 'signup-button' ]) ?>
183   - </div>
184   -
185   - <?php ActiveForm::end(); ?>
186   - </div>
187   - </div>
188   - </div>
189   -</div>
190   -
191   -<!-- Модальное окно buy? -->
192   -<div class="modal fade" id="buy" tabindex="-1" role="dialog" aria-labelledby="buy" aria-hidden="true">
193   - <div class="modal-dialog modal-lg" role="document">
194   - <div class="modal-content">
195   - <div class="modal-header">
196   - <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
197   - <h4 class="model-car-name"></h4>
198   - </div>
199   - <div class="modal-body">
200   - <?php $model = new OrderForm();
201   - $form = ActiveForm::begin([
202   - 'id' => 'form_buy',
203   - 'action' => 'site/buy',
204   - ]); ?>
205   -
206   - <div class="input-blocks"><?= $form->field($model, 'username')
207   - ->textInput([ 'autofocus' => true,'class' => 'form-control custom-input-2' ]) ?></div>
208   - <div class="input-blocks danger-text"><?= $form->field($model, 'phone')
209   - ->textInput(['class' => 'form-control custom-input-2' ]) ?></div>
210   - <div class="input-blocks danger-text"><?= $form->field($model, 'email')
211   - ->textInput(['class' => 'form-control custom-input-2' ]) ?></div>
212   -
213   - <?= $form->field($model, 'model')
214   - ->hiddenInput()
215   - ->label(false) ?>
216   -
217   - <div class="form-footer">
218   - <?= Html::submitButton(Yii::t('app', 'send'), [ 'class' => 'btn' ], [ 'name' => 'signup-button' ]) ?>
219   - </div>
220   -
221   - <?php ActiveForm::end(); ?>
222   - </div>
223   - </div>
224   - </div>
225   -</div>
226   -
227 51 <section id="select0"></section>
228 52 <div class="container for-lang">
229 53 <div class="language">
... ... @@ -699,14 +523,6 @@
699 523 </script>
700 524 </div>
701 525  
702   -
703   -<div id="success_form">
704   - <span id="modal_close"></span>
705   - <div class="txt-success">Ваша заявка принята.<br/>Мы свяжемся с вами в ближайшее время.</div>
706   -</div>
707   -
708   -<div id="overlay"></div>
709   -
710 526 <!-- 9 -->
711 527 <footer>
712 528 <div class="container">
... ... @@ -719,4 +535,195 @@
719 535 <a href="http://artweb.ua/"><?= Yii::t('app', 'footer3')?><img src="images/9/artweb.png" alt="Артвеб"></a> </div>
720 536 </div>
721 537 </div>
722   -</footer>
723 538 \ No newline at end of file
  539 +</footer>
  540 +
  541 +<!-- Modal success -->
  542 +<div class="modal fade" id="success_modal" tabindex="-1" role="dialog" aria-labelledby="test_drive" aria-hidden="true">
  543 + <div class="modal-dialog modal-lg" role="document">
  544 + <div class="modal-content">
  545 + <div class="modal-header">
  546 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
  547 + <h4>Ваша заявка принята.</h4>
  548 + </div>
  549 + <div class="modal-body" style="text-align: center">
  550 + Мы свяжемся с вами в ближайшее время.
  551 + </div>
  552 + </div>
  553 + </div>
  554 +</div>
  555 +
  556 +<!-- Modal Записаться на тест-драйв -->
  557 +<div class="modal fade" id="test_drive" tabindex="-1" role="dialog" aria-labelledby="test_drive" aria-hidden="true">
  558 + <div class="modal-dialog modal-lg" role="document">
  559 + <div class="modal-content">
  560 + <div class="modal-header">
  561 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
  562 + <h4><?= Yii::t('app', 'enroll')?></h4>
  563 + </div>
  564 + <div class="modal-body">
  565 + <?php $model = new TestdriveForm();
  566 + $form = ActiveForm::begin([
  567 + 'id' => 'form_testdrive',
  568 + 'action' => 'site/testdrive',
  569 + ]); ?>
  570 + <div class="form-group">
  571 + <?= $form->field($model, 'username')->textInput([ 'autofocus' => true,'class' => 'form-control custom-input-2' ]) ?>
  572 + </div>
  573 + <div class="form-group danger-text">
  574 + <?= $form->field($model, 'phone')->textInput(['class' => 'form-control custom-input-2' ])?>
  575 + </div>
  576 + <div class="form-footer button-wrapper">
  577 + <?= Html::submitButton(Yii::t('app', 'send'), [ 'class' => 'btn' ], [ 'name' => 'signup-button' ]) ?>
  578 + </div>
  579 +
  580 + <?php ActiveForm::end(); ?>
  581 + </div>
  582 + </div>
  583 + </div>
  584 +</div>
  585 +
  586 +<!-- Модальное окно Остались вопросы? -->
  587 +<div class="modal fade" id="questions" tabindex="-1" role="dialog" aria-labelledby="questions" aria-hidden="true">
  588 + <div class="modal-dialog modal-lg" role="document">
  589 + <div class="modal-content">
  590 + <div class="modal-header">
  591 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
  592 + <h4><?= Yii::t('app', 'questions')?></h4>
  593 + </div>
  594 + <div class="modal-body">
  595 + <?php $model = new QuestionForm();
  596 + $form = ActiveForm::begin([
  597 + 'id' => 'form_question',
  598 + 'action' => 'site/question',
  599 + ]); ?>
  600 +
  601 + <div class="form-group"><?= $form->field($model, 'username')
  602 + ->textInput([ 'autofocus' => true,'class' => 'form-control custom-input-2' ]) ?></div>
  603 + <div class="form-group danger-text"><?= $form->field($model, 'phone')
  604 + ->textInput(['class' => 'form-control custom-input-2' ]) ?></div>
  605 + <div class="form-group danger-text"><?= $form->field($model, 'email')
  606 + ->textInput(['class' => 'form-control custom-input-2' ]) ?></div>
  607 + <div class="form-group"><?= $form->field($model, 'message')
  608 + ->textarea(['class' => 'form-control custom-input-2' ]) ?></div>
  609 +
  610 + <div class="form-footer button-wrapper">
  611 + <?= Html::submitButton(Yii::t('app', 'send'), [ 'class' => 'btn' ], [ 'name' => 'signup-button' ]) ?>
  612 + </div>
  613 +
  614 + <?php ActiveForm::end(); ?>
  615 + </div>
  616 + </div>
  617 + </div>
  618 +</div>
  619 +
  620 +<!-- Модальное окно Оставить заявку? -->
  621 +<div class="modal fade" id="zayavka" tabindex="-1" role="dialog" aria-labelledby="zayavka" aria-hidden="true">
  622 + <div class="modal-dialog modal-lg" role="document">
  623 + <div class="modal-content">
  624 + <div class="modal-header">
  625 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
  626 + <h4><?= Yii::t('app', 'keytokey')?></h4>
  627 + </div>
  628 + <div class="modal-body">
  629 + <?php $model = new KeytokeyForm();
  630 + $form = ActiveForm::begin([
  631 + 'id' => 'form_keytokey',
  632 + 'action' => 'site/keytokey',
  633 + ]); ?>
  634 + <div class="form-group">
  635 + <?= $form->field($model, 'username')->textInput([ 'autofocus' => true,'class' => 'form-control custom-input-2' ]) ?>
  636 + </div>
  637 + <div class="form-group danger-text">
  638 + <?= $form->field($model, 'phone')->textInput(['class' => 'form-control custom-input-2' ]) ?>
  639 + </div>
  640 + <div class="form-group danger-text">
  641 + <?= $form->field($model, 'email')->textInput(['class' => 'form-control custom-input-2' ]) ?>
  642 + </div>
  643 + <div class="form-group"><?= $form->field($model, 'date_count')->dropDownList([
  644 + '3' => '3 '.Yii::t('app', 'days'),
  645 + '5' => '5 '.Yii::t('app', 'days')], ['class' => 'custom-input-2 form-control']) ?>
  646 + </div>
  647 +
  648 + <div class="form-footer button-wrapper">
  649 + <?= Html::submitButton(Yii::t('app', 'send'), [ 'class' => 'btn' ], [ 'name' => 'signup-button' ]) ?>
  650 + </div>
  651 +
  652 + <?php ActiveForm::end(); ?>
  653 + </div>
  654 + </div>
  655 + </div>
  656 +</div>
  657 +
  658 +<!-- Модальное окно Оставить заявку? -->
  659 +<div class="modal fade" id="application" tabindex="-1" role="dialog" aria-labelledby="application" aria-hidden="true">
  660 + <div class="modal-dialog modal-lg" role="document">
  661 + <div class="modal-content">
  662 + <div class="modal-header">
  663 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
  664 + <h4>Заявка на прокат авто</h4>
  665 + </div>
  666 + <div class="modal-body">
  667 + <?php $model = new BookingForm();
  668 + $form = ActiveForm::begin([
  669 + 'id' => 'form_booking',
  670 + 'action' => 'site/booking',
  671 + ]); ?>
  672 +
  673 + <div class="form-group"><?= $form->field($model, 'username')->textInput([ 'autofocus' => true,'class' => 'form-control custom-input-2' ]) ?></div>
  674 + <div class="form-group danger-text"><?= $form->field($model, 'phone')->textInput(['class' => 'form-control custom-input-2' ]) ?></div>
  675 + <div class="form-group danger-text"><?= $form->field($model, 'email')->textInput(['class' => 'form-control custom-input-2' ]) ?></div>
  676 +
  677 + <div class="input-blocks datepicker_ required">
  678 + <div class="datepicker_title"><?= Yii::t('app', 'bron')?>:</div>
  679 + <div class="form-group-2-l danger-text">
  680 + <?= $form->field($model, 'date_from')
  681 + ->textInput(['class' => 'form-control']) ?>
  682 + <?= $form->field($model, 'date_to')
  683 + ->textInput(['class' => 'form-control']) ?>
  684 + </div>
  685 + </div>
  686 + <div class="form-footer button-wrapper">
  687 + <?= Html::submitButton(Yii::t('app', 'comment'), [ 'class' => 'btn' ], [ 'name' => 'signup-button' ]) ?>
  688 + </div>
  689 +
  690 + <?php ActiveForm::end(); ?>
  691 + </div>
  692 + </div>
  693 + </div>
  694 +</div>
  695 +
  696 +<!-- Модальное окно buy? -->
  697 +<div class="modal fade" id="buy" tabindex="-1" role="dialog" aria-labelledby="buy" aria-hidden="true">
  698 + <div class="modal-dialog modal-lg" role="document">
  699 + <div class="modal-content">
  700 + <div class="modal-header">
  701 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
  702 + <h4 class="model-car-name"></h4>
  703 + </div>
  704 + <div class="modal-body">
  705 + <?php $model = new OrderForm();
  706 + $form = ActiveForm::begin([
  707 + 'id' => 'form_buy',
  708 + 'action' => 'site/buy',
  709 + ]); ?>
  710 +
  711 + <div class="input-blocks"><?= $form->field($model, 'username')
  712 + ->textInput([ 'autofocus' => true,'class' => 'form-control custom-input-2' ]) ?></div>
  713 + <div class="input-blocks danger-text"><?= $form->field($model, 'phone')
  714 + ->textInput(['class' => 'form-control custom-input-2' ]) ?></div>
  715 + <div class="input-blocks danger-text"><?= $form->field($model, 'email')
  716 + ->textInput(['class' => 'form-control custom-input-2' ]) ?></div>
  717 +
  718 + <?= $form->field($model, 'model')
  719 + ->hiddenInput()
  720 + ->label(false) ?>
  721 +
  722 + <div class="form-footer">
  723 + <?= Html::submitButton(Yii::t('app', 'send'), [ 'class' => 'btn' ], [ 'name' => 'signup-button' ]) ?>
  724 + </div>
  725 +
  726 + <?php ActiveForm::end(); ?>
  727 + </div>
  728 + </div>
  729 + </div>
  730 +</div>
724 731 \ No newline at end of file
... ...
frontend/web/js/script.js
1 1 $(document).ready(function(){
  2 +
  3 + $(document).on('beforeSubmit', 'form', function(e) {
  4 +
  5 + $.post($(this).attr('action'), $(this).serialize(), function(data) {
  6 + if (data.success) {
  7 + console.log('ok');
  8 + $('.modal').each(function() {
  9 + $(this).modal('hide');
  10 + });
  11 + $('#success_modal')
  12 + .modal('show');
  13 + }
  14 + });
  15 +
  16 + return false;
  17 + });
  18 +
2 19 function initScroll(event) {
3 20 event.preventDefault();
4 21 var id = $(this).attr('href'),
... ... @@ -11,7 +28,8 @@ $(document).ready(function(){
11 28  
12 29 // vGovnokod here
13 30 function addNameYear(){
14   - $(".loadcars .btn").click(function(e){
  31 + $(document).on('click', '.loadcars .btn' ,function(e){
  32 + $('#orderform-model').val($(this).parent().parent().attr('data-key'));
15 33 e.preventDefault();
16 34 var carmodel = $(".models_select .nav-tabs-main").find(".active").text();
17 35 var caryear = $(".models_select .nav-tabs-year").find(".active .year-picker").text();
... ...