Esempio n. 1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPresentations()
 {
     return $this->hasMany(Presentations::className(), ['loc_id' => 'id']);
 }
Esempio n. 2
0
 /**
  * Finds the CsServicesTranslation model based on its translated title.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return CsServices the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findPresentation($id)
 {
     if (($model = \common\models\Presentations::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
 public function findPresentation($id)
 {
     if ($activity = \common\models\Activities::find()->where(['activity' => 'presentation', 'user_id' => $id])->one()) {
         if ($presentation = \common\models\Presentations::find()->where(['activity_id' => $activity->id])->one()) {
             return $presentation;
         }
     }
     return null;
 }
Esempio n. 4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPresentation()
 {
     return $this->hasOne(Presentations::className(), ['activity_id' => 'id']);
 }
Esempio n. 5
0
          
<div class="card_container record-xl grid-item fadeInUp animated" id="card_container<?php 
echo $model->id;
?>
" style="float:none;">

<?php 
switch ($model->activity) {
    case 'order':
        echo $this->render('/orders/_card_compact.php', ['model' => \common\models\Orders::find('activity=' . $model->id)->one()]);
        break;
    case 'promotion':
        echo $this->render('/promotions/_card_compact.php', ['model' => \common\models\Promotions::find('activity=' . $model->id)->one()]);
        break;
    case 'presentation':
        echo $this->render('/presentations/_card_compact.php', ['model' => \common\models\Presentations::find('activity=' . $model->id)->one()]);
        break;
    default:
        //echo $this->render('/orders/_card_compact.php', ['model'=>\common\models\Orders::findOne('activity='.$model->id)]);
        break;
}
if ($model->activity == 'order' && $model->bid) {
    ?>
    <div class="action-area normal-case">
        <?php 
    echo Html::a(Yii::t('app', 'Bids') . '&nbsp;<i class="fa fa-caret-down"></i>', null, ['class' => 'btn btn-link bid-link']);
    ?>
    </div>
    <div class="bids-area animated fadeInDown">
        <?php 
    foreach ($model->order->bids as $bid) {
Esempio n. 6
0
?>
<!-- PRESENTATIONS -->
<hr style="margin-top:0">
<div class="featured">
	<h2 style="text-align:left; margin:30px 0 10px 0;"><i class="fa fa-flag-o"></i> Ponude usluge
	<?php 
echo Html::a('POKAŽI JOŠ', Url::to('/presentations'), array('class' => 'btn btn-default uppercase bold float-right'));
?>
	</h2>
	<p class="paragraph fs_11 gray_color margin-bottom-20"><?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>
	<div class="grid js-masonry" data-masonry-options='{ "itemSelector": ".grid-item", "isFitWidth": true, "gutter": 30 }' style="margin-top:40px;">
	<?php 
foreach (Presentations::find()->limit(4)->orderBy('id DESC')->all() as $key => $model) {
    ?>
		<?php 
    echo $this->render('//presentations/_card.php', ['model' => $model]);
    ?>
	<?php 
}
// foreach ($sektor as $key=>$sek)
?>
	</div>
</div>

<?php 
if (!Yii::$app->user->isGuest) {
    ?>
<!-- VIEWED SERVICES -->
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Presentations::find();
     // add conditions that should always apply here
     $query->joinWith(['objectModels', 'presentationObjectPropertyValues', 'presentationActionPropertyValues', 'location', 'provider']);
     $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;
     }
     // grid filtering conditions
     $query->andFilterWhere(['id' => $this->id, 'activity_id' => $this->activity_id, 'offer_id' => $this->offer_id, 'provider_service_id' => $this->provider_service_id]);
     $query->andFilterWhere(['like', 'title', $this->title]);
     $query->andFilterWhere($this->queryQuantity());
     $query->andFilterWhere($this->queryConsumers());
     $query->andFilterWhere($this->queryPrice());
     $query->andWhere($this->queryObjectModels());
     //$query->andWhere($this->querySpecs());
     //$query->andWhere($this->queryMethods());
     //$query->andWhere($this->queryLocations());
     $query->groupBy('presentations.id');
     return $dataProvider;
 }
Esempio n. 8
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPresentations()
 {
     return $this->hasMany(Presentations::className(), ['provider_service_id' => 'id']);
 }