Esempio n. 1
0
         //Page break needed?
         checkPageBreak($h);
         //Draw cells
         $pdf->SetFont('DejaVu', '', 9);
         for ($i = 0; $i < count($table); $i++) {
             $w = $table_col_width[$i];
             $a = 'L';
             //actual position
             $x = $pdf->GetX();
             $y = $pdf->GetY();
             //Draw
             $pdf->Rect($x, $y, $w, $h);
             //Write
             $pdf->MultiCell($w, 5, stripslashes($record[$table[$i]]), 0, $a);
             //go to right
             $pdf->SetXY($x + $w, $y);
         }
         //return to line
         $pdf->Ln($h);
     }
     $pdf_file = "print_out_pdf_" . date("Y-m-d", mktime(0, 0, 0, date('m'), date('d'), date('y'))) . "_" . generateKey() . ".pdf";
     //send the file
     $pdf->Output($_SESSION['settings']['path_to_files_folder'] . "/" . $pdf_file);
     //log
     logEvents('pdf_export', "", $_SESSION['user_id'], $_SESSION['login']);
     //clean table
     DB::query("TRUNCATE TABLE " . prefix_table("export"));
     echo '[{"text":"<a href=\'' . $_SESSION['settings']['url_to_files_folder'] . '/' . $pdf_file . '\' target=\'_blank\'>' . $LANG['pdf_download'] . '</a>"}]';
 }
 break;
 //CASE export in CSV format