IncompetenciaSujetoController.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace excel\controllers;
  3. use app\models\OficialiaPartesManifiestoDocumento;
  4. use pdf\web\Controller;
  5. use v1\models\FondoLegislativo;
  6. use v1\models\OficialiaPartesDocumento;
  7. use v1\models\OficialiaPartesDocumentoResponsable;
  8. use v1\models\OficialiaPartesManifiesto;
  9. use v1\models\RequisicionResponsable;
  10. use v1\models\Solicitud;
  11. use v1\models\Usuario;
  12. class IncompetenciaSujetoController extends Controller {
  13. public function actionIndex() {
  14. $idSolicitud = trim($this->req->get('solicitud', ''));
  15. $solicitud = null;
  16. if ($idSolicitud === '') {
  17. throw new \yii\web\NotFoundHttpException("No se encontró la solicitud");
  18. }
  19. $solicitud = Solicitud::find()
  20. ->andWhere(['id' => $idSolicitud])
  21. ->andWhere(['eliminado' => null])
  22. ->one();
  23. if ($solicitud === null) {
  24. throw new \yii\web\NotFoundHttpException("No se encontró la solicitud");
  25. }
  26. $request = \Yii::$app->request;
  27. $configuracion = [
  28. 'mode' => 'utf-8',
  29. 'format' => 'letter',
  30. 'margin_top' => '50',
  31. ];
  32. $view = new \yii\web\View();
  33. $htmlPDF = $view->render("@app/modules/pdf/views/incompetencia-sujeto/oficio", [
  34. "solicitud" => $solicitud,
  35. "recursoRevision" => [],
  36. ]);
  37. if ($request->get('header'))
  38. $header = $view->render("@app/modules/pdf/views/header/oficio-landing", [
  39. "titulo" => "ACUSE DE SOLICITUD DE INFORMACIÓN PÚBLICA",
  40. ]);
  41. else
  42. $header = $view->render("@app/modules/pdf/views/header/oficio", [
  43. "titulo" => "ACUSE DE SOLICITUD DE INFORMACIÓN PÚBLICA",
  44. ]);
  45. $pdf = self::crearPDF(
  46. 'AS-ISTAIAS-03',
  47. $htmlPDF,
  48. $configuracion,
  49. false,
  50. $header,
  51. '',
  52. ''
  53. );
  54. }
  55. }