Commit db67ecfb499ec5dd9962fc9ae07753665f886387

Authored by Karnovsky A
2 parents 428b003d a66c29a8

Merge branch 'master' of gitlab.artweb.com.ua:root/new_rukzachok

backend/assets/AdminLteAsset.php
... ... @@ -27,9 +27,9 @@ class AdminLteAsset extends AssetBundle
27 27 ];
28 28 public $depends = [
29 29 'yii\web\YiiAsset',
30   - 'yii\bootstrap\BootstrapAsset',
  30 + 'common\modules\file\FileUploadAsset',
31 31 'yii\bootstrap\BootstrapPluginAsset',
32 32 'backend\assets\FontAwesomeAsset',
33   - 'common\modules\file\FileUploadAsset'
  33 +
34 34 ];
35 35 }
36 36 \ No newline at end of file
... ...
backend/controllers/OrdersController.php
... ... @@ -2,16 +2,16 @@
2 2  
3 3 namespace backend\controllers;
4 4  
  5 +use backend\models\OrdersSearch;
5 6 use Yii;
6 7 use yii\web\Controller;
7   -use yii\filters\AccessControl;
8 8 use yii\filters\VerbFilter;
9 9 use yii\data\ActiveDataProvider;
10 10 use yii\web\HttpException;
11 11 use backend\models\Orders;
12 12 use backend\models\OrdersProducts;
13 13 use common\modules\product\models\ProductVariant;
14   -
  14 +use yii\web\NotFoundHttpException;
