public function selectOptions() { $query = Provider::find(); $arr = $query->select(['id', 'name'])->asArray()->all(); $options = ['' => 'Обрати']; foreach ($arr as $op) { $options[$op['id']] = $op['name']; } return $options; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Provider::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'user_id' => $this->user_id, 'industry_id' => $this->industry_id, 'registration_time' => $this->registration_time, 'is_active' => $this->is_active, 'del_upd_time' => $this->del_upd_time, 'service_upd_time' => $this->service_upd_time, 'score' => $this->score, 'rate' => $this->rate, 'rating' => $this->rating, 'hit_counter' => $this->hit_counter]); $query->andFilterWhere(['like', 'legal_form', $this->legal_form])->andFilterWhere(['like', 'VAT_ID', $this->VAT_ID])->andFilterWhere(['like', 'company_no', $this->company_no])->andFilterWhere(['like', 'status', $this->status]); return $dataProvider; }
public function getProviderLink() { $p = Provider::findOne($this->provided_by); return Html::a(Html::encode($p->name), ['/provider/view', 'id' => $p->id]); }
} // foreach ($sektor as $key=>$sek) ?> </div> <div class="show_more"><?php echo Html::a('POKAŽI JOŠ', Url::to('/providers'), array('class' => 'btn btn-default')); ?> </div> <div class="featured"> <h2 style="text-align:center; margin:30px 0 10px 0;">Pružaoci usluga koje ste preporučili</h2> <hr> <p class="paragraph" style="text-align:center; margin:0 0 10px 0; color:#aaa; font-size:11px;"><?php echo Yii::t('app', 'Choose category by clicking on the colored boxes and then select one of the service industry from the list below.'); ?> </p> <?php foreach (Provider::find()->where('id>0')->limit(5)->all() as $key => $provider) { echo ProviderBox::widget(['boxData' => []]); } // foreach ($sektor as $key=>$sek) ?> </div> <div class="show_more"><?php echo Html::a('POKAŽI JOŠ', Url::to('/providers'), array('class' => 'btn btn-default')); ?> </div>
/** * @return \yii\db\ActiveQuery */ public function getProviders() { return $this->hasMany(Provider::className(), ['industry_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getProvider() { return $this->hasOne(Provider::className(), ['user_id' => 'id']); }
/** * Finds the Provider model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $id * @return Provider the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Provider::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
client_reviewed smo izbacili jer useri nemaju profil i ne mogu biti reviewed / 21/01/15 if ($log->action=='client_reviewed') {$icon = '<i class="fa fa-pencil-square fa-lg"></i>'; $color = '#4d575f;'; $pre = ''; $log_text = 'je pregleda'.$suff.' <i class="fa fa-user></i> korisnika</a>';}*/ // provider_reviewed if ($log->action == 'provider_reviewed') { $icon = '<i class="fa fa-pencil-square fa-lg"></i>'; $color = '#e66021;'; $pre = ''; $log_text = Yii::t('app', 'reviewed') . $suff . ' <a href="' . Url::to('provider/' . $user1->username . '/i') . '"><i class="fa fa-users"></i> ' . Yii::t('app', 'a service provider') . '</a>'; } // if ($log->action=='provider_reviewed') // provider_recommended if ($log->action == 'provider_recommended') { $icon = '<i class="fa fa-thumbs-o-up fa-lg"></i>'; $color = '#e66021;'; $pre = ''; $pro = \common\models\Provider::findOne($log->alias); $log_text = Yii::t('app', 'recommended') . $suff . ' <a href="' . Url::to('provider/' . $pro->user->username . '/i') . '"><i class="fa fa-users"></i> ' . Yii::t('app', 'a service provider') . '</a>'; } // if ($log->action=='provider_recommended') // renderuj ticker echo '<li> <table> <tr> <td class="feed-icon" style="background: ' . $color . ' "> <span>' . $icon . '</span> </td> <td class="feed-content"> <b>' . $pre . ' ' . $user->username . '</b> ' . $log_text . ' | <span><i class="fa fa-clock-o"></i> ' . \yii\timeago\TimeAgo::widget(['timestamp' => $log->time]) . '</span> </td> </tr> </table>
/** * @return \yii\db\ActiveQuery */ public function getRegisteredTo() { return $this->hasOne(Provider::className(), ['id' => 'registered_to']); }