public function search($params) { $query = State::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $query->andFilterWhere([State::tableName() . '.status' => '1']); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['Id' => $this->Id, 'createdOn' => $this->createdOn, 'status' => $this->status, 'updatedOn' => $this->updatedOn, 'createdBy' => $this->createdBy, 'updatedBy' => $this->updatedBy]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'alias', $this->alias])->andFilterWhere(['like', 'ip', $this->ip]); return $dataProvider; }
?> <?php echo $form->field($model, 'identification_type', ['options' => ['class' => 'col-xs-6']])->radioList(DictApplicant::$identificationType); ?> <?php echo $form->field($model, 'marital_status', ['options' => ['class' => 'col-xs-6']])->radioList(DictApplicant::$maritalStatus); ?> <?php echo $form->field($model, 'identification_number', ['options' => ['class' => 'col-xs-6']])->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'social_security_number', ['options' => ['class' => 'col-xs-6']])->widget(MaskedInput::className(), ['mask' => '999-99-9999']); ?> <?php echo $form->field($model, 'identification_state', ['options' => ['class' => 'col-xs-6 padding-right0']])->widget(Select2::classname(), ['data' => ArrayHelper::map(State::find()->all(), 'abbreviation', 'abbreviation'), 'options' => ['placeholder' => 'Select a state ...'], 'pluginOptions' => ['allowClear' => true]]); ?> <?php echo $form->field($model, 'identification_expiration_date', ['options' => ['class' => 'col-xs-6']])->label('ID Expiration Date')->widget(DatePicker::classname(), ['type' => DatePicker::TYPE_COMPONENT_PREPEND, 'removeButton' => false, 'options' => ['value' => $model->identification_expiration_date ? date('m/d/Y', $model->identification_expiration_date) : ''], 'pluginOptions' => ['autoclose' => true, 'format' => 'mm/dd/yyyy']]); ?> <?php echo $form->field($model, 'occupation', ['options' => ['class' => 'col-xs-6']])->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'employer', ['options' => ['class' => 'col-xs-6']])->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'total_annual_income', ['options' => ['class' => 'col-xs-6']])->radioList(DictApplicant::$totalAnnualIncome); ?> <?php echo $form->field($model, 'years_with_advisor', ['options' => ['class' => 'col-xs-6']])->radioList(DictApplicant::$yearsWithAdvisor);
/** * Finds the State model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return State the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = State::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
private function getState() { return State::findOne($this->user_state)->state_code; }
<?php echo $form->field($model, 'client_id', ['options' => ['class' => 'col-xs-6 padding-right0']])->textInput(['readonly' => true]); ?> </div> <?php } ?> <div class="form-ul pb20 clearfix"> <?php echo $form->field($model, 'address_city', ['options' => ['class' => 'col-xs-4 padding-left0']])->textInput(['readonly' => $readonly])->label('City'); ?> <?php echo $form->field($model, 'address_state', ['options' => ['class' => 'col-xs-4 padding-right0']])->label('State')->widget(Select2::classname(), ['data' => ArrayHelper::map(State::find()->all(), 'abbreviation', 'abbreviation'), 'options' => ['placeholder' => 'Select a state ...', 'disabled' => $readonly], 'pluginOptions' => ['allowClear' => true]]); ?> <?php echo $form->field($model, 'address_zip_code', ['options' => ['class' => 'col-xs-4 padding-right0']])->label('Zip Code')->widget(MaskedInput::className(), ['mask' => '99999', 'options' => ['class' => 'form-control', 'readonly' => $readonly]]); ?> </div> <div class="form-ul pb20 clearfix"> <?php echo $form->field($model, 'work_phone', ['options' => ['class' => 'col-xs-4 padding-left0']])->widget(MaskedInput::className(), ['mask' => '999-999-9999', 'options' => ['class' => 'form-control', 'readonly' => $readonly]]); ?> <?php echo $form->field($model, 'cell_phone', ['options' => ['class' => 'col-xs-4 padding-right0']])->widget(MaskedInput::className(), ['mask' => '999-999-9999', 'options' => ['class' => 'form-control', 'readonly' => $readonly]]); ?> <?php echo $form->field($model, 'home_phone', ['options' => ['class' => 'col-xs-4 padding-right0']])->widget(MaskedInput::className(), ['mask' => '999-999-9999', 'options' => ['class' => 'form-control', 'readonly' => $readonly]]);
use common\models\State; /** * @var yii\web\View $this * @var common\models\City $model * @var yii\widgets\ActiveForm $form */ ?> <div class="city-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'stateId')->dropDownList(ArrayHelper::merge(['' => 'Select'], ArrayHelper::map(\common\models\State::find()->andWhere(['status' => 1])->All(), 'Id', 'name'))); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => 255]); ?> <?php echo $form->field($model, 'cityStdCode')->textInput(); ?> <?php echo $form->field($model, 'status')->hiddenInput(['value' => 1])->label(''); /* <?= $form->field($model, 'alias')->textInput(['maxlength' => 100]) ?> <?= $form->field($model, 'createdOn')->textInput() ?>
public function getState() { return $this->hasOne(State::className(), ['id_state' => 'address_state']); }