コード例 #1
0
         $nb = max($nb, nbLines($table_col_width[2], $record['pw']));
         $h = 5 * $nb;
         //Page break needed?
         checkPageBreak($h);
         //Draw cells
         $pdf->SetFont('helvetica', '', 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, $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>"}]';
 }
コード例 #2
0
ファイル: export.queries.php プロジェクト: br0ziliy/TeamPass
         $nb = max($nb, nbLines($table_col_width[2], $record['pw']));
         $h = 5 * $nb;
         //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>"}]';
 }
コード例 #3
0
             checkPageBreak($h);
             //Draw cells
             $pdf->SetFont('DejaVu', '', 9);
             for ($i = 0; $i < count($item); $i++) {
                 $w = $table_col_width[$i];
                 $a = 'L';
                 //actual position
                 $x = $pdf->GetX();
                 $y = $pdf->GetY();
                 //Draw
                 $pdf->Rect($x, $y, $w, $h);
                 //Write
                 if ($i == 3) {
                     $item[$i] = html_entity_decode(htmlspecialchars_decode(str_replace("<br />", "\n", $item[$i]), ENT_QUOTES));
                 }
                 $pdf->MultiCell($w, 5, $item[$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', implode(';', $printed_ids), $_SESSION['user_id']);
     echo '[{"text":"<a href=\'' . $_SESSION['settings']['url_to_files_folder'] . '/' . $pdf_file . '\' target=\'_blank\'>' . $LANG['pdf_download'] . '</a>"}]';
 }
 break;