Пример #1
2
/**
 *	Show linked objects for PDF generation
 *
 *	@param	PDF			$pdf				Object PDF
 *	@param	object		$object				Object
 *	@param  Translate	$outputlangs		Object lang
 *	@param  int			$posx				X
 *	@param  int			$posy				Y
 *	@param	float		$w					Width of cells. If 0, they extend up to the right margin of the page.
 *	@param	float		$h					Cell minimum height. The cell extends automatically if needed.
 *	@param	int			$align				Align
 *	@param	string		$default_font_size	Font size
 *	@return	float                           The Y PDF position
 */
function pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size)
{
    $linkedobjects = pdf_getLinkedObjects($object, $outputlangs);
    if (!empty($linkedobjects)) {
        foreach ($linkedobjects as $linkedobject) {
            $posy += 3;
            $pdf->SetXY($posx, $posy);
            $pdf->SetFont('', '', $default_font_size - 2);
            $pdf->MultiCell($w, $h, $linkedobject["ref_title"] . ' : ' . $linkedobject["ref_value"], '', $align);
            if (!empty($linkedobject["date_title"]) && !empty($linkedobject["date_value"])) {
                $posy += 3;
                $pdf->SetXY($posx, $posy);
                $pdf->MultiCell($w, $h, $linkedobject["date_title"] . ' : ' . $linkedobject["date_value"], '', $align);
            }
        }
    }
    return $pdf->getY();
}
Пример #2
0
 /**
  *   Show table for lines
  *
  *   @param		PDF			$pdf     		Object PDF
  *   @param		string		$tab_top		Top position of table
  *   @param		string		$tab_height		Height of table (rectangle)
  *   @param		int			$nexY			Y
  *   @param		Translate	$outputlangs	Langs object
  *   @param		int			$hidetop		Hide top bar of array
  *   @param		int			$hidebottom		Hide bottom bar of array
  *   @return	void
  */
 function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
 {
     global $conf, $mysoc;
     $default_font_size = pdf_getPDFFontSize($outputlangs);
     $pdf->SetDrawColor(128, 128, 128);
     // Rect prend une longueur en 3eme param
     $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height);
     // line prend une position y en 3eme param
     $pdf->line($this->marge_gauche, $tab_top + 6, $this->page_largeur - $this->marge_droite, $tab_top + 6);
     $pdf->SetTextColor(0, 0, 0);
     $pdf->SetFont('', '', $default_font_size);
     $pdf->SetXY($this->posxref, $tab_top + 1);
     $pdf->MultiCell($this->posxlabel - $this->posxref, 3, $outputlangs->transnoentities("Tasks"), '', 'L');
     $pdf->SetXY($this->posxlabel, $tab_top + 1);
     $pdf->MultiCell($this->posxworkload - $this->posxlabel, 3, $outputlangs->transnoentities("Description"), 0, 'L');
     $pdf->SetXY($this->posxworkload, $tab_top + 1);
     $pdf->MultiCell($this->posxprogress - $this->posxworkload, 3, $outputlangs->transnoentities("PlannedWorkloadShort"), 0, 'R');
     $pdf->SetXY($this->posxprogress, $tab_top + 1);
     $pdf->MultiCell($this->posxdatestart - $this->posxprogress, 3, '%', 0, 'R');
     $pdf->SetXY($this->posxdatestart, $tab_top + 1);
     $pdf->MultiCell($this->posxdateend - $this->posxdatestart, 3, '', 0, 'C');
     $pdf->SetXY($this->posxdateend, $tab_top + 1);
     $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxdatestart, 3, '', 0, 'C');
 }
 // echo "name=$name";
 $school = $r2['school_names_desc'];
 $q5 = @mysql_query("select * from studentcontact where studentcontact_id = {$r1['studentbio_id']}");
 $r5 = @mysql_fetch_array($q5);
 $address1 = $r5['studentcontact_address1'];
 $address2 = $r5['studentcontact_address2'];
 $city = $r5['studentcontact_city'];
 $zip = $r5['studentcontact_zip'];
 $pdf = new PDF('L');
 $w = array(35, 35, 35, 35, 35, 35);
 $pdf->Open();
 $pdf->SetWidths($w);
 $pdf->SetMargins(50, 30);
 $pdf->AddPage();
 $pdf->SetFillColor(255, 255, 255);
 $pdf->SetXY(195, 35);
 $pdf->SetFont('Times', 'IB', 16);
 $pdf->Write(1, $school);
 $pdf->SetFont('Times', '', 14);
 $pdf->Ln();
 $pdf->SetXY(30, 50);
 $pdf->Write(1, $name);
 $pdf->Ln();
 $pdf->SetXY(30, 55);
 $pdf->Write(1, $address1);
 $pdf->Ln();
 if (!empty($address2)) {
     $pdf->SetXY(30, 60);
     $pdf->Write(1, $address2);
 }
 $pdf->Ln();
$rep02OMB = $rep02["OMB"];
$rep02DRT = $rep02["DRT"];
$rep02Funcao = $rep02["Funcao"];
$rep02Endereco = $rep02["Endereco"];
$rep02Telefones = $rep02["Telefones"];
$rep02Email = $rep02["Email"];
$rep02INSS = $rep02["INSS"];
// GERANDO O PDF:
$pdf = new PDF('P', 'mm', 'A4');
//CRIA UM NOVO ARQUIVO PDF NO TAMANHO A4
$pdf->AliasNbPages();
$pdf->AddPage();
$x = 20;
$l = 10;
//DEFINE A ALTURA DA LINHA
$pdf->SetXY($x, 20);
// SetXY - DEFINE O X (largura) E O Y (altura) NA PÁGINA
$pdf->SetX($x);
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(180, 5, utf8_decode('DECLARAÇÃO'), 0, 1, 'C');
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->SetX($x);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(25, $l, utf8_decode('Razão Social:'), 0, 0, 'L');
$pdf->SetFont('Arial', '', 10);
$pdf->MultiCell(155, $l, utf8_decode($pjRazaoSocial));
$pdf->SetX($x);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(13, $l, utf8_decode('CNPJ:'), 0, 0, 'L');
 /**
  * Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0)
  *
  * @param	PDF			$pdf			PDF reference
  * @param	Translate	$outputlangs	Output langs
  * @param	array		$param			Associative array containing label content and optional parameters
  * @return	void
  */
 function addSticker(&$pdf, $outputlangs, $param)
 {
     global $mysoc, $conf;
     $textleft = $param['textleft'];
     $header = $param['textheader'];
     $footer = $param['textfooter'];
     $textright = $param['textright'];
     $code = $param['code'];
     $encoding = $param['encoding'];
     $is2d = $param['is2d'];
     // We are in a new page, then we must add a page
     if ($this->_COUNTX == 0 && $this->_COUNTY == 0 and !$this->_First == 1) {
         $pdf->AddPage();
     }
     $this->_First = 0;
     $_PosX = $this->_Margin_Left + $this->_COUNTX * ($this->_Width + $this->_X_Space);
     $_PosY = $this->_Margin_Top + $this->_COUNTY * ($this->_Height + $this->_Y_Space);
     // Define logo
     $logo = $conf->mycompany->dir_output . '/logos/' . $mysoc->logo;
     if (!is_readable($logo)) {
         $logo = '';
         if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_small)) {
             $logo = $conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_small;
         } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output . '/logos/' . $mysoc->logo)) {
             $logo = $conf->mycompany->dir_output . '/logos/' . $mysoc->logo;
         }
     }
     $xleft = 2;
     $ytop = 2;
     // Top
     if ($header != '') {
         $pdf->SetXY($_PosX + $xleft, $_PosY + 1);
         // Only 1 mm and not ytop for top text
         $pdf->Cell($this->_Width - 2 * $xleft, $this->_Line_Height, $outputlangs->convToOutputCharset($header), 0, 1, 'C');
     }
     $ytop += empty($header) ? 0 : 1 + $this->_Line_Height;
     // Define widthtouse and heighttouse
     $pageMargins = $pdf->getMargins();
     $maxwidthtouse = round($this->_Width - 2 * $xleft);
     $maxheighttouse = round($this->_Height - 2 * $ytop);
     $maxheighttouse -= empty($footer) ? 0 : 1 + $this->_Line_Height;
     $defaultratio = $maxwidthtouse / $maxheighttouse;
     $widthtouse = $maxwidthtouse;
     $heighttouse = $maxheighttouse;
     $logoHeight = $heighttouse;
     $logoWidth = $heighttouse;
     //var_dump($this->_Width.'x'.$this->_Height.' with border and scale '.$imgscale.' => max '.$maxwidthtouse.'x'.$maxheighttouse.' => We use '.$widthtouse.'x'.$heighttouse);exit;
     // Center
     if ($textright == '') {
         // Output left area
         if ($textleft == '%LOGO%' && $logo) {
             $pdf->Image($logo, $_PosX + $xleft, $_PosY + $ytop, 0, $logoHeight);
         } else {
             if ($code && !empty($encoding)) {
                 $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX + $xleft, $_PosY + $ytop, $widthtouse, $heighttouse);
             } else {
                 $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop);
                 $pdf->MultiCell($this->_Width, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L');
             }
         }
     } else {
         if ($textleft != '' && $textright != '') {
             if (($textleft == '%LOGO%' || $textleft == '%PHOTO%' || $textleft == '%BARCODE%') && !strstr($textright, '%')) {
                 if ($textleft == '%LOGO%' && $logo) {
                     $pdf->Image($logo, $_PosX + $xleft, $_PosY + $ytop, $widthtouse / 2, 0);
                 } else {
                     if ($code && !empty($encoding)) {
                         $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX + $xleft, $_PosY + $ytop, $widthtouse / 2, $heighttouse);
                     }
                 }
                 $pdf->SetXY($_PosX + $widthtouse / 2, $_PosY + $ytop);
                 $pdf->MultiCell($widthtouse / 2, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R');
             } else {
                 if (($textright == '%LOGO%' || $textright == '%PHOTO%' || $textright == '%BARCODE%') && !strstr($textleft, '%')) {
                     if ($textright == '%LOGO%' && $logo) {
                         $pdf->Image($logo, $_PosX + $widthtouse / 2, $_PosY + $ytop, $widthtouse / 2, 0);
                     } else {
                         if ($code && !empty($encoding)) {
                             $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX + $widthtouse / 2, $_PosY + $ytop, $widthtouse / 2, $heighttouse);
                         }
                     }
                     $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop);
                     $pdf->MultiCell($widthtouse / 2, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L');
                 } else {
                     if ($textleft == '%LOGO%') {
                         if ($logo) {
                             $pdf->Image($logo, $_PosX + $xleft, $_PosY + $ytop, 0, $logoHeight);
                         }
                         if ($code && !empty($encoding)) {
                             $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX + $xleft + $logoWidth + 1, $_PosY + $ytop, $widthtouse - $logoWidth - 1, $heighttouse);
                         } else {
                             $pdf->SetXY($_PosX + $xleft + $logoWidth + 1, $_PosY + $ytop);
                             $pdf->MultiCell($widthtouse - $logoWidth1 - 1, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R');
                         }
                     } else {
                         if ($textright == '%LOGO%') {
                             if ($logo) {
                                 $pdf->Image($logo, $_PosX + $xleft + $widthtouse - $logoWidth + 1, $_PosY + $ytop, 0, $logoHeight);
                             }
                             if ($code && !empty($encoding)) {
                                 $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX + $xleft, $_PosY + $ytop, $widthtouse - $logoWidth - 1, $heighttouse);
                             } else {
                                 $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop);
                                 $pdf->MultiCell($widthtouse - $logoWidth - 1, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L');
                             }
                         } else {
                             $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop);
                             $pdf->MultiCell(round($this->_Width / 2), $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L');
                             $pdf->SetXY($_PosX + round($this->_Width / 2), $_PosY + $ytop);
                             $pdf->MultiCell(round($this->_Width / 2) - 2, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R');
                         }
                     }
                 }
             }
         } else {
             // Output right area
             if ($textright == '%LOGO%' && $logo) {
                 $pdf->Image($logo, $_PosX + $this->_Width - $widthtouse - $xleft, $_PosY + $ytop, 0, $logoHeight);
             } else {
                 if ($code && !empty($encoding)) {
                     $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX + $this->_Width - $widthtouse - $xleft, $_PosY + $ytop, $widthtouse, $heighttouse);
                 } else {
                     $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop);
                     $pdf->MultiCell($this->_Width - $xleft, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R');
                 }
             }
         }
     }
     // Bottom
     if ($footer != '') {
         $pdf->SetXY($_PosX, $_PosY + $this->_Height - $this->_Line_Height - 1);
         $pdf->Cell($this->_Width, $this->_Line_Height, $outputlangs->convToOutputCharset($footer), 0, 1, 'C');
     }
     //print "$_PosY+$this->_Height-$this->_Line_Height-1<br>\n";
     $this->_COUNTY++;
     if ($this->_COUNTY == $this->_Y_Number) {
         // Si on est en bas de page, on remonte le 'curseur' de position
         $this->_COUNTX++;
         $this->_COUNTY = 0;
     }
     if ($this->_COUNTX == $this->_X_Number) {
         // Si on est en bout de page, alors on repart sur une nouvelle page
         $this->_COUNTX = 0;
         $this->_COUNTY = 0;
     }
 }
