Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Requisicion::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, 'fecha_f' => $this->fecha_f, 'cliente_did' => $this->cliente_did, 'estatus_did' => $this->estatus_did, 'usuario_aid' => $this->usuario_aid, 'fechacreacion_ft' => $this->fechacreacion_ft]);
     $query->andFilterWhere(['like', 'folio', $this->folio])->andFilterWhere(['like', 'departamento', $this->departamento])->andFilterWhere(['like', 'comentarios', $this->comentarios]);
     return $dataProvider;
 }
Exemplo n.º 2
0
 public function actionImprimir($id)
 {
     // get your HTML raw content without any layouts or scripts
     $requisicion = Requisicion::find()->where('id = :id', ['id' => $id])->one();
     $detalleRequisicion = detalleRequisicion::find()->where('requisicion_did = :id', ['id' => $id])->all();
     $pdf = Yii::$app->pdf;
     $pdf->content = $this->renderPartial('_imprimir', ['detalleRequisicion' => $detalleRequisicion, 'requisicion' => $requisicion]);
     return $pdf->render();
 }