Commit 8072159c71ad1a6ebaea89dd1f4ff9ab34d40065

Authored by Alex Savenko
0 parents

create proj

Showing 1145 changed files with 97811 additions and 0 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 1145 files are displayed.

.bowerrc 0 → 100755
  1 +++ a/.bowerrc
  1 +{
  2 + "directory" : "vendor/bower"
  3 +}
... ...
.gitignore 0 → 100755
  1 +++ a/.gitignore
  1 +# yii console command
  2 +/yii
  3 +
  4 +# phpstorm project files
  5 +.idea
  6 +
  7 +# netbeans project files
  8 +nbproject
  9 +
  10 +# zend studio for eclipse project files
  11 +.buildpath
  12 +.project
  13 +.settings
  14 +
  15 +# windows thumbnail cache
  16 +Thumbs.db
  17 +
  18 +# composer vendor dir
  19 +/vendor
  20 +
  21 +# composer itself is not needed
  22 +composer.phar
  23 +
  24 +# Mac DS_Store Files
  25 +.DS_Store
  26 +
  27 +# phpunit itself is not needed
  28 +phpunit.phar
  29 +# local phpunit config
  30 +/phpunit.xml
  31 +
  32 +/storage
  33 +storage.zip
  34 +/common/config/main-local.php
  35 +/common/config/params-local.php
  36 +/backend/config/main-local.php
  37 +/backend/config/params-local.php
  38 +/backend/runtime/
  39 +/frontend/config/main-local.php
  40 +/frontend/config/params-local.php
  41 +/frontend/runtime/
  42 +/backend/web/assets/
  43 +/frontend/web/assets/
  44 +/frontend/web/upload/
  45 +/frontend/web/css/node_modules/
  46 +/frontend/web/images/
  47 +/frontend/views/вертска
  48 +composer.lock
  49 +
  50 +tests/_output/*
  51 +/common/modules/_comment/
  52 +Будет удалено common/modules/comment/
... ...
.htaccess 0 → 100755
  1 +++ a/.htaccess
  1 +AddDefaultCharset utf-8
  2 +<IfModule mod_rewrite.c>
  3 +
  4 +
  5 + RewriteEngine On
  6 +
  7 +</IfModule>
  8 +
  9 +<IfModule mod_rewrite.c>
  10 +
  11 + RewriteBase /
  12 + # deal with admin first
  13 + #liniya svitla only
  14 +
  15 + RewriteRule (.*)lyustry-2.htm /catalog/lyustry-i-potolochnoe-osveshchenie/filters:podrazdel-lustri=lyustra [R=301,L]
  16 + RewriteRule (.*)sovremennye-3448.htm /catalog/lyustry-i-potolochnoe-osveshchenie/filters:style-lustri=sovremennyy-6 [R=301,L]
  17 + RewriteRule (.*)klassicheskie-3407.htm /catalog/lyustry-i-potolochnoe-osveshchenie/filters:style-lustri=klassicheskiy-4 [R=301,L]
  18 + RewriteRule (.*)podvesnye-3439.htm /catalog/lyustry-i-potolochnoe-osveshchenie/filters:podrazdel-lustri=podves [R=301,L]
  19 + RewriteRule (.*)dlya-vannyh-3496.htm /catalog/lyustry-i-potolochnoe-osveshchenie/filters:podrazdel-lustri=lyustry-dlya-vy [R=301,L]
  20 + RewriteRule (.*)detskie-3495.htm /catalog/lyustry-i-potolochnoe-osveshchenie/filters:podrazdel-lustri=det-3 [R=301,L]
  21 + RewriteRule (.*)dlya-vannyh-14.htm /catalog/svetilniki-dlya-vannyh-komnat [R=301,L]
  22 + RewriteRule (.*)bra-3438.htm /catalog/svetilniki-dlya-vannyh-komnat/filters:podrazdel-vanna=bra-i-nastennye-svetilniki-2 [R=301,L]
  23 + RewriteRule (.*)lyustry-3459.htm /catalog/svetilniki-dlya-vannyh-komnat/filters:podrazdel-vanna=lyustry-i-potolochnye-svetilniki-2 [R=301,L]
  24 + RewriteRule (.*)ulichnye-22.htm /catalog/ulichnoe-osveshchenie [R=301,L]
  25 + RewriteRule (.*)podvesnye-3416.htm /catalog/ulichnoe-osveshchenie/filters:podrazdel-ulichnoe=podvesnye [R=301,L]
  26 + RewriteRule (.*)perenosnye-3406.htm /catalog/ulichnoe-osveshchenie/filters:podrazdel-ulichnoe=perenosnye [R=301,L]
  27 + RewriteRule (.*)nastenno-potolochnye-3418.htm /catalog/ulichnoe-osveshchenie/filters:podrazdel-ulichnoe=nastenno-potolochnye [R=301,L]
  28 + RewriteRule (.*)vstraivaemye-v-grunt-3420.htm /catalog/ulichnoe-osveshchenie/filters:podrazdel-ulichnoe=vstraivaemye-v-grunt [R=301,L]
  29 + RewriteRule (.*)vreznye-3419.htm /catalog/ulichnoe-osveshchenie/filters:podrazdel-ulichnoe=vreznye-2 [R=301,L]
  30 + RewriteRule (.*)stolbiki-bolshie-3415.htm /catalog/ulichnoe-osveshchenie/filters:podrazdel-ulichnoe=stolby [R=301,L]
  31 + RewriteRule (.*)abajur-3453.htm /catalog/abazhury-i-plafony [R=301,L]
  32 + RewriteRule (.*)lampochki-29.htm /catalog/lampochki [R=301,L]
  33 + RewriteRule (.*)lampochki-29/fbrandlist-4 /catalog/lampochki/filters:brands=philips [R=301,L]
  34 + RewriteRule (.*)lampochki-29/fbrandlist-5 /catalog/lampochki/filters:brands=pila [R=301,L]
  35 + RewriteRule (.*)lampochki-29/fbrandlist-13 /catalog/lampochki/filters:brands=light-topps [R=301,L]
  36 + RewriteRule (.*)lampochki-29/fcatlist-40.htm /catalog/lampochki/filters:podrazdel-lampo4ki=galogenovye [R=301,L]
  37 + RewriteRule (.*)lampochki-29/fcatlist-36.htm /catalog/lampochki/filters:podrazdel-lampo4ki=lyuminiscentnye [R=301,L]
  38 + RewriteRule (.*)lampochki-29/fcatlist-30.htm /catalog/lampochki/filters:podrazdel-lampo4ki=nakalivaniya [R=301,L]
  39 + RewriteRule (.*)lampochki-29/fcatlist-43.htm /catalog/lampochki/filters:podrazdel-lampo4ki=svetodiodnye-led [R=301,L]
  40 + RewriteRule (.*)bra-5.htm /catalog/bra-i-nastennoe-osveshchenie/filters:podrazdel-bra=bra [R=301,L]
  41 + RewriteRule (.*)bra-5/fbrandlist-7 /catalog/bra-i-nastennoe-osveshchenie/filters:brands=elstead [R=301,L]
  42 + RewriteRule (.*)bra-5/fbrandlist-2 /catalog/bra-i-nastennoe-osveshchenie/filters:brands=eseo [R=301,L]
  43 + RewriteRule (.*)bra-5/fbrandlist-3 /catalog/bra-i-nastennoe-osveshchenie/filters:brands=lirio [R=301,L]
  44 + RewriteRule (.*)bra-5/fbrandlist-1 /catalog/bra-i-nastennoe-osveshchenie/filters:brands=massive [R=301,L]
  45 + RewriteRule (.*)bra-5/fbrandlist-4 /catalog/bra-i-nastennoe-osveshchenie/filters:brands=philips [R=301,L]
  46 + RewriteRule (.*)dlya-vannyh-3501.htm /catalog/bra-i-nastennoe-osveshchenie/filters:podrazdel-bra=dlya-vynny [R=301,L]
  47 + RewriteRule (.*)podsvetki-3503.htm /catalog/bra-i-nastennoe-osveshchenie/filters:podrazdel-bra=podsvetki-kartin [R=301,L]
  48 + RewriteRule (.*)detskie-3500.htm /catalog/bra-i-nastennoe-osveshchenie/filters:podrazdel-bra=det-2 [R=301,L]
  49 + RewriteRule (.*)bra-5/fcatlist-3318.htm /catalog/bra-i-nastennoe-osveshchenie/filters:style-bra=klassicheskiy-3 [R=301,L]
  50 + RewriteRule (.*)klassicheskie-3413.htm /catalog/bra-i-nastennoe-osveshchenie/filters:podrazdel-bra=nastenye-svetilniki [R=301,L]
  51 + RewriteRule (.*)lyustry-2/fbrandlist-1 /catalog/lyustry-i-potolochnoe-osveshchenie/filters:brands=massive [R=301,L]
  52 + RewriteRule (.*)lyustry-2/fbrandlist-4 /catalog/lyustry-i-potolochnoe-osveshchenie/filters:brands=philips [R=301,L]
  53 + RewriteRule (.*)lyustry-2/fbrandlist-7 /catalog/lyustry-i-potolochnoe-osveshchenie/filters:brands=elstead [R=301,L]
  54 + RewriteRule (.*)nastolnye-7.htm /catalog/nastolnye-lampy [R=301,L]
  55 + RewriteRule (.*)nastolnye-7/fbrandlist-4 /catalog/nastolnye-lampy/filters:brands=philips [R=301,L]
  56 + RewriteRule (.*)ofisnye-3402.htm /catalog/nastolnye-lampy/filters:podrazdel-nastolnie=ofisnye [R=301,L]
  57 + RewriteRule (.*)detskie-3504.htm /catalog/nastolnye-lampy/filters:podrazdel-nastolnie=det [R=301,L]
  58 + RewriteRule (.*)torshery-6.htm /catalog/torshery [R=301,L]
  59 + RewriteRule (.*)torshery-klassicheskie-3444.htm /catalog/torshery/filters:style-torsher=klassicheskiy-7 [R=301,L]
  60 + RewriteRule (.*)torshery-sovremennye-3440.htm /catalog/torshery/filters:style-torsher=sovremennyy-10 [R=301,L]
  61 + RewriteRule (.*)massive.htm /brands/massive [R=301,L]
  62 + RewriteRule (.*)detskie-15.htm /catalog/detskie-svetilniki/filters:brands=massive [R=301,L]
  63 + RewriteRule (.*)ulichnye-22/fbrandlist-1 /catalog/ulichnoe-osveshchenie/filters:brands=massive [R=301,L]
  64 + RewriteRule (.*)philips.htm /brands/philips [R=301,L]
  65 + RewriteRule (.*)spoty-9.htm /catalog/tochechnoe/filters:podrazdel-tochki=spoty [R=301,L]
  66 + RewriteRule (.*)tochechnye-8.htm /catalog/tochechnoe [R=301,L]
  67 + RewriteRule (.*)tochechnye-8/fbrandlist-4 /catalog/tochechnoe/filters:brands=philips [R=301,L]
  68 + RewriteRule (.*)vreznye-3400.htm /catalog/tochechnoe/filters:podrazdel-tochki=vreznye [R=301,L]
  69 + RewriteRule (.*)tochechnye-8/fcatlist-3351.htm /catalog/tochechnoe/filters:podrazdel-tochki=tochechnoe-osveshchenie-2 [R=301,L]
  70 + RewriteRule (.*)nakladnye-3431.htm /catalog/tochechnoe/filters:podrazdel-tochki=nakladnye [R=301,L]
  71 + RewriteRule (.*)podsvetki-3434.htm /catalog/svetilniki-gadzhety [R=301,L]
  72 + RewriteRule (.*)dlya-vannyh-14/fcatlist-3365.htm /catalog/aksessuary/filters:podrazdel-aksesyari=zerkala [R=301,L]
  73 + RewriteRule (.*)galogennye-3516.htm /catalog/lampochki/filters:podrazdel-lampo4ki=galogenovye [R=301,L]
  74 +
  75 +
  76 + RewriteRule (.*).htm / [R=301,L]
  77 + #RewriteRule (.*)shops.htm / [R=301,L]
  78 + #RewriteRule (.*)dlya-kuhon-16.htm / [R=301,L]
  79 + RewriteRule (.*)actions/(.*) / [R=301,L]
  80 + RewriteRule (.*)fbrandlist-(.*) / [R=301,L]
  81 + RewriteRule (.*)fcatlist-(.*) / [R=301,L]
  82 +
  83 +
  84 + RewriteRule ^storage/(.*)?$ /storage/$1 [L,PT]
  85 + RewriteRule ^generator/(.*)?$ /generator/$1 [L,PT]
  86 +
  87 + RewriteCond %{REQUEST_URI} ^/(admin)
  88 +
  89 +
  90 +
  91 + RewriteRule ^admin/assets/(.*)$ backend/web/assets/$1 [L]
  92 +
  93 + RewriteRule ^admin/css/(.*)$ backend/web/css/$1 [L]
  94 +
  95 + RewriteRule ^admin/js/(.*)$ backend/web/js/$1 [L]
  96 +
  97 + RewriteRule ^admin/images/(.*)$ backend/web/images/$1 [L]
  98 +
  99 + RewriteRule ^admin/fonts/(.*)$ backend/web/fonts/$1 [L]
  100 +
  101 +
  102 +
  103 +
  104 +
  105 + RewriteCond %{REQUEST_URI} !^/backend/web/(assets|css|js|images|fonts)/
  106 +
  107 + RewriteCond %{REQUEST_URI} ^/(admin)
  108 +
  109 + RewriteRule ^.*$ backend/web/index.php [L]
  110 +
  111 +
  112 + RewriteCond %{REQUEST_URI} ^/(assets|css)
  113 +
  114 + RewriteRule ^assets/(.*)$ frontend/web/assets/$1 [L]
  115 +
  116 + RewriteRule ^css/(.*)$ frontend/web/css/$1 [L]
  117 +
  118 + RewriteRule ^js/(.*)$ frontend/web/js/$1 [L]
  119 +
  120 + RewriteRule ^images/(.*)$ frontend/web/images/$1 [L]
  121 +
  122 + RewriteRule ^libraries/(.*)$ frontend/web/libraries/$1 [L]
  123 +
  124 + RewriteRule ^img/(.*)$ frontend/web/img/$1 [L]
  125 +
  126 + RewriteRule ^files/(.*)$ frontend/web/files/$1 [L]
  127 +
  128 + RewriteRule ^fonts/(.*)$ frontend/web/fonts/$1 [L]
  129 +
  130 + RewriteRule robots.txt$ frontend/web/robots.txt [L]
  131 +
  132 + RewriteRule sitemap.xml$ frontend/web/sitemap.xml [L]
  133 +
  134 + RewriteCond %{REQUEST_URI} !^/(frontend|backend)/web/(assets|css|txt|js|images|fonts|img|files)/
  135 +
  136 + RewriteCond %{REQUEST_URI} !index.php
  137 +
  138 + RewriteCond %{REQUEST_FILENAME} !-f [OR]
  139 +
  140 + RewriteCond %{REQUEST_FILENAME} !-d
  141 +
  142 +
  143 + RewriteCond %{HTTP_HOST} ^www\.(.*)
  144 + RewriteRule ^(.*)$ frontend/web/index.php
  145 +
  146 +
  147 + RewriteCond %{HTTP_HOST} ^([^www].*)$
  148 + RewriteRule (.*) http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  149 +
  150 + RewriteCond %{THE_REQUEST} \s/+(.+?)/+[?\s]
  151 + RewriteRule /$ /%1 [R=301,L]
  152 +
  153 +
  154 + RewriteCond %{HTTP_HOST} ^([^www].*)$
  155 + RewriteRule ^(.*)$ http://www.%1/$1 [R=301]
  156 +
  157 +</IfModule>
  158 +
  159 +#для возможности загрузки файлов парсера
  160 +<IfModule mod_php5.c>
  161 + php_value upload_max_filesize 20M
  162 + php_value post_max_size 30M
  163 +</IfModule>
  164 +
  165 +
  166 +# кеширование в браузере на стороне пользователя
  167 +
  168 +<IfModule mod_expires.c>
  169 + ExpiresActive On
  170 + ExpiresDefault "access 7 days"
  171 + ExpiresByType application/javascript "access plus 1 year"
  172 + ExpiresByType text/javascript "access plus 1 year"
  173 + ExpiresByType text/css "access plus 1 year"
  174 + ExpiresByType text/html "access plus 7 day"
  175 + ExpiresByType text/x-javascript "access 1 year"
  176 + ExpiresByType image/gif "access plus 1 year"
  177 + ExpiresByType image/jpeg "access plus 1 year"
  178 + ExpiresByType image/png "access plus 1 year"
  179 + ExpiresByType image/jpg "access plus 1 year"
  180 + ExpiresByType image/x-icon "access 1 year"
  181 + ExpiresByType application/x-shockwave-flash "access 1 year"
  182 + </IfModule>
  183 +<IfModule mod_deflate.c>
  184 +AddOutputFilterByType DEFLATE text/plain
  185 +AddOutputFilterByType DEFLATE text/html
  186 +AddOutputFilterByType DEFLATE text/xml
  187 +AddOutputFilterByType DEFLATE text/css
  188 +AddOutputFilterByType DEFLATE application/xml
  189 +AddOutputFilterByType DEFLATE application/xhtml+xml
  190 +AddOutputFilterByType DEFLATE application/rss+xml
  191 +AddOutputFilterByType DEFLATE application/javascript
  192 +AddOutputFilterByType DEFLATE application/x-javascript
  193 +BrowserMatch ^Mozilla/4 gzip-only-text/html
  194 +BrowserMatch ^Mozilla/4\.0[678] no-gzip
  195 +BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  196 +Header append Vary User-Agent
  197 +RewriteEngine On
  198 +AddEncoding gzip .gz
  199 +RewriteCond %{HTTP:Accept-encoding} gzip
  200 +RewriteCond %{REQUEST_FILENAME}.gz -f
  201 +RewriteRule ^(.*)$ $1.gz [QSA,L]
  202 +</IfModule>
  203 +# Cache-Control
  204 +<ifModule mod_headers.c>
  205 +# 30 дней
  206 + <filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
  207 + Header set Cache-Control "max-age=2592000, public"
  208 + </filesMatch>
  209 + # 30 дней
  210 + <filesMatch "\.(css|js)$">
  211 + Header set Cache-Control "max-age=2592000, public"
  212 + </filesMatch>
  213 + # 2 дня
  214 + <filesMatch "\.(xml|txt)$">
  215 + Header set Cache-Control "max-age=172800, public, must-revalidate"
  216 + </filesMatch>
  217 + # 1 день
  218 + <filesMatch "\.(html|htm|php)$">
  219 + Header set Cache-Control "max-age=172800, private, must-revalidate"
  220 + </filesMatch>
  221 +</ifModule>
  222 +
  223 +#Запрет отдачи HTTP-заголовков Vary браузерам семейства MSIE
  224 +<IfModule mod_setenvif.c>
  225 +BrowserMatch "MSIE" force-no-vary
  226 +BrowserMatch "Mozilla/4.[0-9]{2}" force-no-vary
  227 +</IfModule>
  228 +
... ...
LICENSE.md 0 → 100755
  1 +++ a/LICENSE.md
  1 +The Yii framework is free software. It is released under the terms of
  2 +the following BSD License.
  3 +
  4 +Copyright © 2008 by Yii Software LLC (http://www.yiisoft.com)
  5 +All rights reserved.
  6 +
  7 +Redistribution and use in source and binary forms, with or without
  8 +modification, are permitted provided that the following conditions
  9 +are met:
  10 +
  11 + * Redistributions of source code must retain the above copyright
  12 + notice, this list of conditions and the following disclaimer.
  13 + * Redistributions in binary form must reproduce the above copyright
  14 + notice, this list of conditions and the following disclaimer in
  15 + the documentation and/or other materials provided with the
  16 + distribution.
  17 + * Neither the name of Yii Software LLC nor the names of its
  18 + contributors may be used to endorse or promote products derived
  19 + from this software without specific prior written permission.
  20 +
  21 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24 +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  25 +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  26 +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  27 +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  28 +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  29 +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  30 +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  31 +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  32 +POSSIBILITY OF SUCH DAMAGE.
... ...
README.md 0 → 100755
  1 +++ a/README.md
  1 +Yii 2 Advanced Project Template
  2 +===============================
  3 +
  4 +Yii 2 Advanced Project Template is a skeleton [Yii 2](http://www.yiiframework.com/) application best for
  5 +developing complex Web applications with multiple tiers.
  6 +
  7 +The template includes three tiers: front end, back end, and console, each of which
  8 +is a separate Yii application.
  9 +
  10 +The template is designed to work in a team development environment. It supports
  11 +deploying the application in different environments.
  12 +
  13 +Documentation is at [docs/guide/README.md](docs/guide/README.md).
  14 +
  15 +[![Latest Stable Version](https://poser.pugx.org/yiisoft/yii2-app-advanced/v/stable.png)](https://packagist.org/packages/yiisoft/yii2-app-advanced)
  16 +[![Total Downloads](https://poser.pugx.org/yiisoft/yii2-app-advanced/downloads.png)](https://packagist.org/packages/yiisoft/yii2-app-advanced)
  17 +[![Build Status](https://travis-ci.org/yiisoft/yii2-app-advanced.svg?branch=master)](https://travis-ci.org/yiisoft/yii2-app-advanced)
  18 +
  19 +DIRECTORY STRUCTURE
  20 +-------------------
  21 +
  22 +```
  23 +common
  24 + config/ contains shared configurations
  25 + mail/ contains view files for e-mails
  26 + models/ contains model classes used in both backend and frontend
  27 +console
  28 + config/ contains console configurations
  29 + controllers/ contains console controllers (commands)
  30 + migrations/ contains database migrations
  31 + models/ contains console-specific model classes
  32 + runtime/ contains files generated during runtime
  33 +backend
  34 + assets/ contains application assets such as JavaScript and CSS
  35 + config/ contains backend configurations
  36 + controllers/ contains Web controller classes
  37 + models/ contains backend-specific model classes
  38 + runtime/ contains files generated during runtime
  39 + views/ contains view files for the Web application
  40 + web/ contains the entry script and Web resources
  41 +frontend
  42 + assets/ contains application assets such as JavaScript and CSS
  43 + config/ contains frontend configurations
  44 + controllers/ contains Web controller classes
  45 + models/ contains frontend-specific model classes
  46 + runtime/ contains files generated during runtime
  47 + views/ contains view files for the Web application
  48 + web/ contains the entry script and Web resources
  49 + widgets/ contains frontend widgets
  50 +vendor/ contains dependent 3rd-party packages
  51 +environments/ contains environment-based overrides
  52 +tests contains various tests for the advanced application
  53 + codeception/ contains tests developed with Codeception PHP Testing Framework
  54 +```
... ...
backend/assets/AdminLteAsset.php 0 → 100755
  1 +++ a/backend/assets/AdminLteAsset.php
  1 +<?php
  2 +/**
  3 + * @link http://www.yiiframework.com/
  4 + * @copyright Copyright (c) 2008 Yii Software LLC
  5 + * @license http://www.yiiframework.com/license/
  6 + */
  7 +
  8 +namespace backend\assets;
  9 +
  10 +use yii\web\AssetBundle;
  11 +
  12 +/**
  13 + * @author Qiang Xue <qiang.xue@gmail.com>
  14 + * @since 2.0
  15 + */
  16 +class AdminLteAsset extends AssetBundle
  17 +{
  18 + public $sourcePath = '@bower/';
  19 + public $css = [
  20 + 'admin-lte/dist/css/AdminLTE.css',
  21 + 'admin-lte/dist/css/skins/_all-skins.css'
  22 + ];
  23 +
  24 + public $js = [
  25 + 'admin-lte/dist/js/app.js',
  26 +
  27 + ];
  28 + public $depends = [
  29 + 'yii\web\YiiAsset',
  30 + 'common\modules\file\FileUploadAsset',
  31 + 'yii\bootstrap\BootstrapPluginAsset',
  32 + 'backend\assets\FontAwesomeAsset',
  33 +
  34 + ];
  35 +}
0 36 \ No newline at end of file
... ...
backend/assets/AppAsset.php 0 → 100755
  1 +++ a/backend/assets/AppAsset.php
  1 +<?php
  2 +/**
  3 + * @link http://www.yiiframework.com/
  4 + * @copyright Copyright (c) 2008 Yii Software LLC
  5 + * @license http://www.yiiframework.com/license/
  6 + */
  7 +
  8 +namespace backend\assets;
  9 +
  10 +use yii\web\AssetBundle;
  11 +
  12 +/**
  13 + * @author Qiang Xue <qiang.xue@gmail.com>
  14 + * @since 2.0
  15 + */
  16 +class AppAsset extends AssetBundle
  17 +{
  18 + public $basePath = '@webroot';
  19 + public $baseUrl = '@web';
  20 + public $css = [
  21 + 'css/site.css',
  22 + ];
  23 + public $js = [
  24 + 'js/fieldWidget.js',
  25 + 'js/site.js',
  26 + ];
  27 + public $depends = [
  28 + 'yii\web\YiiAsset',
  29 + 'yii\bootstrap\BootstrapAsset',
  30 + ];
  31 +}
... ...
backend/assets/FontAwesomeAsset.php 0 → 100755
  1 +++ a/backend/assets/FontAwesomeAsset.php
  1 +<?php
  2 +namespace backend\assets;
  3 +
  4 +use yii\web\AssetBundle;
  5 +
  6 +class FontAwesomeAsset extends AssetBundle
  7 +{
  8 + // The files are not web directory accessible, therefore we need
  9 + // to specify the sourcePath property. Notice the @vendor alias used.
  10 + public $sourcePath = '@vendor/fortawesome/font-awesome';
  11 + public $css = [
  12 + 'css/font-awesome.css',
  13 + ];
  14 +}
0 15 \ No newline at end of file
... ...
backend/config/.gitignore 0 → 100755
  1 +++ a/backend/config/.gitignore
  1 +main-local.php
  2 +params-local.php
0 3 \ No newline at end of file
... ...
backend/config/bootstrap.php 0 → 100755
  1 +++ a/backend/config/bootstrap.php
  1 +<?php
  2 +Yii::setAlias('@uploadDir', dirname(dirname(__DIR__)) . '/storage/sync');
  3 +Yii::setAlias('@uploadFileProducts', 'products.csv');
  4 +Yii::setAlias('@uploadFilePrices', 'file_1.csv');
  5 +Yii::setAlias('@uploadFilePricesAway', 'price_product_away.csv');
  6 +Yii::setAlias('@uploadFilePricesDuplicate', 'price_duplicate.csv');
  7 +Yii::setAlias('@uploadFilePricesNoVariant', 'price_no_variant.csv');
  8 +
  9 +Yii::setAlias('@productsDir', '@storage/products');
0 10 \ No newline at end of file
... ...
backend/config/main.php 0 → 100755
  1 +++ a/backend/config/main.php
  1 +<?php
  2 +use common\behaviors\ArtBoxAccessBehavior;
  3 +$params = array_merge(
  4 + require(__DIR__ . '/../../common/config/params.php'),
  5 + require(__DIR__ . '/../../common/config/params-local.php'),
  6 + require(__DIR__ . '/params.php'),
  7 + require(__DIR__ . '/params-local.php')
  8 +);
  9 +
  10 +return [
  11 + 'id' => 'app-backend',
  12 + 'basePath' => dirname(__DIR__),
  13 + 'controllerMap' => [
  14 + 'elfinder' => [
  15 + 'class' => 'mihaildev\elfinder\Controller',
  16 + 'access' => ['@'], //глобальный доступ к фаил менеджеру @ - для авторизорованных , ? - для гостей , чтоб открыть всем ['@', '?']
  17 + 'disabledCommands' => ['netmount'], //отключение ненужных команд https://github.com/Studio-42/elFinder/wiki/Client-configuration-options#commands
  18 + 'roots' => [
  19 + [
  20 + 'class' => 'mihaildev\elfinder\volume\UserPath',
  21 + 'path' => '../../storage/user_{id}',
  22 + 'name' => 'My Documents'
  23 + ],
  24 + ],
  25 + 'watermark' => [
  26 + 'source' => __DIR__.'/logo.png', // Path to Water mark image
  27 + 'marginRight' => 5, // Margin right pixel
  28 + 'marginBottom' => 5, // Margin bottom pixel
  29 + 'quality' => 95, // JPEG image save quality
  30 + 'transparency' => 70, // Water mark image transparency ( other than PNG )
  31 + 'targetType' => IMG_GIF|IMG_JPG|IMG_PNG|IMG_WBMP, // Target image formats ( bit-field )
  32 + 'targetMinPixel' => 200 // Target image minimum pixel size
  33 + ]
  34 + ],
  35 + 'artbox-comments' => [
  36 + 'class' => 'common\modules\comment\controllers\ManageController',
  37 + 'viewPath' => '@common/modules/comment/views/manage',
  38 + ],
  39 + ],
  40 + 'layout' => 'admin',
  41 + 'controllerNamespace' => 'backend\controllers',
  42 + 'bootstrap' => ['log'],
  43 + 'as AccessBehavior' => [
  44 + 'class' => ArtBoxAccessBehavior::className(),
  45 + 'rules' =>
  46 + [
  47 + 'permit/access' =>
  48 + [
  49 + [
  50 + 'actions' => ['role', 'permission','add-role', 'update-role','add-permission', 'update-permission' ],
  51 + 'allow' => true,
  52 + ]
  53 + ],
  54 + 'site' =>
  55 + [
  56 + [
  57 + 'actions' => ['login', 'error','logout',],
  58 + 'allow' => true,
  59 + ],
  60 + [
  61 + 'actions' => ['index'],
  62 + 'allow' => true,
  63 + 'roles' => ['@'],
  64 + ],
  65 + [
  66 + 'actions' => ['images'],
  67 + 'allow' => true,
  68 + 'roles' => ['@'],
  69 + ]
  70 +
  71 + ],
  72 + 'file/uploader' =>[
  73 + [
  74 + 'actions' => ['images-upload'],
  75 + 'allow' => true,
  76 + ]
  77 + ],
  78 + 'elfinder' => [
  79 + [
  80 + 'actions' => ['manager','connect'],
  81 + 'allow' => true,
  82 + ]
  83 + ]
  84 +
  85 +
  86 + ]
  87 + ],
  88 + 'modules' => [
  89 + 'permit' => [
  90 + 'class' => 'developeruz\db_rbac\Yii2DbRbac',
  91 + 'params' => [
  92 + 'userClass' => 'backend\models\User'
  93 + ]
  94 + ],
  95 +
  96 + 'rubrication' => [
  97 + 'class' => 'common\modules\rubrication\Module',
  98 + 'types' => [
  99 + 'string' => 'Strings',
  100 + 'float' => 'Floating number',
  101 + 'int' => 'Integer number',
  102 + 'link' => 'Web-link',
  103 + ]
  104 + ],
  105 + 'product' => [
  106 + 'class' => 'common\modules\product\Module'
  107 + ],
  108 + 'gridview' => [
  109 + 'class' => '\kartik\grid\Module'
  110 + ],
  111 + 'artbox-comment' => [
  112 + 'class' => 'common\modules\comment\Module',
  113 + 'userIdentityClass' => 'common\models\Customer',
  114 + ],
  115 + ],
  116 + 'components' => [
  117 + 'assetManager' => [
  118 + 'bundles' => [
  119 + 'yii\web\JqueryAsset' =>[
  120 + 'jsOptions' => ['position' => \yii\web\View::POS_HEAD]
  121 + ]
  122 + ],
  123 + ],
  124 + 'authManager' => [
  125 + 'class' => 'yii\rbac\DbManager',
  126 + ],
  127 + 'user' => [
  128 + 'identityClass' => 'common\models\User',
  129 + 'enableAutoLogin' => true,
  130 + ],
  131 + 'log' => [
  132 + 'traceLevel' => YII_DEBUG ? 3 : 0,
  133 + 'targets' => [
  134 + [
  135 + 'class' => 'yii\log\FileTarget',
  136 + 'levels' => ['error', 'warning'],
  137 + ],
  138 + ],
  139 + ],
  140 + 'imageCache' => [
  141 + 'class' => 'iutbay\yii2imagecache\ImageCache',
  142 + 'sourcePath' => '@storage',
  143 + 'sourceUrl' => '/storage',
  144 + 'thumbsPath' => '@storage/thumbs',
  145 + 'thumbsUrl' => '/storage/thumbs',
  146 +
  147 + 'sizes' => [
  148 + 'slider' => [720, 340],
  149 + ],
  150 + ],
  151 + 'errorHandler' => [
  152 + 'errorAction' => 'site/error',
  153 + ],
  154 + 'request'=>[
  155 + 'cookieValidationKey' => 'j4iuot9u5894e7tu8reyh78g9y54sy7i',
  156 + 'csrfParam' => '_backendCSRF',
  157 +
  158 + 'class' => 'common\components\Request',
  159 +
  160 + 'web'=> '/backend/web',
  161 +
  162 + 'adminUrl' => '/admin'
  163 +
  164 + ],
  165 + 'urlManager' => [
  166 + 'baseUrl' => '/admin',
  167 + 'enablePrettyUrl' => true,
  168 + 'showScriptName' => false,
  169 + 'rules' => [
  170 + 'slider-image/<action>/<slider_id:[A-Za-z0-9_-]+>/<id:[A-Za-z0-9_-]+>' => 'slider-image/<action>',
  171 + 'slider-image/<action>/<slider_id:[A-Za-z0-9_-]+>' => 'slider-image/<action>',
  172 + 'rubrication/tax-group/<level:[0-9]+>' => 'rubrication/tax-group',
  173 + 'rubrication/tax-group/<action>/<level:[0-9]+>/<id:[A-Za-z0-9_-]+>' => 'rubrication/tax-group/<action>',
  174 + 'rubrication/tax-group/<action>/<level:[0-9]+>' => 'rubrication/tax-group/<action>',
  175 + 'product/manage/<action>' => 'product/manage/<action>',
  176 + 'product/<controller>/<action>/<product_id:[A-Za-z0-9_-]+>/<id:[A-Za-z0-9_-]+>' => 'product/<controller>/<action>',
  177 + 'product/<controller>/<action>/<product_id:[A-Za-z0-9_-]+>/' => 'product/<controller>/<action>',
  178 + 'product/<action>/<product_id:[A-Za-z0-9_-]+>' => 'product/<action>',
  179 + 'seo-dynamic/<action>/<seo_category_id:[A-Za-z0-9_-]+>/<id:[A-Za-z0-9_-]+>' => 'seo-dynamic/<action>',
  180 + 'seo-dynamic/<action>/<seo_category_id:[A-Za-z0-9_-]+>' => 'seo-dynamic/<action>',
  181 + ]
  182 + ]
  183 +
  184 + ],
  185 + 'params' => $params,
  186 +];