Пример #6
0
    $pdf->Cell($w1[5], $ln, $arrField_2[$i], 'LR', 1, 'L');
}
$pdf->Line($margin, $pdf->GetY(), $margin + $w1[0] + $w1[1] + $w1[2] + $w1[3] + $w1[4] + $w1[5], $pdf->GetY());
$pdf->Ln() * 2;
$pdf->SetFont($font, 'B', $size);
$pdf->SetX($margin + $w[0]);
$pdf->Cell($w[1], $ln, 'B. TARGET DAN REALISASI', '', 1, 'L');
$w2 = array(7, 35, 12, 12, 12, 10, 12, 12, 12);
$pdf->SetFont($font, 'B', $size - 4);
$pdf->SetX($margin);
$pdf->Cell($w2[0], $ln * 3, 'NO.', $border, 0, 'C');
$pdf->SetX($margin + $w2[0]);
$pdf->Cell($w2[1], $ln * 3, 'III. KEGIATAN TUGAS JABATAN', $border, 0, 'L');
$pdf->SetFont($font, 'B', $size - 4);
$y = $pdf->GetY();
$pdf->SetXY($margin + $w2[0] + $w2[1], $y);
$pdf->Cell($w2[2], $ln * 2, 'ANGKA', $noborder, 0, 'C');
$pdf->SetXY($margin + $w2[0] + $w2[1], $y + 6);
$pdf->Cell($w2[2], $ln, 'KREDIT', $noborder, 0, 'C');
$pdf->SetXY($margin + $w2[0] + $w2[1], $y);
$pdf->Cell($w2[2], $ln * 3, '', $border, 0, 'C');
$pdf->SetFont($font, 'B', $size - 3);
$pdf->SetX($margin + $w2[0] + $w2[1] + $w2[2]);
$pdf->Cell($w2[3] + $w2[4] + $w2[5] + $w2[6], $ln, 'TARGET', $border, 0, 'C');
$pdf->SetFont($font, 'B', $size - 4);
$y = $pdf->GetY();
$pdf->SetXY($margin + $w2[0] + $w2[1] + $w2[2] + $w2[3] + $w2[4] + $w2[5] + $w2[6], $y);
$pdf->Cell($w2[2], $ln * 2, 'ANGKA', $noborder, 0, 'C');
$pdf->SetXY($margin + $w2[0] + $w2[1] + $w2[2] + $w2[3] + $w2[4] + $w2[5] + $w2[6], $y + 6);
$pdf->Cell($w2[2], $ln, 'KREDIT', $noborder, 0, 'C');
$pdf->SetXY($margin + $w2[0] + $w2[1] + $w2[2] + $w2[3] + $w2[4] + $w2[5] + $w2[6], $y);
Пример #7
0
 /**
  *   	Show footer of page. Need this->emetteur object
  *
  *   	@param	PDF			$pdf     			PDF
  * 		@param	Object		$object				Object to show
  *      @param	Translate	$outputlangs		Object lang for output
  *      @param	int			$hidefreetext		1=Hide free text
  *      @return	void
  */
 function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
 {
     $default_font_size = pdf_getPDFFontSize($outputlangs);
     $pdf->SetFont('', '', $default_font_size - 2);
     $pdf->SetY(-23);
     $pdf->MultiCell(100, 3, $outputlangs->transnoentities("GoodStatusDeclaration"), 0, 'L');
     $pdf->SetY(-13);
     $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ToAndDate"), 0, 'C');
     $pdf->SetXY(120, -23);
     $pdf->MultiCell(100, 3, $outputlangs->transnoentities("NameAndSignature"), 0, 'C');
     // Show page nb only on iso languages (so default Helvetica font)
     //if (pdf_getPDFFont($outputlangs) == 'Helvetica')
     //{
     //    $pdf->SetXY(-10,-10);
     //    $pdf->MultiCell(11, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0);
     //}
 }
Пример #8
0
        $pdf->Cell(6, $margin, $i, 0, 0);
        $pdf->Cell(30, $margin, $outbox->no_surat, 0, 0);
        $pdf->Cell(15, $margin, date("d-m-Y", strtotime($outbox->tgl_masuk)), 0, 0);
        $pdf->Cell(15, $margin, date("d-m-Y", strtotime($outbox->tgl_surat)), 0, 0);
        $current_x1 = $pdf->GetX();
        $current_y1 = $pdf->GetY();
        $pdf->Cell(90);
        $current_x2 = $pdf->GetX();
        $current_y2 = $pdf->GetY();
        $pdf->Cell(50);
        $current_x3 = $pdf->GetX();
        $current_y3 = $pdf->GetY();
        $pdf->Cell(35);
        $pdf->Cell(30, $margin, $outbox->nama_jenis, 0, 0);
        $pdf->Cell(0, $margin, $outbox->first_name, 0, 0);
        $pdf->SetXY($current_x3, $current_y3);
        $pdf->MultiCell(35, $margin, $outbox->ptt, 0, 'L');
        $y3 = $pdf->getY();
        $pdf->SetXY($current_x2, $current_y2);
        $pdf->MultiCell(50, $margin, $outbox->tujuan, 0, 'L');
        $y2 = $pdf->getY();
        $pdf->SetXY($current_x1, $current_y1);
        $pdf->MultiCell(90, $margin, $outbox->perihal, 0, 'L');
        $y1 = $pdf->getY();
        $pdf->setY(max($y1, $y2, $y3));
        $pdf->CreateLine($pdf->GetY());
        if ($outbox == end($data_outbox)) {
            $pdf->CountJenis($i);
        }
    }
}
Пример #9
0
 // Total Produksi
 $pdf->SetFont($font, 'B', $size - 1);
 $pdf->Cell(32, $height, 'JUMLAH KARTU', 1, 0, 'L');
 $pdf->SetFont($font, '', $size);
 $pdf->Cell(32, $height, $data->t_prod_card . ' / ' . $data->t_prod_card_cnt, 1, 0, 'C');
 // Jumlah Kartu
 $pdf->Ln($height);
 $pdf->SetFont($font, 'B', $size - 1);
 $pdf->Cell(96, $height, 'JENIS SCREW / UKURAN / PLATING', 1, 0, 'C');
 $pdf->Cell(32, $height, 'No. SPECIAL', 1, 0, 'C');
 $pdf->Ln($height);
 $pdf->SetFont($font, 'B', $size + 6);
 // Size Font Item Name
 //$pdf->Cell(96,$height*2,$data->m_item_name,1,0,'C'); // Item Name
 $pdf->MultiCell(96, $height, $data->m_item_name, 0, 'C');
 $pdf->SetXY(96 + 10, $height * 8 - 2);
 $pdf->Cell(32, $height * 2, baking($data->m_item_baking), 1, 0, 'C');
 // BAKING
 $pdf->Ln($height * 2);
 $pdf->SetFont($font, 'B', $size - 1);
 $pdf->Cell(25, $height, 'No. COIL', 1, 0, 'L');
 $pdf->Cell(39, $height, '', 1, 0, 'C');
 $pdf->SetFont($font, '', $size * 0.75);
 $pdf->Cell(32, $height * 2, $data->t_prod_id, 1, 0, 'C');
 //ID Kartu
 $qrcode = new QRcode($data->t_prod_id, 'H');
 // error level : L, M, Q, H
 $qrcode->displayFPDF($pdf, 115, 68, 14);
 $pdf->Cell(32, $height * 2, '', 1, 0, 'C');
 //bARCODE
 $pdf->Ln($height);
Пример #10
0
$pdf->SetCreator('ZVS');
$pdf->AliasNbPages();
$pdf->AddPage(P);
$pdf->ln(5);
$y = $pdf->GetY();
// Address
$pdf->SetFont($fonttype, 'B', 10);
$pdf->Write(5, $request->GetVar('hotel_name', 'session'));
$pdf->ln(4);
$pdf->SetFont($fonttype, '', 10);
$pdf->Write(5, $request->GetVar('hotel_street', 'session'));
$pdf->ln(4);
$pdf->SetFont($fonttype, '', 10);
$pdf->Write(5, $request->GetVar('hotel_zip', 'session') . " " . $request->GetVar('hotel_city', 'session'));
// Headline
$pdf->SetXY(120, $y);
$pdf->SetFont($fonttype, 'B', 12);
$pdf->Write(5, "Meldeschein für Beherbergungsstätten");
$pdf->SetXY(120, $y + 5);
$pdf->SetFont($fonttype, '', 6);
$pdf->Write(3, "Rechtsgrundlage für die Erhebung der nachfolgend aufgeführten Daten sind");
$pdf->SetXY(120, $y + 8);
$pdf->Write(3, "§§23 und 24 des Meldegesetzes vom 11. April 1983 (GBI. S. 117)");
$pdf->SetFont($fonttype, 'B', 10);
$pdf->SetXY(10, 60);
$pdf->Write(5, "Tag der Ankunft");
$pdf->SetY(65);
$pdf->Write(5, "Tag der voraussichtlichen Abreise");
$pdf->SetY(70);
$pdf->Write(5, "Familienname");
$pdf->SetY(75);
$retencoesIRRF = $pedido["retencoesIRRF"];
//PessoaFisica
$Nome = $pessoa["Nome"];
$RG = $pessoa["RG"];
$CPF = $pessoa["CPF"];
$CCM = $pessoa["CCM"];
$setor = $pedido["Setor"];
// GERANDO O PDF:
$pdf = new PDF('P', 'mm', 'A4');
//CRIA UM NOVO ARQUIVO PDF NO TAMANHO A4
$pdf->AliasNbPages();
$pdf->AddPage();
$x = 20;
$l = 6;
//DEFINE A ALTURA DA LINHA
$pdf->SetXY($x, 45);
// SetXY - DEFINE O X (largura) E O Y (altura) NA PÁGINA
$pdf->SetX($x);
$pdf->SetFont('Arial', 'B', 14);
$pdf->Cell(180, 5, utf8_decode("RECIBO DE ENTREGA DE NOTA DE LIQUIDAÇÃO"), 0, 1, 'C');
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->SetX($x);
$pdf->SetFont('Arial', '', 11);
$pdf->MultiCell(180, $l, utf8_decode("Recebi nesta data, da Secretaria Municipal de Cultura, cópias dos seguintes documentos, conforme consta no processo nº: " . $NumeroProcesso . ""));
$pdf->Ln();
$pdf->SetX($x);
$pdf->SetFont('Arial', '', 11);
$pdf->Cell(10, 5, utf8_decode("(    )"), 0, 0, 'C');
$pdf->MultiCell(170, $l, utf8_decode("Extrato de Liquidação e Pagamento nº: " . $extratoLiquidacao));
Пример #12
0
			$checkbox = ($affichage_checkbox) ? '<td class="nu"><input type="checkbox" name="id_item[]" value="'.$item_id.'" /></td>' : '' ;
			$releve_HTML_table_body .= '<td class="nu">&nbsp;</td>'.affich_score_html($valeur1,$tableau_tri_mode,'%').affich_score_html($valeur2,$tableau_tri_mode,'%').$checkbox.'</tr>'."\r\n";
		}
	}
	$releve_HTML_table_body = '<tbody>'.$releve_HTML_table_body.'</tbody>'."\r\n";
	// dernière ligne (doublée)
	$memo_y = $releve_PDF->GetY()+2;
	$releve_PDF->SetY( $memo_y );
	$releve_PDF->choisir_couleur_fond('gris_moyen');
	$releve_PDF->Cell($releve_PDF->intitule_largeur , $releve_PDF->cases_hauteur , pdf('moy. scores '.$info_ponderation_courte.' [*]') , 1 , 2 , 'C' , true , '');
	$releve_PDF->Cell($releve_PDF->intitule_largeur , $releve_PDF->cases_hauteur , pdf('% validations [**]') , 1 , 0 , 'C' , true , '');
	$releve_HTML_table_foot1 = '<tr><th>moy. scores '.$info_ponderation_courte.' [*]</th>';
	$releve_HTML_table_foot2 = '<tr><th>% validations [**]</th>';
	$checkbox = ($affichage_checkbox) ? '<tr><th class="nu">&nbsp;</th>' : '' ;
	$memo_x = $releve_PDF->GetX();
	$releve_PDF->SetXY($memo_x,$memo_y);
	if($tableau_tri_objet=='eleve')
	{
		foreach($tab_liste_item as $item_id)	// Pour chaque item...
		{
			$valeur1 = $tab_moyenne_scores_item[$item_id];
			$valeur2 = $tab_pourcentage_acquis_item[$item_id];
			$releve_PDF->bilan_periode_synthese_pourcentages($valeur1,$valeur2,TRUE,FALSE);
			$releve_HTML_table_foot1 .= affich_score_html($valeur1,'score','%');
			$releve_HTML_table_foot2 .= affich_score_html($valeur2,'score','%');
			$checkbox .= ($affichage_checkbox) ? '<td class="nu"><input type="checkbox" name="id_item[]" value="'.$item_id.'" /></td>' : '' ;
		}
	}
	else
	{
		foreach($tab_eleve as $tab)	// Pour chaque élève...
Пример #13
0
     $order['prefix_code'] = '';
 }
 if ($order_counter % $pdf->label_per_page == 0) {
     $pdf->AddPage();
 }
 $order_counter++;
 $xpos_starter = ($labelxpos - 1) * $pdf->label_width + $labelxpad;
 $ypos_starter = ($labelypos - 1) * $pdf->label_height + $labelypad;
 $logo_xpos = $xpos_starter + 52;
 $logo_ypos = $ypos_starter;
 $pdf->Image(FPDF_IMGPATH . 'jng-logo.png', $logo_xpos, $logo_ypos, 43, 5.33);
 //WxH 64.5 x 8
 $xpos = $xpos_starter;
 $ypos = $ypos_starter - 2;
 //NUMBERING
 $pdf->SetXY($xpos, $ypos);
 $pdf->setFont('Arial', 'B', '18');
 $pdf->Cell(10, 10, $order_counter);
 //SP FLAG
 if ($order['prefix_code'] != '') {
     $pdf->SetXY($xpos + 76, $ypos + 5);
     $pdf->setFont('Arial', '', '10');
     $pdf->Cell(20, 10, $order['prefix_code'], '0', '0', 'R');
 }
 //ORDER DETAIL
 $pdf->setFont('Arial', '', '12');
 $lineheight = 5;
 $ypos = $ypos_starter + 10;
 $pdf->SetXY($xpos, $ypos);
 $labels = array();
 $labels[] = 'Kunde';
Пример #14
0
$rep02DRT = $rep02["DRT"];
$rep02Funcao = $rep02["Funcao"];
$rep02Endereco = $rep02["Endereco"];
$rep02Telefones = $rep02["Telefones"];
$rep02Email = $rep02["Email"];
$rep02INSS = $rep02["INSS"];
// GERANDO O PDF:
$pdf = new PDF('P', 'mm', 'A4');
//CRIA UM NOVO ARQUIVO PDF NO TAMANHO A4
$pdf->AliasNbPages();
$pdf->AddPage();
$x = 20;
$l = 7;
//DEFINE A ALTURA DA LINHA
//Executante
$pdf->SetXY($x, 40);
// SetXY - DEFINE O X (largura) E O Y (altura) NA PÁGINA
$pdf->SetX($x);
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(10, 5, '(A)', 0, 0, 'L');
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(170, 5, 'CONTRATADO', 0, 1, 'C');
$pdf->SetX($x);
$pdf->SetFont('Arial', 'I', 10);
$pdf->Cell(10, 10, utf8_decode('(Quando se tratar de grupo, o líder do grupo)'), 0, 0, 'L');
$pdf->Ln();
$pdf->SetX($x);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(12, $l, 'Nome:', 0, 0, 'L');
$pdf->SetFont('Arial', '', 10);
$pdf->MultiCell(168, $l, utf8_decode($exNome));
Пример #15
0
 $pdf->Cell(50, 7, utf8_decode('Zonificación:'), 0, 0, 'L');
 $pdf->Cell(0, 7, $zonificacion, 1, 1, 'C');
 $pdf->Ln(2);
 $pdf->SetFont('Arial', '', 12);
 $pdf->Cell(50, 7, utf8_decode('Zona de Riesgo Delictivo:'), 0, 0, 'L');
 $pdf->Cell(0, 7, $deszonrie, 1, 1, 'C');
 $pdf->Ln(2);
 $pdf->SetFont('Arial', '', 12);
 $pdf->Cell(50, 7, utf8_decode('Conclusiones:'), 0, 0, 'L');
 $pdf->Cell(0, 7, $descon, 1, 1, 'C');
 $pdf->Ln(2);
 $pdf->SetFont('Arial', '', 12);
 $pdf->Cell(50, 7, utf8_decode('Observaciones:'), 0, 0, 'L');
 $pdf->MultiCell(0, 5, $obscon, 1, 'C');
 $pdf->AddPage();
 $pdf->SetXY(20, 25);
 $pdf->SetFont('Arial', 'BU', 14);
 $pdf->SetTextColor(70, 125, 25);
 $pdf->Cell(0, 10, 'CHECK FOTOGRAFICO DE LA VIVIENDA Y ALREDEDORES', 0, 1, 'C');
 $pdf->SetTextColor(0, 0, 0);
 $pdf->Ln(2);
 $pdf->SetTextColor(0, 0, 0);
 $pdf->SetFont('Arial', 'B', 12);
 $pdf->Cell(55, 7, 'NOMBRES Y APELLIDOS', 1, 0, 'L');
 $pdf->SetFont('Arial', '', 12);
 $pdf->Cell(0, 7, $nombre, 1, 1, 'C');
 $pdf->SetFont('Arial', 'B', 12);
 $pdf->Cell(55, 7, 'DIRECCION', 1, 0, 'L');
 $pdf->SetFont('Arial', '', 12);
 $pdf->MultiCell(0, 7, $domicilio, 1, 'C');
 $pdf->Ln(5);
Пример #16
0
 public static function generate($dbh, $appID, $method = 'I')
 {
     $data = self::get($dbh, $appID);
     //if (strlen($socialnumber) > 20) $socialnumber = $this->decrypt($socialnumber);
     $socialnumber = '';
     //Blank out social on forms per Maria 6/6/2013
     // initiate PDF
     $pdf = new PDF();
     $pdf->SetMargins(PDF_MARGIN_LEFT, 10, PDF_MARGIN_RIGHT);
     // add a page
     $pdf->AddPage();
     $pdf->SetFont("Helvetica", "", 11);
     $pdf->SetXY(33, 30);
     $pdf->Write(5, date('m/d/Y', strtotime($data['appDate'])));
     $pdf->SetXY(85, 30);
     $pdf->Write(5, $data['jobName']);
     $pdf->SetXY(30, 36);
     $pdf->Write(5, $data['lastname']);
     $pdf->SetXY(110, 36);
     $pdf->Write(5, $data['firstname']);
     $pdf->SetXY(170, 36);
     $pdf->Write(5, $data['middlename']);
     $pdf->SetXY(30, 62);
     $pdf->Write(5, $data['address']);
     $pdf->SetXY(105, 62);
     $pdf->Write(5, $data['city']);
     $pdf->SetXY(162, 62);
     $pdf->Write(5, $data['state']);
     $pdf->SetXY(187, 62);
     $pdf->Write(5, $data['zip']);
     $pdf->SetXY(70, 69);
     $pdf->Write(5, $data['years']);
     $pdf->SetXY(105, 69);
     $pdf->Write(5, $data['phone']);
     $pdf->SetXY(122, 76);
     $pdf->Write(5, $data['email']);
     $pdf->SetFont("Helvetica", "", 10);
     $highestx = 59 + $data['highestgrade'] * 5.4;
     if ($data['highestgrade'] > 8) {
         $highestx += 19;
     }
     if ($data['highestgrade'] > 12) {
         $highestx += 20;
     }
     $pdf->SetXY($highestx, 152);
     $pdf->Write(5, 'Highest');
     $pdf->SetXY(46, 175);
     $pdf->Write(5, $data['highschool']);
     $pdf->SetXY(46, 184);
     $pdf->Write(5, $data['highschoolloc']);
     $pdf->SetXY(101, 175);
     $pdf->Write(5, $data['highschoolyears']);
     $pdf->SetXY(129, 175);
     $pdf->Write(5, $data['coursesubject']);
     $pdf->SetXY(174.5, 175);
     $pdf->write(5, $data['coursesubjectgraduated'] == 'Yes' ? 'X' : '');
     $pdf->SetXY(174.5, 184);
     $pdf->write(5, $data['coursesubjectgraduated'] == 'GED' ? 'X' : '');
     $pdf->SetXY(46, 193);
     $pdf->Write(5, $data['collegeuniversity']);
     $pdf->SetXY(46, 202);
     $pdf->Write(5, $data['collegeuniversityloc']);
     $pdf->SetXY(101, 193);
     $pdf->Write(5, $data['collegeuniversityyearscompleted']);
     $pdf->SetXY(129, 193);
     $pdf->Write(5, $data['collegeuniversitycourse']);
     $pdf->SetXY(174.5, 191);
     $pdf->write(5, $data['collegegraduated'] == 'Yes' ? 'X' : '');
     $pdf->SetXY(184, 194);
     $pdf->Write(5, $data['collegegraduatedMonth']);
     $pdf->SetXY(196, 194);
     $pdf->Write(5, $data['collegegraduatedYear']);
     $pdf->SetXY(174.5, 202);
     $pdf->write(5, $data['collegegraduated'] == 'InP' ? 'X' : '');
     $pdf->SetXY(46, 210);
     $pdf->Write(5, $data['othercollege']);
     $pdf->SetXY(46, 222);
     $pdf->Write(5, $data['othercollegeloc']);
     $pdf->SetXY(101, 214);
     $pdf->Write(5, $data['othercollegeyears']);
     $pdf->SetXY(129, 210);
     $pdf->Write(5, $data['othercollegecourse']);
     $pdf->SetXY(174.5, 209);
     $pdf->write(5, $data['othercollegecompleted'] == 'Yes' ? 'X' : '');
     $pdf->SetXY(184, 213);
     $pdf->Write(5, $data['othercollegecompletedMonth']);
     $pdf->SetXY(194, 213);
     $pdf->Write(5, $data['othercollegecompletedYear']);
     $pdf->SetXY(174.5, 219);
     $pdf->write(5, $data['othercollegecompleted'] == 'Pro' ? 'X' : '');
     $pdf->SetXY(128, 260.5);
     $pdf->Write(5, $data['language']);
     $pdf->SetXY(163, 260.5);
     $pdf->write(5, $data['languagespeak'] ? 'X' : '');
     $pdf->SetXY(177, 260.5);
     $pdf->write(5, $data['languageread'] ? 'X' : '');
     $pdf->SetXY(190, 260.5);
     $pdf->write(5, $data['languagewrite'] ? 'X' : '');
     $pdf->AddPage();
     $y = 0;
     $pdf->SetXY(10, $y + 46);
     $pdf->Write(5, $data['companyname1']);
     $pdf->SetXY(10, $y + 55);
     $pdf->MultiCell(50, 10, $data['companyaddress1'], 0, 'L');
     $pdf->SetXY(10, $y + 64);
     $pdf->Write(5, $data['companyphone1']);
     $pdf->SetXY(10, $y + 72);
     $pdf->Write(5, $data['supervisorname1']);
     $pdf->SetXY(60, $y + 52);
     $pdf->MultiCell(80, 35, $data['responsibilities1'], 0, 'L');
     $pdf->SetXY(141, $y + 56);
     $pdf->MultiCell(60, 25, $data['reasonforleaving1'], 0, 'L');
     $pdf->SetXY(160, $y + 64);
     $pdf->write(5, "{$data['startwages1']} -> {$data['endedwages1']}");
     if ($data['maywecontact1'] == 'Yes') {
         $pdf->SetXY(146, $y + 73);
     } else {
         $pdf->SetXY(178, $y + 73);
     }
     $pdf->write(5, 'X');
     $y = 33;
     $pdf->SetXY(10, $y + 46);
     $pdf->Write(5, $data['companyname2']);
     $pdf->SetXY(10, $y + 55);
     $pdf->MultiCell(50, 10, $data['companyaddress2'], 0, 'L');
     $pdf->SetXY(10, $y + 64);
     $pdf->Write(5, $data['companyphone2']);
     $pdf->SetXY(10, $y + 72);
     $pdf->Write(5, $data['supervisorname2']);
     $pdf->SetXY(60, $y + 52);
     $pdf->MultiCell(80, 35, $data['responsibilities2'], 0, 'L');
     $pdf->SetXY(141, $y + 56);
     $pdf->MultiCell(60, 25, $data['reasonforleaving2'], 0, 'L');
     $pdf->SetXY(160, $y + 64);
     $pdf->write(5, "{$data['startwages2']} -> {$data['endedwages2']}");
     if ($data['maywecontact2'] == 'Yes') {
         $pdf->SetXY(140, $y + 73);
     } else {
         $pdf->SetXY(178, $y + 73);
     }
     $pdf->write(5, 'X');
     $y = 66.5;
     $pdf->SetXY(10, $y + 46);
     $pdf->Write(5, $data['companyname3']);
     $pdf->SetXY(10, $y + 55);
     $pdf->MultiCell(50, 10, $data['companyaddress3'], 0, 'L');
     $pdf->SetXY(10, $y + 64);
     $pdf->Write(5, $data['companyphone3']);
     $pdf->SetXY(10, $y + 72);
     $pdf->Write(5, $data['supervisorname3']);
     $pdf->SetXY(60, $y + 52);
     $pdf->MultiCell(80, 35, $data['responsibilities3'], 0, 'L');
     $pdf->SetXY(141, $y + 56);
     $pdf->MultiCell(60, 25, $data['reasonforleaving3'], 0, 'L');
     $pdf->SetXY(160, $y + 64);
     $pdf->write(5, "{$data['startwages3']} -> {$data['endedwages3']}");
     if ($data['maywecontact3'] == 'Yes') {
         $pdf->SetXY(140, $y + 73);
     } else {
         $pdf->SetXY(178, $y + 73);
     }
     $pdf->write(5, 'X');
     $pdf->SetXY(44, 265);
     $pdf->MultiCell(95, 10, "Signed Online as {$data['signature']} from {$data['ipAddress']}", 0, 'L');
     $pdf->SetXY(150, 265);
     $pdf->Write(5, $data['appDate']);
     $pdf->AddPage();
     $pdf->SetXY(26, 42);
     $pdf->Write(5, $data['lastname']);
     $pdf->SetXY(101, 42);
     $pdf->Write(5, $data['firstname']);
     $pdf->SetXY(172, 42);
     $pdf->Write(5, substr($data['middlename'], 0, 1));
     $pdf->SetXY(115, 50);
     $pdf->Write(5, $data['zip']);
     $pdf->SetXY(48, 57);
     $pdf->Write(5, $data['jobName']);
     $pdf->SetXY(48, 57);
     $pdf->Write(5, $data['jobName']);
     $filename = $data['firstname'] . '_' . $data['lastname'] . '_app.pdf';
     if ($method == 'F') {
         $pdf->Output(__DIR__ . '../../public_html/img/pdf/' . $filename, 'F');
         return 'img/pdf/' . $filename;
     } elseif ($method == 'I') {
         $pdf->Output(__DIR__ . '../../public_html/img/pdf/' . $filename, 'I');
         die;
     }
 }
$rep01CPF = $rep01["CPF"];
// Representante02
$rep02Nome = $rep02["Nome"];
$rep02RG = $rep02["RG"];
$rep02CPF = $rep02["CPF"];
$setor = $linha_tabelas["Setor"];
$ano = date('Y');
// GERANDO O PDF:
$pdf = new PDF('P', 'mm', 'A4');
//CRIA UM NOVO ARQUIVO PDF NO TAMANHO A4
$pdf->AliasNbPages();
$pdf->AddPage();
$x = 20;
$l = 7;
//DEFINE A ALTURA DA LINHA
$pdf->SetXY($x, 30);
// SetXY - DEFINE O X (largura) E O Y (altura) NA PÁGINA
$pdf->SetX($x);
$pdf->SetFont('Arial', 'B', 14);
$pdf->Cell(180, 5, utf8_decode("DECLARAÇÃO DE ISS"), 0, 1, 'C');
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->SetX($x);
$pdf->SetFont('Arial', '', 11);
$pdf->MultiCell(170, $l, utf8_decode("Declaro sob as penas da lei que a Empresa: " . "{$pjRazaoSocial}" . ", com sede em " . "{$pjEndereco}" . ", CNPJ nº " . "{$pjCNPJ}" . ", representada por " . "{$rep01Nome}" . ", RG nº " . "{$rep01RG}" . ", não possui débitos perante as FAZENDAS PÚBLICAS, e em especial à PREFEITURA DO MUNICÍPIO DE SÃO PAULO."));
$pdf->Ln();
$pdf->SetX($x);
$pdf->SetFont('Arial', '', 11);
$pdf->MultiCell(170, $l, utf8_decode("Estou ciente de que o ISS incidente sobre a contratação será retido."));
Пример #18
0
 /**
  *   Affiche la grille des lignes de factures
  *
  *   @param     PDF			$pdf     		Object PDF
  *   @param		int			$tab_top		Tab top
  *   @param		int			$tab_height		Tab height
  *   @param		int			$nexY			next y
  *   @param		Translate	$outputlangs	Output langs
  *   @return	void
  */
 function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
 {
     global $conf;
     $default_font_size = pdf_getPDFFontSize($outputlangs);
     // Amount in (at tab_top - 1)
     $pdf->SetTextColor(0, 0, 0);
     $pdf->SetFont('', '', $default_font_size - 2);
     $titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency" . $conf->currency));
     $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 4), $tab_top - 4);
     $pdf->MultiCell($pdf->GetStringWidth($titre) + 3, 2, $titre);
     $pdf->SetDrawColor(128, 128, 128);
     // Rect prend une longueur en 3eme param
     $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height);
     // line prend une position y en 3eme param
     $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5);
     $pdf->SetFont('', '', 8);
     // Accountancy piece
     $pdf->SetXY($this->posxpiece - 1, $tab_top + 1);
     $pdf->MultiCell($this->posxdesc - $this->posxpiece - 1, 1, '', '', 'R');
     // Comments
     $pdf->line($this->posxdesc - 1, $tab_top, $this->posxdesc - 1, $tab_top + $tab_height);
     $pdf->SetXY($this->posxdesc - 1, $tab_top + 1);
     $pdf->MultiCell($this->posxdate - $this->posxdesc - 1, 1, $outputlangs->transnoentities("Description"), '', 'L');
     // Date
     $pdf->line($this->posxdate - 1, $tab_top, $this->posxdate - 1, $tab_top + $tab_height);
     $pdf->SetXY($this->posxdate - 1, $tab_top + 1);
     $pdf->MultiCell($this->posxtype - $this->posxdate - 1, 2, $outputlangs->transnoentities("Date"), '', 'C');
     // Type
     $pdf->line($this->posxtype - 1, $tab_top, $this->posxtype - 1, $tab_top + $tab_height);
     $pdf->SetXY($this->posxtype - 1, $tab_top + 1);
     $pdf->MultiCell($this->posxprojet - $this->posxtype - 1, 2, $outputlangs->transnoentities("Type"), '', 'C');
     // Project
     $pdf->line($this->posxprojet - 1, $tab_top, $this->posxprojet - 1, $tab_top + $tab_height);
     $pdf->SetXY($this->posxprojet - 1, $tab_top + 1);
     $pdf->MultiCell($this->posxtva - $this->posxprojet - 1, 2, $outputlangs->transnoentities("Project"), '', 'C');
     // VAT
     if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
         $pdf->line($this->posxtva - 1, $tab_top, $this->posxtva - 1, $tab_top + $tab_height);
         $pdf->SetXY($this->posxtva - 1, $tab_top + 1);
         $pdf->MultiCell($this->posxup - $this->posxtva - 1, 2, $outputlangs->transnoentities("VAT"), '', 'C');
     }
     // Unit price
     $pdf->line($this->posxup - 1, $tab_top, $this->posxup - 1, $tab_top + $tab_height);
     $pdf->SetXY($this->posxup - 1, $tab_top + 1);
     $pdf->MultiCell($this->posxqty - $this->posxup - 1, 2, $outputlangs->transnoentities("PriceU"), '', 'C');
     // Quantity
     $pdf->line($this->posxqty - 1, $tab_top, $this->posxqty - 1, $tab_top + $tab_height);
     $pdf->SetXY($this->posxqty - 1, $tab_top + 1);
     $pdf->MultiCell($this->postotalttc - $this->posxqty, 2, $outputlangs->transnoentities("Qty"), '', 'R');
     // Total with all taxes
     $pdf->line($this->postotalttc, $tab_top, $this->postotalttc, $tab_top + $tab_height);
     $pdf->SetXY($this->postotalttc - 1, $tab_top + 1);
     $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalttc, 2, $outputlangs->transnoentities("TotalTTC"), '', 'R');
     $pdf->SetTextColor(0, 0, 0);
 }
$rep02DRT = $rep02["DRT"];
$rep02Funcao = $rep02["Funcao"];
$rep02Endereco = $rep02["Endereco"];
$rep02Telefones = $rep02["Telefones"];
$rep02Email = $rep02["Email"];
$rep02INSS = $rep02["INSS"];
// GERANDO O PDF:
$pdf = new PDF('P', 'mm', 'A4');
//CRIA UM NOVO ARQUIVO PDF NO TAMANHO A4
$pdf->AliasNbPages();
$pdf->AddPage();
$x = 20;
$l = 7;
//DEFINE A ALTURA DA LINHA
//Executante
$pdf->SetXY($x, 37);
// SetXY - DEFINE O X (largura) E O Y (altura) NA PÁGINA
$pdf->SetX($x);
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(10, 5, '(A)', 0, 0, 'L');
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(170, 5, 'CONTRATADO', 0, 1, 'C');
$pdf->SetX($x);
$pdf->SetFont('Arial', 'I', 10);
$pdf->Cell(10, 10, utf8_decode('(Quando se tratar de grupo, o líder do grupo)'), 0, 0, 'L');
$pdf->Ln();
$pdf->SetX($x);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(12, $l, 'Nome:', 0, 0, 'L');
$pdf->SetFont('Arial', '', 10);
$pdf->MultiCell(168, $l, utf8_decode($exNome));
Пример #20
0
     }
     $riskArray[getrisk($risk)] = $riskcount;
     $colorarray[$index] = getriskcolor($risk);
     $index++;
     $result->MoveNext();
 }
 if ($Eriskcount > 0) {
     $risk = 8;
     $pdf->MultiCell(70, 6, "" . getrisk($risk) . " : {$Eriskcount}", 0, 0, 'C');
     $riskArray[getrisk($risk)] = $Eriskcount;
     $colorarray[$index] = getriskcolor($risk);
 }
 $pdf->Ln();
 $pdf->Ln();
 //$pdf->SetXY(85, 53); #$valY);
 $pdf->SetXY(85, 47);
 #$valY);
 $pdf->PieChart(140, 40, $riskArray, '%l', $colorarray);
 $pdf->SetXY($valX, $valY + 33);
 //Host-Vulnerability Summary
 $pdf->Ln();
 $pdf->Ln();
 $pdf->Ln();
 $total_number2 = _("Total number of vulnerabilities identified per system");
 if ($chinese) {
     $total_number2 = mb_convert_encoding($total_number2, 'UTF-8', 'HTML-ENTITIES');
     $pdf->SetFont('GB', 'B', 10);
 } else {
     $total_number2 = mb_convert_encoding($total_number2, 'ISO-8859-1', 'HTML-ENTITIES');
     $pdf->SetFont('Helvetica', 'B', 12);
 }
