123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?php
- namespace pdf\controllers;
- use pdf\web\Controller;
- use v1\models\RecursoManifestacion;
- use v1\models\RecursoRevision;
- class RecursoRevisionController extends Controller {
- public function actionIndex() {
- $id = $this->req->get("id", "");
- $recurso = RecursoRevision::findOne($id);
- if (!$recurso) {
- throw new \yii\web\NotFoundHttpException("No se encontró el recurso de revisión");
- }
- return $this->renderPartial("formato", [
- "recurso" => $recurso,
- ]);
- }
- public function actionFormato() {
- //$request = \Yii::$app->request;
- $id = $this->req->get("id", "");
- $recurso = RecursoRevision::findOne($id);
- if (!$recurso) {
- throw new \yii\web\NotFoundHttpException("No se encontró el recurso de revisión");
- }
- $configuracion = [
- 'mode' => 'utf-8',
- 'format' => 'letter',
- 'margin_top' => '36',
- ];
- $view = new \yii\web\View();
- $htmlPDF = $view->render("@app/modules/pdf/views/recurso-revision/formato", [
- "recurso" => $recurso,
- ]);
- $header = $view->render("@app/modules/pdf/views/header/formato", [
- "titulo" => "FORMATO DE RECURSO DE REVISIÓN",
- ]);
- $pdf = self::crearPDF(
- 'RR-ISTAIAS-04',
- $htmlPDF,
- $configuracion,
- false,
- $header,
- "",
- ''
- );
- }
- public function actionManifiesto() {
- //$request = \Yii::$app->request;
- $id = trim($this->req->get("manifiesto", ""));
- $manifiesto = RecursoManifestacion::findOne($id);
- if (!$manifiesto) {
- throw new \yii\web\NotFoundHttpException("No se encontró el manifiesto de recurso de revisión");
- }
- $recurso = RecursoRevision::findOne($manifiesto->idRecurso);
- if (!$recurso) {
- throw new \yii\web\NotFoundHttpException("No se encontró el recurso de revisión");
- }
- $configuracion = [
- 'mode' => 'utf-8',
- 'format' => 'letter',
- 'margin_top' => '36',
- ];
- $view = new \yii\web\View();
- $htmlPDF = $view->render("@app/modules/pdf/views/recurso-revision/manifiesto", [
- "recurso" => $recurso,
- "manifiesto" => $manifiesto,
- ]);
- $header = $view->render("@app/modules/pdf/views/header/formato", [
- "titulo" => "FORMATO DE MANIFIESTO DE RECURSO DE REVISIÓN",
- ]);
- $pdf = self::crearPDF(
- 'RR-ISTAIAS-04',
- $htmlPDF,
- $configuracion,
- false,
- $header,
- "",
- ''
- );
- }
- }
|