/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = EquipmentStatus::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, 'active' => $this->active]); $query->andFilterWhere(['like', 'status', $this->status]); return $dataProvider; }
?> <?php echo $form->field($model, 'equipment_type_id')->dropDownList(ArrayHelper::map(EquipmentType::find()->orderBy('name ASC')->all(), 'id', 'name')); ?> <?php echo $form->field($model, 'description')->textArea(['maxlength' => true]); ?> <?php echo $form->field($model, 'serial_number')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'equipment_status_id')->dropDownList(ArrayHelper::map(EquipmentStatus::find()->orderBy('status ASC')->all(), 'id', 'status')); ?> <?php echo $form->field($model, 'room_id')->dropDownList(ArrayHelper::map(Room::find()->orderBy('name ASC')->all(), 'id', 'name'), ['prompt' => 'Selecciona un Salón...', 'onchange' => '$.post("' . Yii::$app->urlManager->createUrl('equipment/list-locations?id=') . '"+$(this).val(), function(data){ $("#equipment-location_id").html(data); })']); ?> <!--?= $form->field($model, 'location_id')->dropDownList( ArrayHelper::map( Location::find()->all(), 'id', 'location') )