/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = BienesSede::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_sede' => $this->id_sede, 'id_localidad' => $this->id_localidad]); $query->andFilterWhere(['like', 'nombre', $this->nombre]); return $dataProvider; }
echo Html::encode($this->title); ?> </h1> <p> <?php echo Html::a(Yii::t('app', 'Volver'), ['create'], ['class' => 'btn btn-info']); ?> <?php echo Html::a(Yii::t('app', 'Update'), ['update', 'id_codigo' => $model->id_codigo, 'id_direccion' => $model->id_direccion, 'identificacion' => $model->identificacion], ['class' => 'btn btn-primary']); ?> <?php echo Html::a(Yii::t('app', 'Delete'), ['delete', 'id_codigo' => $model->id_codigo, 'id_direccion' => $model->id_direccion, 'identificacion' => $model->identificacion], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), 'method' => 'post']]); ?> </p> <?php echo DetailView::widget(['model' => $model, 'attributes' => [['attribute' => 'nombre', 'value' => BienesCodigo::findOne($model->id_codigo)->descripcion], ['attribute' => 'Sede', 'value' => BienesSede::findOne($model->id_sede)->nombre], 'identificacion', 'descripcion', 'valor_unidad', 'justiprecio', 'ano_adquisicion', 'ubicacion', ['attribute' => 'tipo_adquisicion', 'value' => app\modules\bienes\models\BienesAdquisicion::findOne($model->tipo_adquisicion)->descripcion]]]); ?> </div> <style> .btn-info::before { /*--ajuste de icono de crear--*/ content: "\f0a8 "; font-family: FontAwesome; color: #5A5A5B; } </style>
/** * Finds the BienesSede model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return BienesSede the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = BienesSede::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }