* * * You should have received a copy of the GNU Affero General Public * * License along with eLabFTW. If not, see <http://www.gnu.org/licenses/>. * * * ********************************************************************************/ require_once 'inc/common.php'; require_once ELAB_ROOT . 'inc/locale.php'; require_once ELAB_ROOT . 'vendor/autoload.php'; // Check id is valid and assign it to $id if (isset($_GET['id']) && is_pos_int($_GET['id'])) { $id = $_GET['id']; } else { die(_("The id parameter is not valid!")); } // check the type if ($_GET['type'] === 'experiments' || $_GET['type'] === 'items') { $type = $_GET['type']; } else { die(_("The type parameter is not valid.")); } // do the pdf $pdf = new \Elabftw\Elabftw\MakePdf($id, $type); $mpdf = new mPDF(); $mpdf->SetAuthor($pdf->author); $mpdf->SetTitle($pdf->title); $mpdf->SetSubject('eLabFTW pdf'); $mpdf->SetKeywords($pdf->tags); $mpdf->SetCreator('www.elabftw.net'); $mpdf->WriteHTML($pdf->content); $mpdf->Output($pdf->getFileName(), 'I');
for ($i = 0; $i < $filenb; $i++) { // add files to archive $zip->addFile('uploads/' . $long_name[$i], $folder . "/" . $real_name[$i]); } } // add PDF to archive $pdf = new \Elabftw\Elabftw\MakePdf($id, $table); $mpdf = new mPDF(); $mpdf->SetAuthor($pdf->author); $mpdf->SetTitle($pdf->title); $mpdf->SetSubject('eLabFTW pdf'); $mpdf->SetKeywords($pdf->tags); $mpdf->SetCreator('www.elabftw.net'); $mpdf->WriteHTML($pdf->content); $mpdf->Output($pdf->getPath(), 'F'); $zip->addFile($pdf->getPath(), $folder . '/' . $pdf->getFileName()); // add CSV file to archive $csvpath = make_unique_csv($id, $table); $zip->addFile($csvpath, $folder . "/" . $clean_title . ".csv"); // add the MANIFEST file that lists the files in archive $manifest = ""; for ($i = 0; $i < $zip->numFiles; $i++) { $manifest .= $zip->getNameIndex($i) . "\n"; } // add info about the creator + timestamp $manifest .= "Zip archive created by " . $users['firstname'] . " " . $users['lastname'] . " on " . date('Y.m.d') . " at " . date('H:i:s') . ".\n"; $manifest .= "~~~\neLabFTW - Free open source lab manager - http://www.elabftw.net\n"; // fix utf8 $manifest = utf8_encode($manifest); $manifest = "" . $manifest; $manifestpath = 'uploads/export/manifest-' . uniqid();