/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Cos::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, 'FORWARD_ON_RNA_enabled' => $this->FORWARD_ON_RNA_enabled, 'FORWARD_ON_BUSY_enabled' => $this->FORWARD_ON_BUSY_enabled, 'FORWARD_UNC_enabled' => $this->FORWARD_UNC_enabled, 'clip' => $this->clip, 'clir' => $this->clir, 'mwi' => $this->mwi, 'first_update' => $this->first_update, 'last_update' => $this->last_update, 'call_hunting_type' => $this->call_hunting_type]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'desc', $this->desc])->andFilterWhere(['like', 'FORWARD_ON_RNA_number', $this->FORWARD_ON_RNA_number])->andFilterWhere(['like', 'FORWARD_ON_BUSY_number', $this->FORWARD_ON_BUSY_number])->andFilterWhere(['like', 'FORWARD_UNC_number', $this->FORWARD_UNC_number])->andFilterWhere(['like', 'call_hunting', $this->call_hunting])->andFilterWhere(['like', 'first_user', $this->first_user])->andFilterWhere(['like', 'first_ip', $this->first_ip])->andFilterWhere(['like', 'last_user', $this->last_user])->andFilterWhere(['like', 'last_ip', $this->last_ip]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getCOS() { return $this->hasOne(Cos::className(), ['id' => 'COS']); }
/** * Finds the Cos model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Cos the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Cos::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
?> <?php echo $form->field($model, 'group_id')->dropDownList(ArrayHelper::map(Subsgroup::find()->all(), 'id', 'name'), ['prompt' => 'Select Group']); ?> <?php echo $form->field($model, 'number')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'password')->passwordInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'COS')->dropDownList(ArrayHelper::map(Cos::find()->all(), 'id', 'name'), ['prompt' => 'Select COS']); ?> <?php echo $form->field($model, 'FORWARD_ON_RNA_enabled')->dropDownList([0 => 'Disable', 1 => 'Enable'], ['prompt' => 'Select Forward On RNA Enabled']); ?> <?php echo $form->field($model, 'FORWARD_ON_RNA_number')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'FORWARD_ON_BUSY_enabled')->dropDownList([0 => 'Disable', 1 => 'Enable'], ['prompt' => 'Select Forward On Busy Enabled']); ?> <?php