/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = ResumeStatus::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, 'rec_status_id' => $this->rec_status_id, 'user_id' => $this->user_id, 'dc' => $this->dc]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'note', $this->note]); return $dataProvider; }
<?php $this->beginBlock('other'); ?> <p></p> <?php echo $form->field($model, 'date_start')->widget(\dosamigos\datepicker\DatePicker::className(), ['language' => 'ru', 'options' => ['class' => 'form-control', 'autocomplete' => 'off'], 'clientOptions' => ['forceParse' => true, 'todayBtn' => true, 'clearBtn' => true, 'autoclose' => true, 'todayHighlight' => true, 'format' => 'dd.mm.yyyy']]); ?> <?php echo $form->field($model, 'date_end')->widget(\dosamigos\datepicker\DatePicker::className(), ['language' => 'ru', 'options' => ['class' => 'form-control', 'autocomplete' => 'off'], 'clientOptions' => ['forceParse' => true, 'todayBtn' => true, 'clearBtn' => true, 'autoclose' => true, 'todayHighlight' => true, 'format' => 'dd.mm.yyyy']]); ?> <?php echo $form->field($model, 'resume_status_id')->dropDownList(ArrayHelper::map(\app\models\ResumeStatus::find()->active()->all(), 'id', 'name'), ['prompt' => '']); ?> <?php echo $form->field($model, 'workplace_id')->dropDownList(ArrayHelper::map(\app\models\Workplace::find()->active()->all(), 'id', 'name'), ['prompt' => '']); ?> <?php echo $form->field($model, 'rec_status_id')->radioList(ArrayHelper::map(\app\models\RecStatus::find()->active()->all(), 'id', 'name'), ['class' => 'btn-group', 'data-toggle' => 'buttons', 'unselect' => null, 'item' => function ($index, $label, $name, $checked, $value) { return '<label class="btn btn-default' . ($checked ? ' active' : '') . '">' . Html::radio($name, $checked, ['value' => $value, 'class' => 'project-status-btn']) . $label . '</label>'; }]); ?> <?php echo $form->field($model, 'user_id')->dropDownList(ArrayHelper::map(\app\models\User::find()->active()->all(), 'id', 'name'), ['prompt' => '']); ?>
/** * @return \yii\db\ActiveQuery */ public function getResumeStatus() { return $this->hasOne(ResumeStatus::className(), ['id' => 'resume_status_id']); }
/** * Finds the ResumeStatus model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return ResumeStatus the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = ResumeStatus::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }