Commit 225c516879dcb750b511acdc566cdcfdb21912de
1 parent
f717e203
test
Showing
8 changed files
with
525 additions
and
362 deletions
Show diff stats
common/models/Fields.php
1 | 1 | <?php |
2 | 2 | |
3 | -namespace common\models; | |
3 | + namespace common\models; | |
4 | 4 | |
5 | -use Yii; | |
6 | -use yii\helpers\ArrayHelper; | |
5 | + use Yii; | |
6 | + use yii\helpers\ArrayHelper; | |
7 | 7 | |
8 | -/** | |
9 | - * This is the model class for table "{{%fields}}". | |
10 | - * | |
11 | - * @property integer $id | |
12 | - * @property string $table_name | |
13 | - * @property integer $table_id | |
14 | - * @property string $value | |
15 | - * @property string $field_name | |
16 | - * @property string $field_type | |
17 | - * @property string $language | |
18 | - * @property string $parent_key | |
19 | - * @property string $key | |
20 | - */ | |
21 | -class Fields extends \yii\db\ActiveRecord | |
22 | -{ | |
23 | 8 | /** |
24 | - * @inheritdoc | |
9 | + * This is the model class for table "{{%fields}}". | |
10 | + * @property integer $id | |
11 | + * @property string $table_name | |
12 | + * @property integer $table_id | |
13 | + * @property string $value | |
14 | + * @property string $field_name | |
15 | + * @property string $field_type | |
16 | + * @property string $language | |
17 | + * @property string $parent_key | |
18 | + * @property string $key | |
25 | 19 | */ |
26 | - public static function tableName() | |
20 | + class Fields extends \yii\db\ActiveRecord | |
27 | 21 | { |
28 | - return '{{%fields}}'; | |
29 | - } | |
30 | - | |
31 | - /** | |
32 | - * @inheritdoc | |
33 | - */ | |
34 | - public function rules() | |
35 | - { | |
36 | - return [ | |
37 | - [['table_name', 'table_id',], 'required'], | |
38 | - [['table_id','parent_key','key'], 'integer'], | |
39 | - [['table_name', 'value', 'field_name','field_type','language'], 'string', 'max' => 255] | |
40 | - ]; | |
41 | - } | |
42 | 22 | |
43 | - /** | |
44 | - * @inheritdoc | |
45 | - */ | |
46 | - public function attributeLabels() | |
47 | - { | |
48 | - return [ | |
49 | - 'id' => 'ID', | |
50 | - 'table_name' => 'Model Name', | |
51 | - 'table_id' => 'Model ID', | |
52 | - 'value' => 'Value', | |
53 | - 'field_name' => 'Field Name', | |
54 | - 'language' => 'Language', | |
55 | - ]; | |
56 | - } | |
57 | - | |
58 | - public static function getData($id, $model, $type){ | |
59 | - $data = ArrayHelper::toArray(self::find()->where(['table_id'=>$id, 'table_name'=>$model, 'field_type'=>$type])->all()); | |
60 | - $result = []; | |
61 | - for($i=0; $i < count($data); $i ++){ | |
62 | - $result[$data[$i]['parent_key']][$data[$i]['field_name']] = $data[$i]['value']; | |
23 | + /** | |
24 | + * @inheritdoc | |
25 | + */ | |
26 | + public static function tableName() | |
27 | + { | |
28 | + return '{{%fields}}'; | |
63 | 29 | } |
64 | 30 | |
65 | - return $result; | |
66 | - } | |
67 | - | |
68 | - | |
69 | - /** | |
70 | - * @param $post - array with field data | |
71 | - * @param $table_id - row id in model table | |
72 | - * @param $table_name - madel table name | |
73 | - * @param $language - language id | |
74 | - */ | |
75 | - | |
76 | - public static function saveFieldData($post,$table_id,$table_name, $language){ | |
77 | - | |
78 | - self::deleteAll(['table_id'=>$table_id, 'table_name'=>$table_name, 'language' => $language, 'field_type' => array_keys($post)]); | |
79 | - | |
80 | - if($post){ | |
81 | - | |
82 | - | |
83 | - foreach($post as $k => $field){ | |
84 | - | |
31 | + /** | |
32 | + * @inheritdoc | |
33 | + */ | |
34 | + public function rules() | |
35 | + { | |
36 | + return [ | |
37 | + [ | |
38 | + [ | |
39 | + 'table_name', | |
40 | + 'table_id', | |
41 | + ], | |
42 | + 'required', | |
43 | + ], | |
44 | + [ | |
45 | + [ | |
46 | + 'table_id', | |
47 | + 'parent_key', | |
48 | + 'key', | |
49 | + ], | |
50 | + 'integer', | |
51 | + ], | |
52 | + [ | |
53 | + [ | |
54 | + 'table_name', | |
55 | + 'value', | |
56 | + 'field_name', | |
57 | + 'field_type', | |
58 | + 'language', | |
59 | + ], | |
60 | + 'string', | |
61 | + 'max' => 255, | |
62 | + ], | |
63 | + ]; | |
64 | + } | |
85 | 65 | |
66 | + /** | |
67 | + * @inheritdoc | |
68 | + */ | |
69 | + public function attributeLabels() | |
70 | + { | |
71 | + return [ | |
72 | + 'id' => 'ID', | |
73 | + 'table_name' => 'Model Name', | |
74 | + 'table_id' => 'Model ID', | |
75 | + 'value' => 'Value', | |
76 | + 'field_name' => 'Field Name', | |
77 | + 'language' => 'Language', | |
78 | + ]; | |
79 | + } | |
86 | 80 | |
87 | - foreach($field as $parent_key => $row){ | |
81 | + public static function getData($id, $model, $type) | |
82 | + { | |
83 | + $data = ArrayHelper::toArray(self::find() | |
84 | + ->where([ | |
85 | + 'table_id' => $id, | |
86 | + 'table_name' => $model, | |
87 | + 'field_type' => $type, | |
88 | + ]) | |
89 | + ->all()); | |
90 | + $result = [ ]; | |
91 | + for($i = 0; $i < count($data); $i++) { | |
92 | + $result[ $data[ $i ][ 'parent_key' ] ][ $data[ $i ][ 'field_name' ] ] = $data[ $i ][ 'value' ]; | |
93 | + } | |
88 | 94 | |
89 | - foreach($row as $key => $value){ | |
95 | + return $result; | |
96 | + } | |
90 | 97 | |
91 | - $field_model = new Fields(); | |
92 | - $field_model->field_name = array_keys($value)[0]; | |
93 | - $field_model->value = $value[array_keys($value)[0]]; | |
94 | - $field_model->table_name = $table_name; | |
95 | - $field_model->table_id = $table_id; | |
96 | - $field_model->field_type = $k; | |
97 | - $field_model->language = 'ru'; | |
98 | - $field_model->parent_key = $parent_key; | |
99 | - $field_model->key = $key; | |
100 | - $field_model->save(); | |
98 | + /** | |
99 | + * @param array $post - array with field data | |
100 | + * @param int $table_id - row id in model table | |
101 | + * @param string $table_name - madel table name | |
102 | + * @param int $language - language id | |
103 | + */ | |
104 | + public static function saveFieldData($post, $table_id, $table_name, $language) | |
105 | + { | |
106 | + self::deleteAll([ | |
107 | + 'table_id' => $table_id, | |
108 | + 'table_name' => $table_name, | |
109 | + 'language' => $language, | |
110 | + 'field_type' => array_keys($post), | |
111 | + ]); | |
112 | + if($post) { | |
113 | + /* | |
114 | + * $k - field group name | |
115 | + * $field - array of group variations | |
116 | + */ | |
117 | + foreach($post as $k => $field) { | |
118 | + /** | |
119 | + * $parent_key - group variation index | |
120 | + * $row - array of indexed rows | |
121 | + */ | |
122 | + foreach($field as $parent_key => $row) { | |
123 | + /** | |
124 | + * $key - row sorting index | |
125 | + * $value - array, where key - subfield name, value - subfield value | |
126 | + */ | |
127 | + foreach($row as $key => $value) { | |
128 | + if(!empty($value[array_keys($value)[0]])) { | |
129 | + $field_model = new Fields(); | |
130 | + $field_model->field_name = array_keys($value)[ 0 ]; | |
131 | + $field_model->value = $value[ array_keys($value)[ 0 ] ]; | |
132 | + $field_model->table_name = $table_name; | |
133 | + $field_model->table_id = $table_id; | |
134 | + $field_model->field_type = $k; | |
135 | + $field_model->language = 'ru'; | |
136 | + $field_model->parent_key = $parent_key; | |
137 | + $field_model->key = $key; | |
138 | + $field_model->save(); | |
139 | + } | |
140 | + } | |
101 | 141 | } |
102 | - | |
103 | 142 | } |
104 | 143 | } |
105 | 144 | } |
106 | - } | |
107 | - | |
108 | - | |
109 | - /** | |
110 | - * @param $post - array with field data | |
111 | - * @param $table_id - row id in model table | |
112 | - * @param $table_name - madel table name | |
113 | - * @param $language - language id | |
114 | - */ | |
115 | - | |
116 | - public static function saveFieldVideoData($post,$table_id,$table_name, $language){ | |
117 | - | |
118 | - self::deleteAll(['table_id'=>$table_id, 'table_name'=>$table_name, 'language' => $language, 'field_type' => array_keys($post)]); | |
119 | - | |
120 | - if($post){ | |
121 | - | |
122 | - | |
123 | - foreach($post as $k => $field){ | |
124 | - | |
125 | - | |
126 | - | |
127 | - foreach($field as $parent_key => $row){ | |
128 | - | |
129 | - foreach($row as $key => $value){ | |
130 | - | |
131 | - preg_match('/src=\"(.[^"]*)\"/', $value[array_keys($value)[0]], $video_url); | |
132 | - | |
133 | - if(isset($video_url[1]) && !empty($video_url[1])){ | |
134 | - | |
135 | - $field_model = new Fields(); | |
136 | - $field_model->field_name = array_keys($value)[0]; | |
137 | - $field_model->value = $video_url[1].'?showinfo=0&autoplay=0'; | |
138 | - $field_model->table_name = $table_name; | |
139 | - $field_model->table_id = $table_id; | |
140 | - $field_model->field_type = $k; | |
141 | - $field_model->language = 'ru'; | |
142 | - $field_model->parent_key = $parent_key; | |
143 | - $field_model->key = $key; | |
144 | - $field_model->save(); | |
145 | 145 | |
146 | + /** | |
147 | + * @param $post - array with field data | |
148 | + * @param $table_id - row id in model table | |
149 | + * @param $table_name - madel table name | |
150 | + * @param $language - language id | |
151 | + */ | |
152 | + | |
153 | + public static function saveFieldVideoData($post, $table_id, $table_name, $language) | |
154 | + { | |
155 | + self::deleteAll([ | |
156 | + 'table_id' => $table_id, | |
157 | + 'table_name' => $table_name, | |
158 | + 'language' => $language, | |
159 | + 'field_type' => array_keys($post), | |
160 | + ]); | |
161 | + if($post) { | |
162 | + foreach($post as $k => $field) { | |
163 | + foreach($field as $parent_key => $row) { | |
164 | + foreach($row as $key => $value) { | |
165 | + preg_match('/src=\"(.[^"]*)\"/', $value[ array_keys($value)[ 0 ] ], $video_url); | |
166 | + if(isset( $video_url[ 1 ] ) && !empty( $video_url[ 1 ] )) { | |
167 | + $field_model = new Fields(); | |
168 | + $field_model->field_name = array_keys($value)[ 0 ]; | |
169 | + $field_model->value = $video_url[ 1 ] . '?showinfo=0&autoplay=0'; | |
170 | + $field_model->table_name = $table_name; | |
171 | + $field_model->table_id = $table_id; | |
172 | + $field_model->field_type = $k; | |
173 | + $field_model->language = 'ru'; | |
174 | + $field_model->parent_key = $parent_key; | |
175 | + $field_model->key = $key; | |
176 | + $field_model->save(); | |
177 | + | |
178 | + } | |
146 | 179 | } |
147 | - | |
148 | - | |
149 | 180 | } |
150 | - | |
151 | 181 | } |
152 | 182 | } |
153 | 183 | } |
154 | 184 | } |
155 | -} | ... | ... |
common/widgets/views/education_field.php
... | ... | @@ -22,11 +22,11 @@ |
22 | 22 | 'id' => isset( $model[ $i ][ 'parent_key' ] ) ? $model[ $i ][ 'parent_key' ] : 0, |
23 | 23 | ]) ?> |
24 | 24 | <div class="input-blocks"> |
25 | - <input id="edu-name-<?= ++$label ?>" type="text" placeholder="Название" class="form-control custom-input-2" value="<?= isset( $model[ $t ][ 'value' ] ) ? $model[ $t ][ 'value' ] : '' ?>" name="Fields[education][<?= $row ?>][0][name]"/> | |
25 | + <input id="edu-name-<?= ++$label ?>" type="text" placeholder="Название" class="form-control custom-input-2" value="<?= isset( $model[ $t ][ 'value' ] ) ? $model[ $t ][ 'value' ] : '' ?>" name="Fields[education][<?= $row ?>][0][name]" required /> | |
26 | 26 | <label for="edu-name-<?= $label ?>">Название ВУЗа</label> |
27 | 27 | </div> |
28 | 28 | <div class="input-blocks"> |
29 | - <input id="edu-to-<?= ++$label ?>" type="number" class="form-control form-control custom-input-2 custom-input-2-date" value="<?= isset( $model[ ++$t ][ 'value' ] ) ? $model[ $t ][ 'value' ] : '' ?>" name="Fields[education][<?= $row ?>][1][year_from]" min="1950" max="<?=date('Y')?>" /> | |
29 | + <input id="edu-to-<?= ++$label ?>" type="number" class="form-control form-control custom-input-2 custom-input-2-date" value="<?= isset( $model[ ++$t ][ 'value' ] ) ? $model[ $t ][ 'value' ] : '' ?>" name="Fields[education][<?= $row ?>][1][year_from]" min="1950" max="<?=date('Y')?>" required /> | |
30 | 30 | <label for="edu-to-<?= $label ?>">год начала</label> |
31 | 31 | </div> |
32 | 32 | <div class="input-blocks"> | ... | ... |
frontend/controllers/CompanyController.php
... | ... | @@ -13,10 +13,12 @@ |
13 | 13 | use yii\data\ActiveDataProvider; |
14 | 14 | use yii\data\ArrayDataProvider; |
15 | 15 | use yii\data\Pagination; |
16 | + use yii\data\Sort; | |
16 | 17 | use yii\helpers\ArrayHelper; |
17 | 18 | use yii\web\BadRequestHttpException; |
18 | 19 | use yii\web\Controller; |
19 | 20 | use common\models\User; |
21 | + use yii\web\NotFoundHttpException; | |
20 | 22 | |
21 | 23 | /** |
22 | 24 | * Site controller |
... | ... | @@ -51,19 +53,57 @@ |
51 | 53 | |
52 | 54 | public function actionCommon($company_id) |
53 | 55 | { |
54 | - $company = User::findOne($company_id); | |
56 | + /** | |
57 | + * @var User $company | |
58 | + */ | |
59 | + if(!$company = User::find() | |
60 | + ->where([ 'id' => $company_id ]) | |
61 | + ->with('teams') | |
62 | + ->with('teams.department') | |
63 | + ->with('userInfo') | |
64 | + ->with('companyInfo') | |
65 | + ->one() | |
66 | + ) { | |
67 | + throw new NotFoundHttpException('Компания не найдена'); | |
68 | + } | |
55 | 69 | |
56 | - $educations = Fields::getData($company->id, $company->className(), 'education'); | |
57 | - $phones = Fields::getData($company->id, $company->className(), 'phone'); | |
58 | - $sites = Fields::getData($company->id, $company->className(), 'site'); | |
59 | - $soft = implode(', ', ArrayHelper::getColumn(Fields::getData($company->id, $company->className(), 'soft'), 'soft')); | |
70 | + $projectProvider = new ActiveDataProvider([ | |
71 | + 'query' => $company->getProjects(), | |
72 | + ]); | |
73 | + | |
74 | + $blogProvider = new ActiveDataProvider([ | |
75 | + 'query' => $company->getBlog() | |
76 | + ->with('comments'), | |
77 | + 'sort' => new Sort([ | |
78 | + 'defaultOrder' => [ | |
79 | + 'date_add' => SORT_DESC, | |
80 | + 'name' => SORT_ASC, | |
81 | + ], | |
82 | + ]), | |
83 | + 'pagination' => new Pagination([ | |
84 | + 'pageSize' => 2, | |
85 | + 'pageParam' => '', | |
86 | + ]), | |
87 | + ]); | |
88 | + | |
89 | + $commentProvider = new ActiveDataProvider([ | |
90 | + 'query' => $company->getComments(), | |
91 | + 'sort' => new Sort([ | |
92 | + 'defaultOrder' => [ | |
93 | + 'date_add' => SORT_DESC, | |
94 | + ], | |
95 | + ]), | |
96 | + 'pagination' => new Pagination([ | |
97 | + 'pageSize' => 4, | |
98 | + 'pageParam' => '', | |
99 | + ]), | |
100 | + ]); | |
60 | 101 | |
61 | 102 | return $this->render('common', [ |
62 | - 'company' => $company, | |
63 | - 'educations' => $educations, | |
64 | - 'phones' => $phones, | |
65 | - 'sites' => $sites, | |
66 | - 'soft' => $soft, | |
103 | + 'company' => $company, | |
104 | + 'projectProvider' => $projectProvider, | |
105 | + 'blogProvider' => $blogProvider, | |
106 | + 'commentProvider' => $commentProvider, | |
67 | 107 | ]); |
68 | 108 | } |
69 | 109 | |
... | ... | @@ -165,9 +205,9 @@ |
165 | 205 | throw new BadRequestHttpException('Пользователь не найден'); |
166 | 206 | } |
167 | 207 | $comments = new ActiveDataProvider([ |
168 | - 'query' => $company->getComments(), | |
208 | + 'query' => $company->getComments(), | |
169 | 209 | 'pagination' => [ |
170 | - 'pageSize' => 4 | |
210 | + 'pageSize' => 4, | |
171 | 211 | ], |
172 | 212 | ]); |
173 | 213 | $query = Team::find() | ... | ... |
frontend/controllers/PerformerController.php
... | ... | @@ -69,16 +69,20 @@ |
69 | 69 | } |
70 | 70 | |
71 | 71 | $educations = Fields::getData($user->id, $user->className(), 'education'); |
72 | + $developments = Fields::getData($user->id, $user->className(), 'development'); | |
73 | + $courses = Fields::getData($user->id, $user->className(), 'courses'); | |
72 | 74 | $phones = Fields::getData($user->id, $user->className(), 'phone'); |
73 | 75 | $sites = Fields::getData($user->id, $user->className(), 'site'); |
74 | 76 | $soft = implode(', ', ArrayHelper::getColumn(Fields::getData($user->id, $user->className(), 'soft'), 'soft')); |
75 | 77 | |
76 | 78 | return $this->render('common', [ |
77 | - 'user' => $user, | |
78 | - 'educations' => $educations, | |
79 | - 'phones' => $phones, | |
80 | - 'sites' => $sites, | |
81 | - 'soft' => $soft, | |
79 | + 'user' => $user, | |
80 | + 'educations' => $educations, | |
81 | + 'developments' => $developments, | |
82 | + 'courses' => $courses, | |
83 | + 'phones' => $phones, | |
84 | + 'sites' => $sites, | |
85 | + 'soft' => $soft, | |
82 | 86 | ]); |
83 | 87 | |
84 | 88 | } | ... | ... |
1 | +<?php | |
2 | + /** | |
3 | + * @var Blog $model | |
4 | + */ | |
5 | + use common\models\Blog; | |
6 | + use yii\helpers\Html; | |
7 | + | |
8 | +?> | |
9 | +<?php | |
10 | + echo Html::a(Html::img($model->cover), [ | |
11 | + 'company/blog-view', | |
12 | + 'company_id' => $model->user_id, | |
13 | + 'link' => $model->link, | |
14 | + ]); | |
15 | +?> | |
16 | +<div class="min-post-txt"> | |
17 | + <div class="blog-post-icons-wr style"> | |
18 | + <div class="blog-post-date"> | |
19 | + <span></span> | |
20 | + <p><?= \Yii::$app->formatter->asDate($model->date_add, 'php:d.m.Y') ?></p> | |
21 | + </div> | |
22 | + <div class="blog-post-views"> | |
23 | + <span></span> | |
24 | + <p><?= $model->view_count ?></p> | |
25 | + </div> | |
26 | + <div class="blog-post-comm-num"> | |
27 | + <span></span> | |
28 | + <p><?= count($model->comments) ?></p> | |
29 | + </div> | |
30 | + </div> | |
31 | + <?= Html::a($model->name, [ | |
32 | + 'company/blog-view', | |
33 | + 'company_id' => $model->user_id, | |
34 | + 'link' => $model->link, | |
35 | + ]) ?> | |
36 | +</div> | |
0 | 37 | \ No newline at end of file | ... | ... |
frontend/views/company/common.php
1 | 1 | <?php |
2 | - | |
3 | -use \yii\helpers\Html; | |
4 | - | |
5 | -/* @var $this yii\web\View */ | |
6 | -$this->params['company'] = $company; | |
7 | -$this->title = 'My Yii Application'; | |
2 | + /** | |
3 | + * @var View $this | |
4 | + * @var User $company | |
5 | + * @var ActiveDataProvider $projectProvider | |
6 | + * @var ActiveDataProvider $blogProvider | |
7 | + * @var ActiveDataProvider $commentProvider | |
8 | + */ | |
9 | + use common\models\User; | |
10 | + use yii\data\ActiveDataProvider; | |
11 | + use yii\helpers\ArrayHelper; | |
12 | + use yii\web\View; | |
13 | + use yii\widgets\ListView; | |
14 | + | |
15 | + $this->params[ 'company' ] = $company; | |
16 | + $this->title = 'My Yii Application'; | |
8 | 17 | ?> |
9 | -<div class="company-performer-title style">О компании</div> | |
10 | -<div class="company-performer-txt style"> | |
11 | - <p>Строительная компания «Познякижилстрой» (официально – это корпорация) хорошо известна на столичном рынке недвижимости. Данный застройщик – единственный в Украине, который имеет сертификаты по трем международным стандартам.</p> | |
12 | - <p>Более миллиона квадратных метров жилья и других строений разного назначения было построено компанией с 1996 года, когда молодая киевская организация начала свой славный путь. Сейчас надежный и уверенный в своих силах застройщик «Познякижилстрой» пополняет свой каталог объектов новостройками, современными ЖК, офисными помещениями, паркингами и многими другими объектами. Корпорация уверенно занимает позиции лидера на украинском строительном рынке.</p> | |
13 | - <p>Новые подходы к проектированию, строительным работам и управлению компанией позволяют «Познякижилстрой» выставлять на продажу качественные квартиры, часть из которых реализуются с ремонтом и по приемлемой цене.</p> | |
14 | - <p>Корпорация «Познякижилстрой» строго придерживается буквы закона, гарантируя персоналу, своим потребителям и обществу выполнение нормативных требований, связанных с экологией, охраной здоровья и качеством выполняемых работ. На официальном сайте компании опубликованы объекты застройщика, есть описание его политики и последние новости.</p> | |
15 | -</div> | |
18 | + <div class="company-performer-title style">О компании</div> | |
19 | + <div class="company-performer-txt style"> | |
20 | + <?= $company->userInfo->about ?> | |
21 | + </div> | |
16 | 22 | <?php |
17 | 23 | /*====Blocks for layout====*/ |
24 | + /* | |
25 | + * Use $projectProvider to obtain models for this block | |
26 | + */ | |
18 | 27 | $this->beginBlock('our_objects'); |
19 | 28 | ?> |
20 | 29 | <div class="section-box-18"> |
21 | 30 | <div class="box-wr"> |
22 | 31 | <div class="box-all"> |
23 | - <div class="company-performer-type-title style">Наши объекты (12)</div> | |
32 | + <div class="company-performer-type-title style">Наши объекты (<?= $projectProvider->totalCount ?>)</div> | |
24 | 33 | <div class="settings-map-ul"> |
25 | 34 | <ul> |
26 | 35 | <li><a href="#" class="active"><span>Последний год</span></a></li> |
... | ... | @@ -33,164 +42,122 @@ $this->title = 'My Yii Application'; |
33 | 42 | <div class="shadow-map"></div> |
34 | 43 | <div id="map_cloud" style="display: none;"> |
35 | 44 | <script type="text/javascript"> |
36 | - function initialize() { | |
45 | + function initialize() | |
46 | + { | |
37 | 47 | var start_position = new google.maps.LatLng('49', '33'); |
38 | 48 | var settings = { |
39 | - zoom: 7, | |
40 | - scrollwheel: true, | |
41 | - center: start_position, | |
42 | - mapTypeControl: false, | |
43 | - mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}, | |
44 | - navigationControl: false, | |
45 | - navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL}, | |
46 | - scaleControl: false, | |
47 | - streetViewControl: false, | |
48 | - rotateControl: false, | |
49 | - zoomControl:true, | |
50 | - mapTypeId: google.maps.MapTypeId.ROADMAP}; | |
49 | + zoom : 7, scrollwheel : true, center : start_position, | |
50 | + mapTypeControl : false, | |
51 | + mapTypeControlOptions : {style : google.maps.MapTypeControlStyle.DROPDOWN_MENU}, | |
52 | + navigationControl : false, | |
53 | + navigationControlOptions : {style : google.maps.NavigationControlStyle.SMALL}, | |
54 | + scaleControl : false, streetViewControl : false, | |
55 | + rotateControl : false, zoomControl : true, | |
56 | + mapTypeId : google.maps.MapTypeId.ROADMAP | |
57 | + }; | |
51 | 58 | var map = new google.maps.Map(document.getElementById("map_canvas"), settings); |
52 | 59 | |
53 | - | |
54 | - var image1 = new google.maps.MarkerImage('/images/markers/marker-we-1.png', | |
55 | - new google.maps.Size(21, 32), | |
56 | - new google.maps.Point(0,0), | |
57 | - new google.maps.Point(16, 35) | |
60 | + var image1 = new google.maps.MarkerImage( | |
61 | + '/images/markers/marker-we-1.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
58 | 62 | ); |
59 | - var image2 = new google.maps.MarkerImage('/images/markers/marker-we-2.png', | |
60 | - new google.maps.Size(21, 32), | |
61 | - new google.maps.Point(0,0), | |
62 | - new google.maps.Point(16, 35) | |
63 | + var image2 = new google.maps.MarkerImage( | |
64 | + '/images/markers/marker-we-2.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
63 | 65 | ); |
64 | - var image3 = new google.maps.MarkerImage('/images/markers/marker-we-3.png', | |
65 | - new google.maps.Size(21, 32), | |
66 | - new google.maps.Point(0,0), | |
67 | - new google.maps.Point(16, 35) | |
66 | + var image3 = new google.maps.MarkerImage( | |
67 | + '/images/markers/marker-we-3.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
68 | 68 | ); |
69 | - var image4 = new google.maps.MarkerImage('/images/markers/marker-we-4.png', | |
70 | - new google.maps.Size(21, 32), | |
71 | - new google.maps.Point(0,0), | |
72 | - new google.maps.Point(16, 35) | |
69 | + var image4 = new google.maps.MarkerImage( | |
70 | + '/images/markers/marker-we-4.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
73 | 71 | ); |
74 | - var image5 = new google.maps.MarkerImage('/images/markers/marker-we-5.png', | |
75 | - new google.maps.Size(21, 32), | |
76 | - new google.maps.Point(0,0), | |
77 | - new google.maps.Point(16, 35) | |
72 | + var image5 = new google.maps.MarkerImage( | |
73 | + '/images/markers/marker-we-5.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
78 | 74 | ); |
79 | - var image6 = new google.maps.MarkerImage('/images/markers/marker-we-6.png', | |
80 | - new google.maps.Size(21, 32), | |
81 | - new google.maps.Point(0,0), | |
82 | - new google.maps.Point(16, 35) | |
75 | + var image6 = new google.maps.MarkerImage( | |
76 | + '/images/markers/marker-we-6.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
83 | 77 | ); |
84 | - var image7 = new google.maps.MarkerImage('/images/markers/marker-we-7.png', | |
85 | - new google.maps.Size(21, 32), | |
86 | - new google.maps.Point(0,0), | |
87 | - new google.maps.Point(16, 35) | |
78 | + var image7 = new google.maps.MarkerImage( | |
79 | + '/images/markers/marker-we-7.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
88 | 80 | ); |
89 | - var image8 = new google.maps.MarkerImage('/images/markers/marker-we-8.png', | |
90 | - new google.maps.Size(21, 32), | |
91 | - new google.maps.Point(0,0), | |
92 | - new google.maps.Point(16, 35) | |
81 | + var image8 = new google.maps.MarkerImage( | |
82 | + '/images/markers/marker-we-8.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
93 | 83 | ); |
94 | - var image9 = new google.maps.MarkerImage('/images/markers/marker-we-9.png', | |
95 | - new google.maps.Size(21, 32), | |
96 | - new google.maps.Point(0,0), | |
97 | - new google.maps.Point(16, 35) | |
84 | + var image9 = new google.maps.MarkerImage( | |
85 | + '/images/markers/marker-we-9.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
98 | 86 | ); |
99 | - var image10 = new google.maps.MarkerImage('/images/markers/marker-empl-1.png', | |
100 | - new google.maps.Size(21, 32), | |
101 | - new google.maps.Point(0,0), | |
102 | - new google.maps.Point(16, 35) | |
87 | + var image10 = new google.maps.MarkerImage( | |
88 | + '/images/markers/marker-empl-1.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
103 | 89 | ); |
104 | - var image11 = new google.maps.MarkerImage('/images/markers/marker-empl-2.png', | |
105 | - new google.maps.Size(21, 32), | |
106 | - new google.maps.Point(0,0), | |
107 | - new google.maps.Point(16, 35) | |
90 | + var image11 = new google.maps.MarkerImage( | |
91 | + '/images/markers/marker-empl-2.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
108 | 92 | ); |
109 | - var image12 = new google.maps.MarkerImage('/images/markers/marker-empl-3.png', | |
110 | - new google.maps.Size(21, 32), | |
111 | - new google.maps.Point(0,0), | |
112 | - new google.maps.Point(16, 35) | |
93 | + var image12 = new google.maps.MarkerImage( | |
94 | + '/images/markers/marker-empl-3.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
113 | 95 | ); |
114 | - var image13 = new google.maps.MarkerImage('/images/markers/marker-empl-4.png', | |
115 | - new google.maps.Size(21, 32), | |
116 | - new google.maps.Point(0,0), | |
117 | - new google.maps.Point(16, 35) | |
96 | + var image13 = new google.maps.MarkerImage( | |
97 | + '/images/markers/marker-empl-4.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
118 | 98 | ); |
119 | - var image14 = new google.maps.MarkerImage('/images/markers/marker-empl-5.png', | |
120 | - new google.maps.Size(21, 32), | |
121 | - new google.maps.Point(0,0), | |
122 | - new google.maps.Point(16, 35) | |
99 | + var image14 = new google.maps.MarkerImage( | |
100 | + '/images/markers/marker-empl-5.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
123 | 101 | ); |
124 | - var image15 = new google.maps.MarkerImage('/images/markers/marker-empl-6.png', | |
125 | - new google.maps.Size(21, 32), | |
126 | - new google.maps.Point(0,0), | |
127 | - new google.maps.Point(16, 35) | |
102 | + var image15 = new google.maps.MarkerImage( | |
103 | + '/images/markers/marker-empl-6.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
128 | 104 | ); |
129 | - var image16 = new google.maps.MarkerImage('/images/markers/marker-empl-7.png', | |
130 | - new google.maps.Size(21, 32), | |
131 | - new google.maps.Point(0,0), | |
132 | - new google.maps.Point(16, 35) | |
105 | + var image16 = new google.maps.MarkerImage( | |
106 | + '/images/markers/marker-empl-7.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
133 | 107 | ); |
134 | - var image17 = new google.maps.MarkerImage('/images/markers/marker-empl-8.png', | |
135 | - new google.maps.Size(21, 32), | |
136 | - new google.maps.Point(0,0), | |
137 | - new google.maps.Point(16, 35) | |
108 | + var image17 = new google.maps.MarkerImage( | |
109 | + '/images/markers/marker-empl-8.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
138 | 110 | ); |
139 | - var image18 = new google.maps.MarkerImage('/images/markers/marker-empl-9.png', | |
140 | - new google.maps.Size(21, 32), | |
141 | - new google.maps.Point(0,0), | |
142 | - new google.maps.Point(16, 35) | |
111 | + var image18 = new google.maps.MarkerImage( | |
112 | + '/images/markers/marker-empl-9.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35) | |
143 | 113 | ); |
144 | 114 | |
145 | 115 | var markers = []; |
146 | 116 | |
147 | - var marker = new google.maps.Marker({ | |
148 | - position: new google.maps.LatLng('49', '32.3'), | |
149 | - map: map, | |
150 | - title: 'Marker Title2', | |
151 | - icon: image1 | |
152 | - }); | |
117 | + var marker = new google.maps.Marker( | |
118 | + { | |
119 | + position : new google.maps.LatLng('49', '32.3'), | |
120 | + map : map, title : 'Marker Title2', icon : image1 | |
121 | + } | |
122 | + ); | |
153 | 123 | markers.push(marker); |
154 | 124 | |
155 | - var marker = new google.maps.Marker({ | |
156 | - position: new google.maps.LatLng('49', '36'), | |
157 | - map: map, | |
158 | - title: 'Marker Title2', | |
159 | - icon: image2 | |
160 | - }); | |
125 | + var marker = new google.maps.Marker( | |
126 | + { | |
127 | + position : new google.maps.LatLng('49', '36'), | |
128 | + map : map, title : 'Marker Title2', icon : image2 | |
129 | + } | |
130 | + ); | |
161 | 131 | markers.push(marker); |
162 | 132 | |
163 | - var marker = new google.maps.Marker({ | |
164 | - position: new google.maps.LatLng('49', '34.5'), | |
165 | - map: map, | |
166 | - title: 'Marker Title3', | |
167 | - icon: image18 | |
168 | - }); | |
133 | + var marker = new google.maps.Marker( | |
134 | + { | |
135 | + position : new google.maps.LatLng('49', '34.5'), | |
136 | + map : map, title : 'Marker Title3', icon : image18 | |
137 | + } | |
138 | + ); | |
169 | 139 | markers.push(marker); |
170 | 140 | |
171 | - var marker = new google.maps.Marker({ | |
172 | - position: new google.maps.LatLng('49', '35'), | |
173 | - map: map, | |
174 | - title: 'Marker Title4', | |
175 | - icon: image15 | |
176 | - }); | |
141 | + var marker = new google.maps.Marker( | |
142 | + { | |
143 | + position : new google.maps.LatLng('49', '35'), | |
144 | + map : map, title : 'Marker Title4', icon : image15 | |
145 | + } | |
146 | + ); | |
177 | 147 | markers.push(marker); |
178 | 148 | |
179 | - | |
180 | 149 | var clusterStyles = [ |
181 | 150 | { |
182 | - url: '/images/markers/clasters.png', | |
183 | - height: 36, | |
184 | - width: 36 | |
151 | + url : '/images/markers/clasters.png', height : 36, | |
152 | + width : 36 | |
185 | 153 | } |
186 | 154 | |
187 | 155 | ]; |
188 | - markerClusterer = new MarkerClusterer(map, markers, | |
189 | - { | |
190 | - maxZoom: 10, | |
191 | - gridSize: 100, | |
192 | - styles: clusterStyles | |
193 | - }); | |
156 | + markerClusterer = new MarkerClusterer( | |
157 | + map, markers, { | |
158 | + maxZoom : 10, gridSize : 100, styles : clusterStyles | |
159 | + } | |
160 | + ); | |
194 | 161 | } |
195 | 162 | </script> |
196 | 163 | </div> |
... | ... | @@ -199,7 +166,7 @@ $this->title = 'My Yii Application'; |
199 | 166 | |
200 | 167 | <ul class="content-menu-first"> |
201 | 168 | <li> |
202 | - <span data-menu-bg="#bb0f3f" style="background: #bb0f3f"></span><a href="#">Жилые</a> | |
169 | + <span data-menu-bg="#bb0f3f" style="background: #bb0f3f"></span><a href="#">Жилые</a> | |
203 | 170 | <ul> |
204 | 171 | <li><a href="#">Жилые дома</a></li> |
205 | 172 | <li><a href="#">Виллы</a></li> |
... | ... | @@ -213,20 +180,27 @@ $this->title = 'My Yii Application'; |
213 | 180 | </ul> |
214 | 181 | </li> |
215 | 182 | <li> |
216 | - <span data-menu-bg="#ea640b" style="background: #ea640b"></span><a href="#">Офисные</a> | |
183 | + <span data-menu-bg="#ea640b" style="background: #ea640b"></span><a href="#">Офисные</a> | |
217 | 184 | <ul> |
218 | 185 | <li><a href="#">Коттеджи</a></li> |
219 | 186 | <li><a href="#">Гостиницы</a></li> |
220 | 187 | <li><a href="#">Базы отдыха</a></li> |
221 | 188 | </ul> |
222 | 189 | </li> |
223 | - <li><span data-menu-bg="#f7a901" style="background: #f7a901"></span><a href="#">Торговые</a></li> | |
224 | - <li><span data-menu-bg="#53a827" style="background: #53a827"></span><a href="#">Мосты</a></li> | |
225 | - <li><span data-menu-bg="#018232" style="background: #018232"></span><a href="#">Дороги</a></li> | |
226 | - <li><span data-menu-bg="#02857d" style="background: #02857d"></span><a href="#">Сооружения</a></li> | |
227 | - <li><span data-menu-bg="#019abf" style="background: #019abf"></span><a href="#">Склады</a></li> | |
228 | - <li><span data-menu-bg="#116da8" style="background: #116da8"></span><a href="#">Заводы</a></li> | |
229 | - <li><span data-menu-bg="#413e7f" style="background: #413e7f"></span><a href="#">Разное</a></li> | |
190 | + <li><span data-menu-bg="#f7a901" style="background: #f7a901"></span><a href="#">Торговые</a> | |
191 | + </li> | |
192 | + <li><span data-menu-bg="#53a827" style="background: #53a827"></span><a href="#">Мосты</a> | |
193 | + </li> | |
194 | + <li><span data-menu-bg="#018232" style="background: #018232"></span><a href="#">Дороги</a> | |
195 | + </li> | |
196 | + <li><span data-menu-bg="#02857d" style="background: #02857d"></span><a href="#">Сооружения</a> | |
197 | + </li> | |
198 | + <li><span data-menu-bg="#019abf" style="background: #019abf"></span><a href="#">Склады</a> | |
199 | + </li> | |
200 | + <li><span data-menu-bg="#116da8" style="background: #116da8"></span><a href="#">Заводы</a> | |
201 | + </li> | |
202 | + <li><span data-menu-bg="#413e7f" style="background: #413e7f"></span><a href="#">Разное</a> | |
203 | + </li> | |
230 | 204 | </ul> |
231 | 205 | |
232 | 206 | </div> |
... | ... | @@ -238,64 +212,50 @@ $this->title = 'My Yii Application'; |
238 | 212 | <?php |
239 | 213 | $this->endBlock(); |
240 | 214 | $this->beginBlock('blog'); |
215 | + /** | |
216 | + * Use $blogProvider for this block | |
217 | + */ | |
241 | 218 | ?> |
242 | 219 | <div class="section-box-232"> |
243 | 220 | <div class="box-wr"> |
244 | 221 | <div class="box-all"> |
245 | - <div class="min-post-wr"> | |
246 | - <div class="min-post-block"> | |
247 | - <a href="#"><img src="/images/post-pic1.jpg" alt=""/></a> | |
248 | - <div class="min-post-txt"> | |
249 | - <div class="blog-post-icons-wr style"> | |
250 | - <div class="blog-post-date"> | |
251 | - <span></span><p>22.09.2015</p> | |
252 | - </div> | |
253 | - <div class="blog-post-views"> | |
254 | - <span></span><p>240</p> | |
255 | - </div> | |
256 | - <div class="blog-post-comm-num"> | |
257 | - <span></span><p>12</p> | |
258 | - </div> | |
259 | - </div> | |
260 | - <a href="#">Как обшить балкон | |
261 | - вагонкой своими руками: | |
262 | - пошаговая инструкция</a> | |
263 | - </div> | |
264 | - </div> | |
265 | - <div class="min-post-block"> | |
266 | - <a href="#"><img src="/images/post-pic2.jpg" alt=""/></a> | |
267 | - <div class="min-post-txt"> | |
268 | - <div class="blog-post-icons-wr style"> | |
269 | - <div class="blog-post-date"> | |
270 | - <span></span><p>22.09.2015</p> | |
271 | - </div> | |
272 | - <div class="blog-post-views"> | |
273 | - <span></span><p>240</p> | |
274 | - </div> | |
275 | - <div class="blog-post-comm-num"> | |
276 | - <span></span><p>12</p> | |
277 | - </div> | |
278 | - </div> | |
279 | - <a href="#">Натуральные компоненты | |
280 | - в защитных пропитках для | |
281 | - древесины: природа сама | |
282 | - о себе заботится | |
283 | - </a> | |
284 | - </div> | |
285 | - </div> | |
286 | - </div> | |
222 | + <?php | |
223 | + echo ListView::widget([ | |
224 | + 'dataProvider' => $blogProvider, | |
225 | + 'options' => [ | |
226 | + 'class' => 'min-post-wr', | |
227 | + ], | |
228 | + 'itemView' => '_company_common_review', | |
229 | + 'itemOptions' => [ | |
230 | + 'class' => 'min-post-block', | |
231 | + ], | |
232 | + 'layout' => '{items}', | |
233 | + ]); | |
234 | + ?> | |
287 | 235 | </div> |
288 | 236 | </div> |
289 | 237 | </div> |
290 | 238 | <?php |
291 | 239 | $this->endBlock(); |
292 | 240 | $this->beginBlock('team'); |
241 | + /* | |
242 | + * User preloaded $company->teams models | |
243 | + */ | |
244 | + $teams = ArrayHelper::index($company->teams, 'department.name'); // Group team members according to their department | |
293 | 245 | ?> |
294 | 246 | <div class="section-box-233"> |
295 | 247 | <div class="box-wr"> |
296 | 248 | <div class="box-all"> |
297 | 249 | <div class="table-team-title style">Состав команды</div> |
298 | 250 | <div class="table-team-wr style"> |
251 | + <?php | |
252 | + /** | |
253 | + * @todo BEGIN HERE | |
254 | + */ | |
255 | + for($i = 0; $i < count($teams); $i = $i+2) { | |
256 | + var_dump(array_keys($teams)[$i]); | |
257 | + } | |
258 | + ?> | |
299 | 259 | <div class="table-team-left"> |
300 | 260 | <div class="tb-team-wr"> |
301 | 261 | <table class="title-table" cellspacing="0" cellpadding="0" border="0"> |
... | ... | @@ -315,19 +275,25 @@ $this->title = 'My Yii Application'; |
315 | 275 | |
316 | 276 | <table class="all-table" cellspacing="0" cellpadding="0" border="0"> |
317 | 277 | <tr> |
318 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-1.jpg" alt=""/></td> | |
278 | + <td align="center" width="32"> | |
279 | + <img src="/images/portfolio-project/flag-img-1.jpg" alt=""/> | |
280 | + </td> | |
319 | 281 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
320 | 282 | <td align="center" width="91">22</td> |
321 | 283 | </tr> |
322 | 284 | |
323 | 285 | <tr> |
324 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-2.jpg" alt=""/></td> | |
286 | + <td align="center" width="32"> | |
287 | + <img src="/images/portfolio-project/flag-img-2.jpg" alt=""/> | |
288 | + </td> | |
325 | 289 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
326 | 290 | <td align="center" width="91">1</td> |
327 | 291 | </tr> |
328 | 292 | |
329 | 293 | <tr> |
330 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-3.jpg" alt=""/></td> | |
294 | + <td align="center" width="32"> | |
295 | + <img src="/images/portfolio-project/flag-img-3.jpg" alt=""/> | |
296 | + </td> | |
331 | 297 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
332 | 298 | <td align="center" width="91">3</td> |
333 | 299 | </tr> |
... | ... | @@ -351,31 +317,41 @@ $this->title = 'My Yii Application'; |
351 | 317 | |
352 | 318 | <table class="all-table" cellspacing="0" cellpadding="0" border="0"> |
353 | 319 | <tr> |
354 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-1.jpg" alt=""/></td> | |
320 | + <td align="center" width="32"> | |
321 | + <img src="/images/portfolio-project/flag-img-1.jpg" alt=""/> | |
322 | + </td> | |
355 | 323 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
356 | 324 | <td align="center" width="91">22</td> |
357 | 325 | </tr> |
358 | 326 | |
359 | 327 | <tr> |
360 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-2.jpg" alt=""/></td> | |
328 | + <td align="center" width="32"> | |
329 | + <img src="/images/portfolio-project/flag-img-2.jpg" alt=""/> | |
330 | + </td> | |
361 | 331 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
362 | 332 | <td align="center" width="91">1</td> |
363 | 333 | </tr> |
364 | 334 | |
365 | 335 | <tr> |
366 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-3.jpg" alt=""/></td> | |
336 | + <td align="center" width="32"> | |
337 | + <img src="/images/portfolio-project/flag-img-3.jpg" alt=""/> | |
338 | + </td> | |
367 | 339 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
368 | 340 | <td align="center" width="91">3</td> |
369 | 341 | </tr> |
370 | 342 | |
371 | 343 | <tr> |
372 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-1.jpg" alt=""/></td> | |
344 | + <td align="center" width="32"> | |
345 | + <img src="/images/portfolio-project/flag-img-1.jpg" alt=""/> | |
346 | + </td> | |
373 | 347 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
374 | 348 | <td align="center" width="91">10</td> |
375 | 349 | </tr> |
376 | 350 | |
377 | 351 | <tr> |
378 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-2.jpg" alt=""/></td> | |
352 | + <td align="center" width="32"> | |
353 | + <img src="/images/portfolio-project/flag-img-2.jpg" alt=""/> | |
354 | + </td> | |
379 | 355 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
380 | 356 | <td align="center" width="91">1</td> |
381 | 357 | </tr> |
... | ... | @@ -399,19 +375,25 @@ $this->title = 'My Yii Application'; |
399 | 375 | |
400 | 376 | <table class="all-table" cellspacing="0" cellpadding="0" border="0"> |
401 | 377 | <tr> |
402 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-1.jpg" alt=""/></td> | |
378 | + <td align="center" width="32"> | |
379 | + <img src="/images/portfolio-project/flag-img-1.jpg" alt=""/> | |
380 | + </td> | |
403 | 381 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
404 | 382 | <td align="center" width="91">22</td> |
405 | 383 | </tr> |
406 | 384 | |
407 | 385 | <tr> |
408 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-2.jpg" alt=""/></td> | |
386 | + <td align="center" width="32"> | |
387 | + <img src="/images/portfolio-project/flag-img-2.jpg" alt=""/> | |
388 | + </td> | |
409 | 389 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
410 | 390 | <td align="center" width="91">1</td> |
411 | 391 | </tr> |
412 | 392 | |
413 | 393 | <tr> |
414 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-3.jpg" alt=""/></td> | |
394 | + <td align="center" width="32"> | |
395 | + <img src="/images/portfolio-project/flag-img-3.jpg" alt=""/> | |
396 | + </td> | |
415 | 397 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
416 | 398 | <td align="center" width="91">3</td> |
417 | 399 | </tr> |
... | ... | @@ -437,25 +419,33 @@ $this->title = 'My Yii Application'; |
437 | 419 | |
438 | 420 | <table class="all-table" cellspacing="0" cellpadding="0" border="0"> |
439 | 421 | <tr> |
440 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-1.jpg" alt=""/></td> | |
422 | + <td align="center" width="32"> | |
423 | + <img src="/images/portfolio-project/flag-img-1.jpg" alt=""/> | |
424 | + </td> | |
441 | 425 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
442 | 426 | <td align="center" width="91">22</td> |
443 | 427 | </tr> |
444 | 428 | |
445 | 429 | <tr> |
446 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-2.jpg" alt=""/></td> | |
430 | + <td align="center" width="32"> | |
431 | + <img src="/images/portfolio-project/flag-img-2.jpg" alt=""/> | |
432 | + </td> | |
447 | 433 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
448 | 434 | <td align="center" width="91">1</td> |
449 | 435 | </tr> |
450 | 436 | |
451 | 437 | <tr> |
452 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-3.jpg" alt=""/></td> | |
438 | + <td align="center" width="32"> | |
439 | + <img src="/images/portfolio-project/flag-img-3.jpg" alt=""/> | |
440 | + </td> | |
453 | 441 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
454 | 442 | <td align="center" width="91">3</td> |
455 | 443 | </tr> |
456 | 444 | |
457 | 445 | <tr> |
458 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-3.jpg" alt=""/></td> | |
446 | + <td align="center" width="32"> | |
447 | + <img src="/images/portfolio-project/flag-img-3.jpg" alt=""/> | |
448 | + </td> | |
459 | 449 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
460 | 450 | <td align="center" width="91">3</td> |
461 | 451 | </tr> |
... | ... | @@ -480,25 +470,33 @@ $this->title = 'My Yii Application'; |
480 | 470 | |
481 | 471 | <table class="all-table" cellspacing="0" cellpadding="0" border="0"> |
482 | 472 | <tr> |
483 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-1.jpg" alt=""/></td> | |
473 | + <td align="center" width="32"> | |
474 | + <img src="/images/portfolio-project/flag-img-1.jpg" alt=""/> | |
475 | + </td> | |
484 | 476 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
485 | 477 | <td align="center" width="91">22</td> |
486 | 478 | </tr> |
487 | 479 | |
488 | 480 | <tr> |
489 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-2.jpg" alt=""/></td> | |
481 | + <td align="center" width="32"> | |
482 | + <img src="/images/portfolio-project/flag-img-2.jpg" alt=""/> | |
483 | + </td> | |
490 | 484 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
491 | 485 | <td align="center" width="91">1</td> |
492 | 486 | </tr> |
493 | 487 | |
494 | 488 | <tr> |
495 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-3.jpg" alt=""/></td> | |
489 | + <td align="center" width="32"> | |
490 | + <img src="/images/portfolio-project/flag-img-3.jpg" alt=""/> | |
491 | + </td> | |
496 | 492 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
497 | 493 | <td align="center" width="91">3</td> |
498 | 494 | </tr> |
499 | 495 | |
500 | 496 | <tr> |
501 | - <td align="center" width="32"><img src="/images/portfolio-project/flag-img-3.jpg" alt=""/></td> | |
497 | + <td align="center" width="32"> | |
498 | + <img src="/images/portfolio-project/flag-img-3.jpg" alt=""/> | |
499 | + </td> | |
502 | 500 | <td align="center" width="323">Петриченко Дмитрий Николаевич</td> |
503 | 501 | <td align="center" width="91">3</td> |
504 | 502 | </tr> |
... | ... | @@ -572,7 +570,8 @@ $this->title = 'My Yii Application'; |
572 | 570 | <a href="#" class="company-comm-see-all"><span>Развернуть</span></a> |
573 | 571 | </div> |
574 | 572 | </div> |
575 | - <div class="company-performer-comm-see-all-butt style"><a href="#">Читать все отзывы</a></div> | |
573 | + <div class="company-performer-comm-see-all-butt style"> | |
574 | + <a href="#">Читать все отзывы</a></div> | |
576 | 575 | </div> |
577 | 576 | </div> |
578 | 577 | </div> | ... | ... |
frontend/views/performer/common.php
1 | 1 | <?php |
2 | 2 | |
3 | + use common\models\User; | |
3 | 4 | use yii\helpers\ArrayHelper; |
4 | 5 | use \yii\helpers\Html; |
5 | 6 | |
6 | - /* @var $this yii\web\View | |
7 | - * @var $user common\models\User | |
7 | + /* @var yii\web\View $this | |
8 | + * @var User $user | |
9 | + * @var array $developments | |
10 | + * @var array $educations | |
11 | + * @var array $courses | |
8 | 12 | */ |
9 | 13 | $this->params[ 'user' ] = $user; |
10 | 14 | |
... | ... | @@ -15,16 +19,64 @@ |
15 | 19 | <?= $user->userInfo->about ?> |
16 | 20 | </div> |
17 | 21 | <a href="#" class="profile-see-all"></a> |
22 | + <?php | |
23 | + if(!empty($educations)) { | |
24 | + ?> | |
18 | 25 | <div class="proektant-profile-courses-wr style"> |
19 | - <?php foreach($educations as $education): ?> | |
20 | - <div class="proektant-profile-courses"> | |
21 | - <div class="proektant-profile-courses-title">Образование:</div> | |
22 | - <div class="proektant-profile-courses-year"><?= isset( $education[ 'year_from' ] ) ? $education[ 'year_from' ] : '' ?>-<?= isset( $education[ 'year_to' ] ) ? $education[ 'year_to' ] : '' ?></div> | |
26 | + <div class="proektant-profile-courses"> | |
27 | + <div class="proektant-profile-courses-title">Образование:</div> | |
28 | + <?php | |
29 | + foreach($educations as $education) { | |
30 | + ?> | |
31 | + <div class="proektant-profile-courses-year"><?= isset( $education[ 'year_from' ] ) ? $education[ 'year_from' ] : '' ?>-<?= isset( $education[ 'year_to' ] ) ? $education[ 'year_to' ] : 'настоящее время' ?></div> | |
23 | 32 | <div class="proektant-profile-courses-content"><?= isset( $education[ 'name' ] ) ? $education[ 'name' ] : '' ?></div> |
24 | - </div> | |
25 | - <?php endforeach; ?> | |
33 | + <?php | |
34 | + } | |
35 | + ?> | |
36 | + </div> | |
26 | 37 | </div> |
27 | 38 | <?php |
39 | + } | |
40 | + ?> | |
41 | + <?php | |
42 | + if(!empty($developments)) { | |
43 | + ?> | |
44 | + <div class="proektant-profile-courses-wr style"> | |
45 | + <div class="proektant-profile-courses"> | |
46 | + <div class="proektant-profile-courses-title">Собственные разработки, патенты:</div> | |
47 | + <?php | |
48 | + foreach($developments as $development) { | |
49 | + ?> | |
50 | + <div class="proektant-profile-courses-year"><?= isset( $development[ 'year' ] ) ? $development[ 'year' ] : '' ?></div> | |
51 | + <div class="proektant-profile-courses-content"><?= isset( $development[ 'name' ] ) ? $development[ 'name' ] : '' ?></div> | |
52 | + <?php | |
53 | + } | |
54 | + ?> | |
55 | + </div> | |
56 | + </div> | |
57 | + <?php | |
58 | + } | |
59 | + ?> | |
60 | + <?php | |
61 | + if(!empty($courses)) { | |
62 | + ?> | |
63 | + <div class="proektant-profile-courses-wr style"> | |
64 | + <div class="proektant-profile-courses"> | |
65 | + <div class="proektant-profile-courses-title">Пройденные курсы, тренинги:</div> | |
66 | + <?php | |
67 | + foreach($courses as $course) { | |
68 | + ?> | |
69 | + <div class="proektant-profile-courses-year"><?= isset( $course[ 'year' ] ) ? $course[ 'year' ] : '' ?></div> | |
70 | + <div class="proektant-profile-courses-content"><?= isset( $course[ 'name' ] ) ? $course[ 'name' ] : '' ?></div> | |
71 | + <?php | |
72 | + } | |
73 | + ?> | |
74 | + </div> | |
75 | + </div> | |
76 | + <?php | |
77 | + } | |
78 | + ?> | |
79 | + <?php | |
28 | 80 | if(!empty( $user->jobs )) { |
29 | 81 | ?> |
30 | 82 | <div class="proektant-profile-statistic-wr style"> | ... | ... |
frontend/web/css/style.css