... ...
backend/config/params.php 0 → 100755
  1 +++ a/backend/config/params.php
  1 +<?php
  2 +return [
  3 + 'adminEmail' => 'admin@example.com',
  4 +];
... ...
backend/controllers/ArticlesController.php 0 → 100755
  1 +++ a/backend/controllers/ArticlesController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use Yii;
  6 +use common\models\Articles;
  7 +use common\models\ArticlesSearch;
  8 +use yii\web\Controller;
  9 +use yii\web\NotFoundHttpException;
  10 +use yii\filters\VerbFilter;
  11 +use developeruz\db_rbac\behaviors\AccessBehavior;
  12 +use yii\web\UploadedFile;
  13 +
  14 +/**
  15 + * ArticlesController implements the CRUD actions for Articles model.
  16 + */
  17 +class ArticlesController extends Controller
  18 +{
  19 + /**
  20 + * @inheritdoc
  21 + */
  22 + public function behaviors()
  23 + {
  24 + return [
  25 + 'access'=>[
  26 + 'class' => AccessBehavior::className(),
  27 + 'rules' =>
  28 + ['site' =>
  29 + [
  30 + [
  31 + 'actions' => ['login', 'error'],
  32 + 'allow' => true,
  33 + ]
  34 + ]
  35 + ]
  36 + ],
  37 + 'verbs' => [
  38 + 'class' => VerbFilter::className(),
  39 + 'actions' => [
  40 + 'delete' => ['POST'],
  41 + ],
  42 + ],
  43 + ];
  44 + }
  45 +
  46 + /**
  47 + * Lists all Articles models.
  48 + * @return mixed
  49 + */
  50 + public function actionIndex()
  51 + {
  52 + $searchModel = new ArticlesSearch();
  53 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  54 +
  55 + return $this->render('index', [
  56 + 'searchModel' => $searchModel,
  57 + 'dataProvider' => $dataProvider,
  58 + ]);
  59 + }
  60 +
  61 + /**
  62 + * Displays a single Articles model.
  63 + * @param integer $id
  64 + * @return mixed
  65 + */
  66 + public function actionView($id)
  67 + {
  68 + return $this->render('view', [
  69 + 'model' => $this->findModel($id),
  70 + ]);
  71 + }
  72 +
  73 + /**
  74 + * Creates a new Articles model.
  75 + * If creation is successful, the browser will be redirected to the 'view' page.
  76 + * @return mixed
  77 + */
  78 + public function actionCreate()
  79 + {
  80 + $model = new Articles();
  81 +
  82 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  83 +
  84 + return $this->redirect(['view', 'id' => $model->id]);
  85 + } else {
  86 + return $this->render('create', [
  87 + 'model' => $model,
  88 + ]);
  89 + }
  90 + }
  91 +
  92 + /**
  93 + * Updates an existing Articles model.
  94 + * If update is successful, the browser will be redirected to the 'view' page.
  95 + * @param integer $id
  96 + * @return mixed
  97 + */
  98 + public function actionUpdate($id)
  99 + {
  100 + $model = $this->findModel($id);
  101 +
  102 + if ($model->load(Yii::$app->request->post()) && $model->save() ) {
  103 + return $this->redirect(['view', 'id' => $model->id]);
  104 + } else {
  105 + return $this->render('update', [
  106 + 'model' => $model,
  107 + ]);
  108 + }
  109 + }
  110 +
  111 + /**
  112 + * Deletes an existing Articles model.
  113 + * If deletion is successful, the browser will be redirected to the 'index' page.
  114 + * @param integer $id
  115 + * @return mixed
  116 + */
  117 + public function actionDelete($id)
  118 + {
  119 + $this->findModel($id)->delete();
  120 +
  121 + return $this->redirect(['index']);
  122 + }
  123 +
  124 + /**
  125 + * Finds the Articles model based on its primary key value.
  126 + * If the model is not found, a 404 HTTP exception will be thrown.
  127 + * @param integer $id
  128 + * @return Articles the loaded model
  129 + * @throws NotFoundHttpException if the model cannot be found
  130 + */
  131 + protected function findModel($id)
  132 + {
  133 + if (($model = Articles::findOne($id)) !== null) {
  134 + return $model;
  135 + } else {
  136 + throw new NotFoundHttpException('The requested page does not exist.');
  137 + }
  138 + }
  139 +}
... ...
backend/controllers/BannerController.php 0 → 100755
  1 +++ a/backend/controllers/BannerController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use common\modules\file\widgets\ImageUploader;
  6 +use Yii;
  7 +use common\models\Banner;
  8 +use common\models\BannerSearch;
  9 +use yii\web\Controller;
  10 +use yii\web\NotFoundHttpException;
  11 +use yii\filters\VerbFilter;
  12 +use developeruz\db_rbac\behaviors\AccessBehavior;
  13 +/**
  14 + * BannerController implements the CRUD actions for Banner model.
  15 + */
  16 +class BannerController extends Controller
  17 +{
  18 + /**
  19 + * @inheritdoc
  20 + */
  21 + public function behaviors()
  22 + {
  23 + return [
  24 + 'access'=>[
  25 + 'class' => AccessBehavior::className(),
  26 + 'rules' =>
  27 + ['site' =>
  28 + [
  29 + [
  30 + 'actions' => ['login', 'error'],
  31 + 'allow' => true,
  32 + ]
  33 + ]
  34 + ]
  35 + ],
  36 + 'verbs' => [
  37 + 'class' => VerbFilter::className(),
  38 + 'actions' => [
  39 + 'delete' => ['POST'],
  40 + ],
  41 + ],
  42 + ];
  43 + }
  44 +
  45 + /**
  46 + * Lists all Banner models.
  47 + * @return mixed
  48 + */
  49 + public function actionIndex()
  50 + {
  51 + $searchModel = new BannerSearch();
  52 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  53 +
  54 + return $this->render('index', [
  55 + 'searchModel' => $searchModel,
  56 + 'dataProvider' => $dataProvider,
  57 + ]);
  58 + }
  59 +
  60 + public function actionSaveImageSettings(){
  61 + \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
  62 + $width = Yii::$app->request->post('width');
  63 + $height = Yii::$app->request->post('height');
  64 +
  65 + $html = ImageUploader::widget([
  66 + 'model'=> new Banner(),
  67 + 'field'=>'image',
  68 + 'size' => [
  69 + [
  70 + 'width'=>$width,
  71 + 'height'=>$height,
  72 + ],
  73 + ],
  74 + 'name' => "Загрузить баннер"
  75 + ]);
  76 +
  77 + return ['html'=>$html];
  78 + }
  79 +
  80 + /**
  81 + * Displays a single Banner model.
  82 + * @param integer $id
  83 + * @return mixed
  84 + */
  85 + public function actionView($id)
  86 + {
  87 + return $this->render('view', [
  88 + 'model' => $this->findModel($id),
  89 + ]);
  90 + }
  91 +
  92 + /**
  93 + * Creates a new Banner model.
  94 + * If creation is successful, the browser will be redirected to the 'view' page.
  95 + * @return mixed
  96 + */
  97 + public function actionCreate()
  98 + {
  99 + $model = new Banner();
  100 +
  101 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  102 + return $this->redirect(['view', 'id' => $model->banner_id]);
  103 + } else {
  104 + return $this->render('create', [
  105 + 'model' => $model,
  106 + ]);
  107 + }
  108 + }
  109 +
  110 + /**
  111 + * Updates an existing Banner model.
  112 + * If update is successful, the browser will be redirected to the 'view' page.
  113 + * @param integer $id
  114 + * @return mixed
  115 + */
  116 + public function actionUpdate($id)
  117 + {
  118 + $model = $this->findModel($id);
  119 +
  120 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  121 + return $this->redirect(['view', 'id' => $model->banner_id]);
  122 + } else {
  123 + return $this->render('update', [
  124 + 'model' => $model,
  125 + ]);
  126 + }
  127 + }
  128 +
  129 + /**
  130 + * Deletes an existing Banner model.
  131 + * If deletion is successful, the browser will be redirected to the 'index' page.
  132 + * @param integer $id
  133 + * @return mixed
  134 + */
  135 + public function actionDelete($id)
  136 + {
  137 + $this->findModel($id)->delete();
  138 +
  139 + return $this->redirect(['index']);
  140 + }
  141 +
  142 + /**
  143 + * Finds the Banner model based on its primary key value.
  144 + * If the model is not found, a 404 HTTP exception will be thrown.
  145 + * @param integer $id
  146 + * @return Banner the loaded model
  147 + * @throws NotFoundHttpException if the model cannot be found
  148 + */
  149 + protected function findModel($id)
  150 + {
  151 + if (($model = Banner::findOne($id)) !== null) {
  152 + return $model;
  153 + } else {
  154 + throw new NotFoundHttpException('The requested page does not exist.');
  155 + }
  156 + }
  157 +}
... ...
backend/controllers/BgController.php 0 → 100755
  1 +++ a/backend/controllers/BgController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use Yii;
  6 +use common\models\Bg;
  7 +use common\models\BgSearch;
  8 +use yii\web\Controller;
  9 +use yii\web\NotFoundHttpException;
  10 +use yii\filters\VerbFilter;
  11 +use developeruz\db_rbac\behaviors\AccessBehavior;
  12 +/**
  13 + * BgController implements the CRUD actions for Bg model.
  14 + */
  15 +class BgController extends Controller
  16 +{
  17 + /**
  18 + * @inheritdoc
  19 + */
  20 + public function behaviors()
  21 + {
  22 + return [
  23 + 'access'=>[
  24 + 'class' => AccessBehavior::className(),
  25 + 'rules' =>
  26 + ['site' =>
  27 + [
  28 + [
  29 + 'actions' => ['login', 'error'],
  30 + 'allow' => true,
  31 + ]
  32 + ]
  33 + ]
  34 + ],
  35 + 'verbs' => [
  36 + 'class' => VerbFilter::className(),
  37 + 'actions' => [
  38 + 'delete' => ['POST'],
  39 + ],
  40 + ],
  41 + ];
  42 + }
  43 +
  44 + /**
  45 + * Lists all Bg models.
  46 + * @return mixed
  47 + */
  48 + public function actionIndex()
  49 + {
  50 + $searchModel = new BgSearch();
  51 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  52 +
  53 + return $this->render('index', [
  54 + 'searchModel' => $searchModel,
  55 + 'dataProvider' => $dataProvider,
  56 + ]);
  57 + }
  58 +
  59 + /**
  60 + * Displays a single Bg model.
  61 + * @param integer $id
  62 + * @return mixed
  63 + */
  64 + public function actionView($id)
  65 + {
  66 + return $this->render('view', [
  67 + 'model' => $this->findModel($id),
  68 + ]);
  69 + }
  70 +
  71 + /**
  72 + * Creates a new Bg model.
  73 + * If creation is successful, the browser will be redirected to the 'view' page.
  74 + * @return mixed
  75 + */
  76 + public function actionCreate()
  77 + {
  78 + $model = new Bg();
  79 +
  80 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  81 + return $this->redirect(['view', 'id' => $model->id]);
  82 + } else {
  83 + return $this->render('create', [
  84 + 'model' => $model,
  85 + ]);
  86 + }
  87 + }
  88 +
  89 + /**
  90 + * Updates an existing Bg model.
  91 + * If update is successful, the browser will be redirected to the 'view' page.
  92 + * @param integer $id
  93 + * @return mixed
  94 + */
  95 + public function actionUpdate($id)
  96 + {
  97 + $model = $this->findModel($id);
  98 +
  99 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  100 + return $this->redirect(['view', 'id' => $model->id]);
  101 + } else {
  102 + return $this->render('update', [
  103 + 'model' => $model,
  104 + ]);
  105 + }
  106 + }
  107 +
  108 + /**
  109 + * Deletes an existing Bg model.
  110 + * If deletion is successful, the browser will be redirected to the 'index' page.
  111 + * @param integer $id
  112 + * @return mixed
  113 + */
  114 + public function actionDelete($id)
  115 + {
  116 + $this->findModel($id)->delete();
  117 +
  118 + return $this->redirect(['index']);
  119 + }
  120 +
  121 + /**
  122 + * Finds the Bg model based on its primary key value.
  123 + * If the model is not found, a 404 HTTP exception will be thrown.
  124 + * @param integer $id
  125 + * @return Bg the loaded model
  126 + * @throws NotFoundHttpException if the model cannot be found
  127 + */
  128 + protected function findModel($id)
  129 + {
  130 + if (($model = Bg::findOne($id)) !== null) {
  131 + return $model;
  132 + } else {
  133 + throw new NotFoundHttpException('The requested page does not exist.');
  134 + }
  135 + }
  136 +}
... ...
backend/controllers/BlogController.php 0 → 100755
  1 +++ a/backend/controllers/BlogController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +use developeruz\db_rbac\behaviors\AccessBehavior;
  5 +use common\models\Fields;
  6 +use Yii;
  7 +use common\models\Blog;
  8 +use common\models\BlogSearch;
  9 +use yii\web\Controller;
  10 +use yii\web\NotFoundHttpException;
  11 +use yii\filters\VerbFilter;
  12 +use yii\filters\AccessControl;
  13 +/**
  14 + * BlogController implements the CRUD actions for Blog model.
  15 + */
  16 +class BlogController extends Controller
  17 +{
  18 +
  19 + /**
  20 + * @inheritdoc
  21 + */
  22 + public function behaviors()
  23 + {
  24 + return [
  25 + 'access'=>[
  26 + 'class' => AccessBehavior::className(),
  27 + 'rules' =>
  28 + ['site' =>
  29 + [
  30 + [
  31 + 'actions' => ['login', 'error'],
  32 + 'allow' => true,
  33 + ]
  34 + ]
  35 + ]
  36 + ],
  37 + 'verbs' => [
  38 + 'class' => VerbFilter::className(),
  39 + 'actions' => [
  40 + 'logout' => ['post'],
  41 + ],
  42 + ],
  43 + ];
  44 + }
  45 +
  46 + /**
  47 + * Lists all Blog models.
  48 + * @return mixed
  49 + */
  50 + public function actionIndex()
  51 + {
  52 + $searchModel = new BlogSearch();
  53 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  54 +
  55 + return $this->render('index', [
  56 + 'searchModel' => $searchModel,
  57 + 'dataProvider' => $dataProvider,
  58 + ]);
  59 + }
  60 +
  61 + /**
  62 + * Displays a single Blog model.
  63 + * @param integer $id
  64 + * @return mixed
  65 + */
  66 + public function actionView($id)
  67 + {
  68 + return $this->render('view', [
  69 + 'model' => $this->findModel($id),
  70 + ]);
  71 + }
  72 +
  73 + /**
  74 + * Creates a new Blog model.
  75 + * If creation is successful, the browser will be redirected to the 'view' page.
  76 + * @return mixed
  77 + */
  78 + public function actionCreate()
  79 + {
  80 + $model = new Blog();
  81 +
  82 + if ($model->load(Yii::$app->request->post())) {
  83 +
  84 + Fields::saveFieldData(Yii::$app->request->post('Fields'), $model->blog_id, Blog::className(), 'ru');
  85 +
  86 + if ( ($image = UploadedFile::getInstance($model, 'imageUpload')) ) {
  87 + $model->cover = $image->name;
  88 + }
  89 +
  90 + if ($model->save() && $image) {
  91 + $image->saveAs(Yii::getAlias('@imagesDir/articles/' . $image->name));
  92 + }
  93 +
  94 + return $this->redirect(['view', 'id' => $model->blog_id]);
  95 + } else {
  96 + return $this->render('create', [
  97 + 'model' => $model,
  98 + ]);
  99 + }
  100 + }
  101 +
  102 + /**
  103 + * Updates an existing Blog model.
  104 + * If update is successful, the browser will be redirected to the 'view' page.
  105 + * @param integer $id
  106 + * @return mixed
  107 + */
  108 + public function actionUpdate($id)
  109 + {
  110 + $model = $this->findModel($id);
  111 +
  112 + if ($model->load(Yii::$app->request->post())) {
  113 +
  114 + Fields::saveFieldData(Yii::$app->request->post('Fields'), $model->blog_id, Blog::className(), 'ru');
  115 +
  116 + if ( ($image = UploadedFile::getInstance($model, 'imageUpload')) ) {
  117 + $model->cover = $image->name;
  118 + }
  119 +
  120 + if ($model->save() && $image) {
  121 + $image->saveAs(Yii::getAlias('@imagesDir/articles/' . $image->name));
  122 + }
  123 +
  124 + return $this->redirect(['view', 'id' => $model->blog_id]);
  125 + } else {
  126 + return $this->render('update', [
  127 + 'model' => $model,
  128 + ]);
  129 + }
  130 + }
  131 +
  132 + /**
  133 + * Deletes an existing Blog model.
  134 + * If deletion is successful, the browser will be redirected to the 'index' page.
  135 + * @param integer $id
  136 + * @return mixed
  137 + */
  138 + public function actionDelete($id)
  139 + {
  140 + $this->findModel($id)->delete();
  141 +
  142 + return $this->redirect(['index']);
  143 + }
  144 +
  145 + /**
  146 + * Finds the Blog model based on its primary key value.
  147 + * If the model is not found, a 404 HTTP exception will be thrown.
  148 + * @param integer $id
  149 + * @return Blog the loaded model
  150 + * @throws NotFoundHttpException if the model cannot be found
  151 + */
  152 + protected function findModel($id)
  153 + {
  154 + if (($model = Blog::findOne($id)) !== null) {
  155 + return $model;
  156 + } else {
  157 + throw new NotFoundHttpException('The requested page does not exist.');
  158 + }
  159 + }
  160 +}
... ...
backend/controllers/BrandController.php 0 → 100755
  1 +++ a/backend/controllers/BrandController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use Yii;
  6 +use common\modules\product\models\Brand;
  7 +use common\modules\product\models\BrandSearch;
  8 +use yii\web\Controller;
  9 +use yii\web\NotFoundHttpException;
  10 +use yii\filters\VerbFilter;
  11 +use yii\filters\AccessControl;
  12 +use yii\web\UploadedFile;
  13 +
  14 +/**
  15 + * BrandController implements the CRUD actions for Brand model.
  16 + */
  17 +class BrandController extends Controller
  18 +{
  19 + /**
  20 + * @inheritdoc
  21 + */
  22 + public function behaviors()
  23 + {
  24 + return [
  25 + 'access' => [
  26 + 'class' => AccessControl::className(),
  27 + 'rules' => [
  28 + [
  29 + 'actions' => ['login', 'error'],
  30 + 'allow' => true,
  31 + ],
  32 + [
  33 + 'actions' => ['logout', 'index', 'create', 'update', 'view', 'delete'],
  34 + 'allow' => true,
  35 + 'roles' => ['@'],
  36 + ],
  37 + ],
  38 + ],
  39 + 'verbs' => [
  40 + 'class' => VerbFilter::className(),
  41 + 'actions' => [
  42 + 'logout' => ['post'],
  43 + ],
  44 + ],
  45 + ];
  46 + }
  47 +
  48 + /**
  49 + * Lists all Brand models.
  50 + * @return mixed
  51 + */
  52 + public function actionIndex()
  53 + {
  54 + $searchModel = new BrandSearch();
  55 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  56 +
  57 + return $this->render('index', [
  58 + 'searchModel' => $searchModel,
  59 + 'dataProvider' => $dataProvider,
  60 + ]);
  61 + }
  62 +
  63 + /**
  64 + * Displays a single Brand model.
  65 + * @param integer $id
  66 + * @return mixed
  67 + */
  68 + public function actionView($id)
  69 + {
  70 + return $this->render('view', [
  71 + 'model' => $this->findModel($id),
  72 + ]);
  73 + }
  74 +
  75 + /**
  76 + * Creates a new Brand model.
  77 + * If creation is successful, the browser will be redirected to the 'view' page.
  78 + * @return mixed
  79 + */
  80 + public function actionCreate()
  81 + {
  82 + $model = new Brand();
  83 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  84 +
  85 + return is_null(Yii::$app->request->post('create_and_new')) ? $this->redirect(['view', 'id' => $model->brand_id]) : $this->redirect(array_merge(['create'], Yii::$app->request->queryParams));
  86 + } else {
  87 + return $this->render('create', [
  88 + 'model' => $model,
  89 + ]);
  90 + }
  91 + }
  92 +
  93 + /**
  94 + * Updates an existing Brand model.
  95 + * If update is successful, the browser will be redirected to the 'view' page.
  96 + * @param integer $id
  97 + * @return mixed
  98 + */
  99 + public function actionUpdate($id)
  100 + {
  101 + $model = $this->findModel($id);
  102 +
  103 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  104 +
  105 + return $this->redirect(['view', 'id' => $model->brand_id]);
  106 + } else {
  107 + return $this->render('update', [
  108 + 'model' => $model,
  109 + ]);
  110 + }
  111 + }
  112 +
  113 + /**
  114 + * Deletes an existing Brand model.
  115 + * If deletion is successful, the browser will be redirected to the 'index' page.
  116 + * @param integer $id
  117 + * @return mixed
  118 + */
  119 + public function actionDelete($id)
  120 + {
  121 + $this->findModel($id)->delete();
  122 +
  123 + return $this->redirect(['index']);
  124 + }
  125 +
  126 + /**
  127 + * Finds the Brand model based on its primary key value.
  128 + * If the model is not found, a 404 HTTP exception will be thrown.
  129 + * @param integer $id
  130 + * @return Brand the loaded model
  131 + * @throws NotFoundHttpException if the model cannot be found
  132 + */
  133 + protected function findModel($id)
  134 + {
  135 + if (($model = Brand::findOne($id)) !== null) {
  136 + return $model;
  137 + } else {
  138 + throw new NotFoundHttpException('The requested page does not exist.');
  139 + }
  140 + }
  141 +}
... ...
backend/controllers/CategoryController.php 0 → 100755
  1 +++ a/backend/controllers/CategoryController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +use developeruz\db_rbac\behaviors\AccessBehavior;
  5 +use common\components\artboxtree\ArtboxTreeHelper;
  6 +use Yii;
  7 +use common\modules\product\models\Category;
  8 +use common\modules\product\models\CategorySearch;
  9 +use yii\helpers\ArrayHelper;
  10 +use yii\web\Controller;
  11 +use yii\web\NotFoundHttpException;
  12 +use yii\filters\VerbFilter;
  13 +use yii\filters\AccessControl;
  14 +use yii\web\UploadedFile;
  15 +
  16 +/**
  17 + * CategoryController implements the CRUD actions for Category model.
  18 + */
  19 +class CategoryController extends Controller
  20 +{
  21 + /**
  22 + * @inheritdoc
  23 + */
  24 + public function behaviors()
  25 + {
  26 + return [
  27 + 'access'=>[
  28 + 'class' => AccessBehavior::className(),
  29 + 'rules' =>
  30 + ['site' =>
  31 + [
  32 + [
  33 + 'actions' => ['login', 'error'],
  34 + 'allow' => true,
  35 + ]
  36 + ]
  37 + ]
  38 + ],
  39 + 'verbs' => [
  40 + 'class' => VerbFilter::className(),
  41 + 'actions' => [
  42 + 'logout' => ['post'],
  43 + ],
  44 + ],
  45 + ];
  46 + }
  47 +
  48 + /**
  49 + * Lists all Category models.
  50 + * @return mixed
  51 + */
  52 + public function actionIndex()
  53 + {
  54 + $searchModel = new CategorySearch();
  55 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  56 +
  57 + return $this->render('index', [
  58 + 'searchModel' => $searchModel,
  59 + 'dataProvider' => $dataProvider,
  60 + ]);
  61 + }
  62 +
  63 + /**
  64 + * Displays a single Category model.
  65 + * @param integer $id
  66 + * @return mixed
  67 + */
  68 + public function actionView($id)
  69 + {
  70 + return $this->render('view', [
  71 + 'model' => $this->findModel($id),
  72 + ]);
  73 + }
  74 +
  75 + /**
  76 + * Creates a new Category model.
  77 + * If creation is successful, the browser will be redirected to the 'view' page.
  78 + * @return mixed
  79 + */
  80 + public function actionCreate()
  81 + {
  82 + $model = new Category();
  83 +
  84 + if ($model->load(Yii::$app->request->post())) {
  85 + if ( ($image = UploadedFile::getInstance($model, 'imageUpload')) ) {
  86 + $model->image = $image->name;
  87 + }
  88 +
  89 + if ($model->save() && $image) {
  90 + $image->saveAs(Yii::getAlias('@imagesDir/categories/' . $image->name));
  91 + }
  92 +
  93 + return is_null(Yii::$app->request->post('create_and_new')) ? $this->redirect(['view', 'id' => $model->category_id]) : $this->redirect(array_merge(['create'], Yii::$app->request->queryParams));
  94 + } else {
  95 + if (!empty(Yii::$app->request->queryParams['parent'])) {
  96 + $model->parent_id = Yii::$app->request->queryParams['parent'];
  97 + }
  98 + return $this->render('create', [
  99 + 'model' => $model,
  100 + 'categories' => ArtboxTreeHelper::treeMap(Category::find()->getTree(), 'category_id', 'name', '.')
  101 + ]);
  102 + }
  103 + }
  104 +
  105 + /**
  106 + * Updates an existing Category model.
  107 + * If update is successful, the browser will be redirected to the 'view' page.
  108 + * @param integer $id
  109 + * @return mixed
  110 + */
  111 + public function actionUpdate($id)
  112 + {
  113 + $model = $this->findModel($id);
  114 +
  115 + if ($model->load(Yii::$app->request->post())) {
  116 + if ( ($image = UploadedFile::getInstance($model, 'imageUpload')) ) {
  117 + $model->image = $image->name;
  118 + }
  119 +
  120 + if ($model->save() && $image) {
  121 + $image->saveAs(Yii::getAlias('@imagesDir/categories/' . $image->name));
  122 + }
  123 +
  124 + return $this->redirect(['view', 'id' => $model->category_id]);
  125 + } else {
  126 + return $this->render('update', [
  127 + 'model' => $model,
  128 + 'categories' => ArtboxTreeHelper::treeMap(Category::find()->getTree(), 'category_id', 'name', '.')
  129 + ]);
  130 + }
  131 + }
  132 +
  133 + /**
  134 + * Deletes an existing Category model.
  135 + * If deletion is successful, the browser will be redirected to the 'index' page.
  136 + * @param integer $id
  137 + * @return mixed
  138 + */
  139 + public function actionDelete($id)
  140 + {
  141 + $this->findModel($id)->delete();
  142 +
  143 + return $this->redirect(['index']);
  144 + }
  145 +
  146 + /**
  147 + * Finds the Category model based on its primary key value.
  148 + * If the model is not found, a 404 HTTP exception will be thrown.
  149 + * @param integer $id
  150 + * @return Category the loaded model
  151 + * @throws NotFoundHttpException if the model cannot be found
  152 + */
  153 + protected function findModel($id)
  154 + {
  155 + if (($model = Category::findOne($id)) !== null) {
  156 + return $model;
  157 + } else {
  158 + throw new NotFoundHttpException('The requested page does not exist.');
  159 + }
  160 + }
  161 +}
