Esempio n. 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = TblProfesiones::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]);
     $query->andFilterWhere(['like', 'profesion', $this->profesion]);
     return $dataProvider;
 }
Esempio n. 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdProfesion()
 {
     return $this->hasOne(TblProfesiones::className(), ['id' => 'id_profesion']);
 }
Esempio n. 3
0
echo $form->field($model, 'nit')->Input("number", ['maxlength' => true, 'min' => 666666]);
?>
</div>
                    </div>
                    <div class="row">
                        
                        
                    </div>
                   <?php 
//$form->field($model, 'id_profesion')->dropDownList(
//                                   ArrayHelper::map(TblProfesiones::find()->all(), 'id', 'profesion')
//                                 )//->textInput()
?>
                    <div class="input-group input-group-sm">
                        <?php 
echo $form->field($model, 'id_profesion')->dropDownList(ArrayHelper::map(TblProfesiones::find()->all(), 'id', 'profesion'), ["class" => "form-control", 'ng-model' => 'profesion']);
?>
                        
                        <span class="input-group-btn" style="float:right;top:55px;right:0px;position:absolute" >
                          <button type="button"  ui-sref="state1" data-backdrop="static" 
                          data-keyboard="false" data-toggle="modal" data-target="#myModal" 
                          style="position: absolute;bottom: 0px;" class="btn btn-info btn-flat">+</button>
                        </span>
                  </div>
                    <?php 
if ($model->isNewRecord) {
    echo $this->render('../site/signup', ['model' => $modelu, 'form' => $form]);
}
?>
                    <br>
 /**
  * Finds the TblProfesiones model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return TblProfesiones the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = TblProfesiones::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }