コード例 #1
0
ファイル: SiteController.php プロジェクト: rzamarripa/shabel
 public function actionSignup()
 {
     if (Yii::$app->user->identity->username == "zama") {
         $model = new SignupForm();
         $empleado = new Empleado();
         if ($model->load(Yii::$app->request->post()) && $empleado->load(Yii::$app->request->post())) {
             $empleado->estatus_did = 1;
             if ($empleado->validate() && $model->validate()) {
                 $empleado->save();
                 $model->empleado_did = $empleado->id;
                 if ($user = $model->signup()) {
                     if (Yii::$app->getUser()->login($user)) {
                         return $this->goHome();
                     }
                 }
             }
         }
         return $this->render('signup', ['model' => $model, 'empleado' => $empleado]);
     } else {
         return $this->goHome();
     }
 }
コード例 #2
0
ファイル: EmpleadoSearch.php プロジェクト: rzamarripa/shabel
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Empleado::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, 'estatus_did' => $this->estatus_did]);
     $query->andFilterWhere(['like', 'nombre', $this->nombre])->andFilterWhere(['like', 'apellidos', $this->apellidos])->andFilterWhere(['like', 'celular', $this->celular])->andFilterWhere(['like', 'puesto', $this->puesto])->andFilterWhere(['like', 'direccion', $this->direccion]);
     return $dataProvider;
 }
コード例 #3
0
ファイル: EmpleadoSearch.php プロジェクト: ppino/Cosecha
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Empleado::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(['empleado_id' => $this->empleado_id, 'rut' => $this->rut, 'telefono' => $this->telefono]);
     $query->andFilterWhere(['like', 'nombre', $this->nombre])->andFilterWhere(['like', 'apellido', $this->apellido]);
     return $dataProvider;
 }
コード例 #4
0
 public function actionImprimir()
 {
     // get your HTML raw content without any layouts or scrip
     $Empleado = Empleado::find()->all();
     $pdf = Yii::$app->pdf;
     $pdf->content = $this->renderPartial('_imprimir', ['Empleado' => $Empleado]);
     return $pdf->render();
 }
コード例 #5
0
ファイル: EmpleadoController.php プロジェクト: ppino/Cosecha
 /**
  * Finds the Empleado model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Empleado the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Empleado::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #6
0
ファイル: NotaVenta.php プロジェクト: rolion/ventacompra
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdEmpleado()
 {
     return $this->hasOne(Empleado::className(), ['Id' => 'id_empleado']);
 }
コード例 #7
0
ファイル: Empleados.php プロジェクト: rzamarripa/du
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEmpleado()
 {
     return $this->hasOne(Empleado::className(), ['id' => 'id']);
 }
コード例 #8
0
ファイル: Departamentos.php プロジェクト: rzamarripa/du
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEmpleado()
 {
     return $this->hasMany(Empleado::className(), ['departamento_did' => 'id']);
 }