... ...
backend/controllers/CommentController.php 0 → 100755
  1 +++ a/backend/controllers/CommentController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use developeruz\db_rbac\behaviors\AccessBehavior;
  6 +use Yii;
  7 +use common\modules\comment\models\Comment;
  8 +use backend\models\CommentSearch;
  9 +use yii\web\Controller;
  10 +use yii\web\NotFoundHttpException;
  11 +use yii\filters\VerbFilter;
  12 +
  13 +/**
  14 + * CommentController implements the CRUD actions for Comment model.
  15 + */
  16 +class CommentController extends Controller
  17 +{
  18 + /**
  19 + * @inheritdoc
  20 + */
  21 + public function behaviors()
  22 + {
  23 + return [
  24 + 'access'=>[
  25 + 'class' => AccessBehavior::className(),
  26 + 'rules' =>
  27 + ['site' =>
  28 + [
  29 + [
  30 + 'actions' => ['login', 'error'],
  31 + 'allow' => true,
  32 + ]
  33 + ]
  34 + ]
  35 + ],
  36 + 'verbs' => [
  37 + 'class' => VerbFilter::className(),
  38 + 'actions' => [
  39 + 'delete' => ['POST'],
  40 + ],
  41 + ],
  42 + ];
  43 + }
  44 +
  45 + /**
  46 + * Lists all Comment models.
  47 + * @return mixed
  48 + */
  49 + public function actionIndex()
  50 + {
  51 + $searchModel = new CommentSearch();
  52 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  53 + $query = $dataProvider->query;
  54 + $query->with(['rating', 'user']);
  55 + $sort = $dataProvider->sort;
  56 + $sort->defaultOrder = [
  57 + 'status' => SORT_ASC,
  58 + ];
  59 +
  60 + return $this->render('index', [
  61 + 'searchModel' => $searchModel,
  62 + 'dataProvider' => $dataProvider,
  63 + ]);
  64 + }
  65 +
  66 + /**
  67 + * Displays a single Comment model.
  68 + * @param integer $id
  69 + * @return mixed
  70 + */
  71 +// public function actionView($id)
  72 +// {
  73 +// return $this->render('view', [
  74 +// 'model' => $this->findModel($id),
  75 +// ]);
  76 +// }
  77 +
  78 + /**
  79 + * Creates a new Comment model.
  80 + * If creation is successful, the browser will be redirected to the 'view' page.
  81 + * @return mixed
  82 + */
  83 +// public function actionCreate()
  84 +// {
  85 +// $model = new Comment();
  86 +//
  87 +// if ($model->load(Yii::$app->request->post()) && $model->save()) {
  88 +// return $this->redirect(['view', 'id' => $model->comment_id]);
  89 +// } else {
  90 +// return $this->render('create', [
  91 +// 'model' => $model,
  92 +// ]);
  93 +// }
  94 +// }
  95 +
  96 + /**
  97 + * Updates an existing Comment model.
  98 + * If update is successful, the browser will be redirected to the 'view' page.
  99 + * @param integer $id
  100 + * @return mixed
  101 + */
  102 + public function actionUpdate($id)
  103 + {
  104 + $model = $this->findModel($id);
  105 +
  106 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  107 + return $this->redirect(['view', 'id' => $model->comment_id]);
  108 + } else {
  109 + return $this->render('update', [
  110 + 'model' => $model,
  111 + ]);
  112 + }
  113 + }
  114 +
  115 + public function actionApprove($id) {
  116 + $model = $this->findModel($id);
  117 + $model->status = Comment::STATUS_ACTIVE;
  118 + $model->save(false);
  119 +
  120 + return $this->redirect(['index']);
  121 + }
  122 +
  123 + public function actionDisapprove($id) {
  124 + $model = $this->findModel($id);
  125 + $model->status = Comment::STATUS_HIDDEN;
  126 + $model->save(false);
  127 +
  128 + return $this->redirect(['index']);
  129 + }
  130 +
  131 + /**
  132 + * Deletes an existing Comment model.
  133 + * If deletion is successful, the browser will be redirected to the 'index' page.
  134 + * @param integer $id
  135 + * @return mixed
  136 + */
  137 + public function actionDelete($id)
  138 + {
  139 + $this->findModel($id)->delete();
  140 +
  141 + return $this->redirect(['index']);
  142 + }
  143 +
  144 + /**
  145 + * Finds the Comment model based on its primary key value.
  146 + * If the model is not found, a 404 HTTP exception will be thrown.
  147 + * @param integer $id
  148 + * @return Comment the loaded model
  149 + * @throws NotFoundHttpException if the model cannot be found
  150 + */
  151 + protected function findModel($id)
  152 + {
  153 + if (($model = Comment::findOne($id)) !== null) {
  154 + return $model;
  155 + } else {
  156 + throw new NotFoundHttpException('The requested page does not exist.');
  157 + }
  158 + }
  159 +}
... ...
backend/controllers/CustomerController.php 0 → 100755
  1 +++ a/backend/controllers/CustomerController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use Yii;
  6 +use common\models\Customer;
  7 +use common\models\CustomerSearch;
  8 +use yii\web\Controller;
  9 +use yii\web\NotFoundHttpException;
  10 +use yii\filters\VerbFilter;
  11 +use developeruz\db_rbac\behaviors\AccessBehavior;
  12 +/**
  13 + * CustomerController implements the CRUD actions for Customer model.
  14 + */
  15 +class CustomerController extends Controller
  16 +{
  17 + /**
  18 + * @inheritdoc
  19 + */
  20 + public function behaviors()
  21 + {
  22 + return [
  23 + 'access'=>[
  24 + 'class' => AccessBehavior::className(),
  25 + 'rules' =>
  26 + ['site' =>
  27 + [
  28 + [
  29 + 'actions' => ['login', 'error'],
  30 + 'allow' => true,
  31 + ]
  32 + ]
  33 + ]
  34 + ],
  35 + 'verbs' => [
  36 + 'class' => VerbFilter::className(),
  37 + 'actions' => [
  38 + 'delete' => ['POST'],
  39 + ],
  40 + ],
  41 + ];
  42 + }
  43 +
  44 + /**
  45 + * Lists all Customer models.
  46 + * @return mixed
  47 + */
  48 + public function actionIndex()
  49 + {
  50 + $searchModel = new CustomerSearch();
  51 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  52 +
  53 + return $this->render('index', [
  54 + 'searchModel' => $searchModel,
  55 + 'dataProvider' => $dataProvider,
  56 + ]);
  57 + }
  58 +
  59 + /**
  60 + * Displays a single Customer model.
  61 + * @param integer $id
  62 + * @return mixed
  63 + */
  64 + public function actionView($id)
  65 + {
  66 + return $this->render('view', [
  67 + 'model' => $this->findModel($id),
  68 + ]);
  69 + }
  70 +
  71 + /**
  72 + * Creates a new Customer model.
  73 + * If creation is successful, the browser will be redirected to the 'view' page.
  74 + * @return mixed
  75 + */
  76 + public function actionCreate()
  77 + {
  78 + $model = new Customer();
  79 +
  80 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  81 + return $this->redirect(['view', 'id' => $model->id]);
  82 + } else {
  83 + return $this->render('create', [
  84 + 'model' => $model,
  85 + ]);
  86 + }
  87 + }
  88 +
  89 + /**
  90 + * Updates an existing Customer model.
  91 + * If update is successful, the browser will be redirected to the 'view' page.
  92 + * @param integer $id
  93 + * @return mixed
  94 + */
  95 + public function actionUpdate($id)
  96 + {
  97 + $model = $this->findModel($id);
  98 +
  99 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  100 + return $this->redirect(['view', 'id' => $model->id]);
  101 + } else {
  102 + return $this->render('update', [
  103 + 'model' => $model,
  104 + ]);
  105 + }
  106 + }
  107 +
  108 + /**
  109 + * Deletes an existing Customer model.
  110 + * If deletion is successful, the browser will be redirected to the 'index' page.
  111 + * @param integer $id
  112 + * @return mixed
  113 + */
  114 + public function actionDelete($id)
  115 + {
  116 + $this->findModel($id)->delete();
  117 +
  118 + return $this->redirect(['index']);
  119 + }
  120 +
  121 + /**
  122 + * Finds the Customer model based on its primary key value.
  123 + * If the model is not found, a 404 HTTP exception will be thrown.
  124 + * @param integer $id
  125 + * @return Customer the loaded model
  126 + * @throws NotFoundHttpException if the model cannot be found
  127 + */
  128 + protected function findModel($id)
  129 + {
  130 + if (($model = Customer::findOne($id)) !== null) {
  131 + return $model;
  132 + } else {
  133 + throw new NotFoundHttpException('The requested page does not exist.');
  134 + }
  135 + }
  136 +}
... ...
backend/controllers/EventController.php 0 → 100755
  1 +++ a/backend/controllers/EventController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use common\modules\product\models\Import;
  6 +use Yii;
  7 +use common\models\Event;
  8 +use common\models\EventSearch;
  9 +use yii\web\Controller;
  10 +use yii\web\NotFoundHttpException;
  11 +use yii\filters\VerbFilter;
  12 +use developeruz\db_rbac\behaviors\AccessBehavior;
  13 +use yii\web\UploadedFile;
  14 +
  15 +/**
  16 + * EventController implements the CRUD actions for Event model.
  17 + */
  18 +class EventController extends Controller
  19 +{
  20 + /**
  21 + * @inheritdoc
  22 + */
  23 + public function behaviors()
  24 + {
  25 + return [
  26 + 'access'=>[
  27 + 'class' => AccessBehavior::className(),
  28 + 'rules' =>
  29 + ['site' =>
  30 + [
  31 + [
  32 + 'actions' => ['login', 'error'],
  33 + 'allow' => true,
  34 + ]
  35 + ]
  36 + ]
  37 + ],
  38 + 'verbs' => [
  39 + 'class' => VerbFilter::className(),
  40 + 'actions' => [
  41 + 'delete' => ['POST'],
  42 + ],
  43 + ],
  44 + ];
  45 + }
  46 +
  47 + /**
  48 + * Lists all Event models.
  49 + * @return mixed
  50 + */
  51 + public function actionIndex()
  52 + {
  53 + $searchModel = new EventSearch();
  54 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  55 +
  56 + return $this->render('index', [
  57 + 'searchModel' => $searchModel,
  58 + 'dataProvider' => $dataProvider,
  59 + ]);
  60 + }
  61 +
  62 + /**
  63 + * Displays a single Event model.
  64 + * @param integer $id
  65 + * @return mixed
  66 + */
  67 + public function actionView($id)
  68 + {
  69 + return $this->render('view', [
  70 + 'model' => $this->findModel($id),
  71 + ]);
  72 + }
  73 +
  74 + /**
  75 + * Creates a new Event model.
  76 + * If creation is successful, the browser will be redirected to the 'view' page.
  77 + * @return mixed
  78 + */
  79 + public function actionCreate()
  80 + {
  81 + $model = new Event();
  82 +
  83 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  84 +
  85 + if ( ($image = UploadedFile::getInstance($model, 'imageUpload')) ) {
  86 + $model->image = $image->name;
  87 + $image->saveAs(Yii::getAlias('@imagesDir/event/' . $image->name));
  88 + }
  89 +
  90 + if ( ($banner = UploadedFile::getInstance($model, 'banner')) ) {
  91 + $model->banner = $banner->name;
  92 + $image->saveAs(Yii::getAlias('@imagesDir/event/' . $banner->name));
  93 + }
  94 +
  95 +
  96 + return $this->redirect(['view', 'id' => $model->event_id]);
  97 + } else {
  98 + return $this->render('create', [
  99 + 'model' => $model,
  100 + ]);
  101 + }
  102 + }
  103 +
  104 + /**
  105 + * Updates an existing Event model.
  106 + * If update is successful, the browser will be redirected to the 'view' page.
  107 + * @param integer $id
  108 + * @return mixed
  109 + */
  110 + public function actionUpdate($id)
  111 + {
  112 + $model = $this->findModel($id);
  113 +
  114 + if ($model->load(Yii::$app->request->post())) {
  115 +
  116 + if ( ($image = UploadedFile::getInstance($model, 'imageUpload')) ) {
  117 + $model->image = $image->name;
  118 + }
  119 +
  120 + if ( ($banner = UploadedFile::getInstance($model, 'banner')) ) {
  121 + $model->banner = $banner->name;
  122 + $banner->saveAs(Yii::getAlias('@imagesDir/event/' . $banner->name));
  123 + }
  124 +
  125 + if ($model->save() && $image) {
  126 + $image->saveAs(Yii::getAlias('@imagesDir/event/' . $image->name));
  127 +
  128 + }
  129 +
  130 +
  131 +
  132 + if ( ($file = UploadedFile::getInstance($model, 'products_file')) ) {
  133 + if(!empty($file)){
  134 + $file->saveAs(Yii::getAlias('@uploadDir/' . $file->name));
  135 + $import = new Import();
  136 + $import->goEvent(Yii::getAlias('@uploadDir/' . $file->name));
  137 + }
  138 +
  139 + }
  140 +
  141 + return $this->redirect(['view', 'id' => $model->event_id]);
  142 + } else {
  143 + return $this->render('update', [
  144 + 'model' => $model,
  145 + ]);
  146 + }
  147 + }
  148 +
  149 + /**
  150 + * Deletes an existing Event model.
  151 + * If deletion is successful, the browser will be redirected to the 'index' page.
  152 + * @param integer $id
  153 + * @return mixed
  154 + */
  155 + public function actionDelete($id)
  156 + {
  157 + $this->findModel($id)->delete();
  158 +
  159 + return $this->redirect(['index']);
  160 + }
  161 +
  162 + public function actionDelimg($id,$field){
  163 + $model = $this->findModel($id);
  164 + $model->detachBehavior('img');
  165 + $model->$field = '';
  166 + $model->save();
  167 + return true;
  168 + }
  169 +
  170 +
  171 + /**
  172 + * Finds the Event model based on its primary key value.
  173 + * If the model is not found, a 404 HTTP exception will be thrown.
  174 + * @param integer $id
  175 + * @return Event the loaded model
  176 + * @throws NotFoundHttpException if the model cannot be found
  177 + */
  178 + protected function findModel($id)
  179 + {
  180 + if (($model = Event::findOne($id)) !== null) {
  181 + return $model;
  182 + } else {
  183 + throw new NotFoundHttpException('The requested page does not exist.');
  184 + }
  185 + }
  186 +}
... ...
backend/controllers/FeedbackController.php 0 → 100755
  1 +++ a/backend/controllers/FeedbackController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use common\models\Feedback;
  6 +use common\models\FeedbackSearch;
  7 +use Yii;
  8 +use yii\web\Controller;
  9 +use yii\web\NotFoundHttpException;
  10 +use yii\filters\VerbFilter;
  11 +use developeruz\db_rbac\behaviors\AccessBehavior;
  12 +
  13 +class FeedbackController extends Controller
  14 +{
  15 + /**
  16 + * @inheritdoc
  17 + */
  18 + public function behaviors()
  19 + {
  20 + return [
  21 + 'access'=>[
  22 + 'class' => AccessBehavior::className(),
  23 + 'rules' =>
  24 + ['site' =>
  25 + [
  26 + [
  27 + 'actions' => ['login', 'error'],
  28 + 'allow' => true,
  29 + ]
  30 + ]
  31 + ]
  32 + ],
  33 + 'verbs' => [
  34 + 'class' => VerbFilter::className(),
  35 + 'actions' => [
  36 + 'delete' => ['POST'],
  37 + ],
  38 + ],
  39 + ];
  40 + }
  41 +
  42 + /**
  43 + * Lists all Feedback models.
  44 + * @return mixed
  45 + */
  46 + public function actionIndex()
  47 + {
  48 + $searchModel = new FeedbackSearch();
  49 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  50 +
  51 + return $this->render('index', [
  52 + 'searchModel' => $searchModel,
  53 + 'dataProvider' => $dataProvider,
  54 + ]);
  55 + }
  56 +
  57 + /**
  58 + * Deletes an existing Feedback model.
  59 + * If deletion is successful, the browser will be redirected to the 'index' page.
  60 + * @param integer $id
  61 + * @return mixed
  62 + */
  63 + public function actionDelete($id)
  64 + {
  65 + $this->findModel($id)->delete();
  66 +
  67 + return $this->redirect(['index']);
  68 + }
  69 +
  70 + /**
  71 + * Finds the Feedback model based on its primary key value.
  72 + * If the model is not found, a 404 HTTP exception will be thrown.
  73 + * @param integer $id
  74 + * @return Feedback the loaded model
  75 + * @throws NotFoundHttpException if the model cannot be found
  76 + */
  77 + protected function findModel($id)
  78 + {
  79 + if (($model = Feedback::findOne($id)) !== null) {
  80 + return $model;
  81 + } else {
  82 + throw new NotFoundHttpException('The requested page does not exist.');
  83 + }
  84 + }
  85 +}
... ...
backend/controllers/OrdersController.php 0 → 100755
  1 +++ a/backend/controllers/OrdersController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use backend\models\OrdersSearch;
  6 +use Yii;
  7 +use yii\web\Controller;
  8 +use yii\filters\VerbFilter;
  9 +use yii\data\ActiveDataProvider;
  10 +use yii\web\HttpException;
  11 +use common\models\Orders;
  12 +use backend\models\OrdersProducts;
  13 +use common\modules\product\models\ProductVariant;
  14 +use yii\web\NotFoundHttpException;
  15 +use developeruz\db_rbac\behaviors\AccessBehavior;
  16 +
  17 +class OrdersController extends Controller
  18 +{
  19 + /**
  20 + * @inheritdoc
  21 + */
  22 + public function behaviors()
  23 + {
  24 + return [
  25 + 'access'=>[
  26 + 'class' => AccessBehavior::className(),
  27 + 'rules' =>
  28 + ['site' =>
  29 + [
  30 + [
  31 + 'actions' => ['login', 'error'],
  32 + 'allow' => true,
  33 + ]
  34 + ]
  35 + ]
  36 + ],
  37 + 'verbs' => [
  38 + 'class' => VerbFilter::className(),
  39 + 'actions' => [
  40 + 'delete' => ['POST'],
  41 + ],
  42 + ],
  43 + ];
  44 + }
  45 +
  46 + public function actionIndex()
  47 + {
  48 + $searchModel = new OrdersSearch();
  49 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  50 +
  51 + return $this->render('index', [
  52 + 'dataProvider'=>$dataProvider,
  53 + 'searchModel'=>$searchModel,
  54 + ]);
  55 + }
  56 +
  57 + public function actionShow($id)
  58 + {
  59 +
  60 + $model = $this->findModel((int)$id);
  61 + $dataProvider = new ActiveDataProvider([
  62 + 'query' => OrdersProducts::find()->where(['order_id'=>(int)$id]),
  63 + 'pagination' => [
  64 + 'pageSize' => 20,
  65 + ],
  66 + ]);
  67 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  68 + return $this->redirect(['index']);
  69 + } else {
  70 + $model_orderproducts = new OrdersProducts;
  71 +
  72 +
  73 + return $this->renderAjax('show', [
  74 + 'model' => $model,
  75 + 'model_orderproducts'=>$model_orderproducts,
  76 + 'dataProvider' => $dataProvider,
  77 + ]);
  78 + }
  79 + }
  80 +
  81 + public function actionLabelupdate(){
  82 + $model = Orders::findOne($_POST['order_id']);
  83 + $model->label = $_POST['label_id'];
  84 + $model->save();
  85 + }
  86 +
  87 + public function actionPayupdate(){
  88 + $model = Orders::findOne($_POST['order_id']);
  89 + $model->pay = $_POST['pay_id'];
  90 + $model->save();
  91 + }
  92 +
  93 + public function actionDelete(){
  94 + $model = Orders::findOne($_GET['id']);
  95 + $model->delete();
  96 + return Yii::$app->response->redirect(['/orders/index']);
  97 + }
  98 +
  99 +
  100 + public function actionAdd(){
  101 + $model = new OrdersProducts;
  102 + if ($model->load(Yii::$app->request->post())) {
  103 +
  104 + if(!$modelMod = ProductVariant::find()->with(['product'])->where(['sku'=>$model->sku])->one())
  105 + throw new HttpException(404, 'Данного артикля не существует!');
  106 + $model->product_name = $modelMod->product->name;
  107 + $model->name = $modelMod->name;
  108 + $model->sku = $modelMod->sku;
  109 + $model->price = $modelMod->price;
  110 + $model->sum_cost = $model->count*$modelMod->price;
  111 + $model->mod_id = $modelMod->id;
  112 + $model->save();
  113 + //return Yii::$app->response->redirect(['/admin/orders/show','id'=>$_GET['order_id']]);
  114 + }
  115 +
  116 + //return $this->render('add',['model'=>$model]);
  117 + }
  118 +
  119 + public function actionCreate(){
  120 + $model = new Orders();
  121 +
  122 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  123 + return $this->redirect(['index']);
  124 + } else {
  125 + return $this->render('create', [
  126 + 'model' => $model,
  127 + ]);
  128 + }
  129 + }
  130 +
  131 + public function actionDelete_product(){
  132 + $model = OrdersProducts::findOne($_GET['id']);
  133 + $model->delete();
  134 + return Yii::$app->response->redirect(['/admin/orders/show','id'=>$_GET['order_id']]);
  135 + }
  136 +
  137 + protected function findModel($id)
  138 + {
  139 + if (($model = Orders::findOne($id)) !== null) {
  140 + return $model;
  141 + } else {
  142 + throw new NotFoundHttpException('The requested page does not exist.');
  143 + }
  144 + }
  145 +}
... ...
backend/controllers/PageController.php 0 → 100755
  1 +++ a/backend/controllers/PageController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use Yii;
  6 +use common\models\Page;
  7 +use common\models\PageSearch;
  8 +use yii\web\Controller;
  9 +use yii\web\NotFoundHttpException;
  10 +use yii\filters\VerbFilter;
  11 +use developeruz\db_rbac\behaviors\AccessBehavior;
  12 +/**
  13 + * PageController implements the CRUD actions for Page model.
  14 + */
  15 +class PageController extends Controller
  16 +{
  17 + /**
  18 + * @inheritdoc
  19 + */
  20 + public function behaviors()
  21 + {
  22 + return [
  23 + 'access'=>[
  24 + 'class' => AccessBehavior::className(),
  25 + 'rules' =>
  26 + ['site' =>
  27 + [
  28 + [
  29 + 'actions' => ['login', 'error'],
  30 + 'allow' => true,
  31 + ]
  32 + ]
  33 + ]
  34 + ],
  35 + 'verbs' => [
  36 + 'class' => VerbFilter::className(),
  37 + 'actions' => [
  38 + 'delete' => ['POST'],
  39 + ],
  40 + ],
  41 + ];
  42 + }
  43 +
  44 + /**
  45 + * Lists all Page models.
  46 + * @return mixed
  47 + */
  48 + public function actionIndex()
  49 + {
  50 + $searchModel = new PageSearch();
  51 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  52 +
  53 + return $this->render('index', [
  54 + 'searchModel' => $searchModel,
  55 + 'dataProvider' => $dataProvider,
  56 + ]);
  57 + }
  58 +
  59 + /**
  60 + * Displays a single Page model.
  61 + * @param integer $id
  62 + * @return mixed
  63 + */
  64 + public function actionView($id)
  65 + {
  66 + return $this->render('view', [
  67 + 'model' => $this->findModel($id),
  68 + ]);
  69 + }
  70 +
  71 + /**
  72 + * Creates a new Page model.
  73 + * If creation is successful, the browser will be redirected to the 'view' page.
  74 + * @return mixed
  75 + */
  76 + public function actionCreate()
  77 + {
  78 + $model = new Page();
  79 +
  80 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  81 + return $this->redirect(['view', 'id' => $model->id]);
  82 + } else {
  83 + return $this->render('create', [
  84 + 'model' => $model,
  85 + ]);
  86 + }
  87 + }
  88 +
  89 + /**
  90 + * Updates an existing Page model.
  91 + * If update is successful, the browser will be redirected to the 'view' page.
  92 + * @param integer $id
  93 + * @return mixed
  94 + */
  95 + public function actionUpdate($id)
  96 + {
  97 + $model = $this->findModel($id);
  98 +
  99 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  100 + return $this->redirect(['view', 'id' => $model->id]);
  101 + } else {
  102 + return $this->render('update', [
  103 + 'model' => $model,
  104 + ]);
  105 + }
  106 + }
  107 +
  108 + /**
  109 + * Deletes an existing Page model.
  110 + * If deletion is successful, the browser will be redirected to the 'index' page.
  111 + * @param integer $id
  112 + * @return mixed
  113 + */
  114 + public function actionDelete($id)
  115 + {
  116 + $this->findModel($id)->delete();
  117 +
  118 + return $this->redirect(['index']);
  119 + }
  120 +
  121 + /**
  122 + * Finds the Page model based on its primary key value.
  123 + * If the model is not found, a 404 HTTP exception will be thrown.
  124 + * @param integer $id
  125 + * @return Page the loaded model
  126 + * @throws NotFoundHttpException if the model cannot be found
  127 + */
  128 + protected function findModel($id)
  129 + {
  130 + if (($model = Page::findOne($id)) !== null) {
  131 + return $model;
  132 + } else {
  133 + throw new NotFoundHttpException('The requested page does not exist.');
  134 + }
  135 + }
  136 +}
... ...
backend/controllers/SeoCategoryController.php 0 → 100755
  1 +++ a/backend/controllers/SeoCategoryController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use Yii;
  6 +use common\models\SeoCategory;
  7 +use common\models\SeoCategorySearch;
  8 +use yii\web\Controller;
  9 +use yii\web\NotFoundHttpException;
  10 +use yii\filters\VerbFilter;
  11 +use developeruz\db_rbac\behaviors\AccessBehavior;
  12 +/**
  13 + * SeoCategoryController implements the CRUD actions for SeoCategory model.
  14 + */
  15 +class SeoCategoryController extends Controller
  16 +{
  17 + /**
  18 + * @inheritdoc
  19 + */
  20 + public function behaviors()
  21 + {
  22 + return [
  23 + 'access'=>[
  24 + 'class' => AccessBehavior::className(),
  25 + 'rules' =>
  26 + ['site' =>
  27 + [
  28 + [
  29 + 'actions' => ['login', 'error'],
  30 + 'allow' => true,
  31 + ]
  32 + ]
  33 + ]
  34 + ],
  35 + 'verbs' => [
  36 + 'class' => VerbFilter::className(),
  37 +
  38 + ],
  39 + ];
  40 + }
  41 +
  42 + /**
  43 + * Lists all SeoCategory models.
  44 + * @return mixed
  45 + */
  46 + public function actionIndex()
  47 + {
  48 + $searchModel = new SeoCategorySearch();
  49 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  50 +
  51 + return $this->render('index', [
  52 + 'searchModel' => $searchModel,
  53 + 'dataProvider' => $dataProvider,
  54 + ]);
  55 + }
  56 +
  57 + /**
  58 + * Displays a single SeoCategory model.
  59 + * @param integer $id
  60 + * @return mixed
  61 + */
  62 + public function actionView($id)
  63 + {
  64 + return $this->render('view', [
  65 + 'model' => $this->findModel($id),
  66 + ]);
  67 + }
  68 +
  69 + /**
  70 + * Creates a new SeoCategory model.
  71 + * If creation is successful, the browser will be redirected to the 'view' page.
  72 + * @return mixed
  73 + */
  74 + public function actionCreate()
  75 + {
  76 + $model = new SeoCategory();
  77 +
  78 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  79 + return $this->redirect(['view', 'id' => $model->seo_category_id]);
  80 + } else {
  81 + return $this->render('create', [
  82 + 'model' => $model,
  83 + ]);
  84 + }
  85 + }
  86 +
  87 + /**
  88 + * Updates an existing SeoCategory model.
  89 + * If update is successful, the browser will be redirected to the 'view' page.
  90 + * @param integer $id
  91 + * @return mixed
  92 + */
  93 + public function actionUpdate($id)
  94 + {
  95 + $model = $this->findModel($id);
  96 +
  97 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  98 + return $this->redirect(['view', 'id' => $model->seo_category_id]);
  99 + } else {
  100 + return $this->render('update', [
  101 + 'model' => $model,
  102 + ]);
  103 + }
  104 + }
  105 +
  106 + /**
  107 + * Deletes an existing SeoCategory model.
  108 + * If deletion is successful, the browser will be redirected to the 'index' page.
  109 + * @param integer $id
  110 + * @return mixed
  111 + */
  112 + public function actionDelete($id)
  113 + {
  114 + $this->findModel($id)->delete();
  115 +
  116 + return $this->redirect(['index']);
  117 + }
  118 +
  119 + /**
  120 + * Finds the SeoCategory model based on its primary key value.
  121 + * If the model is not found, a 404 HTTP exception will be thrown.
  122 + * @param integer $id
  123 + * @return SeoCategory the loaded model
  124 + * @throws NotFoundHttpException if the model cannot be found
  125 + */
  126 + protected function findModel($id)
  127 + {
  128 + if (($model = SeoCategory::findOne($id)) !== null) {
  129 + return $model;
  130 + } else {
  131 + throw new NotFoundHttpException('The requested page does not exist.');
  132 + }
  133 + }
  134 +}
... ...
backend/controllers/SeoController.php 0 → 100755
  1 +++ a/backend/controllers/SeoController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use Yii;
  6 +use common\models\Seo;
  7 +use common\models\SeoSearch;
  8 +use yii\web\Controller;
  9 +use yii\web\NotFoundHttpException;
  10 +use yii\filters\VerbFilter;
  11 +use developeruz\db_rbac\behaviors\AccessBehavior;
  12 +/**
  13 + * SeoController implements the CRUD actions for Seo model.
  14 + */
  15 +class SeoController extends Controller
  16 +{
  17 + /**
  18 + * @inheritdoc
  19 + */
  20 + public function behaviors()
  21 + {
  22 + return [
  23 + 'access'=>[
  24 + 'class' => AccessBehavior::className(),
  25 + 'rules' =>
  26 + ['site' =>
  27 + [
  28 + [
  29 + 'actions' => ['login', 'error'],
  30 + 'allow' => true,
  31 + ]
  32 + ]
  33 + ]
  34 + ],
  35 + 'verbs' => [
  36 + 'class' => VerbFilter::className(),
  37 +
  38 + ],
  39 + ];
  40 + }
  41 +
  42 + /**
  43 + * Lists all Seo models.
  44 + * @return mixed
  45 + */
  46 + public function actionIndex()
  47 + {
  48 + $searchModel = new SeoSearch();
  49 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  50 +
  51 + return $this->render('index', [
  52 + 'searchModel' => $searchModel,
  53 + 'dataProvider' => $dataProvider,
  54 + ]);
  55 + }
  56 +
  57 + /**
  58 + * Displays a single Seo model.
  59 + * @param integer $id
  60 + * @return mixed
  61 + */
  62 + public function actionView($id)
  63 + {
  64 + return $this->render('view', [
  65 + 'model' => $this->findModel($id),
  66 + ]);
  67 + }
  68 +
  69 + /**
  70 + * Creates a new Seo model.
  71 + * If creation is successful, the browser will be redirected to the 'view' page.
  72 + * @return mixed
  73 + */
  74 + public function actionCreate()
  75 + {
  76 + $model = new Seo();
  77 +
  78 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  79 + return $this->redirect(['view', 'id' => $model->seo_id]);
  80 + } else {
  81 + return $this->render('create', [
  82 + 'model' => $model,
  83 + ]);
  84 + }
  85 + }
  86 +
  87 + /**
  88 + * Updates an existing Seo model.
  89 + * If update is successful, the browser will be redirected to the 'view' page.
  90 + * @param integer $id
  91 + * @return mixed
  92 + */
  93 + public function actionUpdate($id)
  94 + {
  95 + $model = $this->findModel($id);
  96 +
  97 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  98 + return $this->redirect(['view', 'id' => $model->seo_id]);
  99 + } else {
  100 + return $this->render('update', [
  101 + 'model' => $model,
  102 + ]);
  103 + }
  104 + }
  105 +
  106 + /**
  107 + * Deletes an existing Seo model.
  108 + * If deletion is successful, the browser will be redirected to the 'index' page.
  109 + * @param integer $id
  110 + * @return mixed
  111 + */
  112 + public function actionDelete($id)
  113 + {
  114 + $this->findModel($id)->delete();
  115 +
  116 + return $this->redirect(['index']);
  117 + }
  118 +
  119 + /**
  120 + * Finds the Seo model based on its primary key value.
  121 + * If the model is not found, a 404 HTTP exception will be thrown.
  122 + * @param integer $id
  123 + * @return Seo the loaded model
  124 + * @throws NotFoundHttpException if the model cannot be found
  125 + */
  126 + protected function findModel($id)
  127 + {
  128 + if (($model = Seo::findOne($id)) !== null) {
  129 + return $model;
  130 + } else {
  131 + throw new NotFoundHttpException('The requested page does not exist.');
  132 + }
  133 + }
  134 +}
... ...
backend/controllers/SeoDynamicController.php 0 → 100755
  1 +++ a/backend/controllers/SeoDynamicController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use Yii;
  6 +use common\models\SeoDynamic;
  7 +use common\models\SeoDynamicSearch;
  8 +use yii\web\Controller;
  9 +use yii\web\NotFoundHttpException;
  10 +use yii\filters\VerbFilter;
  11 +use developeruz\db_rbac\behaviors\AccessBehavior;
  12 +/**
  13 + * SeoDynamicController implements the CRUD actions for SeoDynamic model.
  14 + */
  15 +class SeoDynamicController extends Controller
  16 +{
  17 + /**
  18 + * @inheritdoc
  19 + */
  20 + public function behaviors()
  21 + {
  22 + return [
  23 + 'access'=>[
  24 + 'class' => AccessBehavior::className(),
  25 + 'rules' =>
  26 + ['site' =>
  27 + [
  28 + [
  29 + 'actions' => ['login', 'error'],
  30 + 'allow' => true,
  31 + ]
  32 + ]
  33 + ]
  34 + ],
  35 + 'verbs' => [
  36 + 'class' => VerbFilter::className(),
  37 +
  38 + ],
  39 + ];
  40 + }
  41 +
  42 + /**
  43 + * Lists all SeoDynamic models.
  44 + * @return mixed
  45 + */
  46 + public function actionIndex($seo_category_id)
  47 + {
  48 + $searchModel = new SeoDynamicSearch();
  49 + $dataProvider = $searchModel->search($seo_category_id,Yii::$app->request->queryParams);
  50 +
  51 + return $this->render('index', [
  52 + 'searchModel' => $searchModel,
  53 + 'dataProvider' => $dataProvider,
  54 + 'seo_category_id' => $seo_category_id
  55 + ]);
  56 + }
  57 +
  58 + /**
  59 + * Displays a single SeoDynamic model.
  60 + * @param integer $id
  61 + * @return mixed
  62 + */
  63 + public function actionView($seo_category_id, $id)
  64 + {
  65 + return $this->render('view', [
  66 + 'model' => $this->findModel($id),
  67 + 'seo_category_id' => $seo_category_id
  68 + ]);
  69 + }
  70 +
  71 + /**
  72 + * Creates a new SeoDynamic model.
  73 + * If creation is successful, the browser will be redirected to the 'view' page.
  74 + * @return mixed
  75 + */
  76 + public function actionCreate($seo_category_id)
  77 + {
  78 + $model = new SeoDynamic();
  79 +
  80 + if ($model->load(Yii::$app->request->post())) {
  81 + $model->seo_category_id = $seo_category_id;
  82 + $model->save();
  83 + return $this->redirect(['index', 'seo_category_id' => $model->seo_category_id]);
  84 + } else {
  85 + return $this->render('create', [
  86 + 'model' => $model,
  87 + 'seo_category_id' => $seo_category_id
  88 + ]);
  89 + }
  90 + }
  91 +
  92 + /**
  93 + * Updates an existing SeoDynamic model.
  94 + * If update is successful, the browser will be redirected to the 'view' page.
  95 + * @param integer $id
  96 + * @return mixed
  97 + */
  98 + public function actionUpdate($seo_category_id,$id)
  99 + {
  100 + $model = $this->findModel($id);
  101 +
  102 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  103 + return $this->redirect(['index', 'seo_category_id' => $model->seo_category_id]);
  104 + } else {
  105 + return $this->render('update', [
  106 + 'model' => $model,
  107 + 'seo_category_id' => $seo_category_id
  108 + ]);
  109 + }
  110 + }
  111 +
  112 + /**
  113 + * Deletes an existing SeoDynamic model.
  114 + * If deletion is successful, the browser will be redirected to the 'index' page.
  115 + * @param integer $id
  116 + * @return mixed
  117 + */
  118 + public function actionDelete($seo_category_id,$id)
  119 + {
  120 + $this->findModel($id)->delete();
  121 +
  122 + return $this->redirect(['index','seo_category_id'=> $seo_category_id]);
  123 + }
  124 +
  125 + /**
  126 + * Finds the SeoDynamic model based on its primary key value.
  127 + * If the model is not found, a 404 HTTP exception will be thrown.
  128 + * @param integer $id
  129 + * @return SeoDynamic the loaded model
  130 + * @throws NotFoundHttpException if the model cannot be found
  131 + */
  132 + protected function findModel($id)
  133 + {
  134 + if (($model = SeoDynamic::findOne($id)) !== null) {
  135 + return $model;
  136 + } else {
  137 + throw new NotFoundHttpException('The requested page does not exist.');
  138 + }
  139 + }
  140 +}
... ...
backend/controllers/ServiceController.php 0 → 100755
  1 +++ a/backend/controllers/ServiceController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use Yii;
  6 +use common\models\Service;
  7 +use common\models\ServiceSearch;
  8 +use yii\web\Controller;
  9 +use yii\web\NotFoundHttpException;
  10 +use yii\filters\VerbFilter;
  11 +use developeruz\db_rbac\behaviors\AccessBehavior;
  12 +/**
  13 + * ServiceController implements the CRUD actions for Service model.
  14 + */
  15 +class ServiceController extends Controller
  16 +{
  17 + /**
  18 + * @inheritdoc
  19 + */
  20 + public function behaviors()
  21 + {
  22 + return [
  23 + 'access'=>[
  24 + 'class' => AccessBehavior::className(),
  25 + 'rules' =>
  26 + ['site' =>
  27 + [
  28 + [
  29 + 'actions' => ['login', 'error'],
  30 + 'allow' => true,
  31 + ]
  32 + ]
  33 + ]
  34 + ],
  35 + 'verbs' => [
  36 + 'class' => VerbFilter::className(),
  37 + 'actions' => [
  38 + 'delete' => ['POST'],
  39 + ],
  40 + ],
  41 + ];
  42 + }
  43 +
  44 + /**
  45 + * Lists all Service models.
  46 + * @return mixed
  47 + */
  48 + public function actionIndex()
  49 + {
  50 + $searchModel = new ServiceSearch();
  51 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  52 +
  53 + return $this->render('index', [
  54 + 'searchModel' => $searchModel,
  55 + 'dataProvider' => $dataProvider,
  56 + ]);
  57 + }
  58 +
  59 + /**
  60 + * Displays a single Service model.
  61 + * @param integer $id
  62 + * @return mixed
  63 + */
  64 + public function actionView($id)
  65 + {
  66 + return $this->render('view', [
  67 + 'model' => $this->findModel($id),
  68 + ]);
  69 + }
  70 +
  71 + /**
  72 + * Creates a new Service model.
  73 + * If creation is successful, the browser will be redirected to the 'view' page.
  74 + * @return mixed
  75 + */
  76 + public function actionCreate()
  77 + {
  78 + $model = new Service();
  79 +
  80 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  81 + return $this->redirect(['view', 'id' => $model->service_id]);
  82 + } else {
  83 + return $this->render('create', [
  84 + 'model' => $model,
  85 + ]);
  86 + }
  87 + }
  88 +
  89 + /**
  90 + * Updates an existing Service model.
  91 + * If update is successful, the browser will be redirected to the 'view' page.
  92 + * @param integer $id
  93 + * @return mixed
  94 + */
  95 + public function actionUpdate($id)
  96 + {
  97 + $model = $this->findModel($id);
  98 +
  99 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  100 + return $this->redirect(['view', 'id' => $model->service_id]);
  101 + } else {
  102 + return $this->render('update', [
  103 + 'model' => $model,
  104 + ]);
  105 + }
  106 + }
  107 +
  108 + /**
  109 + * Deletes an existing Service model.
  110 + * If deletion is successful, the browser will be redirected to the 'index' page.
  111 + * @param integer $id
  112 + * @return mixed
  113 + */
  114 + public function actionDelete($id)
  115 + {
  116 + $this->findModel($id)->delete();
  117 +
  118 + return $this->redirect(['index']);
  119 + }
  120 +
  121 + /**
  122 + * Finds the Service model based on its primary key value.
  123 + * If the model is not found, a 404 HTTP exception will be thrown.
  124 + * @param integer $id
  125 + * @return Service the loaded model
  126 + * @throws NotFoundHttpException if the model cannot be found
  127 + */
  128 + protected function findModel($id)
  129 + {
  130 + if (($model = Service::findOne($id)) !== null) {
  131 + return $model;
  132 + } else {
  133 + throw new NotFoundHttpException('The requested page does not exist.');
  134 + }
  135 + }
  136 +}
... ...
backend/controllers/SiteController.php 0 → 100755
  1 +++ a/backend/controllers/SiteController.php
  1 +<?php
  2 +namespace backend\controllers;
  3 +use common\modules\product\models\ProductImage;
  4 +use developeruz\db_rbac\behaviors\AccessBehavior;
  5 +use common\modules\product\models\Brand;
  6 +use common\modules\product\models\Category;
  7 +use common\modules\product\models\Product;
  8 +use common\modules\product\models\ProductVariant;
  9 +use common\modules\product\models\ProductVariantType;
  10 +use Yii;
  11 +use yii\filters\AccessControl;
  12 +use yii\helpers\Url;
  13 +use yii\web\Controller;
  14 +use backend\models\LoginForm;
  15 +use yii\filters\VerbFilter;
  16 +use common\models\Blog;
  17 +/**
  18 + * Site controller
  19 + */
  20 +class SiteController extends Controller
  21 +{
  22 +
  23 +
  24 + /**
  25 + * @inheritdoc
  26 + */
  27 + public function behaviors()
  28 + {
  29 + return [
  30 + 'verbs' => [
  31 + 'class' => VerbFilter::className(),
  32 + 'actions' => [
  33 + ],
  34 + ],
  35 + ];
  36 + }
  37 +
  38 + /**
  39 + * @inheritdoc
  40 + */
  41 + public function actions()
  42 + {
  43 + return [
  44 + 'error' => [
  45 + 'class' => 'yii\web\ErrorAction',
  46 + ],
  47 + ];
  48 + }
  49 +
  50 +
  51 + public function actionImages(){
  52 + $files = ProductImage::find()->all();
  53 + foreach($files as $file_object){
  54 + $file = $file_object->image;
  55 + $file_array = explode('/',$file);
  56 + if(is_array($file_array) && count($file_array) >3){
  57 + $count = count($file_array);
  58 + $file_name = $file_array[$count-2]."_".$file_array[$count-1];
  59 + print_r($file_name);
  60 + $save_image = Yii::getAlias('@productsDir') . "/" . $file_name;
  61 + copy($file, $save_image);
  62 + $file_object->image = $file_name;
  63 + $file_object->save();
  64 + }
  65 +
  66 + }
  67 +
  68 +
  69 + }
  70 +
  71 + public function actionIndex()
  72 + {
  73 + $blog = new Blog();
  74 + $post = \Yii::$app->request->post();
  75 + if($blog->load($post)) {
  76 + $blog->save();
  77 + }
  78 + return $this->render('index',[
  79 + 'blog' => $blog
  80 + ]);
  81 + }
  82 +
  83 + public function actionLogin()
  84 + {
  85 + $this->layout = '/none';
  86 +
  87 + if (!\Yii::$app->user->isGuest) {
  88 + return $this->goHome();
  89 + }
  90 +
  91 + $model = new LoginForm();
  92 + if ($model->load(Yii::$app->request->post()) && $model->login()) {
  93 + return $this->redirect(Url::to('/admin/site/index'));
  94 + } else {
  95 + return $this->render('login', [
  96 + 'model' => $model,
  97 + ]);
  98 + }
  99 + }
  100 +
  101 + public function actionLogout()
  102 + {
  103 + Yii::$app->user->logout();
  104 +
  105 + return $this->goHome();
  106 + }
  107 +
  108 + public function actionGo() {
  109 + $new_products = $linked_products = 0;
  110 +
  111 + // открываем файл и перебираем
  112 + $filename = Yii::getAlias('@uploadDir') .'/'. Yii::getAlias('@uploadFileProducts');
  113 + if (!is_file($filename)) {
  114 + var_dump("File $filename not found");
  115 + return Controller::EXIT_CODE_ERROR;
  116 + }
  117 + var_dump("File $filename loaded\n");
  118 +
  119 + $db = yii::$app->db;
  120 +
  121 + if (($handle = fopen ($filename, 'r')) !== FALSE)
  122 + {
  123 + $j = 0;
  124 +
  125 + while (($data = fgetcsv ($handle, 10000, ";")) !== FALSE)
  126 + {
  127 + $j++;
  128 +
  129 + foreach ($data as &$value)
  130 + {
  131 + //$value = mb_convert_encoding ($value, "UTF-8", mb_detect_encoding ($value));
  132 + $value = iconv ('windows-1251', "UTF-8//TRANSLIT//IGNORE", $value);
  133 + $value = trim ($value);
  134 + }
  135 +
  136 + // будет всегда 19 элементов
  137 + for ($i = 0; $i <= 18; $i++)
  138 + {
  139 + if (! isset ($data[$i]))
  140 + {
  141 + $data[$i] = null;
  142 + }
  143 + }
  144 +
  145 + // 1 Группа (категория)
  146 + $catalog_name = $data[0];
  147 + if (empty ($catalog_name))
  148 + {
  149 + CONTINUE;
  150 + }
  151 +
  152 + // 2 Бренд
  153 + $brand_name = $data[1];
  154 + if (empty ($brand_name))
  155 + {
  156 + CONTINUE;
  157 + }
  158 +
  159 + // 3 Название товара
  160 + $product_name = $data[2];
  161 + if (empty ($product_name))
  162 + {
  163 + CONTINUE;
  164 + }
  165 +
  166 + // 4 Описание Укр
  167 + $product_body_uk = $data[3];
  168 +
  169 + // 5 Описание Рус
  170 + $product_body_ru = $data[4];
  171 +
  172 + // 6 Фильтр (через запятую)
  173 + $filters = explode (',', $data[5]);
  174 +
  175 + // 7 Доп фильтр через запятую
  176 + $filters_extra = explode (',', $data[6]);
  177 +
  178 + // 8 Пол череззапятую (мужской, женский, детский, унисекс)
  179 + $gender = explode (',', $data[7]);
  180 +
  181 + // 9 Год
  182 + $years = explode (',', $data[8]);
  183 +
  184 + // 10 Цена старая
  185 + $product_cost_old = $data[9];
  186 +
  187 + // 11 Цена
  188 + $produc_cost = $data[10];
  189 +
  190 + // 12 Акция
  191 + $product_akciya = (bool)$data[11];
  192 +
  193 + // 13 Сопуд. Тов.
  194 + $similar = explode (',', $data[12]);
  195 +
  196 + // 14 Новинки
  197 + $product_new = (bool)$data[13];
  198 +
  199 + // 15 Топ продаж
  200 + $product_top = (bool)$data[14];
  201 +
  202 + // 16 Сетка Характеристик
  203 + $feature = explode ('=', $data[15]);
  204 +
  205 + // 17 ВИДЕО КОД
  206 + $product_video = $data[16];
  207 +
  208 + // 18 Галлерея фото
  209 + $fotos = explode (',', $data[17]);
  210 +
  211 + // 19 Штрих код товара.
  212 + // расшифровал - это модификации товара!
  213 +
  214 + $product_image = explode ('=', $data[18]);
  215 + $product_image = @$product_image[3];
  216 +
  217 + if ( ($_product = Product::find()->filterWhere(['ilike', 'name', trim($product_name)])->one()) === null ) {
  218 + $_product = new Product();
  219 + }
  220 +
  221 + // ==== Set category ====
  222 + if ( ($category = Category::find()->filterWhere(['ilike', 'name', trim($catalog_name)])->one()) !== null ) {
  223 + $_product->categories = [$category->category_id];
  224 + } else {
  225 + // Create category
  226 + $category = new Category();
  227 + $category->name = trim($catalog_name);
  228 + $category->save();
  229 + $_product->categories = [$category->category_id];
  230 + }
  231 +
  232 + // ===== Set brand ====
  233 + if ( $brand_name ) {
  234 + if ( ($brand = Brand::find()->filterWhere(['ilike', 'name', trim($brand_name)])->one()) !== null ) {
  235 + $_product->brand_id = $brand->brand_id;
  236 + } else {
  237 + // Create brand
  238 + $brand = new Brand();
  239 + $brand->name = trim($brand_name);
  240 + $brand->save();
  241 + $_product->brand_id = $brand->brand_id;
  242 + }
  243 + }
  244 +
  245 + $_product->name = $product_name;
  246 + $_product->video = $product_video;
  247 + $_product->description = $product_body_ru;
  248 + $_product->top = $product_top;
  249 + $_product->akciya = $product_akciya;
  250 + $_product->new = $product_new;
  251 +
  252 +
  253 + $_product->save();
  254 +
  255 +
  256 + // @todo Set image
  257 + /*// картинки
  258 + if (is_file ($dir.'/mod/' . $product_image))
  259 + {
  260 + $resizeObj = new resize ($dir.'/mod/' . $product_image);
  261 + $resizeObj->resizeImage (135, 200, 'auto');
  262 + $resizeObj->saveImage ($dir.'/products/ico/' . $product_image, 100);
  263 + $resizeObj->resizeImage (370, 370, 'auto');
  264 + $resizeObj->saveImage ($dir.'/products/big/' . $product_image, 100);
  265 + }*/
  266 +
  267 + // ==== mods ====
  268 +
  269 + // (типа штрих код товара)
  270 +
  271 + // нужно для проставления характеристик относящихся к модификациям
  272 + $MOD_ARRAY = [];
  273 +
  274 + for ($i = 18; $i < count ($data); $i ++)
  275 + {
  276 + if (! empty ($data[$i]))
  277 + {
  278 + $mod_arr = explode ('=', $data[$i]);
  279 + $mod_art = $mod_arr[0];
  280 + $mod_size = $mod_arr[1];
  281 + $mod_color = $mod_arr[2];
  282 + $mod_image = $mod_arr[3];
  283 + $mod_cost = $produc_cost;
  284 + $mod_old_cost = $product_cost_old;
  285 +
  286 + // Check product variant
  287 + if ( ($_productVariant = ProductVariant::find()->andWhere(['ilike', 'sku', $mod_art])->andWhere(['product_id' => $_product->product_id])->one()) === null ) {
  288 + $_productVariant = new ProductVariant();
  289 + $_productVariant->product_id = $_product->product_id;
  290 + }
  291 +
  292 + $_productVariant->sku = $mod_art;
  293 + $_productVariant->price = $mod_cost;
  294 + $_productVariant->price_old = $mod_old_cost;
  295 +
  296 + $_productVariant->save();
  297 +
  298 + $MOD_ARRAY[] = $_productVariant->product_variant_id;
  299 +
  300 +
  301 + $dir = Yii::getAlias('@productsDir').'/';
  302 + if (is_file ($dir . $mod_image))
  303 + {
  304 + $resizeObj = new resize ($dir . $mod_image);
  305 + $resizeObj->resizeImage (40, 40, 'crop');
  306 + $resizeObj->saveImage ($dir.'ico/' . $mod_image, 100);
  307 + $resizeObj->resizeImage (370, 370, 'auto');
  308 + $resizeObj->saveImage ($dir.'/big/' . $mod_image, 100);
  309 + }
  310 +
  311 + $product_variant_type_name = '';
  312 + if (! empty ($mod_color))
  313 + $product_variant_type_name = 'Цвет';
  314 + elseif (! empty ($mod_size))
  315 + $product_variant_type_name = 'Размер';
  316 +
  317 + // ===== Set variant type ====
  318 + if ( $product_variant_type_name ) {
  319 + if ( ($product_variant_type = ProductVariantType::find()->filterWhere(['ilike', 'name', $product_variant_type_name])->one()) !== null ) {
  320 + $_productVariant->product_variant_type_id = $product_variant_type->product_variant_type_id;
  321 + } else {
  322 + // Create brand
  323 + $product_variant_type = new ProductVariantType();
  324 + $product_variant_type->name = $product_variant_type_name;
  325 + $product_variant_type->save();
  326 + $_productVariant->product_variant_type_id = $product_variant_type->product_variant_type_id;
  327 + }
  328 + }
  329 + }
  330 + }
  331 +
  332 + /*// ==== fotos ====
  333 +
  334 + foreach ($fotos as $foto)
  335 + {
  336 + $fields = [
  337 + 'product_id' => $product_id,
  338 + 'image' => $foto
  339 + ];
  340 +
  341 + $modelFotos = Fotos::find ()
  342 + ->where ('image=:image', [
  343 + ':image' => $foto
  344 + ])
  345 + ->one ();
  346 +
  347 + if (empty ($modelFotos->id))
  348 + {
  349 + $db->createCommand ()
  350 + ->insert ('products_fotos', $fields)
  351 + ->execute ();
  352 + }
  353 + else
  354 + {
  355 + $db->createCommand ()
  356 + ->update ('products_fotos', $fields, 'id = ' . $modelFotos->id)
  357 + ->execute ();
  358 + }
  359 +
  360 + if (is_file ($dir.'/fotos/' . $foto))
  361 + {
  362 + $resizeObj = new resize ($dir.'/fotos/' . $foto);
  363 + $resizeObj->resizeImage (100, 100, 'crop');
  364 + $resizeObj->saveImage ($dir.'/fotos/ico/' . $foto, 100);
  365 + $resizeObj->resizeImage (400, 400, 'crop');
  366 + $resizeObj->saveImage ($dir.'/fotos/big/' . $foto, 100);
  367 + }
  368 + }*/
  369 +
  370 + // ========================
  371 + // ==== ХАРАКТЕРИСТИКИ ====
  372 + // ========================
  373 +
  374 + // есть общие характеристики, которые относятся product_id, такие как brand, gender...
  375 + // есть характеристики, которые относятся mod_id, такие как цвет, размер...
  376 +
  377 + // ==== gender ====
  378 +
  379 + /*if (! empty ($gender))
  380 + {
  381 + $bookGender = Book::find ()
  382 + ->where ('book_alias=:book', [
  383 + ':book' => 'gender'
  384 + ])
  385 + ->one ();
  386 +
  387 + foreach ($gender as $filter)
  388 + {
  389 + if (! empty ($filter))
  390 + {
  391 + $bookGenderValue = BookValue::find ()
  392 + ->where ('
  393 + book_id=:book
  394 + AND book_value_title=:value
  395 + AND book_value_alias=:alias
  396 + ', [
  397 + ':book' => $bookGender->book_id,
  398 + ':value' => $filter,
  399 + ':alias' => Translite::rusencode ($filter),
  400 + ]
  401 + )
  402 + ->one();
  403 +
  404 + if (! isset ($bookGenderValue->book_value_id) || empty ($bookGenderValue->book_value_id))
  405 + {
  406 + $db->createCommand ()
  407 + ->insert (BookValue::tableName (), [
  408 + 'book_id' => $bookGender->book_id,
  409 + 'book_value_title' => $filter,
  410 + 'book_value_alias' => Translite::rusencode ($filter),
  411 + ])
  412 + ->execute ();
  413 +
  414 + $book_value_id = Yii::$app->db->lastInsertID;
  415 + }
  416 + else
  417 + {
  418 + $book_value_id = $bookGenderValue->book_value_id;
  419 + }
  420 +
  421 + // + products_value
  422 + $db->createCommand ('
  423 + INSERT IGNORE products_value
  424 + SET
  425 + product_id = '.(int)$product_id.',
  426 + book_value_id = '.(int)$book_value_id.'
  427 + ')
  428 + ->execute ();
  429 + }
  430 + }
  431 + }
  432 +
  433 + // есть характеристики, которые относятся mod_id, такие как цвет, размер...
  434 +
  435 + // ==== destination ====
  436 +
  437 + if (! empty ($filters))
  438 + {
  439 + $bookDestination = Book::find ()
  440 + ->where ('book_alias=:book', [
  441 + ':book' => 'destination'
  442 + ])
  443 + ->one ();
  444 +
  445 + foreach ($filters as $filter)
  446 + {
  447 + if (! empty ($filter))
  448 + {
  449 + $bookDestinationValue = BookValue::find ()
  450 + ->where ('
  451 + book_id=:book
  452 + AND book_value_title=:value
  453 + AND book_value_alias=:alias
  454 + ', [
  455 + ':book' => $bookDestination->book_id,
  456 + ':value' => $filter,
  457 + ':alias' => Translite::rusencode ($filter),
  458 + ]
  459 + )
  460 + ->one();
  461 +
  462 + if (! isset ($bookDestinationValue->book_value_id) || empty ($bookDestinationValue->book_value_id))
  463 + {
  464 + $db->createCommand ()
  465 + ->insert (BookValue::tableName (), [
  466 + 'book_id' => $bookDestination->book_id,
  467 + 'book_value_title' => $filter,
  468 + 'book_value_alias' => Translite::rusencode ($filter),
  469 + ])
  470 + ->execute ();
  471 +
  472 + $book_value_id = Yii::$app->db->lastInsertID;
  473 + }
  474 + else
  475 + {
  476 + $book_value_id = $bookDestinationValue->book_value_id;
  477 + }
  478 +
  479 + if (! empty ($MOD_ARRAY))
  480 + {
  481 + foreach ($MOD_ARRAY as $id)
  482 + {
  483 + // + products_value
  484 + $db->createCommand ('
  485 + INSERT IGNORE mod_value
  486 + SET
  487 + mod_id = '.(int)$id.',
  488 + book_value_id = '.(int)$book_value_id.'
  489 + ')
  490 + ->execute ();
  491 + }
  492 + }
  493 + }
  494 + }
  495 + }
  496 +
  497 + // ==== special ====
  498 +
  499 + if (! empty ($filters_extra))
  500 + {
  501 + $bookSpecial = Book::find ()
  502 + ->where ('book_alias=:book', [
  503 + ':book' => 'special'
  504 + ])
  505 + ->one ();
  506 +
  507 + foreach ($filters_extra as $filter)
  508 + {
  509 + if (! empty ($filter))
  510 + {
  511 + $bookSpecialValue = BookValue::find ()
  512 + ->where ('
  513 + book_id=:book
  514 + AND book_value_title=:value
  515 + AND book_value_alias=:alias
  516 + ', [
  517 + ':book' => $bookSpecial->book_id,
  518 + ':value' => $filter,
  519 + ':alias' => Translite::rusencode ($filter),
  520 + ]
  521 + )
  522 + ->one();
  523 +
  524 + if (! isset ($bookSpecialValue->book_value_id) || empty ($bookSpecialValue->book_value_id))
  525 + {
  526 + $db->createCommand ()
  527 + ->insert (BookValue::tableName (), [
  528 + 'book_id' => $bookSpecial->book_id,
  529 + 'book_value_title' => $filter,
  530 + 'book_value_alias' => Translite::rusencode ($filter),
  531 + ])
  532 + ->execute ();
  533 +
  534 + $book_value_id = Yii::$app->db->lastInsertID;
  535 + }
  536 + else
  537 + {
  538 + $book_value_id = $bookSpecialValue->book_value_id;
  539 + }
  540 +
  541 + if (! empty ($MOD_ARRAY))
  542 + {
  543 + foreach ($MOD_ARRAY as $id)
  544 + {
  545 + // + products_value
  546 + $db->createCommand ('
  547 + INSERT IGNORE mod_value
  548 + SET
  549 + mod_id = '.(int)$id.',
  550 + book_value_id = '.(int)$book_value_id.'
  551 + ')
  552 + ->execute ();
  553 + }
  554 + }
  555 + }
  556 + }
  557 + }
  558 +
  559 + // ==== year ====
  560 +
  561 + if (! empty ($years))
  562 + {
  563 + $bookYear = Book::find ()
  564 + ->where ('book_alias=:book', [
  565 + ':book' => 'year'
  566 + ])
  567 + ->one ();
  568 +
  569 + foreach ($years as $filter)
  570 + {
  571 + if (! empty ($filter))
  572 + {
  573 + $bookYearValue = BookValue::find ()
  574 + ->where ('
  575 + book_id=:book
  576 + AND book_value_title=:value
  577 + AND book_value_alias=:alias
  578 + ', [
  579 + ':book' => $bookYear->book_id,
  580 + ':value' => $filter,
  581 + ':alias' => Translite::rusencode ($filter),
  582 + ]
  583 + )
  584 + ->one();
  585 +
  586 + if (! isset ($bookYearValue->book_value_id) || empty ($bookYearValue->book_value_id))
  587 + {
  588 + $db->createCommand ()
  589 + ->insert (BookValue::tableName (), [
  590 + 'book_id' => $bookYear->book_id,
  591 + 'book_value_title' => $filter,
  592 + 'book_value_alias' => Translite::rusencode ($filter),
  593 + ])
  594 + ->execute ();
  595 +
  596 + $book_value_id = Yii::$app->db->lastInsertID;
  597 + }
  598 + else
  599 + {
  600 + $book_value_id = $bookYearValue->book_value_id;
  601 + }
  602 +
  603 + if (! empty ($MOD_ARRAY))
  604 + {
  605 + foreach ($MOD_ARRAY as $id)
  606 + {
  607 + // + products_value
  608 + $db->createCommand ('
  609 + INSERT IGNORE mod_value
  610 + SET
  611 + mod_id = '.(int)$id.',
  612 + book_value_id = '.(int)$book_value_id.'
  613 + ')
  614 + ->execute ();
  615 + }
  616 + }
  617 + }
  618 + }
  619 + }
  620 +
  621 + // ==== $feature ====
  622 +
  623 + if (! empty ($feature))
  624 + {
  625 + foreach ($feature as $string)
  626 + {
  627 + $string = str_replace([':', '.'], '', $string);
  628 +
  629 + if (! empty ($string))
  630 + {
  631 + list ($book_title, $value_title) = explode ('*', $string);
  632 +
  633 + $book_title = trim ($book_title);
  634 + $value_title = trim ($value_title);
  635 +
  636 + if (empty ($book_title) || empty ($value_title))
  637 + {
  638 + CONTINUE;
  639 + }
  640 +
  641 + $bookFeature = Book::find ()
  642 + ->where ('book_title=:book', [
  643 + ':book' => $book_title
  644 + ])
  645 + ->one ();
  646 +
  647 + if (! isset ($bookFeature->book_id) || empty ($bookFeature->book_id))
  648 + {
  649 + $db->createCommand ()
  650 + ->insert (Book::tableName (), [
  651 + 'book_title' => $book_title,
  652 + 'book_alias' => Translite::rusencode ($book_title),
  653 + ])
  654 + ->execute ();
  655 +
  656 + $book_id = Yii::$app->db->lastInsertID;
  657 + }
  658 + else
  659 + {
  660 + $book_id = $bookFeature->book_id;
  661 + }
  662 +
  663 + $bookFeatureValue = BookValue::find ()
  664 + ->where ('
  665 + book_id=:book
  666 + AND book_value_title=:value
  667 + AND book_value_alias=:alias
  668 + ', [
  669 + ':book' => $book_id,
  670 + ':value' => $value_title,
  671 + ':alias' => Translite::rusencode ($value_title),
  672 + ]
  673 + )
  674 + ->one();
  675 +
  676 + if (! isset ($bookFeatureValue->book_value_id) || empty ($bookFeatureValue->book_value_id))
  677 + {
  678 + $db->createCommand ()
  679 + ->insert (BookValue::tableName (), [
  680 + 'book_id' => $book_id,
  681 + 'book_value_title' => $value_title,
  682 + 'book_value_alias' => Translite::rusencode ($value_title),
  683 + ])
  684 + ->execute ();
  685 +
  686 + $book_value_id = Yii::$app->db->lastInsertID;
  687 + }
  688 + else
  689 + {
  690 + $book_value_id = $bookFeatureValue->book_value_id;
  691 + }
  692 +
  693 + if (! empty ($MOD_ARRAY))
  694 + {
  695 + foreach ($MOD_ARRAY as $id)
  696 + {
  697 + // + products_value
  698 + $db->createCommand ('
  699 + INSERT IGNORE mod_value
  700 + SET
  701 + mod_id = '.(int)$id.',
  702 + book_value_id = '.(int)$book_value_id.'
  703 + ')
  704 + ->execute ();
  705 + }
  706 + }
  707 + }
  708 + }
  709 + }*/
  710 +
  711 + // ==== IMPORTANT ====
  712 +
  713 + // записуем ID обработанной записи
  714 +
  715 + $_product->save();
  716 + var_dump("$j: Product {$_product->name} saved\n");
  717 + if ($j > 100) {
  718 + var_dump("Dev OK");
  719 + exit;
  720 + }
  721 + }
  722 +
  723 + fclose ($handle);
  724 + }
  725 + }
  726 +}
... ...
backend/controllers/SliderController.php 0 → 100755
  1 +++ a/backend/controllers/SliderController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use common\models\TemplateLocation;
  6 +use Yii;
  7 +use common\models\Slider;
  8 +use common\models\SliderSearch;
  9 +use yii\helpers\ArrayHelper;
  10 +use yii\web\Controller;
  11 +use yii\web\NotFoundHttpException;
  12 +use yii\filters\VerbFilter;
  13 +use developeruz\db_rbac\behaviors\AccessBehavior;
  14 +/**
  15 + * SliderController implements the CRUD actions for Slider model.
  16 + */
  17 +class SliderController extends Controller
  18 +{
  19 + /**
  20 + * @inheritdoc
  21 + */
  22 + public function behaviors()
  23 + {
  24 + return [
  25 + 'access'=>[
  26 + 'class' => AccessBehavior::className(),
  27 + 'rules' =>
  28 + ['site' =>
  29 + [
  30 + [
  31 + 'actions' => ['login', 'error'],
  32 + 'allow' => true,
  33 + ]
  34 + ]
  35 + ]
  36 + ],
  37 + 'verbs' => [
  38 + 'class' => VerbFilter::className(),
  39 + 'actions' => [
  40 + 'delete' => ['POST'],
  41 + ],
  42 + ],
  43 + ];
  44 + }
  45 +
  46 + /**
  47 + * Lists all Slider models.
  48 + * @return mixed
  49 + */
  50 + public function actionIndex()
  51 + {
  52 + $searchModel = new SliderSearch();
  53 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  54 +
  55 + return $this->render('index', [
  56 + 'searchModel' => $searchModel,
  57 + 'dataProvider' => $dataProvider,
  58 + ]);
  59 + }
  60 +
  61 + /**
  62 + * Displays a single Slider model.
  63 + * @param integer $id
  64 + * @return mixed
  65 + */
  66 + public function actionView($id)
  67 + {
  68 + return $this->render('view', [
  69 + 'model' => $this->findModel($id),
  70 + ]);
  71 + }
  72 +
  73 + /**
  74 + * Creates a new Slider model.
  75 + * If creation is successful, the browser will be redirected to the 'view' page.
  76 + * @return mixed
  77 + */
  78 + public function actionCreate()
  79 + {
  80 + $model = new Slider();
  81 +
  82 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  83 + return $this->redirect(['view', 'id' => $model->slider_id]);
  84 + } else {
  85 +
  86 +
  87 + return $this->render('create', [
  88 + 'model' => $model,
  89 + ]);
  90 + }
  91 + }
  92 +
  93 + /**
  94 + * Updates an existing Slider model.
  95 + * If update is successful, the browser will be redirected to the 'view' page.
  96 + * @param integer $id
  97 + * @return mixed
  98 + */
  99 + public function actionUpdate($id)
  100 + {
  101 + $model = $this->findModel($id);
  102 +
  103 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  104 + return $this->redirect(['view', 'id' => $model->slider_id]);
  105 + } else {
  106 + return $this->render('update', [
  107 + 'model' => $model,
  108 + ]);
  109 + }
  110 + }
  111 +
  112 + /**
  113 + * Deletes an existing Slider model.
  114 + * If deletion is successful, the browser will be redirected to the 'index' page.
  115 + * @param integer $id
  116 + * @return mixed
  117 + */
  118 + public function actionDelete($id)
  119 + {
  120 + $this->findModel($id)->delete();
  121 +
  122 + return $this->redirect(['index']);
  123 + }
  124 +
  125 + /**
  126 + * Finds the Slider model based on its primary key value.
  127 + * If the model is not found, a 404 HTTP exception will be thrown.
  128 + * @param integer $id
  129 + * @return Slider the loaded model
  130 + * @throws NotFoundHttpException if the model cannot be found
  131 + */
  132 + protected function findModel($id)
  133 + {
  134 + if (($model = Slider::findOne($id)) !== null) {
  135 + return $model;
  136 + } else {
  137 + throw new NotFoundHttpException('The requested page does not exist.');
  138 + }
  139 + }
  140 +}
... ...
backend/controllers/SliderImageController.php 0 → 100755
  1 +++ a/backend/controllers/SliderImageController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +use developeruz\db_rbac\behaviors\AccessBehavior;
  5 +use common\models\Slider;
  6 +use Yii;
  7 +use common\models\SliderImage;
  8 +use common\models\SliderImageSearch;
  9 +use yii\web\Controller;
  10 +use yii\web\NotFoundHttpException;
  11 +use yii\filters\VerbFilter;
  12 +use yii\web\UploadedFile;
  13 +/**
  14 + * SliderImageController implements the CRUD actions for SliderImage model.
  15 + */
  16 +class SliderImageController extends Controller
  17 +{
  18 + /**
  19 + * @inheritdoc
  20 + */
  21 + public function behaviors()
  22 + {
  23 + return [
  24 + 'access'=>[
  25 + 'class' => AccessBehavior::className(),
  26 + 'rules' =>
  27 + ['site' =>
  28 + [
  29 + [
  30 + 'actions' => ['login', 'error'],
  31 + 'allow' => true,
  32 + ]
  33 + ]
  34 + ]
  35 + ],
  36 + 'verbs' => [
  37 + 'class' => VerbFilter::className(),
  38 + 'actions' => [
  39 + 'delete' => ['POST'],
  40 + ],
  41 + ],
  42 + ];
  43 + }
  44 +
  45 + /**
  46 + * Lists all SliderImage models.
  47 + * @param $slider_id Slider id
  48 + * @return mixed
  49 + */
  50 + public function actionIndex($slider_id)
  51 + {
  52 + $searchModel = new SliderImageSearch();
  53 + $dataProvider = $searchModel->search($slider_id, Yii::$app->request->queryParams);
  54 +
  55 + return $this->render('index', [
  56 + 'slider_id' => $slider_id,
  57 + 'searchModel' => $searchModel,
  58 + 'dataProvider' => $dataProvider,
  59 + ]);
  60 + }
  61 +
  62 + /**
  63 + * Displays a single SliderImage model.
  64 + * @param integer $id
  65 + * @param $slider_id Slider id
  66 + * @return mixed
  67 + */
  68 + public function actionView($slider_id, $id)
  69 + {
  70 + return $this->render('view', [
  71 + 'slider_id' => $slider_id,
  72 + 'model' => $this->findModel($slider_id, $id),
  73 + ]);
  74 + }
  75 +
  76 + /**
  77 + * Creates a new SliderImage model.
  78 + * If creation is successful, the browser will be redirected to the 'view' page.
  79 + * @param $slider_id Slider id
  80 + * @return mixed
  81 + */
  82 + public function actionCreate($slider_id)
  83 + {
  84 + $model = new SliderImage();
  85 +
  86 + if ($model->load(Yii::$app->request->post())) {
  87 + $model->slider_id = $slider_id;
  88 + if ( ($image = UploadedFile::getInstance($model, 'image')) ) {
  89 + $model->image = $image->name;
  90 + }
  91 + if ($model->save() && $image) {
  92 +
  93 + $imgDir = Yii::getAlias('@storage/slider/');
  94 +
  95 + if(!is_dir($imgDir)) {
  96 + mkdir($imgDir, 0755, true);
  97 + }
  98 +
  99 + $image->saveAs(Yii::getAlias('@storage/slider/' . $image->name));
  100 + }
  101 + return $this->redirect(['view', 'slider_id'=>$slider_id, 'id' => $model->slider_image_id]);
  102 + } else {
  103 +
  104 + $slider = Slider::findOne($slider_id);
  105 +
  106 + return $this->render('create', [
  107 + 'slider_id' => $slider_id,
  108 + 'model' => $model,
  109 + 'slider' => $slider,
  110 + ]);
  111 + }
  112 + }
  113 +
  114 + /**
  115 + * Updates an existing SliderImage model.
  116 + * If update is successful, the browser will be redirected to the 'view' page.
  117 + * @param $slider_id Slider id
  118 + * @param integer $id
  119 + * @return mixed
  120 + */
  121 + public function actionUpdate($slider_id, $id)
  122 + {
  123 + $model = $this->findModel($slider_id, $id);
  124 +
  125 + if ($model->load(Yii::$app->request->post())) {
  126 +
  127 +
  128 +
  129 + if ( ($image = UploadedFile::getInstance($model, 'image')) ) {
  130 + $model->image = $image->name;
  131 + }
  132 +
  133 + if(!$model->image){
  134 + $model->image = $model->getOldAttribute('image');
  135 + }
  136 +
  137 + if ($model->save() && $image) {
  138 + $imgDir = Yii::getAlias('@storage/slider/');
  139 +
  140 + if(!is_dir($imgDir)) {
  141 + mkdir($imgDir, 0755, true);
  142 + }
  143 +
  144 + $image->saveAs(Yii::getAlias('@storage/slider/' . $image->name));
  145 + }
  146 + return $this->redirect(['view', 'slider_id'=>$slider_id, 'id' => $model->slider_image_id]);
  147 + } else {
  148 +
  149 + $slider = Slider::findOne($slider_id);
  150 + return $this->render('update', [
  151 + 'model' => $model,
  152 + 'slider_id' => $slider_id,
  153 + 'slider' => $slider,
  154 + ]);
  155 + }
  156 + }
  157 +
  158 + /**
  159 + * Deletes an existing SliderImage model.
  160 + * If deletion is successful, the browser will be redirected to the 'index' page.
  161 + * @param $slider_id Slider id
  162 + * @param integer $id
  163 + * @return mixed
  164 + */
  165 + public function actionDelete($slider_id, $id)
  166 + {
  167 + $this->findModel($slider_id, $id)->delete();
  168 +
  169 + return $this->redirect(['index','slider_id'=>$slider_id]);
  170 + }
  171 +
  172 + /**
  173 + * Finds the SliderImage model based on its primary key value.
  174 + * If the model is not found, a 404 HTTP exception will be thrown.
  175 + * @param $slider_id Slider id
  176 + * @param integer $id
  177 + * @return SliderImage the loaded model
  178 + * @throws NotFoundHttpException if the model cannot be found
  179 + */
  180 + protected function findModel($slider_id,$id)
  181 + {
  182 + if (($model = SliderImage::find()->where(['slider_image_id'=> $id, 'slider_id'=>$slider_id])->one()) !== null) {
  183 + return $model;
  184 + } else {
  185 + throw new NotFoundHttpException('The requested page does not exist.');
  186 + }
  187 + }
  188 +}
... ...
backend/controllers/SubscribeController.php 0 → 100755
  1 +++ a/backend/controllers/SubscribeController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use Yii;
  6 +use common\models\Subscribe;
  7 +use common\models\SubscribeSearch;
  8 +use yii\web\Controller;
  9 +use yii\web\NotFoundHttpException;
  10 +use yii\filters\VerbFilter;
  11 +use developeruz\db_rbac\behaviors\AccessBehavior;
  12 +/**
  13 + * SubscribeController implements the CRUD actions for Subscribe model.
  14 + */
  15 +class SubscribeController extends Controller
  16 +{
  17 + /**
  18 + * @inheritdoc
  19 + */
  20 + public function behaviors()
  21 + {
  22 + return [
  23 + 'access'=>[
  24 + 'class' => AccessBehavior::className(),
  25 + 'rules' =>
  26 + ['site' =>
  27 + [
  28 + [
  29 + 'actions' => ['login', 'error'],
  30 + 'allow' => true,
  31 + ]
  32 + ]
  33 + ]
  34 + ],
  35 + 'verbs' => [
  36 + 'class' => VerbFilter::className(),
  37 + 'actions' => [
  38 + 'delete' => ['POST'],
  39 + ],
  40 + ],
  41 + ];
  42 + }
  43 +
  44 + /**
  45 + * Lists all Subscribe models.
  46 + * @return mixed
  47 + */
  48 + public function actionIndex()
  49 + {
  50 + $searchModel = new SubscribeSearch();
  51 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  52 +
  53 + return $this->render('index', [
  54 + 'searchModel' => $searchModel,
  55 + 'dataProvider' => $dataProvider,
  56 + ]);
  57 + }
  58 +
  59 + /**
  60 + * Displays a single Subscribe model.
  61 + * @param integer $id
  62 + * @return mixed
  63 + */
  64 + public function actionView($id)
  65 + {
  66 + return $this->render('view', [
  67 + 'model' => $this->findModel($id),
  68 + ]);
  69 + }
  70 +
  71 + /**
  72 + * Creates a new Subscribe model.
  73 + * If creation is successful, the browser will be redirected to the 'view' page.
  74 + * @return mixed
  75 + */
  76 + public function actionCreate()
  77 + {
  78 + $model = new Subscribe();
  79 +
  80 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  81 + return $this->redirect(['view', 'id' => $model->id]);
  82 + } else {
  83 + return $this->render('create', [
  84 + 'model' => $model,
  85 + ]);
  86 + }
  87 + }
  88 +
  89 + /**
  90 + * Updates an existing Subscribe model.
  91 + * If update is successful, the browser will be redirected to the 'view' page.
  92 + * @param integer $id
  93 + * @return mixed
  94 + */
  95 + public function actionUpdate($id)
  96 + {
  97 + $model = $this->findModel($id);
  98 +
  99 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  100 + return $this->redirect(['view', 'id' => $model->id]);
  101 + } else {
  102 + return $this->render('update', [
  103 + 'model' => $model,
  104 + ]);
  105 + }
  106 + }
  107 +
  108 + /**
  109 + * Deletes an existing Subscribe model.
  110 + * If deletion is successful, the browser will be redirected to the 'index' page.
  111 + * @param integer $id
  112 + * @return mixed
  113 + */
  114 + public function actionDelete($id)
  115 + {
  116 + $this->findModel($id)->delete();
  117 +
  118 + return $this->redirect(['index']);
  119 + }
  120 +
  121 + /**
  122 + * Finds the Subscribe model based on its primary key value.
  123 + * If the model is not found, a 404 HTTP exception will be thrown.
  124 + * @param integer $id
  125 + * @return Subscribe the loaded model
  126 + * @throws NotFoundHttpException if the model cannot be found
  127 + */
  128 + protected function findModel($id)
  129 + {
  130 + if (($model = Subscribe::findOne($id)) !== null) {
  131 + return $model;
  132 + } else {
  133 + throw new NotFoundHttpException('The requested page does not exist.');
  134 + }
  135 + }
  136 +}
... ...
backend/controllers/UserController.php 0 → 100755
  1 +++ a/backend/controllers/UserController.php
  1 +<?php
  2 +
  3 +namespace backend\controllers;
  4 +
  5 +use Yii;
  6 +use backend\models\User;
  7 +use backend\models\UserSearch;
  8 +use yii\filters\AccessControl;
  9 +use yii\web\Controller;
  10 +use yii\web\NotFoundHttpException;
  11 +use yii\filters\VerbFilter;
  12 +use yii\web\Response;
  13 +use yii\widgets\ActiveForm;
  14 +
  15 +/**
  16 + * UserController implements the CRUD actions for User model.
  17 + */
  18 +class UserController extends Controller
  19 +{
  20 + /**
  21 + * @inheritdoc
  22 + */
  23 + public function behaviors()
  24 + {
  25 +
  26 +
  27 + return [
  28 + 'verbs' => [
  29 + 'class' => VerbFilter::className(),
  30 + 'actions' => [
  31 + 'delete' => ['POST'],
  32 + ],
  33 + ],
  34 + 'access' => [
  35 + 'class' => AccessControl::className(),
  36 + 'rules' => [
  37 + [
  38 + 'allow' => true,
  39 +// 'actions' => ['login', 'signup'],
  40 + 'roles' => ['admin'],
  41 + ],
  42 + [
  43 +// 'allow' => true,
  44 +// 'actions' => ['logout'],
  45 +// 'roles' => ['@'],
  46 + ],
  47 + ],
  48 + ],
  49 + ];
  50 + }
  51 +
  52 + /**
  53 + * Lists all User models.
  54 + * @return mixed
  55 + */
  56 + public function actionIndex()
  57 + {
  58 + $searchModel = new UserSearch();
  59 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  60 +
  61 + return $this->render('index', [
  62 + 'searchModel' => $searchModel,
  63 + 'dataProvider' => $dataProvider,
  64 + ]);
  65 + }
  66 +
  67 + /**
  68 + * Displays a single User model.
  69 + * @param integer $id
  70 + * @return mixed
  71 + */
  72 + public function actionView($id)
  73 + {
  74 + return $this->render('view', [
  75 + 'model' => $this->findModel($id),
  76 + ]);
  77 + }
  78 +
  79 + /**
  80 + * Creates a new User model.
  81 + * If creation is successful, the browser will be redirected to the 'view' page.
  82 + * @return mixed
  83 + */
  84 + public function actionCreate()
  85 + {
  86 + $model = new User();
  87 + if (Yii::$app->request->isAjax) {
  88 + Yii::$app->response->format = Response::FORMAT_JSON;
  89 + $model->load(Yii::$app->request->post());
  90 + return ActiveForm::validate($model);
  91 + }else if ($model->load(Yii::$app->request->post()) && $model->validate()) {
  92 + $model->save();
  93 +
  94 + foreach($model->role as $k => $role){
  95 + $auth = Yii::$app->authManager;
  96 + $authorRole = $auth->getRole($role);
  97 + $auth->assign($authorRole, $model->id);
  98 + }
  99 +
  100 + return $this->redirect(['view', 'id' => $model->id]);
  101 + } else {
  102 + return $this->render('create', [
  103 + 'model' => $model,
  104 + ]);
  105 + }
  106 + }
  107 +
  108 + /**
  109 + * Updates an existing User model.
  110 + * If update is successful, the browser will be redirected to the 'view' page.
  111 + * @param integer $id
  112 + * @return mixed
  113 + */
  114 + public function actionUpdate($id)
  115 + {
  116 + $model = $this->findModel($id);
  117 + if (Yii::$app->request->isAjax) {
  118 + Yii::$app->response->format = Response::FORMAT_JSON;
  119 + $model->load(Yii::$app->request->post());
  120 + return ActiveForm::validate($model);
  121 + }else if ($model->load(Yii::$app->request->post()) && $model->validate()) {
  122 +
  123 + $model->save();
  124 +
  125 + return $this->redirect(['view', 'id' => $model->id]);
  126 + } else {
  127 + return $this->render('create', [
  128 + 'model' => $model,
  129 + ]);
  130 + }
  131 + }
  132 +
  133 + /**
  134 + * Deletes an existing User model.
  135 + * If deletion is successful, the browser will be redirected to the 'index' page.
  136 + * @param integer $id
  137 + * @return mixed
  138 + */
  139 + public function actionDelete($id)
  140 + {
  141 + $this->findModel($id)->delete();
  142 +
  143 + return $this->redirect(['index']);
  144 + }
  145 +
  146 + /**
  147 + * Finds the User model based on its primary key value.
  148 + * If the model is not found, a 404 HTTP exception will be thrown.
  149 + * @param integer $id
  150 + * @return User the loaded model
  151 + * @throws NotFoundHttpException if the model cannot be found
  152 + */
  153 + protected function findModel($id)
  154 + {
  155 + if (($model = User::findOne($id)) !== null) {
  156 + return $model;
  157 + } else {
  158 + throw new NotFoundHttpException('The requested page does not exist.');
  159 + }
  160 + }
  161 +}
... ...
backend/models/.gitkeep 0 → 100755
  1 +++ a/backend/models/.gitkeep
  1 +*
... ...
backend/models/CommentSearch.php 0 → 100755
  1 +++ a/backend/models/CommentSearch.php
  1 +<?php
  2 +
  3 +namespace backend\models;
  4 +
  5 +use Yii;
  6 +use yii\base\Model;
  7 +use yii\data\ActiveDataProvider;
  8 +use common\modules\comment\models\Comment;
  9 +
  10 +/**
  11 + * CommentSearch represents the model behind the search form about `common\modules\comment\models\Comment`.
  12 + */
  13 +class CommentSearch extends Comment
  14 +{
  15 + /**
  16 + * @inheritdoc
  17 + */
  18 + public function rules()
  19 + {
  20 + return [
  21 + [['comment_id', 'user_id', 'comment_pid', 'status', 'model_id'], 'integer'],
  22 + [['text', 'user_name', 'user_email', 'date_add', 'date_update', 'date_delete', 'model'], 'safe'],
  23 + ];
  24 + }
  25 +
  26 + /**
  27 + * @inheritdoc
  28 + */
  29 + public function scenarios()
  30 + {
  31 + // bypass scenarios() implementation in the parent class
  32 + return Model::scenarios();
  33 + }
  34 +
  35 + /**
  36 + * Creates data provider instance with search query applied
  37 + *
  38 + * @param array $params
  39 + *
  40 + * @return ActiveDataProvider
  41 + */
  42 + public function search($params)
  43 + {
  44 + $query = Comment::find();
  45 +
  46 + // add conditions that should always apply here
  47 +
  48 + $dataProvider = new ActiveDataProvider([
  49 + 'query' => $query,
  50 + ]);
  51 +
  52 + $this->load($params);
  53 +
  54 + if (!$this->validate()) {
  55 + // uncomment the following line if you do not want to return any records when validation fails
  56 + // $query->where('0=1');
  57 + return $dataProvider;
  58 + }
  59 +
  60 + // grid filtering conditions
  61 + $query->andFilterWhere([
  62 + 'comment_id' => $this->comment_id,
  63 + 'user_id' => $this->user_id,
  64 + 'comment_pid' => $this->comment_pid,
  65 + 'status' => $this->status,
  66 + 'date_add' => $this->date_add,
  67 + 'date_update' => $this->date_update,
  68 + 'date_delete' => $this->date_delete,
  69 + 'model_id' => $this->model_id,
  70 + ]);
  71 +
  72 + $query->andFilterWhere(['like', 'text', $this->text])
  73 + ->andFilterWhere(['like', 'user_name', $this->user_name])
  74 + ->andFilterWhere(['like', 'user_email', $this->user_email])
  75 + ->andFilterWhere(['like', 'model', $this->model]);
  76 +
  77 + return $dataProvider;
  78 + }
  79 +}
... ...
backend/models/Label.php 0 → 100755
  1 +++ a/backend/models/Label.php
  1 +<?php
  2 +
  3 +namespace backend\models;
  4 +use Yii;
  5 +
  6 +
  7 +class Label extends \yii\db\ActiveRecord
  8 +{
  9 +
  10 + public static function tableName()
  11 + {
  12 + return 'orders_label';
  13 + }
  14 +
  15 +
  16 + public function getNl(){
  17 + return $this->name;
  18 + }
  19 +
  20 +
  21 +
  22 +
  23 +
  24 +
  25 +}
... ...
backend/models/LoginForm.php 0 → 100755
  1 +++ a/backend/models/LoginForm.php
  1 +<?php
  2 +namespace backend\models;
  3 +
  4 +use common\models\User;
  5 +use Yii;
  6 +use yii\base\Model;
  7 +
  8 +/**
  9 + * Login form
  10 + */
  11 +class LoginForm extends Model
  12 +{
  13 + public $username;
  14 + public $password;
  15 + public $rememberMe = true;
  16 +
  17 + private $_user;
  18 +
  19 +
  20 + /**
  21 + * @inheritdoc
  22 + */
  23 + public function rules()
  24 + {
  25 + return [
  26 + // username and password are both required
  27 + [['username', 'password'], 'required'],
  28 + // rememberMe must be a boolean value
  29 + ['rememberMe', 'boolean'],
  30 + // password is validated by validatePassword()
  31 + ['password', 'validatePassword'],
  32 + ];
  33 + }
  34 +
  35 + /**
  36 + * Validates the password.
  37 + * This method serves as the inline validation for password.
  38 + *
  39 + * @param string $attribute the attribute currently being validated
  40 + * @param array $params the additional name-value pairs given in the rule
  41 + */
  42 + public function validatePassword($attribute, $params)
  43 + {
  44 + if (!$this->hasErrors()) {
  45 + $user = $this->getUser();
  46 + if (!$user || !$user->validatePassword($this->password)) {
  47 + $this->addError($attribute, 'Incorrect username or password.');
  48 + }
  49 + }
  50 + }
  51 +
  52 + /**
  53 + * Logs in a user using the provided username and password.
  54 + *
  55 + * @return boolean whether the user is logged in successfully
  56 + */
  57 + public function login()
  58 + {
  59 + if ($this->validate()) {
  60 + return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0);
  61 + } else {
  62 + return false;
  63 + }
  64 + }
  65 +
  66 + /**
  67 + * Finds user by [[username]]
  68 + *
  69 + * @return User|null
  70 + */
  71 + protected function getUser()
  72 + {
  73 + if ($this->_user === null) {
  74 + $this->_user = User::findByUsername($this->username);
  75 + }
  76 +
  77 + return $this->_user;
  78 + }
  79 +
  80 + /**
  81 + * @inheritdoc
  82 + */
  83 + public function attributeLabels()
  84 + {
  85 + return [
  86 +
  87 + 'username' => 'Имя пользователя',
  88 + 'password' => 'Пароль',
  89 + 'rememberMe' => 'Запомнить пароль',
  90 +
  91 + ];
  92 + }
  93 +}
... ...
backend/models/Orders.php 0 → 100755
  1 +++ a/backend/models/Orders.php
  1 +<?php
  2 +
  3 +namespace backend\models;
  4 +use common\models\Customer;
  5 +use Yii;
  6 +
  7 +class Orders extends \yii\db\ActiveRecord
  8 +{
  9 + public $labels;
  10 + public static function tableName()
  11 + {
  12 + return 'orders';
  13 + }
  14 +
  15 + public function rules()
  16 + {
  17 + return [
  18 + [['name'], 'required'],
  19 + [['user_id','adress','body','total','status','email',
  20 + 'comment','labels','pay','date_dedline','phone','phone2','numbercard','delivery',
  21 + 'declaration','stock','consignment','payment', 'insurance',
  22 + 'amount_imposed','shipping_by','city','date_time', 'id' ], 'safe'],
  23 + //[['image'], 'file', 'extensions'=>'jpg, gif, png', 'skipOnEmpty'=>true],
  24 + ];
  25 + }
  26 +
  27 + public function attributeLabels()
  28 + {
  29 + return [
  30 + 'id'=>'№ заказа',
  31 + 'name'=>'ФИО',
  32 + 'phone'=>'Телефон',
  33 + 'phone2'=>'Телефон 2',
  34 + 'adress'=>'Адрес',
  35 + 'body'=>'Сообщение',
  36 + 'reserve'=>'Резерв',
  37 + 'status'=>'Статус',
  38 + 'email'=>'E-mail',
  39 + 'total'=>'Сумма',
  40 + 'labels'=>'Метки',
  41 + 'label'=>'Метка',
  42 + 'comment'=>'Комментарий менеджера',
  43 + 'date_dedline'=>'Дедлайн',
  44 + 'numbercard'=>'№ карточки',
  45 + 'delivery'=>'Доставка',
  46 + 'declaration'=>'Декларация №',
  47 + 'stock'=>'№ склада',
  48 + 'consignment'=>'№ накладной',
  49 + 'payment'=>'Способ оплаты',
  50 + 'insurance'=>'Страховка',
  51 + 'amount_imposed'=>'Сумма наложенного',
  52 + 'shipping_by'=>'Отправка за счет',
  53 + 'city'=>'Город'
  54 + ];
  55 + }
  56 +
  57 + public function beforeSave($insert) {
  58 + return parent::beforeSave($insert);
  59 + }
  60 +
  61 + public function beforeDelete() {
  62 + return parent::beforeDelete();
  63 + }
  64 +
  65 + public function getUser()
  66 + {
  67 + return $this->hasOne(Customer::className(), ['id' => 'user_id']);
  68 + }
  69 +
  70 +
  71 +
  72 +}
0 73 \ No newline at end of file
... ...
backend/models/OrdersProducts.php 0 → 100755
  1 +++ a/backend/models/OrdersProducts.php
  1 +<?php
  2 +
  3 +namespace backend\models;
  4 +use common\modules\product\models\ProductVariant;
  5 +use Yii;
  6 +
  7 +class OrdersProducts extends \yii\db\ActiveRecord
  8 +{
  9 +
  10 + public static function tableName()
  11 + {
  12 + return 'orders_products';
  13 + }
  14 +
  15 + public function rules()
  16 + {
  17 + return [
  18 + [['sku','count','order_id'], 'required'],
  19 + ];
  20 + }
  21 +
  22 + public function attributeLabels()
  23 + {
  24 + return [
  25 + 'product_name'=>'Продукт',
  26 + 'name'=>'Вид',
  27 + 'art'=>'Артикул',
  28 + 'cost'=>'Цена за один',
  29 + 'count'=>'Кол.',
  30 + 'sum_cost'=>'Сумма',
  31 + ];
  32 + }
  33 +
  34 + public function getMod()
  35 + {
  36 + return $this->hasOne(ProductVariant::className(), ['product_variant_id' => 'mod_id']);
  37 + }
  38 +}
0 39 \ No newline at end of file
... ...
backend/models/OrdersSearch.php 0 → 100755
  1 +++ a/backend/models/OrdersSearch.php
  1 +<?php
  2 +
  3 +namespace backend\models;
  4 +
  5 +use Yii;
  6 +use yii\base\Model;
  7 +use yii\data\ActiveDataProvider;
  8 +use backend\models\Orders;
  9 +
  10 +/**
  11 + * OrdersSearch represents the model behind the search form about `backend\models\Orders`.
  12 + */
  13 +class OrdersSearch extends Orders
  14 +{
  15 + /**
  16 + * @inheritdoc
  17 + */
  18 + public function rules()
  19 + {
  20 + return [
  21 + [['id', 'user_id', 'label', 'pay', 'numbercard'], 'integer'],
  22 + [['name', 'phone', 'phone2', 'email', 'adress', 'body', 'date_time', 'date_dedline', 'reserve', 'status', 'comment', 'delivery', 'declaration', 'stock', 'consignment', 'payment', 'insurance', 'shipping_by', 'city'], 'safe'],
  23 + [['total', 'amount_imposed'], 'number'],
  24 + ];
  25 + }
  26 +
  27 + /**
  28 + * @inheritdoc
  29 + */
  30 + public function scenarios()
  31 + {
  32 + // bypass scenarios() implementation in the parent class
  33 + return Model::scenarios();
  34 + }
  35 +
  36 + /**
  37 + * Creates data provider instance with search query applied
  38 + *
  39 + * @param array $params
  40 + *
  41 + * @return ActiveDataProvider
  42 + */
  43 + public function search($params)
  44 + {
  45 + $query = Orders::find();
  46 +
  47 + // add conditions that should always apply here
  48 +
  49 + $dataProvider = new ActiveDataProvider([
  50 + 'query' => $query,
  51 + 'sort'=> ['defaultOrder' => ['id'=>SORT_DESC]],
  52 + 'pagination' => [
  53 + 'pageSize' => 20,
  54 + ]
  55 + ]);
  56 +
  57 + $this->load($params);
  58 +
  59 + if (!$this->validate()) {
  60 + // uncomment the following line if you do not want to return any records when validation fails
  61 + // $query->where('0=1');
  62 + return $dataProvider;
  63 + }
  64 +
  65 + // grid filtering conditions
  66 + $query->andFilterWhere([
  67 + 'id' => $this->id,
  68 + 'user_id' => $this->user_id,
  69 + 'total' => $this->total,
  70 + 'date_time' => $this->date_time,
  71 + 'date_dedline' => $this->date_dedline,
  72 + 'label' => $this->label,
  73 + 'pay' => $this->pay,
  74 + 'numbercard' => $this->numbercard,
  75 + 'amount_imposed' => $this->amount_imposed,
  76 + ]);
  77 +
  78 + $query->andFilterWhere(['like', 'name', $this->name])
  79 + ->andFilterWhere(['like', 'phone', $this->phone])
  80 + ->andFilterWhere(['like', 'phone2', $this->phone2])
  81 + ->andFilterWhere(['like', 'email', $this->email])
  82 + ->andFilterWhere(['like', 'adress', $this->adress])
  83 + ->andFilterWhere(['like', 'body', $this->body])
  84 + ->andFilterWhere(['like', 'reserve', $this->reserve])
  85 + ->andFilterWhere(['like', 'status', $this->status])
  86 + ->andFilterWhere(['like', 'comment', $this->comment])
  87 + ->andFilterWhere(['like', 'delivery', $this->delivery])
  88 + ->andFilterWhere(['like', 'declaration', $this->declaration])
  89 + ->andFilterWhere(['like', 'stock', $this->stock])
  90 + ->andFilterWhere(['like', 'consignment', $this->consignment])
  91 + ->andFilterWhere(['like', 'payment', $this->payment])
  92 + ->andFilterWhere(['like', 'insurance', $this->insurance])
  93 + ->andFilterWhere(['like', 'shipping_by', $this->shipping_by])
  94 + ->andFilterWhere(['like', 'city', $this->city]);
  95 +
  96 + return $dataProvider;
  97 + }
  98 +}
... ...
backend/models/User.php 0 → 100755
  1 +++ a/backend/models/User.php
  1 +<?php
  2 +
  3 +namespace backend\models;
  4 +
  5 +use developeruz\db_rbac\interfaces\UserRbacInterface;
  6 +use common\models\Share;
  7 +use common\modules\comment\models\Comment;
  8 +use common\modules\comment\models\Rating;
  9 +use yii\base\NotSupportedException;
  10 +use Yii;
  11 +use yii\behaviors\TimestampBehavior;
  12 +use yii\db\ActiveRecord;
  13 +use yii\web\IdentityInterface;
  14 +/**
  15 + * This is the model class for table "user".
  16 + *
  17 + * @property integer $id
  18 + * @property string $username
  19 + * @property string $auth_key
  20 + * @property string $password_hash
  21 + * @property string $password_reset_token
  22 + * @property string $email
  23 + * @property integer $status
  24 + * @property integer $created_at
  25 + * @property integer $updated_at
  26 + *
  27 + * @property Comment[] $comments
  28 + * @property Rating[] $ratings
  29 + * @property Share[] $shares
  30 + */
  31 +class User extends ActiveRecord implements UserRbacInterface, IdentityInterface
  32 +{
  33 +
  34 + const STATUS_DELETED = 0;
  35 + const STATUS_ACTIVE = 10;
  36 + public $password;
  37 +
  38 + /**
  39 + * @inheritdoc
  40 + */
  41 + public static function tableName()
  42 + {
  43 + return 'user';
  44 + }
  45 +
  46 + /**
  47 + * @inheritdoc
  48 + */
  49 + public function rules()
  50 + {
  51 + return [
  52 + [['username', 'password', 'email'], 'required'],
  53 + [['status', 'created_at', 'updated_at'], 'integer'],
  54 + [['username', 'password_hash', 'password_reset_token', 'email'], 'string', 'max' => 255],
  55 + [['auth_key'], 'string', 'max' => 32],
  56 + [['password_reset_token'], 'unique'],
  57 + ['email', 'unique', 'targetClass' => '\backend\models\User', 'message' => Yii::t('app','message',[
  58 + 'field' => 'Email'
  59 + ])],
  60 + ];
  61 + }
  62 +
  63 +
  64 + /**
  65 + * @inheritdoc
  66 + */
  67 + public function behaviors()
  68 + {
  69 + return [
  70 + TimestampBehavior::className(),
  71 + [
  72 + 'class' => 'common\behaviors\ShowImage',
  73 + ],
  74 + ];
  75 + }
  76 +
  77 +
  78 + public function beforeSave($insert)
  79 + {
  80 + $this->setPassword($this->password);
  81 + $this->generateAuthKey();
  82 + return parent::beforeSave($insert);
  83 + }
  84 +
  85 +
  86 +
  87 + /**
  88 + * @inheritdoc
  89 + */
  90 + public function attributeLabels()
  91 + {
  92 + return [
  93 + 'id' => 'ID',
  94 + 'username' => 'Username',
  95 + 'auth_key' => 'Auth Key',
  96 + 'password_hash' => 'Password Hash',
  97 + 'password_reset_token' => 'Password Reset Token',
  98 + 'email' => 'Email',
  99 + 'status' => 'Status',
  100 + 'created_at' => 'Created At',
  101 + 'updated_at' => 'Updated At',
  102 + ];
  103 + }
  104 +
  105 +
  106 + /**
  107 + * Generates "remember me" authentication key
  108 + */
  109 + public function generateAuthKey()
  110 + {
  111 + $this->auth_key = Yii::$app->security->generateRandomString();
  112 + }
  113 +
  114 + /**
  115 + * Generates password hash from password and sets it to the model
  116 + *
  117 + * @param string $password
  118 + */
  119 + public function setPassword($password)
  120 + {
  121 + $this->password_hash = Yii::$app->security->generatePasswordHash($password);
  122 + }
  123 +
  124 +
  125 +
  126 +
  127 +
  128 + public function getRole(){
  129 + return !empty($this->id) ? \Yii::$app->authManager->getRolesByUser($this->id) : "";
  130 + }
  131 +
  132 + /**
  133 + * @inheritdoc
  134 + */
  135 + public function getId()
  136 + {
  137 + return $this->getPrimaryKey();
  138 + }
  139 +
  140 + /**
  141 + * @inheritdoc
  142 + */
  143 + public function getAuthKey()
  144 + {
  145 + return $this->auth_key;
  146 + }
  147 +
  148 + /**
  149 + * @inheritdoc
  150 + */
  151 + public function validateAuthKey($authKey)
  152 + {
  153 + return $this->getAuthKey() === $authKey;
  154 + }
  155 +
  156 +
  157 + /**
  158 + * @inheritdoc
  159 + */
  160 + public static function findIdentityByAccessToken($token, $type = null)
  161 + {
  162 + throw new NotSupportedException('"findIdentityByAccessToken" is not implemented.');
  163 + }
  164 +
  165 + /**
  166 + * @inheritdoc
  167 + */
  168 + public static function findIdentity($id)
  169 + {
  170 + return static::findOne(['id' => $id, 'status' => self::STATUS_ACTIVE]);
  171 + }
  172 +
  173 + /**
  174 + * @return \yii\db\ActiveQuery
  175 + */
  176 + public function getComments()
  177 + {
  178 + return $this->hasMany(Comment::className(), ['user_id' => 'id']);
  179 + }
  180 +
  181 + /**
  182 + * @return \yii\db\ActiveQuery
  183 + */
  184 + public function getRatings()
  185 + {
  186 + return $this->hasMany(Rating::className(), ['user_id' => 'id']);
  187 + }
  188 +
  189 + /**
  190 + * @return \yii\db\ActiveQuery
  191 + */
  192 + public function getShares()
  193 + {
  194 + return $this->hasMany(Share::className(), ['user_id' => 'id']);
  195 + }
  196 +
  197 +
  198 + public function getUserName()
  199 + {
  200 + return $this->username;
  201 + }
  202 +
  203 +
  204 +}
... ...
backend/models/UserSearch.php 0 → 100755
  1 +++ a/backend/models/UserSearch.php
  1 +<?php
  2 +
  3 +namespace backend\models;
  4 +
  5 +use Yii;
  6 +use yii\base\Model;
  7 +use yii\data\ActiveDataProvider;
  8 +use backend\models\User;
  9 +
  10 +/**
  11 + * UserSearch represents the model behind the search form about `backend\models\User`.
  12 + */
  13 +class UserSearch extends User
  14 +{
  15 + /**
  16 + * @inheritdoc
  17 + */
  18 + public function rules()
  19 + {
  20 + return [
  21 + [['id', 'status', 'created_at', 'updated_at'], 'integer'],
  22 + [['username', 'auth_key', 'password_hash', 'password_reset_token', 'email'], 'safe'],
  23 + ];
  24 + }
  25 +
  26 + /**
  27 + * @inheritdoc
  28 + */
  29 + public function scenarios()
  30 + {
  31 + // bypass scenarios() implementation in the parent class
  32 + return Model::scenarios();
  33 + }
  34 +
  35 + /**
  36 + * Creates data provider instance with search query applied
  37 + *
  38 + * @param array $params
  39 + *
  40 + * @return ActiveDataProvider
  41 + */
  42 + public function search($params)
  43 + {
  44 + $query = User::find();
  45 +
  46 + // add conditions that should always apply here
  47 +
  48 + $dataProvider = new ActiveDataProvider([
  49 + 'query' => $query,
  50 + ]);
  51 +
  52 + $this->load($params);
  53 +
  54 + if (!$this->validate()) {
  55 + // uncomment the following line if you do not want to return any records when validation fails
  56 + // $query->where('0=1');
  57 + return $dataProvider;
  58 + }
  59 +
  60 + // grid filtering conditions
  61 + $query->andFilterWhere([
  62 + 'id' => $this->id,
  63 + 'status' => $this->status,
  64 + 'created_at' => $this->created_at,
  65 + 'updated_at' => $this->updated_at,
  66 + ]);
  67 +
  68 + $query->andFilterWhere(['like', 'username', $this->username])
  69 + ->andFilterWhere(['like', 'auth_key', $this->auth_key])
  70 + ->andFilterWhere(['like', 'password_hash', $this->password_hash])
  71 + ->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token])
  72 + ->andFilterWhere(['like', 'email', $this->email]);
  73 +
  74 + return $dataProvider;
  75 + }
  76 +}
... ...
backend/views/articles/_form.php 0 → 100755
  1 +++ a/backend/views/articles/_form.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\ActiveForm;
  5 +use common\modules\file\widgets\ImageUploader;
  6 +use mihaildev\ckeditor\CKEditor;
  7 +use mihaildev\elfinder\ElFinder;
  8 +use yii\jui\DatePicker;
  9 +/* @var $this yii\web\View */
  10 +/* @var $model common\models\Articles */
  11 +/* @var $form yii\widgets\ActiveForm */
  12 +?>
  13 +
  14 +<div class="articles-form">
  15 +
  16 + <?php $form = ActiveForm::begin([
  17 + 'enableClientValidation' => false,
  18 + 'options' => ['enctype' => 'multipart/form-data']
  19 + ]); ?>
  20 +
  21 +
  22 + <?= $form->field($model, 'date')
  23 + ->widget(DatePicker::className(), [
  24 + 'dateFormat' => 'yyyy-MM-dd',
  25 + 'clientOptions' => [ 'minDate' => 1 ],
  26 + ]) ?>
  27 + <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
  28 +
  29 + <?= $form->field($model, 'body')->widget(CKEditor::className(),
  30 + [
  31 + 'editorOptions' => ElFinder::ckeditorOptions('elfinder',[
  32 + 'preset' => 'full', //разработанны стандартные настройки basic, standard, full данную возможность не обязательно использовать
  33 + 'inline' => false, //по умолчанию false]),
  34 + 'filebrowserUploadUrl'=>Yii::$app->getUrlManager()->createUrl('file/uploader/images-upload')
  35 + ]
  36 + )
  37 + ]) ?>
  38 +
  39 +
  40 + <?= $form->field($model, 'image')->widget(\kartik\file\FileInput::classname(), [
  41 + 'language' => 'ru',
  42 + 'options' => [
  43 + 'accept' => 'image/*',
  44 + 'multiple' => false,
  45 + ],
  46 + 'pluginOptions' => [
  47 + 'allowedFileExtensions' => ['jpg', 'gif', 'png'],
  48 + 'initialPreview' => !empty($model->imageUrl) ? \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'list') : '',
  49 + 'overwriteInitial' => true,
  50 + 'showRemove' => false,
  51 + 'showUpload' => false,
  52 + 'previewFileType' => 'image',
  53 + ],
  54 + ]); ?>
  55 +
  56 + <?= $form->field($model, 'translit')->textInput(['maxlength' => true]) ?>
  57 +
  58 + <?= $form->field($model, 'meta_title')->textInput(['maxlength' => true]) ?>
  59 +
  60 + <?= $form->field($model, 'meta_keywords')->textInput(['maxlength' => true]) ?>
  61 +
  62 + <?= $form->field($model, 'meta_description')->textInput(['maxlength' => true]) ?>
  63 +
  64 + <?= $form->field($model, 'seo_text')->textarea(['rows' => 6]) ?>
  65 +
  66 + <?= $form->field($model, 'h1')->textInput(['maxlength' => true]) ?>
  67 +
  68 + <div class="form-group">
  69 + <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  70 + </div>
  71 +
  72 + <?php ActiveForm::end(); ?>
  73 +
  74 +</div>
... ...
backend/views/articles/_search.php 0 → 100755
  1 +++ a/backend/views/articles/_search.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\ActiveForm;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\ArticlesSearch */
  8 +/* @var $form yii\widgets\ActiveForm */
  9 +?>
  10 +
  11 +<div class="articles-search">
  12 +
  13 + <?php $form = ActiveForm::begin([
  14 + 'action' => ['index'],
  15 + 'method' => 'get',
  16 + ]); ?>
  17 +
  18 + <?= $form->field($model, 'id') ?>
  19 +
  20 + <?= $form->field($model, 'date') ?>
  21 +
  22 + <?= $form->field($model, 'title') ?>
  23 +
  24 + <?= $form->field($model, 'body') ?>
  25 +
  26 + <?= $form->field($model, 'image') ?>
  27 +
  28 + <?php // echo $form->field($model, 'translit') ?>
  29 +
  30 + <?php // echo $form->field($model, 'meta_title') ?>
  31 +
  32 + <?php // echo $form->field($model, 'meta_keywords') ?>
  33 +
  34 + <?php // echo $form->field($model, 'meta_description') ?>
  35 +
  36 + <?php // echo $form->field($model, 'seo_text') ?>
  37 +
  38 + <?php // echo $form->field($model, 'h1') ?>
  39 +
  40 + <div class="form-group">
  41 + <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
  42 + <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
  43 + </div>
  44 +
  45 + <?php ActiveForm::end(); ?>
  46 +
  47 +</div>
... ...
backend/views/articles/create.php 0 → 100755
  1 +++ a/backend/views/articles/create.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\Articles */
  8 +
  9 +$this->title = 'Create Articles';
  10 +$this->params['breadcrumbs'][] = ['label' => 'Articles', 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="articles-create">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <?= $this->render('_form', [
  18 + 'model' => $model,
  19 + ]) ?>
  20 +
  21 +</div>
... ...
backend/views/articles/index.php 0 → 100755
  1 +++ a/backend/views/articles/index.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\grid\GridView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $searchModel common\models\ArticlesSearch */
  8 +/* @var $dataProvider yii\data\ActiveDataProvider */
  9 +
  10 +$this->title = 'Articles';
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="articles-index" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
  14 +
  15 + <h1 itemprop="title"><?= Html::encode($this->title) ?></h1>
  16 + <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
  17 +
  18 + <p>
  19 + <?= Html::a('Create Articles', ['create'], ['class' => 'btn btn-success']) ?>
  20 + </p>
  21 + <?= GridView::widget([
  22 + 'dataProvider' => $dataProvider,
  23 + 'filterModel' => $searchModel,
  24 + 'columns' => [
  25 + ['class' => 'yii\grid\SerialColumn'],
  26 +
  27 + 'id',
  28 + 'date',
  29 + 'title',
  30 + 'image',
  31 + // 'translit',
  32 + // 'meta_title',
  33 + // 'meta_keywords',
  34 + // 'meta_description',
  35 + // 'seo_text:ntext',
  36 + // 'h1',
  37 +
  38 + ['class' => 'yii\grid\ActionColumn'],
  39 + ],
  40 + ]); ?>
  41 +</div>
... ...
backend/views/articles/update.php 0 → 100755
  1 +++ a/backend/views/articles/update.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +/* @var $this yii\web\View */
  6 +/* @var $model common\models\Articles */
  7 +
  8 +$this->title = 'Update Articles: ' . $model->title;
  9 +$this->params['breadcrumbs'][] = ['label' => 'Articles', 'url' => ['index']];
  10 +$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]];
  11 +$this->params['breadcrumbs'][] = 'Update';
  12 +?>
  13 +<div class="articles-update">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <?= $this->render('_form', [
  18 + 'model' => $model,
  19 + ]) ?>
  20 +
  21 +</div>
... ...
backend/views/articles/view.php 0 → 100755
  1 +++ a/backend/views/articles/view.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\DetailView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\Articles */
  8 +
  9 +$this->title = $model->title;
  10 +$this->params['breadcrumbs'][] = ['label' => 'Articles', 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="articles-view" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
  14 +
  15 + <h1 itemprop="title"><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <p>
  18 + <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
  19 + <?= Html::a('Delete', ['delete', 'id' => $model->id], [
  20 + 'class' => 'btn btn-danger',
  21 + 'data' => [
  22 + 'confirm' => 'Are you sure you want to delete this item?',
  23 + 'method' => 'post',
  24 + ],
  25 + ]) ?>
  26 + </p>
  27 +
  28 + <?= DetailView::widget([
  29 + 'model' => $model,
  30 + 'attributes' => [
  31 + 'id',
  32 + 'date',
  33 + 'title',
  34 + 'translit',
  35 + 'meta_title',
  36 + 'meta_keywords',
  37 + 'meta_description',
  38 + 'h1',
  39 + ],
  40 + ]) ?>
  41 +
  42 +</div>
... ...
backend/views/banner/_form.php 0 → 100755
  1 +++ a/backend/views/banner/_form.php
  1 +<?php
  2 +
  3 +use common\modules\file\widgets\ImageUploader;
  4 +use kartik\select2\Select2;
  5 +use yii\helpers\Html;
  6 +use yii\widgets\ActiveForm;
  7 +
  8 +/* @var $this yii\web\View */
  9 +/* @var $model common\models\Banner */
  10 +/* @var $form yii\widgets\ActiveForm */
  11 +?>
  12 +
  13 +<div class="banner-form">
  14 +
  15 + <?php $form = ActiveForm::begin([
  16 + 'enableClientValidation' => false,
  17 + 'options' => ['enctype' => 'multipart/form-data']
  18 + ]); ?>
  19 +
  20 +
  21 + <?= $form->field($model, 'alt')->textInput(['maxlength' => true]) ?>
  22 +
  23 + <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
  24 +
  25 + <?= $form->field($model, 'url')->textInput(['maxlength' => true]) ?>
  26 +
  27 + <?= $form->field($model, 'status')->widget(Select2::className(),([
  28 + 'name' => 'status',
  29 + 'hideSearch' => true,
  30 + 'data' => [1 => 'Active', 2 => 'Inactive'],
  31 + 'options' => ['placeholder' => 'Select status...'],
  32 + 'pluginOptions' => [
  33 + 'allowClear' => true
  34 + ]
  35 + ])) ?>
  36 +
  37 +
  38 + <div id="image_widget_block">
  39 +
  40 + <?= $form->field($model, 'image')->widget(\kartik\file\FileInput::classname(), [
  41 + 'language' => 'ru',
  42 + 'options' => [
  43 + 'accept' => 'image/*',
  44 + 'multiple' => false,
  45 + ],
  46 + 'pluginOptions' => [
  47 + 'allowedFileExtensions' => ['jpg', 'gif', 'png'],
  48 + 'initialPreview' => !empty($model->imageUrl) ? \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'list') : '',
  49 + 'overwriteInitial' => true,
  50 + 'showRemove' => false,
  51 + 'showUpload' => false,
  52 + 'previewFileType' => 'image',
  53 + ],
  54 + ]); ?>
  55 + </div>
  56 +
  57 + <div class="form-group">
  58 + <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  59 + </div>
  60 +
  61 + <?php ActiveForm::end(); ?>
  62 +
  63 +</div>
  64 +<script>
  65 + $('#save_image_widget_settings').click(function(){
  66 + var width = $('#banner-width').val();
  67 + var height = $('#banner-height').val();
  68 + save_image_widget_settings( width, height, function(data){
  69 + $('#image_widget_block').html = '';
  70 + $('#image_widget_block').html(data.html);
  71 + });
  72 + });
  73 + function save_image_widget_settings( width, height, callback )
  74 + {
  75 + $.ajax({
  76 + url: '/admin/banner/save-image-settings',
  77 + data :
  78 + {
  79 + 'width' : width,
  80 + 'height' : height
  81 + },
  82 + type : 'POST',
  83 + dataType: 'json',
  84 + success: function (data)
  85 + {
  86 + if(callback)
  87 + callback(data);
  88 + },
  89 + error: function()
  90 + {
  91 + console.info('error');
  92 + }
  93 + });
  94 + }
  95 +</script>
... ...
backend/views/banner/_search.php 0 → 100755
  1 +++ a/backend/views/banner/_search.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\ActiveForm;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\BannerSearch */
  8 +/* @var $form yii\widgets\ActiveForm */
  9 +?>
  10 +
  11 +<div class="banner-search">
  12 +
  13 + <?php $form = ActiveForm::begin([
  14 + 'action' => ['index'],
  15 + 'method' => 'get',
  16 + ]); ?>
  17 +
  18 + <?= $form->field($model, 'banner_id') ?>
  19 +
  20 +
  21 + <?= $form->field($model, 'image') ?>
  22 +
  23 + <?= $form->field($model, 'alt') ?>
  24 +
  25 + <?= $form->field($model, 'title') ?>
  26 +
  27 + <?php // echo $form->field($model, 'url') ?>
  28 +
  29 + <?php // echo $form->field($model, 'status') ?>
  30 +
  31 + <div class="form-group">
  32 + <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?>
  33 + <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?>
  34 + </div>
  35 +
  36 + <?php ActiveForm::end(); ?>
  37 +
  38 +</div>
... ...
backend/views/banner/create.php 0 → 100755
  1 +++ a/backend/views/banner/create.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\Banner */
  8 +
  9 +$this->title = Yii::t('app', 'Create Banner');
  10 +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Banners'), 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="banner-create">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <?= $this->render('_form', [
  18 + 'model' => $model,
  19 + ]) ?>
  20 +
  21 +</div>
... ...
backend/views/banner/index.php 0 → 100755
  1 +++ a/backend/views/banner/index.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\grid\GridView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $searchModel common\models\BannerSearch */
  8 +/* @var $dataProvider yii\data\ActiveDataProvider */
  9 +
  10 +$this->title = Yii::t('app', 'Banners');
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="banner-index">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 + <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
  17 +
  18 + <p>
  19 + <?= Html::a(Yii::t('app', 'Create Banner'), ['create'], ['class' => 'btn btn-success']) ?>
  20 + </p>
  21 + <?= GridView::widget([
  22 + 'dataProvider' => $dataProvider,
  23 + 'filterModel' => $searchModel,
  24 + 'columns' => [
  25 + ['class' => 'yii\grid\SerialColumn'],
  26 +
  27 + 'banner_id',
  28 + 'image',
  29 + 'alt',
  30 + 'title',
  31 + // 'url:url',
  32 + // 'status',
  33 +
  34 + ['class' => 'yii\grid\ActionColumn'],
  35 + ],
  36 + ]); ?>
  37 +</div>
... ...
backend/views/banner/update.php 0 → 100755
  1 +++ a/backend/views/banner/update.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +/* @var $this yii\web\View */
  6 +/* @var $model common\models\Banner */
  7 +
  8 +$this->title = Yii::t('app', 'Update {modelClass}: ', [
  9 + 'modelClass' => 'Banner',
  10 +]) . $model->title;
  11 +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Banners'), 'url' => ['index']];
  12 +$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->banner_id]];
  13 +$this->params['breadcrumbs'][] = Yii::t('app', 'Update');
  14 +?>
  15 +<div class="banner-update">
  16 +
  17 + <h1><?= Html::encode($this->title) ?></h1>
  18 +
  19 + <?= $this->render('_form', [
  20 + 'model' => $model,
  21 + ]) ?>
  22 +
  23 +</div>
... ...
backend/views/banner/view.php 0 → 100755
  1 +++ a/backend/views/banner/view.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\DetailView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\Banner */
  8 +
  9 +$this->title = $model->title;
  10 +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Banners'), 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="banner-view">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <p>
  18 + <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->banner_id], ['class' => 'btn btn-primary']) ?>
  19 + <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->banner_id], [
  20 + 'class' => 'btn btn-danger',
  21 + 'data' => [
  22 + 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'),
  23 + 'method' => 'post',
  24 + ],
  25 + ]) ?>
  26 + </p>
  27 +
  28 + <?= DetailView::widget([
  29 + 'model' => $model,
  30 + 'attributes' => [
  31 + 'banner_id',
  32 + 'image',
  33 + 'alt',
  34 + 'title',
  35 + 'url:url',
  36 + 'status',
  37 + ],
  38 + ]) ?>
  39 +
  40 +</div>
... ...
backend/views/bg/_form.php 0 → 100755
  1 +++ a/backend/views/bg/_form.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\ActiveForm;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\Bg */
  8 +/* @var $form yii\widgets\ActiveForm */
  9 +?>
  10 +
  11 +<div class="bg-form">
  12 +
  13 + <?php $form = ActiveForm::begin([
  14 + 'enableClientValidation' => false,
  15 + 'options' => ['enctype' => 'multipart/form-data']
  16 + ]); ?>
  17 +
  18 + <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
  19 +
  20 + <?= $form->field($model, 'url')->textInput(['maxlength' => true]) ?>
  21 +
  22 + <?= $form->field($model, 'image')->widget(\kartik\file\FileInput::classname(), [
  23 + 'language' => 'ru',
  24 + 'options' => [
  25 + 'accept' => 'image/*',
  26 + 'multiple' => false,
  27 + ],
  28 + 'pluginOptions' => [
  29 + 'allowedFileExtensions' => ['jpg', 'gif', 'png'],
  30 + 'initialPreview' => !empty($model->imageUrl) ? \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'list') : '',
  31 + 'overwriteInitial' => true,
  32 + 'showRemove' => false,
  33 + 'showUpload' => false,
  34 + 'previewFileType' => 'image',
  35 + ],
  36 + ]); ?>
  37 +
  38 + <div class="form-group">
  39 + <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  40 + </div>
  41 +
  42 + <?php ActiveForm::end(); ?>
  43 +
  44 +</div>
... ...
backend/views/bg/_search.php 0 → 100755
  1 +++ a/backend/views/bg/_search.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\ActiveForm;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\BgSearch */
  8 +/* @var $form yii\widgets\ActiveForm */
  9 +?>
  10 +
  11 +<div class="bg-search">
  12 +
  13 + <?php $form = ActiveForm::begin([
  14 + 'action' => ['index'],
  15 + 'method' => 'get',
  16 + ]); ?>
  17 +
  18 + <?= $form->field($model, 'id') ?>
  19 +
  20 + <?= $form->field($model, 'title') ?>
  21 +
  22 + <?= $form->field($model, 'url') ?>
  23 +
  24 + <?= $form->field($model, 'image') ?>
  25 +
  26 + <div class="form-group">
  27 + <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
  28 + <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
  29 + </div>
  30 +
  31 + <?php ActiveForm::end(); ?>
  32 +
  33 +</div>
... ...
backend/views/bg/create.php 0 → 100755
  1 +++ a/backend/views/bg/create.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\Bg */
  8 +
  9 +$this->title = 'Create Bg';
  10 +$this->params['breadcrumbs'][] = ['label' => 'Bgs', 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="bg-create">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <?= $this->render('_form', [
  18 + 'model' => $model,
  19 + ]) ?>
  20 +
  21 +</div>
... ...
backend/views/bg/index.php 0 → 100755
  1 +++ a/backend/views/bg/index.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\grid\GridView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $searchModel common\models\BgSearch */
  8 +/* @var $dataProvider yii\data\ActiveDataProvider */
  9 +
  10 +$this->title = 'Bgs';
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="bg-index">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 + <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
  17 +
  18 + <p>
  19 + <?= Html::a('Create Bg', ['create'], ['class' => 'btn btn-success']) ?>
  20 + </p>
  21 + <?= GridView::widget([
  22 + 'dataProvider' => $dataProvider,
  23 + 'filterModel' => $searchModel,
  24 + 'columns' => [
  25 + ['class' => 'yii\grid\SerialColumn'],
  26 +
  27 + 'id',
  28 + 'title',
  29 + 'url:url',
  30 + 'image',
  31 +
  32 + ['class' => 'yii\grid\ActionColumn'],
  33 + ],
  34 + ]); ?>
  35 +</div>
... ...
backend/views/bg/update.php 0 → 100755
  1 +++ a/backend/views/bg/update.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +/* @var $this yii\web\View */
  6 +/* @var $model common\models\Bg */
  7 +
  8 +$this->title = 'Update Bg: ' . $model->title;
  9 +$this->params['breadcrumbs'][] = ['label' => 'Bgs', 'url' => ['index']];
  10 +$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]];
  11 +$this->params['breadcrumbs'][] = 'Update';
  12 +?>
  13 +<div class="bg-update">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <?= $this->render('_form', [
  18 + 'model' => $model,
  19 + ]) ?>
  20 +
  21 +</div>
