/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = TblUnidades::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, 'id_institucion' => $this->id_institucion, 'padre' => $this->padre, 'haber_basico' => $this->haber_basico]); $query->andFilterWhere(['like', 'descrip', $this->descrip])->andFilterWhere(['like', 'cite', $this->cite])->andFilterWhere(['like', 'nombre_cargo', $this->nombre_cargo])->andFilterWhere(['like', 'categoria', $this->categoria])->andFilterWhere(['like', 'estado_cargo', $this->estado_cargo])->andFilterWhere(['like', 'clasificacion', $this->clasificacion]); return $dataProvider; }
public static function getItem($id) { return TblUnidades::findOne($id); }
/** * @return \yii\db\ActiveQuery */ public function getIdUnidad() { return $this->hasOne(TblUnidades::className(), ['id' => 'id_unidad']); }
">Nueva Funcionario</h3> </div> <!-- /.box-header --> <div class="box-body"> <div class="tbl-funcionario-form"> <div class="row"> <?php if ($model->isNewRecord) { ?> <div class="col-md-6"><?php echo $form->field($model, 'id_unidad')->dropDownList(ArrayHelper::map(TblUnidades::find()->all(), 'id', 'descrip'), ["class" => "form-control", 'ng-change' => "onChangeUnidad()", "ng-model" => "unidad"]); ?> </div> <div class="col-md-6"><label class="control-label" >Item #:<div data-ng-bind-html='item'></div></label></div> <?php } ?> </div> <div class="row"> <div class="col-md-6"><?php echo $form->field($model, 'fech_ingreso')->textInput(["data-inputmask=" => "'alias':'yyyy/mm/dd'"]); ?> </div> <div class="col-md-6"><?php
/** * Updates an existing TblFuncionario model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id * @return mixed */ public function actionUpdate($id) { $model = $this->findModel($id); //$model = new TblFuncionario(); $modelp = TblPersona::findOne($model->id); $m = TblUsuario::findOne($model->id); $modelu = new SignupForm(); $modelu->username = $m->nom_usuario; $use = User::findByUsername($m->nom_usuario); //$modelu->email=$use->email; $modelu->password = ""; $modelu->repeatpassword = ""; $modelu->isNewRecord = false; //$modelp = new TblPersona(); //$modelu = new SignupForm(); $unidad = $model->id_unidad; if ($model->load(Yii::$app->request->post()) && $modelp->load(Yii::$app->request->post())) { //"TblPersona[imageFile]" if (isset($_FILES["TblPersona"]["name"]["imageFile"]) && $_FILES["TblPersona"]["name"]["imageFile"] != "") { //echo "sube"; $modelp->imageFile = UploadedFile::getInstance($modelp, 'imageFile'); } if ($model->validate() && $modelp->validate()) { $connection = \Yii::$app->db; $transaction = $connection->beginTransaction(); try { $modelp->save(); //print_r($_FILES["TblPersona"]["name"]["imageFile"]); //echo Yii::$app->request->post()["TblPersona"]["imageFile"]."-----"; if (isset($_FILES["TblPersona"]["name"]["imageFile"]) && $_FILES["TblPersona"]["name"]["imageFile"] != "") { $modelp->imageFile = UploadedFile::getInstance($modelp, 'imageFile'); $dir = md5($modelp->id) . '.png'; unlink("images/face/" . $dir); // $modelp->imageFile->saveAs("images/face/".$dir); $modelp->dir_foto = $dir; //echo "save=". $modelp->imageFile->saveAs("images/face/" . $dir); // echo "///////"; } //print_r($modelp); $modelp->imageFile = null; $modelp->update(); $model->id = $modelp->id; $model->antiguedad = 0; $model->estado = 1; if ($unidad != $model->id_unidad) { $model->item = TblUnidades::getItem($model->id_unidad)->item + 1; } $model->update(); $transaction->commit(); // $usuario->save(); return $this->redirect(['view', 'id' => $modelp->id]); echo "111"; } catch (Exception $e) { $transaction->rollback(); } } else { print_r($model); print_r($modelp); print_r($modelu); } } return $this->render('create', ['model' => $model, 'modelp' => $modelp, 'modelu' => $modelu]); /*if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('update', [ 'model' => $model, ]); http://www.compucalitv.com/the-last-of-us-ps3-espanol-latino-region-eur/ http://fxg9uc.1fichier.com http://h7r33i.1fichier.com http://otswke.1fichier.com http://yvbasi.1fichier.com http://uorq84.1fichier.com http://ysiawh.1fichier.com http://k2frgp.1fichier.com http://hsu45v.1fichier.com http://vj0npz.1fichier.com http://40vcjh.1fichier.com http://2k4tla.1fichier.com http://722p9i.1fichier.com http://btxauh.1fichier.com http://e5mp68.1fichier.com http://a9k1e5.1fichier.com http://a246z0.1fichier.com http://4ktf52.1fichier.com http://nb6czd.1fichier.com http://z6wtok.1fichier.com http://4afvec.1fichier.com http://3ybsgg.1fichier.com http://5f5rpo.1fichier.com http://r8dpbc.1fichier.com http://9jovwn.1fichier.com http://arzuhg.1fichier.com http://mzo1aj.1fichier.com http://91bla5.1fichier.com http://4g261d.1fichier.com http://de1w0g.1fichier.com http://wi7kv4.1fichier.com http://p2jj86.1fichier.com http://4cz42j.1fichier.com http://n9vwkf.1fichier.com http://daj7fa.1fichier.com http://u2h73z.1fichier.com http://gmd5uu.1fichier.com http://hvdmyq.1fichier.com http://cztmf3.1fichier.com http://8uttua.1fichier.com http://h6su78.1fichier.com http://mox6j2.1fichier.com http://6d8wrx.1fichier.com http://34eueb.1fichier.com http://mwo0xh.1fichier.com http://lh01w2.1fichier.com http://hjfq37.1fichier.com http://ewa7i9.1fichier.com http://15rfgg.1fichier.com http://a0qq8w.1fichier.com http://h81g0w.1fichier.com http://97w4kv.1fichier.com http://o76lp7.1fichier.com http://5r5g0q.1fichier.com http://2miaq3.1fichier.com http://2egxsy.1fichier.com http://wzscuv.1fichier.com http://071rw0.1fichier.com http://70hs34.1fichier.com http://fbu3e2.1fichier.com http://nddpky.1fichier.com http://1g13l0.1fichier.com http://i7qbow.1fichier.com http://711dfj.1fichier.com http://2fm6gu.1fichier.com http://jhyxvq.1fichier.com http://dab5p9.1fichier.com http://cwatwd.1fichier.com http://ed0exv.1fichier.com http://iuwzpb.1fichier.com http://lsvp2z.1fichier.com http://p3flj6.1fichier.com http://nat034.1fichier.com http://c66lnt.1fichier.com http://65yroj.1fichier.com }*/ }
/** * Finds the TblUnidades model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return TblUnidades the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = TblUnidades::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }