public function view() { //get the uploaded regions //TODO(blessed): Get details from selected invoice //asset id /* $asset_id = $this->input->get('ass_id'); //main asset details $asset_details = $this->assets->getAsset(); foreach($asset_details as $row){ $asset_name = $row->ass_name; $ass_ref = $row->ass_ref; $ass_description = $row->ass_description; } */ //Setup PDF Doc details: // Title // Filename // Orientation $doc_title = 'Ads2Trade - Invoice # ' . $ass_ref . ' - ' . $ass_description; //TODO(blessed): Get details from selected Asset $doc_name = 'Auction_Invoice_' . $ass_ref; $doc_orientation = 'P'; //Load HTML doc $data = array(); $doc_html = $this->load->view('view_invoice', $data, true); //make PDF echo $doc_html; exit; make_pdf($doc_html, $doc_name, $doc_title, $doc_orientation); }
public function index() { $data = array(); $html = $this->load->view('spec_sheet_new', $data, true); //$html = ''; //make_pdf helper from tcpdf_helper that used the Pdf library (custom extension of tcpdf) make_pdf($html, 'Asset_Specsheet', 'Ads2Trade - Asset Specsheet #600', 'L'); //echo $html; }
// FOOTER $html .= "~~~~<br />\n <footer>\n File created with <strong>elabFTW</strong> -- Free open source lab manager<br />\n <a href='http://www.elabftw.net'>eLabFTW.net</a>\n </footer>"; $html .= "</section></body></html>"; // CREATE TXT FILE // utf8 ftw $html = utf8_encode($html); // add header for utf-8 $html = "" . $html; $txtfile = 'uploads/export/' . 'elabftw-' . uniqid(); $tf = fopen($txtfile, 'w+'); fwrite($tf, $html); fclose($tf); // add html file $zip->addFile($txtfile, $folder . "/" . $clean_title . ".html"); // add a PDF, too $pdfname = make_pdf($id, $table, 'uploads/export'); $zip->addFile('uploads/export/' . $pdfname, $folder . "/" . $pdfname); // delete files //unlink($txtfile); //unlink('/tmp/'.$pdfname); } // end foreach $zip->close(); // PAGE BEGIN echo "<div class='item'>"; // Get zip size $zipsize = filesize($zipfile); // Get the title if there is only one experiment in the zip if (count($id_arr) === 1) { $zipname = $date . "-" . $clean_title; }
/******************************************************************************** * This file is part of eLabFTW. * * * * eLabFTW is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * * published by the Free Software Foundation, either version 3 of * * the License, or (at your option) any later version. * * * * eLabFTW is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied * * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * * PURPOSE. See the GNU Affero General Public License for more details. * * * * 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'; // 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 in the URL isn't a valid experiment ID"); } // check the type if ($_GET['type'] === 'experiments' || $_GET['type'] === 'items') { $type = $_GET['type']; } // do the pdf make_pdf($id, $type);
public function spec_sheet($asset_name = "", $asset_ref = "", $asset_description = "") { //get the uploaded regions $asset_id = $this->input->get('ass_id'); redirect(site_url('auctions/spec_sheet/?ass_id=' . $asset_id)); exit; //TODO(blessed): Get details from selected Asset //Setup PDF Doc details: // Title // Filename // Orientation $doc_title = 'Ads2Trade - Asset Specsheet #' . $ass; //TODO(blessed): Get details from selected Asset $doc_name = 'Asset_Specsheet'; $doc_orientation = 'L'; //Load HTML doc //$data = array();echo $doc_title. $doc_name . $doc_orientation; exit; $doc_html = $this->load->view('spec_sheet_new', $data, true); //make PDF make_pdf($doc_html, $doc_name, $doc_title, $doc_orientation); }
public function spec_sheet_list($asset_name = "", $asset_ref = "", $asset_description = "") { //asset id $asset_ids = $this->input->get('asset_ids'); //Setup PDF Doc details: // Title // Filename // Orientation $doc_title = 'Ads2Trade - Asset Specsheet Summaries '; $doc_name = 'Ads2trade_Specsheet_Summary_' . date('Ymd_hjs'); $doc_orientation = 'L'; //Load HTML doc $data = array(); $doc_html = $this->load->view('spec_sheet_list_summary', $data, true); //echo $doc_html; //make PDF make_pdf($doc_html, $doc_name, $doc_title, $doc_orientation); }