... ...
backend/views/bg/view.php 0 → 100755
  1 +++ a/backend/views/bg/view.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\DetailView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\Bg */
  8 +
  9 +$this->title = $model->title;
  10 +$this->params['breadcrumbs'][] = ['label' => 'Bgs', 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="bg-view">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <p>
  18 + <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
  19 + <?= Html::a('Delete', ['delete', 'id' => $model->id], [
  20 + 'class' => 'btn btn-danger',
  21 + 'data' => [
  22 + 'confirm' => 'Are you sure you want to delete this item?',
  23 + 'method' => 'post',
  24 + ],
  25 + ]) ?>
  26 + </p>
  27 +
  28 + <?= DetailView::widget([
  29 + 'model' => $model,
  30 + 'attributes' => [
  31 + 'id',
  32 + 'title',
  33 + 'url:url',
  34 + 'image',
  35 + ],
  36 + ]) ?>
  37 +
  38 +</div>
... ...
backend/views/blog/_form.php 0 → 100755
  1 +++ a/backend/views/blog/_form.php
  1 +<?php
  2 +
  3 +use common\widgets\FieldEditor;
  4 +use yii\helpers\Html;
  5 +use yii\widgets\ActiveForm;
  6 +use common\modules\file\widgets\ImageUploader;
  7 +use mihaildev\ckeditor\CKEditor;
  8 +use mihaildev\elfinder\ElFinder;
  9 +use common\components\Request;
  10 +
  11 +/* @var $this yii\web\View */
  12 +/* @var $model common\models\Blog */
  13 +/* @var $form yii\widgets\ActiveForm */
  14 +?>
  15 +
  16 +<div class="blog-form">
  17 +
  18 + <?php $form = ActiveForm::begin([
  19 + 'enableClientValidation' => false,
  20 + 'options' => ['enctype' => 'multipart/form-data']
  21 + ]); ?>
  22 +
  23 + <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
  24 +
  25 + <?= $form->field($model, 'link')->textInput(['maxlength' => true]) ?>
  26 +
  27 + <?= $form->field($model, 'description')->widget(CKEditor::className(),
  28 + [
  29 + 'editorOptions' => ElFinder::ckeditorOptions('elfinder',[
  30 + 'preset' => 'full', //разработанны стандартные настройки basic, standard, full данную возможность не обязательно использовать
  31 + 'inline' => false, //по умолчанию false]),
  32 + 'filebrowserUploadUrl'=>Yii::$app->getUrlManager()->createUrl('file/uploader/images-upload')
  33 + ]
  34 + )
  35 + ]) ?>
  36 +
  37 + <?= $form->field($model, 'imageUpload')->widget(\kartik\file\FileInput::classname(), [
  38 + 'language' => 'ru',
  39 + 'options' => [
  40 + 'accept' => 'image/*',
  41 + 'multiple' => false,
  42 + ],
  43 + 'pluginOptions' => [
  44 + 'allowedFileExtensions' => ['jpg', 'gif', 'png'],
  45 + 'initialPreview' => !empty($model->imageUrl) ? \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'list') : '',
  46 + 'overwriteInitial' => true,
  47 + 'showRemove' => false,
  48 + 'showUpload' => false,
  49 + 'previewFileType' => 'image',
  50 + ],
  51 + ]); ?>
  52 +
  53 + <?= FieldEditor::widget([
  54 + 'template' => 'education',
  55 + 'item_id' => $model->blog_id,
  56 + 'model' => 'common\models\Blog',
  57 + 'language' => 'ru',
  58 + ]); ?>
  59 + <div class="form-group">
  60 + <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  61 + </div>
  62 +
  63 + <?php ActiveForm::end(); ?>
  64 +
  65 +</div>
... ...
backend/views/blog/_search.php 0 → 100755
  1 +++ a/backend/views/blog/_search.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\ActiveForm;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\BlogSearch */
  8 +/* @var $form yii\widgets\ActiveForm */
  9 +?>
  10 +
  11 +<div class="blog-search">
  12 +
  13 + <?php $form = ActiveForm::begin([
  14 + 'action' => ['index'],
  15 + 'method' => 'get',
  16 + ]); ?>
  17 +
  18 + <?= $form->field($model, 'blog_id') ?>
  19 +
  20 + <?= $form->field($model, 'user_id') ?>
  21 +
  22 + <?= $form->field($model, 'name') ?>
  23 +
  24 + <?= $form->field($model, 'link') ?>
  25 +
  26 + <?= $form->field($model, 'date_add') ?>
  27 +
  28 + <?php // echo $form->field($model, 'user_add_id') ?>
  29 +
  30 + <?php // echo $form->field($model, 'view_count') ?>
  31 +
  32 + <?php // echo $form->field($model, 'description') ?>
  33 +
  34 + <?php // echo $form->field($model, 'cover') ?>
  35 +
  36 + <div class="form-group">
  37 + <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
  38 + <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
  39 + </div>
  40 +
  41 + <?php ActiveForm::end(); ?>
  42 +
  43 +</div>
... ...
backend/views/blog/create.php 0 → 100755
  1 +++ a/backend/views/blog/create.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\Blog */
  8 +
  9 +$this->title = 'Create Blog';
  10 +$this->params['breadcrumbs'][] = ['label' => 'Blogs', 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="blog-create">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <?= $this->render('_form', [
  18 + 'model' => $model,
  19 + ]) ?>
  20 +
  21 +</div>
... ...
backend/views/blog/index.php 0 → 100755
  1 +++ a/backend/views/blog/index.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\grid\GridView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $searchModel common\models\BlogSearch */
  8 +/* @var $dataProvider yii\data\ActiveDataProvider */
  9 +
  10 +$this->title = 'Blogs';
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="blog-index">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 + <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
  17 +
  18 + <p>
  19 + <?= Html::a('Create Blog', ['create'], ['class' => 'btn btn-success']) ?>
  20 + </p>
  21 + <?= GridView::widget([
  22 + 'dataProvider' => $dataProvider,
  23 + 'filterModel' => $searchModel,
  24 + 'columns' => [
  25 + ['class' => 'yii\grid\SerialColumn'],
  26 +
  27 + 'blog_id',
  28 + 'user_id',
  29 + 'name',
  30 + 'link',
  31 + 'date_add',
  32 + // 'user_add_id',
  33 + // 'view_count',
  34 + // 'description:ntext',
  35 + // 'cover',
  36 +
  37 + ['class' => 'yii\grid\ActionColumn'],
  38 + ],
  39 + ]); ?>
  40 +</div>
... ...
backend/views/blog/update.php 0 → 100755
  1 +++ a/backend/views/blog/update.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +/* @var $this yii\web\View */
  6 +/* @var $model common\models\Blog */
  7 +
  8 +$this->title = 'Update Blog: ' . ' ' . $model->name;
  9 +$this->params['breadcrumbs'][] = ['label' => 'Blogs', 'url' => ['index']];
  10 +$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->blog_id]];
  11 +$this->params['breadcrumbs'][] = 'Update';
  12 +?>
  13 +<div class="blog-update">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <?= $this->render('_form', [
  18 + 'model' => $model,
  19 + ]) ?>
  20 +
  21 +</div>
... ...
backend/views/blog/view.php 0 → 100755
  1 +++ a/backend/views/blog/view.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\DetailView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\Blog */
  8 +
  9 +$this->title = $model->name;
  10 +$this->params['breadcrumbs'][] = ['label' => 'Blogs', 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="blog-view">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <p>
  18 + <?= Html::a('Update', ['update', 'id' => $model->blog_id], ['class' => 'btn btn-primary']) ?>
  19 + <?= Html::a('Delete', ['delete', 'id' => $model->blog_id], [
  20 + 'class' => 'btn btn-danger',
  21 + 'data' => [
  22 + 'confirm' => 'Are you sure you want to delete this item?',
  23 + 'method' => 'post',
  24 + ],
  25 + ]) ?>
  26 + </p>
  27 +
  28 + <?= DetailView::widget([
  29 + 'model' => $model,
  30 + 'attributes' => [
  31 + 'blog_id',
  32 + 'user_id',
  33 + 'name',
  34 + 'link',
  35 + 'date_add',
  36 + 'user_add_id',
  37 + 'view_count',
  38 + 'description:ntext',
  39 + 'cover',
  40 + ],
  41 + ]) ?>
  42 +
  43 +</div>
... ...
backend/views/brand/_form.php 0 → 100755
  1 +++ a/backend/views/brand/_form.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\ActiveForm;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\modules\product\models\Brand */
  8 +/* @var $form yii\widgets\ActiveForm */
  9 +?>
  10 +
  11 +<div class="brand-form">
  12 +
  13 + <?php $form = ActiveForm::begin([
  14 + 'enableClientValidation' => false,
  15 + 'options' => ['enctype' => 'multipart/form-data']
  16 + ]); ?>
  17 +
  18 + <?= $form->field($model, 'name')->textInput() ?>
  19 +
  20 + <?= $form->field($model, 'alias')->textInput(['maxlength' => true]) ?>
  21 +
  22 + <?= $form->field($model, 'image')->widget(\kartik\file\FileInput::classname(), [
  23 + 'language' => 'ru',
  24 + 'options' => [
  25 + 'accept' => 'image/*',
  26 + 'multiple' => false,
  27 + ],
  28 + 'pluginOptions' => [
  29 + 'allowedFileExtensions' => ['jpg', 'gif', 'png'],
  30 + 'initialPreview' => !empty($model->imageUrl) ? \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'list') : '',
  31 + 'overwriteInitial' => true,
  32 + 'showRemove' => false,
  33 + 'showUpload' => false,
  34 + 'previewFileType' => 'image',
  35 + ],
  36 + ]); ?>
  37 +
  38 + <?= $form->field($model, 'meta_title')->textInput(['maxlength' => true]) ?>
  39 +
  40 + <?= $form->field($model, 'meta_desc')->textarea(['rows' => 6]) ?>
  41 +
  42 + <?= $form->field($model, 'meta_robots')->textInput(['maxlength' => true]) ?>
  43 +
  44 + <?= $form->field($model, 'seo_text')->textarea(['rows' => 6]) ?>
  45 +
  46 + <?= $form->field($model, 'in_menu')->checkbox()?>
  47 +
  48 + <div class="form-group">
  49 + <?= Html::submitButton($model->isNewRecord ? Yii::t('product', 'Create') : Yii::t('product', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  50 + <?php if ($model->isNewRecord) :?>
  51 + <?= Html::submitButton(Yii::t('product', 'Create and continue'), ['name' => 'create_and_new', 'class' => 'btn btn-primary']) ?>
  52 + <?php endif?>
  53 + </div>
  54 +
  55 + <?php ActiveForm::end(); ?>
  56 +
  57 +</div>
... ...
backend/views/brand/_search.php 0 → 100755
  1 +++ a/backend/views/brand/_search.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\ActiveForm;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\modules\product\models\BrandSearch */
  8 +/* @var $form yii\widgets\ActiveForm */
  9 +?>
  10 +
  11 +<div class="brand-search">
  12 +
  13 + <?php $form = ActiveForm::begin([
  14 + 'action' => ['index'],
  15 + 'method' => 'get',
  16 + ]); ?>
  17 +
  18 + <?= $form->field($model, 'brand_id') ?>
  19 +
  20 + <?= $form->field($model, 'brand_name_id') ?>
  21 +
  22 + <?= $form->field($model, 'alias') ?>
  23 +
  24 + <?= $form->field($model, 'image') ?>
  25 +
  26 + <?= $form->field($model, 'meta_title') ?>
  27 +
  28 + <?php // echo $form->field($model, 'meta_desc') ?>
  29 +
  30 + <?php // echo $form->field($model, 'meta_robots') ?>
  31 +
  32 + <?php // echo $form->field($model, 'seo_text') ?>
  33 +
  34 + <div class="form-group">
  35 + <?= Html::submitButton(Yii::t('product', 'Search'), ['class' => 'btn btn-primary']) ?>
  36 + <?= Html::resetButton(Yii::t('product', 'Reset'), ['class' => 'btn btn-default']) ?>
  37 + </div>
  38 +
  39 + <?php ActiveForm::end(); ?>
  40 +
  41 +</div>
... ...
backend/views/brand/create.php 0 → 100755
  1 +++ a/backend/views/brand/create.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\modules\product\models\Brand */
  8 +
  9 +$this->title = Yii::t('product', 'Create Brand');
  10 +$this->params['breadcrumbs'][] = ['label' => Yii::t('product', 'Brands'), 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="brand-create">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <?= $this->render('_form', [
  18 + 'model' => $model,
  19 + ]) ?>
  20 +
  21 +</div>
... ...
backend/views/brand/index.php 0 → 100755
  1 +++ a/backend/views/brand/index.php
  1 +<?php
  2 +
  3 +use common\components\artboximage\ArtboxImageHelper;
  4 +use yii\helpers\Html;
  5 +use yii\grid\GridView;
  6 +
  7 +/* @var $this yii\web\View */
  8 +/* @var $searchModel common\modules\product\models\BrandSearch */
  9 +/* @var $dataProvider yii\data\ActiveDataProvider */
  10 +
  11 +$this->title = Yii::t('product', 'Brands');
  12 +$this->params['breadcrumbs'][] = $this->title;
  13 +?>
  14 +<div class="brand-index">
  15 +
  16 + <h1><?= Html::encode($this->title) ?></h1>
  17 + <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
  18 +
  19 + <p>
  20 + <?= Html::a(Yii::t('product', 'Create Brand'), ['create'], ['class' => 'btn btn-success']) ?>
  21 + </p>
  22 + <?= GridView::widget([
  23 + 'dataProvider' => $dataProvider,
  24 +// 'filterModel' => $searchModel,
  25 + 'columns' => [
  26 + ['class' => 'yii\grid\SerialColumn'],
  27 +
  28 + 'name',
  29 + 'alias',
  30 + [
  31 + 'attribute' => 'image',
  32 + 'format' => 'image',
  33 + 'value' => function($data) {
  34 + return ArtboxImageHelper::getImageSrc($data->imageUrl, 'brand_item');
  35 + },
  36 + ],
  37 +
  38 + ['class' => 'yii\grid\ActionColumn'],
  39 + ],
  40 + ]); ?>
  41 +</div>
... ...
backend/views/brand/update.php 0 → 100755
  1 +++ a/backend/views/brand/update.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +/* @var $this yii\web\View */
  6 +/* @var $model common\modules\product\models\Brand */
  7 +
  8 +$this->title = Yii::t('product', 'Update {modelClass}: ', [
  9 + 'modelClass' => 'Brand',
  10 +]) . ' ' . $model->brand_id;
  11 +$this->params['breadcrumbs'][] = ['label' => Yii::t('product', 'Brands'), 'url' => ['index']];
  12 +$this->params['breadcrumbs'][] = ['label' => $model->brand_id, 'url' => ['view', 'id' => $model->brand_id]];
  13 +$this->params['breadcrumbs'][] = Yii::t('product', 'Update');
  14 +?>
  15 +<div class="brand-update">
  16 +
  17 + <h1><?= Html::encode($this->title) ?></h1>
  18 +
  19 + <?= $this->render('_form', [
  20 + 'model' => $model,
  21 + ]) ?>
  22 +
  23 +</div>
... ...
backend/views/brand/view.php 0 → 100755
  1 +++ a/backend/views/brand/view.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\DetailView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\modules\product\models\Brand */
  8 +
  9 +$this->title = $model->brand_id;
  10 +$this->params['breadcrumbs'][] = ['label' => Yii::t('product', 'Brands'), 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="brand-view">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <p>
  18 + <?= Html::a(Yii::t('product', 'Update'), ['update', 'id' => $model->brand_id], ['class' => 'btn btn-primary']) ?>
  19 + <?= Html::a(Yii::t('product', 'Delete'), ['delete', 'id' => $model->brand_id], [
  20 + 'class' => 'btn btn-danger',
  21 + 'data' => [
  22 + 'confirm' => Yii::t('product', 'Are you sure you want to delete this item?'),
  23 + 'method' => 'post',
  24 + ],
  25 + ]) ?>
  26 + </p>
  27 +
  28 + <?= DetailView::widget([
  29 + 'model' => $model,
  30 + 'attributes' => [
  31 + 'brand_id',
  32 + 'brand_name_id',
  33 + 'alias',
  34 + 'imageUrl:image',
  35 + 'meta_title',
  36 + 'meta_desc:ntext',
  37 + 'meta_robots',
  38 + 'seo_text:ntext',
  39 + ],
  40 + ]) ?>
  41 +
  42 +</div>
... ...
backend/views/category/_form.php 0 → 100755
  1 +++ a/backend/views/category/_form.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\ActiveForm;
  5 +use mihaildev\ckeditor\CKEditor;
  6 +use mihaildev\elfinder\ElFinder;
  7 +use common\modules\file\widgets\ImageUploader;
  8 +use kartik\select2\Select2;
  9 +
  10 +/* @var $this yii\web\View */
  11 +/* @var $model common\modules\product\models\Category */
  12 +/* @var $form yii\widgets\ActiveForm */
  13 +?>
  14 +
  15 +<div class="category-form">
  16 +
  17 + <?php $form = ActiveForm::begin([
  18 + 'enableClientValidation' => false,
  19 + 'options' => ['enctype' => 'multipart/form-data']
  20 + ]); ?>
  21 +
  22 + <?= $form->field($model, 'name')->textInput() ?>
  23 +
  24 + <?= $form->field($model, 'alias')->textInput(['maxlength' => true]) ?>
  25 +
  26 + <?= $form->field($model, 'parent_id')->dropDownList($categories, [
  27 + 'prompt' => Yii::t('rubrication', 'Root category'),
  28 + 'options' => [
  29 + $model->category_id => ['disabled' => true]
  30 + ]
  31 + ])->label(Yii::t('product', 'Parent category')) ?>
  32 +
  33 + <?= $form->field($model, 'taxGroup')->widget(Select2::className(), [
  34 + 'data' => \yii\helpers\ArrayHelper::map(\common\modules\rubrication\models\TaxGroup::find()->all(), 'tax_group_id', 'name'),
  35 + 'language' => 'ru',
  36 + 'options' => [
  37 + 'placeholder' => 'Linked options',
  38 + 'multiple' => true,
  39 + ],
  40 + 'pluginOptions' => [
  41 + 'allowClear' => true
  42 + ],
  43 + ]
  44 + ) ?>
  45 +
  46 + <?= $form->field($model, 'imageUpload')->widget(\kartik\file\FileInput::classname(), [
  47 + 'language' => 'ru',
  48 + 'options' => [
  49 + 'accept' => 'image/*',
  50 + 'multiple' => false,
  51 + ],
  52 + 'pluginOptions' => [
  53 + 'allowedFileExtensions' => ['jpg', 'gif', 'png'],
  54 + 'initialPreview' => !empty($model->imageUrl) ? \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'list') : '',
  55 + 'overwriteInitial' => true,
  56 + 'showRemove' => false,
  57 + 'showUpload' => false,
  58 + 'previewFileType' => 'image',
  59 + ],
  60 + ]); ?>
  61 +
  62 + <?= $form->field($model, 'meta_title')->textInput(['maxlength' => true]) ?>
  63 +
  64 + <?= $form->field($model, 'meta_desc')->textarea(['rows' => 6]) ?>
  65 +
  66 + <?= $form->field($model, 'meta_robots')->textInput(['maxlength' => true]) ?>
  67 +
  68 + <?= $form->field($model, 'h1')->textInput(['maxlength' => true]) ?>
  69 +
  70 + <?= $form->field($model, 'seo_text')->widget(CKEditor::className(),
  71 + [
  72 + 'editorOptions' => ElFinder::ckeditorOptions('elfinder',[
  73 + 'preset' => 'full', //разработанны стандартные настройки basic, standard, full данную возможность не обязательно использовать
  74 + 'inline' => false, //по умолчанию false]),
  75 + 'filebrowserUploadUrl'=>Yii::$app->getUrlManager()->createUrl('file/uploader/images-upload')
  76 + ]
  77 + )
  78 + ]) ?>
  79 +
  80 + <?php if (!empty($model) && $model->depth == 2) :?>
  81 + <?= $form->field($model, 'populary')->checkbox() ?>
  82 + <?php endif?>
  83 +
  84 + <div class="form-group">
  85 + <?= Html::submitButton($model->isNewRecord ? Yii::t('product', 'Create') : Yii::t('product', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  86 + <?php if ($model->isNewRecord) :?>
  87 + <?= Html::submitButton(Yii::t('product', 'Create and continue'), ['name' => 'create_and_new', 'class' => 'btn btn-primary']) ?>
  88 + <?php endif?>
  89 + </div>
  90 +
  91 + <?php ActiveForm::end(); ?>
  92 +
  93 +</div>
... ...
backend/views/category/_search.php 0 → 100755
  1 +++ a/backend/views/category/_search.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\ActiveForm;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\modules\product\models\CategorySearch */
  8 +/* @var $form yii\widgets\ActiveForm */
  9 +?>
  10 +
  11 +<div class="category-search">
  12 +
  13 + <?php $form = ActiveForm::begin([
  14 + 'action' => ['index'],
  15 + 'method' => 'get',
  16 + ]); ?>
  17 +
  18 + <?= $form->field($model, 'category_id') ?>
  19 +
  20 + <?= $form->field($model, 'parent_id') ?>
  21 +
  22 + <?= $form->field($model, 'path') ?>
  23 +
  24 + <?= $form->field($model, 'depth') ?>
  25 +
  26 + <?= $form->field($model, 'image') ?>
  27 +
  28 + <?php // echo $form->field($model, 'meta_title') ?>
  29 +
  30 + <?php // echo $form->field($model, 'meta_desc') ?>
  31 +
  32 + <?php // echo $form->field($model, 'meta_robots') ?>
  33 +
  34 + <?php // echo $form->field($model, 'seo_text') ?>
  35 +
  36 + <?php // echo $form->field($model, 'category_name_id') ?>
  37 +
  38 + <?php // echo $form->field($model, 'product_unit_id') ?>
  39 +
  40 + <?php // echo $form->field($model, 'alias') ?>
  41 +
  42 + <div class="form-group">
  43 + <?= Html::submitButton(Yii::t('product', 'Search'), ['class' => 'btn btn-primary']) ?>
  44 + <?= Html::resetButton(Yii::t('product', 'Reset'), ['class' => 'btn btn-default']) ?>
  45 + </div>
  46 +
  47 + <?php ActiveForm::end(); ?>
  48 +
  49 +</div>
... ...
backend/views/category/create.php 0 → 100755
  1 +++ a/backend/views/category/create.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\modules\product\models\Category */
  8 +
  9 +$this->title = Yii::t('product', 'Create Category');
  10 +$this->params['breadcrumbs'][] = ['label' => Yii::t('product', 'Categories'), 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="category-create">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <?= $this->render('_form', [
  18 + 'model' => $model,
  19 + 'categories' => $categories
  20 + ]) ?>
  21 +
  22 +</div>
... ...
backend/views/category/index.php 0 → 100755
  1 +++ a/backend/views/category/index.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use kartik\grid\GridView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $searchModel common\modules\product\models\CategorySearch */
  8 +/* @var $dataProvider yii\data\ActiveDataProvider */
  9 +
  10 +$this->title = Yii::t('product', 'Categories');
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="category-index">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 + <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
  17 +
  18 + <p>
  19 + <?= Html::a(Yii::t('product', 'Create Category'), ['create'], ['class' => 'btn btn-success']) ?>
  20 + </p>
  21 + <?= GridView::widget([
  22 + 'dataProvider' => $dataProvider,
  23 +// 'filterModel' => $searchModel,
  24 + 'columns' => [
  25 + ['class' => 'yii\grid\SerialColumn'],
  26 + [
  27 + 'label'=> Yii::t('product', 'Name'),
  28 + 'content'=>function($data){
  29 + $op = [];
  30 + foreach($data->getParents()->all() as $parent) {
  31 + $op[] = $parent->name;
  32 + }
  33 + $op[] = $data->name;
  34 + return implode('&nbsp;&rarr;&nbsp;', $op);
  35 +// return str_repeat('-', $data->depth) .'&nbsp;'. $data->name;
  36 + }
  37 + ],
  38 + [
  39 + 'class' => 'yii\grid\ActionColumn',
  40 + 'template' => '{view} {update} {delete} {populary}',
  41 + 'buttons' => [
  42 + 'populary' => function ($url, $model) {
  43 + if ($model->depth == 2) {
  44 + return Html::a('<span class="glyphicon glyphicon-star' . ($model->populary ? '' : '-empty') . '"></span>', $url, [
  45 + 'title' => Yii::t('product', ($model->populary ? 'Set not populary' : 'Set populary')),
  46 + ]);
  47 + }
  48 + },
  49 + ],
  50 + 'urlCreator' => function ($action, $model, $key, $index) {
  51 + switch ($action) {
  52 + case 'populary':
  53 + return \yii\helpers\Url::to(['category/populary', 'id' => $model->category_id]);
  54 + break;
  55 + case 'view':
  56 + return \yii\helpers\Url::to(['category/view', 'id' => $model->category_id]);
  57 + break;
  58 + case 'update':
  59 + return \yii\helpers\Url::to(['category/update', 'id' => $model->category_id]);
  60 + break;
  61 + case 'delete':
  62 + return \yii\helpers\Url::to(['category/delete', 'id' => $model->category_id]);
  63 + break;
  64 + }
  65 + }
  66 + ],
  67 + ],
  68 + 'panel' => [
  69 + 'type'=>'success',
  70 + ],
  71 + ]); ?>
  72 +</div>
... ...
backend/views/category/update.php 0 → 100755
  1 +++ a/backend/views/category/update.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +/* @var $this yii\web\View */
  6 +/* @var $model common\modules\product\models\Category */
  7 +
  8 +$this->title = Yii::t('product', 'Update {modelClass}: ', [
  9 + 'modelClass' => 'Category',
  10 +]) . ' ' . $model->name;
  11 +$this->params['breadcrumbs'][] = ['label' => Yii::t('product', 'Categories'), 'url' => ['index']];
  12 +$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->category_id]];
  13 +$this->params['breadcrumbs'][] = Yii::t('product', 'Update');
  14 +?>
  15 +<div class="category-update">
  16 +
  17 + <h1><?= Html::encode($this->title) ?></h1>
  18 +
  19 + <?= $this->render('_form', [
  20 + 'model' => $model,
  21 + 'categories' => $categories
  22 + ]) ?>
  23 +
  24 +</div>
... ...
backend/views/category/view.php 0 → 100755
  1 +++ a/backend/views/category/view.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\DetailView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\modules\product\models\Category */
  8 +
  9 +$this->title = $model->name;
  10 +$this->params['breadcrumbs'][] = ['label' => Yii::t('product', 'Categories'), 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="category-view">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <p>
  18 + <?= Html::a(Yii::t('product', 'Update'), ['update', 'id' => $model->category_id], ['class' => 'btn btn-primary']) ?>
  19 + <?= Html::a(Yii::t('product', 'Delete'), ['delete', 'id' => $model->category_id], [
  20 + 'class' => 'btn btn-danger',
  21 + 'data' => [
  22 + 'confirm' => Yii::t('product', 'Are you sure you want to delete this item?'),
  23 + 'method' => 'post',
  24 + ],
  25 + ]) ?>
  26 + <?= Html::a(Yii::t('product', 'Create Category'), ['category/create'], ['class' => 'btn btn-success']) ?>
  27 + <?php if (!empty($model->parent_id)) :?>
  28 + <?= Html::a(Yii::t('product', 'Create category By {name}', ['name' => $model->parent->name]), ['category/create?parent='. $model->parent->category_id], ['class' => 'btn btn-success']) ?>
  29 + <?php endif?>
  30 + </p>
  31 +
  32 + <?= DetailView::widget([
  33 + 'model' => $model,
  34 + 'attributes' => [
  35 + 'category_id',
  36 + 'parent_id',
  37 + 'path',
  38 + 'depth',
  39 + 'imageUrl:image',
  40 + 'meta_title',
  41 + 'meta_desc:ntext',
  42 + 'meta_robots',
  43 + 'h1',
  44 + 'seo_text:ntext',
  45 + 'category_name_id',
  46 + 'product_unit_id',
  47 + 'alias',
  48 +
  49 + ],
  50 + ]) ?>
  51 +
  52 +</div>
... ...
backend/views/comment/_form.php 0 → 100755
  1 +++ a/backend/views/comment/_form.php
  1 +<?php
  2 +
  3 + use common\modules\comment\models\Comment;
  4 + use yii\helpers\Html;
  5 + use yii\widgets\ActiveForm;
  6 +
  7 + /* @var $this yii\web\View */
  8 + /* @var $model Comment */
  9 + /* @var $form yii\widgets\ActiveForm */
  10 + $status_list = [
  11 + Comment::STATUS_ACTIVE => 'Активный',
  12 + Comment::STATUS_HIDDEN => 'Новый',
  13 + Comment::STATUS_DELETED => 'Удаленный',
  14 + ]
  15 +?>
  16 +
  17 +<div class="comment-form">
  18 +
  19 + <?php $form = ActiveForm::begin(); ?>
  20 +
  21 + <?= $form->field($model, 'text')
  22 + ->textarea([ 'rows' => 6 ]) ?>
  23 +
  24 + <?= $form->field($model, 'status')
  25 + ->dropDownList($status_list) ?>
  26 +
  27 + <div class="form-group">
  28 + <?= Html::submitButton('Обновить', [ 'class' => 'btn btn-primary' ]) ?>
  29 + </div>
  30 +
  31 + <?php ActiveForm::end(); ?>
  32 +
  33 +</div>
... ...
backend/views/comment/_search.php 0 → 100755
  1 +++ a/backend/views/comment/_search.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\ActiveForm;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model backend\models\CommentSearch */
  8 +/* @var $form yii\widgets\ActiveForm */
  9 +?>
  10 +
  11 +<div class="comment-search">
  12 +
  13 + <?php $form = ActiveForm::begin([
  14 + 'action' => ['index'],
  15 + 'method' => 'get',
  16 + ]); ?>
  17 +
  18 + <?= $form->field($model, 'comment_id') ?>
  19 +
  20 + <?= $form->field($model, 'text') ?>
  21 +
  22 + <?= $form->field($model, 'user_id') ?>
  23 +
  24 + <?= $form->field($model, 'user_name') ?>
  25 +
  26 + <?= $form->field($model, 'user_email') ?>
  27 +
  28 + <?php // echo $form->field($model, 'comment_pid') ?>
  29 +
  30 + <?php // echo $form->field($model, 'status') ?>
  31 +
  32 + <?php // echo $form->field($model, 'date_add') ?>
  33 +
  34 + <?php // echo $form->field($model, 'date_update') ?>
  35 +
  36 + <?php // echo $form->field($model, 'date_delete') ?>
  37 +
  38 + <?php // echo $form->field($model, 'model') ?>
  39 +
  40 + <?php // echo $form->field($model, 'model_id') ?>
  41 +
  42 + <div class="form-group">
  43 + <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
  44 + <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
  45 + </div>
  46 +
  47 + <?php ActiveForm::end(); ?>
  48 +
  49 +</div>
... ...
backend/views/comment/index.php 0 → 100755
  1 +++ a/backend/views/comment/index.php
  1 +<?php
  2 +
  3 + use common\modules\comment\models\Comment;
  4 + use yii\helpers\Html;
  5 + use yii\grid\GridView;
  6 + use yii\helpers\Url;
  7 +
  8 + /* @var $this yii\web\View */
  9 + /* @var $dataProvider yii\data\ActiveDataProvider */
  10 +
  11 + $this->title = 'Комменты';
  12 + $this->params[ 'breadcrumbs' ][] = $this->title;
  13 +?>
  14 +<div class="comment-index">
  15 +
  16 + <h1><?= Html::encode($this->title) ?></h1>
  17 +
  18 + <?= GridView::widget([
  19 + 'dataProvider' => $dataProvider,
  20 + 'columns' => [
  21 + [
  22 + 'class' => 'yii\grid\ActionColumn',
  23 + 'template' => '{approve} {update} {delete}',
  24 + 'buttons' => [
  25 + 'approve' => function($url, $model, $key) {
  26 + /**
  27 + * @var Comment $model
  28 + */
  29 + $options = array_merge([
  30 + 'title' => "Подтвердить",
  31 + 'aria-label' => "Подтвердить",
  32 + 'data-confirm' => "Комментарий и оценка отобразится на публичной части сайта, подтвердить?",
  33 + 'data-method' => 'post',
  34 + 'data-pjax' => '0',
  35 + ]);
  36 + $glyphicon = 'glyphicon-ok';
  37 + if($model->status == $model::STATUS_ACTIVE) {
  38 + $url = Url::to(['comment/disapprove', 'id' => $model->comment_id]);
  39 + $glyphicon = 'glyphicon-remove';
  40 + }
  41 + return Html::a('<span class="glyphicon '.$glyphicon.'"></span>', $url, $options);
  42 + }
  43 + ]
  44 + ],
  45 + 'comment_id',
  46 + [
  47 + 'attribute' => 'rating.value',
  48 + 'label' => 'Оценка',
  49 + ],
  50 + 'text:ntext',
  51 + [
  52 + 'content' => function($model) {
  53 + /**
  54 + * @var Comment $model
  55 + */
  56 + if(!empty( $model->user )) {
  57 + return $model->user->username . " (ID: " . $model->user->id . ")";
  58 + } else {
  59 + return $model->user_name . " (Гость: " . $model->user_email . ")";
  60 + }
  61 + },
  62 + 'label' => 'Пользователь',
  63 + ],
  64 + [
  65 + 'attribute' => 'status',
  66 + 'value' => function($model) {
  67 + /**
  68 + * @var Comment $model
  69 + */
  70 + $status = '';
  71 + switch($model->status) {
  72 + case Comment::STATUS_ACTIVE:
  73 + $status = 'Активный';
  74 + break;
  75 + case Comment::STATUS_HIDDEN:
  76 + $status = 'Новый';
  77 + break;
  78 + case Comment::STATUS_DELETED:
  79 + $status = 'Удаленный';
  80 + break;
  81 + default:
  82 + $status = 'Неизвестно';
  83 + };
  84 + return $status;
  85 + },
  86 + ],
  87 + 'date_add',
  88 + [
  89 + 'attribute' => 'model',
  90 + 'value' => function($model) {
  91 + /**
  92 + * @var Comment $model
  93 + */
  94 + return $model->model . " (ID: " . $model->model_id . ")";
  95 + },
  96 + ],
  97 + ],
  98 + ]); ?>
  99 +</div>
... ...
backend/views/comment/update.php 0 → 100755
  1 +++ a/backend/views/comment/update.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +/* @var $this yii\web\View */
  6 +/* @var $model common\modules\comment\models\Comment */
  7 +
  8 +$this->title = 'Редактировать коммент: ' . $model->comment_id;
  9 +$this->params['breadcrumbs'][] = ['label' => 'Комментарии', 'url' => ['index']];
  10 +$this->params['breadcrumbs'][] = ['label' => $model->comment_id, 'url' => ['view', 'id' => $model->comment_id]];
  11 +$this->params['breadcrumbs'][] = 'Редактировать';
  12 +?>
  13 +<div class="comment-update">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <?= $this->render('_form', [
  18 + 'model' => $model,
  19 + ]) ?>
  20 +
  21 +</div>
... ...
backend/views/comment/view.php 0 → 100755
  1 +++ a/backend/views/comment/view.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\DetailView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\modules\comment\models\Comment */
  8 +
  9 +$this->title = $model->comment_id;
  10 +$this->params['breadcrumbs'][] = ['label' => 'Comments', 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="comment-view">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <p>
  18 + <?= Html::a('Update', ['update', 'id' => $model->comment_id], ['class' => 'btn btn-primary']) ?>
  19 + <?= Html::a('Delete', ['delete', 'id' => $model->comment_id], [
  20 + 'class' => 'btn btn-danger',
  21 + 'data' => [
  22 + 'confirm' => 'Are you sure you want to delete this item?',
  23 + 'method' => 'post',
  24 + ],
  25 + ]) ?>
  26 + </p>
  27 +
  28 + <?= DetailView::widget([
  29 + 'model' => $model,
  30 + 'attributes' => [
  31 + 'comment_id',
  32 + 'text:ntext',
  33 + 'user_id',
  34 + 'user_name',
  35 + 'user_email:email',
  36 + 'comment_pid',
  37 + 'status',
  38 + 'date_add',
  39 + 'date_update',
  40 + 'date_delete',
  41 + 'model',
  42 + 'model_id',
  43 + ],
  44 + ]) ?>
  45 +
  46 +</div>
... ...
backend/views/customer/_form.php 0 → 100755
  1 +++ a/backend/views/customer/_form.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\ActiveForm;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\Customer */
  8 +/* @var $form yii\widgets\ActiveForm */
  9 +?>
  10 +
  11 +<div class="customer-form">
  12 +
  13 + <?php $form = ActiveForm::begin(); ?>
  14 +
  15 +
  16 + <?= $form->field($model, 'username')->textInput(['maxlength' => true]) ?>
  17 +
  18 +
  19 +
  20 + <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
  21 +
  22 + <?= $form->field($model, 'surname')->textInput(['maxlength' => true]) ?>
  23 +
  24 + <?= $form->field($model, 'phone')->textInput(['maxlength' => true]) ?>
  25 +
  26 + <?= $form->field($model, 'date_time')->textInput() ?>
  27 +
  28 + <?= $form->field($model, 'birth_day')->textInput() ?>
  29 +
  30 + <?= $form->field($model, 'birth_month')->textInput() ?>
  31 +
  32 + <?= $form->field($model, 'birth_year')->textInput() ?>
  33 +
  34 + <?= $form->field($model, 'body')->textarea(['rows' => 6]) ?>
  35 +
  36 + <?= $form->field($model, 'group_id')->textInput() ?>
  37 +
  38 + <div class="form-group">
  39 + <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  40 + </div>
  41 +
  42 + <?php ActiveForm::end(); ?>
  43 +
  44 +</div>
... ...
backend/views/customer/_search.php 0 → 100755
  1 +++ a/backend/views/customer/_search.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\ActiveForm;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\CustomerSearch */
  8 +/* @var $form yii\widgets\ActiveForm */
  9 +?>
  10 +
  11 +<div class="customer-search">
  12 +
  13 + <?php $form = ActiveForm::begin([
  14 + 'action' => ['index'],
  15 + 'method' => 'get',
  16 + ]); ?>
  17 +
  18 + <?= $form->field($model, 'id') ?>
  19 +
  20 + <?= $form->field($model, 'username') ?>
  21 +
  22 + <?= $form->field($model, 'password') ?>
  23 +
  24 + <?= $form->field($model, 'name') ?>
  25 +
  26 + <?= $form->field($model, 'surname') ?>
  27 +
  28 + <?php // echo $form->field($model, 'phone') ?>
  29 +
  30 + <?php // echo $form->field($model, 'date_time') ?>
  31 +
  32 + <?php // echo $form->field($model, 'sex') ?>
  33 +
  34 + <?php // echo $form->field($model, 'birth_day') ?>
  35 +
  36 + <?php // echo $form->field($model, 'birth_month') ?>
  37 +
  38 + <?php // echo $form->field($model, 'birth_year') ?>
  39 +
  40 + <?php // echo $form->field($model, 'body') ?>
  41 +
  42 + <?php // echo $form->field($model, 'group_id') ?>
  43 +
  44 + <div class="form-group">
  45 + <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
  46 + <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
  47 + </div>
  48 +
  49 + <?php ActiveForm::end(); ?>
  50 +
  51 +</div>
... ...
backend/views/customer/create.php 0 → 100755
  1 +++ a/backend/views/customer/create.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\Customer */
  8 +
  9 +$this->title = 'Create Customer';
  10 +$this->params['breadcrumbs'][] = ['label' => 'Customers', 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="customer-create">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <?= $this->render('_form', [
  18 + 'model' => $model,
  19 + ]) ?>
  20 +
  21 +</div>
... ...
backend/views/customer/index.php 0 → 100755
  1 +++ a/backend/views/customer/index.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\grid\GridView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $searchModel common\models\CustomerSearch */
  8 +/* @var $dataProvider yii\data\ActiveDataProvider */
  9 +
  10 +$this->title = 'Customers';
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="customer-index">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 + <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
  17 +
  18 + <p>
  19 + <?= Html::a('Create Customer', ['create'], ['class' => 'btn btn-success']) ?>
  20 + </p>
  21 + <?= GridView::widget([
  22 + 'dataProvider' => $dataProvider,
  23 + 'filterModel' => $searchModel,
  24 + 'columns' => [
  25 + ['class' => 'yii\grid\SerialColumn'],
  26 +
  27 + 'id',
  28 + 'username',
  29 + 'name',
  30 + 'surname',
  31 + // 'phone',
  32 + // 'date_time',
  33 + // 'sex',
  34 + // 'birth_day',
  35 + // 'birth_month',
  36 + // 'birth_year',
  37 + // 'body:ntext',
  38 + // 'group_id',
  39 +
  40 + ['class' => 'yii\grid\ActionColumn'],
  41 + ],
  42 + ]); ?>
  43 +</div>
... ...
backend/views/customer/update.php 0 → 100755
  1 +++ a/backend/views/customer/update.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +/* @var $this yii\web\View */
  6 +/* @var $model common\models\Customer */
  7 +
  8 +$this->title = 'Update Customer: ' . $model->name;
  9 +$this->params['breadcrumbs'][] = ['label' => 'Customers', 'url' => ['index']];
  10 +$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
  11 +$this->params['breadcrumbs'][] = 'Update';
  12 +?>
  13 +<div class="customer-update">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <?= $this->render('_form', [
  18 + 'model' => $model,
  19 + ]) ?>
  20 +
  21 +</div>
... ...
backend/views/customer/view.php 0 → 100755
  1 +++ a/backend/views/customer/view.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\DetailView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\Customer */
  8 +
  9 +$this->title = $model->name;
  10 +$this->params['breadcrumbs'][] = ['label' => 'Customers', 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="customer-view">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <p>
  18 + <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
  19 + <?= Html::a('Delete', ['delete', 'id' => $model->id], [
  20 + 'class' => 'btn btn-danger',
  21 + 'data' => [
  22 + 'confirm' => 'Are you sure you want to delete this item?',
  23 + 'method' => 'post',
  24 + ],
  25 + ]) ?>
  26 + </p>
  27 +
  28 + <?= DetailView::widget([
  29 + 'model' => $model,
  30 + 'attributes' => [
  31 + 'id',
  32 + 'username',
  33 + 'password',
  34 + 'name',
  35 + 'surname',
  36 + 'phone',
  37 + 'date_time',
  38 + 'sex',
  39 + 'birth_day',
  40 + 'birth_month',
  41 + 'birth_year',
  42 + 'body:ntext',
  43 + 'group_id',
  44 + ],
  45 + ]) ?>
  46 +
  47 +</div>
... ...
backend/views/event/_form.php 0 → 100755
  1 +++ a/backend/views/event/_form.php
  1 +<?php
  2 +
  3 +use kartik\date\DatePicker;
  4 +use yii\helpers\Html;
  5 +use yii\widgets\ActiveForm;
  6 +use mihaildev\ckeditor\CKEditor;
  7 +use mihaildev\elfinder\ElFinder;
  8 +/* @var $this yii\web\View */
  9 +/* @var $model common\models\Event */
  10 +/* @var $form yii\widgets\ActiveForm */
  11 +?>
  12 +
  13 +<div class="event-form">
  14 +
  15 + <?php $form = ActiveForm::begin([
  16 + 'enableClientValidation' => false,
  17 + 'options' => ['enctype' => 'multipart/form-data']
  18 + ]); ?>
  19 +
  20 + <?= $form->field($model, 'event_id')->textInput(['maxlength' => true, 'disabled'=>true]) ?>
  21 +
  22 + <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
  23 +
  24 + <?= $form->field($model, 'alias')->textInput(['maxlength' => true]) ?>
  25 +
  26 + <?= $form->field($model, 'body')->widget(CKEditor::className(),
  27 + [
  28 + 'editorOptions' => ElFinder::ckeditorOptions('elfinder',[
  29 + 'preset' => 'full', //разработанны стандартные настройки basic, standard, full данную возможность не обязательно использовать
  30 + 'inline' => false, //по умолчанию false]),
  31 + 'filebrowserUploadUrl'=>Yii::$app->getUrlManager()->createUrl('file/uploader/images-upload')
  32 + ]
  33 + )
  34 + ]) ?>
  35 +
  36 +
  37 + <?= $form->field($model, 'end_at')
  38 + ->widget(DatePicker::className(), [
  39 + 'pluginOptions' => [
  40 + 'todayHighlight' => true,
  41 + 'format' => 'yyyy-mm-dd',
  42 + ]]) ?>
  43 +
  44 +
  45 + <?= $form->field($model, 'imageUpload')->widget(\kartik\file\FileInput::classname(), [
  46 + 'language' => 'ru',
  47 + 'options' => [
  48 + 'accept' => 'image/*',
  49 + 'multiple' => false,
  50 + ],
  51 + 'pluginOptions' => [
  52 + 'allowedFileExtensions' => ['jpg', 'gif', 'png'],
  53 + 'initialPreview' => !empty($model->imageUrl) ? \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'list') : '',
  54 + 'deleteUrl' => \yii\helpers\Url::to(['/product/manage/delimg', 'id' => $model->primaryKey]),
  55 + 'initialPreviewConfig' => $model->getImagesConfig(),
  56 + 'overwriteInitial' => true,
  57 + 'showUpload' => false,
  58 + 'previewFileType' => 'image',
  59 + ],
  60 + ]); ?>
  61 +
  62 +
  63 + <?= $form->field($model, 'banner')->widget(\kartik\file\FileInput::classname(), [
  64 + 'language' => 'ru',
  65 + 'options' => [
  66 + 'accept' => 'image/*',
  67 + 'multiple' => false,
  68 + ],
  69 + 'pluginOptions' => [
  70 + 'allowedFileExtensions' => ['jpg', 'gif', 'png'],
  71 + 'initialPreview' => !empty($model->getImageUrl('banner')) ? \common\components\artboximage\ArtboxImageHelper::getImage($model->getImageUrl('banner'), 'list') : '',
  72 + 'deleteUrl' => \yii\helpers\Url::to(['/product/manage/delimg', 'id' => $model->primaryKey]),
  73 + 'initialPreviewConfig' => $model->getImagesConfig('banner'),
  74 + 'overwriteInitial' => true,
  75 + 'showUpload' => false,
  76 + 'previewFileType' => 'image',
  77 + ],
  78 + ]); ?>
  79 +
  80 + <?= $form->field($model, 'products_file')->widget(\kartik\file\FileInput::classname(), [
  81 + 'language' => 'ru'
  82 + ]); ?>
  83 +
  84 +
  85 + <?= $form->field($model, 'meta_title')->textInput(['maxlength' => true]) ?>
  86 +
  87 + <?= $form->field($model, 'description')->textInput(['maxlength' => true]) ?>
  88 +
  89 + <?= $form->field($model, 'h1')->textInput(['maxlength' => true]) ?>
  90 +
  91 + <?= $form->field($model, 'seo_text')->textarea(['rows' => 6]) ?>
  92 +
  93 + <?= $form->field($model, 'status')->checkbox() ?>
  94 +
  95 + <?= $form->field($model, 'sale')->checkbox() ?>
  96 +
  97 + <?= $form->field($model, 'is_event')->checkbox() ?>
  98 +
  99 + <?= $form->field($model, 'percent')->textInput() ?>
  100 +
  101 +
  102 +
  103 + <div class="form-group">
  104 + <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  105 + </div>
  106 +
  107 + <?php ActiveForm::end(); ?>
  108 +
  109 +</div>
... ...
backend/views/event/_search.php 0 → 100755
  1 +++ a/backend/views/event/_search.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\ActiveForm;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\EventSearch */
  8 +/* @var $form yii\widgets\ActiveForm */
  9 +?>
  10 +
  11 +<div class="event-search">
  12 +
  13 + <?php $form = ActiveForm::begin([
  14 + 'action' => ['index'],
  15 + 'method' => 'get',
  16 + ]); ?>
  17 +
  18 + <?= $form->field($model, 'event_id') ?>
  19 +
  20 + <?= $form->field($model, 'name') ?>
  21 +
  22 + <?= $form->field($model, 'alias') ?>
  23 +
  24 + <?= $form->field($model, 'body') ?>
  25 +
  26 + <?= $form->field($model, 'image') ?>
  27 +
  28 + <?php // echo $form->field($model, 'meta_title') ?>
  29 +
  30 + <?php // echo $form->field($model, 'description') ?>
  31 +
  32 + <?php // echo $form->field($model, 'h1') ?>
  33 +
  34 + <?php // echo $form->field($model, 'seo_text') ?>
  35 +
  36 + <?php // echo $form->field($model, 'created_at') ?>
  37 +
  38 + <?php // echo $form->field($model, 'updated_at') ?>
  39 +
  40 + <?php // echo $form->field($model, 'end_at') ?>
  41 +
  42 + <div class="form-group">
  43 + <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?>
  44 + <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?>
  45 + </div>
  46 +
  47 + <?php ActiveForm::end(); ?>
  48 +
  49 +</div>
... ...
backend/views/event/create.php 0 → 100755
  1 +++ a/backend/views/event/create.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\Event */
  8 +
  9 +$this->title = Yii::t('app', 'Create Event');
  10 +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Events'), 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="event-create">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <?= $this->render('_form', [
  18 + 'model' => $model,
  19 + ]) ?>
  20 +
  21 +</div>
... ...
backend/views/event/index.php 0 → 100755
  1 +++ a/backend/views/event/index.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\grid\GridView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $searchModel common\models\EventSearch */
  8 +/* @var $dataProvider yii\data\ActiveDataProvider */
  9 +
  10 +$this->title = Yii::t('app', 'Events');
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="event-index">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 + <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
  17 +
  18 + <p>
  19 + <?= Html::a(Yii::t('app', 'Create Event'), ['create'], ['class' => 'btn btn-success']) ?>
  20 + </p>
  21 + <?= GridView::widget([
  22 + 'dataProvider' => $dataProvider,
  23 + 'filterModel' => $searchModel,
  24 + 'columns' => [
  25 + ['class' => 'yii\grid\SerialColumn'],
  26 +
  27 + 'event_id',
  28 + 'name',
  29 + 'alias',
  30 + [
  31 + 'format' => 'image',
  32 + 'attribute'=>'image',
  33 + ],
  34 + // 'meta_title',
  35 + // 'description',
  36 + // 'h1',
  37 + // 'seo_text:ntext',
  38 + // 'created_at',
  39 + // 'updated_at',
  40 + // 'end_at',
  41 +
  42 + ['class' => 'yii\grid\ActionColumn'],
  43 + ],
  44 + ]); ?>
  45 +</div>
... ...
backend/views/event/update.php 0 → 100755
  1 +++ a/backend/views/event/update.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +
  5 +/* @var $this yii\web\View */
  6 +/* @var $model common\models\Event */
  7 +
  8 +$this->title = Yii::t('app', 'Update {modelClass}: ', [
  9 + 'modelClass' => 'Event',
  10 +]) . $model->name;
  11 +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Events'), 'url' => ['index']];
  12 +$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->event_id]];
  13 +$this->params['breadcrumbs'][] = Yii::t('app', 'Update');
  14 +?>
  15 +<div class="event-update">
  16 +
  17 + <h1><?= Html::encode($this->title) ?></h1>
  18 +
  19 + <?= $this->render('_form', [
  20 + 'model' => $model,
  21 + ]) ?>
  22 +
  23 +</div>
... ...
backend/views/event/view.php 0 → 100755
  1 +++ a/backend/views/event/view.php
  1 +<?php
  2 +
  3 +use yii\helpers\Html;
  4 +use yii\widgets\DetailView;
  5 +
  6 +/* @var $this yii\web\View */
  7 +/* @var $model common\models\Event */
  8 +
  9 +$this->title = $model->name;
  10 +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Events'), 'url' => ['index']];
  11 +$this->params['breadcrumbs'][] = $this->title;
  12 +?>
  13 +<div class="event-view">
  14 +
  15 + <h1><?= Html::encode($this->title) ?></h1>
  16 +
  17 + <p>
  18 + <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->event_id], ['class' => 'btn btn-primary']) ?>
  19 + <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->event_id], [
  20 + 'class' => 'btn btn-danger',
  21 + 'data' => [
  22 + 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'),
  23 + 'method' => 'post',
  24 + ],
  25 + ]) ?>
  26 + </p>
  27 +
  28 + <?= DetailView::widget([
  29 + 'model' => $model,
  30 + 'attributes' => [
  31 + 'event_id',
  32 + 'name',
  33 + 'alias',
  34 + 'meta_title',
  35 + 'description',
  36 + 'h1',
  37 + ],
  38 + ]) ?>
  39 +
  40 +</div>