15 15  
16 16  
17 17 class OrdersController extends Controller
... ... @@ -33,29 +33,9 @@ class OrdersController extends Controller
33 33  
34 34 public function actionIndex()
35 35 {
36   - $searchModel = new Orders;
37   - $searchModel->load(Yii::$app->request->queryParams);
38   - $query = Orders::find();
39   - if(!empty($searchModel->labels))$query->andWhere(['label'=>$searchModel->labels]);
40   - //if(!empty($searchModel->date_time))$query->andFilterWhere(['like', 'date_time', $searchModel->date_time]);
41   - if(!empty($searchModel->username))$query->andFilterWhere(['like', 'username', $searchModel->username]);
42   - if(!empty($searchModel->id))$query->andFilterWhere(['like', 'id', $searchModel->id]);
43   - if(!empty($searchModel->phone))$query->andFilterWhere(['like', 'phone', $searchModel->phone]);
44   - if(!empty($searchModel->name))$query->andFilterWhere(['like', 'name', $searchModel->name]);
45   - if(!empty($searchModel->total))$query->andFilterWhere(['like', 'total', $searchModel->total]);
46   - if(!empty($searchModel->reserve))$query->andFilterWhere(['like', 'reserve', $searchModel->reserve]);
47   - if(!empty($searchModel->status))$query->andFilterWhere(['like', 'status', $searchModel->status]);
48   -
49   -// var_dump($searchModel->name);
50   -// die;
51   - $dataProvider = new ActiveDataProvider([
52   - 'query' =>$query,
53   - 'sort'=> ['defaultOrder' => ['id'=>SORT_DESC]],
54   - 'pagination' => [
55   - 'pageSize' => 20,
56   - ],
57   - ]);
58   -
  36 + $searchModel = new OrdersSearch();
  37 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  38 +
59 39 return $this->render('index', [
60 40 'dataProvider'=>$dataProvider,
61 41 'searchModel'=>$searchModel,
... ... @@ -78,7 +58,7 @@ class OrdersController extends Controller
78 58 $model_orderproducts = new OrdersProducts;
79 59  
80 60  
81   - return $this->renderPartial('show', [
  61 + return $this->renderAjax('show', [
82 62 'model' => $model,
83 63 'model_orderproducts'=>$model_orderproducts,
84 64 'dataProvider' => $dataProvider,
... ... @@ -90,14 +70,12 @@ class OrdersController extends Controller
90 70 $model = Orders::findOne($_POST['order_id']);
91 71 $model->label = $_POST['label_id'];
92 72 $model->save();
93   - Yii::$app->and();
94 73 }
95 74  
96 75 public function actionPayupdate(){
97 76 $model = Orders::findOne($_POST['order_id']);
98 77 $model->pay = $_POST['pay_id'];
99 78 $model->save();
100   - Yii::$app->and();
101 79 }
102 80  
103 81 public function actionDelete(){
... ... @@ -111,15 +89,15 @@ class OrdersController extends Controller
111 89 $model = new OrdersProducts;
112 90 if ($model->load(Yii::$app->request->post())) {
113 91  
114   - if(!$modelMod = ProductVariant::find()->with(['product'])->where(['sku'=>$model->sku])->one())
115   - throw new HttpException(404, 'Данного артикля не существует!');
116   - $model->product_name = $modelMod->product->name;
117   - $model->name = $modelMod->name;
118   - $model->sku = $modelMod->sku;
119   - $model->price = $modelMod->price;
120   - $model->sum_cost = $model->count*$modelMod->price;
121   - $model->mod_id = $modelMod->id;
122   - $model->save();
  92 + if(!$modelMod = ProductVariant::find()->with(['product'])->where(['sku'=>$model->sku])->one())
  93 + throw new HttpException(404, 'Данного артикля не существует!');
  94 + $model->product_name = $modelMod->product->name;
  95 + $model->name = $modelMod->name;
  96 + $model->sku = $modelMod->sku;
  97 + $model->price = $modelMod->price;
  98 + $model->sum_cost = $model->count*$modelMod->price;
  99 + $model->mod_id = $modelMod->id;
  100 + $model->save();
123 101 //return Yii::$app->response->redirect(['/admin/orders/show','id'=>$_GET['order_id']]);
124 102 }
125 103  
... ...
backend/models/Orders.php
... ... @@ -16,7 +16,7 @@ class Orders extends \yii\db\ActiveRecord
16 16 {
17 17 return [
18 18 [['name'], 'required'],
19   - [['user_id','adress','body','total','status','email','patronymic','surname',
  19 + [['user_id','adress','body','total','status','email',
20 20 'comment','labels','pay','date_dedline','phone','phone2','numbercard','delivery',
21 21 'declaration','stock','consignment','payment', 'insurance',
22 22 'amount_imposed','shipping_by','city','date_time', 'id' ], 'safe'],
... ... @@ -28,31 +28,29 @@ class Orders extends \yii\db\ActiveRecord
28 28 {
29 29 return [
30 30 'id'=>'№ заказа',
31   - 'name'=>'Имя',
  31 + 'name'=>'ФИО',
32 32 'phone'=>'Телефон',
33   - 'phone2'=>'Телефон 2',
  33 + 'phone2'=>'Телефон 2',
34 34 'adress'=>'Адрес',
35   - 'body'=>'Сообщение',
36   - 'reserve'=>'Резерв',
37   - 'status'=>'Статус',
38   - 'email'=>'E-mail',
39   - 'patronymic'=>'Очество',
40   - 'surname'=>'Фамилия',
41   - 'total'=>'Сумма',
42   - 'labels'=>'Метки',
43   - 'label'=>'Метка',
44   - 'comment'=>'Комментарий менеджера',
45   - 'date_dedline'=>'Дедлайн',
46   - 'numbercard'=>'№ карточки',
47   - 'delivery'=>'Доставка',
48   - 'declaration'=>'Декларация №',
49   - 'stock'=>'№ склада',
50   - 'consignment'=>'№ накладной',
51   - 'payment'=>'Способ оплаты',
52   - 'insurance'=>'Страховка',
53   - 'amount_imposed'=>'Сумма наложенного',
54   - 'shipping_by'=>'Отправка за счет',
55   - 'city'=>'Город'
  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'=>'Город'
56 54 ];
57 55 }
58 56  
... ...
backend/models/OrdersSearch.php 0 → 100644
  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/views/event/_form.php
1 1 <?php
2 2  
3   -use yii\jui\DatePicker;
  3 +use kartik\date\DatePicker;
4 4 use yii\helpers\Html;
5 5 use yii\widgets\ActiveForm;
6 6 use mihaildev\ckeditor\CKEditor;
... ... @@ -31,9 +31,10 @@ use mihaildev\elfinder\ElFinder;
31 31  
32 32 <?= $form->field($model, 'end_at')
33 33 ->widget(DatePicker::className(), [
34   - 'dateFormat' => 'yyyy-MM-dd',
35   - 'clientOptions' => [ 'minDate' => 1 ],
36   - ]) ?>
  34 + 'pluginOptions' => [
  35 + 'format' => 'dd-M-yyyy',
  36 + 'todayHighlight' => true
  37 + ]]) ?>
37 38  
38 39  
39 40 <?= \common\modules\file\widgets\ImageUploader::widget([
... ...
backend/views/layouts/header.php
... ... @@ -2,9 +2,9 @@
2 2 <!-- Logo -->
3 3 <a href="index2.html" class="logo">
4 4 <!-- mini logo for sidebar mini 50x50 pixels -->
5   - <span class="logo-mini"><b>A</b>LT</span>
  5 + <span class="logo-mini"><b>A</b>BOX</span>
6 6 <!-- logo for regular state and mobile devices -->
7   - <span class="logo-lg"><b>Admin</b>LTE</span>
  7 + <span class="logo-lg"><b>Art</b>BOX</span>
8 8 </a>
9 9 <!-- Header Navbar: style can be found in header.less -->
10 10 <nav class="navbar navbar-static-top" role="navigation">
... ... @@ -14,247 +14,6 @@
14 14 </a>
15 15  
16 16 <div class="navbar-custom-menu">
17   - <ul class="nav navbar-nav">
18   - <!-- Messages: style can be found in dropdown.less-->
19   - <li class="dropdown messages-menu">
20   - <a href="#" class="dropdown-toggle" data-toggle="dropdown">
21   - <i class="fa fa-envelope-o"></i>
22   - <span class="label label-success">4</span>
23   - </a>
24   - <ul class="dropdown-menu">
25   - <li class="header">You have 4 messages</li>
26   - <li>
27   - <!-- inner menu: contains the actual data -->
28   - <ul class="menu">
29   - <li><!-- start message -->
30   - <a href="#">
31   - <div class="pull-left">
32   - <img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
33   - </div>
34   - <h4>
35   - Support Team
36   - <small><i class="fa fa-clock-o"></i> 5 mins</small>
37   - </h4>
38   - <p>Why not buy a new awesome theme?</p>
39   - </a>
40   - </li>
41   - <!-- end message -->
42   - <li>
43   - <a href="#">
44   - <div class="pull-left">
45   - <img src="dist/img/user3-128x128.jpg" class="img-circle" alt="User Image">
46   - </div>
47   - <h4>
48   - AdminLTE Design Team
49   - <small><i class="fa fa-clock-o"></i> 2 hours</small>
50   - </h4>
51   - <p>Why not buy a new awesome theme?</p>
52   - </a>
53   - </li>
54   - <li>
55   - <a href="#">
56   - <div class="pull-left">
57   - <img src="dist/img/user4-128x128.jpg" class="img-circle" alt="User Image">
58   - </div>
59   - <h4>
60   - Developers
61   - <small><i class="fa fa-clock-o"></i> Today</small>
62   - </h4>
63   - <p>Why not buy a new awesome theme?</p>
64   - </a>
65   - </li>
66   - <li>
67   - <a href="#">
68   - <div class="pull-left">
69   - <img src="dist/img/user3-128x128.jpg" class="img-circle" alt="User Image">
70   - </div>
71   - <h4>
72   - Sales Department
73   - <small><i class="fa fa-clock-o"></i> Yesterday</small>
74   - </h4>
75   - <p>Why not buy a new awesome theme?</p>
76   - </a>
77   - </li>
78   - <li>
79   - <a href="#">
80   - <div class="pull-left">
81   - <img src="dist/img/user4-128x128.jpg" class="img-circle" alt="User Image">
82   - </div>
83   - <h4>
84   - Reviewers
85   - <small><i class="fa fa-clock-o"></i> 2 days</small>
86   - </h4>
87   - <p>Why not buy a new awesome theme?</p>
88   - </a>
89   - </li>
90   - </ul>
91   - </li>
92   - <li class="footer"><a href="#">See All Messages</a></li>
93   - </ul>
94   - </li>
95   - <!-- Notifications: style can be found in dropdown.less -->
96   - <li class="dropdown notifications-menu">
97   - <a href="#" class="dropdown-toggle" data-toggle="dropdown">
98   - <i class="fa fa-bell-o"></i>
99   - <span class="label label-warning">10</span>
100   - </a>
101   - <ul class="dropdown-menu">
102   - <li class="header">You have 10 notifications</li>
103   - <li>
104   - <!-- inner menu: contains the actual data -->
105   - <ul class="menu">
106   - <li>
107   - <a href="#">
108   - <i class="fa fa-users text-aqua"></i> 5 new members joined today
109   - </a>
110   - </li>
111   - <li>
112   - <a href="#">
113   - <i class="fa fa-warning text-yellow"></i> Very long description here that may not fit into the
114   - page and may cause design problems
115   - </a>
116   - </li>
117   - <li>
118   - <a href="#">
119   - <i class="fa fa-users text-red"></i> 5 new members joined
120   - </a>
121   - </li>
122   - <li>
123   - <a href="#">
124   - <i class="fa fa-shopping-cart text-green"></i> 25 sales made
125   - </a>
126   - </li>
127   - <li>
128   - <a href="#">
129   - <i class="fa fa-user text-red"></i> You changed your username
130   - </a>
131   - </li>
132   - </ul>
133   - </li>
134   - <li class="footer"><a href="#">View all</a></li>
135   - </ul>
136   - </li>
137   - <!-- Tasks: style can be found in dropdown.less -->
138   - <li class="dropdown tasks-menu">
139   - <a href="#" class="dropdown-toggle" data-toggle="dropdown">
140   - <i class="fa fa-flag-o"></i>
141   - <span class="label label-danger">9</span>
142   - </a>
143   - <ul class="dropdown-menu">
144   - <li class="header">You have 9 tasks</li>
145   - <li>
146   - <!-- inner menu: contains the actual data -->
147   - <ul class="menu">
148   - <li><!-- Task item -->
149   - <a href="#">
150   - <h3>
151   - Design some buttons
152   - <small class="pull-right">20%</small>
153   - </h3>
154   - <div class="progress xs">
155   - <div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
156   - <span class="sr-only">20% Complete</span>
157   - </div>
158   - </div>
159   - </a>
160   - </li>
161   - <!-- end task item -->
162   - <li><!-- Task item -->
163   - <a href="#">
164   - <h3>
165   - Create a nice theme
166   - <small class="pull-right">40%</small>
167   - </h3>
168   - <div class="progress xs">
169   - <div class="progress-bar progress-bar-green" style="width: 40%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
170   - <span class="sr-only">40% Complete</span>
171   - </div>
172   - </div>
173   - </a>
174   - </li>
175   - <!-- end task item -->
176   - <li><!-- Task item -->
177   - <a href="#">
178   - <h3>
179   - Some task I need to do
180   - <small class="pull-right">60%</small>
181   - </h3>
182   - <div class="progress xs">
183   - <div class="progress-bar progress-bar-red" style="width: 60%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
184   - <span class="sr-only">60% Complete</span>
185   - </div>
186   - </div>
187   - </a>
188   - </li>
189   - <!-- end task item -->
190   - <li><!-- Task item -->
191   - <a href="#">
192   - <h3>
193   - Make beautiful transitions
194   - <small class="pull-right">80%</small>
195   - </h3>
196   - <div class="progress xs">
197   - <div class="progress-bar progress-bar-yellow" style="width: 80%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
198   - <span class="sr-only">80% Complete</span>
199   - </div>
200   - </div>
201   - </a>
202   - </li>
203   - <!-- end task item -->
204   - </ul>
205   - </li>
206   - <li class="footer">
207   - <a href="#">View all tasks</a>
208   - </li>
209   - </ul>
210   - </li>
211   - <!-- User Account: style can be found in dropdown.less -->
212   - <li class="dropdown user user-menu">
213   - <a href="#" class="dropdown-toggle" data-toggle="dropdown">
214   - <!--img src="dist/img/user2-160x160.jpg" class="user-image" alt="User Image"-->
215   - <span class="hidden-xs">Alexander Pierce</span>
216   - </a>
217   - <ul class="dropdown-menu">
218   - <!-- User image -->
219   - <li class="user-header">
220   - <img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
221   -
222   - <p>
223   - Alexander Pierce - Web Developer
224   - <small>Member since Nov. 2012</small>
225   - </p>
226   - </li>
227   - <!-- Menu Body -->
228   - <li class="user-body">
229   - <div class="row">
230   - <div class="col-xs-4 text-center">
231   - <a href="#">Followers</a>
232   - </div>
233   - <div class="col-xs-4 text-center">
234   - <a href="#">Sales</a>
235   - </div>
236   - <div class="col-xs-4 text-center">
237   - <a href="#">Friends</a>
238   - </div>
239   - </div>
240   - <!-- /.row -->
241   - </li>
242   - <!-- Menu Footer-->
243   - <li class="user-footer">
244   - <div class="pull-left">
245   - <a href="#" class="btn btn-default btn-flat">Profile</a>
246   - </div>
247   - <div class="pull-right">
248   - <a href="#" class="btn btn-default btn-flat">Sign out</a>
249   - </div>
250   - </li>
251   - </ul>
252   - </li>
253   - <!-- Control Sidebar Toggle Button -->
254   - <li>
255   - <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
256   - </li>
257   - </ul>
258 17 </div>
259 18 </nav>
260 19 </header>
261 20 \ No newline at end of file
... ...
backend/views/layouts/main-sidebar.php
... ... @@ -4,25 +4,12 @@ use yii\widgets\Menu;
4 4 <aside class="main-sidebar">
5 5 <!-- sidebar: style can be found in sidebar.less -->
6 6 <section class="sidebar">
7   - <!-- Sidebar user panel -->
8   - <!-- search form -->
9   - <form action="#" method="get" class="sidebar-form">
10   - <div class="input-group">
11   - <input type="text" name="q" class="form-control" placeholder="Search...">
12   - <span class="input-group-btn">
13   - <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
14   - </button>
15   - </span>
16   - </div>
17   - </form>
18   - <!-- /.search form -->
19 7 <?=
20 8 Menu::widget([
21 9 'options' => ['class' => 'sidebar-menu'],
22 10 'submenuTemplate' => "\n<ul class='treeview-menu'>\n{items}\n</ul>\n",
23 11  
24 12 'items' => [
25   - ['label' => 'MAIN NAVIGATION', 'options'=>['class'=>'header']],
26 13 ['label' => 'Заказы', 'url' => ['/orders/index'], 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-shopping-cart"></i> <span>{label}</span></a>'],
27 14 [
28 15 'label' => 'eCommerce',
... ...
backend/views/orders/index.php
... ... @@ -5,8 +5,6 @@ use yii\bootstrap\ActiveForm;
5 5 use yii\helpers\ArrayHelper;
6 6 use backend\models\Label;
7 7 use yii\bootstrap\Modal;
8   -$this->registerJsFile('/app/modules/admin/assets/js/jquery-1.11.3.min.js');
9   -$this->registerJsFile('/app/modules/admin/assets/js/site.js');
10 8  
11 9  
12 10 $this->title = 'Заказы';
... ... @@ -15,15 +13,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
15 13 <h1>Заказы</h1>
16 14  
17 15 <?php $form = ActiveForm::begin(['id' => 'label-form','method'=>'get','action'=>['/admin/orders/index']]); ?>
18   -
19   - <?php
20   - $arr = [];
21   - foreach(Label::find()->orderBy('id')->all() as $item)
22   - {
23   - $arr[] = ['id'=>$item->id,'label'=>$item->label.'-'.$item->name];
24   - }
25   - echo $form->field($searchModel, 'labels')->inline(true)->checkboxList(ArrayHelper::map($arr, 'id', 'label'),['onClick'=>'$("#label-form").submit()']);
26   - ?>
  16 +
27 17  
28 18 <?php ActiveForm::end(); ?>
29 19  
... ... @@ -73,23 +63,24 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
73 63 //'contentOptions'=>['style'=>'max-width: 300px;']
74 64 ],
75 65 [
76   - 'attribute' => 'label',
77   - 'value' => function ($model, $key, $index, $column) {
78   - // var_dump($model); var_dump($key); exit;
79   - return Html::activeDropDownList($model, 'label',
80   - yii\helpers\ArrayHelper::map(Label::find()->orderBy('id')->asArray()->all(), 'id', 'label'),
81   - [
82   - 'prompt' => 'Нет',
83   - 'onchange' => "$.ajax({
84   - url: \"/admin/orders/labelupdate\",
85   - type: \"post\",
86   - data: { order_id: $model->id, label_id : this.value},
87   - });"
88   - ]
  66 + 'filter' => yii\helpers\ArrayHelper::map(Label::find()->orderBy('id')->asArray()->all(), 'id', 'label'),
  67 + 'attribute' => 'label',
  68 + 'value' => function ($model, $key, $index, $column) {
  69 + // var_dump($model); var_dump($key); exit;
  70 + return Html::activeDropDownList($model, 'label',
  71 + yii\helpers\ArrayHelper::map(Label::find()->orderBy('id')->asArray()->all(), 'id', 'label'),
  72 + [
  73 + 'prompt' => 'Нет',
  74 + 'onchange' => "$.ajax({
  75 + url: \"/admin/orders/labelupdate\",
  76 + type: \"post\",
  77 + data: { order_id: $model->id, label_id : this.value},
  78 + });"
  79 + ]
89 80  
90   - );
91   - },
92   - 'format' => 'raw',
  81 + );
  82 + },
  83 + 'format' => 'raw',
93 84 ],
94 85 [
95 86 'attribute' => 'pay',
... ...
backend/views/orders/show.php
... ... @@ -5,8 +5,7 @@ use yii\bootstrap\ActiveForm;
5 5 use yii\helpers\ArrayHelper;
6 6 use common\models\Delivery;
7 7 use yii\bootstrap\Modal;
8   -
9   -$this->registerCssFile('/app/modules/admin/assets/css/admin_order.css');
  8 +use kartik\date\DatePicker;
10 9  
11 10  
12 11 // $this->title = 'Заказ №'.$model->id;
... ... @@ -44,8 +43,13 @@ $this-&gt;registerCssFile(&#39;/app/modules/admin/assets/css/admin_order.css&#39;);
44 43 <label class="control-label col-sm-3">Дата</label>
45 44 <?=$model->date_time?>
46 45 </div>
47   -<?= $form->field($model,'date_dedline')->widget(\yii\jui\DatePicker::className(),['clientOptions' => [],'options' => ['class'=>'form-control','style'=>'width:150px;'],'dateFormat' => 'yyyy-MM-dd',]) ?>
48 46  
  47 + <?= $form->field($model, 'date_dedline')
  48 + ->widget(DatePicker::className(), [
  49 + 'pluginOptions' => [
  50 + 'format' => 'dd-M-yyyy',
  51 + 'todayHighlight' => true
  52 + ]]) ?>
49 53  
50 54 <?= $form->field($model, 'name') ?>
51 55  
... ...
backend/web/css/site.css
1   -@import url("//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css");
2   -
3 1 html,
4 2 body {
5 3 height: 100%;
... ...
common/models/Orders.php
... ... @@ -51,33 +51,7 @@ class Orders extends \yii\db\ActiveRecord
51 51 return parent::beforeDelete();
52 52 }
53 53  
54   - public function contact($email,$body)
55   - {
56   - if ($this->validate()) {
57   - $body .= 'Вся сумма: '.$this->total;
58   - $body .= "\n\r";
59   - $body .= 'Имя: '.$this->name;
60   - $body .= "\n\r";
61   - $body .= 'E-mail: '.$this->email;
62   - $body .= "\n\r";
63   - $body .= 'Телефон: '.$this->phone;
64   - $body .= "\n\r";
65   - $body .= 'Адрес: '.$this->adress;
66   - $body .= "\n\r";
67   - $body .= 'Сообщение: '.$this->body;
68   - $body .= "\n\r";
69   -
70   - Yii::$app->mailer->compose()
71   - ->setTo($email)
72   - ->setFrom(['send@artweb.ua' => 'send'])
73   - ->setSubject('Заказ на сайте Рюкзаки')
74   - ->setTextBody($body)
75   - ->send();
76   - return true;
77   - } else {
78   - return false;
79   - }
80   - }
  54 +
81 55 public function addBasket ($mod_id, $count)
82 56 {
83 57 $session = new Session;
... ...
frontend/views/site/index.php
... ... @@ -16,17 +16,17 @@ $this-&gt;registerJsFile (
16 16  
17 17 <?php
18 18  
19   -echo SliderWidget::widget(["title"=>"HOME_SLIDER"]);
  19 +echo '<div class="home_banner_up">';
  20 + echo SliderWidget::widget(["title"=>"HOME_SLIDER"]);
  21 + echo BannerWidget::widget(['title' => 'HOME_RIGHT']);
20 22  
21   -echo BannerWidget::widget(['title' => 'HOME_RIGHT']);
  23 + echo '<div id="HOME_UNDER_SLIDER">';
  24 + echo BannerWidget::widget(['title' => 'HOME_UNDER_SLIDER_1']);
  25 + echo BannerWidget::widget(['title' => 'HOME_UNDER_SLIDER_2']);
  26 + echo BannerWidget::widget(['title' => 'HOME_UNDER_SLIDER_3']);
  27 + echo '</div>';
22 28  
23   -echo '<div id="HOME_UNDER_SLIDER">';
24   -
25   -echo BannerWidget::widget(['title' => 'HOME_UNDER_SLIDER_1']);
26   -echo BannerWidget::widget(['title' => 'HOME_UNDER_SLIDER_2']);
27   -echo BannerWidget::widget(['title' => 'HOME_UNDER_SLIDER_3']);
28   -
29   -echo '</div>';
  29 +echo '</div>'
30 30 ?>
31 31  
32 32 <?= \frontend\widgets\Rubrics::widget(['wrapper' => 'rubrics', 'includes' => [117,118,119,120,121]])?>
... ...
frontend/web/css/style.css
1 1 html,form,
2   -body { padding:0px;margin:0px;
  2 +body { padding:0;margin:0;
3 3 font-family: 'Roboto';font-size:14px;color:#1d1d1b;height:100%;
4 4 }
5 5 h1,h2,h3{margin:0px;padding:0px 0px 10px 0px;}
... ... @@ -8,7 +8,7 @@ h1,h2,h3{margin:0px;padding:0px 0px 10px 0px;}
8 8 .fotter .wrap .fr img{position: absolute; top: 50%; margin-top: -10px; right: 0;}
9 9 .fotter .wrap .fl {line-height: 50px;}
10 10 .both{clear:both;}
11   -h1{margin:10px 0px;font-size:24px;}
  11 +h1{margin:10px 0;font-size:24px;}
12 12 h3{margin-bottom:30px;}
13 13 p{margin:3px 0px;padding:0px;}
14 14  
... ... @@ -21,9 +21,9 @@ a:hover{color:#799920;}
21 21 .f{background: #ffffff;}
22 22  
23 23 .br{-webkit-box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46);
24   --moz-box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46);
25   -box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46);
26   -padding:20px;}
  24 + -moz-box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46);
  25 + box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46);
  26 + padding:20px;}
27 27  
28 28 nav.top{background:#f5f5f5;padding:10px 0px;border-bottom:1px solid #d2d2d2;font-size:12px;}
29 29 nav.top ul{list-style:none;margin:0px;padding:0px;}
... ... @@ -64,12 +64,17 @@ nav input[type=&quot;submit&quot;]{width:35px;height:29px;border:none;background:url(&#39;../i
64 64 .basket a:link,.basket a:visited{text-decoration:none;color:#000000;font-size:18px;}
65 65  
66 66 .basket span.more {margin-bottom: -1px}
67   -.menu{background:#596065;border:1px solid #e8e8e8;}
  67 +.menu{
  68 + background:#596065;
  69 + /*border:1px solid #e8e8e8;*/
  70 +}
68 71 .menu ul{margin:0px;padding:0px;list-style:none;}
69   -.menu ul li{float:left;border-right:1px solid #e8e8e8;}
70   -.menu ul li a{float:left;padding:15px 20px 15px 20px;text-transform: uppercase;color:#ffffff;font-size:14px;font-weight:bold;text-decoration: none;}
  72 +.menu ul li{float:left;border-left:1px solid #8b9094; height: 43px;}
  73 +.menu ul li:first-child{border-left:none;}
  74 +.menu ul li a{width: 100%; height:100%;line-height:43px;float:left;box-sizing:border-box; padding:0 21px;text-transform: uppercase;color:#ffffff;font-size:15px;text-decoration: none;font-weight: 600;}
71 75 .menu ul li a:hover{color:#e5e4e4;}
72 76 .menu ul li.active a{background:#f5f5f5;color:#596065;}
  77 +.menu ul li.active a:hover{cursor: default;}
73 78  
74 79 .menu_childs{background:#f5f5f5;border:1px solid #e8e8e8;border-bottom:2px solid #596065;}
75 80 .menu_childs ul{margin:0px;padding:0px;list-style:none;}
... ... @@ -79,7 +84,7 @@ nav input[type=&quot;submit&quot;]{width:35px;height:29px;border:none;background:url(&#39;../i
79 84  
80 85 .fr ul li{border:none;}
81 86 .akciya a{background:#f75d50;color:#ffffff;}
82   -.brends a{background:#95ba2f;color:#ffffff;}
  87 +.brands a{background:#95ba2f;color:#ffffff;}
83 88  
84 89 a.myorders{color:#f75d50}
85 90  
... ... @@ -90,11 +95,11 @@ a.myorders{color:#f75d50}
90 95 .rubrics ul{list-style:none;margin:0px;padding:0px;}
91 96 .rubrics ul li{float:left;margin:0px 35px;}
92 97 .rubrics ul li a{float:left;width:120px;padding-top:130px;text-align:center;text-transform: uppercase;color:#494949;text-decoration:none;font-weight:bold;}
93   -.rubrics ul li.item_ryukzaki a{background:url('../img/ico1.png') no-repeat;}
94   -.rubrics ul li.item_sumki a{background:url('../img/ico2.png') no-repeat;}
95   -.rubrics ul li.item_chehly a{background:url('../img/ico3.png') no-repeat;}
96   -.rubrics ul li.item_nesessery a{background:url('../img/ico4.png') no-repeat;}
97   -.rubrics ul li.item_koshelki a{background:url('../img/ico5.png') no-repeat;}
  98 +.rubrics ul li.item1 a{background:url('../img/ico1.png') no-repeat;}
  99 +.rubrics ul li.item2 a{background:url('../img/ico2.png') no-repeat;}
  100 +.rubrics ul li.item3 a{background:url('../img/ico3.png') no-repeat;}
  101 +.rubrics ul li.item4 a{background:url('../img/ico4.png') no-repeat;}
  102 +.rubrics ul li.item5 a{background:url('../img/ico5.png') no-repeat;}
98 103  
99 104  
100 105 .products{border-top:1px solid #d2d2d2;padding-bottom:30px;padding-top:20px;}
... ... @@ -197,26 +202,26 @@ ul.product_colors li img{border:1px solid #d2d2d2;}
197 202  
198 203  
199 204 .modal_box{
200   - position: fixed;
201   - left: 0;
202   - top: 0;
203   - width: 100%;
204   - height: 100%;
205   - z-index: 999;
206   -
207   - background: #000;
208   -filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50); /* IE 5.5+*/
209   --moz-opacity: 0.5; /* Mozilla 1.6 Р С‘ РЅРёР¶Рµ */
210   --khtml-opacity: 0.5; /* Konqueror 3.1, Safari 1.1 */
211   -opacity: 0.5;
212   -
  205 + position: fixed;
  206 + left: 0;
  207 + top: 0;
  208 + width: 100%;
  209 + height: 100%;
  210 + z-index: 999;
  211 +
  212 + background: #000;
  213 + filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50); /* IE 5.5+*/
  214 + -moz-opacity: 0.5; /* Mozilla 1.6 Р С‘ РЅРёР¶Рµ */
  215 + -khtml-opacity: 0.5; /* Konqueror 3.1, Safari 1.1 */
  216 + opacity: 0.5;
  217 +
213 218 }
214 219 #data_box{position:absolute;top:100px;z-index:1000;width:400px;background:#ffffff;
215   - -webkit-box-shadow: 0 0 15px #000;
216   - -moz-box-shadow: 0 0 15px #000;
217   - box-shadow: 0 0 15px #000;
218   - border:7px solid #1b9bb6;
219   - border-radius:5px;
  220 + -webkit-box-shadow: 0 0 15px #000;
  221 + -moz-box-shadow: 0 0 15px #000;
  222 + box-shadow: 0 0 15px #000;
  223 + border:7px solid #1b9bb6;
  224 + border-radius:5px;
220 225 }
221 226 #data_box .data_wrp{padding:25px 15px 15px 15px;}
222 227 #data_box .data_wrp h1{text-transform: uppercase;}
... ... @@ -229,10 +234,10 @@ opacity: 0.5;
229 234 .rightbar .control-label{float:left;width:80px;padding-top:5px;}
230 235 .form-control{outline:0;border:1px solid #d8d6d6;border-radius:5px;padding:5px 0px 5px 0px;font-size:14px;text-indent:10px;margin-bottom:3px;width:250px;}
231 236 .form-control:focus {
232   -border:#1b9bb6 1px solid;
233   -box-shadow: 0 0 10px #1b9bb6;
234   --webkit-box-shadow: 0 0 10px #1b9bb6;
235   --moz-box-shadow: 0 0 10px #1b9bb6;
  237 + border:#1b9bb6 1px solid;
  238 + box-shadow: 0 0 10px #1b9bb6;
  239 + -webkit-box-shadow: 0 0 10px #1b9bb6;
  240 + -moz-box-shadow: 0 0 10px #1b9bb6;
236 241 }
237 242 .help-block{color:red;font-size:12px;margin-bottom:5px;}
238 243  
... ... @@ -337,22 +342,22 @@ ul.social {margin-top: 20px;}
337 342 transition: all 0.5s ease-out;
338 343 }
339 344 .social .fb{background-position:-44px 0;
340   -cursor: pointer;
  345 + cursor: pointer;
341 346 }
342 347 .social .vk{
343   -cursor: pointer;
  348 + cursor: pointer;
344 349 }
345 350 .social .vk:hover{background-color:#5B7FA6;}
346 351 .social .fb:hover{background-color:#354f89;
347 352 }
348 353 .social .gp{background-position:-132px 0;
349   -cursor: pointer;}
  354 + cursor: pointer;}
350 355 .social .gp:hover{background-color:#c72f21;}
351 356 .social .tw{background-position:-144px 0;
352   -cursor: pointer;}
  357 + cursor: pointer;}
353 358 .social .tw:hover{background-color:#6398c9;}
354 359 .social .ok{background-position:-89px 0;
355   -cursor: pointer;}
  360 + cursor: pointer;}
356 361 .social .ok:hover{background-color:#f88f15;}
357 362 .social ul li a:hover{
358 363 background-color:#065baa;
... ... @@ -826,8 +831,8 @@ a.active{font-weight:bold;text-decoration: underline;}
826 831 -webkit-font-smoothing: antialiased;
827 832 }
828 833 .sort_block ul li a.asc:after {
829   - content: "";
  834 + content: "↓";
830 835 }
831 836 .sort_block ul li a.desc:after {
832   - content: "";
  837 + content: "↑";
833 838 }
834 839 \ No newline at end of file
... ...