Ejemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = CsCurrencies::find();
     // add conditions that should always apply here
     $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, 'state_id' => $this->state_id, 'rate' => $this->rate]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'code', $this->code]);
     return $dataProvider;
 }
Ejemplo n.º 2
0
    <?php 
echo ' <span class="optional">(opciono)</span>';
?>
    <i class="fa fa-chevron-right chevron"></i>
</div>
<div class="wrapper notshown body fadeIn animated" style="border-top:none;">
	<?php 
echo $this->render('../_hint.php', ['message' => $message]);
?>
	  
    <div class="form-group kv-fieldset-inline">
	    <?php 
echo Html::activeLabel($model, 'budget', ['label' => 'Moj budžet za ovu porudžbinu', 'class' => 'col-sm-3 control-label']);
?>
	    <div class="col-sm-2" style="padding-right:0">
	    	<?php 
echo $form->field($model, 'budget_operator', ['showLabels' => false])->dropDownList(['exact' => 'tačno', 'approx' => 'oko', 'min' => 'najmanje', 'max' => 'najviše'], ['class' => 'input-lg']);
?>
	    </div>
	    <div class="col-sm-3" style="padding-right:0">
	        <?php 
echo $form->field($model, 'budget', ['addon' => ['prepend' => ['content' => '<i class="fa fa-money"></i>'], 'groupOptions' => ['class' => 'input-group-lg']], 'feedbackIcon' => ['success' => 'ok', 'error' => 'exclamation-sign', 'successOptions' => ['class' => 'text-primary'], 'errorOptions' => ['class' => 'text-primary', 'style' => 'top: 6px;']], 'hintType' => ActiveField::HINT_SPECIAL, 'hintSettings' => ['onLabelClick' => true, 'onLabelHover' => false, 'title' => '<i class="glyphicon glyphicon-info-sign"></i> Napomena'], 'showLabels' => false])->input('number', ['min' => 0, 'step' => 10, 'placeholder' => 'Iznos', 'class' => 'input-lg']);
?>
	    </div>	    
	    <div class="col-sm-2" style="padding-right:0">
	        <?php 
echo $form->field($model, 'currency_id', ['showLabels' => false])->dropDownList(ArrayHelper::map(CsCurrencies::find()->all(), 'id', 'code'), ['class' => 'input-lg']);
?>
	    </div>
	</div>
</div>
Ejemplo n.º 3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCurrency()
 {
     return $this->hasOne(CsCurrencies::className(), ['id' => 'currency_id']);
 }
Ejemplo n.º 4
0
 /**
  * Finds the CsCurrencies model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return CsCurrencies the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = CsCurrencies::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }