public function generateCodes(array $data) { $count = (int) $data['count']; $teacherId = $data['teacher_id']; $message = $data['message']; if (is_null($count) || is_null($teacherId)) { return false; } else { try { \DB::beginTransaction(); $teacher = Authenticator::user($teacherId); \PDF::setPrintHeader(false); \PDF::setPrintFooter(false); \PDF::AddPage(); for ($i = 0; $i < $count; $i++) { $code = $this->codeRepo->generateCode(); $data = array(); $data = array_add($data, 'student_code', $code); $data = array_add($data, 'teacher_id', $teacherId); $code = $this->codeRepo->create($data); $code->message = $message; $this->codeRepo->clearModel(); $html = View::make('pages.code')->with('code', $code)->render(); if ($i % 5 === 0 && $i !== 0) { \PDF::AddPage(); \PDF::writeHTML($html, false, false, false, false, 'L'); } else { \PDF::writeHTML($html, false, false, false, false, 'L'); } } \PDF::SetCreator(''); \PDF::SetAuthor(''); $format = '%s/%s.pdf'; $subpath = sprintf($format, 'pdfs', $teacherId); $format = '/%s/%s'; $fullpath = sprintf($format, public_path(), $subpath); \PDF::Output($fullpath, 'F'); \DB::commit(); return $subpath; } catch (\Exception $ex) { \Log::error($ex); \DB::rollback(); return false; } } }
/** * PDF Setup - WT_Report_PDF */ function setup() { parent::setup(); // Setup the PDF class with custom size pages because WT supports more page sizes. If WT sends an unknown size name then the default would be A4 $this->pdf = new PDF($this->orientation, parent::unit, array($this->pagew, $this->pageh), self::unicode, "UTF-8", self::diskcache); // Setup the PDF margins $this->pdf->setMargins($this->leftmargin, $this->topmargin, $this->rightmargin); $this->pdf->SetHeaderMargin($this->headermargin); $this->pdf->SetFooterMargin($this->footermargin); //Set auto page breaks $this->pdf->SetAutoPageBreak(true, $this->bottommargin); // Set font subsetting $this->pdf->setFontSubsetting(self::subsetting); // Setup PDF compression $this->pdf->SetCompression(self::compression); // Setup RTL support $this->pdf->setRTL($this->rtl); // Set the document information // Only admin should see the version number $appversion = WT_WEBTREES; if (Auth::isAdmin()) { $appversion .= " " . WT_VERSION; } $this->pdf->SetCreator($appversion . " (" . parent::wt_url . ")"); // Not implemented yet - WT_Report_Base::setup() $this->pdf->SetAuthor($this->rauthor); $this->pdf->SetTitle($this->title); $this->pdf->SetSubject($this->rsubject); $this->pdf->SetKeywords($this->rkeywords); $this->pdf->setReport($this); if ($this->showGenText) { // The default style name for Generated by.... is 'genby' $element = new CellPDF(0, 10, 0, "C", "", "genby", 1, ".", ".", 0, 0, "", "", true); $element->addText($this->generatedby); $element->setUrl(parent::wt_url); $this->pdf->addFooter($element); } }
$pdf_data['title'] = $clientObj->title(); $pdf_data['subtitle'] = "subtitle..."; $pdf_data['subsubtitle'] = "subsubtitle..."; $pdf_data['date'] = "date..."; $pdf_data['filename'] = "filename..."; //preg_replace("/[^0-9a-z\-_\.]/i",'', $myts->htmlSpecialChars($article->topic_title()).' - '.$article->title()); $pdf_data['content'] = $clientObj->description(); $pdf_data['author'] = "author..."; echo "test"; //Other stuff $puff = '<br />'; $puffer = '<br /><br /><br />'; //create the A4-PDF... $pdf_config['slogan'] = $xoopsConfig['sitename'] . ' - ' . $xoopsConfig['slogan']; $pdf = new PDF(); $pdf->SetCreator($pdf_config['creator']); $pdf->SetTitle($pdf_data['title']); $pdf->SetAuthor($pdf_config['url']); $pdf->SetSubject($pdf_data['author']); $out = $pdf_config['url'] . ', ' . $pdf_data['author'] . ', ' . $pdf_data['title'] . ', ' . $pdf_data['subtitle'] . ', ' . $pdf_data['subsubtitle']; $pdf->SetKeywords($out); $pdf->SetAutoPageBreak(true, 25); $pdf->SetMargins($pdf_config['margin']['left'], $pdf_config['margin']['top'], $pdf_config['margin']['right']); $pdf->Open(); //First page $pdf->AddPage(); $pdf->SetXY(24, 25); $pdf->SetTextColor(10, 60, 160); $pdf->SetFont($pdf_config['font']['slogan']['family'], $pdf_config['font']['slogan']['style'], $pdf_config['font']['slogan']['size']); $pdf->WriteHTML($pdf_config['slogan'], $pdf_config['scale']); //$pdf->Image($pdf_config['logo']['path'],$pdf_config['logo']['left'],$pdf_config['logo']['top'],$pdf_config['logo']['width'],$pdf_config['logo']['height'],'',$pdf_config['url']);
function Footer() { //Position at 1.5 cm from bottom $this->SetY(-15); //Arial italic 8 $this->SetFont('Arial', 'I', 8); //Page number $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C'); } } $pdf = new PDF('L', $unit = 'mm', $format = 'A4'); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Daily Sales"); $pdf->SetTitle("Daily Sales"); $pdf->SetCreator("Imran Zahid"); $prop = array('color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'color3' => array(128, 128, 128), 'padding' => 2, 'font' => array('Arial', '', 10), 'thfont' => array('Arial', 'B', 10)); $pdf->AddPage(); $pdf->AddCol('party_name', "20%", 'Party', 'L'); $pdf->AddCol('vendor', "20%", 'Vendor', 'L'); $pdf->AddCol('cat_name', "20%", 'Category', 'L'); $pdf->AddCol('description', "20%", 'Item', 'L'); $pdf->AddCol("cs", "10%", 'CS', 'R'); $pdf->AddCol("pc", "10%", 'PC', 'R'); $pdf->Table($data, $prop); $_cMargin = $pdf->cMargin; $pdf->cMargin = $prop['padding']; $pdf->SetFont('Arial', 'B', 10); $pdf->Cell(221.59806666667, 6, "Total", 1, 0, 'C'); $pdf->Cell(27.69975833333, 6, $totals['cs'], 1, 0, 'R'); $pdf->Cell(27.69975833333, 6, $totals['pc'], 1, 0, 'R');
public function basket() { $this->start = $this->input->get('start'); $this->end = $this->input->get('end'); $this->view = ""; if (isset($_GET['view']) && $_GET['view'] != "") { $this->view = pnp::clean($_GET['view']); } $this->data->getTimeRange($this->start, $this->end, $this->view); $basket = $this->session->get("basket"); if (is_array($basket) && sizeof($basket) > 0) { foreach ($basket as $item) { # explode host::service::source $slices = explode("::", $item); if (sizeof($slices) == 2) { $this->data->buildDataStruct($slices[0], $slices[1], $this->view); } if (sizeof($slices) == 3) { $this->data->buildDataStruct($slices[0], $slices[1], $this->view, $slices[2]); } } } //echo Kohana::debug($this->data->STRUCT); /* * PDF Output */ $pdf = new PDF(); $pdf->AliasNbPages(); $pdf->SetAutoPageBreak('off'); $pdf->SetMargins(17.5, 30, 10); $pdf->AddPage(); if ($this->use_bg) { $pdf->setSourceFile($this->config->conf['background_pdf']); $tplIdx = $pdf->importPage(1, '/MediaBox'); $pdf->useTemplate($tplIdx); } $pdf->SetCreator('Created with PNP'); $pdf->SetFont('Arial', '', 10); // Title foreach ($this->data->STRUCT as $data) { if ($pdf->GetY() > 200) { $pdf->AddPage(); if ($this->use_bg) { $pdf->useTemplate($tplIdx); } } if ($data['LEVEL'] == 0) { $pdf->SetFont('Arial', '', 12); $pdf->CELL(120, 10, $data['MACRO']['DISP_HOSTNAME'] . " -- " . $data['MACRO']['DISP_SERVICEDESC'], 0, 1); $pdf->SetFont('Arial', '', 10); $pdf->CELL(120, 5, $data['TIMERANGE']['title'] . " (" . $data['TIMERANGE']['f_start'] . " - " . $data['TIMERANGE']['f_end'] . ")", 0, 1); $pdf->SetFont('Arial', '', 8); $pdf->CELL(120, 5, "Datasource " . $data["ds_name"], 0, 1); } else { $pdf->SetFont('Arial', '', 8); $pdf->CELL(120, 5, "Datasource " . $data["ds_name"], 0, 1); } $image = $this->rrdtool->doImage($data['RRD_CALL'], $out = 'PDF'); $img = $this->rrdtool->saveImage($image); $Y = $pdf->GetY(); $cell_height = $img['height'] * 0.23; $cell_width = $img['width'] * 0.23; $pdf->Image($img['file'], 17.5, $Y, $cell_width, $cell_height, 'PNG'); $pdf->CELL(120, $cell_height, '', 0, 1); unlink($img['file']); } $pdf->Output("pnp4nagios.pdf", "I"); }
$logger->write('Found ' . $products_total . ' products >1 star'); while ($row = tep_db_fetch_array($result)) { $row['fmargin'] = number_format($row['margin'], 1) . '%'; $row['weekly'] = array(); $row['total_sold_L4W'] = 0; foreach ($weekly_name as $wkey => $wn) { $row['weekly'][$wkey] = getOrderWeekly($row['products_id'], $wkey, $filter_date, $sp_list); $row['total_sold_L4W'] += $row['weekly'][$wkey]['total_sold']; } $products[$row['catid']][$row['products_id']] = $row; } $logger->write('Creating PDF File'); $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('Sales Report Weekly Products'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('Manobo PDF Generator'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(true, 25); $pdf->AliasNbPages(); $pdf->AddPage('L'); $margin = 30; $ypos = 10; $cellstart = $margin; $cellsize = 48; $cellsize_half = $cellsize / 2; $cellsizecollweek = $cellsize + $margin; $cell_height_col = 55; $cell_height = 5; $pdf->setXY($margin, $ypos); $pdf->setFont('Arial', 'B', '14'); $pdf->cell(240, 5, 'SALES REPORT WEEKLY PRODUCT KW ' . date('W') . ' (' . date('d.m.Y', strtotime($filter_date)) . ')', 0, 0, 'C');
function format($text) { include_once 'lib/Template.php'; global $request; $tokens['page'] = $this->_page; $tokens['CONTENT'] = $this->_transform($text); $pagename = $this->_page->getName(); // This is a XmlElement tree, which must be converted to PDF // We can make use of several pdf extensions. This one - fpdf // - is pure php and very easy, but looks quite ugly and has a // terrible interface, as terrible as most of the othes. // The closest to HTML is htmldoc which needs an external cgi // binary. // We use a custom HTML->PDF class converter from PHPWebthings // to be able to use templates for PDF. require_once 'lib/fpdf.php'; require_once 'lib/pdf.php'; $pdf = new PDF(); $pdf->SetTitle($pagename); $pdf->SetAuthor($this->_page->get('author')); $pdf->SetCreator(WikiURL($pagename, false, 1)); $pdf->AliasNbPages(); $pdf->AddPage(); //TODO: define fonts $pdf->SetFont('Times', '', 12); //$pdf->SetFont('Arial','B',16); // PDF pagelayout from a special template $template = new Template('pdf', $request, $tokens); $pdf->ConvertFromHTML($template); // specify filename, destination $pdf->Output($pagename . ".pdf", 'I'); // I for stdin or D for download // Output([string name [, string dest]]) return $pdf; }
$c2x = $c1x + $w; $c3x = $c2x + $w; $c4x = $c3x + $w; $c1h = 170; $c2h = $c1h / 2; $c3h = $c2h / 2; $c4h = $c3h / 2; $bottom = $top + $c1h; $pdf = new PDF('L', 'mm', 'Letter'); $pdf->Open(); $pdf->SetTopMargin(13); $pdf->SetLeftMargin(13); $pdf->SetRightMargin(10); $pdf->SetAutoPageBreak(True, 13); $pdf->AddPage(); $pdf->SetCreator($_SERVER["PHP_SELF"]); $pdf->SetAuthor("Keith Morrison, keithm@infused.org"); $pdf->SetTitle(sprintf(gtc("Pedigree for %s"), $o->full_name())); $pdf->SetSubject(gtc("Genealogy")); # Person 1 $pdf->SetY($top); $pdf->SetX($c1x); $pdf->Cell($w, $c1h, '', 1, 0, 'L'); $pdf->SetY($top + $c1h / 2 - 6); $pdf->SetX($c1x); $pdf->SetFont($font, 'B', 10); $pdf->MultiCell($w, 4, isset($g_node_strings[1][0]) ? $g_node_strings[1][0] : '', 0, 'L'); $pdf->SetFont($font, '', 10); $pdf->Cell($w, 4, isset($g_node_strings[1][1]) ? $g_node_strings[1][1] : '', 0, 2, 'L'); $pdf->Cell($w, 4, isset($g_node_strings[1][2]) ? $g_node_strings[1][2] : '', 0, 0, 'L'); # Person 2
*/ include_once "../includes/default.inc.php"; $auth->is_authenticated(); include_once 'bookingclass.inc.php'; $booking = new Booking(); $bookid = $request->GetVar('bookid', 'get'); $bookdata = $booking->getMeldedata($bookid); define('FPDF_FONTPATH', $fontpath); include_once 'fpdf.php'; include_once 'pdf.php'; $fonttype = 'times'; $pdf = new PDF(); $pdf->Open(); $pdf->SetTitle('ZVS Meldeschein'); $pdf->SetAuthor($request->GetVar('hotel_name', 'session')); $pdf->SetCreator('ZVS'); $pdf->AliasNbPages(); $pdf->AddPage(P); $pdf->ln(5); $y = $pdf->GetY(); // Address $pdf->SetFont($fonttype, 'B', 10); $pdf->Write(5, $request->GetVar('hotel_name', 'session')); $pdf->ln(4); $pdf->SetFont($fonttype, '', 10); $pdf->Write(5, $request->GetVar('hotel_street', 'session')); $pdf->ln(4); $pdf->SetFont($fonttype, '', 10); $pdf->Write(5, $request->GetVar('hotel_zip', 'session') . " " . $request->GetVar('hotel_city', 'session')); // Headline $pdf->SetXY(120, $y);
//Rodapé do Relatório function Footer() { $usuarioNome = $_GET['UsuarioNome']; //Posiciona a 1.5 cm do final $this->SetY(-15); //Arial italico 8 $this->SetFont('Arial', 'I', 7); $this->Line(10, 281, 200, 281); $this->Cell(100, 3, 'Emitido por: ' . $usuarioNome); } } //Instancia a classe gerador de pdf $pdf = new PDF(); //Define os atributos de propriedade do arquivo PDF $pdf->SetCreator('work | eventos - CopyRight(c) - Desenvolvido por Work Labs Tecnologia - www.worklabs.com.br'); $pdf->SetAuthor($usuarioNome . ' - ' . $empresaNome); $pdf->SetTitle('Planilha Controle de Foto e Vídeo do Evento'); $pdf->SetSubject('Relatório gerado automaticamente pelo sistema'); $pdf->AliasNbPages(); //Cria a página do relatório $pdf->AddPage('L'); //verifica os formandos já cadastrados para este evento $sql_formando = mysql_query("SELECT \n\t form.id, \n\t form.evento_id,\n\t form.nome,\n\t form.contato,\n\t form.operadora,\n\t form.telefone_comercial,\n\t form.telefone_residencial,\n\t form.endereco,\n\t form.complemento,\n\t form.bairro,\n\t form.cep,\n\t form.cpf,\n\t form.uf,\n\t form.email,\n\t form.observacoes,\n\t cid.nome AS cidade_nome,\n\t cid.uf AS cidade_uf,\n\t eve.nome AS evento_nome\n FROM \n \teventos_formando form\n LEFT OUTER JOIN \n \teventos eve ON eve.id = form.evento_id\n LEFT OUTER JOIN \n \tcidades cid ON cid.id = form.cidade_id\n WHERE \n \tform.status = 2 \n\t {$where_cidade}\n\t {$where_uf}\n\t {$where_datas}\n AND \n \tform.status_fotovideo = 1\n AND\n \teve.foto_video_liberado = 1\n ORDER BY \n \tform.nome"); //Verifica o numero de registros retornados $registros = mysql_num_rows($sql_formando); //Verifica a quantidade de registros if ($registros == 0) { //Exibe a mensagem que não foram encontrados registros $pdf->ln(12); $pdf->SetFont('Arial', 'B', 9);
//Arial italic 8 $this->SetFont('Arial', 'I', 8); //Page number //$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C'); $this->SetX($this->lMargin); $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L'); $this->SetX($this->lMargin); $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R'); } } $pdf = new PDF('P'); $pdf->AliasNbPages(); $pdf->SetAuthor("*****@*****.**"); $pdf->SetSubject("Party Contact"); $pdf->SetTitle("Party Contact"); $pdf->SetCreator("Khurram Naseem"); $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 1, 'formatNumber' => TRUE, 'formatNumberDecimal' => 0, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10)); $pdf->AddPage(); foreach ($data as $vid => $d) { //$vehicle = $d['Rank']; $pdf->AddCol('party_name', '20%', '', 'L'); $pdf->AddCol('party_address', '25%', '', 'L'); $pdf->AddCol('Phone1', '10%', '', 'L'); $pdf->AddCol('Phone2', '10%', '', 'L'); $pdf->AddCol('Cell', '10%', '', 'L'); $pdf->AddCol('contact_person', '12%', '', 'L'); $pdf->AddCol('vehicle_name', '13%', '', 'L'); $pdf->Table($d['data'], $prop, TRUE, FALSE); } $pdf->Output("party_contact.pdf", "D"); } else {
//Ajusta a fonte $this->SetFont('Arial', '', 9); $this->Cell(0, 4, date('d/m/Y', mktime()), 0, 0, 'R'); $this->Ln(); $this->SetFont('Arial', '', 10); $this->Cell(0, 4, 'Emissão do Formulário de AR', 0, 0, 'L'); //Imprime o logotipo da empresa $this->Image('../image/logo_correios.jpg', 9, 70, 40); //Line break $this->Ln(6); } } //Instancia a classe gerador de pdf $pdf = new PDF(); //Define os atributos de propriedade do arquivo PDF $pdf->SetCreator('work | eventos - CopyRight(c) - Desenvolvido por Work Labs - maycon@worklabs.com.br'); $pdf->SetAuthor($usuarioNome . " - " . $empresaNome); $pdf->SetTitle('Formulário de AR'); $pdf->SetSubject('Relatório gerado automaticamente pelo sistema'); $pdf->AliasNbPages(); //Cria a página do relatório $pdf->AddPage(); //Busca os dados da pessoa conforme o tipo de pessoa informado //Verifica se é formando if ($TipoPessoa == 1) { //verifica os formandos já cadastrados para este evento $sql_formando = mysql_query("SELECT \n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.nome,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.cpf,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.endereco,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.complemento,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.bairro,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.uf,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.cep,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tform.observacoes,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tcid.nome as cidade_nome\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM eventos_formando form\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tLEFT OUTER JOIN cidades cid ON cid.id = form.cidade_id\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE form.id = {$PessoaId}"); //Verifica o numero de registros retornados $registros = mysql_num_rows($sql_formando); //Verifica a quantidade de registros if ($registros == 0) {
//Recupera os valores para filtragem $MusicaId = $_GET["MusicaId"]; //Recupera dos dados da musica $sql_musica = "SELECT * FROM musicas WHERE id = '{$MusicaId}'"; //Executa a query de consulta $query_musica = mysql_query($sql_musica); //Monta a matriz com os dados $dados_musica = mysql_fetch_array($query_musica); //Chama a classe para gerar o PDF class PDF extends FPDF { } //Instancia a classe gerador de pdf $pdf = new PDF(); //Define os atributos de propriedade do arquivo PDF $pdf->SetCreator('work | eventos - CopyRight(c) - Desenvolvido por Maycon Edinger - workeventos@gmail.com'); $pdf->SetAuthor($usuarioNome . " - " . $empresaNome); $pdf->SetTitle('Impressão da Música'); $pdf->SetSubject('Relatório gerado automaticamente pelo sistema'); $pdf->AliasNbPages(); //Cria a página do relatório $pdf->AddPage(); //Nova linha //$pdf->ln(); $pdf->SetFont('Arial', 'B', 15); $pdf->Cell(0, 7, $dados_musica['nome'], 'T', 0, 'L'); //Nova linha $pdf->ln(); $pdf->SetFont('Arial', 'B', 11); $pdf->MultiCell(0, 4, $dados_musica['interprete'], 'B'); //Nova linha
function createPDF($ignoreStockStatusDepot = false, $output = 'D', $add_to_daily_statistic = false, $print_per_orders = true) { /* OUTPUT : D -> WILL PRODUCE ONE PDF FOR ALL ORDERS WITH ITEMS IN IT OUTPUT : F -> WILL PRODUCE MULTI PDF PER ORDER ITEMS */ global $class_jo, $class_o, $class_do; $pi_printed_jg = array(); $pi_printed_sp = array(); $pi_printed_dp = array(); if ($output == 'D') { //PRODUCE SINGLE PDF FILE $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('Production Instruction'); $pdf->SetAuthor('JULIE GRACE / Bonofactum'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(false); $pdf->AliasNbPages(); $pdf->SetFillColor(191, 191, 191); } $item_printed = 0; $oiid_last_printed = ''; /* Moved this on function constructPIContent and replace using below $print_per_orders, * so eventhough we use $output='F' we still could create pi which consists of collection of orders */ //foreach($this->orders as $order) { // $o = $order['detail']; // foreach($order['items'] as $oiid=>$i) { // if($i['status']<8) $this->pi_printed[strtolower($o['type'])][] = $oiid; // //if($i['status']<8) ${'pi_printed_'.strtolower($o['type'])}[] = $oiid; // $this->constructPIContent($pdf, $output, $order, $oiid, $ignoreStockStatusDepot, $print_per_orders); // $item_printed++; // $oiid_last_printed = $oiid; // } //} if ($print_per_orders) { foreach ($this->orders as $order) { $this->constructPIContent($pdf, $output, $order, $ignoreStockStatusDepot, true); $item_printed++; } } else { $this->constructPIContent($pdf, $output, $this->orders, $ignoreStockStatusDepot, false); } #PI Print Counter if (count($this->pi_printed['sp']) > 0) { $class_jo->printCountAdd($this->pi_printed['sp']); } if (count($this->pi_printed['jg']) > 0) { $class_o->printCountAdd($this->pi_printed['jg']); } if (count($this->pi_printed['dp']) > 0) { $class_do->printCountAdd($this->pi_printed['dp']); } /* D: Download; F: Save File on Server */ if ($output == 'D') { $infix = ''; //$infix = count($this->orders)>1 ? '' : strtoupper($o['type']).'O'.$o['id'].'-'; //if($item_printed==1) $infix = strtoupper($o['type']).'-'.$oiid_last_printed.'-'; if ($item_printed == 1) { $infix = array_keys($this->orders); $infix = $infix[0] . '-'; } $filename = 'PI-' . $infix . date('YmdHi'); $pdf->Output($filename . '.pdf', $output); //$pdf->Output($filename.'.pdf','D'); } if ($add_to_daily_statistic) { $pt = new production_target(); $timestamp = date('Y-m-d H:i:s'); if ($this->qty_total_first_printed > 0) { $pt->addDataToField($timestamp, 'start', $this->qty_total_first_printed); } } }
//Rodapé do Relatório function Footer() { $usuarioNome = $_GET["UsuarioNome"]; //Posiciona a 1.5 cm do final $this->SetY(-15); //Arial italico 8 $this->SetFont("Arial", "I", 7); $this->Line(10, 281, 200, 281); $this->Cell(0, 3, "Emitido por: " . $usuarioNome); } } //Instancia a classe gerador de pdf $pdf = new PDF(); //Define os atributos de propriedade do arquivo PDF $pdf->SetCreator("*****@*****.**"); $pdf->SetAuthor($usuarioNome . " - " . $empresaNome); $pdf->SetTitle("Detalhamento do colaborador"); $pdf->SetSubject("Relatório gerado automaticamente pelo sistema"); $pdf->AliasNbPages(); $pdf->AddPage(); //Verifica se há uma foto definida para o colaborador if ($dados_conta["foto"] != "") { $caminho_foto = "../imagem_colaborador/{$dados_conta['foto']}"; //Imprime a foto do colaborador $pdf->Image($caminho_foto, 167, 30, 32, 43); } $pdf->SetY(25); $pdf->SetFont("Arial", "B", 10); $pdf->SetFillColor(178, 178, 178); $pdf->Cell(0, 6, "Detalhamento do Colaborador", 1, 0, "C", 1);
$pdf->Cell(20, $height, $keynum, 1, 0, 'C', false); $pdf->Cell($width, $height, _get_key_label($knump), $border, 0, 'C', $fill); # Spalte 2 $knump = str_pad($knum + 14, 4, '0', STR_PAD_LEFT); $pdf->Cell($width, $height, _get_key_label($knump), $border, 0, 'C', !$fill); $pdf->Cell(20, $height, $keynum + 14, 1, 0, 'C', false); # Spalte 3 $knump = str_pad($knum + 28, 4, '0', STR_PAD_LEFT); $pdf->Cell(20, $height, $keynum + 28, 1, 0, 'C', false); $pdf->Cell($width, $height, _get_key_label($knump), $border, 0, 'C', $fill); # Spalte 4 $knump = str_pad($knum + 42, 4, '0', STR_PAD_LEFT); $pdf->Cell($width, $height, _get_key_label($knump), $border, 0, 'C', !$fill); $pdf->Cell(20, $height, $keynum + 42, 1, 0, 'C', false); } $pdf->Ln(); } $fill = !$fill; } if ($phone_layout === 'snom' && $key_level_idx == 2) { $pdf->AddPage(); } if ($phone_layout === 'grandstream' && $key_level_idx < 2) { $pdf->AddPage(); } } } } $pdf->SetCreator('Gemeinschaft'); $pdf->SetAuthor('Gemeinschaft'); $pdf->Output(__('Tastenbeschriftung') . '_' . $phone_type . '_' . $user_name . '.pdf', 'D');
function run() { // change some win codes, and xhtml into html $str = array('<br />' => '<br>', '<hr />' => '<hr>', '[r]' => '<red>', '[/r]' => '</red>', '[l]' => '<blue>', '[/l]' => '</blue>', '“' => '"', '”' => '"', '„' => '"', '…' => '...', '’' => '\''); foreach ($str as $_from => $_to) { $this->html = str_replace($_from, $_to, $this->html); } $pdf = new PDF('P', 'mm', 'A4', $this->title, $this->articleurl, false); $pdf->Open(); $pdf->SetCompression(true); $pdf->SetCreator("Script by Radek HULAN, http://hulan.info/blog/"); $pdf->SetDisplayMode('real'); $pdf->SetTitle($this->_convert($this->title)); $pdf->SetAuthor($this->articleurl); $pdf->AddPage(); // face $pdf->PutMainTitle($this->_convert($this->title)); $pdf->PutMinorHeading('Article URI'); $pdf->PutMinorTitle($this->articleurl, $this->articleurl); $pdf->PutMinorHeading('Author'); $pdf->PutMinorTitle($this->_convert($this->author)); $pdf->PutMinorHeading("Published: " . date("F j, Y, g:i a", $this->date)); $pdf->PutLine(); $pdf->Ln(10); // html $pdf->WriteHTML($this->_convert(stripslashes($this->html)), $this->bi); //save and redirect $filename = $this->directory . $this->_makeFileName($this->title) . '.pdf'; $http = $this->http . $this->_makeFileName($this->title) . '.pdf'; $pdf->Output($filename); header("Location: {$http}"); // cleanup $files = opendir($this->directory); while (false !== ($filename = readdir($files))) { if (!(strpos($filename, '.pdf') === false)) { // delete old temp files $time = filectime($this->directory . $filename); if (!($time === false) && $time > 0) { if ($time + $this->delete * 60 < time()) { unlink($this->directory . $filename); } } } } // stop processing exit; }
function savePdf() { $meeting =& $this->meeting; $meetingAttendanceDao =& DAORegistry::getDAO("MeetingAttendanceDAO"); $meetingAttendances =& $meetingAttendanceDao->getMeetingAttendancesByMeetingId($meeting->getId()); $suppGuestNames = $this->getData("suppGuestName"); $suppGuestAffiliations = $this->getData("suppGuestAffiliation"); $meetingDateTime = date("d F Y g:ia", strtotime($meeting->getDate())); $meetingDate = date("d F Y", strtotime($meeting->getDate())); $details = Locale::translate('editor.meeting.attendanceReport.intro1') . ' ' . $this->getData("venue") . ' ' . Locale::translate('common.date.on') . ' ' . $meetingDateTime . ' ' . Locale::translate('editor.meeting.attendanceReport.intro2') . ' ' . $this->quorum . ' ' . Locale::translate('editor.meeting.attendanceReport.intro3') . ' ' . $this->getData('adjourned') . "."; $journal = Request::getJournal(); $user = Request::getUser(); import('classes.lib.tcpdf.pdf'); $pdf = new PDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor($user->getFullName()); $pdf->SetTitle($journal->getJournalTitle()); $pdf->SetSubject($meeting->getPublicId() . ' - ' . Locale::translate('editor.minutes.attendance')); // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 020', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, 58, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->AddPage(); $pdf->SetFont('dejavusans', 'B', 13); $sectionDao =& DAORegistry::getDAO("SectionDAO"); $erc =& $sectionDao->getSection($meeting->getUploader()); $pdf->SetFont('dejavusans', 'I', 13); $pdf->MultiCell(0, 6, $erc->getSectionTitle(), 0, 'C'); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.meetingDate') . ' ' . $meetingDate, 0, 'C'); $pdf->ln(); $memberCount = 0; $pdf->SetFont('dejavusans', 'BU', 12); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.membersPresent'), 0, 'L'); $pdf->ln(); $pdf->SetFont('dejavusans', '', 12); foreach ($meetingAttendances as $meetingAttendance) { if ($meetingAttendance->getWasPresent() == 1) { $member =& $meetingAttendance->getUser(); $pdf->MultiCell(0, 6, $member->getFullName(), 0, 'L'); $memberCount++; } } if ($memberCount == 0) { $pdf->MultiCell(0, 6, Locale::translate('common.none'), 0, 'L'); } $pdf->ln(); $memberCount = 0; $pdf->SetFont('dejavusans', 'BU', 12); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.membersAbsent'), 0, 'L'); $pdf->ln(); $pdf->SetFont('dejavusans', '', 12); foreach ($meetingAttendances as $meetingAttendance) { if ($meetingAttendance->getWasPresent() == 2) { $member =& $meetingAttendance->getUser(); $pdf->MultiCell(0, 6, $member->getFullName() . ' (' . Locale::translate('editor.meeting.attendanceReport.reasonForAbsence') . ' ' . $meetingAttendance->getReasonForAbsence() . ')', 0, 'L'); $memberCount++; } } if ($memberCount == 0) { $pdf->MultiCell(0, 6, Locale::translate('common.none'), 0, 'L'); } $pdf->ln(); if (count($suppGuestNames) > 0) { $suppGuestCount = 0; foreach ($suppGuestNames as $key => $guest) { if ($guest != "" && $guest != null) { if ($suppGuestCount == 0) { $pdf->SetFont('dejavusans', 'BU', 12); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.suppGuest'), 0, 'L'); $pdf->ln(); $pdf->SetFont('dejavusans', '', 12); } $pdf->MultiCell(0, 6, $guest . ' (' . $suppGuestAffiliations[$key] . ')', 0, 'L'); $suppGuestCount++; } } $pdf->ln(); } $pdf->MultiCell(0, 6, $details, 0, 'L'); $pdf->ln(); if ($this->getData("announcements")) { $pdf->SetFont('dejavusans', 'BU', 12); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.announcements'), 0, 'L'); $pdf->ln(); $pdf->SetFont('dejavusans', '', 12); $pdf->MultiCell(0, 6, $this->getData("announcements"), 0, 'L'); $pdf->ln(); } $pdf->SetFont('dejavusans', 'BU', 12); $pdf->MultiCell(0, 6, Locale::translate('editor.meeting.attendanceReport.submittedBy'), 0, 'L'); $pdf->ln(); $pdf->SetFont('dejavusans', '', 12); $pdf->MultiCell(0, 6, $user->getFullName(), 0, 'L'); $pdf->ln(); import('classes.file.MinutesFileManager'); $minutesFileManager = new MinutesFileManager($meeting->getId()); $minutesFileManager->handleWrite($pdf, MINUTES_FILE_ATTENDANCE); }
while ($row = $db->fetch_object($result)) { $lang = $row->lang; $solution_id = $row->solution_id; $thema = $row->thema; $content = $row->content; $date = $row->datum; $author = $row->author; } } else { print "Error!"; } $pdf = new PDF($currentCategory, $thema, $tree->categoryName, $orientation = "P", $unit = "mm", $format = "A4"); $pdf->Open(); $pdf->SetAutoPageBreak(true, 2 * (40 / $pdf->k)); $pdf->SetTitle($thema); $pdf->SetCreator($PMF_CONF["title"]); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont("Arial", "", 12); $pdf->SetDisplayMode("real"); $pdf->WriteHTML(str_replace("../", "", $content)); $pdf->Ln(); $pdf->Ln(); $pdf->SetStyle('I', true); $pdf->Write(5, unhtmlentities($PMF_LANG['ad_entry_solution_id']) . ': #' . $solution_id); $pdf->SetAuthor($author); $pdf->Ln(); $pdf->Write(5, unhtmlentities($PMF_LANG["msgAuthor"]) . $author); $pdf->SetAuthor($author); $pdf->Ln(); $pdf->Write(5, unhtmlentities($PMF_LANG["msgLastUpdateArticle"]) . makeDate($date));
/** * Internal function to return the cover for publishing a research * @param $sectionEditorSubmission SectionEditorSubmission * @return string path to cover created */ function &_generateCover($sectionEditorSubmission) { $journal =& Request::getJournal(); import('classes.lib.tcpdf.pdf'); import('classes.lib.tcpdf.tcpdf'); Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_OJS_EDITOR, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER)); $pdf = new PDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // No header and footer for this document $pdf->SetPrintHeader(false); $pdf->SetPrintFooter(false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor($journal->getJournalTitle()); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, 20, PDF_MARGIN_RIGHT); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // Right now this cover page is only in english, but the english translation keys are ready $pdf->AddPage(); $pdf->SetFont('dejavusans', 'B', 14); $pdf->MultiCell(0, 6, 'Final Technical Report', 0, 'C'); // Locale::translate('editor.finalReport') $pdf->ln(); $pdf->ln(); $pdf->MultiCell(0, 6, 'for', 0, 'C'); // Locale::translate('editor.finalReport.for') $pdf->ln(); $pdf->ln(); $pdf->MultiCell(0, 6, 'Research Project', 0, 'C'); // Locale::translate('editor.finalReport.researchProject') $pdf->ln(); $pdf->ln(); $pdf->ln(); $pdf->ln(); $abstract = $sectionEditorSubmission->getAbstractByLocale('en_US'); // Right now, considering only the english language $pdf->SetFont('dejavusans', 'B', 16); $pdf->MultiCell(0, 6, $abstract->getScientificTitle(), 0, 'C'); $pdf->ln(); $authors = $sectionEditorSubmission->getAuthors(); $coInvestigatorsString = (string) ''; $pInvestigatorsString = (string) ''; foreach ($authors as $author) { if (!$author->getPrimaryContact()) { if ($coInvestigatorsString == '') { $coInvestigatorsString = $author->getFullName() . ' (' . $author->getAffiliation() . ')'; } else { $coInvestigatorsString = $coInvestigatorsString . ', ' . $author->getFullName() . ' (' . $author->getAffiliation() . ')'; } } else { $pInvestigatorsString = $author->getFullName() . ' (' . $author->getAffiliation() . ')'; } } $pdf->SetFont('dejavusans', '', 16); $pdf->MultiCell(0, 6, 'Principal Investigator: ' . $pInvestigatorsString, 0, 'C'); // Locale::translate('user.role.primaryInvestigator') if ($coInvestigatorsString != '') { $pdf->MultiCell(0, 6, 'Co-Investigator(s): ' . $coInvestigatorsString, 0, 'C'); // Locale::translate('user.role.coinvestigator') } $pdf->ln(); $pdf->ln(); $pdf->ln(); $pdf->ln(); $pdf->SetFont('dejavusans', 'B', 16); $pdf->MultiCell(0, 6, $sectionEditorSubmission->getProposalId(), 0, 'C'); $pdf->ln(); $pdf->ln(); $decision = $sectionEditorSubmission->getLastSectionDecision(); $pdf->MultiCell(0, 0, date("F Y", strtotime($decision->getDateDecided())), 0, 'L', 0, 1, '', 250, true); $pdf->Image("public/site/images/mainlogo.png", 'C', 230, 40, '', '', false, 'C', false, 300, 'R', false, false, 0, false, false, false); $pdf->AddPage(); $pdf->SetFont('dejavusans', 'B', 14); $pdf->MultiCell(0, 6, 'Final Technical Report', 0, 'C'); // Locale::translate('editor.finalReport') $pdf->ln(); $pdf->ln(); $pdf->SetFont('dejavusans', 'B', 12); $pdf->MultiCell(0, 6, 'Disclaimer', 0, 'C'); // Locale::translate('editor.finalReport.disclaimer') $pdf->ln(); $pdf->ln(); $pdf->SetFont('dejavusans', '', 11); $pdf->writeHTMLCell(0, 6, '', '', $journal->getSetting('reportDisclaimer'), 0, 0, false, true, 'J'); $filePath = Config::getVar('files', 'files_dir') . '/articles/' . $sectionEditorSubmission->getArticleId() . '/public/'; if (!FileManager::fileExists($filePath, 'dir')) { FileManager::mkdirtree($filePath); } $pdf->Output($filePath . 'tempCover.pdf', 'F'); return $filePath; }
$anoActual = date("Y"); $radicadosPdf .= "</table>"; error_reporting(7); $ruta_raiz = ".."; include "{$ruta_raiz}/fpdf/html2pdf.php"; $fecha = date("d-m-Y"); $fecha_hoy_corto = date("d-m-Y"); include "{$ruta_raiz}/class_control/class_gen.php"; $b = new CLASS_GEN(); $date = date("m/d/Y"); $fecha_hoy = $b->traducefecha($date); $html = "<table width='100%' align='left'><tr><td></td></tr><tr><td colspan=3 > </td><td align='left'><b>" . strtoupper($ent) . "</b></td></tr></table>\n\t\t<p><p>\n\t\t<br><br><br>\n\t\t<b><center> \n\t\t \n\t\t \n\t\tACTA DE ANULACIÓN No. {$actaNo} </center></b><p><br>\n\t\t<CENTER><B>\n\t\t \n\t\tNUMEROS DE RADICACIÓN DE CORRESPONDENCIA ENVIADA AÑO {$anoActual}</B></CENTER><p>\n\t\t<CENTER><B> \n\t\t \n\t\t \n\t\tGESTIÓN DOCUMENTAL Y ARCHIVO </B></CENTER><p>\n\t\t<br>\n <p text-align:justify; padding:3px >\n\t\tEn cumplimiento a lo establecido en el Acuerdo No. 060 del 30 de octubre de 2001 expedido por el Archivo General de la Nación, en el cual se establecen pautas para la administración de las comunicaciones oficiales en las entidades públicas y privadas que cumplen funciones públicas, y con base especialmente en el parágrafo del Artículo Quinto, el cual establece que cuando existan errores en la radicación y se anulen los números, se debe dejar constancia por escrito, con la respectiva justificación y firma del Jefe de la unidad de correspondencia; el coordinador de Gestión Documental y Correspondencia de {$entidad} procede a anular los siguientes números de radicación de {$TituloActam} que no fueron tramitados por las dependencias radicadoras:\n </p><br><br><br><br>\n\t\t1.- Números de radicación de {$TituloActam} a anular: <br>\n\t\t {$radicadosPdf}\n\t\t<br><br>\n\t\t2.- Se deja copia de la presente acta en el archivo central de la Entidad para el trámite <br>\n\t\t respectivo de la organización física de los archivos.<p>\n\t\tSe firma la presente el {$fecha_hoy}\n\t\t<p><p>\t\n\t\t______________________________________________________ <br>\n\t\t" . iconv($odt->codificacion($usua_nomb), 'ISO-8859-1', $usua_nomb) . "<BR>\nCentro de Administración Documental"; $ruta_raiz = ".."; $pdf = new PDF(); $pdf->Open(); $pdf->SetCreator("HTML2PDF"); $pdf->SetTitle("Acta de Anulacion de Radicados"); $pdf->SetSubject("Anulacion radicados"); $pdf->SetAuthor("Correspondencia"); $pdf->SetFont('Arial', '', 12); $pdf->AddPage(); if (ini_get('magic_quotes_gpc') == '1') { $html = stripslashes($html); } $pdf->WriteHTML($html); //save and redirect $noArchivo_out = "../" . $carpetaBodega . $noArchivo; $pdf->Output($noArchivo_out); ?> <center>Ver Acta <a href='../seguridadImagen.php?fec=<?php echo base64_encode($noArchivo);
/** * * @global array $DIAMOND_BRAND_IDS * @global string $server * @global jng_sp $class_sp * @global products_minierp $class_pm * @global logger $logger * @global string $icon_diamond * @global string $icon_gold_585_w * @global string $icon_gold_585_g * @param string $timestamp * @param int $jng_sp_id * @return boolean */ function generateReports($timestamp, $jng_sp_id) { global $DIAMOND_BRAND_IDS, $server, $class_sp, $class_pm, $logger, $icon_diamond, $icon_gold_585_w, $icon_gold_585_g; $log_date = strtotime($timestamp); $sp_detail = $jng_sp_id > 0 ? $class_sp->retrieveDetail($jng_sp_id) : array('package_prefix' => 'JG.DE'); $filter_sold = 1; $filter_age = 56; $logger->write("GENERATING REPORT {$sp_detail['package_prefix']}"); /* * Query get new products which: * 1) age <= 8 weeks (56 days) * 2) total sold >= 1 */ $q = "SELECT p.products_id, p.products_model, p.products_image, p.products_price, p.material_expenses, p.stars "; $q .= " , ptc.categories_id AS catid, cd.categories_name"; $q .= " , IFNULL(plps.sold_monthly_1, 0) AS sold_monthly_1, IFNULL(plps.sold_monthly_2, 0) AS sold_monthly_2"; if ($jng_sp_id > 0) { $q .= " , ((jc.total_returned / jc.total_sold) * 100) AS returned_rate, jc.active_age"; } else { $q .= " , 'N/A' AS returned_rate, DATEDIFF(NOW(), p.products_date_added) AS active_age"; } $q .= " FROM products p"; if ($jng_sp_id > 0) { $q .= " INNER JOIN jng_sp_catalog jc ON jc.jng_sp_id = {$jng_sp_id} AND jc.products_id = p.products_id"; } else { $q .= " INNER JOIN orders_products op ON op.products_id = p.products_id"; } $q .= " LEFT JOIN products_log_per_sp plps ON plps.products_id = p.products_id AND plps.jng_sp_id = {$jng_sp_id}"; $q .= " LEFT JOIN products_to_categories ptc ON ptc.products_id = p.products_id"; $q .= " LEFT JOIN categories_description cd ON cd.categories_id = ptc.categories_id AND cd.language_id = 1"; $q .= " WHERE"; if ($jng_sp_id > 0) { $q .= " jc.active_age <= {$filter_age}"; $q .= " AND jc.active_status = 1"; $q .= " AND total_sold >= {$filter_sold}"; } else { //$q .= " p.products_date_added >= '2013-01-01 00:00:00'"; $q .= " DATEDIFF(NOW(), p.products_date_added) <= {$filter_age}"; $q .= " AND p.products_status = 1"; $q .= " AND op.status NOT IN (10, 12)"; $q .= " GROUP BY p.products_id"; $q .= " HAVING SUM(op.products_quantity) >= {$filter_sold}"; } //$q .= " LIMIT 5"; $dbq = tep_db_query($q); $products = array(); while ($row = tep_db_fetch_array($dbq)) { $row['margin'] = $class_pm->calculateMargin($row['products_price'], $row['material_expenses'], 1); $products[$row['catid']][$row['products_id']] = $row; } if (count($products) == 0) { $logger->write("NO DATA RETRIEVED"); return false; } //Start Creating PDF Reports $margin = 20; $ypos = 10; $col_width = 48; $col_height = 77; $line_height = 5; $cell_text_width = $col_width - 3; $no = 0; $row = 1; $icon_w = 4; $icon_h = 4; $first_page = true; $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('New Comer Report'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('Manobo PDF Generator'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(true, 25); $pdf->AliasNbPages(); $pdf->AddPage('L'); $pdf->setXY($margin, $ypos); $pdf->setFont('Arial', 'B', '14'); $pdf->cell(240, 5, 'SALES REPORT NEWCOMER PRODUCT ' . $sp_detail['package_prefix'] . ' (' . date('d.m.Y', $log_date) . ')', 0, 0, 'C'); $pdf->setFont('Arial', '', '10'); $ypos += 15; $pdf->setXY($margin, $ypos); $catids = load_config('products-categories-sorting'); foreach ($catids as $catid) { $xpos = $margin; if (is_array($products[$catid])) { foreach ($products[$catid] as $pid => $p) { $obj_product = new product($pid); $no++; if ($ypos >= 150 || $no == 1 && !$first_page) { //Reset vars to new page state $xpos = $margin; $ypos = 25; $row = 1; $pdf->AddPage('L'); $pdf->setXY($margin, $ypos); } //Draw product box $pdf->Cell($col_width, $col_height, '', 1, 0); //Start drawing contents $pdf->drawProductsImage($xpos + 10, $ypos + 1, $p['products_image']); if (is_object($obj_product) && in_array($obj_product->brand_id, $DIAMOND_BRAND_IDS)) { $ypos_icon = $ypos + 3; $pdf->drawIcon($icon_diamond, $xpos + 39.5, $ypos_icon, $icon_w, $icon_h); } if (is_object($obj_product) && ($obj_product->metal_stamp_code > 0 && $obj_product->metal_stamp_code != 925)) { $icon_gold_selected = "icon_gold_" . $obj_product->metal_stamp_code . '_' . strtolower(substr($obj_product->metal_stamp_info, 0, 1)); $icon_gold = ${$icon_gold_selected}; $ypos_icon += $icon_h; //gold icon dimension is 21 x 16 $icon_gold_w = 21 / 16 * $icon_h; $pdf->drawIcon($icon_gold, $xpos + 38, $ypos_icon, $icon_gold_w, $icon_h); } $pdf->setXY($xpos + 2, $ypos + 3); $pdf->setFont('Arial', 'B', '10'); $pdf->Cell($col_width, $line_height, $no . ". " . ($no == 1 ? $p['categories_name'] : '')); $pdf->setFont('Arial', '', '10'); $pdf->drawStar($p['stars'], $xpos + 15, $ypos + 29); $pdf->setXY($xpos + 2, $ypos + 35); $link = "http://{$server}/?open=product-detail&products_id=" . $pid; $pdf->SetFont('Arial', 'U'); $pdf->SetTextColor(0, 0, 255); $pdf->Cell($cell_text_width, $line_height, $pid . ' / ' . $p['products_model'], 0, 0, 'C', 0, $link); $pdf->SetFont('Arial', ''); $pdf->SetTextColor(0, 0, 0); $pdf->setXY($xpos + 2, $ypos + 40); $pdf->Cell($cell_text_width, $line_height, 'Price: ' . displayCurrency('EUR', $p['products_price'], false) . ' EUR', 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 45); $pdf->Cell($cell_text_width, $line_height, 'Margin: ' . number_format($p['margin'], 1) . '%', 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 50); $pdf->Cell($cell_text_width, $line_height, 'Return Rate: ' . ($jng_sp_id > 0 ? number_format($p['returned_rate'], 1) . '%' : $p['returned_rate']), 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 60); $pdf->Cell($cell_text_width, $line_height, 'Age in ' . ($jng_sp_id > 0 ? 'SP' : 'JG') . ': ' . $p['active_age'] . ' days', 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 65); $pdf->Cell($cell_text_width, $line_height, 'Sold L30D in ' . ($jng_sp_id > 0 ? 'SP' : 'JG') . ': ' . $p['sold_monthly_1'], 0, 0, 'C'); $pdf->setXY($xpos + 2, $ypos + 70); $pdf->Cell($cell_text_width, $line_height, 'Sold L60D in ' . ($jng_sp_id > 0 ? 'SP' : 'JG') . ': ' . $p['sold_monthly_2'], 0, 0, 'C'); if ($no % 5 == 0) { $row++; $xpos = $margin; $ypos += $col_height * ($row - 1) + 5; } else { $xpos += $col_width + 5; } $pdf->setXY($xpos, $ypos); } $first_page = false; } $no = 0; } $filepath = 'sales-report-newcomer-products/'; $yeardir = $filepath . date('Y/', $log_date); if (!file_exists(DIR_FS_ARCHIVES . $yeardir) || !is_dir(DIR_FS_ARCHIVES . $yeardir)) { mkdir(DIR_FS_ARCHIVES . $yeardir); } $monthdir = $yeardir . date('m/', $log_date); if (!file_exists(DIR_FS_ARCHIVES . $monthdir) || !is_dir(DIR_FS_ARCHIVES . $monthdir)) { mkdir(DIR_FS_ARCHIVES . $monthdir); } $path_location = DIR_FS_ARCHIVES . $monthdir; $filename = date('YmdHi', strtotime($timestamp)) . '-sales-report-newcomer-products-' . $sp_detail['package_prefix'] . '.pdf'; $pdf->Output($path_location . $filename, 'F'); $logger->write("PDF CREATED: {$filename}"); //$pdf->Output($filename, 'D'); return true; }
var $page_width; var $page_height; var $font_size; //Page header function Header() { } //Page footer function Footer() { } } $pdf = new PDF('P', 'mm', 'A4'); $pdf->setTitle('Invoice'); $pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->left_margin = 10; $pdf->top_margin = 20; $pdf->page_width = 210; $pdf->page_height = 297; $pdf->font_size = 11; $pdf->line_height = 6; $pdf->AddPage(); $pdf->setFont('Arial', '', $pdf->font_size); //PAGING SETTING $firstpagecount = 41; $nextpagecount = 54; //HEADER RIGHT $head_width = 70; $xpos = $pdf->left_margin + 110;
function automaticSummaryInPDF($submission) { $countryDao =& DAORegistry::getDAO('CountryDAO'); $articleDrugInfoDao =& DAORegistry::getDAO('ArticleDrugInfoDAO'); $extraFieldDAO =& DAORegistry::getDAO('ExtraFieldDAO'); $journal =& Request::getJournal(); $submitter =& $submission->getUser(); $title = $journal->getJournalTitle(); $articleTexts = $submission->getArticleTexts(); $articleTextLocales = $journal->getSupportedLocaleNames(); $secIds = $submission->getArticleSecIds(); $details = $submission->getArticleDetails(); $purposes = $submission->getArticlePurposes(); $articlePrimaryOutcomes = $submission->getArticleOutcomesByType(ARTICLE_OUTCOME_PRIMARY); $articleSecondaryOutcomes = $submission->getArticleOutcomesByType(ARTICLE_OUTCOME_SECONDARY); $coutryList = $countryDao->getCountries(); $articleDrugs = $submission->getArticleDrugs(); $pharmaClasses = $articleDrugInfoDao->getPharmaClasses(); $drugStudyClasses = $articleDrugInfoDao->getClassKeysMap(); $articleSites = $submission->getArticleSites(); $expertisesList = $extraFieldDAO->getExtraFieldsList(EXTRA_FIELD_THERAPEUTIC_AREA, EXTRA_FIELD_ACTIVE); $fundingSources = $submission->getArticleFundingSources(); $pSponsor = $submission->getArticlePrimarySponsor(); $sSponsors = $submission->getArticleSecondarySponsors(); $CROs = $submission->getArticleCROs(); $contact = $submission->getArticleContact(); Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_OJS_EDITOR, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER)); import('classes.lib.tcpdf.pdf'); import('classes.lib.tcpdf.tcpdf'); $pdf = new PDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor($submitter->getFullName()); $pdf->SetTitle($title); $subject = $submission->getProposalId() . ' - ' . Locale::translate('submission.summary'); $pdf->SetSubject($subject); $cell_width = 45; $cell_height = 6; // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 020', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, 58, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->AddPage(); // Title $pdf->SetFont('Times', 'B', 15); $w = $pdf->GetStringWidth($title) + 6; $pdf->SetX((210 - $w) / 2); $pdf->Cell($w, 9, $title, 0, 1, 'C'); // sub-title $pdf->SetFont('Times', 'BI', 14); $w2 = $pdf->GetStringWidth($subject) + 6; $pdf->SetX((210 - $w2) / 2); $pdf->Cell($w2, 9, $subject, 0, 1, 'C'); // Line break $pdf->Ln(10); // Main Info $pdf->SetFont('Times', '', 12); $pdf->MultiRow(50, Locale::translate("common.proposalId"), $submission->getProposalId(), 'L'); $pdf->MultiRow(50, Locale::translate("article.title"), $submission->getScientificTitle(), 'L'); $pdf->MultiRow(50, Locale::translate("submission.submitter"), $submitter->getFullName(), 'L'); $pdf->MultiRow(50, Locale::translate("common.dateSubmitted"), $submission->getDateSubmitted(), 'L'); // Line break $pdf->Ln(10); //CT Information $pdf->SetFont('Times', 'B', 14); $pdf->Cell(190, 9, 'I' . Locale::translate('common.queue.long.articleDetails', array('id' => '')), 0, 1, 'L'); $pdf->Ln(5); $pdf->SetFont('Times', '', 12); $scientificTitle = null; foreach ($articleTexts as $atKey => $articleText) { if (!$scientificTitle) { $pdf->MultiRow(50, Locale::translate("proposal.scientificTitle"), $articleText->getScientificTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); $scientificTitle = true; } else { $pdf->MultiRow(50, '', $articleText->getScientificTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); } } $publicTitle = null; foreach ($articleTexts as $atKey => $articleText) { if (!$publicTitle) { $pdf->MultiRow(50, Locale::translate("proposal.publicTitle"), $articleText->getPublicTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); $publicTitle = true; } else { $pdf->MultiRow(50, '', $articleText->getPublicTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); } } $pdf->Ln(3); $firstSecId = null; foreach ($secIds as $secId) { if (!$firstSecId) { $pdf->MultiRow(50, Locale::translate("proposal.articleSecId"), $secId->getSecId() . ' (' . Locale::translate($secId->getTypeKey()) . ')', 'L'); $firstSecId = true; } else { $pdf->MultiRow(50, '', $secId->getSecId() . ' (' . Locale::translate($secId->getTypeKey()) . ')', 'L'); } } $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.protocolVersion"), $details->getProtocolVersion(), 'L'); $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.therapeuticArea"), $details->getRightTherapeuticAreaDisplay(), 'L'); $pdf->Ln(3); $firstICD10 = null; foreach ($details->getHealthCondDiseaseArrayToDisplay() as $healthCond) { $code = $healthCond['code']; $exactCode = $healthCond['exactCode']; if ($exactCode != '') { $code = $code . ' (' . $exactCode . ')'; } if (!$firstICD10) { $pdf->MultiRow(50, Locale::translate("proposal.icd10s"), $code, 'L'); $firstICD10 = true; } else { $pdf->MultiRow(50, '', $code, 'L'); } } $pdf->Ln(3); $firstPurpose = null; foreach ($purposes as $purpose) { if (!$firstPurpose) { $purposeTitle = Locale::translate("proposal.purposes"); $firstPurpose = true; } else { $purposeTitle = ''; } if ($purpose->getType() == ARTICLE_PURPOSE_TYPE_OBS) { $pdf->MultiRow(50, $purposeTitle, Locale::translate($purpose->getTypeKey()), 'L'); } else { $pdf->MultiRow(50, $purposeTitle, Locale::translate('proposal.purpose.type.int'), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.purposes.type') . ': ' . Locale::translate($purpose->getTypeKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.purposes.ctPhase') . ': ' . Locale::translate($purpose->getCTPhaseKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.purposes.studyDesign') . ', ' . Locale::translate('proposal.purposes.allocation') . ': ' . Locale::translate($purpose->getAllocationKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.purposes.masking') . ': ' . Locale::translate($purpose->getMaskingKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.purposes.control') . ': ' . Locale::translate($purpose->getControlKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.purposes.assignment') . ': ' . Locale::translate($purpose->getAssignmentKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.purposes.endpoint') . ': ' . Locale::translate($purpose->getEndpointKey()), 'L'); } } $pdf->Ln(3); $description = null; foreach ($articleTexts as $atKey => $articleText) { if (!$description) { $pdf->MultiRow(50, Locale::translate("proposal.description"), $articleText->getDescription() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); $description = true; } else { $pdf->MultiRow(50, '', $articleText->getDescription() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); } } $pdf->Ln(3); $kic = null; foreach ($articleTexts as $atKey => $articleText) { if (!$kic) { $pdf->MultiRow(50, Locale::translate("proposal.keyInclusionCriteria"), $articleText->getKeyInclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); $kic = true; } else { $pdf->MultiRow(50, '', $articleText->getKeyInclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); } } $pdf->Ln(3); $kec = null; foreach ($articleTexts as $atKey => $articleText) { if (!$kec) { $pdf->MultiRow(50, Locale::translate("proposal.keyExclusionCriteria"), $articleText->getKeyExclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); $kec = true; } else { $pdf->MultiRow(50, '', $articleText->getKeyExclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); } } $pdf->Ln(3); $firstPOutcome = null; foreach ($articlePrimaryOutcomes as $articleOutcomeLocales) { foreach ($articleOutcomeLocales as $key => $articleOutcome) { if (!$firstPOutcome) { $outcomeTitle = Locale::translate("proposal.primaryOutcomes"); $firstPOutcome = true; } else { $outcomeTitle = ''; } $pdf->MultiRow(50, $outcomeTitle, $articleOutcome->getName() . ' (' . $articleTextLocales[$key] . ')', 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.primaryOutcome.measurement') . ': ' . $articleOutcome->getMeasurement(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.primaryOutcome.timepoint') . ': ' . $articleOutcome->getTimepoint(), 'L'); $pdf->Ln(3); } } $firstSOutcome = null; foreach ($articleSecondaryOutcomes as $articleOutcomeLocales) { foreach ($articleOutcomeLocales as $key => $articleOutcome) { if (!$firstSOutcome) { $sOutcomeTitle = Locale::translate("proposal.secondaryOutcomes"); $firstSOutcome = true; } else { $sOutcomeTitle = ''; } $pdf->MultiRow(50, $sOutcomeTitle, $articleOutcome->getName() . ' (' . $articleTextLocales[$key] . ')', 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.primaryOutcome.measurement') . ': ' . $articleOutcome->getMeasurement(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.primaryOutcome.timepoint') . ': ' . $articleOutcome->getTimepoint(), 'L'); $pdf->Ln(3); } } $pdf->MultiRow(50, Locale::translate("proposal.age.minimum"), $details->getMinAgeNum() . ' ' . Locale::translate($details->getMinAgeUnitKey()), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.age.maximum"), $details->getMaxAgeNum() . ' ' . Locale::translate($details->getMaxAgeUnitKey()), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.sex"), Locale::translate($details->getSexKey()), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.healthy"), Locale::translate($details->getYesNoKey($details->getHealthy())), 'L'); $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.localeSampleSize"), $details->getLocaleSampleSize(), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.multinational") . ' ' . $journal->getLocalizedSetting('location'), Locale::translate($details->getYesNoKey($details->getMultinational())), 'L'); if ($details->getMultinational() == ARTICLE_DETAIL_YES) { foreach ($details->getIntSampleSizeArray() as $countryAndNumberArray) { $country = $countryAndNumberArray['country']; $pdf->MultiRow(50, '', ' ' . $coutryList[$country] . ': ' . $countryAndNumberArray['number'], 'L'); } } $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.expectedDate"), Locale::translate('proposal.startDate') . ': ' . $details->getStartDate() . ', ' . Locale::translate('proposal.endDate') . ': ' . $details->getEndDate(), 'L'); $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.recruitment"), Locale::translate("proposal.recruitment.status") . ': ' . Locale::translate($details->getRecruitmentStatusKey()), 'L'); $rssi = null; foreach ($articleTexts as $atKey => $articleText) { if ($articleText->getRecruitmentInfo() != '') { if (!$rssi) { $pdf->MultiRow(50, '', Locale::translate("proposal.recruitment.info") . ': ' . $articleText->getRecruitmentInfo() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); $rssi = true; } else { $pdf->MultiRow(50, '', $articleText->getRecruitmentInfo() . ' (' . $articleTextLocales[$atKey] . ')', 'L'); } } } $pdf->MultiRow(50, '', Locale::translate("proposal.recruitment.adScheme") . ': ' . Locale::translate($details->getYesNoKey($details->getAdvertisingScheme())), 'L'); // Line break $pdf->Ln(10); //Drug products $pdf->SetFont('Times', 'B', 14); $pdf->Cell(190, 9, 'II' . Locale::translate('common.queue.long.articleDrugs', array('id' => '')), 0, 1, 'L'); $pdf->Ln(5); foreach ($articleDrugs as $articleDrug) { $pdf->SetFont('Times', 'BU', 12); $pdf->Cell(190, 9, $articleDrug->getName(), 0, 1, 'L'); $pdf->SetFont('Times', '', 12); $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.type"), Locale::translate($articleDrug->getTypeKey()), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.name"), $articleDrug->getName(), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.brandName"), $articleDrug->getBrandName(), 'L'); if ($articleDrug->getOtherAdministration() == 'NA') { $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.administration"), Locale::translate($articleDrug->getAdministrationKey()), 'L'); } else { $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.administration"), $articleDrug->getOtherAdministration(), 'L'); } if ($articleDrug->getOtherForm() == 'NA') { $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.form"), Locale::translate($articleDrug->getFormKey()), 'L'); } else { $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.form"), $articleDrug->getOtherForm(), 'L'); } $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.strength"), $articleDrug->getStrength(), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.storage"), Locale::translate($articleDrug->getStorageKey()), 'L'); $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.pharmaClass"), $pharmaClasses[$articleDrug->getPharmaClass()], 'L'); $firstClass = false; $classIIIOrIV = false; $classesToDisplay = ''; foreach ($articleDrug->getClassesArray() as $class) { if ($class == ARTICLE_DRUG_INFO_CLASS_III || $class == ARTICLE_DRUG_INFO_CLASS_IV) { $classIIIOrIV = true; } if (!$firstClass) { $classesToDisplay = Locale::translate($drugStudyClasses[$class]); } else { $classesToDisplay = $classesToDisplay . ', ' . Locale::translate($drugStudyClasses[$class]); } $firstClass = true; } $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.studyClasses"), $classesToDisplay, 'L'); if ($classIIIOrIV) { $countriesToDisplay = ''; $firstCountry = false; foreach ($articleDrug->getCountriesArray() as $country) { if (!$firstCountry) { $countriesToDisplay = $coutryList[$country]; } else { $countriesToDisplay = $countriesToDisplay . ', ' . $coutryList[$country]; } $firstCountry = true; } $pdf->MultiRow(50, '', Locale::translate("proposal.drugInfo.countries") . ': ' . $countriesToDisplay, 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.drugInfo.conditionsOfUse") . ': ' . Locale::translate($articleDrug->getDifferentConditionsOfUseKey()), 'L'); } $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.cpr"), Locale::translate($articleDrug->getCPRKey()), 'L'); if ($articleDrug->getCPR() == ARTICLE_DRUG_INFO_YES) { $pdf->MultiRow(50, '', Locale::translate("proposal.drugInfo.drugRegistrationNumber") . ': ' . $articleDrug->getDrugRegistrationNumber(), 'L'); } if ($articleDrug->getImportedQuantity() != '') { $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.importedQuantity"), $articleDrug->getImportedQuantity(), 'L'); } $firstManufacturer = false; foreach ($articleDrug->getManufacturers() as $manufacturer) { $manufacturerTitle = ''; if (!$firstManufacturer) { $manufacturerTitle = Locale::translate('proposal.drugInfo.manufacturers'); } $pdf->MultiRow(50, $manufacturerTitle, $manufacturer->getName(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.drugInfo.manufacturer.address') . ': ' . $manufacturer->getAddress(), 'L'); $firstManufacturer = true; $pdf->Ln(2); } $pdf->Ln(3); } // Line break $pdf->Ln(10); // Trial Site(s) $pdf->SetFont('Times', 'B', 14); $pdf->Cell(190, 9, 'III' . Locale::translate('common.queue.long.articleSites', array('id' => '')), 0, 1, 'L'); $pdf->Ln(5); foreach ($articleSites as $articleSite) { $trialSiteObject = $articleSite->getTrialSiteObject(); $pdf->SetFont('Times', 'BU', 12); $pdf->Cell(190, 9, $trialSiteObject->getName(), 0, 1, 'L'); $pdf->SetFont('Times', '', 12); $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.articleSite.site"), $trialSiteObject->getName(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteAddress') . ': ' . $trialSiteObject->getAddress(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteCity') . ': ' . $trialSiteObject->getCity(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteRegion') . ': ' . $trialSiteObject->getRegionText(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteLicensure') . ': ' . $trialSiteObject->getLicensure(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteAccreditation') . ': ' . $trialSiteObject->getAccreditation(), 'L'); $pdf->Ln(2); $pdf->MultiRow(50, Locale::translate("proposal.articleSite.erc"), $articleSite->getERCName(), 'L'); $pdf->Ln(2); $pdf->MultiRow(50, Locale::translate("proposal.articleSite.authority"), $articleSite->getAuthority(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.primaryPhone') . ': ' . $articleSite->getPrimaryPhone(), 'L'); if ($articleSite->getSecondaryPhone()) { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.secondaryPhone') . ': ' . $articleSite->getSecondaryPhone(), 'L'); } if ($articleSite->getFax()) { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.fax') . ': ' . $articleSite->getFax(), 'L'); } $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.email') . ': ' . $articleSite->getEmail(), 'L'); $pdf->Ln(2); $pdf->MultiRow(50, Locale::translate("proposal.articleSite.subjectsNumber"), $articleSite->getSubjectsNumber(), 'L'); $pdf->Ln(2); $countInvestigators = 1; foreach ($articleSite->getInvestigators() as $investigator) { $investigatorTitle = ""; if ($countInvestigators == 1) { $investigatorTitle = Locale::translate('user.role.primaryInvestigator'); } elseif ($countInvestigators == 2) { $investigatorTitle = Locale::translate('user.role.coinvestigator'); } $pdf->MultiRow(50, $investigatorTitle, $investigator->getFullName(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.expertise') . ': ' . $expertisesList[$investigator->getExpertise()], 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iPrimaryPhone') . ': ' . $investigator->getPrimaryPhoneNumber(), 'L'); if ($investigator->getSecondaryPhoneNumber()) { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iSecondaryPhone') . ': ' . $investigator->getSecondaryPhoneNumber(), 'L'); } if ($investigator->getFaxNumber()) { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iFax') . ': ' . $investigator->getFaxNumber(), 'L'); } $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iEmail') . ': ' . $investigator->getEmail(), 'L'); $countInvestigators++; } $pdf->Ln(3); } // Line break $pdf->Ln(10); // Sponsors $pdf->SetFont('Times', 'B', 14); $pdf->Cell(190, 9, 'IV' . Locale::translate('common.queue.long.articleSponsors', array('id' => '')), 0, 1, 'L'); $pdf->Ln(5); $pdf->SetFont('Times', '', 12); $firstFSource = false; foreach ($fundingSources as $fundingSource) { $fSourceTitle = ''; if (!$firstFSource) { $fSourceTitle = Locale::translate('proposal.articleSponsor.fundingSources'); } $institution = $fundingSource->getInstitutionObject(); $pdf->MultiRow(50, $fSourceTitle, $institution->getInstitutionName(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.acronym') . ': ' . $institution->getInstitutionAcronym(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.type') . ': ' . Locale::translate($institution->getInstitutionTypeKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.location') . ': ' . $institution->getInstitutionInternationalText(), 'L'); if ($institution->getInstitutionInternational() == INSTITUTION_INTERNATIONAL) { $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $institution->getInstitutionLocationText(), 'L'); } else { $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $institution->getInstitutionLocationText(), 'L'); } $pdf->Ln(2); $firstFSource = true; } $pdf->Ln(1); $institution = $pSponsor->getInstitutionObject(); $pdf->MultiRow(50, Locale::translate("proposal.articleSponsor.primarySponsor"), $institution->getInstitutionName(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.acronym') . ': ' . $institution->getInstitutionAcronym(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.type') . ': ' . Locale::translate($institution->getInstitutionTypeKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.location') . ': ' . $institution->getInstitutionInternationalText(), 'L'); if ($institution->getInstitutionInternational() == INSTITUTION_INTERNATIONAL) { $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $institution->getInstitutionLocationText(), 'L'); } else { $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $institution->getInstitutionLocationText(), 'L'); } $pdf->Ln(3); $firstSSponsor = false; foreach ($sSponsors as $sSponsor) { $SSponsorTitle = ''; if (!$firstSSponsor) { $SSponsorTitle = Locale::translate('proposal.articleSponsor.secondarySponsors'); } $institution = $sSponsor->getInstitutionObject(); $pdf->MultiRow(50, $SSponsorTitle, $institution->getInstitutionName(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.acronym') . ': ' . $institution->getInstitutionAcronym(), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.type') . ': ' . Locale::translate($institution->getInstitutionTypeKey()), 'L'); $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.location') . ': ' . $institution->getInstitutionInternationalText(), 'L'); if ($institution->getInstitutionInternational() == INSTITUTION_INTERNATIONAL) { $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $institution->getInstitutionLocationText(), 'L'); } else { $pdf->MultiRow(50, '', ' ' . Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $institution->getInstitutionLocationText(), 'L'); } $pdf->Ln(2); $firstSSponsor = true; } $pdf->Ln(1); $pdf->MultiRow(50, Locale::translate("proposal.articleSponsor.croInvolved"), Locale::translate($details->getYesNoKey($details->getCROInvolved())), 'L'); foreach ($CROs as $CRO) { $pdf->MultiRow(50, '', $CRO->getName(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.location') . ': ' . $CRO->getInternationalText(), 'L'); if ($CRO->getInternational() == CRO_INTERNATIONAL) { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $CRO->getLocationText(), 'L'); } else { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $CRO->getLocationText(), 'L'); } $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.city') . ': ' . $CRO->getCity(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.address') . ': ' . $CRO->getAddress(), 'L'); $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.primaryPhone') . ': ' . $CRO->getPrimaryPhone(), 'L'); if ($CRO->getSecondaryPhone()) { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.secondaryPhone') . ': ' . $CRO->getSecondaryPhone(), 'L'); } if ($CRO->getFax()) { $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.fax') . ': ' . $CRO->getFax(), 'L'); } $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.email') . ': ' . $CRO->getEmail(), 'L'); $pdf->Ln(2); } $pdf->Ln(1); // Line break $pdf->Ln(10); // Contact Information $pdf->SetFont('Times', 'B', 14); $pdf->Cell(190, 9, 'V' . Locale::translate('common.queue.long.articleContact', array('id' => '')), 0, 1, 'L'); $pdf->Ln(5); $pdf->SetFont('Times', '', 12); $pdf->MultiRow(50, Locale::translate("proposal.articleContact.pq"), $contact->getPQName(), 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.affiliation") . ': ' . $contact->getPQAffiliation(), 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.address") . ': ' . $contact->getPQAddress(), 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.country") . ': ' . $coutryList[$contact->getPQCountry()], 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.phone") . ': ' . $contact->getPQPhone(), 'L'); if ($contact->getPQFax() != '') { $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.fax") . ': ' . $contact->getPQFax(), 'L'); } $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.email") . ': ' . $contact->getPQEmail(), 'L'); $pdf->Ln(3); $pdf->MultiRow(50, Locale::translate("proposal.articleContact.sq"), $contact->getSQName(), 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.affiliation") . ': ' . $contact->getSQAffiliation(), 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.address") . ': ' . $contact->getSQAddress(), 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.country") . ': ' . $coutryList[$contact->getSQCountry()], 'L'); $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.phone") . ': ' . $contact->getSQPhone(), 'L'); if ($contact->getPQFax() != '') { $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.fax") . ': ' . $contact->getSQFax(), 'L'); } $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.email") . ': ' . $contact->getSQEmail(), 'L'); $pdf->Output($submission->getProposalId() . '-' . Locale::translate('submission.summary') . '.pdf', "D"); }
$usuarioNome = $_GET["UsuarioNome"]; //Position at 1.5 cm from bottom $this->SetY(-15); //Arial italic 8 $this->SetFont('Arial', 'I', 7); //Page number $this->Line(10, 281, 200, 281); $this->Cell(0, 3, 'Emitido por: ' . $usuarioNome); //Logotipo $this->Image('../image/workcrm_powered.jpg', 175, 282, 24); } } //Instancia a classe gerador de pdf $pdf = new PDF(); //Define os atributos de propriedade do arquivo PDF $pdf->SetCreator('work | crm - www.workcrm.com.br'); $pdf->SetAuthor($usuarioNome . " - " . $empresaNome); $pdf->SetTitle('Relação de Contas'); $pdf->SetSubject('Relatório gerado automaticamente pelo sistema'); $pdf->AliasNbPages(); //Cria a primeira página no modo landscape $pdf->AddPage(L); //Verifica se precisa imprimir o cabeçalho da quebra if ($SemQuebra != 1) { //Imprime o cabeçalho da primeira quebra $pdf->ln(); $pdf->SetFont('Arial', 'B', 10); $pdf->Cell(0, 5, $Agrupamento_nome . $Nome_quebra); $pdf->SetFont('Arial', '', 10); } //Salta a primeira linha
{ $usuarioNome = $_GET['UsuarioNome']; //Posiciona a 1.5 cm do final $this->SetY(-15); //Arial italico 8 $this->SetFont('Arial', 'I', 7); $this->Line(10, 281, 200, 281); $this->Cell(100, 3, 'Emitido por: ' . $usuarioNome); $this->SetFont('Arial', '', 7); $this->Cell(0, 3, '[Powered by work | eventos]', 0, 0, 'R'); } } //Instancia a classe gerador de pdf $pdf = new PDF(); //Define os atributos de propriedade do arquivo PDF $pdf->SetCreator('Work Eventos - CopyRight(c) - Work Labs Tecnologia - www.worklabs.com.br'); $pdf->SetAuthor($usuarioNome . ' - ' . $empresaNome); $pdf->SetTitle('Detalhamento do Evento'); $pdf->SetSubject('Relatório gerado automaticamente pelo sistema'); $pdf->AliasNbPages(); //Cria a página do relatório $pdf->AddPage(); //Nova linha $pdf->SetFont('Arial', 'B', 14); $pdf->Cell(0, 7, $dados_evento['nome'], 1, 0, 'C'); $pdf->ln(4); //Nova linha $pdf->ln(); $pdf->SetFont('Arial', 'B', 10); $pdf->SetFillColor(178, 178, 178); $pdf->Cell(0, 6, 'Detalhamento do Evento', 1, 0, 'C', 1);
//Rodapé do Relatório function Footer() { $usuarioNome = $_GET["UsuarioNome"]; //Posiciona a 1.5 cm do final $this->SetY(-15); //Arial italico 8 $this->SetFont('Arial', 'I', 7); $this->Line(10, 281, 200, 281); $this->Cell(0, 3, 'Emitido por: ' . $usuarioNome); } } //Instancia a classe gerador de pdf $pdf = new PDF(); //Define os atributos de propriedade do arquivo PDF $pdf->SetCreator('*****@*****.**'); $pdf->SetAuthor($usuarioNome . " - " . $empresaNome); $pdf->SetTitle('Detalhamento do cliente'); $pdf->SetSubject('Relatório gerado automaticamente pelo sistema'); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetY(25); $pdf->SetFont('Arial', 'B', 10); $pdf->SetFillColor(178, 178, 178); $pdf->Cell(0, 6, 'Detalhamento do Cliente', 1, 0, 'C', 1); //Nova Linha $pdf->ln(); $pdf->SetFont('Arial', 'B', 9); $pdf->Cell(0, 6, 'Tipo Cliente:', 1, 0, 'L'); $pdf->SetFont('Arial', 'I', 9); $pdf->SetX(39);
function Footer() { $usuarioNome = $_GET["UsuarioNome"]; //Position at 1.5 cm from bottom $this->SetY(-15); //Arial italic 8 $this->SetFont("Arial", "I", 7); //Page number $this->Line(10, 281, 200, 281); $this->Cell(0, 3, "Emitido por: " . $usuarioNome); } } //Instancia a classe gerador de pdf $pdf = new PDF(); //Define os atributos de propriedade do arquivo PDF $pdf->SetCreator("work | eventos"); $pdf->SetAuthor($usuarioNome . ' - ' . $empresaNome); $pdf->SetTitle("Relação de Eventos por Data"); $pdf->SetSubject("Relatório gerado automaticamente pelo sistema"); $pdf->AliasNbPages(); $pdf->AddPage("L"); //Títulos das colunas $pdf->SetFont("Arial", "B", 10); //Define a cor RGB do fundo da celula $pdf->SetFillColor(178, 178, 178); //Faz a célula ser preenchida. Isso é feito setando 1 após a expressao de alinhamento $pdf->Cell(0, 6, "Status", 1, 0, "L", 1); $pdf->SetX(36); $pdf->Cell(80, 6, "Atividade"); $pdf->Cell(14, 6, "Dias"); $pdf->Cell(30, 6, "Prazo");
function Footer() { $usuarioNome = $_GET["UsuarioNome"]; //Position at 1.5 cm from bottom $this->SetY(-15); //Arial italic 8 $this->SetFont('Arial', 'I', 7); //Page number $this->Line(10, 281, 200, 281); $this->Cell(0, 3, 'Emitido por: ' . $usuarioNome); } } //Instancia a classe gerador de pdf $pdf = new PDF(); //Define os atributos de propriedade do arquivo PDF $pdf->SetCreator('work | eventos'); $pdf->SetAuthor($usuarioNome . " - " . $empresaNome); $pdf->SetTitle('Relação de Momentos de Repertório'); $pdf->SetSubject('Relatório gerado automaticamente pelo sistema'); $pdf->AliasNbPages(); $pdf->AddPage(); //Títulos das colunas $pdf->SetFont('Arial', 'B', 10); //Define a cor RGB do fundo da celula $pdf->SetFillColor(178, 178, 178); //Faz a célula ser preenchida. Isso é feito setando 1 após a expressao de alinhamento $pdf->Cell(0, 6, 'Descrição do Momento de Repertório', 1, 0, 'L', 1); $pdf->SetX(170); $pdf->Cell(0, 6, 'Ativo'); //Monta as linhas com os dados da query $pdf->SetFont('Arial', '', 10);
$start = $_GET['page'] * $config['topiczahl']; $start = $start - $config['topiczahl']; // Some speed optimisation $speeder = $info['posts'] + 1; if ($speeder > $config['topiczahl']) { $searchsql = " LIMIT " . $start . "," . $config['topiczahl']; } else { $searchsql = " LIMIT " . $speeder; } $bbcode = initBBCodes(); $memberdata = cache_memberdata(); $pdftitle = html_entity_decode($config['fname'] . ": " . $pre . $info['topic']); $pdf = new PDF(); $pdf->SetCompression($config['pdfcompress']); $pdf->AliasNbPages('[Pages]'); $pdf->SetCreator('Viscacha ' . $config['version']); $pdf->SetAuthor($config['fname']); $pdf->SetSubject($pre . $info['topic']); $pdf->SetTitle($pre . $info['topic']); $pdf->AddPage(); $inner['body'] = ''; // prepare for vote if (!empty($info['vquestion']) && $_GET['page'] == 1) { $votes = 0; $inner['head'] = $lang->phrase('pdf_vote') . $info['vquestion']; $cachev = array(); $aids = array(); $vresult = $db->query("\n\tSELECT COUNT(r.id) as votes, v.id, v.answer\n\tFROM {$db->pre}vote AS v LEFT JOIN {$db->pre}votes AS r ON r.aid=v.id \n\tWHERE v.tid = '{$info['id']}' GROUP BY v.id ORDER BY v.id", __LINE__, __FILE__); while ($row = $db->fetch_assoc($vresult)) { $row['answer'] = $gpc->prepare($row['answer']); $cachev[] = $row;