Example #1
15
 public function Footer()
 {
     $txt = '';
     if ($this->footer_param['form']) {
         $txt = HTML2PDF::textGET('pdf05');
     }
     if ($this->footer_param['date'] && $this->footer_param['heure']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf03');
     }
     if ($this->footer_param['date'] && !$this->footer_param['heure']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf01');
     }
     if (!$this->footer_param['date'] && $this->footer_param['heure']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf02');
     }
     if ($this->footer_param['page']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf04');
     }
     if (strlen($txt) > 0) {
         $txt = str_replace('[[date_d]]', date('d'), $txt);
         $txt = str_replace('[[date_m]]', date('m'), $txt);
         $txt = str_replace('[[date_y]]', date('Y'), $txt);
         $txt = str_replace('[[date_h]]', date('H'), $txt);
         $txt = str_replace('[[date_i]]', date('i'), $txt);
         $txt = str_replace('[[date_s]]', date('s'), $txt);
         $txt = str_replace('[[current]]', $this->PageNo(), $txt);
         $txt = str_replace('[[nb]]', '{nb}', $txt);
         parent::SetY(-11);
         $this->setOverline(false);
         $this->SetFont('helvetica', 'I', 8);
         $this->Cell(0, 10, $txt, 0, 0, 'R');
     }
 }
