/** * 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; }
/** * 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; }
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(); }