$this->SetFont('freesans', '', 6, '', true);
        $this->Cell(0, 3, mb_strtoupper(api_text("module-diary_export-page"), 'UTF-8') . " " . $this->getAliasNumPage() . " " . mb_strtoupper(api_text("module-diary_export-pageOf"), 'UTF-8') . " " . $this->getAliasNbPages(), 0, 0, 'L', 0);
        $this->Cell(0, 3, mb_strtoupper(api_text("module-diary_export-footer"), 'UTF-8') . " " . $training->datetraining, 0, 0, 'R', 0);
        //$this->Cell(0,3,mb_strtoupper(api_text("module-diary_export-footer"),'UTF-8')." ".$GLOBALS['module-diary']->number,0,0,'R',0);
    }
}
// create new pdf document
$pdf = new MYPDF('L', 'mm', 'A4', true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
//$pdf->SetAuthor(api_account($training->addIdAccount)->name);
$pdf->SetTitle("Dettaglio allenamenti svolti");
//$pdf->SetSubject("Training nr. ".$training->number." - ".api_timestampFormat($request->timestamp,api_text("date")));
// header and footer
$pdf->setPrintHeader(true);
$pdf->setPrintFooter(true);
// set margins
$pdf->SetMargins(10, 30, 10);
$pdf->SetHeaderMargin(30);
$pdf->SetFooterMargin(10);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, 15);
// set font
$pdf->SetFont('freesans', '', 12, '', true);
// add a page
$pdf->AddPage();
// page styles
$pdf->SetTextColor(0);
$pdf->SetFillColor(245);
$fill = FALSE;
// border
Example #2
0
$pdf->SetTitle('Programa de Servicio de Salud');
$pdf->SetSubject('Detalle programa paciente');
$pdf->SetKeywords('Paciente, PSS, Programa');
//$pdf->SetHeaderData('../../img/logo.jpg', PDF_HEADER_LOGO_WIDTH,'SERVICIO DE SALUD ARICA ','HOSPITAL REGIONAL DE ARICA Y PARINACOTA');
$pdf->setHeaderFont(array('helvetica', '', 18));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(4, 5, 5, 1);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(0);
$pdf->SetAutoPageBreak(TRUE, 0);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setLanguageArray($l);
$pdf->setFontSubsetting(true);
$pdf->SetFont('helvetica', '', 9, '', true);
$pdf->setPrintFooter(false);
//CREA UNA PAGINA
$pdf->AddPage('L', 'A4');
//CARGA DE CLASES Y METODOS
require_once '../../class/Tipo_Producto.class.php';
$objTipPro = new Tipo_Producto();
require_once '../../class/Nota_Credito.class.php';
$objNot = new Nota_Credito();
require_once '../../class/Conectar.class.php';
$objCon = new Conectar();
require_once '../../class/Arqueo.class.php';
$objArq = new Arqueo();
require_once '../../class/Boleta.class.php';
$objBol = new Boleta();
require_once '../../class/Pagos.class.php';
$objPag = new Pagos();
 public function generarReporte($atributosReceta, $labelCabecera, $labelDetalle, $labelPie, $datosCabecera, $datosDetalle, $datosExamen, $datosExamenUni, $datosGrupo, $datosPie, $modo, $nombreReceta, $parametros)
 {
     $lblCabecera = array();
     $lblDetalle = array();
     $lblPie = array();
     $styleCL = array();
     $styleCD = array();
     $styleDL = array();
     $styleDD = array();
     $stylePL = array();
     $stylePD = array();
     $o_classGeneral = new classGeneral();
     $o_classGeneral->setLabelCabecera($labelCabecera, $atributosReceta);
     $styleCL = $o_classGeneral->getStyleCL();
     $styleCD = $o_classGeneral->getStyleCD();
     $lblCabecera = $o_classGeneral->getLblCabecera();
     $o_classGeneral->setLabelDetalle($labelDetalle, $atributosReceta);
     $styleDL = $o_classGeneral->getStyleDL();
     $styleDD = $o_classGeneral->getStyleDD();
     $lblDetalle = $o_classGeneral->getLblDetalle();
     $o_classGeneral->setLabelPie($labelPie, $atributosReceta);
     $stylePL = $o_classGeneral->getStylePL();
     $stylePD = $o_classGeneral->getStylePD();
     $lblPie = $o_classGeneral->getLblPie();
     $pdf = new MYPDF($parametros["PDF_PAGE_ORIENTATION"], PDF_UNIT, $parametros["PDF_PAGE_FORMAT"], true, 'UTF-8', false);
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Juan Carlos Ludeña Montesinos');
     $pdf->SetTitle('Generardor de Reportes');
     $pdf->SetSubject('Generardor de Reportes');
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     $pdf->setPrintHeader($parametros["PRINT_HEADER"]);
     $pdf->setPrintFooter($parametros["PRINT_FOOTER"]);
     $pdf->SetMargins($parametros["PDF_MARGIN_LEFT"], $parametros["PDF_MARGIN_TOP"], $parametros["PDF_MARGIN_RIGHT"]);
     $pdf->SetHeaderMargin($parametros["PDF_MARGIN_HEADER"]);
     $pdf->SetFooterMargin($parametros["PDF_MARGIN_FOOTER"]);
     $pdf->SetAutoPageBreak($parametros["AUTO_PAGE_BREAK"], $parametros["PDF_MARGIN_BOTTOM"]);
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     $pdf->SetFont('helvetica', '', 6);
     $pdf->AddPage();
     $style = array('position' => '', 'align' => 'C', 'stretch' => false, 'fitwidth' => true, 'cellfitalign' => '', 'border' => false, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => false, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4);
     $pdf->write1DBarcode($parametros["CODIGO_DE_BARRAS"], 'C39', 75, 278, 70, 8, 0.4, $style, 'N');
     $pdf->CargarDatos($lblCabecera, $lblDetalle, $lblPie, $datosCabecera, $datosDetalle, $datosExamen, $datosExamenUni, $datosGrupo, $datosPie, $styleCL, $styleDL, $stylePL, $styleCD, $styleDD, $stylePD, $modo);
     $pdf->lastPage();
     $pdf->Output($nombreReceta, 'I');
 }
Example #4
0
		   $reportname=$DB->get_record('block_cobalt_reports',array('id'=>$requestData['id']));
		  // Position at 15 mm from bottom
		 
		  // Set font
		  $this->SetFont('helvetica', 'I', 10);
         
		  $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
		  $this->SetY(-15);
		  $this->Cell(0, 10,'('.''.$reportname->name.''.')', 0, false, 'C', 0, '', 0, false, 'T', 'M');
	  }
   }
   
    $doc = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

    $doc->setPrintHeader(true);
    $doc->setPrintFooter(true);
   
   // set default header data
   $doc->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 059', PDF_HEADER_STRING);
   
   // set header and footer fonts
   $doc->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
   $doc->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
   
   // set default monospaced font
   $doc->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
   
   // set margins
   $doc->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
   $doc->SetHeaderMargin(PDF_MARGIN_HEADER);
   $doc->SetFooterMargin(PDF_MARGIN_FOOTER);
Example #5
0
 function dispNstore_digitalCertificate()
 {
     $oNstore_digitalModel = getModel('nstore_digital');
     $logged_info = Context::get('logged_info');
     $cart_srl = Context::get('cart_srl');
     if (!Context::get('is_logged')) {
         return new Object(-1, 'msg_login_required');
     }
     $config = $oNstore_digitalModel->getModuleConfig();
     $item_info = $oNstore_digitalModel->getPurchasedItem($logged_info->member_srl, $cart_srl);
     Context::set('item_info', $item_info);
     if (!in_array($item_info->order_status, array('3'))) {
         return new Object(-1, '구매완료된 상품이 아닙니다.');
     }
     // create new PDF document
     $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Nicola Asuni');
     $pdf->SetTitle('TCPDF Example 006');
     $pdf->SetSubject('TCPDF Tutorial');
     $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     /*
     		// set default header data
     		$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 006', 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));
     // remove default header/footer
     //$pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     //set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, 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);
     //set some language-dependent strings
     $pdf->setLanguageArray($l);
     // ---------------------------------------------------------
     // set font
     //$pdf->SetFont('dejavusans', '', 10);
     $pdf->SetFont('cid0kr', '', 16);
     // table line height
     //$pdf->setCellHeightRatio(1.9);
     $pdf->setCellHeightRatio(1.7);
     // add a page
     $pdf->AddPage();
     // output the HTML content
     $this->setTemplatePath($this->module_path . "tpl");
     $oTemplate =& TemplateHandler::getInstance();
     $output = $oTemplate->compile($this->module_path . 'tpl', 'certificate');
     $pdf->writeHTML($output, true, false, true, false, '');
     // reset pointer to the last page
     $pdf->lastPage();
     //Close and output PDF document
     $pdf->Output('certificate.pdf', 'I');
     exit;
 }
Example #6
0
 public function sendGiftCard($order_id)
 {
     $url = JURI::root();
     $giftcardmail_body = '';
     $giftcardmail = $this->_redshopMail->getMailtemplate(0, "giftcard_mail");
     if (count($giftcardmail) > 0) {
         $giftcardmail = $giftcardmail[0];
     }
     $query = 'SELECT * FROM ' . $this->_table_prefix . 'order_item ' . 'WHERE order_id = ' . (int) $order_id . ' AND is_giftcard=1';
     $this->_db->setQuery($query);
     $orders = $this->_db->loadObjectList();
     foreach ($orders as $eachorders) {
         $giftcardmailsub = $giftcardmail->mail_subject;
         $giftcardData = $this->_producthelper->getGiftcardData($eachorders->product_id);
         $thum_image = "<img src='" . REDSHOP_FRONT_IMAGES_ABSPATH . "giftcard/" . $giftcardData->giftcard_image . "'  title='" . $giftcardData->giftcard_name . "' alt='" . $giftcardData->giftcard_name . "'></a>";
         $giftcard_value = $this->_producthelper->getProductFormattedPrice($giftcardData->giftcard_value, true);
         $giftcard_price = $eachorders->product_final_price;
         $giftcardmail_body .= $giftcardmail->mail_body;
         $giftcard_name = $giftcardData->giftcard_name;
         $giftcardmail_body = str_replace('{giftcard_name}', $giftcardData->giftcard_name, $giftcardmail_body);
         $user_fields = $this->_producthelper->GetProdcutUserfield($eachorders->order_item_id, 13);
         $giftcardmail_body = str_replace("{product_userfields}", $user_fields, $giftcardmail_body);
         $giftcardmail_body = str_replace("{giftcard_price_lbl}", JText::_('COM_REDSHOP_GIFTCARD_PRICE_LBL'), $giftcardmail_body);
         $giftcardmail_body = str_replace("{giftcard_price}", $this->_producthelper->getProductFormattedPrice($giftcard_price), $giftcardmail_body);
         $giftcardmail_body = str_replace("{giftcard_reciver_name_lbl}", JText::_('COM_REDSHOP_GIFTCARD_RECIVER_NAME_LBL'), $giftcardmail_body);
         $giftcardmail_body = str_replace("{giftcard_reciver_email_lbl}", JText::_('COM_REDSHOP_GIFTCARD_RECIVER_EMAIL_LBL'), $giftcardmail_body);
         $giftcardmail_body = str_replace("{giftcard_reciver_email}", $eachorders->giftcard_user_email, $giftcardmail_body);
         $giftcardmail_body = str_replace("{giftcard_reciver_name}", $eachorders->giftcard_user_name, $giftcardmail_body);
         $giftcardmail_body = $this->_producthelper->getValidityDate($giftcardData->giftcard_validity, $giftcardmail_body);
         $giftcardmail_body = str_replace("{giftcard_value}", $giftcard_value, $giftcardmail_body);
         $giftcardmail_body = str_replace("{giftcard_value_lbl}", JText::_('COM_REDSHOP_GIFTCARD_VALUE_LBL'), $giftcardmail_body);
         $giftcardmail_body = str_replace("{giftcard_desc}", $giftcardData->giftcard_desc, $giftcardmail_body);
         $giftcardmail_body = str_replace("{giftcard_validity}", $giftcardData->giftcard_validity, $giftcardmail_body);
         $giftcardmailsub = str_replace('{giftcard_name}', $giftcardData->giftcard_name, $giftcardmailsub);
         $giftcardmailsub = str_replace('{giftcard_price}', $this->_producthelper->getProductFormattedPrice($giftcard_price), $giftcardmailsub);
         $giftcardmailsub = str_replace('{giftcard_value}', $giftcard_value, $giftcardmailsub);
         $giftcardmailsub = str_replace('{giftcard_validity}', $giftcardData->giftcard_validity, $giftcardmailsub);
         $gift_code = $this->_order_functions->random_gen_enc_key(12);
         $couponItems = $this->getTable('coupon_detail');
         if ($giftcardData->customer_amount) {
             $giftcardData->giftcard_value = $eachorders->product_final_price;
         }
         $couponItems->coupon_code = $gift_code;
         $couponItems->percent_or_total = 0;
         $couponItems->coupon_value = $giftcardData->giftcard_value;
         $couponItems->start_date = strtotime(date('d M Y'));
         $couponItems->end_date = mktime(0, 0, 0, date('m'), date('d') + $giftcardData->giftcard_validity, date('Y'));
         $couponItems->coupon_type = 0;
         $couponItems->userid = 0;
         $couponItems->coupon_left = 1;
         $couponItems->published = 1;
         if (!$couponItems->store()) {
             $this->setError($this->_db->getErrorMsg());
             return false;
         }
         $giftcardmail_body = str_replace("{giftcard_code_lbl}", JText::_('COM_REDSHOP_GIFTCARD_CODE_LBL'), $giftcardmail_body);
         $giftcardmail_body = str_replace("{giftcard_code}", $gift_code, $giftcardmail_body);
         ob_flush();
         ob_clean();
         echo "<div id='redshopcomponent' class='redshop'>";
         $is_giftcard = 1;
         $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
         if (file_exists(REDSHOP_FRONT_IMAGES_RELPATH . 'giftcard/' . $giftcardData->giftcard_bgimage) && $giftcardData->giftcard_bgimage) {
             $pdf->img_file = REDSHOP_FRONT_IMAGES_RELPATH . 'giftcard/' . $giftcardData->giftcard_bgimage;
         }
         $pdf->SetCreator(PDF_CREATOR);
         $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
         $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
         $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
         $pdf->SetHeaderMargin(0);
         $pdf->SetFooterMargin(0);
         $pdf->setPrintFooter(false);
         $pdf->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM);
         $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
         $pdf->SetFont('times', '', 18);
         $pdf->AddPage();
         $pdfImage = "";
         if (file_exists(REDSHOP_FRONT_IMAGES_RELPATH . 'giftcard/' . $giftcardData->giftcard_image) && $giftcardData->giftcard_image) {
             $pdfImage = '<img src="' . REDSHOP_FRONT_IMAGES_RELPATH . 'giftcard/' . $giftcardData->giftcard_image . '" alt="test alt attribute" width="150px" height="150px" border="0" />';
         }
         $giftcardmail_body = str_replace("{giftcard_image}", $pdfImage, $giftcardmail_body);
         $pdf->writeHTML($giftcardmail_body, $ln = true, $fill = false, $reseth = false, $cell = false, $align = '');
         $g_pdfName = time();
         $pdf->Output(JPATH_SITE . '/components/com_redshop/assets/orders/' . $g_pdfName . ".pdf", "F");
         $config = JFactory::getConfig();
         $from = $config->getValue('mailfrom');
         $fromname = $config->getValue('fromname');
         $giftcard_attachment = JPATH_SITE . '/components/com_redshop/assets/orders/' . $g_pdfName . ".pdf";
         JUtility::sendMail($from, $fromname, $eachorders->giftcard_user_email, $giftcardmailsub, $giftcardmail_body, 1, '', '', $giftcard_attachment);
     }
 }
 public function generarMYPDF($atributosReceta, $labelCabecera, $labelDetalle, $labelPie, $datosCabecera, $datosDetalle, $datosPie, $modo, $nombreReceta, $parametros)
 {
     /* =======================================        Obs       ============================================ */
     // width->0, height->1, top->2, left->3, color->4 TipoLetra=>5 EstiloLetra=>6 TamañoLetra=>6
     /* ===================================================================================================== */
     $lblCabecera = array();
     $lblDetalle = array();
     $lblPie = array();
     $styleCL = array();
     $styleCD = array();
     $styleDL = array();
     $styleDD = array();
     $stylePL = array();
     $stylePD = array();
     $o_classGeneral = new classGeneral();
     $o_classGeneral->setLabelCabecera($labelCabecera, $atributosReceta);
     $styleCL = $o_classGeneral->getStyleCL();
     $styleCD = $o_classGeneral->getStyleCD();
     $lblCabecera = $o_classGeneral->getLblCabecera();
     $o_classGeneral->setLabelDetalle($labelDetalle, $atributosReceta);
     $styleDL = $o_classGeneral->getStyleDL();
     $styleDD = $o_classGeneral->getStyleDD();
     $lblDetalle = $o_classGeneral->getLblDetalle();
     $o_classGeneral->setLabelPie($labelPie, $atributosReceta);
     $stylePL = $o_classGeneral->getStylePL();
     $stylePD = $o_classGeneral->getStylePD();
     $lblPie = $o_classGeneral->getLblPie();
     /* ====================================================================================================== */
     // create new PDF document  //PDF_PAGE_ORIENTATION(P,L)
     $pdf = new MYPDF($parametros["PDF_PAGE_ORIENTATION"], PDF_UNIT, $parametros["PDF_PAGE_FORMAT"], true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Juan Carlos Ludeña Montesinos');
     $pdf->SetTitle('Generardor de Reportes');
     $pdf->SetSubject('Generardor de Reportes');
     //$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     // set default header data
     //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 011', 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);
     // remove default header/footer
     $pdf->setPrintHeader($parametros["PRINT_HEADER"]);
     $pdf->setPrintFooter($parametros["PRINT_FOOTER"]);
     //set margins
     $pdf->SetMargins($parametros["PDF_MARGIN_LEFT"], $parametros["PDF_MARGIN_TOP"], $parametros["PDF_MARGIN_RIGHT"]);
     $pdf->SetHeaderMargin($parametros["PDF_MARGIN_HEADER"]);
     $pdf->SetFooterMargin($parametros["PDF_MARGIN_FOOTER"]);
     //set auto page breaks
     $pdf->SetAutoPageBreak($parametros["AUTO_PAGE_BREAK"], $parametros["PDF_MARGIN_BOTTOM"]);
     //set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     //set some language-dependent strings
     //$pdf->setLanguageArray($l);
     // ---------------------------------------------------------
     // set font
     $pdf->SetFont('helvetica', '', 6);
     // add a page
     $pdf->AddPage();
     //Data loading
     // print colored table
     $pdf->ColoredTable($lblCabecera, $lblDetalle, $lblPie, $datosCabecera, $datosDetalle, $datosPie, $styleCL, $styleDL, $stylePL, $styleCD, $styleDD, $stylePD, $modo);
     $pdf->lastPage();
     // ---------------------------------------------------------
     //Close and output PDF document
     $pdf->Output($nombreReceta, 'I');
     //$pdf->extractCSSproperties();
     //============================================================+
     // END OF FILE
     //============================================================+
 }