Example #1
0
 public function guardar($codigo)
 {
     $path = getcwd();
     if (!is_dir(realpath("{$path}/archivos/presupuestos"))) {
         mkdir("{$path}/archivos/presupuestos", 0755);
     }
     $presupuesto = new Presupuesto_model();
     $presupuesto->datos($codigo);
     $path = str_replace('http://localhost', realpath(__DIR__ . '/../../../'), $presupuesto->ruta($codigo));
     $datos_lineas = $this->LineasPresupuesto->obtener($codigo);
     $pdf = new Presupuestopdf();
     $pdf->SetMargins(20, 25, 30);
     $pdf->SetAutoPageBreak(true, 25);
     $pdf->AliasNbPages();
     $pdf->AddPage();
     $pdf->SetFont('Times', '', 12);
     $pdf->datos_presupuesto($presupuesto);
     $pdf->honorarios($datos_lineas);
     $pdf->Output($path, 'F');
 }