Commit 1da765544b416bbac2b76c9a8a0d581f8ca99e64
1 parent
d86d7105
big commti
Showing
18 changed files
with
785 additions
and
173 deletions
Show diff stats
backend/controllers/EventController.php
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | namespace backend\controllers; |
4 | 4 | |
5 | +use common\modules\product\models\Import; | |
5 | 6 | use Yii; |
6 | 7 | use common\models\Event; |
7 | 8 | use common\models\EventSearch; |
... | ... | @@ -85,8 +86,13 @@ class EventController extends Controller |
85 | 86 | $model->image = $image->name; |
86 | 87 | } |
87 | 88 | |
89 | + if ( ($banner = UploadedFile::getInstance($model, 'banner')) ) { | |
90 | + $model->banner = $banner->name; | |
91 | + $image->saveAs(Yii::getAlias('@imagesDir/event/' . $banner->name)); | |
92 | + } | |
93 | + | |
88 | 94 | if ($model->save() && $image) { |
89 | - $image->saveAs(Yii::getAlias('@imagesDir/articles/' . $image->name)); | |
95 | + $image->saveAs(Yii::getAlias('@imagesDir/event/' . $image->name)); | |
90 | 96 | } |
91 | 97 | |
92 | 98 | return $this->redirect(['view', 'id' => $model->event_id]); |
... | ... | @@ -113,8 +119,25 @@ class EventController extends Controller |
113 | 119 | $model->image = $image->name; |
114 | 120 | } |
115 | 121 | |
122 | + if ( ($banner = UploadedFile::getInstance($model, 'banner')) ) { | |
123 | + $model->banner = $banner->name; | |
124 | + $banner->saveAs(Yii::getAlias('@imagesDir/event/' . $banner->name)); | |
125 | + } | |
126 | + | |
116 | 127 | if ($model->save() && $image) { |
117 | - $image->saveAs(Yii::getAlias('@imagesDir/articles/' . $image->name)); | |
128 | + $image->saveAs(Yii::getAlias('@imagesDir/event/' . $image->name)); | |
129 | + | |
130 | + } | |
131 | + | |
132 | + | |
133 | + | |
134 | + if ( ($file = UploadedFile::getInstance($model, 'products_file')) ) { | |
135 | + if(!empty($file)){ | |
136 | + $file->saveAs(Yii::getAlias('@uploadDir/' . $file->name)); | |
137 | + $import = new Import(); | |
138 | + $import->goEvent(Yii::getAlias('@uploadDir/' . $file->name)); | |
139 | + } | |
140 | + | |
118 | 141 | } |
119 | 142 | |
120 | 143 | return $this->redirect(['view', 'id' => $model->event_id]); | ... | ... |
backend/controllers/SliderImageController.php
... | ... | @@ -85,7 +85,19 @@ class SliderImageController extends Controller |
85 | 85 | |
86 | 86 | if ($model->load(Yii::$app->request->post())) { |
87 | 87 | $model->slider_id = $slider_id; |
88 | - $model->save(); | |
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 | + } | |
89 | 101 | return $this->redirect(['view', 'slider_id'=>$slider_id, 'id' => $model->slider_image_id]); |
90 | 102 | } else { |
91 | 103 | |
... | ... | @@ -114,7 +126,23 @@ class SliderImageController extends Controller |
114 | 126 | |
115 | 127 | |
116 | 128 | |
117 | - $model->save(); | |
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 | + } | |
118 | 146 | return $this->redirect(['view', 'slider_id'=>$slider_id, 'id' => $model->slider_image_id]); |
119 | 147 | } else { |
120 | 148 | ... | ... |
backend/views/event/_form.php
... | ... | @@ -17,6 +17,8 @@ use mihaildev\elfinder\ElFinder; |
17 | 17 | 'options' => ['enctype' => 'multipart/form-data'] |
18 | 18 | ]); ?> |
19 | 19 | |
20 | + <?= $form->field($model, 'event_id')->textInput(['maxlength' => true, 'disabled'=>true]) ?> | |
21 | + | |
20 | 22 | <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?> |
21 | 23 | |
22 | 24 | <?= $form->field($model, 'alias')->textInput(['maxlength' => true]) ?> |
... | ... | @@ -35,8 +37,8 @@ use mihaildev\elfinder\ElFinder; |
35 | 37 | <?= $form->field($model, 'end_at') |
36 | 38 | ->widget(DatePicker::className(), [ |
37 | 39 | 'pluginOptions' => [ |
38 | - 'format' => 'dd-M-yyyy', | |
39 | - 'todayHighlight' => true | |
40 | + 'todayHighlight' => true, | |
41 | + 'format' => 'yyyy-mm-dd', | |
40 | 42 | ]]) ?> |
41 | 43 | |
42 | 44 | |
... | ... | @@ -56,6 +58,28 @@ use mihaildev\elfinder\ElFinder; |
56 | 58 | ], |
57 | 59 | ]); ?> |
58 | 60 | |
61 | + | |
62 | + <?= $form->field($model, 'banner')->widget(\kartik\file\FileInput::classname(), [ | |
63 | + 'language' => 'ru', | |
64 | + 'options' => [ | |
65 | + 'accept' => 'image/*', | |
66 | + 'multiple' => false, | |
67 | + ], | |
68 | + 'pluginOptions' => [ | |
69 | + 'allowedFileExtensions' => ['jpg', 'gif', 'png'], | |
70 | + 'initialPreview' => !empty($model->bannerUrl) ? \common\components\artboximage\ArtboxImageHelper::getImage($model->bannerUrl, 'list') : '', | |
71 | + 'overwriteInitial' => true, | |
72 | + 'showRemove' => false, | |
73 | + 'showUpload' => false, | |
74 | + 'previewFileType' => 'image', | |
75 | + ], | |
76 | + ]); ?> | |
77 | + | |
78 | + <?= $form->field($model, 'products_file')->widget(\kartik\file\FileInput::classname(), [ | |
79 | + 'language' => 'ru' | |
80 | + ]); ?> | |
81 | + | |
82 | + | |
59 | 83 | <?= $form->field($model, 'meta_title')->textInput(['maxlength' => true]) ?> |
60 | 84 | |
61 | 85 | <?= $form->field($model, 'description')->textInput(['maxlength' => true]) ?> |
... | ... | @@ -64,6 +88,8 @@ use mihaildev\elfinder\ElFinder; |
64 | 88 | |
65 | 89 | <?= $form->field($model, 'seo_text')->textarea(['rows' => 6]) ?> |
66 | 90 | |
91 | + <?= $form->field($model, 'status')->checkbox() ?> | |
92 | + | |
67 | 93 | |
68 | 94 | |
69 | 95 | <div class="form-group"> | ... | ... |
backend/views/slider-image/_form.php
... | ... | @@ -5,7 +5,7 @@ use common\modules\file\widgets\ImageUploader; |
5 | 5 | use kartik\select2\Select2; |
6 | 6 | use yii\helpers\Html; |
7 | 7 | use yii\widgets\ActiveForm; |
8 | - | |
8 | +use kartik\date\DatePicker; | |
9 | 9 | /* @var $this yii\web\View */ |
10 | 10 | /* @var $slider Slider*/ |
11 | 11 | /* @var $model common\models\SliderImage */ |
... | ... | @@ -16,7 +16,6 @@ use yii\widgets\ActiveForm; |
16 | 16 | |
17 | 17 | <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?> |
18 | 18 | |
19 | - | |
20 | 19 | <?= $form->field($model, 'image')->widget(\kartik\file\FileInput::classname(), [ |
21 | 20 | 'model' => $model, |
22 | 21 | 'attribute' => 'image', |
... | ... | @@ -38,17 +37,16 @@ use yii\widgets\ActiveForm; |
38 | 37 | |
39 | 38 | <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?> |
40 | 39 | |
40 | + <?= $form->field($model, 'end_at') | |
41 | + ->widget(DatePicker::className(), [ | |
42 | + 'pluginOptions' => [ | |
43 | + 'todayHighlight' => true, | |
44 | + 'format' => 'yyyy-mm-dd', | |
45 | + ]]) ?> | |
46 | + | |
41 | 47 | <?= $form->field($model, 'url')->textInput(['maxlength' => true]) ?> |
42 | 48 | |
43 | - <?= $form->field($model, 'status')->widget(Select2::className(),([ | |
44 | - 'name' => 'status', | |
45 | - 'hideSearch' => true, | |
46 | - 'data' => [1 => 'Active', 2 => 'Inactive'], | |
47 | - 'options' => ['placeholder' => 'Select status...'], | |
48 | - 'pluginOptions' => [ | |
49 | - 'allowClear' => true | |
50 | - ] | |
51 | - ])) ?> | |
49 | + <?= $form->field($model, 'status')->checkbox() ?> | |
52 | 50 | |
53 | 51 | <?= $form->field($model, 'sort')->textInput() ?> |
54 | 52 | ... | ... |
common/config/main.php
... | ... | @@ -116,6 +116,22 @@ return [ |
116 | 116 | 'master' => null |
117 | 117 | ], |
118 | 118 | ], |
119 | + 'event_in_product' => | |
120 | + [ | |
121 | + 'resize' => [ | |
122 | + 'width' => 730, | |
123 | + 'height' => 100, | |
124 | + 'master' => null | |
125 | + ], | |
126 | + ], | |
127 | + 'event_left' => | |
128 | + [ | |
129 | + 'resize' => [ | |
130 | + 'width' => 960, | |
131 | + 'height' => 400, | |
132 | + 'master' => null | |
133 | + ], | |
134 | + ], | |
119 | 135 | 'brand_item' => [ |
120 | 136 | 'resize' => [ |
121 | 137 | 'width' => 125, | ... | ... |
common/models/Event.php
1 | 1 | <?php |
2 | 2 | |
3 | 3 | namespace common\models; |
4 | - | |
4 | +use common\behaviors\SaveImgBehavior; | |
5 | +use common\modules\product\models\Product; | |
5 | 6 | use Yii; |
6 | 7 | use yii\behaviors\TimestampBehavior; |
7 | 8 | /** |
... | ... | @@ -19,10 +20,13 @@ use yii\behaviors\TimestampBehavior; |
19 | 20 | * @property integer $created_at |
20 | 21 | * @property integer $updated_at |
21 | 22 | * @property integer $end_at |
23 | + * @property integer $status | |
24 | + * @property integer $banner | |
22 | 25 | */ |
23 | 26 | class Event extends \yii\db\ActiveRecord |
24 | 27 | { |
25 | 28 | public $imageUpload; |
29 | + public $products_file; | |
26 | 30 | |
27 | 31 | /** |
28 | 32 | * @inheritdoc |
... | ... | @@ -32,12 +36,19 @@ class Event extends \yii\db\ActiveRecord |
32 | 36 | return 'event'; |
33 | 37 | } |
34 | 38 | |
39 | + | |
40 | + | |
41 | + | |
35 | 42 | /** |
36 | 43 | * @inheritdoc |
37 | 44 | */ |
38 | 45 | public function behaviors() |
39 | 46 | { |
40 | 47 | return [ |
48 | + [ | |
49 | + 'class' => SaveImgBehavior::className(), | |
50 | + 'directory' => 'event' | |
51 | + ], | |
41 | 52 | TimestampBehavior::className(), |
42 | 53 | 'slug' => [ |
43 | 54 | 'class' => 'common\behaviors\Slug', |
... | ... | @@ -55,7 +66,8 @@ class Event extends \yii\db\ActiveRecord |
55 | 66 | public function beforeSave($insert) |
56 | 67 | { |
57 | 68 | if (parent::beforeSave($insert)) { |
58 | - $this->end_at = strtotime($this->end_at); | |
69 | + | |
70 | + $this->end_at = !empty($this->end_at) ? strtotime($this->end_at) : ''; | |
59 | 71 | return true; |
60 | 72 | } else { |
61 | 73 | return false; |
... | ... | @@ -63,7 +75,7 @@ class Event extends \yii\db\ActiveRecord |
63 | 75 | } |
64 | 76 | |
65 | 77 | public function afterFind(){ |
66 | - $this->end_at = date("Y-m-d", $this->end_at); | |
78 | + $this->end_at = !empty($this->end_at) ? date("Y-m-d", $this->end_at) : ''; | |
67 | 79 | } |
68 | 80 | |
69 | 81 | |
... | ... | @@ -75,10 +87,11 @@ class Event extends \yii\db\ActiveRecord |
75 | 87 | return [ |
76 | 88 | [['body', 'seo_text'], 'string'], |
77 | 89 | [['created_at', 'updated_at' ], 'integer'], |
78 | - [['name', 'alias', 'image', 'meta_title', 'description', 'h1','end_at'], 'string', 'max' => 255], | |
90 | + [['name', 'alias', 'image', 'meta_title', 'description', 'h1','end_at','banner'], 'string', 'max' => 255], | |
79 | 91 | [['name','body'], 'required'], |
80 | 92 | [['imageUpload'], 'safe'], |
81 | 93 | [['imageUpload'], 'file', 'extensions' => 'jpg, gif, png'], |
94 | + [['products_file'], 'file'], | |
82 | 95 | ]; |
83 | 96 | } |
84 | 97 | |
... | ... | @@ -88,7 +101,7 @@ class Event extends \yii\db\ActiveRecord |
88 | 101 | public function attributeLabels() |
89 | 102 | { |
90 | 103 | return [ |
91 | - 'event_id' => Yii::t('app', 'event_id'), | |
104 | + 'event_id' => Yii::t('app', 'ID ะฐะบัะธะธ'), | |
92 | 105 | 'name' => Yii::t('app', 'name'), |
93 | 106 | 'alias' => Yii::t('app', 'alias'), |
94 | 107 | 'body' => Yii::t('app', 'body'), |
... | ... | @@ -100,16 +113,35 @@ class Event extends \yii\db\ActiveRecord |
100 | 113 | 'created_at' => Yii::t('app', 'created_at'), |
101 | 114 | 'updated_at' => Yii::t('app', 'updated_at'), |
102 | 115 | 'end_at' => Yii::t('app', 'end_at'), |
116 | + 'status' => Yii::t('app', 'ะกัะฐััั ะฐะบัะธะธ'), | |
117 | + 'products_file' => Yii::t('app', 'ะะฐะณััะทะบะฐ ัะฐะนะปะฐ'), | |
103 | 118 | ]; |
104 | 119 | } |
105 | 120 | |
106 | 121 | |
107 | - public function getImageFile() { | |
108 | - return empty($this->image) ? null : Yii::getAlias('@imagesDir/articles/'. $this->image); | |
122 | + public function isActive(){ | |
123 | + if($this->status){ | |
124 | + | |
125 | + if(!empty($this->end_at) && (strtotime($this->end_at) <= strtotime(date("Y-m-d")))){ | |
126 | + return false; | |
127 | + } | |
128 | + return true; | |
129 | + } | |
130 | + return false; | |
131 | + } | |
132 | + | |
133 | + | |
134 | + public function getBannerFile() { | |
135 | + return empty($this->image) ? null : Yii::getAlias('@imagesDir/event/'. $this->banner); | |
136 | + } | |
137 | + | |
138 | + | |
139 | + public function getProducts(){ | |
140 | + return $this->hasMany(Product::className(),['product_id' => 'product_id'] )->viaTable('events_to_products', ['event_id' => 'event_id']); | |
109 | 141 | } |
110 | 142 | |
111 | - public function getImageUrl() | |
143 | + public function getBannerUrl() | |
112 | 144 | { |
113 | - return empty($this->image) ? null : Yii::getAlias('@imagesUrl/articles/' . $this->image); | |
145 | + return empty($this->image) ? null : Yii::getAlias('@imagesUrl/event/' . $this->banner); | |
114 | 146 | } |
115 | 147 | } | ... | ... |
common/models/SliderImage.php
... | ... | @@ -16,12 +16,19 @@ use Yii; |
16 | 16 | * @property string $url |
17 | 17 | * @property integer $status |
18 | 18 | * @property integer $sort |
19 | + * @property integer $end_at | |
19 | 20 | * |
20 | 21 | * @property Slider $slider |
21 | 22 | */ |
22 | 23 | class SliderImage extends \yii\db\ActiveRecord |
23 | 24 | { |
24 | - | |
25 | + /** | |
26 | + * @inheritdoc | |
27 | + */ | |
28 | + public static function tableName() | |
29 | + { | |
30 | + return 'slider_image'; | |
31 | + } | |
25 | 32 | |
26 | 33 | |
27 | 34 | /** |
... | ... | @@ -36,16 +43,6 @@ class SliderImage extends \yii\db\ActiveRecord |
36 | 43 | ] |
37 | 44 | ]; |
38 | 45 | } |
39 | - | |
40 | - | |
41 | - /** | |
42 | - * @inheritdoc | |
43 | - */ | |
44 | - public static function tableName() | |
45 | - { | |
46 | - return 'slider_image'; | |
47 | - } | |
48 | - | |
49 | 46 | /** |
50 | 47 | * @inheritdoc |
51 | 48 | */ |
... | ... | @@ -53,11 +50,26 @@ class SliderImage extends \yii\db\ActiveRecord |
53 | 50 | { |
54 | 51 | return [ |
55 | 52 | [['slider_id', 'status', 'sort'], 'integer'], |
56 | - [['image', 'alt', 'title', 'url'], 'string', 'max' => 255], | |
53 | + [['image', 'alt', 'title', 'url','end_at'], 'string', 'max' => 255], | |
57 | 54 | [['slider_id'], 'exist', 'skipOnError' => true, 'targetClass' => Slider::className(), 'targetAttribute' => ['slider_id' => 'slider_id']], |
58 | 55 | ]; |
59 | 56 | } |
60 | 57 | |
58 | + | |
59 | + public function beforeSave($insert) | |
60 | + { | |
61 | + if (parent::beforeSave($insert)) { | |
62 | + | |
63 | + $this->end_at = !empty($this->end_at) ? strtotime($this->end_at) : ''; | |
64 | + return true; | |
65 | + } else { | |
66 | + return false; | |
67 | + } | |
68 | + } | |
69 | + | |
70 | + public function afterFind(){ | |
71 | + $this->end_at = !empty($this->end_at) ? date("Y-m-d", $this->end_at) : ''; | |
72 | + } | |
61 | 73 | /** |
62 | 74 | * @inheritdoc |
63 | 75 | */ |
... | ... | @@ -74,8 +86,16 @@ class SliderImage extends \yii\db\ActiveRecord |
74 | 86 | 'sort' => Yii::t('app', 'sort'), |
75 | 87 | ]; |
76 | 88 | } |
77 | - | |
78 | - | |
89 | + public function isActive(){ | |
90 | + if($this->status){ | |
91 | + | |
92 | + if(!empty($this->end_at) && (strtotime($this->end_at) <= strtotime(date("Y-m-d")))){ | |
93 | + return false; | |
94 | + } | |
95 | + return true; | |
96 | + } | |
97 | + return false; | |
98 | + } | |
79 | 99 | |
80 | 100 | /** |
81 | 101 | * @return \yii\db\ActiveQuery |
... | ... | @@ -86,5 +106,4 @@ class SliderImage extends \yii\db\ActiveRecord |
86 | 106 | } |
87 | 107 | |
88 | 108 | |
89 | - | |
90 | 109 | } | ... | ... |
common/modules/product/models/Import.php
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | namespace common\modules\product\models; |
4 | 4 | |
5 | +use common\models\EventsToProducts; | |
5 | 6 | use common\modules\product\helpers\ProductHelper; |
6 | 7 | use common\modules\product\models\Category; |
7 | 8 | use common\modules\product\models\CategoryName; |
... | ... | @@ -265,7 +266,7 @@ class Import extends Model { |
265 | 266 | // 5 ะะฟะธัะฐะฝะธะต ะ ัั |
266 | 267 | $product_body_ru = $data[4]; |
267 | 268 | |
268 | - // 6 ะคะธะปััั | |
269 | + // 6 ะคะธะปััั [god:2013-2014]*[pol:ะผัะถัะบะพะน]*[naznacenie-germo-beg:ะะปั ะฒะตัะตะน]*[material-germo-bag:ะฝะตั]*[value-germo-bag:ะฝะตั]*[weight-germo-bag:ะฝะตั]*[ipx-germo-bag:ะฝะตั]*[in-pacage-bag:ะฝะตั]*[size-germo-bag:ะฝะตั]*[rekomend-germo-bag:ะฝะตั] | |
269 | 270 | $filters = explode ('*', $data[5]); |
270 | 271 | |
271 | 272 | // 11 ะฆะตะฝะฐ ะฐะบัะธั |
... | ... | @@ -312,7 +313,7 @@ class Import extends Model { |
312 | 313 | |
313 | 314 | foreach($catalog_names as $catalog_name){ |
314 | 315 | // ==== Set category ==== |
315 | - if ( ($category = Category::find()->filterWhere(['ilike', 'name', trim($catalog_name)])->one()) === null ) { | |
316 | + if ( ($category = CategoryName::find()->filterWhere(['ilike', 'value', trim($catalog_name)])->one()) === null ) { | |
316 | 317 | // Create category |
317 | 318 | $category = new Category(); |
318 | 319 | $category->name = trim($catalog_name); |
... | ... | @@ -327,7 +328,7 @@ class Import extends Model { |
327 | 328 | |
328 | 329 | // ===== Set brand ==== |
329 | 330 | if ( $brand_name ) { |
330 | - if ( ($brand = Brand::find()->filterWhere(['ilike', 'name', trim($brand_name)])->one()) !== null ) { | |
331 | + if ( ($brand = BrandName::find()->filterWhere(['ilike', 'value', trim($brand_name)])->one()) !== null ) { | |
331 | 332 | $_product->brand_id = $brand->brand_id; |
332 | 333 | } else { |
333 | 334 | // Create brand |
... | ... | @@ -432,7 +433,6 @@ class Import extends Model { |
432 | 433 | $MOD_ARRAY[] = $_productVariant->product_variant_id; |
433 | 434 | |
434 | 435 | if ($mod_image) { |
435 | - | |
436 | 436 | $source_image = Yii::getAlias('@uploadDir') . '/product_images/'. urlencode($mod_image); |
437 | 437 | if (file_exists($source_image)) { |
438 | 438 | if (($variantImage = ProductImage::find()->andFilterWhere(['ilike', 'image', $mod_image])->andFilterWhere(['product_variant_id' => $_productVariant->product_variant_id])->one()) === null) { |
... | ... | @@ -483,6 +483,35 @@ class Import extends Model { |
483 | 483 | return $result; |
484 | 484 | } |
485 | 485 | |
486 | + | |
487 | + public function goEvent($file) { | |
488 | + | |
489 | + set_time_limit(0); | |
490 | + | |
491 | + | |
492 | + $handle = fopen($file, 'r'); | |
493 | + | |
494 | + | |
495 | + while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) { | |
496 | + if(isset($data[0]) && isset($data[1])){ | |
497 | + $product = ProductVariant::find()->where(['sku' => $data[1]])->joinWith('product')->one(); | |
498 | + if($product instanceof ProductVariant){ | |
499 | + $model= EventsToProducts::find()->where(['event_id' =>$data[0], 'product_id' => $product->product->product_id ])->one(); | |
500 | + if(!$model instanceof EventsToProducts){ | |
501 | + $model = new EventsToProducts; | |
502 | + $model->event_id = $data[0]; | |
503 | + $model->product_id = $product->product->product_id; | |
504 | + $model->save(); | |
505 | + } | |
506 | + } | |
507 | + } | |
508 | + | |
509 | + } | |
510 | + fclose($handle); | |
511 | + unlink($file); | |
512 | + | |
513 | + } | |
514 | + | |
486 | 515 | private function getProductsFile($file_type) { |
487 | 516 | $filename = Yii::getAlias('@uploadDir') .'/'. Yii::getAlias('@'. $file_type); |
488 | 517 | if (!is_file($filename)) { |
... | ... | @@ -528,7 +557,7 @@ class Import extends Model { |
528 | 557 | $taxGroup->name = $filter_name; |
529 | 558 | $taxGroup->module = 'string'; |
530 | 559 | $taxGroup->hierarchical = FALSE; |
531 | - $taxGroup->categories = $catalog_names; | |
560 | + $taxGroup->group_to_category = $catalog_names; | |
532 | 561 | $taxGroup->is_filter = FALSE; |
533 | 562 | $taxGroup->save(); |
534 | 563 | } | ... | ... |
common/modules/product/models/Product.php
... | ... | @@ -13,7 +13,7 @@ use Yii; |
13 | 13 | use yii\db\ActiveQuery; |
14 | 14 | use yii\db\ActiveRecord; |
15 | 15 | use yii\helpers\ArrayHelper; |
16 | - | |
16 | +use common\models\Event; | |
17 | 17 | /** |
18 | 18 | * This is the model class for table "{{%product}}". |
19 | 19 | * |
... | ... | @@ -67,6 +67,9 @@ class Product extends \yii\db\ActiveRecord |
67 | 67 | { |
68 | 68 | return '{{%product}}'; |
69 | 69 | } |
70 | + public function getEvents(){ | |
71 | + return $this->hasMany(Event::className(), ['event_id' => 'event_id'])->viaTable('events_to_products', ['product_id' => 'product_id']); | |
72 | + } | |
70 | 73 | |
71 | 74 | /** |
72 | 75 | * @inheritdoc | ... | ... |
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 frontend\assets; | |
9 | + | |
10 | +use yii\web\AssetBundle; | |
11 | + | |
12 | +/** | |
13 | + * @author Qiang Xue <qiang.xue@gmail.com> | |
14 | + * @since 2.0 | |
15 | + */ | |
16 | +class FlipclockAsset extends AssetBundle | |
17 | +{ | |
18 | + public $sourcePath = '@bower'; | |
19 | + public $css = [ | |
20 | + 'flipclock/compiled/flipclock.css' | |
21 | + ]; | |
22 | + public $js = [ | |
23 | + 'flipclock/compiled/flipclock.min.js' | |
24 | + ]; | |
25 | + public $jsOptions = array( | |
26 | + 'position' => \yii\web\View::POS_END | |
27 | + ); | |
28 | +} | ... | ... |
1 | +<?php | |
2 | + | |
3 | +namespace frontend\controllers; | |
4 | + | |
5 | +use Yii; | |
6 | +use common\models\Event; | |
7 | +use yii\web\Controller; | |
8 | +use yii\web\NotFoundHttpException; | |
9 | +use yii\data\ActiveDataProvider; | |
10 | + | |
11 | + | |
12 | + | |
13 | +class EventController extends Controller | |
14 | +{ | |
15 | + | |
16 | + public function actionIndex() | |
17 | + { | |
18 | + | |
19 | + $dataProvider = new ActiveDataProvider([ | |
20 | + 'query' => Event::find() ]); | |
21 | + | |
22 | + return $this->render('index', [ | |
23 | + 'dataProvider' => $dataProvider, | |
24 | + ]); | |
25 | + } | |
26 | + | |
27 | + | |
28 | + | |
29 | + public function actionShow($alias) | |
30 | + { | |
31 | + | |
32 | + $model = $this->findModel($alias); | |
33 | + $productProvider = new ActiveDataProvider([ | |
34 | + 'query' => $model->getProducts(), | |
35 | + ]); | |
36 | + return $this->render('show', [ | |
37 | + 'productProvider' => $productProvider, | |
38 | + 'model' => $model, | |
39 | + ]); | |
40 | + } | |
41 | + | |
42 | + | |
43 | + protected function findModel($alias) | |
44 | + { | |
45 | + if (($model = Event::findOne(["alias"=>$alias])) !== null) { | |
46 | + return $model; | |
47 | + } else { | |
48 | + throw new NotFoundHttpException('The requested page does not exist.'); | |
49 | + } | |
50 | + } | |
51 | + | |
52 | + | |
53 | +} | |
0 | 54 | \ No newline at end of file | ... | ... |
frontend/views/catalog/product.php
... | ... | @@ -8,8 +8,10 @@ |
8 | 8 | use yii\bootstrap\ActiveForm; |
9 | 9 | use yii\bootstrap\Html; |
10 | 10 | use yii\widgets\MaskedInput; |
11 | - | |
12 | - //FotoramaAsset::register($this); | |
11 | +use frontend\assets\FlipclockAsset; | |
12 | + FotoramaAsset::register($this); | |
13 | +FlipclockAsset::register($this); | |
14 | + | |
13 | 15 | $this->params[ 'seo' ][ 'key' ] = $category->name; |
14 | 16 | $this->params[ 'seo' ][ 'fields' ][ 'name' ] = $product->fullname; |
15 | 17 | $this->params[ 'seo' ][ 'h1' ] = !empty( Seo::widget([ 'row' => 'h1' ]) ) ? Seo::widget([ 'row' => 'h1' ]) : $product->fullname; |
... | ... | @@ -208,7 +210,47 @@ |
208 | 210 | </table> |
209 | 211 | </td> |
210 | 212 | </tr> |
211 | - | |
213 | + <tr> | |
214 | + <?php foreach($product->events as $event):?> | |
215 | + <?php if(!empty($event->end_at) && $event->isActive()):?> | |
216 | + <div class="event_block"> | |
217 | + | |
218 | + <div class="event_title"> <?= Html::a('ะะบัะธั!!! '.$event->name,Url::to(['event/show','alias'=>$event->alias,'id'=>$event->primaryKey]))?></div> | |
219 | + <div class="event_time">ะะพ ะบะพะฝัะฐ ะพััะฐะปะพัั:</div> | |
220 | + <div class="clock_<?= $event->primaryKey ?> clock_product_first "></div> | |
221 | + <script type="text/javascript"> | |
222 | + var clock; | |
223 | + | |
224 | + $(document).ready(function() { | |
225 | + var clock; | |
226 | + | |
227 | + clock = $('.clock_<?= $event->primaryKey ?>').FlipClock({ | |
228 | + clockFace: 'DailyCounter', | |
229 | + language: 'ru', | |
230 | + classes: { | |
231 | + active: 'flip-clock-active', | |
232 | + before: 'flip-clock-before', | |
233 | + divider: 'flip-clock-divider', | |
234 | + dot: 'flip-clock-dot', | |
235 | + label: 'flip-clock-label', | |
236 | + flip: 'flip', | |
237 | + play: 'play', | |
238 | + wrapper: 'flip-clock-wrapper' | |
239 | + }, | |
240 | + }); | |
241 | + | |
242 | + clock.setTime(<?= strtotime($event->end_at) - strtotime(date("Y-m-d H:i:s"))?>); | |
243 | + clock.setCountdown(true); | |
244 | + clock.start(); | |
245 | + | |
246 | + }); | |
247 | + </script> | |
248 | + | |
249 | + </div> | |
250 | + <?php endif; ?> | |
251 | + <?php endforeach; ?> | |
252 | + | |
253 | + </tr> | |
212 | 254 | <tr> |
213 | 255 | <td class="price_block"> |
214 | 256 | <div class="price_block_container"> |
... | ... | @@ -344,10 +386,16 @@ |
344 | 386 | |
345 | 387 | |
346 | 388 | <div class="detail_tabs_content"> |
347 | - ะั ัะตะบะพะผะตะฝะดัะตะผ ะฒัะฑัะฐัั ะปััััะฐ ะญะปััะตะด ะฟะพ ัะฐะผะพะน ะปัััะตะน ัะตะฝะต ััะตะดะธ ะธะฝัะตัะฝะตั ะบะฐัะฐะปะพะณะพะฒ ัะฒะตัะธะปัะฝะธะบะพะฒ ะธ ะดััะณะธั ะพัะฒะตัะธัะตะปัะฝัั ัะธััะตะผ ะฒ ะะธะตะฒะต ะธ ะฃะบัะฐะธะฝะต | |
389 | + <div class="events"> | |
390 | + <?php foreach($product->events as $event):?> | |
391 | + <?php if(!empty($event->banner) && $event->isActive()):?> | |
392 | + <?= Html::a(\common\components\artboximage\ArtboxImageHelper::getImage($event->bannerUrl, 'event_in_product'),Url::to(['event/show','alias'=>$event->alias,'id'=>$event->primaryKey]))?> | |
393 | + <?php endif; ?> | |
394 | + <?php endforeach; ?> | |
395 | + </div> | |
348 | 396 | <div class="clear properties tab_div"> |
349 | 397 | <h2 id="characteristics"> |
350 | - ะฅะฐัะฐะบัะตัะธััะธะบะธ ะปััััะฐ Elstead FE/LEILA6 | |
398 | + ะฅะฐัะฐะบัะตัะธััะธะบะธ <?= $product->name ?> | |
351 | 399 | </h2> |
352 | 400 | |
353 | 401 | <!-- Nav tabs --> |
... | ... | @@ -398,125 +446,125 @@ |
398 | 446 | </div> |
399 | 447 | |
400 | 448 | <div class="clearfix"></div> |
401 | - <div class="collection"> | |
402 | - <br/> | |
403 | - <h2 id="collection"> | |
404 | - ะะพะปะปะตะบัะธั ัะฒะตัะธะปัะฝะธะบะพะฒ <!--ะะะะะ ะ--> | |
405 | - </h2> | |
406 | - <?php /* Collection products begin (should be reworked) */ ?> | |
407 | - <div class="catalog_product_list view_table"> | |
408 | - <div class="catalog_item"> | |
409 | - <div class="wrapper"> | |
410 | - <div class="item_container"> | |
411 | - <div class="title"> | |
412 | - <a href="http://www.linija-svitla.ua/lyustra-elstead-fe-leila3-5893.htm">ะปััััะฐ FE/LEILA3</a> | |
413 | - </div> | |
414 | - <div class="img"> | |
415 | - <a href="http://www.linija-svitla.ua/lyustra-elstead-fe-leila3-5893.htm"> | |
416 | - <img src="http://www.linija-svitla.ua/gallery/prod/fe_leila3/5893_5.jpg" alt="ะปััััะฐ FE/LEILA3" class="selected"> | |
417 | - </a> | |
418 | - <div class="info_icons"> | |
419 | - <a href="#" class="btn btnBuy buy_button" data-id="<?php echo $product->variant->product_variant_id; ?>" data-toggle="modal" data-target="#buyForm" lang="5893">ะัะฟะธัั ัะฒะตัะธะปัะฝะธะบ</a> | |
420 | - <ul class="ul wishlike_block"> | |
421 | - <li class="compare"> | |
422 | - <a onclick="add2compare(); return false;" class="compare compare_text_link_5893" lang="5893" href="#">ะ ััะฐะฒะฝะตะฝะธั</a> | |
423 | - <span class="icon"></span> | |
424 | - </li> | |
425 | - <li class="like"> | |
426 | - <a class="like like_text_link_5893" lang="5893" href="#">ะ ะธะทะฑัะฐะฝะฝะพะต</a><span class="icon"></span> | |
427 | - </li> | |
428 | - </ul> | |
429 | - </div> | |
430 | - </div> | |
431 | - <div class="price"> | |
432 | - <div class="dlexfduinxipi"> | |
433 | - ะฆะตะฝะฐ: | |
434 | - <span class="main"> 25794.00 <span class="currency">ะณัะฝ</span> | |
435 | - </span> | |
436 | - </div> | |
437 | - </div> | |
438 | - <div class="additional_info params"> | |
439 | - </div> | |
440 | - <div class="opacity_bg"></div> | |
441 | - </div> | |
442 | - </div> | |
443 | - </div> | |
444 | - <div class="catalog_item"> | |
445 | - <div class="wrapper"> | |
446 | - <div class="item_container"> | |
447 | - <div class="title"> | |
448 | - <a href="http://www.linija-svitla.ua/elstead-fe-leila1c-6991.htm"> FE/LEILA1C</a> | |
449 | - </div> | |
450 | - <div class="img"> | |
451 | - <a href="http://www.linija-svitla.ua/elstead-fe-leila1c-6991.htm"> | |
452 | - <img src="http://www.linija-svitla.ua/gallery/prod/fe_leila1c/6991_5.jpg" alt=" FE/LEILA1C" class="selected"> | |
453 | - </a> | |
454 | - <div class="info_icons"> | |
455 | - <a href="#" class="btn btnBuy buy_button" data-toggle="modal" data-id="<?php echo $product->variant->product_variant_id; ?>" data-target="#buyForm" lang="6991">ะัะฟะธัั ัะฒะตัะธะปัะฝะธะบ</a> | |
456 | - <ul class="ul wishlike_block"> | |
457 | - <li class="compare"> | |
458 | - <a onclick="add2compare(); return false;" class="compare compare_text_link_6991" lang="6991" href="#">ะ ััะฐะฒะฝะตะฝะธั</a> | |
459 | - <span class="icon"></span> | |
460 | - </li> | |
461 | - <li class="like"> | |
462 | - <a class="like like_text_link_6991" lang="6991" href="#">ะ ะธะทะฑัะฐะฝะฝะพะต</a><span class="icon"></span> | |
463 | - </li> | |
464 | - </ul> | |
465 | - </div> | |
466 | - </div> | |
467 | - <div class="price"> | |
468 | - <div class="dlexfduinxipi"> | |
469 | - ะฆะตะฝะฐ: | |
470 | - <span class="main"> 14330.40 <span class="currency">ะณัะฝ</span> | |
471 | - </span> | |
472 | - </div> | |
473 | - </div> | |
474 | - <div class="additional_info params"> | |
475 | - </div> | |
476 | - <div class="opacity_bg"></div> | |
477 | - </div> | |
478 | - </div> | |
479 | - </div> | |
480 | - <div class="catalog_item"> | |
481 | - <div class="wrapper"> | |
482 | - <div class="item_container"> | |
483 | - <div class="title"> | |
484 | - <a href="http://www.linija-svitla.ua/nastennyy-svetilnik-elstead-fe-leila2-5894.htm">ะฝะฐััะตะฝะฝัะน ัะฒะตัะธะปัะฝะธะบ FE/LEILA2</a> | |
485 | - </div> | |
486 | - <div class="img"> | |
487 | - <a href="http://www.linija-svitla.ua/nastennyy-svetilnik-elstead-fe-leila2-5894.htm"> | |
488 | - <img src="http://www.linija-svitla.ua/gallery/prod/fe_leila2/5894_5.jpg" alt="ะฝะฐััะตะฝะฝัะน ัะฒะตัะธะปัะฝะธะบ FE/LEILA2" class="selected"> | |
489 | - </a> | |
490 | - <div class="info_icons"> | |
491 | - <a href="#" class="btn btnBuy buy_button" data-id="<?php echo $product->variant->product_variant_id; ?>" data-toggle="modal" data-target="#buyForm" lang="5894">ะัะฟะธัั ัะฒะตัะธะปัะฝะธะบ</a> | |
492 | - <ul class="ul wishlike_block"> | |
493 | - <li class="compare"> | |
494 | - <a onclick="add2compare(); return false;" class="compare compare_text_link_5894" lang="5894" href="#">ะ ััะฐะฒะฝะตะฝะธั</a> | |
495 | - <span class="icon"></span> | |
496 | - </li> | |
497 | - <li class="like"> | |
498 | - <a class="like like_text_link_5894" lang="5894" href="#">ะ ะธะทะฑัะฐะฝะฝะพะต</a><span class="icon"></span> | |
499 | - </li> | |
500 | - </ul> | |
501 | - </div> | |
502 | - </div> | |
503 | - <div class="price"> | |
504 | - <div class="dlexfduinxipi"> | |
505 | - ะฆะตะฝะฐ: | |
506 | - <span class="main"> 8598.00 <span class="currency">ะณัะฝ</span> | |
507 | - </span> | |
508 | - </div> | |
509 | - </div> | |
510 | - <div class="additional_info params"> | |
511 | - </div> | |
512 | - <div class="opacity_bg"></div> | |
513 | - </div> | |
514 | - </div> | |
515 | - </div> | |
516 | - </div> | |
517 | - <div class="clearfix"></div> | |
518 | - <?php /* Collection products end (should be reworked) */ ?> | |
519 | - </div> | |
449 | +<!-- <div class="collection">--> | |
450 | +<!-- <br/>--> | |
451 | +<!-- <h2 id="collection">--> | |
452 | +<!-- ะะพะปะปะตะบัะธั ัะฒะตัะธะปัะฝะธะบะพะฒ <!--ะะะะะ ะ-->--> | |
453 | +<!-- </h2>--> | |
454 | +<!-- --><?php ///* Collection products begin (should be reworked) */ ?> | |
455 | +<!-- <div class="catalog_product_list view_table">--> | |
456 | +<!-- <div class="catalog_item">--> | |
457 | +<!-- <div class="wrapper">--> | |
458 | +<!-- <div class="item_container">--> | |
459 | +<!-- <div class="title">--> | |
460 | +<!-- <a href="http://www.linija-svitla.ua/lyustra-elstead-fe-leila3-5893.htm">ะปััััะฐ FE/LEILA3</a>--> | |
461 | +<!-- </div>--> | |
462 | +<!-- <div class="img">--> | |
463 | +<!-- <a href="http://www.linija-svitla.ua/lyustra-elstead-fe-leila3-5893.htm">--> | |
464 | +<!-- <img src="http://www.linija-svitla.ua/gallery/prod/fe_leila3/5893_5.jpg" alt="ะปััััะฐ FE/LEILA3" class="selected">--> | |
465 | +<!-- </a>--> | |
466 | +<!-- <div class="info_icons">--> | |
467 | +<!-- <a href="#" class="btn btnBuy buy_button" data-id="--><?php //echo $product->variant->product_variant_id; ?><!--" data-toggle="modal" data-target="#buyForm" lang="5893">ะัะฟะธัั ัะฒะตัะธะปัะฝะธะบ</a>--> | |
468 | +<!-- <ul class="ul wishlike_block">--> | |
469 | +<!-- <li class="compare">--> | |
470 | +<!-- <a onclick="add2compare(); return false;" class="compare compare_text_link_5893" lang="5893" href="#">ะ ััะฐะฒะฝะตะฝะธั</a>--> | |
471 | +<!-- <span class="icon"></span>--> | |
472 | +<!-- </li>--> | |
473 | +<!-- <li class="like">--> | |
474 | +<!-- <a class="like like_text_link_5893" lang="5893" href="#">ะ ะธะทะฑัะฐะฝะฝะพะต</a><span class="icon"></span>--> | |
475 | +<!-- </li>--> | |
476 | +<!-- </ul>--> | |
477 | +<!-- </div>--> | |
478 | +<!-- </div>--> | |
479 | +<!-- <div class="price">--> | |
480 | +<!-- <div class="dlexfduinxipi">--> | |
481 | +<!-- ะฆะตะฝะฐ:--> | |
482 | +<!-- <span class="main"> 25794.00 <span class="currency">ะณัะฝ</span>--> | |
483 | +<!-- </span>--> | |
484 | +<!-- </div>--> | |
485 | +<!-- </div>--> | |
486 | +<!-- <div class="additional_info params">--> | |
487 | +<!-- </div>--> | |
488 | +<!-- <div class="opacity_bg"></div>--> | |
489 | +<!-- </div>--> | |
490 | +<!-- </div>--> | |
491 | +<!-- </div>--> | |
492 | +<!-- <div class="catalog_item">--> | |
493 | +<!-- <div class="wrapper">--> | |
494 | +<!-- <div class="item_container">--> | |
495 | +<!-- <div class="title">--> | |
496 | +<!-- <a href="http://www.linija-svitla.ua/elstead-fe-leila1c-6991.htm"> FE/LEILA1C</a>--> | |
497 | +<!-- </div>--> | |
498 | +<!-- <div class="img">--> | |
499 | +<!-- <a href="http://www.linija-svitla.ua/elstead-fe-leila1c-6991.htm">--> | |
500 | +<!-- <img src="http://www.linija-svitla.ua/gallery/prod/fe_leila1c/6991_5.jpg" alt=" FE/LEILA1C" class="selected">--> | |
501 | +<!-- </a>--> | |
502 | +<!-- <div class="info_icons">--> | |
503 | +<!-- <a href="#" class="btn btnBuy buy_button" data-toggle="modal" data-id="--><?php //echo $product->variant->product_variant_id; ?><!--" data-target="#buyForm" lang="6991">ะัะฟะธัั ัะฒะตัะธะปัะฝะธะบ</a>--> | |
504 | +<!-- <ul class="ul wishlike_block">--> | |
505 | +<!-- <li class="compare">--> | |
506 | +<!-- <a onclick="add2compare(); return false;" class="compare compare_text_link_6991" lang="6991" href="#">ะ ััะฐะฒะฝะตะฝะธั</a>--> | |
507 | +<!-- <span class="icon"></span>--> | |
508 | +<!-- </li>--> | |
509 | +<!-- <li class="like">--> | |
510 | +<!-- <a class="like like_text_link_6991" lang="6991" href="#">ะ ะธะทะฑัะฐะฝะฝะพะต</a><span class="icon"></span>--> | |
511 | +<!-- </li>--> | |
512 | +<!-- </ul>--> | |
513 | +<!-- </div>--> | |
514 | +<!-- </div>--> | |
515 | +<!-- <div class="price">--> | |
516 | +<!-- <div class="dlexfduinxipi">--> | |
517 | +<!-- ะฆะตะฝะฐ:--> | |
518 | +<!-- <span class="main"> 14330.40 <span class="currency">ะณัะฝ</span>--> | |
519 | +<!-- </span>--> | |
520 | +<!-- </div>--> | |
521 | +<!-- </div>--> | |
522 | +<!-- <div class="additional_info params">--> | |
523 | +<!-- </div>--> | |
524 | +<!-- <div class="opacity_bg"></div>--> | |
525 | +<!-- </div>--> | |
526 | +<!-- </div>--> | |
527 | +<!-- </div>--> | |
528 | +<!-- <div class="catalog_item">--> | |
529 | +<!-- <div class="wrapper">--> | |
530 | +<!-- <div class="item_container">--> | |
531 | +<!-- <div class="title">--> | |
532 | +<!-- <a href="http://www.linija-svitla.ua/nastennyy-svetilnik-elstead-fe-leila2-5894.htm">ะฝะฐััะตะฝะฝัะน ัะฒะตัะธะปัะฝะธะบ FE/LEILA2</a>--> | |
533 | +<!-- </div>--> | |
534 | +<!-- <div class="img">--> | |
535 | +<!-- <a href="http://www.linija-svitla.ua/nastennyy-svetilnik-elstead-fe-leila2-5894.htm">--> | |
536 | +<!-- <img src="http://www.linija-svitla.ua/gallery/prod/fe_leila2/5894_5.jpg" alt="ะฝะฐััะตะฝะฝัะน ัะฒะตัะธะปัะฝะธะบ FE/LEILA2" class="selected">--> | |
537 | +<!-- </a>--> | |
538 | +<!-- <div class="info_icons">--> | |
539 | +<!-- <a href="#" class="btn btnBuy buy_button" data-id="--><?php //echo $product->variant->product_variant_id; ?><!--" data-toggle="modal" data-target="#buyForm" lang="5894">ะัะฟะธัั ัะฒะตัะธะปัะฝะธะบ</a>--> | |
540 | +<!-- <ul class="ul wishlike_block">--> | |
541 | +<!-- <li class="compare">--> | |
542 | +<!-- <a onclick="add2compare(); return false;" class="compare compare_text_link_5894" lang="5894" href="#">ะ ััะฐะฒะฝะตะฝะธั</a>--> | |
543 | +<!-- <span class="icon"></span>--> | |
544 | +<!-- </li>--> | |
545 | +<!-- <li class="like">--> | |
546 | +<!-- <a class="like like_text_link_5894" lang="5894" href="#">ะ ะธะทะฑัะฐะฝะฝะพะต</a><span class="icon"></span>--> | |
547 | +<!-- </li>--> | |
548 | +<!-- </ul>--> | |
549 | +<!-- </div>--> | |
550 | +<!-- </div>--> | |
551 | +<!-- <div class="price">--> | |
552 | +<!-- <div class="dlexfduinxipi">--> | |
553 | +<!-- ะฆะตะฝะฐ:--> | |
554 | +<!-- <span class="main"> 8598.00 <span class="currency">ะณัะฝ</span>--> | |
555 | +<!-- </span>--> | |
556 | +<!-- </div>--> | |
557 | +<!-- </div>--> | |
558 | +<!-- <div class="additional_info params">--> | |
559 | +<!-- </div>--> | |
560 | +<!-- <div class="opacity_bg"></div>--> | |
561 | +<!-- </div>--> | |
562 | +<!-- </div>--> | |
563 | +<!-- </div>--> | |
564 | +<!-- </div>--> | |
565 | +<!-- <div class="clearfix"></div>--> | |
566 | +<!-- --><?php ///* Collection products end (should be reworked) */ ?> | |
567 | +<!-- </div>--> | |
520 | 568 | <div class="clearfix"></div> |
521 | 569 | <br/> |
522 | 570 | <h2 id="reviews"> | ... | ... |
1 | +<?php | |
2 | +use yii\helpers\Html; | |
3 | +use frontend\helpers\TextHelper; | |
4 | +use yii\helpers\Url; | |
5 | +use frontend\components\Text; | |
6 | +use frontend\assets\FlipclockAsset; | |
7 | +FlipclockAsset::register($this); | |
8 | +?> | |
9 | +<div class="news_item"> | |
10 | + | |
11 | + | |
12 | + <a href="<?=Url::to(['event/show','alias'=>$model->alias,'id'=>$model->primaryKey])?>" class="name"><?=$model->name?></a> | |
13 | + | |
14 | + | |
15 | + <div style="position: relative"> | |
16 | + <a href="<?=Url::to(['event/show','alias'=>$model->alias,'id'=>$model->primaryKey])?>"> | |
17 | + <?= \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'event_left', ['align' => 'left'])?> | |
18 | + </a> | |
19 | + | |
20 | + | |
21 | + <?php | |
22 | + | |
23 | + if(!empty($model->end_at) && strtotime($model->end_at) > strtotime(date("Y-m-d"))){ | |
24 | + ?> | |
25 | + <div class="clock_style clock_<?= $model->primaryKey ?>"></div> | |
26 | + <script type="text/javascript"> | |
27 | + var clock; | |
28 | + | |
29 | + $(document).ready(function() { | |
30 | + var clock; | |
31 | + | |
32 | + clock = $('.clock_<?= $model->primaryKey ?>').FlipClock({ | |
33 | + clockFace: 'DailyCounter', | |
34 | + language: 'ru', | |
35 | + classes: { | |
36 | + active: 'flip-clock-active', | |
37 | + before: 'flip-clock-before', | |
38 | + divider: 'flip-clock-divider', | |
39 | + dot: 'flip-clock-dot', | |
40 | + label: 'flip-clock-label', | |
41 | + flip: 'flip', | |
42 | + play: 'play', | |
43 | + wrapper: 'flip-clock-wrapper' | |
44 | + }, | |
45 | + }); | |
46 | + | |
47 | + clock.setTime(<?= strtotime($model->end_at) - strtotime(date("Y-m-d H:i:s"))?>); | |
48 | + clock.setCountdown(true); | |
49 | + clock.start(); | |
50 | + | |
51 | + }); | |
52 | + </script> | |
53 | + | |
54 | + | |
55 | + <?php | |
56 | + } | |
57 | + | |
58 | + ?> | |
59 | + </div> | |
60 | + <div class="both"></div> | |
61 | + | |
62 | + | |
63 | + | |
64 | + | |
65 | + | |
66 | +</div> | |
0 | 67 | \ No newline at end of file | ... | ... |
1 | +<?php | |
2 | +use yii\helpers\Url; | |
3 | +use yii\widgets\Breadcrumbs; | |
4 | +//use app\models\News; | |
5 | +use yii\widgets\LinkPager; | |
6 | + | |
7 | +use yii\widgets\ListView; | |
8 | + | |
9 | +?> | |
10 | +<?php | |
11 | +$this->title = 'ะะบัะธะธ'; | |
12 | +$this->registerMetaTag(['name' => 'description', 'content' => 'ะะบัะธะธ']); | |
13 | +$this->registerMetaTag(['name' => 'keywords', 'content' => 'ะะบัะธะธ']); | |
14 | +?> | |
15 | + | |
16 | + | |
17 | +<div class="wrapper white item_container"> | |
18 | + <div class="container"> | |
19 | + <h1>ะะบัะธะธ</h1> | |
20 | + <?php | |
21 | + | |
22 | + foreach($dataProvider->models as $model){ | |
23 | + | |
24 | + if($model->isActive()){ | |
25 | + echo $this->render('_objects',['model' => $model]); | |
26 | + } | |
27 | + | |
28 | + } | |
29 | + ?> | |
30 | + | |
31 | + <div class="both"></div> | |
32 | + | |
33 | + | |
34 | + </div> | |
35 | + | |
36 | +</div> | |
0 | 37 | \ No newline at end of file | ... | ... |
1 | +<?php | |
2 | +use frontend\assets\FlipclockAsset; | |
3 | +use yii\helpers\Url; | |
4 | +use yii\widgets\Breadcrumbs; | |
5 | +FlipclockAsset::register($this); | |
6 | +?> | |
7 | +<?php | |
8 | +$this->title = $model->name; | |
9 | + | |
10 | +?> | |
11 | + | |
12 | + | |
13 | +<div class="wrapper white item_container"> | |
14 | + <div class="container"> | |
15 | + <h1><?=$model->name?></h1> | |
16 | + <div class="event_block_img"> | |
17 | + <?php if($model->image){?> | |
18 | + <?= \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'event_left', ['align' => 'left'])?> | |
19 | + <?php }?> | |
20 | + | |
21 | + <?php | |
22 | + | |
23 | + if(!empty($model->end_at) && strtotime($model->end_at) > strtotime(date("Y-m-d"))){ | |
24 | + ?> | |
25 | + <div class="clock_style clock"></div> | |
26 | + <script type="text/javascript"> | |
27 | + var clock; | |
28 | + | |
29 | + $(document).ready(function() { | |
30 | + var clock; | |
31 | + | |
32 | + clock = $('.clock').FlipClock({ | |
33 | + clockFace: 'DailyCounter', | |
34 | + language: 'ru', | |
35 | + classes: { | |
36 | + active: 'flip-clock-active', | |
37 | + before: 'flip-clock-before', | |
38 | + divider: 'flip-clock-divider', | |
39 | + dot: 'flip-clock-dot', | |
40 | + label: 'flip-clock-label', | |
41 | + flip: 'flip', | |
42 | + play: 'play', | |
43 | + wrapper: 'flip-clock-wrapper' | |
44 | + }, | |
45 | + }); | |
46 | + | |
47 | + clock.setTime(<?= strtotime($model->end_at) - strtotime(date("Y-m-d H:i:s"))?>); | |
48 | + clock.setCountdown(true); | |
49 | + clock.start(); | |
50 | + | |
51 | + }); | |
52 | + </script> | |
53 | + | |
54 | + | |
55 | + <?php | |
56 | + } | |
57 | + | |
58 | + ?> | |
59 | + </div> | |
60 | + | |
61 | + <?=$model->body?> | |
62 | + </div> | |
63 | + | |
64 | + | |
65 | + <div class="content"> | |
66 | + <div class="products pn"> | |
67 | + <ul> | |
68 | + <?php foreach($productProvider->models as $product) :?> | |
69 | + <?php if(!empty($product->enabledVariants) ):?> | |
70 | + <?= $this->render('../catalog/product_item', ['product' => $product])?> | |
71 | + <?php endif;?> | |
72 | + <?php endforeach?> | |
73 | + </ul> | |
74 | + </div> | |
75 | + </div> | |
76 | + | |
77 | +</div> | |
0 | 78 | \ No newline at end of file | ... | ... |
frontend/web/css/css_header.css
... | ... | @@ -14391,3 +14391,133 @@ h1.title { |
14391 | 14391 | } |
14392 | 14392 | } |
14393 | 14393 | |
14394 | +.flip-clock-wrapper ul{ | |
14395 | + width: 40px; | |
14396 | + height: 60px; | |
14397 | +} | |
14398 | + | |
14399 | +.flip-clock-wrapper ul li{ | |
14400 | + line-height: 60px; | |
14401 | +} | |
14402 | + | |
14403 | +.flip-clock-wrapper ul li a div div.inn{ | |
14404 | + font-size: 50px; | |
14405 | +} | |
14406 | + | |
14407 | +.flip-clock-dot.top{ | |
14408 | + top: 40px; | |
14409 | +} | |
14410 | +.flip-clock-dot.bottom{ | |
14411 | + bottom: 40px; | |
14412 | +} | |
14413 | +.flip-clock-divider { | |
14414 | + height: 70px; | |
14415 | +} | |
14416 | + | |
14417 | +.events{ | |
14418 | + margin-top: 20px; | |
14419 | + margin-bottom: 20px; | |
14420 | + | |
14421 | +} | |
14422 | +.events img{ | |
14423 | + display: block; | |
14424 | + margin: 0 auto; | |
14425 | +} | |
14426 | + | |
14427 | +.news_item{ | |
14428 | + position: relative; | |
14429 | +} | |
14430 | +.clock_style{ | |
14431 | + position: absolute; | |
14432 | + top:10px; | |
14433 | + left: 10px; | |
14434 | +} | |
14435 | +.clock_style .flip-clock-label{ | |
14436 | + right: -65px !important; | |
14437 | +} | |
14438 | +.event_block{ | |
14439 | + position: relative; | |
14440 | + width: 260px; | |
14441 | + overflow: hidden; | |
14442 | + border: 2px solid #799920; | |
14443 | + padding: 5px; | |
14444 | +} | |
14445 | + | |
14446 | +.event_block .flip-clock-wrapper{ | |
14447 | + margin-top: 15px; | |
14448 | + margin-left: 0px; | |
14449 | +} | |
14450 | +.event_block .flip-clock-wrapper ul{ | |
14451 | + width: 27px; | |
14452 | + height: 46px; | |
14453 | + padding: 0; | |
14454 | + margin: 1px; | |
14455 | +} | |
14456 | + | |
14457 | +.event_block .event_title a{ | |
14458 | + color: #799920; | |
14459 | + font-size: 20px; | |
14460 | + margin-bottom: 5px; | |
14461 | +} | |
14462 | +.event_block .flip-clock-label{ | |
14463 | + right: -45px !important; | |
14464 | +} | |
14465 | + | |
14466 | +.event_block .flip-clock-wrapper ul li a div div.inn{ | |
14467 | + font-size: 40px; | |
14468 | +} | |
14469 | + | |
14470 | + | |
14471 | +.event_block .flip-clock-dot { | |
14472 | + left: 2px; | |
14473 | +} | |
14474 | +.event_block .flip-clock-divider.hours, | |
14475 | +.event_block .flip-clock-divider.minutes, | |
14476 | +.event_block .flip-clock-divider.seconds{ | |
14477 | + width: 9px; | |
14478 | +} | |
14479 | + | |
14480 | +.event_block .flip-clock-dot{ | |
14481 | + width: 6px; | |
14482 | + height: 6px; | |
14483 | +} | |
14484 | + | |
14485 | +.event_block .flip-clock-dot.top{ | |
14486 | + top: 30px; | |
14487 | +} | |
14488 | +.event_block .flip-clock-dot.bottom{ | |
14489 | + bottom: 50px; | |
14490 | +} | |
14491 | + | |
14492 | +.event_block .flip-clock-wrapper ul li{ | |
14493 | + line-height: 50px; | |
14494 | +} | |
14495 | +#HOME_SLIDER .flip-clock-wrapper{ | |
14496 | + z-index: 1000; | |
14497 | +} | |
14498 | + | |
14499 | +ul.product-special li.promo div{ | |
14500 | + color: #fff; | |
14501 | +} | |
14502 | + | |
14503 | +.news_item{ | |
14504 | + display: block; | |
14505 | + height: 270px; | |
14506 | +} | |
14507 | +.news_item{ | |
14508 | + margin-bottom: 20px | |
14509 | +} | |
14510 | + | |
14511 | +.news_item { | |
14512 | + padding-bottom: 20px; | |
14513 | + border-bottom: 1px solid silver | |
14514 | +} | |
14515 | + | |
14516 | + | |
14517 | +.news_item a { | |
14518 | + font-size: 16px | |
14519 | +} | |
14520 | +.event_block_img{ | |
14521 | + position: relative; | |
14522 | + overflow: hidden; | |
14523 | +} | ... | ... |
frontend/web/js/artbox_basket.js
frontend/web/js/artbox_basket.js.map
1 | -{"version":3,"file":"artbox_basket.js","sourceRoot":"","sources":["artbox_basket.ts"],"names":[],"mappings":"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"} | |
2 | 1 | \ No newline at end of file |
2 | +{"version":3,"file":"artbox_basket.js","sourceRoot":"","sources":["artbox_basket.ts"],"names":["ArtboxBasket","ArtboxBasket.constructor","ArtboxBasket.items","ArtboxBasket.add","ArtboxBasket.set","ArtboxBasket.updateModal","ArtboxBasket.updateCart","ArtboxBasket.count","ArtboxBasket.sum"],"mappings":"AAAA;IAKIA;QACIC,CAACA,CAACA,GAAGA,CAACA,SAASA,EAAEA,UAAUA,IAAIA;YAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC1B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC,CAACA,IAAIA,CAACA,IAAIA,CAACA,EAAEA,MAAMA,CAACA,CAACA,IAAIA,CAACA;YACvB,OAAO,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC3C,CAAC,CAACA,CAACA;IACPA,CAACA;IAVDD,sBAAIA,+BAAKA;aAATA;YACIE,MAAMA,CAACA,IAAIA,CAACA,MAAMA,CAACA;QACvBA,CAACA;;;OAAAF;IASMA,0BAAGA,GAAVA,UAAWA,kBAAkBA,EAAEA,KAAKA;QAChCG,CAACA,CAACA,IAAIA,CAACA,iCAAiCA,GAACA,kBAAkBA,GAACA,SAASA,GAACA,KAAKA,EAAEA,UAAUA,IAAIA;YACvF,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC1B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAClD,CAAC,CAACA,IAAIA,CAACA,IAAIA,CAACA,EAAEA,MAAMA,CAACA,CAACA,IAAIA,CAACA,UAAUA,GAAGA,EAAEA,MAAMA,EAAEA,KAAKA;YACnD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC,CAACA,CAACA;IACPA,CAACA;IACMH,0BAAGA,GAAVA,UAAWA,kBAAkBA,EAAEA,KAAKA;QAChCI,CAACA,CAACA,IAAIA,CAACA,iCAAiCA,GAACA,kBAAkBA,GAACA,SAASA,GAACA,KAAKA,EAAEA,UAAUA,IAAIA;YACvF,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC1B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC,CAACA,IAAIA,CAACA,IAAIA,CAACA,EAAEA,MAAMA,CAACA,CAACA,IAAIA,CAACA,UAAUA,GAAGA,EAAEA,MAAMA,EAAEA,KAAKA;YACnD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC,CAACA,CAACA;IACPA,CAACA;IACMJ,kCAAWA,GAAlBA,UAAmBA,KAAKA,EAAEA,SAASA,EAAEA,IAAYA;QAAZK,oBAAYA,GAAZA,YAAYA;QAE7CA,IAAIA,QAAQA,GAAGA,CAACA,CAACA,UAAUA,CAACA,CAACA;QAC7BA,QAAQA,CAACA,IAAIA,CAACA,KAAKA,CAACA,CAACA;QACrBA,EAAEA,CAAAA,CAACA,IAAIA,CAACA,KAAKA,GAAGA,CAACA,CAACA,CAACA,CAACA;YAChBA,QAAQA,CAACA,KAAKA,CAACA,MAAMA,CAACA,CAACA;QAC3BA,CAACA;QAACA,IAAIA,CAACA,EAAEA,CAAAA,CAACA,IAAIA,CAACA,CAACA,CAACA;YACbA,QAAQA,CAACA,KAAKA,CAACA,MAAMA,CAACA,CAACA;QAC3BA,CAACA;QACDA,IAAIA,CAACA,UAAUA,CAACA,SAASA,CAACA,CAACA;IAC/BA,CAACA;IACML,iCAAUA,GAAjBA,UAAkBA,SAASA;QACvBM,IAAIA,IAAIA,GAAGA,CAACA,CAACA,mBAAmBA,CAACA,CAACA;QAClCA,IAAIA,CAACA,IAAIA,CAACA,SAASA,CAACA,CAACA;IACzBA,CAACA;IACDN,sBAAIA,+BAAKA;aAATA;YACIO,MAAMA,CAACA,MAAMA,CAACA,IAAIA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA,MAAMA,CAACA;QAC3CA,CAACA;;;OAAAP;IACDA,sBAAIA,6BAAGA;aAAPA;YACIQ,IAAIA,GAAGA,GAAGA,CAACA,CAACA;YACZA,CAACA,CAACA,IAAIA,CAACA,IAAIA,CAACA,MAAMA,EAAEA,UAASA,KAAKA,EAAEA,KAAKA;gBACrC,GAAG,IAAI,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YACrC,CAAC,CAACA,CAACA;YACHA,MAAMA,CAACA,GAAGA,CAACA;QACfA,CAACA;;;OAAAR;IACLA,mBAACA;AAADA,CAACA,AAtDD,IAsDC"} | |
3 | 3 | \ No newline at end of file | ... | ... |