... ...
backend/views/feedback/index.php 0 → 100755
  1 +++ a/backend/views/feedback/index.php
  1 +<?php
  2 + use common\models\FeedbackSearch;
  3 + use yii\bootstrap\Html;
  4 + use yii\data\ActiveDataProvider;
  5 + use yii\grid\GridView;
  6 + use yii\web\View;
  7 + /**
  8 + * @var ActiveDataProvider $dataProvider
  9 + * @var FeedbackSearch $searchModel
  10 + * @var View $this
  11 + */
  12 + $this->title = 'Feedback';
  13 + $this->params['breadcrumbs'][] = $this->title;
  14 +?>
  15 +<div class="feedback-index">
  16 +
  17 + <h1><?= Html::encode($this->title) ?></h1>
  18 + <?= GridView::widget([
  19 + 'dataProvider' => $dataProvider,
  20 + 'filterModel' => $searchModel,
  21 + 'columns' => [
  22 + ['class' => 'yii\grid\SerialColumn'],
  23 + 'feedback_id',
  24 + 'name',
  25 + 'phone',
  26 + 'date_add:date',
  27 + [
  28 + 'class' => 'yii\grid\ActionColumn',
  29 + 'template' => '{delete}',
  30 + ],
  31 + ],
  32 + ]); ?>
  33 +</div>
0 34 \ No newline at end of file
... ...
backend/views/layouts/admin.php 0 → 100755
  1 +++ a/backend/views/layouts/admin.php
  1 +<?php
  2 +use yii\widgets\Breadcrumbs;
  3 +use common\widgets\Alert;
  4 +
  5 +/* @var $content string */
  6 +$this->beginContent('@app/views/layouts/main.php');
  7 +?>
  8 +
  9 + <?= $this->render('header') ?>
  10 + <!-- Left side column. contains the logo and sidebar -->
  11 + <?= $this->render('main-sidebar') ?>
  12 +
  13 + <!-- Content Wrapper. Contains page content -->
  14 + <div class="content-wrapper">
  15 + <section class="content">
  16 + <?= Breadcrumbs::widget([
  17 + 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
  18 + ]) ?>
  19 + <?= Alert::widget() ?>
  20 +
  21 + <?= $content; ?>
  22 + </section>
  23 + </div><!-- /.content-wrapper -->
  24 + <?= $this->render('footer') ?>
  25 +
  26 +
  27 +
  28 + <!-- Control Sidebar -->
  29 + <?= $this->render('control-sidebar') ?>
  30 + <!-- /.control-sidebar -->
  31 + <!-- Add the sidebar's background. This div must be placed
  32 + immediately after the control sidebar -->
  33 + <div class="control-sidebar-bg"></div>
  34 +<?php $this->endContent() ?>
0 35 \ No newline at end of file
... ...
backend/views/layouts/control-sidebar.php 0 → 100755
  1 +++ a/backend/views/layouts/control-sidebar.php
  1 +<aside class="control-sidebar control-sidebar-dark">
  2 + <!-- Create the tabs -->
  3 + <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
  4 + <li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
  5 + <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
  6 + </ul>
  7 + <!-- Tab panes -->
  8 + <div class="tab-content">
  9 + <!-- Home tab content -->
  10 + <div class="tab-pane" id="control-sidebar-home-tab">
  11 + <h3 class="control-sidebar-heading">Recent Activity</h3>
  12 + <ul class="control-sidebar-menu">
  13 + <li>
  14 + <a href="javascript::;">
  15 + <i class="menu-icon fa fa-birthday-cake bg-red"></i>
  16 +
  17 + <div class="menu-info">
  18 + <h4 class="control-sidebar-subheading">Langdon's Birthday</h4>
  19 +
  20 + <p>Will be 23 on April 24th</p>
  21 + </div>
  22 + </a>
  23 + </li>
  24 + <li>
  25 + <a href="javascript::;">
  26 + <i class="menu-icon fa fa-user bg-yellow"></i>
  27 +
  28 + <div class="menu-info">
  29 + <h4 class="control-sidebar-subheading">Frodo Updated His Profile</h4>
  30 +
  31 + <p>New phone +1(800)555-1234</p>
  32 + </div>
  33 + </a>
  34 + </li>
  35 + <li>
  36 + <a href="javascript::;">
  37 + <i class="menu-icon fa fa-envelope-o bg-light-blue"></i>
  38 +
  39 + <div class="menu-info">
  40 + <h4 class="control-sidebar-subheading">Nora Joined Mailing List</h4>
  41 +
  42 + <p>nora@example.com</p>
  43 + </div>
  44 + </a>
  45 + </li>
  46 + <li>
  47 + <a href="javascript::;">
  48 + <i class="menu-icon fa fa-file-code-o bg-green"></i>
  49 +
  50 + <div class="menu-info">
  51 + <h4 class="control-sidebar-subheading">Cron Job 254 Executed</h4>
  52 +
  53 + <p>Execution time 5 seconds</p>
  54 + </div>
  55 + </a>
  56 + </li>
  57 + </ul>
  58 + <!-- /.control-sidebar-menu -->
  59 +
  60 + <h3 class="control-sidebar-heading">Tasks Progress</h3>
  61 + <ul class="control-sidebar-menu">
  62 + <li>
  63 + <a href="javascript::;">
  64 + <h4 class="control-sidebar-subheading">
  65 + Custom Template Design
  66 + <span class="label label-danger pull-right">70%</span>
  67 + </h4>
  68 +
  69 + <div class="progress progress-xxs">
  70 + <div class="progress-bar progress-bar-danger" style="width: 70%"></div>
  71 + </div>
  72 + </a>
  73 + </li>
  74 + <li>
  75 + <a href="javascript::;">
  76 + <h4 class="control-sidebar-subheading">
  77 + Update Resume
  78 + <span class="label label-success pull-right">95%</span>
  79 + </h4>
  80 +
  81 + <div class="progress progress-xxs">
  82 + <div class="progress-bar progress-bar-success" style="width: 95%"></div>
  83 + </div>
  84 + </a>
  85 + </li>
  86 + <li>
  87 + <a href="javascript::;">
  88 + <h4 class="control-sidebar-subheading">
  89 + Laravel Integration
  90 + <span class="label label-warning pull-right">50%</span>
  91 + </h4>
  92 +
  93 + <div class="progress progress-xxs">
  94 + <div class="progress-bar progress-bar-warning" style="width: 50%"></div>
  95 + </div>
  96 + </a>
  97 + </li>
  98 + <li>
  99 + <a href="javascript::;">
  100 + <h4 class="control-sidebar-subheading">
  101 + Back End Framework
  102 + <span class="label label-primary pull-right">68%</span>
  103 + </h4>
  104 +
  105 + <div class="progress progress-xxs">
  106 + <div class="progress-bar progress-bar-primary" style="width: 68%"></div>
  107 + </div>
  108 + </a>
  109 + </li>
  110 + </ul>
  111 + <!-- /.control-sidebar-menu -->
  112 +
  113 + </div>
  114 + <!-- /.tab-pane -->
  115 + <!-- Stats tab content -->
  116 + <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div>
  117 + <!-- /.tab-pane -->
  118 + <!-- Settings tab content -->
  119 + <div class="tab-pane" id="control-sidebar-settings-tab">
  120 + <form method="post">
  121 + <h3 class="control-sidebar-heading">General Settings</h3>
  122 +
  123 + <div class="form-group">
  124 + <label class="control-sidebar-subheading">
  125 + Report panel usage
  126 + <input type="checkbox" class="pull-right" checked>
  127 + </label>
  128 +
  129 + <p>
  130 + Some information about this general settings option
  131 + </p>
  132 + </div>
  133 + <!-- /.form-group -->
  134 +
  135 + <div class="form-group">
  136 + <label class="control-sidebar-subheading">
  137 + Allow mail redirect
  138 + <input type="checkbox" class="pull-right" checked>
  139 + </label>
  140 +
  141 + <p>
  142 + Other sets of options are available
  143 + </p>
  144 + </div>
  145 + <!-- /.form-group -->
  146 +
  147 + <div class="form-group">
  148 + <label class="control-sidebar-subheading">
  149 + Expose author name in posts
  150 + <input type="checkbox" class="pull-right" checked>
  151 + </label>
  152 +
  153 + <p>
  154 + Allow the user to show his name in blog posts
  155 + </p>
  156 + </div>
  157 + <!-- /.form-group -->
  158 +
  159 + <h3 class="control-sidebar-heading">Chat Settings</h3>
  160 +
  161 + <div class="form-group">
  162 + <label class="control-sidebar-subheading">
  163 + Show me as online
  164 + <input type="checkbox" class="pull-right" checked>
  165 + </label>
  166 + </div>
  167 + <!-- /.form-group -->
  168 +
  169 + <div class="form-group">
  170 + <label class="control-sidebar-subheading">
  171 + Turn off notifications
  172 + <input type="checkbox" class="pull-right">
  173 + </label>
  174 + </div>
  175 + <!-- /.form-group -->
  176 +
  177 + <div class="form-group">
  178 + <label class="control-sidebar-subheading">
  179 + Delete chat history
  180 + <a href="javascript::;" class="text-red pull-right"><i class="fa fa-trash-o"></i></a>
  181 + </label>
  182 + </div>
  183 + <!-- /.form-group -->
  184 + </form>
  185 + </div>
  186 + <!-- /.tab-pane -->
  187 + </div>
  188 +</aside>
0 189 \ No newline at end of file
... ...
backend/views/layouts/footer.php 0 → 100755
  1 +++ a/backend/views/layouts/footer.php
  1 +<footer class="main-footer">
  2 +
  3 +</footer>
0 4 \ No newline at end of file
... ...
backend/views/layouts/header.php 0 → 100755
  1 +++ a/backend/views/layouts/header.php
  1 +<?php
  2 +
  3 +/* @var $this \yii\web\View */
  4 +/* @var $content string */
  5 +
  6 +use yii\helpers\Html;
  7 +use yii\bootstrap\Nav;
  8 +use yii\bootstrap\NavBar;
  9 +use yii\helpers\Url;
  10 +use yii\widgets\Breadcrumbs;
  11 +use backend\assets\AppAsset;
  12 +use common\widgets\Alert;
  13 +use yii\widgets\Menu;
  14 +
  15 +AppAsset::register($this);
  16 +?>
  17 +<header class="main-header">
  18 + <!-- Logo -->
  19 + <a href="/admin/" class="logo">
  20 + <!-- mini logo for sidebar mini 50x50 pixels -->
  21 + <span class="logo-mini"><b>A</b>BOX</span>
  22 + <!-- logo for regular state and mobile devices -->
  23 + <span class="logo-lg"><b>Art</b>BOX</span>
  24 + </a>
  25 + <!-- Header Navbar: style can be found in header.less -->
  26 + <nav class="navbar navbar-static-top" role="navigation">
  27 + <!-- Sidebar toggle button-->
  28 + <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
  29 + <span class="sr-only">Toggle navigation</span>
  30 + </a>
  31 +
  32 + <div class="navbar-custom-menu">
  33 + </div>
  34 + </nav>
  35 +</header>
0 36 \ No newline at end of file
... ...