Пример #21
0
$pdf->page_width = 210;
$pdf->page_height = 297;
$pdf->font_size = 11;
$pdf->line_height = 6;
$pdf->AddPage();
$pdf->setFont('Arial', '', $pdf->font_size);
//PAGING SETTING
$firstpagecount = 41;
$nextpagecount = 54;
//HEADER RIGHT
$head_width = 70;
$xpos = $pdf->left_margin + 110;
$ypos = $pdf->top_margin;
$line_height = 9;
$pdf->setFont('Arial', 'B', '13');
$pdf->SetXY($xpos, $ypos);
$pdf->MultiCell($head_width, $line_height, 'Invoice', 1);
//HEADER LEFT
$head_width = 100;
$xpos = $pdf->left_margin;
$ypos = $pdf->top_margin;
$line_height = 4;
$address1 = array();
$address1[] = JNG_ADDRESS_NAME;
$address1[] = EMAIL_NAME_PETERN;
$address1[] = JNG_ADDRESS_STREET;
$address1[] = JNG_ADDRESS_ZIPCODE . ' ' . JNG_ADDRESS_CITY;
$pdf->setFont('Arial', '', '8');
$pdf->SetXY($xpos, $ypos);
$pdf->MultiCell($head_width, $line_height, implode("\n", $address1));
$pdf->setFont('Arial', 'B', '11');
Пример #22
0
$cbo = $pessoa["cbo"];
$Funcao = $pessoa["Funcao"];
$Endereco = $pessoa["Endereco"];
$Telefones = $pessoa["Telefones"];
$Email = $pessoa["Email"];
$INSS = $pessoa["INSS"];
$ano = date('Y');
// GERANDO O PDF:
$pdf = new PDF('P', 'mm', 'A4');
//CRIA UM NOVO ARQUIVO PDF NO TAMANHO A4
$pdf->AliasNbPages();
$pdf->AddPage();
$x = 20;
$l = 5;
//DEFINE A ALTURA DA LINHA
$pdf->SetXY($x, 20);
// SetXY - DEFINE O X (largura) E O Y (altura) NA PÁGINA
$pdf->SetX($x);
$pdf->SetFont('Arial', 'B', 14);
$pdf->Cell(23, 5, utf8_decode("EVENTO:"), 0, 0, 'L');
$pdf->SetFont('Arial', '', 14);
$pdf->MultiCell(155, $l, utf8_decode($Objeto));
$pdf->Ln();
$pdf->Ln();
$pdf->SetX($x);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(29, $l, 'Tipo de evento:', 0, 0, 'L');
$pdf->SetFont('Arial', '', 10);
$pdf->MultiCell(120, $l, utf8_decode($tipoEvento));
$pdf->SetX($x);
$pdf->SetFont('Arial', 'B', 10);
Пример #23
0
$pdf->SetFont($font, 'B', $size + 2);
$pdf->SetX($margin + $w[0]);
$pdf->Cell($w[1], $ln, 'RENCANA AKSI DARI PENETAPAN KINERJA', '', 1, 'C');
$pdf->SetX($margin + $w[0]);
$pdf->Cell($w[1], $ln, trim(strtoupper(nm_unit($kdunit))), '', 1, 'C');
$pdf->Ln() * 2;
$w1 = array(35, 40, 18, 9, 40, 9, 40, 9, 40, 9, 40);
$pdf->SetFont($font, 'B', $size);
$pdf->SetX($margin);
$pdf->Cell($w1[0], $ln * 3, 'Sasaran Strategis', $border, 0, 'C');
$pdf->SetX($margin + $w1[0]);
$pdf->Cell($w1[1], $ln * 3, 'Indikator Kinerja', $border, 0, 'C');
$pdf->SetX($margin + $w1[0] + $w1[1]);
$pdf->Cell($w1[2], $ln * 3, 'Target', $border, 0, 'C');
$y = $pdf->GetY();
$pdf->SetXY($margin + $w1[0] + $w1[1] + $w1[2], $y);
$pdf->Cell(($w1[3] + $w1[4]) * 4, $ln, 'Rencana Aksi', $border, 0, 'C');
$pdf->SetXY($margin + $w1[0] + $w1[1] + $w1[2], $y + 5);
$pdf->Cell($w1[3] + $w1[4], $ln, 'Triwulan I', $border, 0, 'C');
$pdf->SetXY($margin + $w1[0] + $w1[1] + $w1[2] + $w1[3] + $w1[4], $y + 5);
$pdf->Cell($w1[5] + $w1[6], $ln, 'Triwulan II', $border, 0, 'C');
$pdf->SetXY($margin + $w1[0] + $w1[1] + $w1[2] + $w1[3] + $w1[4] + $w1[5] + $w1[6], $y + 5);
$pdf->Cell($w1[7] + $w1[8], $ln, 'Triwulan III', $border, 0, 'C');
$pdf->SetXY($margin + $w1[0] + $w1[1] + $w1[2] + $w1[3] + $w1[4] + $w1[5] + $w1[6] + $w1[7] + $w1[8], $y + 5);
$pdf->Cell($w1[9] + $w1[10], $ln, 'Triwulan IV', $border, 0, 'C');
$pdf->SetXY($margin + $w1[0] + $w1[1] + $w1[2], $y + 10);
$pdf->Cell($w1[3], $ln, '(%)', $border, 0, 'C');
$pdf->SetXY($margin + $w1[0] + $w1[1] + $w1[2] + $w1[3], $y + 10);
$pdf->Cell($w1[4], $ln, 'Uraian', $border, 0, 'C');
$pdf->SetXY($margin + $w1[0] + $w1[1] + $w1[2] + $w1[3] + $w1[4], $y + 10);
$pdf->Cell($w1[5], $ln, '(%)', $border, 0, 'C');
$rep02DRT = $rep02["DRT"];
$rep02Funcao = $rep02["Funcao"];
$rep02Endereco = $rep02["Endereco"];
$rep02Telefones = $rep02["Telefones"];
$rep02Email = $rep02["Email"];
$rep02INSS = $rep02["INSS"];
// GERANDO O PDF:
$pdf = new PDF('P', 'mm', 'A4');
//CRIA UM NOVO ARQUIVO PDF NO TAMANHO A4
$pdf->AliasNbPages();
$pdf->AddPage();
$x = 20;
$l = 7;
//DEFINE A ALTURA DA LINHA
//Executante
$pdf->SetXY($x, 37);
// SetXY - DEFINE O X (largura) E O Y (altura) NA PÁGINA
$pdf->SetX($x);
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(10, 5, '(A)', 0, 0, 'L');
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(170, 5, 'CONTRATADO', 0, 1, 'C');
$pdf->SetX($x);
$pdf->SetFont('Arial', 'I', 10);
$pdf->Cell(10, 10, utf8_decode('(Quando se tratar de grupo, o líder do grupo)'), 0, 0, 'L');
$pdf->Ln();
$pdf->SetX($x);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(12, $l, 'Nome:', 0, 0, 'L');
$pdf->SetFont('Arial', '', 10);
$pdf->MultiCell(168, $l, utf8_decode($exNome));
Пример #25
0
require 'MultiCellBlt2.php';
//Create pdf
$pdf = new PDF();
$pdf->AddPage();
//set document properties
$pdf->SetAuthor('Anon');
$pdf->SetTitle($name);
// Set the page break to 'true' and the bottom margin height
$pdf->SetAutoPageBreak(1, 10);
//set font for the entire document
$pdf->SetFont('Helvetica', 'B', 20);
$pdf->SetTextColor(50, 60, 100);
//insert Collage logo
$pdf->Image('logo.png', 10, 10, 33, 0);
//display the title without a border around it
$pdf->SetXY(50, 15);
$pdf->SetDrawColor(50, 60, 100);
$pdf->Cell(100, 10, $name, 0, 0, 'C', 0);
// Insert a dynamic image from a URL
$pdf->Image($image, 11, 30, 0, 50);
//Set x and y position for the main text, reduce font size and write content
$pdf->SetXY(65, 30);
$pdf->SetLeftMargin(65);
$pdf->SetFontSize(10);
$pdf->Write(5, $characteristics);
$pdf->Ln(8);
//Output the clues
$pdf->SetFont('Helvetica', '', 9);
$pdf->SetXY(10, 90);
$column_width = $pdf->w - 10;
// For bullet list - width and bullet array variables
$cpf = $linha_tabelas_pessoa["CPF"];
$telefone1 = $linha_tabelas_pessoa["Telefones"];
$telefone2 = $linha_tabelas_pessoa["Telefones"];
$telefone3 = $linha_tabelas_pessoa["Telefones"];
$email = $linha_tabelas_pessoa["Email"];
$setor = $linha_tabelas["Setor"];
$ano = date('Y');
// GERANDO O PDF:
$pdf = new PDF('P', 'mm', 'A4');
//CRIA UM NOVO ARQUIVO PDF NO TAMANHO A4
$pdf->AliasNbPages();
$pdf->AddPage();
$x = 20;
$l = 7;
//DEFINE A ALTURA DA LINHA
$pdf->SetXY($x, 45);
// SetXY - DEFINE O X (largura) E O Y (altura) NA PÁGINA
$pdf->SetX($x);
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(180, 5, utf8_decode("Folha de Informação nº ___________"), 0, 1, 'R');
$pdf->Ln();
$pdf->Ln();
$pdf->SetX($x);
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(28, $l, utf8_decode("Do processo nº:"), 0, 0, 'L');
$pdf->Cell(30, $l, utf8_decode("{$NumeroProcesso}"), 0, 0, 'L');
$pdf->Cell(122, $l, "Data: _______ / _______ / " . $ano . ".", 0, 1, 'R');
$pdf->Ln();
$pdf->Ln();
$pdf->SetX($x);
$pdf->SetFont('Arial', 'B', 10);
Пример #27
-1
 /**
  *   Show table for lines
  *
  *   @param		PDF			$pdf     		Object PDF
  *   @param		string		$tab_top		Top position of table
  *   @param		string		$tab_height		Height of table (rectangle)
  *   @param		int			$nexY			Y (not used)
  *   @param		Translate	$outputlangs	Langs object
  *   @param		int			$hidetop		1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
  *   @param		int			$hidebottom		Hide bottom bar of array
  *   @param		string		$currency		Currency code
  *   @return	void
  */
 function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '')
 {
     global $conf;
     // Force to disable hidetop and hidebottom
     $hidebottom = 0;
     if ($hidetop) {
         $hidetop = -1;
     }
     $currency = !empty($currency) ? $currency : $conf->currency;
     $default_font_size = pdf_getPDFFontSize($outputlangs);
     // Amount in (at tab_top - 1)
     $pdf->SetTextColor(0, 0, 0);
     $pdf->SetFont('', '', $default_font_size - 2);
     if (empty($hidetop)) {
         $titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency" . $currency));
         $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top - 4);
         $pdf->MultiCell($pdf->GetStringWidth($titre) + 3, 2, $titre);
         //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
         if (!empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) {
             $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
         }
     }
     $pdf->SetDrawColor(128, 128, 128);
     $pdf->SetFont('', '', $default_font_size - 1);
     // Output Rect
     $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom);
     // Rect prend une longueur en 3eme param et 4eme param
     if (empty($hidetop)) {
         $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5);
         // line prend une position y en 2eme param et 4eme param
         $pdf->SetXY($this->posxdesc - 1, $tab_top + 1);
         $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L');
     }
     if (!empty($conf->global->MAIN_GENERATE_INVOICES_WITH_PICTURE)) {
         $pdf->line($this->posxpicture - 1, $tab_top, $this->posxpicture - 1, $tab_top + $tab_height);
         if (empty($hidetop)) {
             //$pdf->SetXY($this->posxpicture-1, $tab_top+1);
             //$pdf->MultiCell($this->posxtva-$this->posxpicture-1,2, $outputlangs->transnoentities("Photo"),'','C');
         }
     }
     if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
         $pdf->line($this->posxtva - 1, $tab_top, $this->posxtva - 1, $tab_top + $tab_height);
         if (empty($hidetop)) {
             $pdf->SetXY($this->posxtva - 3, $tab_top + 1);
             $pdf->MultiCell($this->posxup - $this->posxtva + 3, 2, $outputlangs->transnoentities("VAT"), '', 'C');
         }
     }
     $pdf->line($this->posxup - 1, $tab_top, $this->posxup - 1, $tab_top + $tab_height);
     if (empty($hidetop)) {
         $pdf->SetXY($this->posxup - 1, $tab_top + 1);
         $pdf->MultiCell($this->posxqty - $this->posxup - 1, 2, $outputlangs->transnoentities("PriceUHT"), '', 'C');
     }
     $pdf->line($this->posxqty - 1, $tab_top, $this->posxqty - 1, $tab_top + $tab_height);
     if (empty($hidetop)) {
         $pdf->SetXY($this->posxqty - 1, $tab_top + 1);
         if ($conf->global->PRODUCT_USE_UNITS) {
             $pdf->MultiCell($this->posxunit - $this->posxqty - 1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
         } else {
             $pdf->MultiCell($this->posxdiscount - $this->posxqty - 1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
         }
     }
     if ($conf->global->PRODUCT_USE_UNITS) {
         $pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
         if (empty($hidetop)) {
             $pdf->SetXY($this->posxunit - 1, $tab_top + 1);
             $pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C');
         }
     }
     $pdf->line($this->posxdiscount - 1, $tab_top, $this->posxdiscount - 1, $tab_top + $tab_height);
     if (empty($hidetop)) {
         if ($this->atleastonediscount) {
             $pdf->SetXY($this->posxdiscount - 1, $tab_top + 1);
             $pdf->MultiCell($this->postotalht - $this->posxdiscount + 1, 2, $outputlangs->transnoentities("ReductionShort"), '', 'C');
         }
     }
     if ($this->atleastonediscount) {
         $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
     }
     if (empty($hidetop)) {
         $pdf->SetXY($this->postotalht - 1, $tab_top + 1);
         $pdf->MultiCell(30, 2, $outputlangs->transnoentities("TotalHT"), '', 'C');
     }
 }
$rep01CPF = $rep01["CPF"];
// Representante02
$rep02Nome = $rep02["Nome"];
$rep02RG = $rep02["RG"];
$rep02CPF = $rep02["CPF"];
$setor = $pedido["Setor"];
$ano = date('Y');
// GERANDO O PDF:
$pdf = new PDF('P', 'mm', 'A4');
//CRIA UM NOVO ARQUIVO PDF NO TAMANHO A4
$pdf->AliasNbPages();
$pdf->AddPage();
$x = 20;
$l = 6;
//DEFINE A ALTURA DA LINHA
$pdf->SetXY($x, 15);
// SetXY - DEFINE O X (largura) E O Y (altura) NA PÁGINA
$pdf->SetX($x);
$pdf->SetFont('Arial', 'B', 14);
$pdf->Cell(180, 5, utf8_decode("DECLARAÇÃO DE EXCLUSIVIDADE"), 0, 1, 'C');
$pdf->Ln();
$pdf->Ln();
$pdf->SetX($x);
$pdf->SetFont('Arial', '', 11);
$pdf->MultiCell(170, $l, utf8_decode("Nós, abaixo assinados, declaramos, com o fim especial de contratação de Serviços Profissionais de Natureza Artística pela Prefeitura do Município de São Paulo, que somos representados COM EXCLUSIVIDADE pela empresa " . "{$pjRazaoSocial}" . ", CNPJ nº " . "{$pjCNPJ}" . ", com sede em " . "{$pjEndereco}" . ", representada por " . "{$rep01Nome}" . ", RG nº " . "{$rep01RG}" . " e CPF nº " . "{$rep01CPF}" . " e representada por " . "{$rep02Nome}" . ", RG nº " . "{$rep02RG}" . " e CPF nº " . "{$rep02CPF}" . ", para a apresentação " . "{$Objeto}" . ", mediante cachê de R\$ " . "{$ValorGlobal}" . " (" . "{$ValorPorExtenso}" . " )" . " no(s) local(is)" . "{$Local}" . "."));
$pdf->Ln();
$pdf->SetX($x);
$pdf->SetFont('Arial', '', 11);
$pdf->MultiCell(170, $l, utf8_decode("A empresa representante fica autorizada a celebrar contrato, inclusive receber o cachê e outorgar quitação."));
$pdf->Ln();
$pdf->SetX($x);
Пример #29
-1
/**
 * Export PDF document
 *
 * @param   string  $where  WHERE clause for SQL statement
 */
function pdfexport($WHERE)
{
    global $config;
    $ypos = $config['pdf_font_size'];
    // Match the font size for proper vertical offset
    $page_width = $config['pdf_page_width'];
    $margin = $config['pdf_margin'];
    $left_margin = $config['pdf_left_margin'];
    $right_margin = $config['pdf_right_margin'];
    $mediaimg_width = $config['pdf_image_media_width'];
    $font_size = $config['pdf_font_size'];
    $image_height = $config['pdf_image_height'];
    $image_width = $config['pdf_image_width'];
    $font_title = $config['pdf_font_title'];
    $font_plot = $config['pdf_font_plot'];
    $text_length = $config['pdf_text_length'];
    $tempfolder = cache_get_folder('');
    if ($config['cache_pruning']) {
        cache_prune_folder($tempfolder, 3600, false, false, 'videodb*.pdf');
    }
    $filename = $tempfolder . 'videodb' . date('His', time()) . '.pdf';
    // setup pdf class
    $pdf = new PDF();
    $pdf->Open($filename);
    $pdf->VerifyFont($font_title);
    $pdf->VerifyFont($font_title, 'B');
    $pdf->VerifyFont($font_plot);
    $pdf->AddPage();
    $pdf->SetRightMargin($right_margin);
    // add downscaling
    if ($config['pdf_scale']) {
        $pdf->Scale = $config['pdf_scale'];
        $pdf->max_width = $config['pdf_image_max_width'];
        $pdf->max_height = $config['pdf_image_max_height'];
    }
    // get data
    $result = iconv_array('utf-8', 'iso-8859-1', exportData($WHERE));
    foreach ($result as $row) {
        set_time_limit(300);
        // rise per movie execution timeout limit if safe_mode is not set in php.ini
        $title = $row['title'];
        if ($row['subtitle']) {
            $title .= ' - ' . $row['subtitle'];
        }
        if ($row['diskid'] || $row['mediatype']) {
            $title .= ' [';
            if ($row['mediatype']) {
                $title .= $row['mediatype'] . ', ';
            }
            if ($row['diskid']) {
                $title .= $row['diskid'];
            }
            $title = preg_replace('/, $/', '', $title) . ']';
        }
        // get drilldown url for image
        $imdb = $row['imdbID'];
        $link = $imdb ? engineGetContentUrl($imdb, engineGetEngine($imdb)) : '';
        // title
        $pdf->SetFont($font_title, 'B', $font_size);
        $pdf->SetXY($left_margin + $image_width + $margin, $ypos);
        $pdf->Cell(0, 0, $title, 0, 1, 'L', 0, $link);
        // [muddle] technical details
        unset($tech['V']);
        if ($row['video_width'] and $row['video_height']) {
            $vw = $row['video_width'];
            $vh = $row['video_height'];
            $tech['V'] = "Video: ";
            if ($vw > 1920) {
                $tech['V'] .= "UHD " . $vw . "x" . $vh;
            } elseif ($vw > 1280) {
                $tech['V'] .= "HD 1080p";
            } elseif ($vw == 1280 or $vh == 720) {
                $tech['V'] .= "HD 720p";
            } elseif ($vw == 720 or $vw == 704) {
                $tech['V'] .= "SD ";
                if ($vh == 480) {
                    $tech['V'] .= "NTSC";
                } elseif ($vh == 576) {
                    $tech['V'] .= "PAL";
                } else {
                    $tech['V'] .= $vw . "x" . $vh;
                }
            } else {
                $tech['V'] .= "LORES " . $vw . "x" . $vh;
            }
        }
        unset($tech['A']);
        if ($row['audio_codec']) {
            $tech['A'] = "Audio: " . $row['audio_codec'];
        }
        unset($tech['D']);
        if ($row['created']) {
            $tech['D'] = "Date: " . $row['created'];
        }
        $techinfo = implode(", ", $tech);
        $pdf->SetFont($font_title, 'B', $font_size - 3);
        $pdf->SetXY($left_margin + $image_width + $margin, $ypos + 4);
        $pdf->Cell(0, 0, $techinfo, 0, 1, 'L', 0);
        // plot
        $plot = leftString($row['plot'], $text_length);
        $pdf->SetFont($font_plot, '', $font_size - 1);
        $pdf->SetXY($left_margin + $image_width + $margin, $ypos + 3 + 3);
        $pdf->SetLeftMargin($left_margin + $image_width + $margin);
        $pdf->WriteHTML($plot);
        // image
        $file = getThumbnail($row['imgurl']);
        if (preg_match('/^img.php/', $file)) {
            $file = img();
        }
        // image file present?
        if ($file) {
            $pdf->Image($file, $left_margin, $ypos - 2, $image_width, $image_height, '', $link);
        }
        // add mediatype image
        if ($type_image = getMediaImage($row['mediatype'])) {
            $pdf->Image('./images/media/' . $type_image, $page_width - $mediaimg_width - $right_margin, $ypos - 2, $mediaimg_width, 0, '', '');
        }
        // new position
        $ypos += $margin;
        if ($file or $plot) {
            $ypos += max($image_height, $font_size);
        } else {
            $ypos += $font_size;
        }
        if ($ypos > 250) {
            $ypos = $config['pdf_font_size'];
            $pdf->AddPage();
        }
    }
    $pdf->Output('videoDB.pdf', 'D');
    // get rid of temp file
    @unlink($filename);
}
Пример #30
-1
 function savepdfcertificate()
 {
     $datac = JRequest::get('post', JREQUEST_ALLOWRAW);
     include JPATH_SITE . DS . 'components' . DS . 'com_guru' . DS . 'models' . DS . 'gurutask.php';
     $background_color = "";
     $op = JRequest::getVar("op", "");
     if ($op == 9) {
         $db = JFactory::getDBO();
         $user = JFactory::getUser();
         $config = JFactory::getConfig();
         $imagename = "SELECT * FROM #__guru_certificates WHERE id=1";
         $db->setQuery($imagename);
         $db->query();
         $imagename = $db->loadAssocList();
         if ($imagename[0]["design_background"] != "") {
             $image_theme = explode("/", $imagename[0]["design_background"]);
             if (trim($image_theme[4]) == 'thumbs') {
                 $image_theme = $image_theme[5];
             } else {
                 $image_theme = $image_theme[4];
             }
         } else {
             $background_color = "background-color:" . "#" . $imagename[0]["design_background_color"];
         }
         $site_url = JURI::root();
         $coursename = JRequest::getVar('cn', '', 'get');
         $authorname = JRequest::getVar('an', '', 'get');
         $certificateid = JRequest::getVar('id', '', 'get');
         $completiondate = JRequest::getVar('cd', '', 'get');
         $course_id = JRequest::getVar('ci', '', 'get');
         $sitename = $config->get('sitename');
         $user_id = $user->id;
         $scores_avg_quizzes = @guruModelguruTask::getAvgScoresQ($user_id, $course_id);
         $avg_quizzes_cert = "SELECT avg_certc FROM #__guru_program WHERE id=" . intval($course_id);
         $db->setQuery($avg_quizzes_cert);
         $db->query();
         $avg_quizzes_cert = $db->loadResult();
         $sql = "SELECT id_final_exam FROM #__guru_program WHERE id=" . intval($course_id);
         $db->setQuery($sql);
         $result = $db->loadResult();
         $sql = "SELECT hasquiz from #__guru_program WHERE id=" . intval($course_id);
         $db->setQuery($sql);
         $resulthasq = $db->loadResult();
         $sql = "SELECT max_score FROM #__guru_quiz WHERE id=" . intval($result);
         $db->setQuery($sql);
         $result_maxs = $db->loadResult();
         // final quiz --------------------------------------------------
         $sql = "SELECT id, score_quiz FROM #__guru_quiz_question_taken_v3 WHERE user_id=" . intval($user_id) . " and quiz_id=" . intval($result) . " and pid=" . intval($course_id) . " ORDER BY id DESC LIMIT 0,1";
         $db->setQuery($sql);
         $result_q = $db->loadObject();
         $first = explode("|", @$result_q->score_quiz);
         @($res = intval($first[0] / $first[1] * 100));
         if ($resulthasq == 0 && $scores_avg_quizzes == "") {
             $avg_certc = "N/A";
         } elseif ($resulthasq != 0 && $scores_avg_quizzes == "") {
             $avg_certc = "N/A";
         } elseif ($resulthasq != 0 && isset($scores_avg_quizzes)) {
             if ($scores_avg_quizzes >= intval($avg_quizzes_cert)) {
                 $avg_certc = $scores_avg_quizzes . '%';
             } else {
                 $avg_certc = $scores_avg_quizzes . '%';
             }
         }
         // final quiz --------------------------------------------------
         // regular ----------------------------------------------
         $s = 0;
         $sql = "select mr.`media_id` from #__guru_mediarel mr, #__guru_days d where mr.`type`='dtask' and mr.`type_id`=d.`id` and d.`pid`=" . intval($course_id);
         $db->setQuery($sql);
         $db->query();
         $lessons = $db->loadColumn();
         if (!isset($lessons) || count($lessons) == 0) {
             $lessons = array("0");
         }
         $sql = "select mr.`media_id` from #__guru_mediarel mr where mr.`layout`='12' and mr.`type`='scr_m' and mr.`type_id` in (" . implode(", ", $lessons) . ")";
         $db->setQuery($sql);
         $db->query();
         $all_quizzes = $db->loadColumn();
         if (isset($all_quizzes) && count($all_quizzes) > 0) {
             foreach ($all_quizzes as $key_quiz => $quiz_id) {
                 $sql = "SELECT score_quiz FROM #__guru_quiz_question_taken_v3 WHERE user_id=" . intval($user_id) . " and quiz_id=" . intval($quiz_id) . " and pid=" . intval($course_id) . " ORDER BY id DESC LIMIT 0,1";
                 $db->setQuery($sql);
                 $db->query();
                 $result_q = $db->loadColumn();
                 $res = @$result_q["0"];
                 $s += $res;
             }
             $avg_certc1 = "N/A";
             if ($s > 0) {
                 $avg_certc1 = $s / count($all_quizzes) . "%";
             }
         }
         // regular ----------------------------------------------
         /*$sql = "SELECT id, score_quiz, time_quiz_taken_per_user  FROM #__guru_quiz_taken_v3 WHERE user_id=".intval($user_id)." and quiz_id=".intval($result)." and pid=".intval($course_id )." ORDER BY id DESC LIMIT 0,1";
         			$db->setQuery($sql);
         			$result_q = $db->loadObject();
         	
         			$first= explode("|", @$result_q->score_quiz);
         	
         			@$res = intval(($first[0]/$first[1])*100);
         	
         			if($resulthasq == 0 && $scores_avg_quizzes == ""){
         				$avg_certc1 = "N/A";
         			}
         			elseif($resulthasq != 0 && $scores_avg_quizzes == ""){
         				$avg_certc1 = "N/A";
         			}
         			elseif($resulthasq != 0 && isset($scores_avg_quizzes)){
         				if($scores_avg_quizzes >= intval($avg_quizzes_cert)){
         					$avg_certc1 =  $scores_avg_quizzes.'%'; 
         				}
         				else{
         					$avg_certc1 = $scores_avg_quizzes.'%';
         				}
         			}*/
         /*if($result !=0 && $res !="" ){
         			if( $res >= $result_maxs){
         				$avg_certc = $res.'%';
         			}
         			elseif($res < $result_maxs){
         				$avg_certc = $res.'%';
         			}
         		}
         		elseif(($result !=0 && $result !="")){
         			$avg_certc = "N/A";
         		}
         		elseif($result ==0 || $result ==""){
         			$avg_certc = "N/A";
         		}*/
         $firstnamelastname = "SELECT firstname, lastname FROM #__guru_customer WHERE id=" . intval($user_id);
         $db->setQuery($firstnamelastname);
         $db->query();
         $firstnamelastname = $db->loadAssocList();
         $coursemsg = "SELECT certificate_course_msg FROM #__guru_program WHERE id=" . intval($course_id);
         $db->setQuery($coursemsg);
         $db->query();
         $coursemsg = $db->loadResult();
         $certificate_url = JUri::base() . "index.php?option=com_guru&view=guruOrders&task=printcertificate&opt=" . $certificateid . "&cn=" . $coursename . "&an=" . $authorname . "&cd=" . $completiondate . "&id=" . $certificateid;
         $certificate_url = str_replace(" ", "%20", $certificate_url);
         $imagename[0]["templates1"] = str_replace("[SITENAME]", $sitename, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[STUDENT_FIRST_NAME]", $firstnamelastname[0]["firstname"], $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[STUDENT_LAST_NAME]", $firstnamelastname[0]["lastname"], $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[SITEURL]", $site_url, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[CERTIFICATE_ID]", $certificateid, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[COMPLETION_DATE]", $completiondate, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[COURSE_NAME]", $coursename, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[AUTHOR_NAME]", $authorname, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[CERT_URL]", $certificate_url, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[COURSE_MSG]", $coursemsg, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[COURSE_AVG_SCORE]", $avg_certc1, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[COURSE_FINAL_SCORE]", $avg_certc, $imagename[0]["templates1"]);
         while (ob_get_level()) {
             ob_end_clean();
         }
         header("Content-Encoding: None", true);
         if (strlen($imagename[0]["design_text_color"]) == 3) {
             $r = hexdec(substr($imagename[0]["design_text_color"], 0, 1) . substr($imagename[0]["design_text_color"], 0, 1));
             $g = hexdec(substr($imagename[0]["design_text_color"], 1, 1) . substr($imagename[0]["design_text_color"], 1, 1));
             $b = hexdec(substr($imagename[0]["design_text_color"], 2, 1) . substr($imagename[0]["design_text_color"], 2, 1));
         } else {
             $r = hexdec(substr($imagename[0]["design_text_color"], 0, 2));
             $g = hexdec(substr($imagename[0]["design_text_color"], 2, 2));
             $b = hexdec(substr($imagename[0]["design_text_color"], 4, 2));
         }
         $background_color = explode(":", $background_color);
         @($background_color[1] = str_replace("#", "", $background_color[1]));
         if (strlen($background_color[1]) == 3) {
             $rg = hexdec(substr($background_color[1], 0, 1) . substr($background_color[1], 0, 1));
             $gg = hexdec(substr($background_color[1], 1, 1) . substr($background_color, 1, 1));
             $bg = hexdec(substr($background_color[1], 2, 1) . substr($background_color[1], 2, 1));
         } else {
             $rg = hexdec(substr($background_color[1], 0, 2));
             $gg = hexdec(substr($background_color[1], 2, 2));
             $bg = hexdec(substr($background_color[1], 4, 2));
         }
         if ($imagename[0]["library_pdf"] == 0) {
             require_once JPATH_SITE . DS . "components" . DS . "com_guru" . DS . "helpers" . DS . "fpdf.php";
             $pdf = new PDF('L', 'mm', 'A5');
             $pdf->SetFont($imagename[0]["font_certificate"], '', 12);
             $pdf->SetTextColor($r, $g, $b);
             //set up a page
             $pdf->AddPage();
             if ($image_theme != "") {
                 $pdf->Image(JUri::base() . "images/stories/guru/certificates/" . $image_theme, -4, -1, 210, 150);
                 //$pdf->Cell(0,75,JText::_("GURU_CERTIFICATE_OF_COMPLETION"),0,1,'C');
             } else {
                 $pdf->SetFillColor($rg, $gg, $bg);
                 //$pdf->Cell(0,115,JText::_("GURU_CERTIFICATE_OF_COMPLETION"),0,1,'C',true);
             }
             $pdf->Ln(20);
             $pdf->SetXY(100, 50);
             $pdf->WriteHTML(iconv('UTF-8', 'ISO-8859-1', $imagename[0]["templates1"]), true);
             $pdf->Output('certificate' . $certificateid . '.pdf', 'D');
         } else {
             require JPATH_SITE . DS . "components" . DS . "com_guru" . DS . "helpers" . DS . "MPDF" . DS . "mpdf.php";
             $pdf = new mPDF('utf-8', 'A4-L');
             $pdf = new mPDF('utf-8', 'A4-L', 0, strtolower($imagename[0]["font_certificate"]));
             $imagename[0]["templates1"] = '<style> body { font-family:"' . strtolower($imagename[0]["font_certificate"]) . '" ; color: rgb(' . $r . ', ' . $g . ', ' . $b . '); }</style>' . $imagename[0]["templates1"];
             //set up a page
             $pdf->AddPage('L');
             if ($image_theme != "") {
                 $pdf->Image(JPATH_BASE . "/images/stories/guru/certificates/" . $image_theme, 0, 0, 298, 210, 'jpg', '', true, false);
                 //$pdf->Cell(0,75,JText::_("GURU_CERTIFICATE_OF_COMPLETION"),0,1,'C');
             } else {
                 $pdf->SetFillColor($rg, $gg, $bg);
                 //$pdf->Cell(0,115,JText::_("GURU_CERTIFICATE_OF_COMPLETION"),0,1,'C',true);
             }
             //$pdf->Ln(20);
             $pdf->SetXY(100, 50);
             $pdf->SetDisplayMode('fullpage');
             $pdf->WriteHTML($imagename[0]["templates1"]);
             $pdf->Output('certificate' . $certificateid . '.pdf', 'D');
             exit;
         }
     } else {
         $db = JFactory::getDBO();
         $user = JFactory::getUser();
         $config = JFactory::getConfig();
         $imagename = "SELECT * FROM #__guru_certificates WHERE id=1";
         $db->setQuery($imagename);
         $db->query();
         $imagename = $db->loadAssocList();
         if ($imagename[0]["design_background"] != "") {
             $image_theme = explode("/", $imagename[0]["design_background"]);
             if (trim($image_theme[4]) == 'thumbs') {
                 $image_theme = $image_theme[5];
             } else {
                 $image_theme = $image_theme[4];
             }
         } else {
             $background_color = "background-color:" . "#" . $imagename[0]["design_background_color"];
         }
         $site_url = JURI::root();
         $coursename = $datac['cn'];
         $authorname = $datac['an'];
         $certificateid = $datac['id'];
         $completiondate = $datac['cd'];
         $course_id = $datac['ci'];
         $sitename = $config->get('config.sitename');
         $user_id = $user->id;
         $scores_avg_quizzes = guruModelguruTask::getAvgScoresQ($user_id, $course_id);
         $avg_quizzes_cert = "SELECT avg_certc FROM #__guru_program WHERE id=" . intval($course_id);
         $db->setQuery($avg_quizzes_cert);
         $db->query();
         $avg_quizzes_cert = $db->loadResult();
         $sql = "SELECT id_final_exam FROM #__guru_program WHERE id=" . intval($course_id);
         $db->setQuery($sql);
         $result = $db->loadResult();
         $sql = "SELECT hasquiz from #__guru_program WHERE id=" . intval($course_id);
         $db->setQuery($sql);
         $resulthasq = $db->loadResult();
         $sql = "SELECT max_score FROM #__guru_quiz WHERE id=" . intval($result);
         $db->setQuery($sql);
         $result_maxs = $db->loadResult();
         $sql = "SELECT id, score_quiz, time_quiz_taken_per_user  FROM #__guru_quiz_taken_v3 WHERE user_id=" . intval($user_id) . " and quiz_id=" . intval($result) . " and pid=" . intval($course_id) . " ORDER BY id DESC LIMIT 0,1";
         $db->setQuery($sql);
         $result_q = $db->loadObject();
         $first = explode("|", @$result_q->score_quiz);
         @($res = intval($first[0] / $first[1] * 100));
         if ($resulthasq == 0 && $scores_avg_quizzes == "") {
             $avg_certc1 = "N/A";
         } elseif ($resulthasq != 0 && $scores_avg_quizzes == "") {
             $avg_certc1 = "N/A";
         } elseif ($resulthasq != 0 && isset($scores_avg_quizzes)) {
             if ($scores_avg_quizzes >= intval($avg_quizzes_cert)) {
                 $avg_certc1 = $scores_avg_quizzes . '%';
             } else {
                 $avg_certc1 = $scores_avg_quizzes . '%';
             }
         }
         if ($result != 0 && $res != "") {
             if ($res >= $result_maxs) {
                 $avg_certc = $res . '%';
             } elseif ($res < $result_maxs) {
                 $avg_certc = $res . '%';
             }
         } elseif ($result != 0 && $result != "") {
             $avg_certc = "N/A";
         } elseif ($result == 0 || $result == "") {
             $avg_certc = "N/A";
         }
         $firstnamelastname = "SELECT firstname, lastname FROM #__guru_customer WHERE id=" . intval($user_id);
         $db->setQuery($firstnamelastname);
         $db->query();
         $firstnamelastname = $db->loadAssocList();
         $coursemsg = "SELECT certificate_course_msg FROM #__guru_program WHERE id=" . intval($course_id);
         $db->setQuery($coursemsg);
         $db->query();
         $coursemsg = $db->loadResult();
         $certificate_url = JUri::base() . "index.php?option=com_guru&view=guruOrders&task=printcertificate&opt=" . $certificateid . "&cn=" . $coursename . "&an=" . $authorname . "&cd=" . $completiondate . "&id=" . $certificateid;
         $certificate_url = str_replace(" ", "%20", $certificate_url);
         $imagename[0]["templates1"] = str_replace("[SITENAME]", $sitename, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[STUDENT_FIRST_NAME]", $firstnamelastname[0]["firstname"], $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[STUDENT_LAST_NAME]", $firstnamelastname[0]["lastname"], $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[SITEURL]", $site_url, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[CERTIFICATE_ID]", $certificateid, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[COMPLETION_DATE]", $completiondate, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[COURSE_NAME]", $coursename, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[AUTHOR_NAME]", $authorname, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[CERT_URL]", $certificate_url, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[COURSE_MSG]", $coursemsg, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[COURSE_AVG_SCORE]", $avg_certc1, $imagename[0]["templates1"]);
         $imagename[0]["templates1"] = str_replace("[COURSE_FINAL_SCORE]", $avg_certc, $imagename[0]["templates1"]);
         while (ob_get_level()) {
             ob_end_clean();
         }
         header("Content-Encoding: None", true);
         if (strlen($imagename[0]["design_text_color"]) == 3) {
             $r = hexdec(substr($imagename[0]["design_text_color"], 0, 1) . substr($imagename[0]["design_text_color"], 0, 1));
             $g = hexdec(substr($imagename[0]["design_text_color"], 1, 1) . substr($imagename[0]["design_text_color"], 1, 1));
             $b = hexdec(substr($imagename[0]["design_text_color"], 2, 1) . substr($imagename[0]["design_text_color"], 2, 1));
         } else {
             $r = hexdec(substr($imagename[0]["design_text_color"], 0, 2));
             $g = hexdec(substr($imagename[0]["design_text_color"], 2, 2));
             $b = hexdec(substr($imagename[0]["design_text_color"], 4, 2));
         }
         $background_color = explode(":", $background_color);
         $background_color[1] = str_replace("#", "", $background_color[1]);
         if (strlen($background_color[1]) == 3) {
             $rg = hexdec(substr($background_color[1], 0, 1) . substr($background_color[1], 0, 1));
             $gg = hexdec(substr($background_color[1], 1, 1) . substr($background_color, 1, 1));
             $bg = hexdec(substr($background_color[1], 2, 1) . substr($background_color[1], 2, 1));
         } else {
             $rg = hexdec(substr($background_color[1], 0, 2));
             $gg = hexdec(substr($background_color[1], 2, 2));
             $bg = hexdec(substr($background_color[1], 4, 2));
         }
         if ($imagename[0]["library_pdf"] == 0) {
             require JPATH_SITE . DS . "components" . DS . "com_guru" . DS . "helpers" . DS . "fpdf.php";
             $pdf = new PDF('L', 'mm', 'A5');
             $pdf->SetFont($imagename[0]["font_certificate"], '', 12);
             $pdf->SetTextColor($r, $g, $b);
             //set up a page
             $pdf->AddPage();
             if ($image_theme != "") {
                 $pdf->Image(JUri::base() . "images/stories/guru/certificates/" . $image_theme, -4, -1, 210, 150);
                 //$pdf->Cell(0,75,JText::_("GURU_CERTIFICATE_OF_COMPLETION"),0,1,'C');
             } else {
                 $pdf->SetFillColor($rg, $gg, $bg);
                 //$pdf->Cell(0,115,JText::_("GURU_CERTIFICATE_OF_COMPLETION"),0,1,'C',true);
             }
             $pdf->Ln(20);
             $pdf->SetXY(100, 50);
             $pdf->WriteHTML(iconv('UTF-8', 'ISO-8859-1', $imagename[0]["templates1"]), true);
             $pdf->Output('certificate' . $certificateid . '.pdf', 'D');
         } else {
             require JPATH_SITE . DS . "components" . DS . "com_guru" . DS . "helpers" . DS . "MPDF" . DS . "mpdf.php";
             $pdf = new mPDF('utf-8', 'A4-L');
             $imagename[0]["templates1"] = '<style> body { font-family:"' . strtolower($imagename[0]["font_certificate"]) . '" ; color: rgb(' . $r . ', ' . $g . ', ' . $b . '); }</style>' . $imagename[0]["templates1"];
             //set up a page
             $pdf->AddPage('L');
             if ($image_theme != "") {
                 $pdf->Image(JPATH_BASE . "/images/stories/guru/certificates/" . $image_theme, 0, 0, 298, 210, 'jpg', '', true, false);
                 //$pdf->Cell(0,75,JText::_("GURU_CERTIFICATE_OF_COMPLETION"),0,1,'C');
             } else {
                 $pdf->SetFillColor($rg, $gg, $bg);
                 //$pdf->Cell(0,115,JText::_("GURU_CERTIFICATE_OF_COMPLETION"),0,1,'C',true);
             }
             //$pdf->Ln(20);
             $pdf->SetXY(100, 50);
             $pdf->SetDisplayMode('fullpage');
             $pdf->WriteHTML($imagename[0]["templates1"]);
             $pdf->Output('certificate' . $certificateid . '.pdf', 'D');
             exit;
         }
     }
 }