Example #2
2
 public function testPdfOutput()
 {
     // create new PDF document
     $pdf = new TCPDF(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 027');
     $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 . ' 027', 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, 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 (optional)
     $pdf->setLanguageArray($this->langSettings);
     // ---------------------------------------------------------
     // set a barcode on the page footer
     $pdf->setBarcode('2015-06-18 09:12:27');
     // set font
     $pdf->SetFont('helvetica', '', 11);
     // add a page
     $pdf->AddPage();
     // print a message
     $txt = "You can also export 1D barcodes in other formats (PNG, SVG, HTML). Check the examples inside the barcodes directory.\n";
     $pdf->MultiCell(70, 50, $txt, 0, 'J', false, 1, 125, 30, true, 0, false, true, 0, 'T', false);
     $pdf->SetY(30);
     // -----------------------------------------------------------------------------
     $pdf->SetFont('helvetica', '', 10);
     // define barcode style
     $style = array('position' => '', 'align' => 'C', 'stretch' => false, 'fitwidth' => true, 'cellfitalign' => '', 'border' => true, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4);
     // PRINT VARIOUS 1D BARCODES
     // CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
     $pdf->Cell(0, 0, 'CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9', 0, 1);
     $pdf->write1DBarcode('CODE 39', 'C39', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // CODE 39 + CHECKSUM
     $pdf->Cell(0, 0, 'CODE 39 + CHECKSUM', 0, 1);
     $pdf->write1DBarcode('CODE 39 +', 'C39+', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // CODE 39 EXTENDED
     $pdf->Cell(0, 0, 'CODE 39 EXTENDED', 0, 1);
     $pdf->write1DBarcode('CODE 39 E', 'C39E', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // CODE 39 EXTENDED + CHECKSUM
     $pdf->Cell(0, 0, 'CODE 39 EXTENDED + CHECKSUM', 0, 1);
     $pdf->write1DBarcode('CODE 39 E+', 'C39E+', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // CODE 93 - USS-93
     $pdf->Cell(0, 0, 'CODE 93 - USS-93', 0, 1);
     $pdf->write1DBarcode('TEST93', 'C93', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // Standard 2 of 5
     $pdf->Cell(0, 0, 'Standard 2 of 5', 0, 1);
     $pdf->write1DBarcode('1234567', 'S25', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // Standard 2 of 5 + CHECKSUM
     $pdf->Cell(0, 0, 'Standard 2 of 5 + CHECKSUM', 0, 1);
     $pdf->write1DBarcode('1234567', 'S25+', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // Interleaved 2 of 5
     $pdf->Cell(0, 0, 'Interleaved 2 of 5', 0, 1);
     $pdf->write1DBarcode('1234567', 'I25', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // Interleaved 2 of 5 + CHECKSUM
     $pdf->Cell(0, 0, 'Interleaved 2 of 5 + CHECKSUM', 0, 1);
     $pdf->write1DBarcode('1234567', 'I25+', '', '', '', 18, 0.4, $style, 'N');
     // add a page ----------
     $pdf->AddPage();
     // CODE 128 AUTO
     $pdf->Cell(0, 0, 'CODE 128 AUTO', 0, 1);
     $pdf->write1DBarcode('CODE 128 AUTO', 'C128', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // CODE 128 A
     $pdf->Cell(0, 0, 'CODE 128 A', 0, 1);
     $pdf->write1DBarcode('CODE 128 A', 'C128A', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // CODE 128 B
     $pdf->Cell(0, 0, 'CODE 128 B', 0, 1);
     $pdf->write1DBarcode('CODE 128 B', 'C128B', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // CODE 128 C
     $pdf->Cell(0, 0, 'CODE 128 C', 0, 1);
     $pdf->write1DBarcode('0123456789', 'C128C', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // EAN 8
     $pdf->Cell(0, 0, 'EAN 8', 0, 1);
     $pdf->write1DBarcode('1234567', 'EAN8', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // EAN 13
     $pdf->Cell(0, 0, 'EAN 13', 0, 1);
     $pdf->write1DBarcode('1234567890128', 'EAN13', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // UPC-A
     $pdf->Cell(0, 0, 'UPC-A', 0, 1);
     $pdf->write1DBarcode('12345678901', 'UPCA', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // UPC-E
     $pdf->Cell(0, 0, 'UPC-E', 0, 1);
     $pdf->write1DBarcode('04210000526', 'UPCE', '', '', '', 18, 0.4, $style, 'N');
     // add a page ----------
     $pdf->AddPage();
     // 5-Digits UPC-Based Extension
     $pdf->Cell(0, 0, '5-Digits UPC-Based Extension', 0, 1);
     $pdf->write1DBarcode('51234', 'EAN5', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // 2-Digits UPC-Based Extension
     $pdf->Cell(0, 0, '2-Digits UPC-Based Extension', 0, 1);
     $pdf->write1DBarcode('34', 'EAN2', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // MSI
     $pdf->Cell(0, 0, 'MSI', 0, 1);
     $pdf->write1DBarcode('80523', 'MSI', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // MSI + CHECKSUM (module 11)
     $pdf->Cell(0, 0, 'MSI + CHECKSUM (module 11)', 0, 1);
     $pdf->write1DBarcode('80523', 'MSI+', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // CODABAR
     $pdf->Cell(0, 0, 'CODABAR', 0, 1);
     $pdf->write1DBarcode('123456789', 'CODABAR', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // CODE 11
     $pdf->Cell(0, 0, 'CODE 11', 0, 1);
     $pdf->write1DBarcode('123-456-789', 'CODE11', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // PHARMACODE
     $pdf->Cell(0, 0, 'PHARMACODE', 0, 1);
     $pdf->write1DBarcode('789', 'PHARMA', '', '', '', 18, 0.4, $style, 'N');
     $pdf->Ln();
     // PHARMACODE TWO-TRACKS
     $pdf->Cell(0, 0, 'PHARMACODE TWO-TRACKS', 0, 1);
     $pdf->write1DBarcode('105', 'PHARMA2T', '', '', '', 18, 2, $style, 'N');
     // add a page ----------
     $pdf->AddPage();
     // IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
     $pdf->Cell(0, 0, 'IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200', 0, 1);
     $pdf->write1DBarcode('01234567094987654321-01234567891', 'IMB', '', '', '', 15, 0.6, $style, 'N');
     $pdf->Ln();
     // POSTNET
     $pdf->Cell(0, 0, 'POSTNET', 0, 1);
     $pdf->write1DBarcode('98000', 'POSTNET', '', '', '', 15, 0.6, $style, 'N');
     $pdf->Ln();
     // PLANET
     $pdf->Cell(0, 0, 'PLANET', 0, 1);
     $pdf->write1DBarcode('98000', 'PLANET', '', '', '', 15, 0.6, $style, 'N');
     $pdf->Ln();
     // RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
     $pdf->Cell(0, 0, 'RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)', 0, 1);
     $pdf->write1DBarcode('SN34RD1A', 'RMS4CC', '', '', '', 15, 0.6, $style, 'N');
     $pdf->Ln();
     // KIX (Klant index - Customer index)
     $pdf->Cell(0, 0, 'KIX (Klant index - Customer index)', 0, 1);
     $pdf->write1DBarcode('SN34RDX1A', 'KIX', '', '', '', 15, 0.6, $style, 'N');
     // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     // TEST BARCODE ALIGNMENTS
     // add a page
     $pdf->AddPage();
     // set a background color
     $style['bgcolor'] = array(255, 255, 240);
     $style['fgcolor'] = array(127, 0, 0);
     // Left position
     $style['position'] = 'L';
     $pdf->write1DBarcode('LEFT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
     $pdf->Ln(2);
     // Center position
     $style['position'] = 'C';
     $pdf->write1DBarcode('CENTER', 'C128A', '', '', '', 15, 0.4, $style, 'N');
     $pdf->Ln(2);
     // Right position
     $style['position'] = 'R';
     $pdf->write1DBarcode('RIGHT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
     $pdf->Ln(2);
     // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
     $style['fgcolor'] = array(0, 127, 0);
     $style['position'] = '';
     $style['stretch'] = false;
     // disable stretch
     $style['fitwidth'] = false;
     // disable fitwidth
     // Left alignment
     $style['align'] = 'L';
     $pdf->write1DBarcode('LEFT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
     $pdf->Ln(2);
     // Center alignment
     $style['align'] = 'C';
     $pdf->write1DBarcode('CENTER', 'C128A', '', '', '', 15, 0.4, $style, 'N');
     $pdf->Ln(2);
     // Right alignment
     $style['align'] = 'R';
     $pdf->write1DBarcode('RIGHT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
     $pdf->Ln(2);
     // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
     $style['fgcolor'] = array(0, 64, 127);
     $style['position'] = '';
     $style['stretch'] = false;
     // disable stretch
     $style['fitwidth'] = true;
     // disable fitwidth
     // Left alignment
     $style['cellfitalign'] = 'L';
     $pdf->write1DBarcode('LEFT', 'C128A', 105, '', 90, 15, 0.4, $style, 'N');
     $pdf->Ln(2);
     // Center alignment
     $style['cellfitalign'] = 'C';
     $pdf->write1DBarcode('CENTER', 'C128A', 105, '', 90, 15, 0.4, $style, 'N');
     $pdf->Ln(2);
     // Right alignment
     $style['cellfitalign'] = 'R';
     $pdf->write1DBarcode('RIGHT', 'C128A', 105, '', 90, 15, 0.4, $style, 'N');
     $pdf->Ln(2);
     // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
     $style['fgcolor'] = array(127, 0, 127);
     // Left alignment
     $style['position'] = 'L';
     $pdf->write1DBarcode('LEFT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
     $pdf->Ln(2);
     // Center alignment
     $style['position'] = 'C';
     $pdf->write1DBarcode('CENTER', 'C128A', '', '', '', 15, 0.4, $style, 'N');
     $pdf->Ln(2);
     // Right alignment
     $style['position'] = 'R';
     $pdf->write1DBarcode('RIGHT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
     // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     // TEST BARCODE STYLE
     // define barcode style
     $style = array('position' => '', 'align' => '', 'stretch' => true, 'fitwidth' => false, 'cellfitalign' => '', 'border' => true, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 128), 'bgcolor' => array(255, 255, 128), 'text' => true, 'label' => 'CUSTOM LABEL', 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4);
     // CODE 39 EXTENDED + CHECKSUM
     $pdf->Cell(0, 0, 'CODE 39 EXTENDED + CHECKSUM', 0, 1);
     $pdf->SetLineStyle(array('width' => 1, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0)));
     $pdf->write1DBarcode('CODE 39 E+', 'C39E+', '', '', 120, 25, 0.4, $style, 'N');
     $this->comparePdfs($pdf);
 }
Example #3
1
// 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('helvetica', '', 10);
// add a page
$pdf->AddPage();
// NOTE: Uncomment the following line to rasterize SVG image using the ImageMagick library.
//$pdf->setRasterizeVectorImages(true);
$pdf->ImageSVG($file = '../images/testsvg.svg', $x = 15, $y = 30, $w = '', $h = '', $link = 'http://www.tcpdf.org', $align = '', $palign = '', $border = 1, $fitonpage = false);
$pdf->ImageSVG($file = '../images/tux.svg', $x = 30, $y = 100, $w = '', $h = 100, $link = '', $align = '', $palign = '', $border = 0, $fitonpage = false);
$pdf->SetFont('helvetica', '', 8);
$pdf->SetY(195);
$txt = '© The copyright holder of the above Tux image is Larry Ewing, allows anyone to use it for any purpose, provided that the copyright holder is properly attributed. Redistribution, derivative work, commercial use, and all other use is permitted.';
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_058.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
Example #4
0
 public function testPdfOutput()
 {
     // create new PDF document
     $pdf = new TCPDF(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 058');
     $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 . ' 058', 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, 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 (optional)
     $pdf->setLanguageArray($this->langSettings);
     // ---------------------------------------------------------
     // set font
     $pdf->SetFont('helvetica', '', 10);
     // add a page
     $pdf->AddPage();
     // NOTE: Uncomment the following line to rasterize SVG image using the ImageMagick library.
     //$pdf->setRasterizeVectorImages(true);
     $pdf->ImageSVG($file = 'tests/images/testsvg.svg', $x = 15, $y = 30, $w = '', $h = '', $link = 'http://www.tcpdf.org', $align = '', $palign = '', $border = 1, $fitonpage = false);
     $pdf->ImageSVG($file = 'tests/images/tux.svg', $x = 30, $y = 100, $w = '', $h = 100, $link = '', $align = '', $palign = '', $border = 0, $fitonpage = false);
     $pdf->SetFont('helvetica', '', 8);
     $pdf->SetY(195);
     $txt = '© The copyright holder of the above Tux image is Larry Ewing, allows anyone to use it for any purpose, provided that the copyright holder is properly attributed. Redistribution, derivative work, commercial use, and all other use is permitted.';
     $pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
     // ---------------------------------------------------------
     $this->comparePdfs($pdf);
 }
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
    require_once dirname(__FILE__) . '/lang/eng.php';
    $pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('freeserif', 'B', 14);
// add a page
$pdf->AddPage();
$cfg = erConfigClassLhConfig::getInstance();
// set some text to print
$txt = $cfg->getSetting('site', 'seller_attributes');
// print a block of text using Write()
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
$pdf->SetY(25);
// set some text to print
//$txt = "Buyer\nremdex@gmail.com";
$txt = erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Date Issued') . ": " . date('Y-m-d', $invoice->odate) . "\n";
$txt .= erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Invoice number') . ": " . date('Ymd', $invoice->odate) . $invoice->id;
// print a block of text using Write()
$pdf->Write(0, $txt, '', 0, 'R', true, 0, false, false, 0);
// set font
$pdf->SetFont('freeserif', '', 10);
// ---------------------------------------------------------
//$pdf->SetX(0);
$pdf->SetY(65);
$pdf->writeHTML("\r\n\t\t\r\n<table  border=\"1\">\r\n<tr>\r\n\t\t<th><b>" . erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Desciption') . "</b></th>\r\n\t\t<th><b>" . erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Price') . "</b></th>\r\n</tr>\t\t\r\n<tr>\r\n\t<td>{$invoice->option_selection1}</td>\t\t\r\n\t<td>{$invoice->price_front}</td>\t\t\r\n</tr>\r\n</table>\r\n");
$pdf->Write(0, erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Total') . ": " . $invoice->price_front, '', 0, 'R', true, 0, false, false, 0);
$pdf->SetFont('freeserif', '', 14);
$pdf->writeHTML(erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Bill to') . ":<br/>" . $invoice->customer_name);
Example #6
0
    /**
     * we redifine the original SetY method, because we don't want the automatic treatment.
     * It is HTML2PDF that make the treatment.
     * If language is RTL direction this method will call to parent (TCPDF class).
     *
     * @param float   $y
     * @param boolean $resetx Reset the X position
     * @param boolean $rtloff 
     * @access public
     */
    public function SetY($y, $resetx=true, $rtloff=false)
    {
        if (!$rtloff AND $this->rtl) {
            parent::SetY($y, $resetx, $rtloff);
        } else {
            if ($resetx)
                $this->x=$this->lMargin;

            $this->y=$y;
        }
    }
Example #7
0
 $i = -1;
 while (($line = fgets($handle)) !== false) {
     $i = ($i + 1) % $cellsPerPage;
     if ($i == 0) {
         //page change
         $x = $leftMargin;
         $y = $topMargin;
         $pdf->AddPage();
     }
     if ($i % 2 == 0) {
         $x = $leftMargin;
     } else {
         $x = $leftMargin + $cellWidth;
     }
     //template
     $pdf->SetY($y);
     $pdf->SetX($x);
     $pdf->Image('config/template.png', $x, $y, $cellWidth, $cellHeight);
     //border
     $pdf->MultiCell($cellWidth, $cellHeight, "", 1, 'C');
     //name
     $pdf->SetY($y + 27.5);
     $pdf->SetX($x);
     $pdf->SetFont('freemono', '', 18);
     $pdf->MultiCell($cellWidth, 20, $line, 0, 'C');
     //footer
     $pdf->SetFont('freemono', '', 9);
     $pdf->SetY($y + 42.5);
     $pdf->SetX($x);
     $pdf->MultiCell($cellWidth, 20, $footer, 0, 'C', 0, 0, '', '', true, 0, true);
     if ($i % 2 == 1) {
Example #8
0
 public function tax_continuous_type4($id = null, $year = null)
 {
     if (Session::get('level') != '') {
         $y = Input::get('y3');
         if ($y != '') {
             $year = $y;
             $id = 'all';
         }
         $pdf = new TCPDF();
         $pdf->SetPrintHeader(false);
         $pdf->SetPrintFooter(false);
         $n = DB::select('select * from s_general_data');
         foreach ($n as $k) {
             $name = $k->name;
             $address = $k->address;
             $address2 = $k->address2;
             $tax_id2 = $k->tax_id2;
             $director = $k->director;
         }
         $sql = ' select concat(n.pname,"",n.fname," ",n.lname) as name, s.cid, s.tax_id,sum(s.salary+s.r_other) as salary, sum(s.r_c) as r_c, sum(s.special_m+s.pts+s.pts2) as special, sum(s.tax) as tax ,sum(s.kbk) as kbk from s_salary_ocsc_detail s left join n_datageneral n on n.cid=s.cid left join n_position_salary p on p.cid=n.cid where  s.cid=5350400051484  and  year(s.order_date)=' . $year . ' group by s.cid order by n.datainfoID asc ';
         $result = DB::select($sql);
         foreach ($result as $key) {
             $pdf->AddPage('P', 'A4');
             $pdf->SetFont('freeserif', 'B', 11, '', true);
             $pdf->MultiCell(185, 5, 'เลขที่ งป. ........................./ ' . ($year == 'null' ? $this->yearThai() : $year + 543), 0, 'R', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', 'B', 16, '', true);
             $pdf->SetY(25);
             $pdf->SetX(18);
             $pdf->MultiCell(177, 5, 'หนังสือรับรองการหักภาษี ณ ที่จ่าย', 0, 'C', 0, 1, '', '', true);
             $pdf->SetY(34);
             $pdf->SetX(18);
             $pdf->MultiCell(177, 5, 'ตามมาตรา 50 ทวิ แห่งประมวลรัษฎากร', 0, 'C', 0, 1, '', '', true);
             //===== แนวตั้ง =====//
             $linever1 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
             $pdf->Line(18, 190, 18, 50, $linever1);
             $linever2 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
             $pdf->Line(80, 190, 80, 50, $linever2);
             $linever3 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
             $pdf->Line(110, 190, 110, 50, $linever3);
             $linever4 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
             $pdf->Line(135, 190, 135, 50, $linever4);
             $linever5 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
             $pdf->Line(165, 190, 165, 50, $linever5);
             $linever6 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
             $pdf->Line(195, 190, 195, 50, $linever6);
             //===== แนวนอน =====//
             $linetop = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
             $pdf->Line(18, 50, 195, 50, $linetop);
             $linetop2 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
             $pdf->Line(80, 63, 195, 63, $linetop2);
             $linetop3 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
             $pdf->Line(18, 120, 80, 120, $linetop3);
             $linetop4 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
             $pdf->Line(80, 180, 195, 180, $linetop4);
             $linetop5 = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
             $pdf->Line(18, 190, 195, 190, $linetop5);
             //======= text in box 1 ========//
             $pdf->SetFont('freeserif', '', 13, '', true);
             $pdf->SetY(52);
             $pdf->SetX(19);
             $pdf->MultiCell(62, 5, 'ชื่อและที่อยู่ของผู้มีหน้าที่หักภาษี ณ ที่จ่าย บุคคลคณะบุคคล นิติบุคคล ส่วนราชการ องค์การ รัฐวิสาหกิจ ฯลฯ ', 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', 'B', 13, '', true);
             $pdf->SetY(82);
             $pdf->SetX(19);
             $pdf->MultiCell(62, 5, $address2, 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', 'B', 13, '', true);
             $pdf->SetY(105);
             $pdf->SetX(19);
             $pdf->MultiCell(40, 5, $tax_id2, 0, 'L', 0, 1, '', '', true);
             //======= text in box 2 ========//
             $pdf->SetFont('freeserif', '', 13, '', true);
             $pdf->SetY(122);
             $pdf->SetX(19);
             $pdf->MultiCell(62, 5, 'ชื่อและที่อยู่ของผู้ถูกหักภาษี ณ ที่จ่าย', 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', 'B', 12, '', true);
             $pdf->SetY(137);
             $pdf->SetX(21);
             $pdf->MultiCell(59, 5, $key->name, 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', '', 13, '', true);
             $pdf->SetY(145);
             $pdf->SetX(19);
             $pdf->MultiCell(62, 5, $address, 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', 'B', 13, '', true);
             $pdf->SetY(165);
             $pdf->SetX(19);
             $pdf->MultiCell(62, 5, 'เลขประจำตัวผู้เสียภาษีของผู้ถูกหักภาษี ณ ที่จ่าย', 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', '', 12, '', true);
             $pdf->SetY(178);
             $pdf->SetX(22);
             $pdf->MultiCell(62, 5, $key->cid, 0, 'L', 0, 1, '', '', true);
             //======= text in box 3 header content ========//
             $pdf->SetFont('freeserif', 'B', 13, '', true);
             $pdf->SetY(54);
             $pdf->SetX(83);
             $pdf->MultiCell(32, 5, 'เงินได้ที่จ่าย', 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', 'B', 13, '', true);
             $pdf->SetY(54);
             $pdf->SetX(111);
             $pdf->MultiCell(32, 5, 'ปีภาษีที่จ่าย', 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', 'B', 13, '', true);
             $pdf->SetY(54);
             $pdf->SetX(138);
             $pdf->MultiCell(32, 5, 'จำนวนเงิน', 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', 'B', 13, '', true);
             $pdf->SetY(54);
             $pdf->SetX(167);
             $pdf->MultiCell(32, 5, 'ภาษีที่หักไว้', 0, 'L', 0, 1, '', '', true);
             //============= text in content ================//
             $pdf->SetFont('freeserif', '', 12, '', true);
             //-----col 1
             $pdf->SetY(70);
             $pdf->SetX(80);
             $pdf->MultiCell(30, 5, 'เงินเดือน ค่าจ้าง บำนาญ เบี้ยเลี้ยง โบนัส ตามมาตรา 40(1)', 0, 'L', 0, 1, '', '', true);
             $pdf->SetY(95);
             $pdf->SetX(80);
             $pdf->MultiCell(31, 5, 'เงินประจำตำแหน่ง', 0, 'L', 0, 1, '', '', true);
             $pdf->SetY(104);
             $pdf->SetX(80);
             $pdf->MultiCell(27, 5, 'เงินค่าตอบแทนพิเศษ พตส ค่าครองชีพ', 0, 'L', 0, 1, '', '', true);
             //-----col 2
             $pdf->SetY(70);
             $pdf->SetX(116);
             $pdf->MultiCell(31, 5, $year == 'null' ? $this->yearThai() : $year + 543, 0, 'L', 0, 1, '', '', true);
             //-----col 3
             $pdf->SetY(70);
             $pdf->SetX(135);
             $pdf->MultiCell(30, 5, number_format($key->salary, 2), 0, 'R', 0, 1, '', '', true);
             $pdf->SetY(95);
             $pdf->SetX(135);
             $pdf->MultiCell(30, 5, number_format($key->r_c, 2), 0, 'R', 0, 1, '', '', true);
             $pdf->SetY(104);
             $pdf->SetX(135);
             $pdf->MultiCell(30, 5, number_format($key->special, 2), 0, 'R', 0, 1, '', '', true);
             //-----col 4
             $pdf->SetY(70);
             $pdf->SetX(165);
             $pdf->MultiCell(30, 5, number_format($key->tax, 2), 0, 'R', 0, 1, '', '', true);
             //============= text in box 4 footer sum ============//
             $pdf->SetFont('freeserif', 'B', 13, '', true);
             $pdf->SetY(182);
             $pdf->SetX(89);
             $pdf->MultiCell(32, 5, 'รวม', 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', '', 12, '', true);
             $pdf->SetY(182);
             $pdf->SetX(135);
             $pdf->MultiCell(30, 5, number_format($key->salary + $key->special + $key->r_c, 2), 0, 'R', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', '', 12, '', true);
             $pdf->SetY(182);
             $pdf->SetX(165);
             $pdf->MultiCell(30, 5, number_format($key->tax, 2), 0, 'R', 0, 1, '', '', true);
             //============= text footer ================//
             $pdf->SetFont('freeserif', '', 12, '', true);
             $pdf->SetY(195);
             $pdf->SetX(22);
             $pdf->MultiCell(32, 5, 'ผู้จ่ายเงิน', 0, 'L', 0, 1, '', '', true);
             $pdf->SetY(195);
             $pdf->SetX(39);
             $pdf->MultiCell(5, 5, '', 1, 'L', 0, 1, '', '', true);
             $pdf->SetY(195);
             $pdf->SetX(44);
             $pdf->MultiCell(30, 5, '(1) หัก ณ ที่จ่าย', 0, 'L', 0, 1, '', '', true);
             $pdf->SetY(195);
             $pdf->SetX(73);
             $pdf->MultiCell(5, 5, '', 1, 'L', 0, 1, '', '', true);
             $pdf->SetY(195);
             $pdf->SetX(78);
             $pdf->MultiCell(35, 5, '(2) ออกให้ตลอดไป', 0, 'L', 0, 1, '', '', true);
             $pdf->SetY(195);
             $pdf->SetX(112);
             $pdf->MultiCell(5, 5, '', 1, 'L', 0, 1, '', '', true);
             $pdf->SetY(195);
             $pdf->SetX(117);
             $pdf->MultiCell(35, 5, '(3) ออกให้ครั้งเดียว', 0, 'L', 0, 1, '', '', true);
             $pdf->SetY(205);
             $pdf->SetX(39);
             $pdf->MultiCell(5, 5, ' /', 1, 'L', 0, 1, '', '', true);
             $pdf->SetY(205);
             $pdf->SetX(44);
             $pdf->MultiCell(100, 5, '(4) เงินสบทบกองทุนประกันสังคม ' . '  ' . number_format($key->kbk, 2) . ' บาท', 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', 'B', 12, '', true);
             $pdf->SetY(220);
             $pdf->SetX(18);
             $pdf->MultiCell(177, 5, 'ข้าพเจ้าขอรับรองว่า ข้อความและตัวเลขดังกล่าวข้างต้นนี้ถูกต้องตามความเป็นจริงทุกประการ', 0, 'R', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', '', 12, '', true);
             $pdf->SetY(235);
             $pdf->SetX(32);
             $pdf->MultiCell(170, 5, 'ลงชื่อ...........................................................ผู้มีหน้าที่หักภาษี ณ ที่จ่าย', 0, 'C', 0, 1, '', '', true);
             $pdf->SetY(245);
             $pdf->SetX(32);
             $pdf->MultiCell(140, 5, $director, 0, 'C', 0, 1, '', '', true);
             $pdf->SetY(255);
             $pdf->SetX(32);
             $pdf->MultiCell(140, 5, 'ทันตแพทย์เชี่ยวชาญ ปฎิบัติราชการแทน', 0, 'C', 0, 1, '', '', true);
             $pdf->SetY(265);
             $pdf->SetX(32);
             $pdf->MultiCell(140, 5, 'ผู้อำนวยการโรงพยาบาลโนนไทย', 0, 'C', 0, 1, '', '', true);
         }
         $filename = storage_path() . '/report_tax_continuous_emp4.pdf';
         // Response::download($filename);
         $contents = $pdf->output($filename, 'I');
         $headers = array('Content-Type' => 'application/pdf');
         return Response::make($contents, 200, $headers);
     } else {
         return View::make('login.index');
     }
 }
Example #9
0
 public function testPdfOutput()
 {
     // create new PDF document
     $pdf = new TCPDF(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 028');
     $pdf->SetSubject('TCPDF Tutorial');
     $pdf->SetKeywords('TCPDF, PDF, example, test, guide');
     // remove default header/footer
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // set margins
     $pdf->SetMargins(10, PDF_MARGIN_TOP, 10);
     // 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 (optional)
     $pdf->setLanguageArray($this->langSettings);
     // ---------------------------------------------------------
     $pdf->SetDisplayMode('fullpage', 'SinglePage', 'UseNone');
     // set font
     $pdf->SetFont('times', 'B', 20);
     $pdf->AddPage('P', 'A4');
     $pdf->Cell(0, 0, 'A4 PORTRAIT', 1, 1, 'C');
     $pdf->AddPage('L', 'A4');
     $pdf->Cell(0, 0, 'A4 LANDSCAPE', 1, 1, 'C');
     $pdf->AddPage('P', 'A5');
     $pdf->Cell(0, 0, 'A5 PORTRAIT', 1, 1, 'C');
     $pdf->AddPage('L', 'A5');
     $pdf->Cell(0, 0, 'A5 LANDSCAPE', 1, 1, 'C');
     $pdf->AddPage('P', 'A6');
     $pdf->Cell(0, 0, 'A6 PORTRAIT', 1, 1, 'C');
     $pdf->AddPage('L', 'A6');
     $pdf->Cell(0, 0, 'A6 LANDSCAPE', 1, 1, 'C');
     $pdf->AddPage('P', 'A7');
     $pdf->Cell(0, 0, 'A7 PORTRAIT', 1, 1, 'C');
     $pdf->AddPage('L', 'A7');
     $pdf->Cell(0, 0, 'A7 LANDSCAPE', 1, 1, 'C');
     // --- test backward editing ---
     $pdf->setPage(1, true);
     $pdf->SetY(50);
     $pdf->Cell(0, 0, 'A4 test', 1, 1, 'C');
     $pdf->setPage(2, true);
     $pdf->SetY(50);
     $pdf->Cell(0, 0, 'A4 test', 1, 1, 'C');
     $pdf->setPage(3, true);
     $pdf->SetY(50);
     $pdf->Cell(0, 0, 'A5 test', 1, 1, 'C');
     $pdf->setPage(4, true);
     $pdf->SetY(50);
     $pdf->Cell(0, 0, 'A5 test', 1, 1, 'C');
     $pdf->setPage(5, true);
     $pdf->SetY(50);
     $pdf->Cell(0, 0, 'A6 test', 1, 1, 'C');
     $pdf->setPage(6, true);
     $pdf->SetY(50);
     $pdf->Cell(0, 0, 'A6 test', 1, 1, 'C');
     $pdf->setPage(7, true);
     $pdf->SetY(40);
     $pdf->Cell(0, 0, 'A7 test', 1, 1, 'C');
     $pdf->setPage(8, true);
     $pdf->SetY(40);
     $pdf->Cell(0, 0, 'A7 test', 1, 1, 'C');
     $pdf->lastPage();
     $this->comparePdfs($pdf);
 }
Example #10
0
        $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
        // set default font subsetting mode
        $pdf->setFontSubsetting(true);
        // Set font
        $pdf->SetFont('helvetica', '', 14, '', true);
        // Add a page
        // This method has several options, check the source code documentation for more information.
        $pdf->AddPage('L', 'A4');
        $sliders = getSliders();
        $notes = getNotes();
        $gallery = getSliderGallery($sliders[1]["id_slider"]);
        if ($gallery) {
            $filename = generateRandomString();
            file_put_contents("_temp/" . $filename . getExtension($gallery[0]["type_image"]), $gallery[0]["slider_image"]);
            $pdf->Image("_temp/" . $filename . getExtension($gallery[0]["type_image"]), 25, 40);
        }
        $gallery = getSliderGallery($sliders[2]["id_slider"]);
        if ($gallery) {
            $filename = generateRandomString();
            file_put_contents("_temp/" . $filename . getExtension($gallery[0]["type_image"]), $gallery[0]["slider_image"]);
            $pdf->Image("_temp/" . $filename . getExtension($gallery[0]["type_image"]), 25, 60);
        }
        foreach ($notes as $note) {
            if ($note["note"] === "C&aacute;lculo del Precio de un Rubro") {
                $pdf->SetY(220);
                $pdf->MultiCell(0, 5, $note["note_text"]);
            }
        }
        $pdf->Output('indice-general-de-la-construcción.pdf', 'I');
        break;
}
Example #11
0
    function nonMelLoanPaperWorkPDF()
    {
        $this->loan->LoanNumber = $this->loaninfo['LoanNumber'];
        $this->Address();
        $pdf = new TCPDF();
        // set document information
        $pdf->SetCreator(PDF_CREATOR);
        $pdf->SetAuthor('Niels Klazenga');
        $pdf->SetTitle('non-MEL loan paperwork');
        $pdf->SetSubject('non-MEL loan paperwork');
        //set margins
        $pdf->SetMargins(20, 30, 20);
        //set auto page breaks
        $pdf->SetAutoPageBreak(TRUE, 10);
        // remove default header/footer
        $pdf->setPrintHeader(false);
        $pdf->setPrintFooter(false);
        $pdf->setViewerPreferences(array('FitWindow' => true));
        // set font
        $pdf->SetFont('helvetica', '', 10);
        // set cell padding
        $pdf->setCellPaddings(0, 0, 0, 0);
        // set cell margins
        $pdf->setCellMargins(0, 0, 0, 0);
        // start loan cover letter
        $pdf->AddPage();
        $pdf->Image('images/mel-letterhead.jpg', 25, 0, '', '', '', '', 'T', true, 300, '', false, false, 0, false, false, false);
        $x = 20;
        $pdf->MultiCell(120, 5, $this->loaninfo['ShipmentDate'], 0, 'L', 0, 1, $x, 12, true, false, true);
        $pdf->MultiCell(120, 5, $this->loan->ShippedTo, 0, 'L', 0, 1, $x, 19, true, false, true);
        $pdf->MultiCell(140, 5, '<span style="font-size:16pt;font-weight:bold">MEL returning loan ' . $this->loan->LoanNumber . ' (MEL ref. ' . $this->loaninfo['MELRefNo'] . ')</span>', 0, 'L', 0, 1, $x, 60, true, false, true);
        $pdf->MultiCell(140, 1, '<hr/>', 0, 'L', 0, 1, $x - 2.5, $pdf->GetY() + 1, true, false, true);
        $w = 30;
        $y = $pdf->GetY() - 2;
        $pdf->MultiCell($w, 5, 'Taxa:', 0, 'L', 0, 1, $x, $y, true, false, true);
        $pdf->MultiCell(130 - $w, 5, $this->loaninfo['TaxaOnLoan'], 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
        $y = $pdf->GetY() + 1;
        $pdf->MultiCell($w, 5, 'Sent for study by:', 0, 'L', 0, 1, $x, $y, true, false, true);
        $pdf->MultiCell(130 - $w, 5, $this->loaninfo['LoanAgents'], 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
        $y = $pdf->GetY() + 1;
        $pdf->MultiCell($w, 5, 'Shipment details:', 0, 'L', 0, 1, $x, $y, true, false, true);
        $pdf->MultiCell(130 - $w, 5, $this->loaninfo['ShipmentMethod'], 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
        if ($this->loaninfo['TrackingLabels']) {
            $y = $pdf->GetY() + 1;
            $pdf->MultiCell($w, 5, 'Tracking label(s):', 0, 'L', 0, 1, $x, $y, true, false, true);
            $pdf->MultiCell(130 - $w, 5, $this->loaninfo['TrackingLabels'], 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
        }
        $y = $pdf->GetY() + 1;
        $pdf->MultiCell($w, 5, 'Loan summary:', 0, 'L', 0, 1, $x, $y, true, false, true);
        $pdf->MultiCell(40, 5, $this->loaninfo['DateReceived'], 0, 'L', 0, 1, $x + $w + 35, $y, true, false, true);
        $pdf->MultiCell(35, 5, (int) $this->loaninfo['QuantityReceived'] . ' received', 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
        $last = count($this->loaninfo['ShipmentSummary']) - 1;
        foreach ($this->loaninfo['ShipmentSummary'] as $index => $row) {
            $y = $pdf->GetY();
            if ($index == $last) {
                $pdf->MultiCell(40, 5, '<b>' . $row['ShipmentDate'] . '</b>', 0, 'L', 0, 1, $x + $w + 35, $y, true, false, true);
                $pdf->MultiCell(35, 5, '<b>' . (int) $row['Number1'] . ' returned</b>', 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
            } else {
                $pdf->MultiCell(40, 5, $row['ShipmentDate'], 0, 'L', 0, 1, $x + $w + 35, $y, true, false, true);
                $pdf->MultiCell(35, 5, (int) $row['Number1'] . ' returned', 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
            }
        }
        $y = $pdf->GetY() + 1;
        $pdf->MultiCell($w, 5, 'Outstanding:', 0, 'L', 0, 1, $x, $y, true, false, true);
        $outstanding = $this->loaninfo['Outstanding'] > 0 ? (int) $this->loaninfo['Outstanding'] . ' specimens' : 'This loan has now been fully returned';
        $pdf->MultiCell(130 - $w, 5, $outstanding, 0, 'L', 0, 1, $x + $w + 5, $y, true, false, true);
        $pdf->MultiCell(140, 5, '<hr/>', 0, 'L', 0, 1, $x - 2.5, $pdf->GetY() + 1, true, false, true);
        $paragraphs = array();
        $paragraphs[] = <<<EOD
Please acknowledge receipt by returning the yellow copy of this form. Any damage should be noted on the form.
EOD;
        $paragraphs[] = <<<EOD
For queries relating to loans, exchange or donations please email MEL at HerbMEL@rbg.vic.gov.au.
EOD;
        $pdf->SetY($pdf->GetY() - 2);
        foreach ($paragraphs as $para) {
            $pdf->Multicell(135, 5, $para, 0, 'L', 0, 1, $x, $pdf->GetY() + 1, true, false, true);
        }
        $pdf->MultiCell(135, 5, $this->loaninfo['ShippedBy'] . '<br/>on behalf of the Collections Manager', 0, 'L', 0, 1, $x, 220, true, false, true);
        $y = 236;
        //$image_file = base_url() . 'images/scissors.png';
        //$pdf->Image($image_file, 22, $y-2.5, 5, 5, 'PNG', '', 'T', false, 300, '', false, false, 0, false, false, false);
        //$pdf->MultiCell(127, 5, '<hr/>', 0, 'L', 0, 1, 25.5, $y, true, false, true);
        $pdf->MultiCell(140, 5, '<hr/>', 0, 'L', 0, 1, $x - 2.5, $y, true, false, true);
        $y = $pdf->GetY() - 1;
        $pdf->MultiCell(45, 5, 'Number of parcels: ' . $this->loaninfo['NumberOfPackages'], 0, 'L', 0, 1, $x, $y, true, false, true);
        $pdf->MultiCell(75, 5, 'Number of specimens: ' . (int) $this->loaninfo['QuantityReturned'], 0, 'L', 0, 1, 75, $y, true, false, true);
        $pdf->MultiCell(125, 5, 'Material received in good condition.', 0, 'L', 0, 1, $x, $pdf->GetY() + 3, true, false, true);
        $y = $pdf->GetY() + 3;
        $pdf->MultiCell(25, 5, 'Comments: ', 0, 'L', 0, 1, $x, $y, true, false, true);
        $pdf->MultiCell(115, 5, '<hr/>', 0, 'L', 0, 1, $x + 20, $y + 4, true, false, true);
        $pdf->MultiCell(135, 5, '<hr/>', 0, 'L', 0, 1, $x, $pdf->GetY() + 1, true, false, true);
        $pdf->MultiCell(135, 5, '<hr/>', 0, 'L', 0, 1, $x, $pdf->GetY() + 1, true, false, true);
        $y = $pdf->GetY() + 1;
        $pdf->MultiCell(35, 5, 'Receiving officer:', 0, 'L', 0, 1, $x, $y, true, false, true);
        $pdf->MultiCell(60, 5, '<hr/>', 0, 'L', 0, 1, $x + 30, $y + 4, true, false, true);
        $pdf->MultiCell(15, 5, 'Date: ', 0, 'L', 0, 1, $x + 90, $y, true, false, true);
        $pdf->MultiCell(25, 5, '<hr/>', 0, 'L', 0, 1, $x + 100, $y + 4, true, false, true);
        $pdf->Output('nonmelloan.pdf', 'I');
    }
Example #12
0
 private function validate_position($width)
 {
     $margins = parent::getMargins();
     if ($width == 0) {
         $width = $this->document_width - $this->last_width;
     }
     $x_width = parent::GetX() + $width;
     if ($x_width > $this->document_width || parent::GetX() >= $this->document_width) {
         parent::SetY($this->last_height + $this->separator);
         $x_width = $margins['left'] + $width;
     }
     if (parent::GetY() < $this->last_height) {
         parent::SetX($this->last_width);
         $x_width = $this->last_width + $width;
     }
     if (parent::GetY() >= parent::getPageHeight() - $margins['bottom']) {
         $this->add_page();
     }
     if ($x_width < $this->document_width) {
         $this->last_width = $x_width + $this->separator;
     }
 }
Example #13
0
 public function detailNewPage()
 {
     $this->arraydetail[0]["y_axis"] = $this->arraydetail[0]["y_axis"] - $this->titleheight;
     $field_pos_y = $this->arraydetail[0]["y_axis"];
     $biggestY = 0;
     $checkpoint = $this->arraydetail[0]["y_axis"];
     $tempY = $this->arraydetail[0]["y_axis"];
     $i = 0;
     if ($this->arraysqltable) {
         $oo = 0;
         foreach ($this->arraysqltable as $row) {
             $oo++;
             //check the group's groupExpression existed and same or not
             if (isset($this->arraygroup) && $this->global_pointer > 0 && $this->arraysqltable[$this->global_pointer][$this->group_pointer] != $this->arraysqltable[$this->global_pointer - 1][$this->group_pointer]) {
                 if (isset($this->arrayVariable)) {
                     $this->variable_calculation($rownum, $this->arraysqltable[$this->global_pointer][$this->group_pointer]);
                 }
                 $this->pageFooter();
                 $this->pageHeaderNewPage();
                 $checkpoint = $this->arraydetail[0]["y_axis"];
                 $biggestY = 0;
                 $tempY = $this->arraydetail[0]["y_axis"];
                 //###                     $this->group_count=0;
                 $this->group_count["{$this->group_name}"] = 1;
                 //### End of modification
             }
             foreach ($this->arraydetail as $compare) {
                 $this->currentrow = $this->arraysqltable[$this->global_pointer];
                 switch ($compare["hidden_type"]) {
                     case "field":
                         $txt = $this->analyse_expression($row["{$compare['txt']}"]);
                         //check group footer existed or not
                         if (isset($this->arraygroup[$this->group_name]["groupFooter"]) && $checkpoint + $compare["height"] * $txt > $this->arrayPageSetting[pageHeight] - $this->arraygroup["{$this->group_name}"][groupFooter][0]["height"] - $this->arrayPageSetting["bottomMargin"]) {
                             //   $this->showGroupHeader();
                             $this->showGroupFooter();
                             $this->pageFooter();
                             // $this->pdf->AddPage();
                             //   $this->background();
                             $this->pageHeaderNewPage();
                             $checkpoint = $this->arraydetail[0]["y_axis"];
                             $biggestY = 0;
                             $tempY = $this->arraydetail[0]["y_axis"];
                         } elseif (isset($this->arraypageFooter) && $checkpoint + $compare["height"] * $this->NbLines($compare["width"], $txt) > $this->arrayPageSetting["pageHeight"] - $this->arraypageFooter[0]["height"] - $this->arrayPageSetting["bottomMargin"]) {
                             $this->showGroupFooter();
                             $this->pageFooter();
                             //  $this->pdf->AddPage();
                             $this->pageHeaderNewPage();
                             //     $this->showGroupHeader();
                             //   $this->background();
                             $headerY = $this->arrayPageSetting["topMargin"] + $this->arraypageHeader[0]["height"];
                             $checkpoint = $this->arraydetail[0]["y_axis"];
                             $biggestY = 0;
                             $tempY = $this->arraydetail[0]["y_axis"];
                         } elseif (isset($this->arraylastPageFooter) && $checkpoint + $compare["height"] * $this->NbLines($compare["width"], $txt) > $this->arrayPageSetting["pageHeight"] - $this->arraylastPageFooter[0]["height"] - $this->arrayPageSetting["bottomMargin"]) {
                             $this->showGroupFooter();
                             $this->lastPageFooter();
                             //   $this->pdf->AddPage();
                             // $this->background();
                             $this->pageHeaderNewPage();
                             //  $this->showGroupHeader();
                             $checkpoint = $this->arraydetail[0]["y_axis"];
                             $biggestY = 0;
                             $tempY = $this->arraydetail[0]["y_axis"];
                         }
                         if ($checkpoint + $compare["height"] * $this->NbLines($compare["width"], $txt) > $tempY) {
                             $tempY = $checkpoint + $compare["height"] * $this->NbLines($compare["width"], $txt);
                         }
                         break;
                     case "relativebottomline":
                         break;
                     case "report_count":
                         //                            $this->report_count++;
                         break;
                     case "group_count":
                         //###                            $this->group_count++;
                         break;
                     default:
                         $this->display($compare, $checkpoint);
                         break;
                 }
             }
             if ($checkpoint + $this->arraydetail[0]["height"] > $this->arrayPageSetting["pageHeight"] - $this->arraypageFooter[0]["height"] - $this->arrayPageSetting["bottomMargin"]) {
                 $this->pageFooter();
                 //      $this->pdf->AddPage();
                 //    $this->background();
                 $headerY = $this->arrayPageSetting["topMargin"] + $this->arraypageHeader[0]["height"];
                 $this->pageHeaderNewPage();
                 //  $this->showGroupHeader();
                 $checkpoint = $this->arraydetail[0]["y_axis"];
                 $biggestY = 0;
                 $tempY = $this->arraydetail[0]["y_axis"];
             }
             foreach ($this->arraydetail as $out) {
                 $this->currentrow = $this->arraysqltable[$this->global_pointer];
                 switch ($out["hidden_type"]) {
                     case "field":
                         $this->prepare_print_array = array("type" => "MultiCell", "width" => $out["width"], "height" => $out["height"], "txt" => $out["txt"], "border" => $out["border"], "align" => $out["align"], "fill" => $out["fill"], "hidden_type" => $out["hidden_type"], "printWhenExpression" => $out["printWhenExpression"], "soverflow" => $out["soverflow"], "poverflow" => $out["poverflow"], "link" => $out["link"], "pattern" => $out["pattern"]);
                         $this->display($this->prepare_print_array, 0, true);
                         if ($this->pdf->GetY() > $biggestY) {
                             $biggestY = $this->pdf->GetY();
                         }
                         break;
                     case "relativebottomline":
                         //$this->relativebottomline($out,$tempY);
                         $this->relativebottomline($out, $biggestY);
                         break;
                     default:
                         $this->display($out, $checkpoint);
                         //$checkpoint=$this->pdf->GetY();
                         break;
                 }
             }
             $this->pdf->SetY($biggestY);
             if ($biggestY > $checkpoint + $this->arraydetail[0]["height"]) {
                 $checkpoint = $biggestY;
             } elseif ($biggestY < $checkpoint + $this->arraydetail[0]["height"]) {
                 $checkpoint = $checkpoint + $this->arraydetail[0]["height"];
             } else {
                 $checkpoint = $biggestY;
             }
             if (isset($this->arraygroup) && $this->global_pointer > 0 && $this->arraysqltable[$this->global_pointer][$this->group_pointer] != $this->arraysqltable[$this->global_pointer + 1][$this->group_pointer]) {
                 $this->showGroupFooter($tempY);
             }
             //if(isset($this->arraygroup)){$this->global_pointer++;}
             $this->global_pointer++;
         }
     } else {
         echo utf8_decode("Sorry cause there is not result from this query.");
         exit(0);
     }
     $this->global_pointer--;
     $rownum++;
     if ($this->arraysummary[0]["height"] > 0) {
         $this->summary();
     }
     if (isset($this->arraylastPageFooter)) {
         //     $this->showGroupFooter();
         $this->lastPageFooter();
     } else {
         //     $this->showGroupFooter();
         $this->pageFooter();
     }
 }
Example #14
0
    function create_account_pdf($name_ca, $edrpou, $type_account, $email, $tel, $session_user_uuid)
    {
        //  $session_user_uuid = 'd7b6e0d4-36c2-11e5-8eee-0017315e2427';
        if ($session_user_uuid == 'ef7f2df7-2b9e-11e5-b075-0017315e2427') {
            $header_account_name = <<<EOD
Фізична особа - підприємець Чабан Олександр Сергійович
EOD;
            $header_account_property = <<<EOD
Банк Ф-Я ЮЖ. ГОЛ.РЕГ.УПР.ЗАТ КБ""ПРИВАТБАНК"", МФО 328704
р/р 26000054315095 , ЄДРПОУ 2579701431, № свід. 108703,
Платник єдиного податку III група. Не є платником ПДВ.
EOD;
            $header_account_logotext = <<<EOD
                    www.e911.com.ua
EOD;
            $header_main_supplier = <<<EOD
ФОП Чабан Олександр Сергійович
ЕДРПОУ: 2579701431
тел: (048) 794-51-37
sonata@e911.com.ua
EOD;
            $footer_sign = <<<EOD
___________________  Чабан О.С.
    м.п.
EOD;
            $footer_info = <<<EOD
Увага ! При сплаті рахунку УВАЖНО вказуйте номер та дату рахунку !
Виникли питання, телефонуйте : (044)3322440 (048)7945137 (0552)440530 (0322)539770 (0629)486910 (0412)551990
(068)7756837 (066)7980357 (063)8317948 (056)7850715 (0542)705991 (0612)201340  (0462)972990 (0352)400629
Або залишайте питання на сайті e911.com.ua {$session_user_uuid}
EOD;
            $footer_sign_stamp = 'chab.jpg';
            $header_logo_png = 'logo.png';
        } else {
            if ($session_user_uuid == 'ebff8dc0-311b-11e5-a676-0017315e2427') {
                $header_account_name = <<<EOD
Фізична особа - підприємець Чорноус Сергій Олександрович
EOD;
                $header_account_property = <<<EOD
Банк АТ Укрсиббанк м.Херсон , МФО 351005  
р/р 26009274877100, ЄДРПОУ 2925212898,
Платник єдиного податку III група. Не є платником ПДВ.
EOD;
                $header_account_logotext = <<<EOD
                    sonata.biz.ua
EOD;
                $header_main_supplier = <<<EOD
ФОП Чорноус Сергій Олександрович
ЕДРПОУ: 2925212898
тел: (0552)44-05-30
office@sonata.biz.ua
EOD;
                $footer_sign = <<<EOD
___________________  Чорноус  С.О.
    м.п.
EOD;
                $footer_info = <<<EOD
Увага ! При сплаті рахунку УВАЖНО вказуйте номер та дату рахунку !
Виникли питання, телефонуйте : (044)3322440 (048)7945137 (0552)440530 (0322)539770 (0629)486910 (0412)551990
(068)7756837 (066)7980357 (063)8317948 (056)7850715 (0542)705991 (0612)201340  (0462)972990 (0352)400629
Або залишайте питання на сайті sonata.biz.ua
EOD;
                $footer_sign_stamp = 'cher.jpg';
                $header_logo_png = 'header_logo_sonata.png';
            } else {
                $header_account_name = <<<EOD
Фізична особа - підприємець Чабан Олександр Сергійович
EOD;
                $header_account_property = <<<EOD
Банк Ф-Я ЮЖ. ГОЛ.РЕГ.УПР.ЗАТ КБ""ПРИВАТБАНК"", МФО 328704
р/р 26000054315095 , ЄДРПОУ 2579701431, № свід. 108703,
Платник єдиного податку III група. Не є платником ПДВ.
EOD;
                $header_account_logotext = <<<EOD
                    www.e911.com.ua
EOD;
                $header_main_supplier = <<<EOD
ФОП Чабан Олександр Сергійович
ЕДРПОУ: 2579701431
тел: (048) 794-51-37
sonata@e911.com.ua
EOD;
                $footer_sign = <<<EOD
___________________  Чабан О.С.
    м.п.
EOD;
                $footer_info = <<<EOD
Увага ! При сплаті рахунку УВАЖНО вказуйте номер та дату рахунку !
Виникли питання, телефонуйте : (044)3322440 (048)7945137 (0552)440530 (0322)539770 (0629)486910 (0412)551990
(068)7756837 (066)7980357 (063)8317948 (056)7850715 (0542)705991 (0612)201340  (0462)972990 (0352)400629
Або ** залишайте питання на сайті e911.com.ua
EOD;
                $footer_sign_stamp = 'chab.jpg';
                $header_logo_png = 'logo.png';
            }
        }
        $date_now = date("m.d.y");
        $number_acc = date("Hms");
        $type_acc = '00';
        $number_acc_id = $type_acc . $number_acc;
        // $name_ca = 'ООО"Лютики Цветочки скорочена назва пыдприемства до 256 знакыв"';
        // $edrpou = '36524587';
        // $tel = '';
        // $email = '*****@*****.**';
        switch ($type_account) {
            case "s3":
                $namelic = 'Супроводження ПЗ Соната 3 місяці';
                $sum = 250;
                $sum_prop = 'Двісті п\'тдесят';
                break;
            case "s6":
                $namelic = 'Супроводження ПЗ Соната 6 місяців';
                $sum = 360;
                $sum_prop = 'Триста шістдесят';
                break;
            case "s12":
                $namelic = 'Супроводження ПЗ Соната 12 місяців';
                $sum = 500;
                $sum_prop = 'П\'ятсот';
                break;
            case "sf12":
                $namelic = 'Супроводження ПЗ Соната 12 місяців';
                $sum = 200;
                $sum_prop = 'Двісті';
                break;
            case "ecp_s2":
                $namelic = 'Послуга цифрового підпису за договором доручення (тариф стандартний)';
                $sum = 322;
                $sum_prop = 'Триста двадцять дві';
                break;
            case "ecp_s3":
                $namelic = 'Послуга цифрового підпису за договором доручення (тар. стандартний)';
                $sum = 483;
                $sum_prop = 'Чотириста вісімдесят три';
                break;
            case "ecp_l1":
                $namelic = 'Послуга електронного цифрового підпису за договором доручення (тариф легкий)';
                $sum = 140;
                $sum_prop = 'Сто сорок';
                break;
            case "ecp_l2":
                $namelic = 'Послуга електронного цифрового підпису за договором доручення (тариф легкий)';
                $sum = 280;
                $sum_prop = 'Двісті вісімдесят';
                break;
            case "w1":
                $namelic = 'Налаштування програмного забезпечення  ';
                $sum = 200;
                $sum_prop = 'Двісті';
                break;
            case "Kaspersky Internet Security 2016 - 2 ПК":
                $namelic = 'ПЗ  Kaspersky Internet Security 2016 - 2 ПК 12 міс.';
                $sum = 680;
                $sum_prop = 'Шістсот вісімдесят';
                break;
            case "Kaspersky Internet Security 2016 - продление 1 ПК":
                $namelic = 'ПЗ  Kaspersky Internet Security 2016 - 1 ПК продовження 12 міс.';
                $sum = 380;
                $sum_prop = 'Триста вісімдесят';
                break;
            case "Kaspersky Internet Security 2016 - продление 2 ПК":
                $namelic = 'ПЗ  Kaspersky Internet Security 2016 - 2 ПК продовження 12 міс.';
                $sum = 550;
                $sum_prop = 'П\'ятсот п\'ятдесят';
                break;
            case "avast! Pro Antivirus 2015 - 1 ПК":
                $namelic = 'avast! Pro Antivirus 2015 - 1 ПК 12 міс.';
                $sum = 275;
                $sum_prop = 'Двісті сімдесят п\'ять';
                break;
            case "avast! Pro Antivirus 2015 - продление 1 ПК":
                $namelic = 'avast! Pro Antivirus 2015 - 1 ПК продовження 12 міс.';
                $sum = 215;
                $sum_prop = 'Двісті п\'ятнадцять';
                break;
            case "avast! Internet Security 8 - 1 ПК":
                $namelic = 'avast! Internet Security 8 - 1 ПК 12 міс.';
                $sum = 290;
                $sum_prop = 'Двісті дев\'яносто';
                break;
            case "avast! Internet Security 8 - продление 1 ПК":
                $namelic = 'avast! Internet Security 8 - 1 ПК продовженя 12 міс.';
                $sum = 240;
                $sum_prop = 'Двісті сорок';
                break;
            default:
                $namelic = 'Супроводження ПЗ Соната';
                $sum = 500;
                $sum_prop = 'П\'ятсот';
                break;
        }
        // $namelic = ' Прогорамма соната 12 месяцев';
        // $sum = '500 ';
        // $sum_prop = 'пятьчот';
        //
        define('PDF_PATH_IMAGE', '/include/image/');
        define('PDF_PATH', '/include/');
        //define ('FILE_PDF_PATH','include/file/');
        $this->load->library('Pdf');
        $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
        $pdf->setPrintHeader(false);
        $pdf->setPrintFooter(false);
        // set default monospaced font
        $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
        $pdf->AddPage();
        // Основные показатели
        $hx = 11;
        // высота ячейки
        $Wzamov = 50;
        $Wisp = 120;
        $Wmulticel = 50;
        // Заголовок
        $pdf->Image(PDF_PATH_IMAGE . $header_logo_png, 10, 10, 65, 20, 'png', '', '', true, 300, '', false, false, false, false, false, false);
        $pdf->SetFont('dejavusans', 'B', 10);
        // Header
        $pdf->Write(5, $header_account_name, '', 0, 'R', true, 0, false, false, 0, 0);
        $pdf->SetFont('dejavusans', '', 9);
        // $pdf->Write(5, $header_account_property, '', 0, 'R', true, 0, false, false, 0,0,array(1,1));
        $pdf->Write(0, $header_account_property, '', 0, 'R', true, 0, false, false, 0);
        // e911.com.ua
        $pdf->SetFont('dejavusans', '', 9);
        $pdf->Write(5, $header_account_logotext, '', 0, 'L', true, 0, false, false, 0, 0, array(1, 1));
        $pdf->SetFont('dejavusans', '', 8);
        $date = Date("d.m.Y");
        $pdf->SetFillColor(255, 255, 255);
        // $ypost = 54;
        $pdf->SetFont('', 'B', 9);
        $y_header = 40;
        $pdf->SetY($y_header, true);
        $pdf->cell(50, $hx, 'Постачальник:', 0, 'L');
        $pdf->SetY($y_header, true);
        $pdf->SetX(100, true);
        $pdf->cell(50, $hx, 'Платник:', 0, 'L');
        $wedhtCell = 50;
        $pdf->SetFont('', '', 9);
        // header_main_supplier
        $pdf->SetY(50, true);
        $pdf->SetX(10, true);
        // $pdf->SetY($ypost+8,true);
        $pdf->multicell(100, $hx, $header_main_supplier, 0, 'L', 1, 0, '', '', true);
        $txt = <<<EOD
{$name_ca}
ЕДРПОУ: {$edrpou}
тел: {$tel}
{$email}
EOD;
        $pdf->SetY(50, true);
        $pdf->SetX(100, true);
        $pdf->multicell(100, $hx, $txt, 0, 'L', 1, 0, '', '', true);
        // ЗАКАЗ
        $pdf->SetFont('dejavusans', 'B', 16);
        // set some text to print
        $number_acc_id = $type_acc . $number_acc;
        $txt = <<<EOD
Рахунок №  {$number_acc_id} від {$date}
EOD;
        $pdf->SetY(80, true);
        $pdf->Write(5, $txt, '', 0, 'C', true, 0, false, false, 0, 0);
        $pdf->SetFont('dejavusans', '', 8);
        $txt = <<<EOD
за інформаційні послуги
EOD;
        $pdf->Write(5, $txt, '', 0, 'C', true, 0, false, false, 0, 0);
        // Table Account
        $x = 10;
        // Start Horizont
        $xf = 190;
        // Finish horizont
        $y = 100;
        // start vertical
        $wx = 72;
        $wmin = $wx - 36;
        $pdf->SetFont('', '', 11);
        // Header table
        $pdf->SetFont('', 'B', 11);
        $pdf->SetY($y - 10, true);
        $pdf->cell($wx, $hx, 'Найменування', 'B', 0, 'L');
        $pdf->cell($wmin, $hx, 'Кількість', 'B', 0, 'R');
        $pdf->cell($wmin, $hx, 'Ціна,грн', 'B', 0, 'R');
        $pdf->cell($wmin, $hx, 'Сума,грн', 'B', 0, 'R');
        // Date Table
        $tableHeight = 6;
        $pdf->SetFont('', '', 9);
        $pdf->SetY($y + 1, true);
        // $pdf->cell($wx,$tableHeight,$namelic,'B',0,'L');
        // $pdf->cell($wmin,$tableHeight,1,'B',0,'C');
        // $pdf->cell($wmin,$tableHeight,$sum,'B',0,'C');
        // $pdf->cell($wmin,$tableHeight,$sum,'B',0,'C');
        $html = '
		<table border="1" cellspacing="0" cellpadding="2">
    		<tr>
		    	<td align="left" width="250">' . $namelic . '</td>
		    	<td align="center" width="90">1</td>
		    	<td align="center" width="90">' . $sum . '</td>
		    	<td align="center" width="90">' . $sum . '</td>
    		</tr>
    	</table>
		';
        $pdf->writeHTML($html, true, false, true, false, '');
        // Footer table
        $pdf->SetFont('', 'B', 11);
        $pdf->SetY($y + 15, true);
        $pdf->cell($wx, $hx, 'Разом: ' . $sum_prop . '  гривень 00 коп. без ПДВ', '', 0, 'L');
        $pdf->SetFillColor(255, 255, 255);
        $pdf->Image(PDF_PATH_IMAGE . $footer_sign_stamp, 40, 125, 40, 40, 'jpg', '', '', true, 1000, '', false, false, false, false, false, false);
        $ypost = 140;
        $pdf->SetFont('', 'B', 9);
        $pdf->SetY($ypost, true);
        $pdf->cell($Wisp, $hx, 'Постачальник:', 0, 'L');
        // $pdf->cell($Wzamov,$hx,'Від замовника:',0,'L');
        $pdf->SetFont('', '', 9);
        // 		$txt = <<<EOD
        //  ___________________  Чабан О.С.
        //  м.п.
        // EOD;
        $pdf->SetY($ypost, true);
        $pdf->SetX(50, true);
        $pdf->multicell($Wmulticel + 10, $hx, $footer_sign, 0, 'L', 1, 0, '', '', true);
        $pdf->SetFont('dejavusans', '', 8);
        $pdf->SetY(150, true);
        $pdf->Write(5, $footer_info, '', 0, 'L', true, 0, false, false, 0, 0);
        $pdf->Output(FCPATH . '/include/file/sonata_rahunok.pdf', 'F');
        // OUTPUT THE NEW PDF INTO THE SAME DIRECTORY DEFINED ABOVE
    }
Example #15
0
     {
     $pdf->AddPage();
     $numefftot = 0;
     }
 //a secondo del tipo di effetto stampo il relativo modulo
 switch($effetto['tipeff'])
 {
 //questo è il modulo delle ricevute bancarie
 case "B":
     $pdf->SetFont('helvetica','',7);
     $pdf->Rect(5,5+$passo*$numefftot,200,50);
     $pdf->Rect(5,60+$passo*$numefftot,65,30);
     $pdf->Rect(71,60+$passo*$numefftot,85,30);
     $pdf->Rect(157,60+$passo*$numefftot,48,30);
     $pdf->Rect(75,20+$passo*$numefftot,125,10,'DF');
     $pdf->SetY(30+$numefftot*$passo);
     $pdf->Image('@'.$logo,6,6+$passo*$numefftot,30,0);
     $pdf->Cell(50,3,$admin_aziend['ragso1'],0,2,'L');
     $pdf->Cell(50,3,$admin_aziend['ragso2'],0,2,'L');
     $pdf->Cell(50,3,$admin_aziend['indspe'].' Tel.'.$admin_aziend['telefo'],0,2,'L');
     $pdf->Cell(50,3,$admin_aziend['capspe'].' '.$admin_aziend['citspe'].' ('.$admin_aziend['prospe'].')',0,2,'L');
     $pdf->Cell(50,3,'P.I. '.$admin_aziend['pariva'],0,2,'L');
     $pdf->Cell(50,3,'C.F. '.$admin_aziend['codfis'],0,0,'L');
     $pdf->SetXY(70,5+$numefftot*$passo);
     $pdf->SetFont('helvetica','B',10);
     $pdf->Cell(50,10,'RICEVUTA N. '.$effetto['progre'],0,0,'L');
     $pdf->SetFont('helvetica','',8);
     $pdf->MultiCell(22,10,'Data di pagamento','LTB','L',1);
     $pdf->SetXY(140,5+$numefftot*$passo);
     $pdf->SetFont('helvetica','B',10);
     $pdf->Cell(20,10,$scadenza.' ','RTB',0,'R',1);
Example #16
0
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
    require_once dirname(__FILE__) . '/lang/eng.php';
    $pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set a barcode on the page footer
$pdf->setBarcode(date('Y-m-d H:i:s'));
// set font
$pdf->SetFont('helvetica', '', 11);
// add a page
$pdf->AddPage();
// print a message
$txt = "You can also export 1D barcodes in other formats (PNG, SVG, HTML). Check the examples inside the barcodes directory.\n";
$pdf->MultiCell(70, 50, $txt, 0, 'J', false, 1, 125, 30, true, 0, false, true, 0, 'T', false);
$pdf->SetY(30);
// -----------------------------------------------------------------------------
$pdf->SetFont('helvetica', '', 10);
// define barcode style
$style = array('position' => '', 'align' => 'C', 'stretch' => false, 'fitwidth' => true, 'cellfitalign' => '', 'border' => true, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4);
// PRINT VARIOUS 1D BARCODES
// CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
$pdf->Cell(0, 0, 'CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9', 0, 1);
$pdf->write1DBarcode('CODE 39', 'C39', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 + CHECKSUM
$pdf->Cell(0, 0, 'CODE 39 + CHECKSUM', 0, 1);
$pdf->write1DBarcode('CODE 39 +', 'C39+', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 EXTENDED
$pdf->Cell(0, 0, 'CODE 39 EXTENDED', 0, 1);
Example #17
0
 /**
  * This function is call automatically by TCPDF at the end of a page
  * It takes no parameters
  *
  * @access public
  */
 public function Footer()
 {
     // prepare the text from the tranlated text
     $txt = '';
     if ($this->_footerParam['form']) {
         $txt = HTML2PDF_locale::get('pdf05');
     }
     if ($this->_footerParam['date'] && $this->_footerParam['hour']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF_locale::get('pdf03');
     }
     if ($this->_footerParam['date'] && !$this->_footerParam['hour']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF_locale::get('pdf01');
     }
     if (!$this->_footerParam['date'] && $this->_footerParam['hour']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF_locale::get('pdf02');
     }
     if ($this->_footerParam['page']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF_locale::get('pdf04');
     }
     if (strlen($txt) > 0) {
         // replace some values
         $toReplace = array('[[date_d]]' => date('d'), '[[date_m]]' => date('m'), '[[date_y]]' => date('Y'), '[[date_h]]' => date('H'), '[[date_i]]' => date('i'), '[[date_s]]' => date('s'), '[[page_cu]]' => $this->getMyNumPage(), '[[page_nb]]' => $this->getMyAliasNbPages());
         $txt = str_replace(array_keys($toReplace), array_values($toReplace), $txt);
         // draw the footer
         parent::SetY(-11);
         $this->SetFont('helvetica', 'I', 8);
         $this->Cell(0, 10, $txt, 0, 0, 'R');
     }
 }
Example #18
0
 function printLabelNew($labeldata, $props, $start = 0)
 {
     $numx = $props['numx'];
     $numy = $props['numy'];
     $labelheight = $props['dimensions']['labelheight'];
     $labelwidht = $props['dimensions']['labelwidth'];
     $labelheader_pos = $props['dimensions']['labelheader_pos'];
     $barcode_pos = $props['dimensions']['barcode_pos'];
     $barcodetext_pos = $props['dimensions']['barcodetext_pos'];
     $labelbody_pos = $props['dimensions']['labelbody_pos'];
     $labelfooter_pos = $props['dimensions']['labelfooter_pos'];
     $numlabels = $numx * $numy;
     if ($this->input->post('labeltype') == 6 || $this->input->post('labeltype') == 7 || $this->input->post('labeltype') == 13 || $this->input->post('labeltype') == 14) {
         $dup = true;
     } else {
         $dup = false;
     }
     set_time_limit(600);
     // create new PDF document
     $format = 'A4';
     if (isset($props['format'])) {
         $format = $props['format'];
     }
     $orientation = 'P';
     if (isset($props['orientation'])) {
         $orientation = $props['orientation'];
     }
     $pdf = new TCPDF($orientation, 'mm', $format, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Niels Klazenga');
     $pdf->SetTitle('MEL Label');
     $pdf->SetSubject('MEL Label');
     //set margins
     $pdf->SetMargins(5, 7.5, 5);
     //set auto page breaks
     //if($props['footerpositionabsolute'])
     $pdf->SetAutoPageBreak(FALSE, 7.5);
     // remove default header/footer
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     // ---------------------------------------------------------
     // set font
     $pdf->SetFont('helvetica', '', 9);
     // set cell padding
     $pdf->setCellPaddings(0, 0, 0, 0);
     // set cell margins
     $pdf->setCellMargins(0, 0, 0, 0);
     if (!$dup) {
         $labelheader = '<p style="font-weight: bold"><span style="font-size: 11.5pt;">NATIONAL HERBARIUM OF VICTORIA (MEL)</span><br />
             <span style="font-size: 11pt;">MELBOURNE, AUSTRALIA</span></p>';
     } else {
         $labelheader = '<p style="font-weight: bold"><span style="font-size: 30px;">Ex NATIONAL HERBARIUM OF VICTORIA (MEL)</span><br />
             <span style="font-size: 11pt;">MELBOURNE, AUSTRALIA</span></p>';
     }
     $barcodestyle = array('position' => '', 'padding' => 0, 'align' => 'C', 'stretch' => true, 'cellfitalign' => '', 'border' => false, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => false);
     if ($start > 0) {
         $pdf->AddPage();
     }
     for ($i = 0; $i < count($labeldata); $i++) {
         $j = $i + $start;
         $offset = $j % ($numx * $numy);
         $x = $offset % $numx;
         $y = floor($offset / $numx);
         $barcodeheight = 12;
         $barcode_pos_y = $barcode_pos['y'][$y];
         if ($j % $numlabels == 0) {
             $pdf->AddPage();
         }
         $pdf->MultiCell($props['wheader'], 7.5, $labelheader, 0, 'C', 0, 1, $labelheader_pos['x'][$x], $labelheader_pos['y'][$y], true, false, true);
         if ($this->input->post('labeltype') == 19 || $this->input->post('labeltype') == 21) {
             $pdf->MultiCell($props['wheader'], 5, '<b>Victorian Reference Set</b>', 0, 'C', 0, 1, $labelheader_pos['x'][$x], $pdf->GetY(), true, false, true);
         } elseif ($labeldata[$i]['HortRefSet']) {
             $pdf->MultiCell($props['wheader'], 5, '<b>Horticultural Reference Set</b>', 0, 'C', 0, 1, $labelheader_pos['x'][$x], $pdf->GetY(), true, false, true);
             $barcode_pos_y += 3;
             $barcodeheight -= 3;
         }
         if (!$dup) {
             if ($this->input->post('labeltype') == 19 || $this->input->post('labeltype') == 21) {
                 $vrsnumber = 'VRS ' . $labeldata[$i]['VRSNumber'];
                 $pdf->write1DBarcode($vrsnumber, 'C39', $barcode_pos['x'][$x], $barcode_pos_y, 55, $barcodeheight, 0.1, $barcodestyle, 'N');
                 $pdf->MultiCell(55, 5, '<b>' . $vrsnumber . '</b>', 0, 'C', 0, 1, $barcodetext_pos['x'][$x], $barcodetext_pos['y'][$y], true, false, true);
             } else {
                 $melnumber = 'MEL ' . $labeldata[$i]['MelNumber'];
                 $pdf->write1DBarcode($melnumber, 'C39', $barcode_pos['x'][$x], $barcode_pos_y, 55, $barcodeheight, 0.1, $barcodestyle, 'N');
                 $pdf->MultiCell(55, 5, '<b>' . $melnumber . '</b>', 0, 'C', 0, 1, $barcodetext_pos['x'][$x], $barcodetext_pos['y'][$y], true, false, true);
             }
         }
         if (isset($labeldata[$i]['SpiritInfo']) && $labeldata[$i]['SpiritInfo']) {
             $spirit = 'Spirit jar: ' . $labeldata[$i]['SpiritInfo']['Number'] . $labeldata[$i]['SpiritInfo']['JarSize'];
             $pdf->MultiCell(51, 5, $spirit, 0, 'R', 0, 1, $barcodetext_pos['x'][$x], $barcode_pos_y - 6, true, false, true);
         }
         $pdf->SetY($labelbody_pos['y'][$y]);
         if ($this->input->post('labeltype') == 19 || $this->input->post('labeltype') == 21) {
             $pdf->MultiCell($props['whtml'], 5, '<b>' . strtoupper($labeldata[$i]['Family']) . '</b>', 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY(), true, 0, true, true, 0, 'T', false);
             $pdf->SetY($pdf->GetY() - 1);
         }
         $formattedname = '';
         if ($labeldata[$i]['Introduced'] == 'Not native') {
             $formattedname .= '*';
         }
         $formattedname .= $labeldata[$i]['FormattedName'];
         $formattedname = "<div style=\"font-size: 11pt;\">{$formattedname}</div>";
         $pdf->MultiCell($props['whtml'], 5, $formattedname, 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY(), true, 0, true, true, 0, 'T', false);
         if ($labeldata[$i]['ExtraInfo']) {
             $pdf->MultiCell($props['whtml'], 5, $labeldata[$i]['ExtraInfo'], 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() - 1, true, 0, true, true, 0, 'T', false);
         }
         if (($labeldata[$i]['DetType'] == 'Det.' || $labeldata[$i]['DetType'] == 'Conf.') && $labeldata[$i]['DeterminedBy']) {
             $det = '<b>' . $labeldata[$i]['DetType'] . ':</b> ' . $labeldata[$i]['DeterminedBy'];
             if ($labeldata[$i]['DeterminedDate']) {
                 $det .= ', ' . $labeldata[$i]['DeterminedDate'];
             }
             $pdf->MultiCell($props['whtml'], 5, $det, 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY(), true, 0, true, true, 0, 'T', false);
         }
         if ($labeldata[$i]['TypeInfo']) {
             if ($this->input->post('labeltype') == 6 || $this->input->post('labeltype') == 7) {
                 $labeldata[$i]['TypeInfo'] = str_replace('HOLOTYPE', 'ISOTYPE', $labeldata[$i]['TypeInfo']);
             }
             $pdf->MultiCell($props['whtml'], 5, $labeldata[$i]['TypeInfo'], 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() - 1, true, 0, true, true, 0, 'T', false);
         }
         $collinfo = '<b>Coll.:</b> ' . $labeldata[$i]['Collector'] . ' ' . $labeldata[$i]['CollectingNumber'];
         if ($labeldata[$i]['CollectingDate']) {
             $collinfo .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Date:</b> ' . $labeldata[$i]['CollectingDate'];
         }
         $pdf->MultiCell($props['whtml'], 5, $collinfo, 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() + 2, true, 0, true, true, 0, 'T', false);
         if ($labeldata[$i]['AdditionalCollectors']) {
             $pdf->MultiCell($props['whtml'], 5, '<b>Addit. Coll.:</b> ' . $labeldata[$i]['AdditionalCollectors'], 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() - 1, true, 0, true, true, 0, 'T', false);
         }
         if ($labeldata[$i]['CollectingTrip']) {
             $pdf->MultiCell($props['whtml'], 5, '<b>Collecting trip:</b> ' . $labeldata[$i]['CollectingTrip'], 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() - 1, true, 0, true, true, 0, 'T', false);
         }
         $pdf->MultiCell($props['whtml'], 5, '<b>' . $labeldata[$i]['Geography'] . '</b>', 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() + 2, true, 0, true, true, 0, 'T', false);
         $loc = '<b>Loc.:</b> ' . trim($labeldata[$i]['Locality']);
         if ($labeldata[$i]['Latitude'] && $labeldata[$i]['Longitude'] || $labeldata[$i]['Altitude'] || $labeldata[$i]['Depth']) {
             $loc .= '<br/>';
             if ($labeldata[$i]['Latitude'] || $labeldata[$i]['Latitude']) {
                 $loc .= $labeldata[$i]['Latitude'] . '&nbsp;&nbsp;' . $labeldata[$i]['Longitude'] . '. ';
             }
             if ($labeldata[$i]['Altitude']) {
                 $loc .= 'Alt.: ' . $labeldata[$i]['Altitude'] . '. ';
             }
             if ($labeldata[$i]['Depth']) {
                 $loc .= 'Depth: ' . $labeldata[$i]['Depth'] . '. ';
             }
         }
         $pdf->MultiCell($props['whtml'], 5, $loc, 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() - 1, true, 0, true, true, 0, 'T', false);
         $hab = array();
         if ($labeldata[$i]['Habitat']) {
             $hab['Habitat'] = '<b>Habitat:</b> ' . xml_convert($labeldata[$i]['Habitat']);
         }
         if ($labeldata[$i]['AssociatedTaxa']) {
             $hab['AssociatedTaxa'] = '<b>Associated taxa:</b> ' . xml_convert($labeldata[$i]['AssociatedTaxa']);
         }
         if ($labeldata[$i]['Substrate']) {
             $hab['Substrate'] = '<b>Substrate:</b> ' . xml_convert($labeldata[$i]['Substrate']);
         }
         if ($labeldata[$i]['Host']) {
             $hab['Host'] = '<b>Host:</b> ' . xml_convert($labeldata[$i]['Host']);
         }
         if ($hab) {
             $pdf->MultiCell($props['whtml'], 5, implode('<br/>', $hab), 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() + 1, true, 0, true, true, 0, 'T', false);
         }
         if ($labeldata[$i]['Provenance']) {
             $pdf->MultiCell($props['whtml'], 5, '<b>Provenance:</b> ' . $labeldata[$i]['Provenance'], 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() + 1, true, 0, true, true, 0, 'T', false);
         }
         $not = array();
         if ($labeldata[$i]['DescriptiveNotes']) {
             $not['DescriptiveNotes'] = '<b>Descriptive notes:</b> ' . xml_convert($labeldata[$i]['DescriptiveNotes']);
         }
         if ($labeldata[$i]['Introduced']) {
             $not['Introduced'] = '<b>Natural occurrence:</b> ' . $labeldata[$i]['Introduced'];
         }
         if ($labeldata[$i]['Cultivated']) {
             $not['Cultivated'] = '<b>Cultivated occurrence:</b> ' . $labeldata[$i]['Cultivated'];
         }
         if ($labeldata[$i]['CollectingNotes']) {
             $not['CollectingNotes'] = '<b>Collecting notes:</b> ' . xml_convert($labeldata[$i]['CollectingNotes']);
         }
         if ($labeldata[$i]['Ethnobotany']) {
             $not['Ethnobotany'] = '<b>Ethnobotany notes:</b> ' . $labeldata[$i]['Ethnobotany'];
         }
         if ($labeldata[$i]['Toxicity']) {
             $not['Toxicity'] = '<b>Toxicity notes:</b> ' . $labeldata[$i]['Toxicity'];
         }
         if ($labeldata[$i]['MiscellaneousNotes']) {
             $not['MiscellaneousNotes'] = '<b>Misc. notes:</b> ' . xml_convert($labeldata[$i]['MiscellaneousNotes']);
         }
         if ($not) {
             $pdf->SetY($pdf->GetY() + 1);
             $pdf->MultiCell($props['whtml'], 5, implode('<br/>', $not), 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() - 1, true, 0, true, true, 0, 'T', false);
         }
         if ($labeldata[$i]['Multisheet'] && !$dup && !in_array($this->input->post('labeltype'), array(19, 21))) {
             $pdf->SetY($pdf->GetY() + 2);
             $pdf->MultiCell($props['whtml'], 5, $labeldata[$i]['Multisheet'], 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() + 1, true, 0, true, true, 0, 'T', false);
         }
         if (isset($labeldata[$i]['VRSMultisheets']) && $labeldata[$i]['VRSMultisheets']) {
             $pdf->SetY($pdf->GetY() + 2);
             $pdf->MultiCell($props['whtml'], 5, $labeldata[$i]['VRSMultisheets'], 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() + 1, true, 0, true, true, 0, 'T', false);
         }
         if ($labeldata[$i]['MixedInfo']) {
             $mixed = '<b>This is a mixed collection. The components are:</b><br/>';
             if ($props['type'] == 3 || $props['type'] == 4) {
                 $labeldata[$i]['MixedInfo'] = str_replace('<br/>', ' &ndash; ', $labeldata[$i]['MixedInfo']);
             }
             //echo '<pre>' . str_replace('<', '&lt;', $labeldata[$i]['MixedInfo']) . '</pre>';
             $mixed .= $labeldata[$i]['MixedInfo'];
             $pdf->MultiCell($props['whtml'], 5, $mixed, 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() + 1, true, 0, true, true, 0, 'T', false);
         }
         if ($dup || $this->input->post('labeltype') == 19 || $this->input->post('labeltype') == 21) {
             $dupl = '<b>This specimen is a duplicate of MEL ' . $labeldata[$i]['MelNumber'] . '.</b>';
             $pdf->MultiCell($props['whtml'], 5, $dupl, 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() + 1, true, 0, true, true, 0, 'T', false);
         }
         if ($labeldata[$i]['DuplicateInfo']) {
             $pdf->MultiCell($props['whtml'], 5, '<b>Dupl.:</b> ' . $labeldata[$i]['DuplicateInfo'], 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() + 1, true, 0, true, true, 0, 'T', false);
         }
         if ($labeldata[$i]['VicRefSet']) {
             $pdf->MultiCell($props['whtml'], 5, '<b>Vic. Ref. Set:</b> ' . $labeldata[$i]['VicRefSet'], 0, 'L', 0, 1, $labelbody_pos['x'][$x], $pdf->GetY() + 2, true, 0, true, true, 0, 'T', false);
         }
         $storedunder = $labeldata[$i]['StoredUnder'];
         if ($labeldata[$i]['HortRefSet']) {
             $storedunder = str_replace('Main collection', 'Hort. Ref. Set', $storedunder);
         }
         if ($props['footerpositionabsolute']) {
             if ($dup) {
                 $footer = '<div style="font-size: 7pt">Printed from MELISR, ' . date('d M. Y') . '</div>';
                 $melnumber = 'MEL ' . $labeldata[$i]['MelNumber'];
                 $pdf->MultiCell(40, 5, '<div style="font-size: 7pt">MEL specimen stored under:<br/>' . $storedunder . '</div>', 0, 'L', 0, 1, $labelfooter_pos['x'][$x], $barcode_pos['y'][$y] + 1, true, false, true);
                 $pdf->MultiCell(90, 5, $footer, 0, 'L', 0, 1, $labelfooter_pos['x'][$x], $labelfooter_pos['y'][$y] + 3, true, 0, true, true, 0, 'T', false);
                 $pdf->write1DBarcode($melnumber, 'C39', $barcode_pos['x'][$x], $barcode_pos['y'][$y] - 1, 55, 12, 0.1, $barcodestyle, 'N');
                 $pdf->MultiCell(55, 5, '<b>' . $melnumber . '</b>', 0, 'C', 0, 1, $barcodetext_pos['x'][$x], $labelfooter_pos['y'][$y] + 2, true, false, true);
             } else {
                 if ($labeldata[$i]['Continent']) {
                     $storedunder .= ' (' . $labeldata[$i]['Continent'] . ')';
                 }
                 if ($this->input->post('labeltype') != 19 && $this->input->post('labeltype') != 21) {
                     $storage = '<div style="font-size: 7pt">' . $storedunder . '</div>';
                     $pdf->MultiCell(90, 5, $storage, 0, 'L', 0, 1, $labelfooter_pos['x'][$x], $labelfooter_pos['y'][$y] - 3.5, true, 0, true, true, 0, 'T', false);
                 }
                 $footer = '<div style="font-size: 7pt">Printed from MELISR, ' . date('d M. Y') . '</div>';
                 $pdf->MultiCell(90, 5, $footer, 0, 'L', 0, 1, $labelfooter_pos['x'][$x], $labelfooter_pos['y'][$y], true, 0, true, true, 0, 'T', false);
             }
         } else {
             $yy = $pdf->GetY() + 5;
             if ($dup) {
                 $footer = '<div style="font-size: 7pt">Printed from MELISR, ' . date('d M. Y') . '</div>';
                 $melnumber = 'MEL ' . $labeldata[$i]['MelNumber'];
                 $pdf->MultiCell(40, 5, '<div style="font-size: 7pt">MEL specimen stored under:<br/>' . $storedunder, 0, 'L', 0, 1, $labelfooter_pos['x'][$x], $yy + 1, true, false, true);
                 $pdf->write1DBarcode($melnumber, 'C39', $barcode_pos['x'][$x], $yy, 55, 12, 0.1, $barcodestyle, 'N');
                 $pdf->MultiCell(55, 5, '<b>' . $melnumber . '</b>', 0, 'C', 0, 1, $barcodetext_pos['x'][$x], $yy + 11, true, false, true);
                 $pdf->MultiCell(90, 5, $footer, 0, 'L', 0, 1, $labelfooter_pos['x'][$x], $yy + 11.5, true, 0, true, true, 0, 'T', false);
             } else {
                 if ($labeldata[$i]['Continent']) {
                     $storedunder .= ' (' . $labeldata[$i]['Continent'] . ')';
                 }
                 if ($this->input->post('labeltype') != 19 && $this->input->post('labeltype') != 21) {
                     $storage = '<div style="font-size: 7pt">' . $storedunder . '</div>';
                     $pdf->MultiCell(90, 5, $storage, 0, 'L', 0, 1, $labelfooter_pos['x'][$x], $yy, true, 0, true, true, 0, 'T', false);
                     $yy = $pdf->GetY() - 2;
                 }
                 $footer = '<div style="font-size: 7pt">Printed from MELISR, ' . date('d M. Y') . '</div>';
                 $pdf->MultiCell(90, 5, $footer, 0, 'L', 0, 1, $labelfooter_pos['x'][$x], $yy, true, 0, true, true, 0, 'T', false);
             }
         }
     }
     // move pointer to last page
     $pdf->lastPage();
     // ---------------------------------------------------------
     //Close and output PDF document
     $pdf->Output('mellabel.pdf', 'I');
 }
Example #19
0
function cetak_infohalaman2($label,$info){
	global $pdf,$dcPageW;
	$pdf->MultiCell(30, 0, $label, 0, 'L', 0, 0, $dcPageW-50, '', true);
	$pdf->MultiCell(100, 0, ': '.$info, 0, 'L', 0, 0, '', '', true);
	$pdf->Ln();
}

// 4. Cetak info halaman: Sesuaikan Page Selection Bar >> Edit
$ty=$pdf->GetY();
cetak_infohalaman('Nama stock opname',$data_so['nama']);
cetak_infohalaman('Tanggal mulai',fftgl($data_so['tanggal1']));
cetak_infohalaman('Tanggal selesai',fftgl($data_so['tanggal2']));

if($lap_sum==1){
$pdf->SetY($ty);
cetak_infohalaman2('Total item',$data_so['nitem'].' item');
cetak_infohalaman2('Item dicek',$data_so['nceky'].' item');
cetak_infohalaman2('Item hilang',($data_so['nitem']-$data_so['nceky']).' item');
}
dc_YDown(2);

// 5. Header tabel: samakan di $xtable->head() >> Edit
$phead=array(
array('No.','C',11),
array('Barkode','L',32),
array('Judul','L',60),
array('Callnumber','L',25),
array('ISBN','L',30),
array('Pengarang','L',30),
array('Penerbit','L',30),
Example #20
0
 public function detail()
 {
     $currentpage = $this->pdf->getNumPages();
     $this->maxpagey = array();
     $this->currentband = 'detail';
     $this->arraydetail[0][0]["y_axis"] = $this->arraydetail[0]["y_axis"];
     //- $this->titleheight;
     $field_pos_y = $this->arraydetail[0][0]["y_axis"];
     $biggestY = 0;
     $tempY = $this->arraydetail[0][0]["y_axis"];
     if (isset($this->SubReportCheckPoint)) {
         $checkpoint = $this->SubReportCheckPoint;
     }
     $colheader = $this->columnHeader($this->arrayPageSetting["topMargin"] + $this->titlebandheight + $this->arraypageHeader[0]["height"]);
     //if($this->pdf->getPage()>1)
     if ($this->pdf->getPage() > 1) {
         $checkpoint = $this->arrayPageSetting["topMargin"] + $this->titlebandheight + $this->arraypageHeader[0]["height"] + $this->columnheaderbandheight;
         //  for($i=0;$i<$this->totalgroup;$i++){
         $this->groupnochange = 0;
         $checkpoint = $this->showGroupHeader($checkpoint, false);
         //}
     } else {
         $checkpoint = $this->arrayPageSetting["topMargin"] + $this->orititlebandheight + $this->arraypageHeader[0]["height"] + $this->columnheaderbandheight;
         //  for($i=0;$i<$this->totalgroup;$i++){
         $checkpoint = $this->showGroupHeader($checkpoint, false);
         // }
     }
     if ($this->pdf->getPage() > 1) {
         $this->titlebandheight = 0;
     }
     $isgroupfooterprinted = false;
     if ($this->titlewithpagebreak == false) {
         $this->maxpagey = array('page_0' => $checkpoint);
     } else {
         $this->maxpagey = array('page_1' => $checkpoint);
     }
     $rownum = 0;
     if ($this->arraysqltable) {
         $n = 0;
         foreach ($this->arraysqltable as $row) {
             $n++;
             $this->report_count++;
             $currentpage = $this->pdf->getNumPages();
             $this->pdf->lastPage();
             $this->hideheader == false;
             if ($n > 1) {
                 $checkpoint = $this->maxpagey['page_' . ($this->pdf->getNumPages() - 1)];
             }
             $pageheight = $this->arrayPageSetting["pageHeight"];
             $footerheight = $this->footerbandheight;
             $headerheight = $this->headerbandheight;
             $bottommargin = $this->arrayPageSetting["bottomMargin"];
             //print_r( $this->arrayVariable);
             //echo $g["name"]."<br/>";
             if ($this->checkSwitchGroup("header")) {
                 $checkpoint = $this->showGroupHeader($checkpoint, true);
                 //echo "Switch Group: $checkpoint<br/>";
                 $currentpage = $this->pdf->getNumPages();
                 $this->maxpagey[$this->pdf->getPage() - 1] = $checkpoint;
                 $this->pdf->SetY($checkpoint);
             }
             $this->group_count[$this->grouplist[0]["name"]]++;
             $this->group_count[$this->grouplist[1]["name"]]++;
             $this->group_count[$this->grouplist[2]["name"]]++;
             $this->group_count[$this->grouplist[3]["name"]]++;
             if (isset($this->arrayVariable)) {
                 //if self define variable existing, go to do the calculation
                 $this->variable_calculation($rownum, $this->arraysqltable[$this->global_pointer][$this->group_pointer]);
             }
             //begin page handling
             for ($d = 0; $d < $this->detailbandqty; $d++) {
                 $detailheight = $this->detailbandheight[$d];
                 $this->pdf->setPage($this->pdf->getNumPages());
                 $currentpage = $this->pdf->getNumPages();
                 //  echo $this->pdf->getPage().",".$this->pdf->getNumPages().",";
                 //echo "Row:$this->report_count checkpoint:$checkpoint detail height:$detailheight> allow till:$this->detailallowtill,page:".$this->pdf->getNumPages()."<br/>";
                 //                echo "Row:$this->report_count :
                 //                    if(($checkpoint +$detailheight >$this->detailallowtill) && ({$this->pdf->getPage()}>1) || <br/>
                 //                        ($checkpoint +$detailheight >$this->detailallowtill-$this->orititleheight) && ({$this->pdf->getNumPages()}==1)<br/><br/>
                 //                    ";
                 $rowheight = 0;
                 foreach ($this->arraydetail[$d] as $out) {
                     if (isset($out["hidden_type"])) {
                         switch ($out["hidden_type"]) {
                             case "field":
                                 if ($out["stretchType"] == "RelativeToTallestObject") {
                                     $txt = $this->analyse_expression($out["txt"], $out["isPrintRepeatedValues"]);
                                     $txt = $this->formatText($txt, isset($out["pattern"]) ? $out["pattern"] : "");
                                     $rowheight = max($this->pdf->getNumLines($txt, $out["width"]), $rowheight);
                                 }
                                 break;
                             case "font":
                                 if ($this->CurrentFontFamily != $out["font"] || $this->CurrentFontStyle != $out["fontstyle"] || $this->CurrentFontSizePt != $out["fontsize"] + 0 && $out["fontsize"] + 0 != 0) {
                                     $this->pdf->SetFont($out["font"], $out["fontstyle"], $out["fontsize"]);
                                     $this->CurrentFontFamily = $this->pdf->getFontFamily();
                                     $this->CurrentFontStyle = $this->pdf->getFontStyle();
                                     $this->CurrentFontSizePt = $this->pdf->getFontSizePt();
                                 }
                                 break;
                             default:
                                 break;
                         }
                     }
                 }
                 //IF $rowheight > espacio libre hasta el footer ? cambiar de pagina >
                 $altoFila = $rowheight * ($this->pdf->GetFontSize() * $this->pdf->getCellHeightRatio() + 2 * 1);
                 if ($checkpoint + $detailheight > $this->detailallowtill && $this->pdf->getPage() > 1 || $checkpoint + $detailheight > $this->detailallowtill - $this->orititleheight && $this->pdf->getNumPages() == 1 || $checkpoint + $detailheight + $altoFila > $this->detailallowtill) {
                     $this->columnFooter();
                     $this->pageFooter();
                     $this->pageHeader();
                     $colheader = $this->columnHeader($this->arrayPageSetting["topMargin"] + $this->titlebandheight + $this->arraypageHeader[0]["height"]);
                     $currentpage = $this->pdf->getNumPages();
                     $checkpoint = $this->arrayPageSetting["topMargin"] + $this->arraypageHeader[0]["height"] + $this->titlebandheight + $this->columnheaderbandheight;
                     //$this->arraydetail[0]["y_axis"]- $this->titleheight;
                     $this->maxpagey[$this->pdf->getPage() - 1] = $checkpoint;
                 }
                 $this->currentband = 'detail';
                 /* begin page handling*/
                 foreach ($this->arraydetail[$d] as $out) {
                     $this->currentrow = $this->arraysqltable[$this->global_pointer];
                     //						echo $out["hidden_type"]."<br/>";
                     switch ($out["hidden_type"]) {
                         case "field":
                             //        $txt=$this->analyse_expression($compare["txt"]);
                             //  $out["txt"].":".print_r($out,true)."<br/>";
                             $maxheight = $this->detailallowtill - $checkpoint;
                             //$this->arrayPageSetting["pageHeight"]-$this->arraypageFooter[0]["height"]-$this->pdf->GetY()+2-$this->columnheaderbandheight-$this->columnfooterbandheight;
                             $cellMargins = 1;
                             $height = 0;
                             if ($out["stretchType"] == "RelativeToTallestObject") {
                                 $maxheight = $rowheight * ($this->pdf->GetFontSize() * $this->pdf->getCellHeightRatio() + 2 * $cellMargins);
                                 //FIXME 1 temp, calcular el margen
                                 $height = $maxheight;
                             } else {
                                 $maxheight = 0;
                                 $height = $out['height'];
                             }
                             $this->prepare_print_array = array("type" => "MultiCell", "width" => $out["width"], "height" => $height, "txt" => $out["txt"], "border" => $out["border"], "align" => $out["align"], "fill" => $out["fill"], "hidden_type" => $out["hidden_type"], "printWhenExpression" => $out["printWhenExpression"], "soverflow" => $out["soverflow"], "poverflow" => $out["poverflow"], "link" => $out["link"], "pattern" => $out["pattern"], "writeHTML" => $out["writeHTML"], "isPrintRepeatedValues" => $out["isPrintRepeatedValues"], "valign" => $out["valign"], "linktarget" => $out['linktarget']);
                             $this->display($this->prepare_print_array, 0, true, $maxheight);
                             //                                  $checkpoint=$this->arraydetail[0]["y_axis"];
                             break;
                         case "relativebottomline":
                             //$this->relativebottomline($out,$tempY);
                             $this->relativebottomline($out, $biggestY);
                             break;
                         case "subreport":
                             $checkpoint = $this->display($out, $checkpoint);
                             //$this->arraydetail[0]["y_axis"]=$checkpoint;
                             //$biggestY=$checkpoint;
                             if ($this->maxpagey['page_' . ($this->pdf->getNumPages() - 1)] < $checkpoint) {
                                 $this->maxpagey['page_' . ($this->pdf->getNumPages() - 1)] = $checkpoint;
                             }
                             break;
                         default:
                             //echo $out["hidden_type"]."=".print_r($out,true)."<br/><br/>";
                             $this->display($out, $checkpoint);
                             $maxheight = $this->detailallowtill - $checkpoint;
                             //$checkpoint=$this->pdf->GetY();
                             break;
                     }
                     if ($this->pdf->getNumPages() > 1) {
                         $this->pdf->setPage($currentpage);
                     }
                 }
                 //$this->pdf->lastPage();
                 $checkpoint = $this->maxpagey['page_' . ($this->pdf->getNumPages() - 1)];
             }
             //end loop detail band[]
             $this->pdf->setPage($this->pdf->getNumPages());
             $this->global_pointer++;
             $rownum++;
             $headerY = $checkpoint;
         }
         $this->global_pointer--;
     } else {
         //			echo "No data found";
         //			exit(0);
     }
     if ($this->totalgroup > 0) {
         $totalgroupheight = 0;
         $this->report_count++;
         $this->global_pointer++;
         $checkpoint = $this->showGroupFooter($totalgroupheight + $this->maxpagey['page_' . ($this->pdf->getNumPages() - 1)]);
         $totalgroupheight += $this->grouplist[$i]["groupfootheight"];
     }
     $this->summary($checkpoint + $detailheight);
 }
Example #21
0
 public function salary_sso_pdf_export()
 {
     $m = Input::get('m_sso_1');
     $y = Input::get('y_sso_1');
     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     $pdf->SetPrintHeader(false);
     // set header and footer fonts
     $pdf->setHeaderFont(array('freeserif', 'B', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array('freeserif', 'B', PDF_FONT_SIZE_DATA));
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // set margins
     $pdf->SetMargins(10, 15, 10);
     $pdf->SetHeaderMargin(15);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     $pdf->SetFont('freeserif', '', 14, '', true);
     $n = DB::select('select * from s_general_data');
     foreach ($n as $k) {
         $name = $k->name;
     }
     $sql = ' select s.cid, concat(n.pname,"",n.fname," ",n.lname) as name, (s.salary+s.salary_other) as salary, s.salary_sso ';
     $sql .= ' from s_salary_detail s';
     $sql .= ' left join n_datageneral n on n.cid=s.cid';
     $sql .= ' where year(order_date)=' . $y . ' and month(order_date)=' . $m . ' ';
     $data = DB::Select($sql);
     $j = 0;
     $row = 0;
     $sum1 = 0;
     $sum2 = 0;
     foreach ($data as $k) {
         $row++;
         if ($j == 30) {
             $j = 0;
         }
         if ($j == 0) {
             $pdf->AddPage('', 'A4');
             //header
             $pdf->SetFont('freeserif', '', 12, '', true);
             $pdf->SetY(5);
             $pdf->SetX(160);
             $pdf->MultiCell(40, 5, 'สปส.1-10 (ส่วนที่ 2)', 0, 'R', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', 'B', 14, '', true);
             $pdf->MultiCell(190, 5, 'แบบรายงานการแสดงการส่งเงินสมทบ ', 0, 'C', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', '', 13, '', true);
             $pdf->SetY(18);
             $pdf->MultiCell(190, 5, 'การนำส่งเงินสมทบสำหรับค่าจ้างเดิอน ' . $this->get_monthyearThai($m, $y), 0, 'C', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', 'B', 13, '', true);
             $pdf->SetY(30);
             $pdf->SetX(10);
             $pdf->MultiCell(40, 5, 'ชื่อสถานประกอบการ ', 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', '', 13, '', true);
             $pdf->SetY(30);
             $pdf->SetX(50);
             $pdf->MultiCell(70, 5, $name, 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', 'B', 13, '', true);
             $pdf->SetY(30);
             $pdf->SetX(140);
             $pdf->MultiCell(22, 5, 'เลขที่บัญชี', 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', '', 13, '', true);
             $pdf->SetY(30);
             $pdf->SetX(163);
             $pdf->MultiCell(25, 5, '1090000219', 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', 'B', 13, '', true);
             $pdf->SetY(36);
             $pdf->SetX(140);
             $pdf->MultiCell(22, 5, 'สาขา', 0, 'L', 0, 1, '', '', true);
             $pdf->SetFont('freeserif', '', 13, '', true);
             $pdf->SetY(36);
             $pdf->SetX(163);
             $pdf->MultiCell(25, 5, '300311', 0, 'L', 0, 1, '', '', true);
             $linever = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(0, 0, 0));
             $pdf->Line(200, 43, 10, 43, $linever);
             $pdf->Line(200, 50, 10, 50, $linever);
             $pdf->SetFont('freeserif', '', 13, '', true);
             $pdf->SetY(43);
             $pdf->SetX(10);
             $pdf->MultiCell(20, 7, 'ลำดับที่', 0, 'C', 0, 1, '', '', true);
             $pdf->SetY(43);
             $pdf->SetX(30);
             $pdf->MultiCell(40, 7, 'เลขประจำตัวประชาชน', 0, 'C', 0, 1, '', '', true);
             $pdf->SetY(43);
             $pdf->SetX(70);
             $pdf->MultiCell(70, 7, 'ชื่อ-สกุล', 0, 'C', 0, 1, '', '', true);
             $pdf->SetY(43);
             $pdf->SetX(140);
             $pdf->MultiCell(30, 7, 'ค่าจ้าง', 0, 'R', 0, 1, '', '', true);
             $pdf->SetY(43);
             $pdf->SetX(170);
             $pdf->MultiCell(30, 7, 'เงินสมทบ', 0, 'R', 0, 1, '', '', true);
         }
         //end add header
         //detail
         $pdf->SetY(50 + $j * 7.5);
         $pdf->SetX(10);
         $pdf->MultiCell(20, 7, $row, 0, 'R', 0, 1, '', '', true);
         $pdf->SetY(50 + $j * 7.5);
         $pdf->SetX(30);
         $pdf->MultiCell(40, 7, $k->cid, 0, 'C', 0, 1, '', '', true);
         $pdf->SetY(50 + $j * 7.5);
         $pdf->SetX(70);
         $pdf->MultiCell(70, 7, $k->name, 0, 'L', 0, 1, '', '', true);
         $pdf->SetY(50 + $j * 7.5);
         $pdf->SetX(140);
         $pdf->MultiCell(30, 7, number_format($k->salary, 2), 0, 'R', 0, 1, '', '', true);
         $pdf->SetY(50 + $j * 7.5);
         $pdf->SetX(170);
         $pdf->MultiCell(30, 7, number_format($k->salary_sso, 2), 0, 'R', 0, 1, '', '', true);
         //end detail
         $sum1 = $sum1 + $k->salary;
         $sum2 = $sum2 + $k->salary_sso;
         $j++;
     }
     // end data
     //sum all
     $pdf->Line(200, 50 + $j * 7.5, 10, 50 + $j * 7.5, $linever);
     $pdf->Line(200, 56 + $j * 7.5, 10, 57 + $j * 7.5, $linever);
     $pdf->SetFont('freeserif', 'B', 13, '', true);
     $pdf->SetY(50 + $j * 7.5);
     $pdf->SetX(70);
     $pdf->MultiCell(70, 7, 'ยอดรวม', 0, 'C', 0, 1, '', '', true);
     $pdf->SetY(50 + $j * 7.5);
     $pdf->SetX(140);
     $pdf->MultiCell(30, 7, number_format($sum1, 2), 0, 'R', 0, 1, '', '', true);
     $pdf->SetY(50 + $j * 7.5);
     $pdf->SetX(170);
     $pdf->MultiCell(30, 7, number_format($sum2, 2), 0, 'R', 0, 1, '', '', true);
     //end sum all
     //
     $pdf->SetFont('freeserif', '', 13, '', true);
     $pdf->SetY(62 + $j * 7.5);
     $pdf->SetX(70);
     $pdf->MultiCell(90, 5, 'ลงชื่อ.............................................................', 0, 'R', 0, 1, '', '', true);
     $pdf->SetY(62 + $j * 7.5);
     $pdf->SetX(160);
     $pdf->MultiCell(43, 5, 'นายจ้าง/ผู้รับมอบอำนาจ', 0, 'R', 0, 1, '', '', true);
     $pdf->SetY(70 + $j * 7.5);
     $pdf->SetX(70);
     $pdf->MultiCell(90, 5, '(.............................................................)', 0, 'R', 0, 1, '', '', true);
     $pdf->SetY(82 + $j * 7.5);
     $pdf->SetX(70);
     $pdf->MultiCell(120, 5, 'ยื่นแบบวันที่.............เดือน..............................พ.ศ..............', 0, 'C', 0, 1, '', '', true);
     $filename = storage_path() . '/salary_sso_pdf_export.pdf';
     // Response::download($filename);
     $contents = $pdf->output($filename, 'I');
     $headers = array('Content-Type' => 'application/pdf');
     return Response::make($contents, 200, $headers);
 }
Example #22
0
$pdf->Cell(0, 0, 'A4 LANDSCAPE', 1, 1, 'C');
$pdf->AddPage('P', 'A5');
$pdf->Cell(0, 0, 'A5 PORTRAIT', 1, 1, 'C');
$pdf->AddPage('L', 'A5');
$pdf->Cell(0, 0, 'A5 LANDSCAPE', 1, 1, 'C');
$pdf->AddPage('P', 'A6');
$pdf->Cell(0, 0, 'A6 PORTRAIT', 1, 1, 'C');
$pdf->AddPage('L', 'A6');
$pdf->Cell(0, 0, 'A6 LANDSCAPE', 1, 1, 'C');
$pdf->AddPage('P', 'A7');
$pdf->Cell(0, 0, 'A7 PORTRAIT', 1, 1, 'C');
$pdf->AddPage('L', 'A7');
$pdf->Cell(0, 0, 'A7 LANDSCAPE', 1, 1, 'C');
// --- test backward editing ---
$pdf->setPage(1, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A4 test', 1, 1, 'C');
$pdf->setPage(2, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A4 test', 1, 1, 'C');
$pdf->setPage(3, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A5 test', 1, 1, 'C');
$pdf->setPage(4, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A5 test', 1, 1, 'C');
$pdf->setPage(5, true);
$pdf->SetY(50);
$pdf->Cell(0, 0, 'A6 test', 1, 1, 'C');
$pdf->setPage(6, true);
$pdf->SetY(50);
    public function make_pdf($order_id, $save_to_file = true)
    {
        // 获取订单记录
        $order = M('loan_order')->find($order_id);
        if (!$order) {
            $this->error = '找不到此订单!';
            return false;
        }
        $order_id = $order['id'];
        // 获取用户协议记录
        $contract = M('loan_user_contract')->find($order['uid']);
        if (!$contract) {
            $this->error = '找不到用户的认证资料!';
            return false;
        }
        $order_auth = M('loan_order_auth')->where(['order_id' => $order['id']])->getField('auth_id,url');
        import('Common.Util.Tcpdf.Tcpdf');
        $pdf = new \TCPDF('P', 'MM', 'A4', true, 'UTF-8', false);
        $pdf->SetCreator('指尖分期');
        $pdf->SetAuthor('广西云尚文化产业投资有限公司');
        $pdf->SetTitle('指尖分期协议-' . $order['realname'] . '-' . $order_id);
        $pdf->SetSubject($order['realname']);
        $pdf->SetKeywords('指尖分期,' . $order['realname'] . ',' . $order_id);
        $pdf->setFooterData(array(0, 0, 0), array(122, 122, 122));
        $pdf->setPrintHeader(false);
        $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
        // set margins
        $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
        $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
        $pdf->SetFooterMargin(8);
        $pdf->SetY(-10);
        $pdf->SetFont('stsongstdlight', 'N', 9);
        // set auto page breaks
        $pdf->SetAutoPageBreak(TRUE, 9);
        // set image scale factor
        $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
        // ---------------------------------------------------------
        // set default font subsetting mode
        $pdf->setFontSubsetting(true);
        // Set font
        // dejavusans is a UTF-8 Unicode font, if you only need to
        // print standard ASCII chars, you can use core fonts like
        // helvetica or times to reduce file size.
        $pdf->SetFont('stsongstdlight', '', 11);
        // Add a page
        // This method has several options, check the source code documentation for more information.
        $pdf->AddPage();
        $cur_month = strtotime(date('Y-m-01', $order['created']));
        $next_month = strtotime('+1 month', $cur_month);
        $first_repay_day = date('Y-m-', $next_month) . date('d', $order['created']);
        $first_repay_day = min($first_repay_day, date('Y-m-t', $next_month));
        if (in_array($order['type'], [2, 3, 4])) {
            // 线下/现金/全网分期
            $html = '<p style="text-align:right;font-weight:bold;">协议编号:<span style="border-bottom:1px solid #000;">' . $order_id . '</span></p>
<h1 style="text-align:center">商品分期服务协议</h1>
<p>甲方:广西云尚文化产业投资有限公司<br>客服电话:400-611-8602</p>
<p>乙方:<span style="border-bottom:1px solid #000;">' . $order['realname'] . '</span><br>身份证:<span style="border-bottom:1px solid #000;">' . $contract['id_card'] . '</span><br>手机号:<span style="border-bottom:1px solid #000;">' . $order['mobile'] . '</span></p>
<p>根据《中华人民共和国合同法》等法律法规,双方本着平等自愿,公平公正,协商一致等原则,达成如下协议:</p>
<h2>第一条 分期服务</h2>
<table border="1">
  <tr><td>商品/服务名称</td><td>' . $order['title'] . '</td><td>乙方分期金额</td><td>' . $order['loan_money'] . '元</td></tr>
  <tr><td>分期月数</td><td>' . $order['month'] . '个月</td><td>每月还款金额[本金+服务费]</td><td>' . $order['month_total'] . '元</td></tr>
  <tr><td>每月还款日</td><td>每月' . date('j', $order['created']) . '日</td><td>首期还款日</td><td>' . $first_repay_day . '</td></tr>
  <tr><td colspan="4">此订单为代购,指尖分期商城只提供分期服务,不对商品/服务质量负责。</td></tr>
</table>
<h2>第二条 甲方权利和义务</h2>
<ol><li>甲方应按照本合同约定为乙方提供指尖分期网站的相关服务。
</li><li>妥善保管乙方在甲方所运营的指尖分期网站上注册登记的个人信息。
</li><li>甲方不承担乙方使用标的物过程中乙方或第三方人身伤亡或者财产损失所引发的责任。
</li></ol>
			
<h2>第三条 乙方权利和义务</h2>
<ol>
  <li>乙方应将本合同第一条所约定的每月还款金额在每月还款日前足额支付给甲方。</li>
  <li>乙方应提供有效期内的本人证件以及其他甲方要求的信息,由甲方工作人员核对。</li>
</ol>
<h2>第四条 违约责任</h2>
<ol><li>乙方若未能依本合同的约定按时支付总价款,则须向甲方支付滞纳金,滞纳金的金额按所有未偿还价款总金额的【1%】为日息进行征收(不到1日按1日计算)。
</li><li>如乙方累计拖欠甲方费用达【10】日或以上则甲方可通过书面、短信、电子邮件、电话等任一形式通知乙方解除本合同,乙方全部未偿还价款必须在自本合同解除日起【3】日内一次付清。同时,乙方必须在自本合同解除【3】日内,另向甲方支付合同未偿还价款总金额的【30%】作为违约金。如乙方延迟支付未偿还价款和违约金,每延迟【1】日,甲方有权加收应付款项(未偿还价款加违约金之和)的【1%】作为滞纳金,甲方已收取的款项(包括但不限于:首付、首期分期款、滞纳金等)不再退回。
</li><li>如乙方于还款期内有逾期还款的行为,甲方将有权免去给予乙方的任何优惠措施(包括但不限于0服务费等),在追款中产生的费用(包括但不限于调查费、诉讼费、律师费、往返路费、餐费、住宿费、电话费等)全部由乙方承担。
</li><li>乙方应保证其向甲方提供的信息真实有效、合法合规且全面,不存在任何虚假、遗漏或重大错误。如甲方发现乙方提供虚假或错误信息,将视为合同欺诈,乙方必须在自甲方发现之日起【3】日内付清全部未偿还价款,并另向甲方支付本合同总价款的【10%】作为赔偿金,已经收取的款项不予退回。如乙方延迟支付未偿还价款和赔偿金,每延迟【1】日,甲方有权向乙方加收应付款项(未偿还价款加赔偿金之和)的【1%】作为滞纳金。
</li><li>乙方如有违约行为,且出现逃避支付、拒绝沟通或者恶意拖欠还款等情形的甲方有权将乙方的个人信息及其信用信息向征信机构披露,并有权在其网站上公布相关信息,在本条所述违约情形下,甲方亦有权将乙方违约的相关信息及乙方信息向所在学校及管理机构如实披露,由此引发的后果,甲方不承担任何法律责任。
</li><li>若在规定期限内乙方无法偿还所欠款项,甲方向乙方提供有偿的兼职劳务岗位帮助乙方实现劳务代偿欠款,如乙方拒绝劳务代偿又无法支付欠款,甲方有权要求乙方一次性还清欠款与及约定的违约金、滞纳金。
</li><li>如果乙方违约,乙方同意甲方或其聘请的第三方催收机构以直接上门、邮件、电话或其他方式向乙方进行追款,乙方不得提出任何异议,由此产生的一切费用由乙方承担。
</li></ol>
<h2>第五条 授权委托</h2>
<ol><li>现乙方委托甲方在第三方平台或机构上向第三方平台或机构出借人(以下简称“出借人”)融资,融资金额即为签订合同时乙方尚未支付的金额(“应付款项”)。融资款项仅限于支付该应付款项,甲方指定乙方作为融资款项的收款人。同时甲方在此过程中为乙方提供咨询、办理融资申请、还款管理等服务。经甲方推荐且前述融资匹配成功后,甲方、乙方、第三方平台、出借人等将以电子文本形式签订《分期服务协议》。
</li><li>乙方同意,甲方作为受托融资人处理如下:<br />
(1)自主决定实现融资的理财平台,并确定有意向的资金提供方(“投资人”);<br />
(2)应理财平台或投资人的要求,在合理范围内向投资人和理财平台披露乙方资信材料,包括但不限于年龄,性别,锁在学校,专业等,并视情况引入增信措施。<br />
(3)代收乙方应向投资人及理财平台的融资款及融资成本费。<br />
(4)代收本条第(3)项的相关费用。<br />
(5)代收乙方从投资人出融到的款项,并向标的物销售方代付款项。<br />
(6)指定接收涉及本条第(3)项及第(5)项的账户。<br />
(7)以乙方名义签署和理财平台、投资人以及甲方作为保证人的《商品分期服务协议》;<br />
(8)代理在第三方平台融资所需的手续。
</li><li>乙方授权甲方及/或第三方平台在约定还款日期代扣应支付给出借人的本金、利息以及支付给第三方平台的费用,并按《商品分期服务协议》约定的还款日代付给相关个人及公司。
</li><li>授权甲方及/或第三方平台及/或相关金融机构在相关机构平台(包括但不限于:金融机构、工商、税务、征信机构、人民法院等)查询、确认乙方相关的征信信息。
</li><li>乙方同意并授权甲方在审核其信用记录、后续风险管理、提供综合化服务的过程中,向依法设立的征信机构及气体相关合法机构了解和查询其资产、资讯、个人信用信息等情况,并保留相关资料。
</li><li>乙方同意采用电子文本形式制作《商品分期服务协议》,且乙方确认已仔细阅读及不可撤销的同意该电子协议的全部条款,一经甲方及/或第三方平台通过该第三方平台账户在第三方平台对《商品分期服务协议》进行确认,相关协议即对乙方形成效力,乙方同意受《商品分期服务协议》相关内容的约束。
</li><li>授权甲方代为接收第三方平台向乙方发送的相关信息(包括但不限于分期服务协议电子文本,债权转让协议通知等),该等信息在发送至甲方时即视为送达乙方。
</li><li>乙方授权甲方可将上述委托事项部分或全部转委托。
</li><li>委托期限:自合同生效之日起至甲方或第三方平台代乙方在第三方平台签署电子文本形式的《商品分期服务协议》项下确认乙方的义务全部履行完毕之日止。
</li><li>特别委托:乙方在此不可撤销的承诺,乙方在《商品分期服务协议》项下乙方未全部履行完毕之前,不得单方面解除或终止上述对甲方及/或第三方平台的委托。
</li><li>若乙方未按照相关融资协议履行偿还义务,甲方进行预期垫付融资款项以及融资利息和理财平台费用,自甲方代偿之日起,乙方应当在【3】个工作日内向甲方偿还上诉款项,并向甲方支付违约金:代偿款项*【1】%*逾期天数,为避免疑义,逾期天数自乙方预期偿还代偿融资款项及融资利息或服务费之日起计算,至乙方向甲方偿还该等代偿融资款项及融资利息或服务费以及违约金之日截止。
</li></ol>
<h2>第六条 争议解决</h2>
<p>本协议在履行过程中如发生争议,双方应协商解决;协商不成,可向仲裁机构提交仲裁申请进行调解,不愿调解的甲乙双方均可向甲乙方所在地的法院起诉。</p>
<h2>第七条 合同的变更和解除</h2>
<p>除合同另有约定外,任何一方均不得单方面变更或解除本合同,对本合同或其他条款内容有任何补充、修改或变更,必须经过双方事先达成书面协议方可作实。
</p>
<h2>第八条 合同的生效</h2>
<ol>
  <li>本协议以电子文本形式生成。
</li><li>本协议的任何修改、补充均须以甲方平台电子文本形式做出。
</li><li>乙方委托甲方保管所有与本协议有关的书面文件或电子信息。
</li><li>双方确认,本协议由乙方通过甲方运营的网站、手机客户端以网络在线点击确认的方式进行签署。
</li><li>乙方下单分期时阅读本协议电子版并点击确认,甲方派工作人员当面与乙方确认订单信息与协议内容,乙方确认所有事项后签署订单确认书并由乙方本人手持订单确认书拍照作为不可抵赖的法律证据由甲方保存。
</li><li>甲方审核完订单信息后完成订单付款操作后本协议自动生效,协议双方不得有异议。
</li>
</ol>
<h2>第九条 银行代扣</h2>
<p>为方便甲、乙双方关于商品分期付款费用的收缴工作,经双方协商,除支付宝支付外也可选用指定银行卡支付,银行卡指定开户行在广西区内为桂林银行,乙方在桂林银行开设预定代扣银行卡,每个月在还款期限达到前将资金划拨到该银行卡,用于支付乙方每月的分期付款费用。
</p>
<br />
<p style="font-weight:bold;">乙方承诺:本人保证所提供的个人资料信息真实,有效。并依据详细了解所填合同章程,业务协议,功能说明及责任条款,同意接受相关业务章程和协议的约束,以上条款本人已经确认并知晓。</p>
<br />';
            $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
            // $pdf->AddPage ();
            $img = $order_auth[9] ? '<img src="' . $order_auth[9] . '?imageMogr2/auto-orient/thumbnail/2000x2000" border="0" />' : '';
            $pdf->writeHTMLCell(0, 0, '', '', '<h2>第十条 附件资料</h2><div style="border:1px solid #000;padding:10px;margin-bottom:10px;"><p style="text-align:center;">(手持确认书)</p>' . $img . '</div>', 0, 1, 0, true, '', true);
        } else {
            // 线上代购
            $html = '<p style="text-align:right;font-weight:bold;">协议编号:<span style="border-bottom:1px solid #000;">' . $order_id . '</span></p>
<h1 style="text-align:center">商品分期服务协议</h1>
<p>甲方:广西云尚文化产业投资有限公司<br>客服电话:400-611-8602</p>
<p>乙方:<span style="border-bottom:1px solid #000;">' . $order['realname'] . '</span><br>身份证:<span style="border-bottom:1px solid #000;">' . $contract['id_card'] . '</span><br>手机号:<span style="border-bottom:1px solid #000;">' . $order['mobile'] . '</span></p>
<p>根据《中华人民共和国合同法》等法律法规,双方本着平等自愿,公平公正,协商一致等原则,达成如下协议:</p>
<h2>第一条 分期服务</h2>
<table border="1">
  <tr><td>商品/服务名称</td><td>' . $order['title'] . '</td><td>乙方分期金额</td><td>' . $order['loan_money'] . '元</td></tr>
  <tr><td>分期月数</td><td>' . $order['month'] . '个月</td><td>每月还款金额[本金+服务费]</td><td>' . $order['month_total'] . '元</td></tr>
  <tr><td>每月还款日</td><td>每月' . date('j', $order['created']) . '日</td><td>首期还款日</td><td>' . $first_repay_day . '</td></tr>
</table>
<h2>第二条 甲方权利和义务</h2>
<ol><li>甲方应按照本合同约定为乙方提供指尖分期网站的相关服务。
</li><li>妥善保管乙方在甲方所运营的指尖分期网站上注册登记的个人信息。
</li><li>甲方不承担乙方使用标的物过程中乙方或第三方人身伤亡或者财产损失所引发的责任。
</li></ol>
			
<h2>第三条 乙方权利和义务</h2>
<ol>
  <li>乙方应将本合同第一条所约定的每月还款金额在每月还款日前足额支付给甲方。</li>
  <li>乙方应提供有效期内的本人证件以及其他甲方要求的信息,由甲方工作人员核对。</li>
</ol>
<h2>第四条 违约责任</h2>
<ol><li>乙方若未能依本合同的约定按时支付总价款,则须向甲方支付滞纳金,滞纳金的金额按所有未偿还价款总金额的【1%】为日息进行征收(不到1日按1日计算)。
</li><li>如乙方累计拖欠甲方费用达【10】日或以上则甲方可通过书面、短信、电子邮件、电话等任一形式通知乙方解除本合同,乙方全部未偿还价款必须在自本合同解除日起【3】日内一次付清。同时,乙方必须在自本合同解除【3】日内,另向甲方支付合同未偿还价款总金额的【30%】作为违约金。如乙方延迟支付未偿还价款和违约金,每延迟【1】日,甲方有权加收应付款项(未偿还价款加违约金之和)的【1%】作为滞纳金,甲方已收取的款项(包括但不限于:首付、首期分期款、滞纳金等)不再退回。
</li><li>如乙方于还款期内有逾期还款的行为,甲方将有权免去给予乙方的任何优惠措施(包括但不限于0服务费等),在追款中产生的费用(包括但不限于调查费、诉讼费、律师费、往返路费、餐费、住宿费、电话费等)全部由乙方承担。
</li><li>乙方应保证其向甲方提供的信息真实有效、合法合规且全面,不存在任何虚假、遗漏或重大错误。如甲方发现乙方提供虚假或错误信息,将视为合同欺诈,乙方必须在自甲方发现之日起【3】日内付清全部未偿还价款,并另向甲方支付本合同总价款的【10%】作为赔偿金,已经收取的款项不予退回。如乙方延迟支付未偿还价款和赔偿金,每延迟【1】日,甲方有权向乙方加收应付款项(未偿还价款加赔偿金之和)的【1%】作为滞纳金。
</li><li>乙方如有违约行为,且出现逃避支付、拒绝沟通或者恶意拖欠还款等情形的甲方有权将乙方的个人信息及其信用信息向征信机构披露,并有权在其网站上公布相关信息,在本条所述违约情形下,甲方亦有权将乙方违约的相关信息及乙方信息向所在学校及管理机构如实披露,由此引发的后果,甲方不承担任何法律责任。
</li><li>若在规定期限内乙方无法偿还所欠款项,甲方向乙方提供有偿的兼职劳务岗位帮助乙方实现劳务代偿欠款,如乙方拒绝劳务代偿又无法支付欠款,甲方有权要求乙方一次性还清欠款与及约定的违约金、滞纳金。
</li><li>如果乙方违约,乙方同意甲方或其聘请的第三方催收机构以直接上门、邮件、电话或其他方式向乙方进行追款,乙方不得提出任何异议,由此产生的一切费用由乙方承担。
</li></ol>
<h2>第五条 授权委托</h2>
<ol><li>现乙方委托甲方在第三方平台或机构上向第三方平台或机构出借人(以下简称“出借人”)融资,融资金额即为签订合同时乙方尚未支付的金额(“应付款项”)。融资款项仅限于支付该应付款项,甲方指定乙方作为融资款项的收款人。同时甲方在此过程中为乙方提供咨询、办理融资申请、还款管理等服务。经甲方推荐且前述融资匹配成功后,甲方、乙方、第三方平台、出借人等将以电子文本形式签订《分期服务协议》。
</li><li>乙方同意,甲方作为受托融资人处理如下:<br />
(1)自主决定实现融资的理财平台,并确定有意向的资金提供方(“投资人”);<br />
(2)应理财平台或投资人的要求,在合理范围内向投资人和理财平台披露乙方资信材料,包括但不限于年龄,性别,锁在学校,专业等,并视情况引入增信措施。<br />
(3)代收乙方应向投资人及理财平台的融资款及融资成本费。<br />
(4)代收本条第(3)项的相关费用。<br />
(5)代收乙方从投资人出融到的款项,并向标的物销售方代付款项。<br />
(6)指定接收涉及本条第(3)项及第(5)项的账户。<br />
(7)以乙方名义签署和理财平台、投资人以及甲方作为保证人的《商品分期服务协议》;<br />
(8)代理在第三方平台融资所需的手续。
</li><li>乙方授权甲方及/或第三方平台在约定还款日期代扣应支付给出借人的本金、利息以及支付给第三方平台的费用,并按《商品分期服务协议》约定的还款日代付给相关个人及公司。
</li><li>授权甲方及/或第三方平台及/或相关金融机构在相关机构平台(包括但不限于:金融机构、工商、税务、征信机构、人民法院等)查询、确认乙方相关的征信信息。
</li><li>乙方同意并授权甲方在审核其信用记录、后续风险管理、提供综合化服务的过程中,向依法设立的征信机构及气体相关合法机构了解和查询其资产、资讯、个人信用信息等情况,并保留相关资料。
</li><li>乙方同意采用电子文本形式制作《商品分期服务协议》,且乙方确认已仔细阅读及不可撤销的同意该电子协议的全部条款,一经甲方及/或第三方平台通过该第三方平台账户在第三方平台对《商品分期服务协议》进行确认,相关协议即对乙方形成效力,乙方同意受《商品分期服务协议》相关内容的约束。
</li><li>授权甲方代为接收第三方平台向乙方发送的相关信息(包括但不限于分期服务协议电子文本,债权转让协议通知等),该等信息在发送至甲方时即视为送达乙方。
</li><li>乙方授权甲方可将上述委托事项部分或全部转委托。
</li><li>委托期限:自合同生效之日起至甲方或第三方平台代乙方在第三方平台签署电子文本形式的《商品分期服务协议》项下确认乙方的义务全部履行完毕之日止。
</li><li>特别委托:乙方在此不可撤销的承诺,乙方在《商品分期服务协议》项下乙方未全部履行完毕之前,不得单方面解除或终止上述对甲方及/或第三方平台的委托。
</li><li>若乙方未按照相关融资协议履行偿还义务,甲方进行预期垫付融资款项以及融资利息和理财平台费用,自甲方代偿之日起,乙方应当在【3】个工作日内向甲方偿还上诉款项,并向甲方支付违约金:代偿款项*【1】%*逾期天数,为避免疑义,逾期天数自乙方预期偿还代偿融资款项及融资利息或服务费之日起计算,至乙方向甲方偿还该等代偿融资款项及融资利息或服务费以及违约金之日截止。
</li></ol>
<h2>第六条 争议解决</h2>
<p>本协议在履行过程中如发生争议,双方应协商解决;协商不成,可向仲裁机构提交仲裁申请进行调解,不愿调解的甲乙双方均可向甲乙方所在地的法院起诉。</p>
<h2>第七条 合同的变更和解除</h2>
<p>除合同另有约定外,任何一方均不得单方面变更或解除本合同,对本合同或其他条款内容有任何补充、修改或变更,必须经过双方事先达成书面协议方可作实。
</p>
<h2>第八条 合同的生效</h2>
<ol>
  <li>本协议以电子文本形式生成。
</li><li>本协议的任何修改、补充均须以甲方平台电子文本形式做出。
</li><li>乙方委托甲方保管所有与本协议有关的书面文件或电子信息。
</li><li>双方确认,本协议由乙方通过甲方运营的网站、手机客户端以网络在线点击确认的方式进行签署。
</li><li>乙方下单分期时阅读本协议电子版并点击确认,甲方派工作人员当面与乙方确认订单信息与协议内容,乙方确认所有事项后签署订单确认书并由乙方本人手持订单确认书拍照作为不可抵赖的法律证据由甲方保存。
</li><li>甲方审核完订单信息后完成订单付款操作后本协议自动生效,协议双方不得有异议。
</li>
</ol>
<h2>第九条 银行代扣</h2>
<p>为方便甲、乙双方关于商品分期付款费用的收缴工作,经双方协商,除支付宝支付外也可选用指定银行卡支付,银行卡指定开户行在广西区内为桂林银行,乙方在桂林银行开设预定代扣银行卡,每个月在还款期限达到前将资金划拨到该银行卡,用于支付乙方每月的分期付款费用。
</p>
<h2>第十条 退换货政策以第三方销售商退换货政策为准。</h2>
<ol>
  <li>因下述原因造成乙方未能预期收到标的物或标的物不符合乙方的预期的,由乙方自行承担相关风险,且不影响乙方在本合同项下履行向甲方支付代理服务费的义务:
(1)乙方提供的购物信息不实或者有误;<br />
(2)乙方未及时签收标的物;<br />
(3)标的物本身的质量、物流、售后等可归咎于销售方、物流公司或者其他第三方的问题等。乙方因本条上述原因退货产生的费用(包含但不限于:对应账单生成到取消期间甲方的服务费、运费、第三方销售商的手续费等)均由乙方承担。乙方退换货成功,相关款项退到甲方账户后,此费用根据甲方网站公布的规定生成新账单,乙方不得因退换货成功而拒绝承担此费用。
</li><li>乙方在签署本合同后应及时接收标的物。如乙方因故不能接收标的物的,应与第三方销售商或相关物流协商延期。如协商不成或乙方延期提取标的物超过【3】日的,应视为放弃,乙方不得要求甲方退还任何款项,并需在甲方处置标的物后的【3】日内向甲方支付本合同总价款的1%作为服务费及因此产生的费用。
</li><li>在标的物交付后【7】日内,乙方应对标的物进行全面检查,如存在非乙方原因引起的产品瑕疵或质量问题,乙方可自行联系第三方销售商处理,甲方在此过程中可给予配合。
</li><li>对于标的物在交付后使用过程中产生的产品瑕疵或质量问题,乙方可按照标的物相关的三包条款处理,如质保期限已过或者乙方要求处理的商品与第三方销售商所售商品的序列号不符(以第三方销售商后台记录为准),乙方应自行承担相关责任。
</li><li>标的物的交付时间,以第三方销售商及相关物流商的签收日期为准。标的物交付后,标的物毁损灭失的风险由乙方承担。如乙方将标的物转交第三方,由此产生的风险一概与甲方无关。以上风险承担的规定不影响各自对违约责任及其他责任的主张。
</li>
</ol>
<br />
<p style="font-weight:bold;margin:0 20px;">乙方承诺:本人保证所提供的个人资料信息真实,有效。并依据详细了解所填合同章程,业务协议,功能说明及责任条款,同意接受相关业务章程和协议的约束,以上条款本人已经确认并知晓。</p>
<br />';
            $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
            // $pdf->AddPage ();
            $img = $order_auth[9] ? '<img src="' . $order_auth[9] . '?imageMogr2/auto-orient/thumbnail/2000x2000" border="0" />' : '';
            $pdf->writeHTMLCell(0, 0, '', '', '<h2>第十一条 附件资料</h2><div style="border:1px solid #000;padding:10px;margin-bottom:10px;"><p style="text-align:center;">(手持确认书)</p>' . $img . '</div>', 0, 1, 0, true, '', true);
        }
        // ---------------------------------------------------------
        $base_dir = THINK_PATH . '../../static.zjfq';
        $save_dir = '/order/contract/' . date('Ymd') . '/';
        $filename = md5('order' . $order_id . 'contract') . '.pdf';
        $save_dir_all = $base_dir . $save_dir;
        is_dir($save_dir_all) or mkdir($save_dir_all, 0777, true);
        if ($save_to_file) {
            $pdf->Output($save_dir_all . $filename, 'F');
            unset($pdf);
            return $save_dir . $filename;
        } else {
            $pdf->Output($save_dir_all . $filename, 'I');
            unset($pdf);
            return;
        }
        unset($pdf);
    }