Commit 35b03e571c51398e6f5d8b2c6dc5ce44bfb44481
1 parent
375f641b
add yii jquery
Showing
11 changed files
with
496 additions
and
551 deletions
Show diff stats
common/models/Specialization.php
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | namespace common\models; |
| 4 | 4 | |
| 5 | 5 | use Yii; |
| 6 | +use yii\helpers\ArrayHelper; | |
| 6 | 7 | |
| 7 | 8 | /** |
| 8 | 9 | * This is the model class for table "specialization". |
| ... | ... | @@ -63,4 +64,15 @@ class Specialization extends \yii\db\ActiveRecord |
| 63 | 64 | return $this->hasMany(self::className(), ['specialization_pid' => 'specialization_id']); |
| 64 | 65 | } |
| 65 | 66 | |
| 67 | + public function hasChildrenInArray($array){ | |
| 68 | + $array = ArrayHelper::map($array,'specialization_id', 'specialization_name','specialization_pid'); | |
| 69 | + | |
| 70 | + if(isset($array[$this->specialization_id])){ | |
| 71 | + return $array[$this->specialization_id]; | |
| 72 | + } else { | |
| 73 | + return false; | |
| 74 | + } | |
| 75 | + | |
| 76 | + } | |
| 77 | + | |
| 66 | 78 | } | ... | ... |
common/models/User.php
frontend/controllers/SearchController.php
| 1 | 1 | <?php |
| 2 | - namespace frontend\controllers; | |
| 3 | - | |
| 4 | - use common\models\CustomerSearch; | |
| 5 | - use common\models\Project; | |
| 6 | - use common\models\UserInfo; | |
| 7 | - use common\models\Vacancy; | |
| 8 | - use Yii; | |
| 9 | - use common\models\LoginForm; | |
| 10 | - use frontend\models\PasswordResetRequestForm; | |
| 11 | - use frontend\models\ResetPasswordForm; | |
| 12 | - use frontend\models\SignupForm; | |
| 13 | - use frontend\models\ContactForm; | |
| 14 | - use frontend\models\Options; | |
| 15 | - use frontend\models\OptionValues; | |
| 16 | - use yii\base\InvalidParamException; | |
| 17 | - use yii\data\ActiveDataProvider; | |
| 18 | - use yii\data\Pagination; | |
| 19 | - use yii\web\BadRequestHttpException; | |
| 20 | - use yii\web\Controller; | |
| 21 | - use yii\filters\VerbFilter; | |
| 22 | - use yii\filters\AccessControl; | |
| 23 | - use frontend\models\OptionsToValues; | |
| 24 | - use yii\validators\EmailValidator; | |
| 25 | - use common\models\User; | |
| 26 | - use yii\helpers\VarDumper; | |
| 27 | - use common\models\Page; | |
| 28 | - use frontend\models\Option; | |
| 29 | - use common\models\Social; | |
| 2 | +namespace frontend\controllers; | |
| 3 | + | |
| 4 | +use common\models\CustomerSearch; | |
| 5 | +use common\models\Project; | |
| 6 | +use common\models\Specialization; | |
| 7 | +use common\models\UserInfo; | |
| 8 | +use common\models\Vacancy; | |
| 9 | +use frontend\models\SearchPerformerForm; | |
| 10 | +use Yii; | |
| 11 | +use common\models\LoginForm; | |
| 12 | +use frontend\models\PasswordResetRequestForm; | |
| 13 | +use frontend\models\ResetPasswordForm; | |
| 14 | +use frontend\models\SignupForm; | |
| 15 | +use frontend\models\ContactForm; | |
| 16 | +use frontend\models\Options; | |
| 17 | +use frontend\models\OptionValues; | |
| 18 | +use yii\base\InvalidParamException; | |
| 19 | +use yii\data\ActiveDataProvider; | |
| 20 | +use yii\data\Pagination; | |
| 21 | +use yii\helpers\ArrayHelper; | |
| 22 | +use yii\web\BadRequestHttpException; | |
| 23 | +use yii\web\Controller; | |
| 24 | +use yii\filters\VerbFilter; | |
| 25 | +use yii\filters\AccessControl; | |
| 26 | +use frontend\models\OptionsToValues; | |
| 27 | +use yii\validators\EmailValidator; | |
| 28 | +use common\models\User; | |
| 29 | +use yii\helpers\VarDumper; | |
| 30 | +use common\models\Page; | |
| 31 | +use frontend\models\Option; | |
| 32 | +use common\models\Social; | |
| 30 | 33 | |
| 31 | 34 | /** |
| 32 | 35 | * Site controller |
| ... | ... | @@ -130,54 +133,43 @@ |
| 130 | 133 | ]); |
| 131 | 134 | } |
| 132 | 135 | |
| 133 | - public function actionCompany() | |
| 134 | - { | |
| 135 | - $query = UserInfo::find() | |
| 136 | - ->joinWith([ 'user' ]) | |
| 137 | - ->where([ | |
| 138 | - 'is_customer' => 1, | |
| 139 | - 'user.type' => 2, | |
| 140 | - ]); | |
| 141 | - | |
| 142 | - $companies = new ActiveDataProvider([ | |
| 143 | - 'query' => $query, | |
| 144 | - 'pagination' => [ | |
| 145 | - 'pageSize' => 3, | |
| 146 | - ], | |
| 147 | - ]); | |
| 148 | 136 | |
| 149 | - return $this->render('company', [ | |
| 150 | - 'companies' => $companies, | |
| 151 | - ]); | |
| 152 | - } | |
| 153 | 137 | |
| 154 | - public function actionPerformer() | |
| 155 | - { | |
| 156 | - $query = UserInfo::find() | |
| 157 | - ->joinWith([ 'user' ]) | |
| 158 | - ->where([ | |
| 159 | - 'is_customer' => 1, | |
| 160 | - 'user.type' => 1, | |
| 161 | - ]); | |
| 162 | - | |
| 163 | - $performer = new ActiveDataProvider([ | |
| 164 | - 'query' => $query, | |
| 165 | - 'pagination' => [ | |
| 166 | - 'pageSize' => 3, | |
| 167 | - ], | |
| 168 | - ]); | |
| 138 | + public function actionPerformer() | |
| 139 | + { | |
| 169 | 140 | |
| 170 | - return $this->render('performer', [ | |
| 171 | - 'performer' => $performer, | |
| 172 | - ]); | |
| 141 | + | |
| 142 | + $specializationArray = []; | |
| 143 | + | |
| 144 | + $specialization = Specialization::find()->where(['specialization_id'=> Specialization::find()->select('specialization_id') | |
| 145 | + ->andWhere('specialization_pid != 0') | |
| 146 | + ->column()]) | |
| 147 | + ->all(); | |
| 148 | + | |
| 149 | + foreach(ArrayHelper::index($specialization,'specialization_id') as $spec){ | |
| 150 | + $array = $spec->hasChildrenInArray($specialization); | |
| 151 | + if($array){ | |
| 152 | + $specializationArray[$spec->specialization_name] = $array; | |
| 153 | + } | |
| 173 | 154 | } |
| 174 | 155 | |
| 156 | + | |
| 157 | + $searchModel = new SearchPerformerForm(); | |
| 158 | + | |
| 159 | + | |
| 160 | + return $this->render('performer',[ | |
| 161 | + 'dataProvider' => $searchModel->search(Yii::$app->request->queryParams), | |
| 162 | + 'specialization' => $specializationArray, | |
| 163 | + 'model'=> $searchModel | |
| 164 | + ]); | |
| 165 | + } | |
| 166 | + | |
| 175 | 167 | public function actionVacancy() |
| 176 | 168 | { |
| 177 | 169 | |
| 178 | 170 | $query = Vacancy::find(); |
| 179 | 171 | |
| 180 | - $countQuery = clone $query; | |
| 172 | + $countQuery = clone $query; | |
| 181 | 173 | |
| 182 | 174 | $pagination = new Pagination([ |
| 183 | 175 | 'totalCount' => $countQuery->count(), | ... | ... |
| 1 | +<?php | |
| 2 | + | |
| 3 | +namespace frontend\models; | |
| 4 | + | |
| 5 | +use common\models\Portfolio; | |
| 6 | +use common\models\User; | |
| 7 | +use Yii; | |
| 8 | +use yii\base\Model; | |
| 9 | +use yii\data\ActiveDataProvider; | |
| 10 | +use yii\helpers\ArrayHelper; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * ContactForm is the model behind the contact form. | |
| 14 | + */ | |
| 15 | +class SearchPerformerForm extends Model | |
| 16 | +{ | |
| 17 | + public $city; | |
| 18 | + public $specialization; | |
| 19 | + public $working_conditions; | |
| 20 | + public $type; | |
| 21 | + public $additional_parameters; | |
| 22 | + public $rating; | |
| 23 | + public $online; | |
| 24 | + public $search; | |
| 25 | + | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * @inheritdoc | |
| 29 | + */ | |
| 30 | + public function rules() | |
| 31 | + { | |
| 32 | + return [ | |
| 33 | + [['specialization','city', 'type','additional_parameters','working_conditions', 'rating','online','search'], 'safe'], | |
| 34 | + [ | |
| 35 | + ['rating'], | |
| 36 | + 'default', | |
| 37 | + 'value' => 0, | |
| 38 | + ] | |
| 39 | + | |
| 40 | + ]; | |
| 41 | + } | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * @inheritdoc | |
| 45 | + */ | |
| 46 | + public function attributeLabels() | |
| 47 | + { | |
| 48 | + return [ | |
| 49 | + 'city' => 'Город', | |
| 50 | + 'specialization' => 'Специализация', | |
| 51 | + 'type' => 'Тип исполнителя', | |
| 52 | + 'additional_parameters' => 'Тип исполнителя', | |
| 53 | + 'working_conditions' => 'Условия работы', | |
| 54 | + 'rating' => 'Рейтинг', | |
| 55 | + 'online' => 'Статус', | |
| 56 | + 'search' => 'Найти' | |
| 57 | + ]; | |
| 58 | + } | |
| 59 | + | |
| 60 | + /** | |
| 61 | + * Sends an email to the specified email address using the information collected by this model. | |
| 62 | + * @param string $email the target email address | |
| 63 | + * @return boolean whether the email was sent | |
| 64 | + */ | |
| 65 | + public function sendEmail($email) | |
| 66 | + { | |
| 67 | + return Yii::$app->mailer->compose() | |
| 68 | + ->setTo($email) | |
| 69 | + ->setFrom([$this->email => $this->name]) | |
| 70 | + ->setSubject($this->subject) | |
| 71 | + ->setTextBody($this->body) | |
| 72 | + ->send(); | |
| 73 | + } | |
| 74 | + | |
| 75 | + /** | |
| 76 | + * Creates data provider instance with search query applied | |
| 77 | + * | |
| 78 | + * @param array $params | |
| 79 | + * | |
| 80 | + * @return ActiveDataProvider | |
| 81 | + */ | |
| 82 | + public function search($params) | |
| 83 | + { | |
| 84 | + | |
| 85 | + $this->load($params); | |
| 86 | + | |
| 87 | + $query = User::find() | |
| 88 | + ->select(['user.*', 'company_info.*','user_info.*']) | |
| 89 | + ->distinct(true) | |
| 90 | + ->joinWith(['userInfo','specializations','companyInfo']) | |
| 91 | + ->where(['user_info.is_freelancer' => 1]); | |
| 92 | + | |
| 93 | + | |
| 94 | + $dataProvider = new ActiveDataProvider([ | |
| 95 | + 'query' => $query, | |
| 96 | + 'pagination' => [ | |
| 97 | + 'pageSize' => 3, | |
| 98 | + ], | |
| 99 | + ]); | |
| 100 | + | |
| 101 | + $dataProvider->setSort([ | |
| 102 | + 'defaultOrder' => [ | |
| 103 | + 'name' => SORT_ASC, | |
| 104 | + ], | |
| 105 | + 'attributes' => [ | |
| 106 | + 'name' => [ | |
| 107 | + 'asc' => [ | |
| 108 | + 'company_info.name' => SORT_ASC, | |
| 109 | + 'firstname' => SORT_ASC, | |
| 110 | + 'lastname' => SORT_ASC, | |
| 111 | + ], | |
| 112 | + 'desc' => [ | |
| 113 | + 'company_info.name' => SORT_DESC, | |
| 114 | + 'firstname' => SORT_DESC, | |
| 115 | + 'lastname' => SORT_DESC, | |
| 116 | + ], | |
| 117 | + 'default' => SORT_ASC, | |
| 118 | + 'label' => 'Название', | |
| 119 | + ], | |
| 120 | + 'visit' => [ | |
| 121 | + 'asc' => [ | |
| 122 | + 'user_info.date_visit' => SORT_ASC, | |
| 123 | + ], | |
| 124 | + 'desc' => [ | |
| 125 | + 'user_info.date_visit' => SORT_DESC, | |
| 126 | + ], | |
| 127 | + 'default' => SORT_DESC, | |
| 128 | + 'label' => 'Последний визит', | |
| 129 | + ], | |
| 130 | + 'city' => [ | |
| 131 | + 'asc' => [ | |
| 132 | + 'user_info.city' => SORT_ASC, | |
| 133 | + ], | |
| 134 | + 'desc' => [ | |
| 135 | + 'user_info.city' => SORT_DESC, | |
| 136 | + ], | |
| 137 | + 'default' => SORT_ASC, | |
| 138 | + 'label' => 'Город', | |
| 139 | + ], | |
| 140 | + ], | |
| 141 | + ]); | |
| 142 | + | |
| 143 | + | |
| 144 | + if (!$this->validate()) { | |
| 145 | + | |
| 146 | + | |
| 147 | + // uncomment the following line if you do not want to any records when validation fails | |
| 148 | + // $query->where('0=1'); | |
| 149 | + return $dataProvider; | |
| 150 | + } | |
| 151 | + | |
| 152 | + $query->andFilterWhere([ | |
| 153 | + 'user_info.city' => $this->city, | |
| 154 | + 'specialization.specialization_id' => $this->specialization, | |
| 155 | + 'user.type' => $this->type, | |
| 156 | + | |
| 157 | + ]); | |
| 158 | + | |
| 159 | + $query->andFilterWhere([ | |
| 160 | + '>=', 'user_info.rating', $this->rating, | |
| 161 | + ]); | |
| 162 | + | |
| 163 | + if($this->online == 1) { | |
| 164 | + $query->andWhere([ | |
| 165 | + '>=', | |
| 166 | + 'user_info.date_visit', | |
| 167 | + date('Y-m-d H:i:s.u', time() - 1800), | |
| 168 | + ]); | |
| 169 | + } | |
| 170 | + | |
| 171 | + foreach($this->working_conditions as $working_conditions){ | |
| 172 | + if($working_conditions=='guarantee'){ | |
| 173 | + $query->andWhere([ | |
| 174 | + '<>', | |
| 175 | + 'user_info.guarantee', | |
| 176 | + '' | |
| 177 | + ]); | |
| 178 | + }else if($working_conditions=='prepayment'){ | |
| 179 | + $query->andWhere([ | |
| 180 | + 'user_info.prepayment'=>0, | |
| 181 | + | |
| 182 | + ]); | |
| 183 | + }else { | |
| 184 | + $query->andFilterWhere([ | |
| 185 | + 'user_info.'.$working_conditions => 1, | |
| 186 | + ]); | |
| 187 | + } | |
| 188 | + | |
| 189 | + } | |
| 190 | + | |
| 191 | + foreach($this->additional_parameters as $additional_parameters){ | |
| 192 | + | |
| 193 | + switch ($additional_parameters) { | |
| 194 | + case 'with_portfolio': | |
| 195 | + $query->andFilterWhere([ | |
| 196 | + 'user.id'=>ArrayHelper::toArray(Portfolio::find()->select('user_id')->column()), | |
| 197 | + ]); | |
| 198 | + break; | |
| 199 | + case 'with_comments': | |
| 200 | + $query->andFilterWhere([ | |
| 201 | + 'user.id'=>ArrayHelper::toArray(Portfolio::find()->select('user_id')->column()), | |
| 202 | + ]); | |
| 203 | + break; | |
| 204 | + case 'only_free': | |
| 205 | + $query->andFilterWhere([ | |
| 206 | + 'user_info.busy'=>0, | |
| 207 | + ]); | |
| 208 | + break; | |
| 209 | + } | |
| 210 | + } | |
| 211 | + | |
| 212 | + | |
| 213 | + if(!empty( $this->search)){ | |
| 214 | + | |
| 215 | + $query->andFilterWhere([ | |
| 216 | + 'or', | |
| 217 | + ['like', 'user.firstname', $this->search], | |
| 218 | + ['like', 'user.lastname', $this->search], | |
| 219 | + ['like', 'company_info.name', $this->search] | |
| 220 | + ]); | |
| 221 | + } | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + return $dataProvider; | |
| 227 | + } | |
| 228 | +} | |
| 229 | + | ... | ... |
frontend/views/accounts/general.php
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | <div class="general-check"> |
| 28 | 28 | |
| 29 | 29 | <div class="general-check-left"> |
| 30 | - <?= $form->field($user, 'isPerformer', [ 'template' => "{input}\n{label}\n{error}" ]) | |
| 30 | + <?= $form->field($user_info, 'is_freelancer', [ 'template' => "{input}\n{label}\n{error}" ]) | |
| 31 | 31 | ->label('<span></span>Я - исполнитель') |
| 32 | 32 | ->checkbox([ |
| 33 | 33 | 'class' => 'custom-check disabled admin-check', |
| ... | ... | @@ -41,7 +41,7 @@ |
| 41 | 41 | |
| 42 | 42 | <div class="general-check"> |
| 43 | 43 | <div class="general-check-left"> |
| 44 | - <?= $form->field($user, 'isCustomer', [ 'template' => "{input}\n{label}\n{error}" ]) | |
| 44 | + <?= $form->field($user_info, 'is_customer', [ 'template' => "{input}\n{label}\n{error}" ]) | |
| 45 | 45 | ->label('<span></span>Я - заказчик') |
| 46 | 46 | ->checkbox([ |
| 47 | 47 | 'class' => 'custom-check disabled admin-check', | ... | ... |
frontend/views/layouts/main.php
| ... | ... | @@ -89,7 +89,7 @@ AppAsset::register($this); |
| 89 | 89 | <ul> |
| 90 | 90 | <li><?= Html::a('Список проектов', ['search/project'])?></li> |
| 91 | 91 | <li><?= Html::a('Список вакансий', ['search/vacancy'])?></li> |
| 92 | - <li><?= Html::a('Список заказчиков', ['site/index'])?></li> | |
| 92 | + <li><?= Html::a('Список заказчиков', ['search/customer'])?></li> | |
| 93 | 93 | </ul> |
| 94 | 94 | </div> |
| 95 | 95 | </li> |
| ... | ... | @@ -103,8 +103,8 @@ AppAsset::register($this); |
| 103 | 103 | </ul> |
| 104 | 104 | <ul> |
| 105 | 105 | |
| 106 | - <li><?= Html::a('Список проектантов', ['search/performer'])?></li> | |
| 107 | - <li><?= Html::a('Список проектных компаний', ['search/company'])?></li> | |
| 106 | + <li><?= Html::a('Список проектантов', ['search/performer','SearchPerformerForm[type]'=>'1'])?></li> | |
| 107 | + <li><?= Html::a('Список проектных компаний', ['search/performer','SearchPerformerForm[type]'=>'2'])?></li> | |
| 108 | 108 | </ul> |
| 109 | 109 | </div> |
| 110 | 110 | </li> |
| ... | ... | @@ -120,7 +120,7 @@ AppAsset::register($this); |
| 120 | 120 | <ul> |
| 121 | 121 | <li><?= Html::a('Список проектантов', ['search/performer'])?></li> |
| 122 | 122 | <li><?= Html::a('Список проектов', ['search/project'])?></li> |
| 123 | - <li><?= Html::a('Список заказчиков', ['site/index'])?></li> | |
| 123 | + <li><?= Html::a('Список заказчиков', ['search/customer'])?></li> | |
| 124 | 124 | </ul> |
| 125 | 125 | </div> |
| 126 | 126 | </li> | ... | ... |
frontend/views/search/_performer_list_view.php
| ... | ... | @@ -7,7 +7,7 @@ use yii\helpers\Url; |
| 7 | 7 | <div class="search-worker-blocks"> |
| 8 | 8 | <div class="search-worker-blocks-foto-wr"> |
| 9 | 9 | <div class="gallery-box-search gallery-box"> |
| 10 | - <?php $portfolios = ArrayHelper::getColumn($model->user->getPortfolios()->limit(4)->all(), 'cover'); ?> | |
| 10 | + <?php $portfolios = ArrayHelper::getColumn($model->getPortfolios()->limit(4)->all(), 'cover'); ?> | |
| 11 | 11 | <?php |
| 12 | 12 | for($i = 0; $i<count($portfolios); $i++ ) :?> |
| 13 | 13 | <?php if($i):?> |
| ... | ... | @@ -34,16 +34,16 @@ use yii\helpers\Url; |
| 34 | 34 | |
| 35 | 35 | <div class="search-worker-blocks-text-wr"> |
| 36 | 36 | <div class="search-worker-blocks-ico-wr"> |
| 37 | - <?= Html::img($model->minImg($model->image, '48','48'))?> | |
| 37 | + <?= Html::img($model->minImg($model->userInfo->image, '48','48'))?> | |
| 38 | 38 | </div> |
| 39 | 39 | <div class="search-worker-blocks-title-wr"> |
| 40 | - <?php if($model->member):?> | |
| 40 | + <?php if($model->userInfo->member):?> | |
| 41 | 41 | <div class="land-stars-pro">PRO</div> |
| 42 | 42 | <?php else: ?> |
| 43 | 43 | <div class="land-stars-new">NEW</div> |
| 44 | 44 | <?php endif; ?> |
| 45 | 45 | |
| 46 | - <div class="search-worker-blocks-title"><?= $model->user->name?></div> | |
| 46 | + <div class="search-worker-blocks-title"><?= $model->name?></div> | |
| 47 | 47 | </div> |
| 48 | 48 | <div class="search-worker-blocks-title-wr"> |
| 49 | 49 | <div class="rating-new"> |
| ... | ... | @@ -53,11 +53,11 @@ use yii\helpers\Url; |
| 53 | 53 | <!--<input type="hidden" class="votes" value="12"/>--> |
| 54 | 54 | |
| 55 | 55 | </div> |
| 56 | - <div class="search-worker-blocks-atr">30 отзывов, <?= $model->city?></div> | |
| 56 | + <div class="search-worker-blocks-atr">30 отзывов, <?= $model->userInfo->city?></div> | |
| 57 | 57 | </div> |
| 58 | 58 | <div class="search-worker-blocks-title-wr"> |
| 59 | 59 | <div class="search-worker-blocks-status"> |
| 60 | - <?php if($model->busy):?> | |
| 60 | + <?php if($model->userInfo->busy):?> | |
| 61 | 61 | <?= Html::img('/images/sidebar-ico/ico_work_01.png');?><span>занят</span> |
| 62 | 62 | <?php else:?> |
| 63 | 63 | <?= Html::img('/images/sidebar-ico/ico-9.png');?><span>свободен</span> |
| ... | ... | @@ -68,15 +68,15 @@ use yii\helpers\Url; |
| 68 | 68 | <div class="search-worker-blocks-geographic style"> |
| 69 | 69 | |
| 70 | 70 | |
| 71 | - <span>География работ: </span><?= implode(',',array_filter(ArrayHelper::getColumn($model->user->portfolios, 'city'))) ?> | |
| 71 | + <span>География работ: </span><?= implode(',',array_filter(ArrayHelper::getColumn($model->portfolios, 'city'))) ?> | |
| 72 | 72 | </div> |
| 73 | 73 | <div class="search-worker-blocks-tags style"> |
| 74 | - <?php foreach($model->user->specializations as $specialization):?> | |
| 74 | + <?php foreach($model->specializations as $specialization):?> | |
| 75 | 75 | <a href="#"><?= $specialization->specialization_name ?></a>, |
| 76 | 76 | <?php endforeach;?> |
| 77 | 77 | </div> |
| 78 | - <div class="search-worker-blocks-visit style"><span>Последний визит: </span><?= $model->lastVisit ?></div> | |
| 79 | - <?= Html::a(count($model->user->portfolios)." работа в портфолио",[Url::toRoute(['performer/portfolio','performer_id'=>$model->user_id])], ['class' => "search-worker-blocks-jobs-portfolio" ])?> | |
| 78 | + <div class="search-worker-blocks-visit style"><span>Последний визит: </span><?= $model->userInfo->lastVisit ?></div> | |
| 79 | + <?= Html::a(count($model->portfolios)." работа в портфолио",[Url::toRoute(['performer/portfolio','performer_id'=>$model->userInfo->user_id])], ['class' => "search-worker-blocks-jobs-portfolio" ])?> | |
| 80 | 80 | <div class="search-worker-blocks-buttons style"> |
| 81 | 81 | <a class="get-list" href="#">Добавить в закладки</a> |
| 82 | 82 | <a class="get-project" href="#">Предложить проект</a> | ... | ... |
frontend/views/search/company.php deleted
| 1 | -<?php | |
| 2 | - use \yii\helpers\Html; | |
| 3 | -use yii\widgets\ListView; | |
| 4 | - | |
| 5 | -/* @var $this yii\web\View */ | |
| 6 | - $this->title = 'My Yii Application'; | |
| 7 | -?> | |
| 8 | - | |
| 9 | -<div class="section-box content"> | |
| 10 | - <div class="section-box-22"> | |
| 11 | - <div class="box-wr"> | |
| 12 | - <div class="box-all"> | |
| 13 | - <div class="left-search-work"> | |
| 14 | - <form action="" class="search-work-form"> | |
| 15 | - <div class="blocks-check-list-wrapp"> | |
| 16 | - <div class="blocks-check-title"><label for="theme-1">Город</label></div> | |
| 17 | - <select id="theme-1"> | |
| 18 | - <option selected value="">Любой</option> | |
| 19 | - <option value="">Киев</option> | |
| 20 | - <option value="">Житомир</option> | |
| 21 | - <option value="">Львов</option> | |
| 22 | - <option value="">Киев</option> | |
| 23 | - <option value="">Житомир</option> | |
| 24 | - <option value="">Львов</option> | |
| 25 | - </select> | |
| 26 | - </div> | |
| 27 | - <div class="blocks-check-list-wrapp"> | |
| 28 | - <div class="blocks-check-title"><label for="theme-2">Специализация</label></div> | |
| 29 | - <select id="theme-2"> | |
| 30 | - <option selected value="">Любая</option> | |
| 31 | - <option value="">Киев</option> | |
| 32 | - <option value="">Житомир</option> | |
| 33 | - <option value="">Львов</option> | |
| 34 | - <option value="">Киев</option> | |
| 35 | - <option value="">Житомир</option> | |
| 36 | - <option value="">Львов</option> | |
| 37 | - </select> | |
| 38 | - </div> | |
| 39 | - | |
| 40 | - <div class="blocks-check-list-wrapp"> | |
| 41 | - <div class="blocks-check-title"><label for="theme-3">Тип исполнителя</label></div> | |
| 42 | - <select id="theme-3"> | |
| 43 | - <option selected value="">Любая</option> | |
| 44 | - <option value="">Киев</option> | |
| 45 | - <option value="">Житомир</option> | |
| 46 | - <option value="">Львов</option> | |
| 47 | - <option value="">Киев</option> | |
| 48 | - <option value="">Житомир</option> | |
| 49 | - <option value="">Львов</option> | |
| 50 | - </select> | |
| 51 | - </div> | |
| 52 | - | |
| 53 | - <div class="blocks-check-list-wrapp"> | |
| 54 | - <div class="blocks-check-title">Условия работы</div> | |
| 55 | - <div class="blocks-check-list"> | |
| 56 | - <input type="checkbox" name="group2" class="check-search" id="theme-4"><label for="theme-4"><span></span>С гарантией</label> | |
| 57 | - </div> | |
| 58 | - <div class="blocks-check-list"> | |
| 59 | - <input type="checkbox" name="group2" class="check-search" id="theme-5"><label for="theme-5"><span></span>С договором</label> | |
| 60 | - </div> | |
| 61 | - <div class="blocks-check-list"> | |
| 62 | - <input type="checkbox" name="group2" class="check-search" id="theme-6"><label for="theme-6"><span></span>Со сметой</label> | |
| 63 | - </div> | |
| 64 | - <div class="blocks-check-list"> | |
| 65 | - <input type="checkbox" name="group2" class="check-search" id="theme-7"><label for="theme-7"><span></span>Без предоплаты</label> | |
| 66 | - </div> | |
| 67 | - </div> | |
| 68 | - | |
| 69 | - <div class="blocks-check-list-wrapp"> | |
| 70 | - <div class="blocks-check-title">Рейтинг</div> | |
| 71 | - <div class="rating"> | |
| 72 | - <!--оценка--> | |
| 73 | - <input type="hidden" class="val" value="0"/> | |
| 74 | - </div> | |
| 75 | - </div> | |
| 76 | - | |
| 77 | - <div class="blocks-check-list-wrapp"> | |
| 78 | - <div class="blocks-check-title">Статус</div> | |
| 79 | - <div class="blocks-check-list"> | |
| 80 | - <input type="radio" name="group3" class="check-search" id="theme-8"><label for="theme-8"><span></span>Онлайн</label> | |
| 81 | - </div> | |
| 82 | - <div class="blocks-check-list"> | |
| 83 | - <input type="radio" name="group3" class="check-search" id="theme-9" checked><label for="theme-9"><span></span>Все</label> | |
| 84 | - </div> | |
| 85 | - </div> | |
| 86 | - | |
| 87 | - <div class="blocks-check-list-wrapp"> | |
| 88 | - <div class="blocks-check-title">Дополнительно</div> | |
| 89 | - <div class="blocks-check-list"> | |
| 90 | - <input type="checkbox" name="group4" class="check-search" id="theme-10"><label for="theme-10"><span></span>Только с портфолио</label> | |
| 91 | - </div> | |
| 92 | - <div class="blocks-check-list"> | |
| 93 | - <input type="checkbox" name="group4" class="check-search" id="theme-11"><label for="theme-11"><span></span>Только с отзывами</label> | |
| 94 | - </div> | |
| 95 | - <div class="blocks-check-list"> | |
| 96 | - <input type="checkbox" name="group4" class="check-search" id="theme-12"><label for="theme-12"><span></span>Только свободные</label> | |
| 97 | - </div> | |
| 98 | - </div> | |
| 99 | - <div class="blocks-check-list-submit"> | |
| 100 | - <input type="submit" value="Найти"/> | |
| 101 | - </div> | |
| 102 | - </form> | |
| 103 | - <script> | |
| 104 | - $('div.rating').rating({ | |
| 105 | - fx: 'full', | |
| 106 | - url: 'rating.php' | |
| 107 | - }); | |
| 108 | - </script> | |
| 109 | - </div> | |
| 110 | - <div class="right-search-work"> | |
| 111 | - <div class="search-worker-title style">Найти исполнителя</div> | |
| 112 | - <div class="search-worker-title-two style">Компании готовые приступить к работе <span>145</span></div> | |
| 113 | - <div class="search-worker-search-wr style"> | |
| 114 | - <form action="" class="search-worker-form"> | |
| 115 | - <input id="srch-wrk-text" type="text" placeholder="Любая информация о проектанте" required=""/> | |
| 116 | - <input id="srch-wrk-sub" type="submit" value="Найти"/> | |
| 117 | - </form> | |
| 118 | - <a href="#" class="add-to-catalog-search-worker">Добавить себя в каталог</a> | |
| 119 | - <div class="search-worker-sort-wr style"> | |
| 120 | - <div class="search-worker-sort">Сортировать: </div> | |
| 121 | - <ul> | |
| 122 | - <li class="activejob"> | |
| 123 | - <a href="#">рейтинг</a> | |
| 124 | - <div class="sidebar-droped-wr style"> | |
| 125 | - <ul> | |
| 126 | - <li><a href="#">1заказчик</a></li> | |
| 127 | - <li><a href="#">2заказчик</a></li> | |
| 128 | - <li><a href="#">3заказчик</a></li> | |
| 129 | - <li><a href="#">4заказчик</a></li> | |
| 130 | - <li style="display: none"><a href="#">рейтинг</a></li> | |
| 131 | - </ul> | |
| 132 | - </div> | |
| 133 | - </li> | |
| 134 | - </ul> | |
| 135 | - </div> | |
| 136 | - </div> | |
| 137 | - | |
| 138 | - <div class="search-company-blocks-wr style"> | |
| 139 | - | |
| 140 | - <?= | |
| 141 | - ListView::widget( [ | |
| 142 | - 'dataProvider' => $companies, | |
| 143 | - 'itemView'=>'_company_list_view', | |
| 144 | - 'layout' => "{items}\n<div class='navi-buttons-wr style'>{pager}</div>", | |
| 145 | - 'itemOptions' =>[ | |
| 146 | - 'tag' => false | |
| 147 | - ] | |
| 148 | - | |
| 149 | - ] ); | |
| 150 | - ?> | |
| 151 | - </div> | |
| 152 | - | |
| 153 | - <script> | |
| 154 | - $('div.rating-new').rating({ | |
| 155 | - fx: 'full', | |
| 156 | - readOnly: 'true', | |
| 157 | - url: 'rating.php' | |
| 158 | - }); | |
| 159 | - </script> | |
| 160 | - | |
| 161 | - </div> | |
| 162 | - </div> | |
| 163 | - </div> | |
| 164 | - </div> | |
| 165 | - | |
| 166 | -</div> |
frontend/views/search/customer.php
| ... | ... | @@ -171,136 +171,6 @@ |
| 171 | 171 | 'itemView' => '_customer_list_view', |
| 172 | 172 | ]); |
| 173 | 173 | ?> |
| 174 | - <?php | |
| 175 | - /* == Layout == | |
| 176 | - ?> | |
| 177 | - <div class="search-worker-blocks-wr style"> | |
| 178 | - | |
| 179 | - <div class="search-worker-blocks"> | |
| 180 | - <div class="search_perform_txt-wr"> | |
| 181 | - <div class="search_perform_title">ООО «Ортекс»</div> | |
| 182 | - <div class="search_perform-stars-wr"> | |
| 183 | - <div class="rating_search_performer"> | |
| 184 | - <!--оценка--> | |
| 185 | - <input type="hidden" class="val" value="4"/> | |
| 186 | - </div> | |
| 187 | - <div class="search_perform-stars-txt">30 отзывов, Киев</div> | |
| 188 | - </div> | |
| 189 | - <div class="search_perform_leng"> | |
| 190 | - <div>Сотрудники: более 40</div> | |
| 191 | - </div> | |
| 192 | - <div class="search_perform_visit"> | |
| 193 | - <span>Послелний визит:</span> 2 дня назад | |
| 194 | - </div> | |
| 195 | - <div class="search_perform_projets_nam"> | |
| 196 | - <a href="#">Заказано проектов: 21</a></div> | |
| 197 | - </div> | |
| 198 | - | |
| 199 | - <div class="right_search_perform_block-wr"> | |
| 200 | - <div class="right_search_perform_foto-wr"> | |
| 201 | - <div><img src="/images/search_performer_img-1.jpg" alt=""/></div> | |
| 202 | - </div> | |
| 203 | - <a class="get-list" href="#">Добавить в закладки</a> | |
| 204 | - </div> | |
| 205 | - </div> | |
| 206 | - | |
| 207 | - <div class="search-worker-blocks"> | |
| 208 | - <div class="search_perform_txt-wr"> | |
| 209 | - <div class="search_perform_title">Петер Цумтор</div> | |
| 210 | - <div class="search_perform-stars-wr"> | |
| 211 | - <div class="rating_search_performer"> | |
| 212 | - <!--оценка--> | |
| 213 | - <input type="hidden" class="val" value="2"/> | |
| 214 | - </div> | |
| 215 | - <div class="search_perform-stars-txt">30 отзывов, Киев</div> | |
| 216 | - </div> | |
| 217 | - <div class="search_perform_leng"> | |
| 218 | - <!--<div>Сотрудники: более 40</div>--> | |
| 219 | - </div> | |
| 220 | - <div class="search_perform_visit"> | |
| 221 | - <span>Послелний визит:</span> 2 дня назад | |
| 222 | - </div> | |
| 223 | - <div class="search_perform_projets_nam"> | |
| 224 | - <a href="#">Заказано проектов: 21</a></div> | |
| 225 | - </div> | |
| 226 | - | |
| 227 | - <div class="right_search_perform_block-wr"> | |
| 228 | - <div class="right_search_perform_foto-wr"> | |
| 229 | - <div><a href="#"><img src="/images/ded-ico.png" alt=""/></a></div> | |
| 230 | - </div> | |
| 231 | - <a class="get-list" href="#">Добавить в закладки</a> | |
| 232 | - </div> | |
| 233 | - </div> | |
| 234 | - | |
| 235 | - <div class="search-worker-blocks"> | |
| 236 | - <div class="search_perform_txt-wr"> | |
| 237 | - <div class="search_perform_title">ООО «Ортекс»</div> | |
| 238 | - <div class="search_perform-stars-wr"> | |
| 239 | - <div class="rating_search_performer"> | |
| 240 | - <!--оценка--> | |
| 241 | - <input type="hidden" class="val" value="1"/> | |
| 242 | - </div> | |
| 243 | - <div class="search_perform-stars-txt">30 отзывов, Киев</div> | |
| 244 | - </div> | |
| 245 | - <div class="search_perform_leng"> | |
| 246 | - <div>Сотрудники: более 40</div> | |
| 247 | - </div> | |
| 248 | - <div class="search_perform_visit"> | |
| 249 | - <span>Послелний визит:</span> 2 дня назад | |
| 250 | - </div> | |
| 251 | - <div class="search_perform_projets_nam"> | |
| 252 | - <a href="#">Заказано проектов: 21</a></div> | |
| 253 | - </div> | |
| 254 | - | |
| 255 | - <div class="right_search_perform_block-wr"> | |
| 256 | - <div class="right_search_perform_foto-wr"> | |
| 257 | - <div><img src="/images/search_performer_img-1.jpg" alt=""/></div> | |
| 258 | - </div> | |
| 259 | - <a class="get-list" href="#">Добавить в закладки</a> | |
| 260 | - </div> | |
| 261 | - </div> | |
| 262 | - | |
| 263 | - <div class="search-worker-blocks"> | |
| 264 | - <div class="search_perform_txt-wr"> | |
| 265 | - <div class="search_perform_title">Петер Цумтор</div> | |
| 266 | - <div class="search_perform-stars-wr"> | |
| 267 | - <div class="rating_search_performer"> | |
| 268 | - <!--оценка--> | |
| 269 | - <input type="hidden" class="val" value="5"/> | |
| 270 | - </div> | |
| 271 | - <div class="search_perform-stars-txt">30 отзывов, Киев</div> | |
| 272 | - </div> | |
| 273 | - <div class="search_perform_leng"> | |
| 274 | - <!--<div>Сотрудники: более 40</div>--> | |
| 275 | - </div> | |
| 276 | - <div class="search_perform_visit"> | |
| 277 | - <span>Послелний визит:</span> 2 дня назад | |
| 278 | - </div> | |
| 279 | - <div class="search_perform_projets_nam"> | |
| 280 | - <a href="#">Заказано проектов: 21</a></div> | |
| 281 | - </div> | |
| 282 | - | |
| 283 | - <div class="right_search_perform_block-wr"> | |
| 284 | - <div class="right_search_perform_foto-wr"> | |
| 285 | - <div><img src="/images/ded-ico.png" alt=""/></div> | |
| 286 | - </div> | |
| 287 | - <a class="get-list" href="#">Добавить в закладки</a> | |
| 288 | - </div> | |
| 289 | - </div> | |
| 290 | - </div> | |
| 291 | - | |
| 292 | - <div class="navi-buttons-wr style"> | |
| 293 | - <ul class="pagination"> | |
| 294 | - <li class="prev disabled"><span>«</span></li> | |
| 295 | - <li class="active"><a href="#">1</a></li> | |
| 296 | - <li><a href="#">2</a></li> | |
| 297 | - <li class="next"><a href="#">»</a></li> | |
| 298 | - </ul> | |
| 299 | - </div> | |
| 300 | - | |
| 301 | - <?php | |
| 302 | - == End of layout == */ | |
| 303 | - ?> | |
| 304 | 174 | |
| 305 | 175 | <script> |
| 306 | 176 | $('div.rating_search_performer').rating( | ... | ... |
frontend/views/search/performer.php
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +use common\models\Vacancy; | |
| 4 | +use kartik\select2\Select2; | |
| 5 | +use yii\helpers\ArrayHelper; | |
| 3 | 6 | use \yii\helpers\Html; |
| 7 | +use yii\helpers\Url; | |
| 8 | +use yii\jui\SliderInput; | |
| 9 | +use yii\web\JsExpression; | |
| 10 | +use yii\widgets\ActiveForm; | |
| 11 | +use yii\widgets\LinkSorter; | |
| 4 | 12 | use yii\widgets\ListView; |
| 5 | 13 | |
| 6 | 14 | /* @var $this yii\web\View */ |
| 7 | 15 | |
| 16 | +$sort_array = $dataProvider->sort->getAttributeOrders(); | |
| 17 | +$active_key = array_keys($sort_array)[0]; | |
| 18 | +$active_value = $sort_array[$active_key]; | |
| 19 | +$sort_name = (($active_value == 4)?'-':'').$active_key; | |
| 20 | + | |
| 8 | 21 | $this->title = 'My Yii Application'; |
| 9 | 22 | ?> |
| 10 | 23 | |
| ... | ... | @@ -13,182 +26,169 @@ $this->title = 'My Yii Application'; |
| 13 | 26 | <div class="box-wr"> |
| 14 | 27 | <div class="box-all"> |
| 15 | 28 | <div class="left-search-work"> |
| 16 | - <form action="" class="search-work-form"> | |
| 17 | - <div class="blocks-check-list-wrapp"> | |
| 18 | - <div class="blocks-check-title"><label for="theme-1">Город</label></div> | |
| 19 | - <select id="theme-1"> | |
| 20 | - <option selected value="">Любой</option> | |
| 21 | - <option value="">Киев</option> | |
| 22 | - <option value="">Житомир</option> | |
| 23 | - <option value="">Львов</option> | |
| 24 | - <option value="">Киев</option> | |
| 25 | - <option value="">Житомир</option> | |
| 26 | - <option value="">Львов</option> | |
| 27 | - | |
| 28 | - <option value="">Киев</option> | |
| 29 | - <option value="">Житомир</option> | |
| 30 | - <option value="">Львов</option> | |
| 31 | - <option value="">Киев</option> | |
| 32 | - <option value="">Житомир</option> | |
| 33 | - <option value="">Львов</option> | |
| 34 | - <option value="">Киев</option> | |
| 35 | - <option value="">Житомир</option> | |
| 36 | - <option value="">Львов</option> | |
| 37 | - <option value="">Киев</option> | |
| 38 | - <option value="">Житомир</option> | |
| 39 | - <option value="">Львов</option> | |
| 40 | - <option value="">Киев</option> | |
| 41 | - <option value="">Житомир</option> | |
| 42 | - <option value="">Львов</option> | |
| 43 | - <option value="">Киев</option> | |
| 44 | - <option value="">Житомир</option> | |
| 45 | - <option value="">Львов</option> | |
| 46 | - <option value="">Киев</option> | |
| 47 | - <option value="">Житомир</option> | |
| 48 | - <option value="">Львов</option> | |
| 49 | - <option value="">Киев</option> | |
| 50 | - <option value="">Житомир</option> | |
| 51 | - <option value="">Львов</option> | |
| 52 | - <option value="">Киев</option> | |
| 53 | - <option value="">Житомир</option> | |
| 54 | - <option value="">Львов</option> | |
| 55 | - <option value="">Киев</option> | |
| 56 | - <option value="">Житомир</option> | |
| 57 | - <option value="">Львов</option> | |
| 58 | - <option value="">Киев</option> | |
| 59 | - <option value="">Житомир</option> | |
| 60 | - <option value="">Львов</option> | |
| 61 | - <option value="">Киев</option> | |
| 62 | - <option value="">Житомир</option> | |
| 63 | - <option value="">Львов</option> | |
| 64 | - <option value="">Киев</option> | |
| 65 | - <option value="">Житомир</option> | |
| 66 | - <option value="">Львов</option> | |
| 67 | - <option value="">Киев</option> | |
| 68 | - <option value="">Житомир</option> | |
| 69 | - <option value="">Львов</option> | |
| 70 | - <option value="">Киев</option> | |
| 71 | - <option value="">Житомир</option> | |
| 72 | - <option value="">Львов</option> | |
| 73 | - <option value="">Киев</option> | |
| 74 | - <option value="">Житомир</option> | |
| 75 | - <option value="">Львов</option> | |
| 76 | - <option value="">Киев</option> | |
| 77 | - <option value="">Житомир</option> | |
| 78 | - <option value="">Львов</option> | |
| 79 | - <option value="">Киев</option> | |
| 80 | - <option value="">Житомир</option> | |
| 81 | - <option value="">Львов</option> | |
| 82 | - <option value="">Киев</option> | |
| 83 | - | |
| 84 | - </select> | |
| 85 | - </div> | |
| 86 | - <div class="blocks-check-list-wrapp"> | |
| 87 | - <div class="blocks-check-title"><label for="theme-2">Специализация</label></div> | |
| 88 | - <select id="theme-2"> | |
| 89 | - <option selected value="">Любая</option> | |
| 90 | - <option value="">Киев</option> | |
| 91 | - <option value="">Житомир</option> | |
| 92 | - <option value="">Львов</option> | |
| 93 | - <option value="">Киев</option> | |
| 94 | - <option value="">Житомир</option> | |
| 95 | - <option value="">Львов</option> | |
| 96 | - </select> | |
| 97 | - </div> | |
| 29 | + <?php | |
| 30 | + $form = ActiveForm::begin(['options'=>['class'=>'search-work-form'],'action'=>[''], 'method'=>'get']); | |
| 31 | + ?> | |
| 32 | + | |
| 33 | + | |
| 34 | + <?= $form->field($model, 'city') | |
| 35 | + ->widget(Select2::classname(), [ | |
| 36 | + 'options' => [ 'placeholder' => 'Выбор города ...' ], | |
| 37 | + 'pluginOptions' => [ | |
| 38 | + 'allowClear' => true, | |
| 39 | + 'minimumInputLength' => 3, | |
| 40 | + 'ajax' => [ | |
| 41 | + 'url' => \yii\helpers\Url::to([ 'site/city' ]), | |
| 42 | + 'dataType' => 'json', | |
| 43 | + 'data' => new JsExpression('function(params) { return {q:params.term}; }'), | |
| 44 | + ], | |
| 45 | + 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), | |
| 46 | + 'templateResult' => new JsExpression('function(city) { return city.text; }'), | |
| 47 | + 'templateSelection' => new JsExpression('function (city) { return city.text; }'), | |
| 48 | + ], | |
| 49 | + ]); ?> | |
| 98 | 50 | |
| 99 | - <div class="blocks-check-list-wrapp"> | |
| 100 | - <div class="blocks-check-title"><label for="theme-3">Тип исполнителя</label></div> | |
| 101 | - <select id="theme-3"> | |
| 102 | - <option selected value="">Любая</option> | |
| 103 | - <option value="">Киев</option> | |
| 104 | - <option value="">Житомир</option> | |
| 105 | - <option value="">Львов</option> | |
| 106 | - <option value="">Киев</option> | |
| 107 | - <option value="">Житомир</option> | |
| 108 | - <option value="">Львов</option> | |
| 109 | - </select> | |
| 110 | - </div> | |
| 111 | 51 | |
| 112 | - <div class="blocks-check-list-wrapp"> | |
| 113 | - <div class="blocks-check-title">Условия работы</div> | |
| 114 | - <div class="blocks-check-list"> | |
| 115 | - <input type="checkbox" name="group2" class="check-search" id="theme-4"><label for="theme-4"><span></span>С гарантией</label> | |
| 116 | - </div> | |
| 117 | - <div class="blocks-check-list"> | |
| 118 | - <input type="checkbox" name="group2" class="check-search" id="theme-5"><label for="theme-5"><span></span>С договором</label> | |
| 119 | - </div> | |
| 120 | - <div class="blocks-check-list"> | |
| 121 | - <input type="checkbox" name="group2" class="check-search" id="theme-6"><label for="theme-6"><span></span>Со сметой</label> | |
| 122 | - </div> | |
| 123 | - <div class="blocks-check-list"> | |
| 124 | - <input type="checkbox" name="group2" class="check-search" id="theme-7"><label for="theme-7"><span></span>Без предоплаты</label> | |
| 125 | - </div> | |
| 126 | - </div> | |
| 52 | + <?= | |
| 53 | + $form->field($model, 'specialization') | |
| 54 | + ->dropDownList($specialization, ['prompt' => 'Любая']); | |
| 55 | + ?> | |
| 127 | 56 | |
| 128 | - <div class="blocks-check-list-wrapp"> | |
| 129 | - <div class="blocks-check-title">Рейтинг</div> | |
| 130 | - <div class="rating"> | |
| 131 | - <!--оценка--> | |
| 132 | - <input type="hidden" class="val" value="0"/> | |
| 133 | - </div> | |
| 134 | - </div> | |
| 135 | 57 | |
| 136 | - <div class="blocks-check-list-wrapp"> | |
| 137 | - <div class="blocks-check-title">Статус</div> | |
| 138 | - <div class="blocks-check-list"> | |
| 139 | - <input type="radio" name="group3" class="check-search" id="theme-8"><label for="theme-8"><span></span>Онлайн</label> | |
| 140 | - </div> | |
| 141 | - <div class="blocks-check-list"> | |
| 142 | - <input type="radio" name="group3" class="check-search" id="theme-9" checked><label for="theme-9"><span></span>Все</label> | |
| 143 | - </div> | |
| 144 | - </div> | |
| 58 | + <?= | |
| 59 | + $form->field($model, 'type') | |
| 60 | + ->dropDownList(['1'=>'Частное лицо','2'=>'Компания'], ['prompt' => 'Любой']); | |
| 61 | + ?> | |
| 145 | 62 | |
| 146 | - <div class="blocks-check-list-wrapp"> | |
| 147 | - <div class="blocks-check-title">Дополнительно</div> | |
| 148 | - <div class="blocks-check-list"> | |
| 149 | - <input type="checkbox" name="group4" class="check-search" id="theme-10"><label for="theme-10"><span></span>Только с портфолио</label> | |
| 150 | - </div> | |
| 151 | - <div class="blocks-check-list"> | |
| 152 | - <input type="checkbox" name="group4" class="check-search" id="theme-11"><label for="theme-11"><span></span>Только с отзывами</label> | |
| 153 | - </div> | |
| 154 | - <div class="blocks-check-list"> | |
| 155 | - <input type="checkbox" name="group4" class="check-search" id="theme-12"><label for="theme-12"><span></span>Только свободные</label> | |
| 156 | - </div> | |
| 157 | - </div> | |
| 158 | - <div class="blocks-check-list-submit"> | |
| 159 | - <input type="submit" value="Найти"/> | |
| 160 | - </div> | |
| 161 | - </form> | |
| 162 | - <script> | |
| 163 | - $('div.rating').rating({ | |
| 164 | - fx: 'full', | |
| 165 | - url: 'rating.php' | |
| 166 | - }); | |
| 167 | - </script> | |
| 63 | + | |
| 64 | + | |
| 65 | + <?= | |
| 66 | + | |
| 67 | + $form->field ($model, 'working_conditions') | |
| 68 | + ->checkboxList ( | |
| 69 | + [ | |
| 70 | + 'guarantee' => 'С гарантией', | |
| 71 | + 'contract' => 'С договором', | |
| 72 | + 'estimate' => 'Со сметой', | |
| 73 | + 'prepayment' => 'Без предоплаты' | |
| 74 | + ], | |
| 75 | + [ | |
| 76 | + 'item' => function($index, $label, $name, $checked, $value) { | |
| 77 | + $return = '<div class="blocks-check-list">'; | |
| 78 | + $return .= '<input type="checkbox" '.($checked ? "checked" : "" ).' name="' . $name . '" class="check-search" value="' . $value . '" id="theme-'.$index.'">'; | |
| 79 | + $return .= '<label for="theme-'.$index.'"><span></span>'.$label.'</label>'; | |
| 80 | + $return .= '</div>'; | |
| 81 | + return $return; | |
| 82 | + } | |
| 83 | + ] | |
| 84 | + ); | |
| 85 | + ?> | |
| 86 | + | |
| 87 | + <div class="blocks-check-list-wrapp"> | |
| 88 | + <div id="slider-value"></div> | |
| 89 | + <?php | |
| 90 | + echo $form->field($model, 'rating', [ | |
| 91 | + 'template' => "{label}<br><div id='{$form->id}-rating'>{$model->rating}</div><br>{input}\n{hint}\n{error}", | |
| 92 | + 'labelOptions' => [ | |
| 93 | + 'class' => 'blocks-check-title', | |
| 94 | + ], | |
| 95 | + ]) | |
| 96 | + ->widget(SliderInput::className(), [ | |
| 97 | + 'clientOptions' => [ | |
| 98 | + 'min' => 0, | |
| 99 | + 'max' => 5, | |
| 100 | + 'step' => 0.5, | |
| 101 | + ], | |
| 102 | + 'clientEvents' => [ | |
| 103 | + 'slide' => "function( event, ui ) { | |
| 104 | + $( '#{$form->id}-rating' ).text(ui.value); | |
| 105 | + $('input[name=\"{$model->formName()}[rating]\"]').val(ui.value); | |
| 106 | + | |
| 107 | + }", | |
| 108 | + ], | |
| 109 | + ]); | |
| 110 | + ?> | |
| 111 | + </div> | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + <?= | |
| 116 | + $form->field($model, 'online', [ | |
| 117 | + 'options' => [ | |
| 118 | + 'class' => 'blocks-check-list-wrapp', | |
| 119 | + ], | |
| 120 | + 'template' => "<div class='blocks-check-title'>{label}</div>\n{input}\n{hint}\n{error}", | |
| 121 | + ]) | |
| 122 | + ->radioList([ | |
| 123 | + '' => 'Все', | |
| 124 | + 1 => 'Онлайн', | |
| 125 | + ], [ | |
| 126 | + 'item' => function($index, $label, $name, $checked, $value) use ($model) { | |
| 127 | + return "<div class='blocks-check-list'><input type='radio' id='{$model->formName()}-{$index}' name='{$name}' class='check-search' value='{$value}' " . ($checked?'checked':'') . "><label for='{$model->formName()}-{$index}'><span></span>{$label}</label></div>"; | |
| 128 | + }, | |
| 129 | + 'unselect' => NULL, | |
| 130 | + ]); | |
| 131 | + ?> | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + <?= | |
| 136 | + $form->field ($model, 'additional_parameters') | |
| 137 | + ->checkboxList ( | |
| 138 | + [ | |
| 139 | + 'with_portfolio' => 'Только с портфолио', | |
| 140 | + 'with_comments' => 'Только с отзывами', | |
| 141 | + 'only_free' => 'Только свободные', | |
| 142 | + ], | |
| 143 | + [ | |
| 144 | + 'item' => function($index, $label, $name, $checked, $value) { | |
| 145 | + $return = '<div class="blocks-check-list">'; | |
| 146 | + $return .= '<input type="checkbox" '.($checked ? "checked" : "" ).' name="' . $name . '" class="check-search" value="' . $value . '" id="theme2-'.$index.'">'; | |
| 147 | + $return .= '<label for="theme2-'.$index.'"><span></span>'.$label.'</label>'; | |
| 148 | + $return .= '</div>'; | |
| 149 | + return $return; | |
| 150 | + } | |
| 151 | + ] | |
| 152 | + ); | |
| 153 | + ?> | |
| 154 | + <div class="blocks-check-list-submit"> | |
| 155 | + <?= Html::submitInput('Найти') ?> | |
| 156 | + </div> | |
| 157 | + | |
| 158 | + <?php | |
| 159 | + $form->end(); | |
| 160 | + ?> | |
| 168 | 161 | </div> |
| 169 | 162 | <div class="right-search-work"> |
| 170 | 163 | <div class="search-worker-title style">Найти исполнителя</div> |
| 171 | - <div class="search-worker-title-two style">Проектанты готовые приступить к работе <span>145</span></div> | |
| 164 | + <div class="search-worker-title-two style">Проектанты готовые приступить к работе <span><?= $dataProvider->totalCount ?></span></div> | |
| 172 | 165 | <div class="search-worker-search-wr style"> |
| 173 | - <form action="" class="search-worker-form"> | |
| 174 | - <input id="srch-wrk-text" type="text" placeholder="Любая информация о проектанте" required=""/> | |
| 175 | - <input id="srch-wrk-sub" type="submit" value="Найти"/> | |
| 176 | - </form> | |
| 177 | - <a href="#" class="add-to-catalog-search-worker">Добавить себя в каталог</a> | |
| 166 | + <?php | |
| 167 | + $form2 = ActiveForm::begin(['method' => 'get', 'action' => [''], 'options' => ['class' => 'search-worker-form']]); | |
| 168 | + ?> | |
| 169 | + | |
| 170 | + <?= $form2->field($model, 'search', ['options' => ['tag' => 'span']])->label(false)->textInput(['placeholder' => $model->getAttributeLabel('search')]);?> | |
| 171 | + | |
| 172 | + <?= Html::submitInput('Найти');?> | |
| 173 | + | |
| 174 | + <?php | |
| 175 | + $form2->end(); | |
| 176 | + ?> | |
| 177 | + | |
| 178 | + | |
| 179 | + <?= Html::a('Добавить себя в каталог',Url::toRoute('accounts/service'),['class'=>'add-to-catalog-search-worker'])?> | |
| 180 | + | |
| 178 | 181 | <div class="search-worker-sort-wr style"> |
| 179 | 182 | <div class="search-worker-sort">Сортировать: </div> |
| 180 | 183 | <ul> |
| 181 | 184 | <li class="activejob"> |
| 182 | - <a href="#">рейтинг</a> | |
| 185 | + <a href="#" data-sort-name="<?=$sort_name?>"></a> | |
| 183 | 186 | <div class="sidebar-droped-wr style"> |
| 184 | - <ul> | |
| 185 | - <li><a href="#">рейтинг</a></li> | |
| 186 | - <li><a href="#">1заказчик</a></li> | |
| 187 | - <li><a href="#">2заказчик</a></li> | |
| 188 | - <li><a href="#">3заказчик</a></li> | |
| 189 | - <li><a href="#">4заказчик</a></li> | |
| 190 | - | |
| 191 | - </ul> | |
| 187 | + <?php | |
| 188 | + echo LinkSorter::widget([ | |
| 189 | + 'sort' => $dataProvider->sort, | |
| 190 | + ]); | |
| 191 | + ?> | |
| 192 | 192 | </div> |
| 193 | 193 | </li> |
| 194 | 194 | </ul> |
| ... | ... | @@ -198,8 +198,9 @@ $this->title = 'My Yii Application'; |
| 198 | 198 | <div class="search-worker-blocks-wr style"> |
| 199 | 199 | |
| 200 | 200 | <?= |
| 201 | + | |
| 201 | 202 | ListView::widget( [ |
| 202 | - 'dataProvider' => $performer, | |
| 203 | + 'dataProvider' => $dataProvider, | |
| 203 | 204 | 'itemView'=>'_performer_list_view', |
| 204 | 205 | 'layout' => "{items}\n<div class='navi-buttons-wr style'>{pager}</div>" |
| 205 | 206 | ] ); |
| ... | ... | @@ -209,19 +210,9 @@ $this->title = 'My Yii Application'; |
| 209 | 210 | |
| 210 | 211 | |
| 211 | 212 | </div> |
| 212 | - | |
| 213 | - <script> | |
| 214 | - $('div.rating-new').rating({ | |
| 215 | - fx: 'full', | |
| 216 | - readOnly: 'true', | |
| 217 | - url: 'rating.php' | |
| 218 | - }); | |
| 219 | - </script> | |
| 220 | 213 | </div> |
| 221 | 214 | </div> |
| 222 | 215 | </div> |
| 223 | 216 | </div> |
| 224 | 217 | |
| 225 | 218 | </div> |
| 226 | - | |
| 227 | - | ... | ... |
frontend/web/css/style.css
| ... | ... | @@ -6655,6 +6655,18 @@ input[disabled], select[disabled] { |
| 6655 | 6655 | } |
| 6656 | 6656 | .right_search_perform_foto-wr {vertical-align: middle} |
| 6657 | 6657 | .section-box-customer .search-worker-blocks {margin-top: 20px} |
| 6658 | + | |
| 6659 | +.search-work-form .control-label{ | |
| 6660 | + width: 100%; | |
| 6661 | + font-size: 13px; | |
| 6662 | + font-weight: 700; | |
| 6663 | + margin-bottom: 5px; | |
| 6664 | +} | |
| 6665 | + | |
| 6666 | +.search-work-form .form-group{ | |
| 6667 | + margin-bottom: 16px; | |
| 6668 | + | |
| 6669 | +} | |
| 6658 | 6670 | .form_site_logn-wr { |
| 6659 | 6671 | width: 240px; |
| 6660 | 6672 | margin: 0 auto; | ... | ... |