コード例 #1
1
ファイル: PDF.php プロジェクト: Jtgadbois/Pedadida
	/**
	 * Save PHPExcel to file
	 *
	 * @param 	string 		$pFileName
	 * @throws 	Exception
	 */
	public function save($pFilename = null) {
		// Open file
		global $cnf;
		$pFilename= $cnf['path']['Temp'] . $pFilename;

		$fileHandle = fopen($pFilename, 'w');
		if ($fileHandle === false) {
			throw new Exception("Could not open file $pFilename for writing.");
		}

		// Fetch sheets
		$sheets = array();
		if (is_null($this->_sheetIndex)) {
			$sheets = $this->_phpExcel->getAllSheets();
		} else {
			$sheets[] = $this->_phpExcel->getSheet($this->_sheetIndex);
		}

    	// PDF paper size
    	$paperSize = 'A4';

		// Create PDF
		$pdf = new FPDF('P', 'pt', $paperSize);

		// Loop all sheets
		foreach ($sheets as $sheet) {
	    	// PDF orientation
	    	$orientation = 'P';
	    	if ($sheet->getPageSetup()->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) {
		    	$orientation = 'L';
	    	}

			// Start sheet
			$pdf->SetAutoPageBreak(true);
			$pdf->SetFont('Arial', '', 10);
			$pdf->AddPage($orientation);

	    	// Get worksheet dimension
	    	$dimension = explode(':', $sheet->calculateWorksheetDimension());
	    	$dimension[0] = PHPExcel_Cell::coordinateFromString($dimension[0]);
	    	$dimension[0][0] = PHPExcel_Cell::columnIndexFromString($dimension[0][0]) - 1;
	    	$dimension[1] = PHPExcel_Cell::coordinateFromString($dimension[1]);
	    	$dimension[1][0] = PHPExcel_Cell::columnIndexFromString($dimension[1][0]) - 1;

	    	// Calculate column widths
	    	$sheet->calculateColumnWidths();

	    	// Loop trough cells
	    	for ($row = $dimension[0][1]; $row <= $dimension[1][1]; $row++) {
	    		// Line height
	    		$lineHeight = 0;

	    		// Calulate line height
	    		for ($column = $dimension[0][0]; $column <= $dimension[1][0]; $column++) {
	    		    $rowDimension = $sheet->getRowDimension($row);
	    			$cellHeight = PHPExcel_Shared_Drawing::pixelsToPoints(
	    				PHPExcel_Shared_Drawing::cellDimensionToPixels($rowDimension->getRowHeight())
	    			);
	    			if ($cellHeight <= 0) {
		    			$cellHeight = PHPExcel_Shared_Drawing::pixelsToPoints(
		    				PHPExcel_Shared_Drawing::cellDimensionToPixels($sheet->getDefaultRowDimension()->getRowHeight())
		    			);
	    			}
	    			if ($cellHeight <= 0) {
	    				$cellHeight = $sheet->getStyleByColumnAndRow($column, $row)->getFont()->getSize();
	    			}
	    			if ($cellHeight > $lineHeight) {
	    				$lineHeight = $cellHeight;
	    			}
	    		}

	    		// Output values
	    		for ($column = $dimension[0][0]; $column <= $dimension[1][0]; $column++) {
	    			// Start with defaults...
	    			$pdf->SetFont('Arial', '', 10);
	    			$pdf->SetTextColor(0, 0, 0);
	    			$pdf->SetDrawColor(100, 100, 100);
	    			$pdf->SetFillColor(255, 255, 255);

			    	// Coordinates
			    	$startX = $pdf->GetX();
			    	$startY = $pdf->GetY();

	    			// Cell exists?
	    			$cellData = '';
	    			if ($sheet->cellExistsByColumnAndRow($column, $row)) {
	    				if ($sheet->getCellByColumnAndRow($column, $row)->getValue() instanceof PHPExcel_RichText) {
	    					$cellData = $sheet->getCellByColumnAndRow($column, $row)->getValue()->getPlainText();
	    				} else {
		    				if ($this->_preCalculateFormulas) {
		    					$cellData = PHPExcel_Style_NumberFormat::ToFormattedString(
		    						$sheet->getCellByColumnAndRow($column, $row)->getCalculatedValue(),
		    						$sheet->getstyle( $sheet->getCellByColumnAndRow($column, $row)->getCoordinate() )->getNumberFormat()->getFormatCode()
		    					);
		    				} else {
		    					$cellData = PHPExcel_Style_NumberFormat::ToFormattedString(
		    						$sheet->getCellByColumnAndRow($column, $row)->getValue(),
		    						$sheet->getstyle( $sheet->getCellByColumnAndRow($column, $row)->getCoordinate() )->getNumberFormat()->getFormatCode()
		    					);
		    				}
	    				}
	    			}

	    			// Style information
	    			$style = $sheet->getStyleByColumnAndRow($column, $row);

	    			// Cell width
	    			$columnDimension = $sheet->getColumnDimensionByColumn($column);
	    			if ($columnDimension->getWidth() == -1) {
	    				$columnDimension->setAutoSize(true);
	    				$sheet->calculateColumnWidths(false);
	    			}
	    			$cellWidth = PHPExcel_Shared_Drawing::pixelsToPoints(
	    				PHPExcel_Shared_Drawing::cellDimensionToPixels($columnDimension->getWidth())
	    			);

	    			// Cell height
	    			$rowDimension = $sheet->getRowDimension($row);
	    			$cellHeight = PHPExcel_Shared_Drawing::pixelsToPoints(
	    				PHPExcel_Shared_Drawing::cellDimensionToPixels($rowDimension->getRowHeight())
	    			);
	    			if ($cellHeight <= 0) {
	    				$cellHeight = $style->getFont()->getSize();
	    			}

	    			// Column span? Rowspan?
	    			$singleCellWidth = $cellWidth;
	    			$singleCellHeight = $cellHeight;
					foreach ($sheet->getMergeCells() as $cells) {
						if ($sheet->getCellByColumnAndRow($column, $row)->isInRange($cells)) {
							list($first, ) = PHPExcel_Cell::splitRange($cells);

							if ($first == $sheet->getCellByColumnAndRow($column, $row)->getCoordinate()) {
								list($colSpan, $rowSpan) = PHPExcel_Cell::rangeDimension($cells);

								$cellWidth = $cellWidth * $colSpan;
								$cellHeight = $cellHeight * $rowSpan;
							}

							break;
						}
					}

					// Cell height OK?
					if ($cellHeight < $lineHeight) {
						$cellHeight = $lineHeight;
						$singleCellHeight = $cellHeight;
					}

	    			// Font formatting
	    			$fontStyle = '';
	    			if ($style->getFont()->getBold()) {
	    				$fontStyle .= 'B';
					}
					if ($style->getFont()->getItalic()) {
						$fontStyle .= 'I';
					}
					if ($style->getFont()->getUnderline() != PHPExcel_Style_Font::UNDERLINE_NONE) {
						$fontStyle .= 'U';
					}
					$pdf->SetFont('Arial', $fontStyle, $style->getFont()->getSize());

					// Text alignment
					$alignment = 'L';
					switch ($style->getAlignment()->getHorizontal()) {
						case PHPExcel_Style_Alignment::HORIZONTAL_CENTER:
							$alignment = 'C'; break;
						case PHPExcel_Style_Alignment::HORIZONTAL_RIGHT:
							$alignment = 'R'; break;
						case PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY:
							$alignment = 'J'; break;
						case PHPExcel_Style_Alignment::HORIZONTAL_LEFT:
						case PHPExcel_Style_Alignment::HORIZONTAL_GENERAL:
						default:
							$alignment = 'L'; break;
					}

					// Text color
					$pdf->SetTextColor(
						hexdec(substr($style->getFont()->getColor()->getRGB(), 0, 2)),
						hexdec(substr($style->getFont()->getColor()->getRGB(), 2, 2)),
						hexdec(substr($style->getFont()->getColor()->getRGB(), 4, 2))
					);

					// Fill color
					if ($style->getFill()->getFillType() != PHPExcel_Style_Fill::FILL_NONE) {
						$pdf->SetFillColor(
							hexdec(substr($style->getFill()->getStartColor()->getRGB(), 0, 2)),
							hexdec(substr($style->getFill()->getStartColor()->getRGB(), 2, 2)),
							hexdec(substr($style->getFill()->getStartColor()->getRGB(), 4, 2))
						);
					}

					// Border color
					$borders = '';
	    			if ($style->getBorders()->getLeft()->getBorderStyle() != PHPExcel_Style_Border::BORDER_NONE) {
						$borders .= 'L';
						$pdf->SetDrawColor(
							hexdec(substr($style->getBorders()->getLeft()->getColor()->getRGB(), 0, 2)),
							hexdec(substr($style->getBorders()->getLeft()->getColor()->getRGB(), 2, 2)),
							hexdec(substr($style->getBorders()->getLeft()->getColor()->getRGB(), 4, 2))
						);
					}
	    			if ($style->getBorders()->getRight()->getBorderStyle() != PHPExcel_Style_Border::BORDER_NONE) {
						$borders .= 'R';
						$pdf->SetDrawColor(
							hexdec(substr($style->getBorders()->getRight()->getColor()->getRGB(), 0, 2)),
							hexdec(substr($style->getBorders()->getRight()->getColor()->getRGB(), 2, 2)),
							hexdec(substr($style->getBorders()->getRight()->getColor()->getRGB(), 4, 2))
						);
					}
	    			if ($style->getBorders()->getTop()->getBorderStyle() != PHPExcel_Style_Border::BORDER_NONE) {
						$borders .= 'T';
						$pdf->SetDrawColor(
							hexdec(substr($style->getBorders()->getTop()->getColor()->getRGB(), 0, 2)),
							hexdec(substr($style->getBorders()->getTop()->getColor()->getRGB(), 2, 2)),
							hexdec(substr($style->getBorders()->getTop()->getColor()->getRGB(), 4, 2))
						);
					}
	    			if ($style->getBorders()->getBottom()->getBorderStyle() != PHPExcel_Style_Border::BORDER_NONE) {
						$borders .= 'B';
						$pdf->SetDrawColor(
							hexdec(substr($style->getBorders()->getBottom()->getColor()->getRGB(), 0, 2)),
							hexdec(substr($style->getBorders()->getBottom()->getColor()->getRGB(), 2, 2)),
							hexdec(substr($style->getBorders()->getBottom()->getColor()->getRGB(), 4, 2))
						);
					}
					if ($borders == '') {
						$borders = 0;
					}
					if ($sheet->getShowGridlines()) {
						$borders = 'LTRB';
					}

	    			// Image?
			    	$iterator = $sheet->getDrawingCollection()->getIterator();
			    	while ($iterator->valid()) {
			    		if ($iterator->current()->getCoordinates() == PHPExcel_Cell::stringFromColumnIndex($column) . ($row + 1)) {
			    			try {
				    			$pdf->Image(
				    				$iterator->current()->getPath(),
				    				$pdf->GetX(),
				    				$pdf->GetY(),
				    				$iterator->current()->getWidth(),
				    				$iterator->current()->getHeight(),
				    				'',
				    				$this->_tempDir
				    			);
			    			} catch (Exception $ex) { }
			    		}

			    		$iterator->next();
			    	}

	    			// Print cell
	    			$pdf->MultiCell(
	    				$cellWidth,
	    				$cellHeight,
	    				$cellData,
	    				$borders,
	    				$alignment,
	    				($style->getFill()->getFillType() == PHPExcel_Style_Fill::FILL_NONE ? 0 : 1)
	    			);

			    	// Coordinates
			    	$endX = $pdf->GetX();
			    	$endY = $pdf->GetY();

			    	// Revert to original Y location
			    	if ($endY > $startY) {
			    		$pdf->SetY($startY);
			    		if ($lineHeight < $lineHeight + ($endY - $startY)) {
			    			$lineHeight = $lineHeight + ($endY - $startY);
			    		}
			    	}
			    	$pdf->SetX($startX + $singleCellWidth);

			    	// Hyperlink?
			    	if ($sheet->getCellByColumnAndRow($column, $row)->hasHyperlink()) {
			    		if (!$sheet->getCellByColumnAndRow($column, $row)->getHyperlink()->isInternal()) {
			    			$pdf->Link(
			    				$startX,
			    				$startY,
			    				$endX - $startX,
			    				$endY - $startY,
			    				$sheet->getCellByColumnAndRow($column, $row)->getHyperlink()->getUrl()
			    			);
			    		}
			    	}
				}

				// Garbage collect!
				$sheet->garbageCollect();

				// Next line...
				$pdf->Ln($lineHeight);
	    	}
		}

		// Document info
		$pdf->SetTitle($this->_phpExcel->getProperties()->getTitle());
		$pdf->SetAuthor($this->_phpExcel->getProperties()->getCreator());
		$pdf->SetSubject($this->_phpExcel->getProperties()->getSubject());
		$pdf->SetKeywords($this->_phpExcel->getProperties()->getKeywords());
		$pdf->SetCreator($this->_phpExcel->getProperties()->getCreator());

		// Write to file
		fwrite($fileHandle, $pdf->output($pFilename, 'S'));

		// Close file
		fclose($fileHandle);
	}
コード例 #2
1
function genpdf($typefacture, $datefacture, $nofacture, $montant, $civilite, $client, $contact, $chrono, $today)
{
    $pdf = new FPDF("P", "mm", "A4");
    $pdf->AddPage();
    $pdf->SetMargins(20, 20);
    $pdf->AddFont("Arialb", "", "arialb.php");
    //$pdf->AddFont("Courier","","arialb.php");
    /////////////////////////////////////en tete////////////////////////////////////////
    //logo
    $pdf->SetXY(18, 24);
    $X = $pdf->GetX();
    $Y = $pdf->GetY();
    $pdf->Image("img/logo.jpg", $X, $Y, 23, 19, "jpg");
    //Commune de Faa"a
    $pdf->SetXY(42, 22);
    $X = $pdf->GetX();
    $Y = $pdf->GetY();
    $pdf->SetFont("Arialb", "", 13);
    $pdf->Cell(55, 10, utf8_decode("COMMUNE DE FAA'A"));
    $pdf->SetXY($X + 1, $Y + 8);
    $pdf->SetFont("Arial", "", 12);
    $pdf->Cell(55, 5, utf8_decode("N° {$chrono}/DAF/FTR-Régie-hp"), 1, 1, "C");
    //$X=$pdf->GetX();
    $Y = $pdf->GetY();
    $pdf->SetXY($X, $Y);
    $pdf->SetFont("Arial", "", 9);
    $pdf->Cell(55, 5, utf8_decode("Affaire suivie par : Hinatini Parker"), 0, 1);
    $Y = $pdf->GetY();
    $pdf->SetXY($X, $Y);
    $pdf->SetFont("Arial", "", 9);
    $pdf->Cell(55, 3, utf8_decode("Téléphone : 800 960 poste 421"), 0, 0);
    ///////////////////////////////////fin en tete/////////////////////////////////////
    ///////////////////////////////////colonne droite/////////////////////////////////
    //Date
    $pdf->SetXY($X + 100, $Y);
    $pdf->SetFont("Arial", "", 10);
    $pdf->Cell(55, 3, "Faa'a le " . $today, 0);
    ///////////////////////////////////fin colonne droite////////////////////////////
    /////////////////////////////////info exp/dest //////////////////////////////////////
    //Le Maire
    $pdf->SetY(60);
    $pdf->SetFont("times", "", 18);
    $pdf->Cell(0, 10, "Le Maire", 0, 1, "C");
    //Destinataire
    $pdf->SetY(70);
    $pdf->SetFont("Arial", "", 10);
    $pdf->Multicell(0, 5, utf8_decode("à\n{$client}\n{$contact}"), 0, "C");
    $currentY = $pdf->GetY();
    $pdf->SetY($currentY + 10);
    $pdf->SetFont("Arialb", "U", 10);
    $pdf->Cell(20, 5, utf8_decode("Objet :"), 0, 0, "L");
    $pdf->SetFont("Arialb", "", 10);
    $pdf->Cell(0, 5, utf8_decode("Relance des factures impayées"), 0, 1, "L");
    $pdf->SetFont("Arial", "U", 10);
    $pdf->Cell(20, 5, utf8_decode("N/Réf :"), 0, 0, "L");
    $pdf->SetFont("Arial", "", 10);
    $pdf->Cell(0, 5, utf8_decode("Facture {$typefacture} N° {$nofacture} du {$datefacture}"), 0, 1, "L");
    $Y = $pdf->GetY();
    $pdf->SetY($Y + 20);
    $text = "{$civilite},\n\nJe vous informe que, sauf erreur de ma part, vous présentez un impayé " . "envers la Commune de FAA'A d'un montant de {$montant} FCP au titre de la (des) {$typefacture}.\n\n" . "Aussi, je vous demande de bien vouloir vous rapprocher de la Régie municipale pour vous acquitter de la somme due.\n\n" . "A défaut de réponse de votre part dans un délai de 45 jours à compter de la date du présent courrier," . "votre dossier sera transmis en contentieux à la Trésorerie des Iles du Vent, des Australes et des Archipels pour commandement de payer.\n\n" . "La Régie reste à votre disposition au 800.960 poste 421 pour toute entente préalable avant poursuite.\n\n" . "Je vous prie d'agréer, {$civilite}, l'expression de mes salutations distinguées";
    $pdf->Multicell(0, 5, utf8_decode($text), 0, "L");
    $pdf->Image("img/marianne.jpg", 150, 220, 31, 31, "jpg");
    ////////////////////////////////information////////////////////////////////////
    $pdf->Line(20, 273, 190, 273);
    $pdf->SetXY(20, 273);
    $pdf->SetFont("Arial", "", 7);
    $pdf->Cell(0, 3, utf8_decode("PK 4 côté mer - BP 60 002 - 98702 Faa’a Centre - Tahiti / Tél. : (689) 800 960 - Télécopie : (689) 834 890 - E-mail : mairiefaaa@mail.pf\n"), 0, 0, "C");
    ////////////////////////////////fin information////////////////////////////////////
    $pdf->Output();
}
コード例 #3
0
    $status = $clearance_model->getOverallSignatoryClearanceStatus($stud_id, $value, $current_sysemID);
    if ($status == "No Requirements") {
        $status = "Cleared";
    }
    $listOfSignatories["status"][$key] = $status;
}
//var_dump($listOfSignatories);
$fpdf = new FPDF('P', 'mm', 'Legal');
$fpdf->SetDisplayMode('fullpage', 'continuous');
$fpdf->SetTitle("SOCS Clearance - Export Copy");
$fpdf->SetCreator("USEP SOCS");
$fpdf->SetAuthor("University of Southeastern Philippines");
$fpdf->SetSubject("Electronic Clearance (export copy)");
$fpdf->SetMargins(15, 15, 15);
$fpdf->AddPage();
$fpdf->SetY('15');
$fpdf->Image('logo.jpg', 13, $fpdf->GetY() - 5, 25);
printBody();
$fpdf->Cell(0, 0, "Registrar's Copy", 0, 1, 'R', false);
$fpdf->Ln(4);
$fpdf->Cell(0, 0, "", 1, 1, 'L', true);
$fpdf->Ln(4);
$fpdf->Cell(0, 0, "Adviser's Copy", 0, 1, 'R', false);
$fpdf->SetY($fpdf->GetY() + 10);
$fpdf->Image('logo.jpg', 13, $fpdf->GetY() - 5, 25);
printBody();
function printBody()
{
    global $fpdf, $stud_id, $stud_gender, $stud_name, $stud_year, $stud_course, $stud_dept, $current_sem, $current_sy, $listOfSignatories, $signatory_model;
    $fontsize = 10;
    $single_spacing = 4;
コード例 #4
0
$pdf->Cell(40, 5, '', 1, 0, 'C');
$pdf->Cell(40, 5, '', 1, 1, 'C');
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(70, 5, 'Others', 1, 0, 'L');
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(40, 5, '', 1, 0, 'C');
$pdf->Cell(40, 5, '', 1, 0, 'C');
$pdf->Cell(40, 5, '', 1, 0, 'C');
$pdf->Cell(40, 5, '', 1, 0, 'C');
$pdf->Cell(40, 5, '', 1, 1, 'C');
//new signatories table
$result = mysql_query("select gs_name, gs_pos, gs_office from global_sign where sign_id =1") or die(mysql_error());
$resulta = mysql_fetch_row($result);
//$Y_Table_Position = $Y_Table_Position + 20;
$pdf->Cell(270, 5, '', 0, 1, 'C');
$pdf->SetY(-18);
$pdf->SetX(5);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(142, 5, 'Recommend Approval:', 1, 0, 'L');
$pdf->Cell(142, 5, 'Approved:', 1, 1, 'L');
$pdf->Cell(270, 5, '', 0, 1, 'C');
$pdf->Cell(270, 5, '', 0, 1, 'C');
$pdf->SetX(5);
$pdf->SetFont('Arial', 'BU', 10);
$pdf->Cell(142, 5, '', 1, 0, 'C');
$pdf->Cell(142, 5, $resulta[0], 1, 1, 'C');
$pdf->SetFont('Arial', 'B', 10);
$pdf->SetX(5);
$pdf->Cell(142, 5, '', 1, 0, 'C');
$pdf->Cell(142, 5, $resulta[2], 1, 0, 'C');
$pdf->Output();
コード例 #5
0
ファイル: pdf.php プロジェクト: KINOTO/apymeco
            }
        }
        $pdf->Output();
        break;
    case '5':
        $sliders = getSliders();
        $notes = getNotes();
        $pdf = new FPDF('L');
        $pdf->AddPage();
        $pdf->SetFont('Helvetica', '', 8);
        $gallery = getSliderGallery($sliders[1]->getIdSlider());
        if ($gallery) {
            $filename = generateRandomString();
            file_put_contents("_temp/" . $filename . getExtension($gallery[0]->getTypeImage()), $gallery[0]->getSliderImage());
            $pdf->Image("_temp/" . $filename . getExtension($gallery[0]->getTypeImage()), 25, 40);
        }
        $gallery = getSliderGallery($sliders[2]->getIdSlider());
        if ($gallery) {
            $filename = generateRandomString();
            file_put_contents("_temp/" . $filename . getExtension($gallery[0]->getTypeImage()), $gallery[0]->getSliderImage());
            $pdf->Image("_temp/" . $filename . getExtension($gallery[0]->getTypeImage()), 170, 40);
        }
        foreach ($notes as $note) {
            if ($note->getNote() === "C&aacute;lculo del Precio de un Rubro") {
                $pdf->SetY(170);
                $pdf->MultiCell(0, 5, $note->getNoteText());
            }
        }
        $pdf->Output();
        break;
}
コード例 #6
0
ファイル: reglage.php プロジェクト: astrolabb/aerogard3.2
function creation_rappels($liste_rappel2, $texte_rappel, $filename, $info_veto, $debut, $fin, $data_mot, $choix)
{
    $liste_rappel = json_decode($liste_rappel2, true);
    //$info_client = json_decode($info_client, true);
    if (!file_exists($filename)) {
        if (!mkdir($filename, 0755, true)) {
            die('Echec lors de la création des répertoires...');
        }
    }
    if ($choix == "A4") {
        $pdf = new FPDF('P', 'mm', 'A4');
    } elseif ($choix == "lettre") {
        $pdf = new FPDF('L', 'mm', array(200, 90));
    }
    while (list($key_rappel, $value_rappel) = each($liste_rappel)) {
        if ($choix == "lettre") {
            $pdf->AddPage();
            $pdf->SetFont('Times', '', 12);
            $pdf->SetXY(15, 20);
            $pdf->Cell(70, 0, requetemysql::gestion_string_maj($value_rappel['nom_a']), 0, 0, 'L');
            $pdf->SetXY(120, 40);
            $pdf->MultiCell(70, 7, requetemysql::gestion_string_maj($value_rappel['nom_p']) . ' ' . requetemysql::gestion_string_norm($value_rappel['prenom_p']) . "\n" . requetemysql::gestion_string_norm($value_rappel['adresse_p']) . "\n" . requetemysql::gestion_string_norm($value_rappel['code_p']) . ' ' . requetemysql::gestion_string_norm($value_rappel['ville_p']), 0, 'L');
            $pdf->SetXY(25, 50);
            $pdf->Cell(70, 0, requetemysql::gestion_string_maj($value_rappel['date_rappel']), 0, 0, 'L');
            $pdf->SetXY(20, 68);
            $pdf->Cell(75, 0, requetemysql::gestion_string_maj($info_veto[0]['nom']) . ' ' . requetemysql::gestion_string_norm($info_veto[0]['tel']), 0, 0, 'L');
        } elseif ($choix == "A4") {
            foreach ($texte_rappel as $key_texte => $value_texte) {
                if (strtolower($value_texte['nom']) == strtolower($value_rappel['type'])) {
                    $pdf->AddPage();
                    $pdf->SetFont('Times', '', 12);
                    $pdf->MultiCell(85, 5, requetemysql::gestion_string_maj($info_veto[0]['nom']) . "\n" . requetemysql::gestion_string_norm($info_veto[0]['adresse']) . "\n" . requetemysql::gestion_string_norm($info_veto[0]['code']) . ' ' . requetemysql::gestion_string_norm($info_veto[0]['commune']) . "\n" . requetemysql::gestion_string_norm($info_veto[0]['tel']), 0, 'L');
                    $pdf->Ln(15);
                    $pdf->Cell(90);
                    $pdf->MultiCell(85, 5, requetemysql::gestion_string_maj($value_rappel['nom_p']) . ' ' . requetemysql::gestion_string_norm($value_rappel['prenom_p']) . "\n" . requetemysql::gestion_string_norm($value_rappel['adresse_p']) . "\n" . requetemysql::gestion_string_norm($value_rappel['code_p']) . ' ' . requetemysql::gestion_string_norm($value_rappel['ville_p']), 0, 'C');
                    $pdf->Ln(25);
                    $date2 = $ligne['date'] / 1000;
                    $mon_texte = $value_texte['texte'];
                    $donnee_mot = array(requetemysql::gestion_string_norm($value_rappel['espece']), requetemysql::gestion_string_maj($value_rappel['nom_a']), requetemysql::gestion_string_maj($value_rappel['date_rappel']), requetemysql::gestion_string_maj($info_veto[0]['nom']));
                    $str = str_replace($data_mot, $donnee_mot, $mon_texte);
                    $pdf->MultiCell(0, 5, utf8_decode($str), 0, 'J');
                    $pdf->Ln(25);
                    if ($value_rappel['commentaire'] != '') {
                        $pdf->Cell(50, 20, utf8_decode("Commentaire :"), 'LTB', 0, false);
                        $pdf->MultiCell(0, 20, requetemysql::gestion_string_maj($value_rappel['commentaire']), 'TRB', 'L', false);
                        $pdf->Ln(10);
                    }
                    $pdf->Cell(90);
                    $pdf->MultiCell(85, 5, "Dr " . $_SESSION['login'], 0, 'C');
                    $pdf->SetY(-40);
                    $pdf->Cell(0, 10, utf8_decode('Pensez à prendre rendez-vous au ' . requetemysql::gestion_string_norm($info_veto[0]['tel']) . '. N\'oubliez pas le livret de santé.'), 0, 0, 'C');
                }
                // fermeture if $value_texte
            }
            //fermeture seconde boucle
        }
        //fermeture if choix A4
    }
    // fermeture premiere boucle
    $variable_lien = $filename . '/relance__' . $debut . '__' . $fin . '_' . uniqid() . '.pdf';
    $pdf->Output($variable_lien, F);
    return $variable_lien;
}
コード例 #7
0
    $cant = $can;
    $can = $can / 100 * $por;
    $can += $cant;
    return $can;
}
$pdf->SetFont('Arial', '', 8);
//establece el nombre del paciente
$pdf->SetXY(30, 5);
$pdf->Cell(0, 0, $paciente, 0, 0, L);
$pdf->SetX(1);
//numero de paciente
$pdf->Cell(0, 0, $_GET['numeroE'], 0, 0, R);
//cambiar fecha
//$myrow1['fecha1']=cambia_a_normal($myrow1['fecha1']);
$fecha1 = date("d/m/Y");
$pdf->SetY(10);
$pdf->Cell(0, 0, $fecha1, 0, 0, R);
//Imprimo con salto de pagina
$pdf->Ln(15);
//salto de linea
$pdf->SetFont('Arial', '', 8);
$pdf->SetXY(30, 7);
$pdf->Ln(15);
//salto de linea
$sSQL = "SELECT *\r\nFROM\r\ncargosCuentaPaciente\r\nWHERE \r\nnumeroE ='" . $_GET['numeroE'] . "' and nCuenta='" . $_GET['nCuenta'] . "' and\r\nnumeroConfirmacion='" . $_GET['numeroConfirmacion'] . "'\r\n\r\n\r\n ";
$result = mysql_db_query($basedatos, $sSQL);
while ($myrow = mysql_fetch_array($result)) {
    $codigoTT = $myrow['tipoTransaccion'];
    $pdf->Ln(1);
    //salto de linea
    $cant = $myrow61['cant'];
        } else {
            $sub = str_replace("<custas>", '', $sub);
        }
        $pdf->AddPage();
        $pdf->Image('../images/header.jpg', '0', '0', '19', '3,04', 'JPG');
        $pdf->SetFont('times', 'B', 12);
        $pdf->Cell(19.2, 2.5, 'NÃO EMITIMOS E NEM VENDEMOS CERTIDÕES E SIM PRAZOS E SOLUÇÕES', 0, 1, 'C');
        require 'gera_imoveis_busca_' . $id_impresso . '.php';
        $pdf->SetFont('times', '', 12);
        $pdf->Write(0.5, $sub, '');
        $pdf->Write(0.5, '

                        ', '');
        $pdf->SetFont('times', 'B', 10);
        $pdf->Line(1, 25.5, 20, 25.5);
        $pdf->SetY(25.5);
        $pdf->Cell(0, 0.5, $responsavel_empresa, 0, 1, 'C');
        $rodape = $responsavel_endereco . ',
' . $responsavel_cidade . '-' . $responsavel_estado . ' CEP: ' . $responsavel_cep;
        $pdf->Cell(0, 0.5, $rodape, 0, 1, 'C');
        $rodape = 'Tel/Fax: ' . $responsavel_tel . '/' . $responsavel_fax . '

E-mail:' . $responsavel_email;
        $pdf->Cell(0, 0.5, $rodape, 0, 1, 'C');
        $rodape = 'www.cartoriopostal.com.br';
        $pdf->Cell(0, 0.5, $rodape, 0, 1, 'C');
        if ($anexar == 'on' and ($id_servico == '11' or $id_servico == '169' or $id_servico == '170')) {
            $pdf->Close();
            //imprime a saida
            $anexoDAO = new AnexoDAO();
            $num_a = $anexoDAO->verifica('Declaração de Busca de Imóveis', $id_pedido_item);
コード例 #9
0
ファイル: report.php プロジェクト: 247rahimab/testrepo
    $code = $row['id'];
    $name = substr($row['company'], 0, 20);
    $real_price = $row['total'];
    $show = $row['total'];
    $c_code = $c_code . $code . "\n";
    $c_name = $c_name . $name . "\n";
    $c_price = $c_price . $show . "\n";
    //Sum all the Prices (TOTAL)
    $total = $total + $real_price;
}
mysql_close();
$total = $total;
//Create a new PDF file
$pdf = new FPDF();
$pdf->AddPage();
//Now show the 3 columns
$pdf->SetFont('Arial', '', 14);
$pdf->SetY(26);
$pdf->SetX(45);
$pdf->MultiCell(20, 6, $c_code, 1);
$pdf->SetY(26);
$pdf->SetX(65);
$pdf->MultiCell(100, 6, $c_name, 1);
$pdf->SetY(26);
$pdf->SetX(135);
$pdf->MultiCell(30, 6, $c_price, 1, 'R');
$pdf->SetX(135);
$pdf->MultiCell(30, 6, '$ ' . $total, 1, 'R');
$filename = "invoice.pdf";
$pdf->Output($filename, 'F');
echo '<a href="invoice.pdf">Download your Report</a>';
コード例 #10
0
 public function pdfcreateAction()
 {
     require "lib/fpdf/fpdf.php";
     //Page footer
     function Footer()
     {
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
     }
     $pdf = new FPDF();
     $pdf->AliasNbPages();
     $todate = date("D M j Y");
     $time = date(" G:i:s T");
     $storePhone = Mage::getStoreConfig('general/store_information/phone');
     $store_email = Mage::getStoreConfig('trans_email/ident_support/email');
     $freeSubTotal = Mage::getStoreConfig('carriers/freeshipping/free_shipping_subtotal');
     $session = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
     //print_r($session);die;
     $img_path = Mage::getBaseUrl() . 'skin/frontend/default/zoffio/images/logo_print.gif';
     $telephone = Mage::getBaseUrl() . 'skin/frontend/default/zoffio/images/telephone.png';
     $mail = Mage::getBaseUrl() . 'skin/frontend/default/zoffio/images/mail.png';
     $indianrupee = Mage::getBaseUrl() . 'skin/frontend/default/zoffio/images/rupee.png';
     $indian_rupee_symbol = Mage::getBaseUrl() . 'skin/frontend/default/zoffio/images/total.png';
     $indian_rupee = Mage::getBaseUrl() . 'skin/frontend/default/zoffio/images/savings.png';
     $sub_total = Mage::getBaseUrl() . 'skin/frontend/default/zoffio/images/sub-total1.png';
     $shipping = Mage::getBaseUrl() . 'skin/frontend/default/zoffio/images/shipping.png';
     $discount_image = Mage::getBaseUrl() . 'skin/frontend/default/zoffio/images/discount.png';
     $store_address = Mage::getStoreConfig('general/store_information/address');
     $split_store_address = explode(',', $store_address);
     $pdf->AddPage();
     $linestyle = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 10, 'color' => array(255, 0, 0));
     $pdf->Image($img_path, 10, 20, 31, 20, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false);
     $pdf->SetX(100);
     $pdf->SetY(25);
     $pdf->SetFont('arial', 'B', 13);
     $pdf->Cell(180, 0, 'Quotation', 2, 2, 'C');
     $pdf->Line(90, 27, 110, 27, $linestyle);
     $pdf->SetX(100);
     $pdf->SetY(25);
     $pdf->SetFont('arial', 'B', 11);
     $pdf->Cell(0, 0, $split_store_address[0], 0, 0, 'R');
     $pdf->SetFont('arial', '', 9);
     $pdf->Cell(0, 10, $split_store_address[1] . ',' . $split_store_address[2] . ',' . $split_store_address[3], 0, 0, 'R');
     $pdf->Cell(0, 20, $split_store_address[4] . ',' . $split_store_address[5], 0, 0, 'R');
     $pdf->Cell(0, 30, $split_store_address[6], 0, 0, 'R');
     $pdf->Line(10, 49, 200, 49, $linestyle);
     $pdf->SetX(20);
     $pdf->SetY(38);
     $pdf->SetFont('arial', 'B', 9);
     $pdf->Cell(0, 30, 'VAT/TIN :  ', 0, 0, 'L');
     $pdf->SetX(25);
     $pdf->SetFont('arial', '', 9);
     $pdf->Cell(0, 30, ' 29471119182', 0, 0, 'L');
     $pdf->SetX(85);
     $pdf->SetFont('arial', 'B', 9);
     $pdf->Cell(0, 30, 'CST No:  ', 0, 0, 'L');
     $pdf->SetX(98);
     $pdf->SetFont('arial', '', 9);
     $pdf->Cell(0, 30, ' 29471119182', 0, 0, 'L');
     $pdf->SetX(150);
     $pdf->SetFont('arial', 'B', 9);
     $pdf->Cell(0, 30, 'PAN No :  ', 0, 0, 'L');
     $pdf->SetX(164);
     $pdf->SetFont('arial', '', 9);
     $pdf->Cell(0, 30, ' AALCA1282E', 0, 0, 'L');
     $pdf->Line(10, 57, 200, 57, $linestyle);
     $pdf->Line(10, 72, 200, 72, $linestyle);
     $pdf->SetFont('arial', '', 9);
     $pdf->SetX(20);
     $pdf->SetY(45);
     $pdf->Cell(0, 35, 'QUOTATION DATE : ', 0, 0, 'L');
     $pdf->SetX(125);
     $pdf->Cell(0, 35, 'FOR ANY QUERIES : ', 0, 0, 'L');
     $pdf->SetFont('arial', 'B', 9);
     $pdf->SetX(20);
     $pdf->SetY(50);
     $pdf->Cell(0, 35, $todate . ', ' . $time, 0, 0, 'L');
     $pdf->SetX(127);
     $pdf->Image($telephone, 125, 66, 3, 3, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false);
     $pdf->Cell(0, 35, '+91-' . $storePhone, 0, 0, 'L');
     $pdf->Image($mail, 155, 66, 3, 3, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false);
     $pdf->SetX(157);
     $pdf->Cell(0, 35, ' : ' . $store_email, 0, 0, 'L');
     $pdf->SetX(21);
     $pdf->SetY(60);
     $pdf->SetFont('arial', '', 9);
     if (Mage::getSingleton('customer/session')->isLoggedIn()) {
         $customer = Mage::getSingleton('customer/session')->getCustomer();
         $firstname = $customer->getFirstname();
     } else {
         $firstname = 'Customer';
     }
     $pdf->SetFont('arial', '', 9);
     $pdf->Cell(0, 30, 'Dear ' . $firstname . ',', 0, 0, 'L');
     //$pdf->SetX(20);
     $pdf->SetY(80);
     $pdf->Cell(0, 1, 'Thank you for your interest in buying from us. Please find the below details of your selected products', 0, 0, 'L');
     $pdf->SetFont('arial', 'B', 8);
     //$pdf->SetX(10);
     $pdf->SetY(90);
     //$pdf->SetX(10);
     $pdf->Cell(7, 10, 'S.No', 1, 0, 'C');
     $pdf->Cell(100, 10, 'Products', 1, 0, 'L');
     $pdf->Cell(20, 10, 'SKU', 1, 0, 'C');
     $pdf->Cell(20, 10, 'Price', 1, 0, 'C');
     $pdf->Image($indianrupee, 152, 94, 3, 2, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false);
     $pdf->Image($indianrupee, 197, 94, 3, 2, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false);
     $pdf->Cell(10, 10, 'Qty', 1, 0, 'C');
     $pdf->Cell(15, 10, 'Tax (%)', 1, 0, 'C');
     $pdf->Cell(20, 10, 'Sub Total', 1, 1, 'L');
     $j = 1;
     foreach ($session as $item) {
         if (!$item->getParentItem()) {
             $i = 10;
             $pdf->SetFont('arial', '', 9);
             $product_name = wordwrap($item->getName(), 15, TRUE);
             $font_size = 14;
             $decrement_step = 0.1;
             $line_width = 100;
             while ($pdf->GetStringWidth($item->getName()) > 98) {
                 $pdf->SetFontSize($font_size -= $decrement_step);
             }
             $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $item->getSku());
             $item_total = ceil($item->getPriceInclTax()) * $item->getQty();
             $product_total = ceil($product->getPrice()) * $item->getQty();
             $pdf->SetX(10);
             $pdf->Cell(7, $i, $j, 1, 0, 'C');
             $pdf->Cell($line_width, 10, $item->getName(), 1, 0, 'L');
             //$pdf->Cell(50,$i,$product_name, 1,0,'C');
             $pdf->Cell(20, $i, $item->getSku(), 1, 0, 'C');
             $pdf->Cell(20, $i, number_format($item->getPriceInclTax(), 2), 1, 0, 'C');
             $pdf->Cell(10, $i, $item->getQty(), 1, 0, 'C');
             if ($product->getTypeId() == 'bundle') {
                 $pdf->Cell(15, $i, '-', 1, 0, 'C');
             } else {
                 $pdf->Cell(15, $i, number_format($item['tax_percent'], 1), 1, 0, 'C');
             }
             $pdf->Cell(20, $i, number_format($item->getPriceInclTax() * $item->getQty(), 2), 1, 1, 'C');
             $total = $total + $item->getPriceInclTax() * $item->getQty();
             $saving = $saving + $product_total;
             $j++;
         }
     }
     $totals1 = Mage::getSingleton('checkout/session')->getQuote()->getTotals();
     $subtotal = $totals1["subtotal"]->getValue();
     $grandtotal = $totals1["grand_total"]->getValue();
     if (isset($totals1['discount']) && $totals1['discount']->getValue()) {
         $discount = number_format($totals1['discount']->getValue(), 2);
         //Discount value if applied
     }
     // exit;
     if ($total > $freeSubTotal) {
         $shipping_rate = '0.00';
     } else {
         if ($total < $freeSubTotal) {
             $shipping_rate = Mage::getStoreConfig('carriers/flatrate/price');
             $shipping_rate = number_format($shipping_rate, 2);
             $totals = $grandtotal + $shipping_rate;
         }
     }
     $pdf->SetFont('arial', '', 10);
     $saving_amount = '  ' . $saving - $total;
     $customer_care = Mage::getStoreConfig('general/store_information/phone');
     $pdf->Cell(192, 10, $pdf->Image($sub_total, 150, $pdf->GetY() + 4, 27, 3, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false) . '   ' . number_format($total, 2), 1, 2, 'R');
     //$pdf->Cell(192,10,'Sub Total:'.number_format($total,2), 1,2,'R');
     $pdf->Cell(192, 10, $pdf->Image($shipping, 142, $pdf->GetY() + 4, 27, 3, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false) . '   ' . $shipping_rate, 1, 2, 'R');
     //$pdf->Cell(192,10,'Shipping & Handling:	'.$shipping_rate, 1,2,'R');
     if ($discount != NULL) {
         $pdf->Cell(192, 10, $pdf->Image($discount_image, 142, $pdf->GetY() + 4, 26, 2.5, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false) . '   ' . $discount, 1, 2, 'R');
         //$pdf->Cell(192,10,'Discount Amount:	'.$discount, 1,2,'R');
     }
     $pdf->SetFont('arial', 'B', 12);
     $pdf->Cell(96, 10, $pdf->Image($indian_rupee, 20, $pdf->GetY() + 3, 27, 4, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false) . '   ' . number_format($saving_amount, 2), 1, 0, 'C');
     if ($totals != NULL) {
         $pdf->Cell(96, 10, $pdf->Image($indian_rupee_symbol, 115, $pdf->GetY() + 3, 27, 4, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false) . '  ' . number_format($totals, 2), 1, 0, 'C');
     } else {
         $pdf->Cell(96, 10, $pdf->Image($indian_rupee_symbol, 115, $pdf->GetY() + 3, 27, 4, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false) . '  ' . number_format($grandtotal, 2), 1, 0, 'C');
     }
     $pdf->SetX(5);
     $statement1 = 'We would be happy to fulfill your order at the earliest.';
     $statement1_1 = ' Zoffio helps you save upto 60% on all your office needs and guarantees ';
     $statement1_2 = 'you the best quality original products';
     $statement2 = 'Complete your order today so as not to lose out of the savings!';
     $statement3 = 'You can also contact our customer care support team for more information.';
     $pdf->SetFont('arial', '', 9);
     $pdf->Cell(0, 45, $statement1, 0, 0, 'L');
     $pdf->SetFont('arial', '', 9);
     $pdf->SetX(80);
     $pdf->Cell(0, 45, $statement1_1, 0, 0, 'L');
     $pdf->SetFont('arial', '', 9);
     $pdf->SetX(5);
     $pdf->Cell(0, 55, $statement1_2, 0, 0, 'L');
     $pdf->SetFont('arial', '', 9);
     $pdf->SetX(5);
     $pdf->Cell(0, 70, $statement2, 0, 0, 'L');
     $pdf->SetX(5);
     $pdf->Cell(0, 80, $statement3 . '- +91- ' . $customer_care, 0, 0, 'L');
     $pdf->SetX(5);
     $pdf->Cell(0, 95, 'Best Wishes', 0, 0, 'L');
     $pdf->SetX(5);
     $pdf->Cell(0, 105, 'Zoffio Team', 0, 0, 'L');
     $pdf->SetTextColor(0, 8, 8);
     $pdf->SetFont('arial', '', 7);
     $pdf->SetY(-15);
     $pdf->Cell(0, -10, '(This quotation is generated from the website Zoffio.com in real time. As prices are dynamic, so please recheck the price before confirmation)', 0, 0, 'C');
     $pdf->Output('Zoffio-quotation.pdf', 'D');
 }
while ($rowInfo = mysql_fetch_array($resultInfo)) {
    $AgencyName = $rowInfo['content_agencyName'];
    $AgencyAddress = $rowInfo['content_agencyAddress'];
    $pdfAgencyName = $rowInfo['content_pdfagencyName'];
}
//while
$mysqli->query("INSERT INTO tbl_notification\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\tnotifId,\n\t\t\t\t\t\t\t\t\tclientId, \n\t\t\t\t\t\t\t\t\tnotifDesc, \n\t\t\t\t\t\t\t\t\tdateCreated,\n\t\t\t\t\t\t\t\t\tnotifStatus\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tVALUES \n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t'{$_SESSION['ses_partnerClientID']}',\n\t\t\t\t\t\t\t\t\t'Partnership was successfully done.',\n\t\t\t\t\t\t\t\t\tnow(),\n\t\t\t\t\t\t\t\t\t'new'\n\t\t\t\t\t\t\t\t)");
$pdf = new FPDF('p', 'mm', array(215.9, 330.2));
$pdf->AddPage();
$pdf->AddFont('BarcodeFont', '', 'BarcodeFont.php');
$pdf->AddFont('Calibri', '', 'Calibri.php');
$pdf->AddFont('Calibri Bold', '', 'Calibri Bold.php');
$pdf->SetAutoPageBreak(true, 5);
$pdf->SetFont('Calibri', '', 11);
$pdf->SetTextColor(141, 141, 141);
$pdf->SetY(5);
$pdf->SetX(150);
$pdf->Cell(56, 6, 'Powered By: Getchs;', 0, 0, 'R', FALSE);
$pdf->SetFont('Calibri Bold', '', 11);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetY(5);
$pdf->SetX(17);
$pdf->Cell(56, 6, $pdfAgencyName, 0, 0, 'L', FALSE);
$pdf->SetFont('Calibri', '', 23);
$pdf->SetY(19);
$pdf->SetX(80);
$pdf->Cell(56, 6, 'Partnership Agreement', 0, 0, 'C', FALSE);
$pdf->SetFont('Calibri', '', 11);
$pdf->SetY(23);
$pdf->SetX(23);
$pdf->Cell(16, 23, 'THIS PARTNERSHIP AGREEMENT is made this                   day of       ,          , by and between the', 0, 1, 'L', FALSE);
コード例 #12
0
 $pdf->SetFont("Times", "B", 8);
 $pdf->Cell(10, 5, "No", "TB", 0, 'C');
 $pdf->Cell(120, 5, "Item", "TB", 0, 'L');
 //$pdf->Cell(40,5,"Payment Method","TB",0,'C');
 $pdf->Cell(0, 5, "Amount ({$currency_code})", "TB", 1, 'R');
 $query2 = $xoopsDB->query($sql);
 $pdf->SetFont("Times", "", 9);
 $i = 0;
 $m = 0;
 //$maxy=0;
 $maxy = 70;
 while ($row = $xoopsDB->fetchArray($query2)) {
     $i++;
     $m++;
     //$chequeno=$row['chequeno'];
     $pdf->SetY($maxy + 2);
     $subject = $row['subject'];
     $amt = $row['amt'];
     $account_type = $row['account_type'];
     $linedesc = $row['linedesc'];
     if ($account_type == 4) {
         $paymentmethodtext = "Cheque :";
     } else {
         $paymentmethodtext = "Cash";
     }
     if ($m > 13) {
         $m = 1;
         $pdf->AddPage($pdf->CurOrientation);
     }
     $pdf->SetX($xmargin);
     $pdf->Cell(10, 4, $i, 0, 0, 'C');
コード例 #13
0
$pdf->Open();
// disable oto page break
$pdf->SetAutoPageBreak(false);
$pdf->AddPage();
$y_axis_initial = 5;
$y_axis1 = 5;
$data = mysql_query("SELECT * from tblmhs where nim='{$_GET['id']}'");
$i = 0;
$max = 25;
$row_height = 5;
$row = mysql_fetch_array($data);
$tgl_lahir = explode("-", $row['tanggal']);
$pdf->SetDrawColor(50, 0, 0, 0);
$pdf->SetFillColor(300, 0);
$pdf->SetFont('Arial', 'B', 10);
$pdf->SetY($y_axis1);
//$pdf->SetX(25);
$pdf->Rect(9.75, 4.0, 90, 62, 'D');
$pdf->Line(9.65, 17.5, 99.5, 17.5);
$pdf->Rect(105, 4.0, 90, 62, 'D');
$pdf->Cell(89, 6, 'KARTU TANDA MASUK GEDUNG', 0, 0, 'C', 1);
$pdf->Cell(6.5);
$pdf->Cell(89, 6, 'PERHATIAN', 0, 0, 'C', 0);
$pdf->Ln();
$pdf->Cell(89, 6, 'TELKOMSEL', 0, 0, 'C', 1);
$pdf->Cell(6.5);
$pdf->Cell(89, 6, ' ', 0, 0, 'C', 0);
//$pdf->Line(100, 4, 100, 83);
$pdf->Ln();
$pdf->Ln();
$pdf->SetFont('Arial', '', 10);
コード例 #14
0
ファイル: supplier_pdf.php プロジェクト: sunny36/grecocos
 function __construct($products, $order, $filename, $save = false)
 {
     App::import('vendor', 'fpdf/fpdf');
     $orientation = 'P';
     $unit = 'pt';
     $format = 'A4';
     $margin = 40;
     $pdf = new FPDF($orientation, $unit, $format);
     App::import('Helper', 'Time');
     $timeHelper = new TimeHelper();
     setlocale(LC_MONETARY, 'th_TH');
     $pdf->AddPage();
     $pdf->SetTopMargin($margin);
     $pdf->SetLeftMargin($margin);
     $pdf->SetRightMargin($margin);
     $pdf->SetAutoPageBreak(true, $margin);
     $pdf->SetY($pdf->GetY() + 60);
     $pdf->SetFont('Arial', 'B', 10);
     $pdf->SetTextColor(0);
     $pdf->SetFillColor(255);
     $pdf->SetLineWidth(1);
     $pdf->Cell(50, 25, "Order ID: ", 'LT', 0, 'L');
     $pdf->SetFont('Arial', '');
     $pdf->Cell(50, 25, $order['Order']['id'], 'T', 0, 'L');
     $pdf->SetFont('Arial', 'B');
     $pdf->Cell(100, 25, 'Customer Name: ', 'T', 0, 'L');
     $pdf->SetFont('Arial', '');
     $pdf->Cell(316, 25, $order['User']['name'], 'TR', 1, 'L');
     $pdf->SetFont('Arial', 'B');
     $pdf->Cell(100, 25, "Delivery Date: ", 'LT', 0, 'L');
     $pdf->SetFont('Arial', '');
     $pdf->Cell(416, 25, $timeHelper->format($format = 'd-m-Y', $order['Delivery']['date']), 'TR', 1, 'L');
     $pdf->SetFont('Arial', 'B', '10');
     $current_y = $pdf->GetY();
     $current_x = $pdf->GetX();
     $cell_width = 30;
     $pdf->MultiCell($cell_width, 25, "No.\n ", 'LTR', 'C');
     $pdf->SetXY($current_x + $cell_width, $current_y);
     $pdf->Cell(250, 25, "Description", 'LTR', 0, 'C');
     $current_y = $pdf->GetY();
     $current_x = $pdf->GetX();
     $cell_width = 48;
     $pdf->MultiCell($cell_width, 25, "Number Ordered", 'LTR', 'C');
     $pdf->SetXY($current_x + $cell_width, $current_y);
     $current_y = $pdf->GetY();
     $current_x = $pdf->GetX();
     $cell_width = 48;
     $pdf->MultiCell($cell_width, 25, "Number Supplied", 'LTR', 'C');
     $pdf->SetXY($current_x + $cell_width, $current_y);
     $current_y = $pdf->GetY();
     $current_x = $pdf->GetX();
     $cell_width = 70;
     $pdf->MultiCell($cell_width, 25, "Amount per Unit", 'LTR', 'C');
     $pdf->SetXY($current_x + $cell_width, $current_y);
     $current_y = $pdf->GetY();
     $current_x = $pdf->GetX();
     $cell_width = 70;
     $pdf->MultiCell($cell_width, 25, "Amount\n ", 'LTR', 'C');
     $pdf->SetY($pdf->GetY() - 25);
     $pdf->SetFont('Arial', '');
     $pdf->SetFillColor(238);
     $pdf->SetLineWidth(0.2);
     $pdf->SetY($pdf->GetY() + 25);
     $num = 1;
     $number_ordered = 0;
     $number_supplied = 0;
     foreach ($products as $product) {
         $pdf->Cell(30, 20, $num++, 1, 0, 'L');
         $pdf->Cell(250, 20, $product['Product']['short_description'], 1, 0, 'L');
         $pdf->Cell(48, 20, $product['LineItem']['quantity'], 1, 0, 'R');
         $number_ordered += $product['LineItem']['quantity'];
         $pdf->Cell(48, 20, $product['LineItem']['quantity_supplied'], 1, 0, 'R');
         $number_supplied += $product['LineItem']['quantity_supplied'];
         $pdf->Cell(70, 20, money_format("%i", $product['Product']['selling_price']), 1, 0, 'R');
         $pdf->Cell(70, 20, money_format("%i", $product['LineItem']['total_price_supplied']), 1, 1, 'R');
     }
     $pdf->SetX($pdf->GetX() + 30);
     $pdf->SetFont('Arial', 'B');
     $pdf->Cell(250, 20, "TOTALS", 1);
     $pdf->SetFont('Arial', '');
     $pdf->Cell(48, 20, $number_ordered, 1, 0, 'R');
     $pdf->Cell(48, 20, $number_supplied, 1, 0, 'R');
     $pdf->Cell(70, 20, "N.A.", 1, 0, 'R');
     $pdf->Cell(70, 20, money_format("%i", $order['Order']['total_supplied']), 1, 1, 'R');
     $pdf->SetY($pdf->GetY() + 25);
     $pdf->SetFont('Arial', 'B');
     $pdf->Cell(80, 20, "Amount Paid: ");
     $pdf->SetFont('Arial', '');
     $pdf->Cell(80, 20, money_format("%i", $order['Order']['total']), 0, 1);
     $pdf->SetFont('Arial', 'B');
     $pdf->Cell(80, 20, "Actual Amount: ");
     $pdf->SetFont('Arial', '');
     $pdf->Cell(80, 20, money_format("%i", $order['Order']['total_supplied']), 0, 1);
     $pdf->SetFont('Arial', 'B');
     $pdf->Cell(80, 20, "Rebate Amount: ");
     $pdf->SetFont('Arial', '');
     $pdf->Cell(80, 20, money_format("%i", $order['Order']['total'] - $order['Order']['total_supplied']), 0, 1);
     if ($save) {
         $pdf->Output($filename, 'F');
     } else {
         $pdf->Output($filename, 'I');
     }
 }
コード例 #15
0
$owner_id = $getd[0];
$business_id = $getd[1];
$stat = $getd[2];
$linebus = mysql_query("select * from tempbusnature where owner_id={$owner_id} and\r\n\t\t\tbusiness_id={$business_id} and active=1") or die(mysql_error());
$number_of_rows = mysql_numrows($linebus);
$i = 1;
//$pdf->SetY($Y_Table_Position);
while ($busline = mysql_fetch_row($linebus)) {
    $pdf->SetX(5);
    $pdf->Cell(120, 5, $busline[2], 1, 0, 'L');
    $pdf->SetX(125);
    $pdf->Cell(40, 5, $busline[3], 1, 0, 'R');
    $pdf->SetX(165);
    $pdf->Cell(40, 5, $busline[4], 1, 0, 'R');
    $i++;
    $pdf->SetY($pdf->GetY() + 5);
}
$pdf->Cell(200, 5, '', 0, 2, 'C');
$pdf->SetX(5);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(120, 5, 'TAXES AND FEES:', 1, 0, 'L');
$pdf->Cell(40, 5, 'PERIOD COVERED:', 1, 0, 'C');
$pdf->Cell(40, 5, 'AMOUNT:', 1, 1, 'C');
$gettax = mysql_query("select a.compval, b.tfodesc, c.payment_part, c.ts\r\n\t\t\t\t\t from tempassess a, ebpls_buss_tfo b, ebpls_transaction_payment_or_details c\r\n\t\t\t\t\t where a.tfoid = b.tfoid and a.owner_id = {$owner_id} and a.business_id={$business_id}\r\n\t\t\t\t\t and a.owner_id=c.trans_id and a.business_id=c.payment_id and a.transaction=c.transaction\r\n\t\t\t\t\t and a.active=1");
$i = 1;
//$pdf->SetY($Y_Table_Position);
while ($busline = mysql_fetch_row($gettax)) {
    $periodico = $busline[2];
    //dito ka maglagay ng code kung gagawin mong descriptive un payment mode, ok!?!?!?!
    if ($paymentmode == 'annual') {
        $paymentmode = 'One Year';
require "fpdf.php";
// Begin configuration
$textColour = array(0, 0, 0);
$headerColour = array(0, 0, 0);
$reportName = "ENDORSEMENT SLIP";
// End configuration
/**
  Create the title page
**/
$pdf = new FPDF('p', 'mm', 'A4');
$pdf->AddPage();
$pdf->AddFont('BarcodeFont', '', 'BarcodeFont.php');
$pdf->AddFont('Calibri', '', 'Calibri.php');
$pdf->AddFont('Calibri Bold', '', 'Calibri Bold.php');
$pdf->SetFont('Calibri Bold', '', 14);
$pdf->SetY(5);
$pdf->SetX(10.5);
$pdf->Cell(189.5, 155, '', 1, 0, 'L', FALSE);
$pdf->SetFont('Calibri Bold', '', 12);
$pdf->SetY(8);
$pdf->SetX(14);
$pdf->Cell(56, 6, $pdfAgencyName, 0, 0, 'L', FALSE);
$pdf->SetY(6);
$pdf->SetX(14);
$pdf->SetFont('Calibri', '', 11);
$pdf->SetTextColor(144, 141, 141);
$pdf->Cell(10, 20, 'Powered by getchs;', 0, 0, 'L', FALSE);
$pdf->SetFont('Calibri', '', 13);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetY(14);
$pdf->SetX(9.5);
$resultInfo = mysql_query("SELECT content_agencyName ,content_agencyAddress, content_pdfagencyName FROM tbl_content WHERE contentId = 1\n\t\t\t\t\t\t\t\t");
while ($rowInfo = mysql_fetch_array($resultInfo)) {
    $AgencyName = $rowInfo['content_agencyName'];
    $AgencyAddress = $rowInfo['content_agencyAddress'];
    $pdfAgencyName = $rowInfo['content_pdfagencyName'];
}
//while
$pdf = new FPDF('p', 'mm', 'A4');
$pdf->AddPage();
$pdf->AddFont('BarcodeFont', '', 'BarcodeFont.php');
$pdf->AddFont('Calibri', '', 'Calibri.php');
$pdf->AddFont('Calibri Bold', '', 'Calibri Bold.php');
$pdf->SetFont('Calibri Bold', '', 11);
$pdf->SetX(16);
$pdf->Cell(56, 6, $pdfAgencyName, 0, 0, 'L', FALSE);
$pdf->SetY(9);
$pdf->SetX(16);
$pdf->SetFont('Calibri', '', 11);
$pdf->SetTextColor(144, 141, 141);
$pdf->Cell(10, 20, 'Powered by getchs;', 0, 0, 'L', FALSE);
$pdf->SetY(18);
$pdf->SetX(148);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('BarcodeFont', '', 54);
$pdf->Cell(108, 25, $appfinal, 0, 'R', FALSE);
$pdf->SetY(30);
$pdf->SetX(16);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('Calibri Bold', '', 24);
$pdf->Cell(56, 6, "Applicant's Copy", 0, 0, 'L', FALSE);
$pdf->SetY(34);
コード例 #18
0
ファイル: facture.php プロジェクト: Ophois/webforce3
$pdf->Text(20, 85, 'N° de client : '.$tCommande[0]['idClient']);

// Infos du client calées à droite
$pdf->Text(120, 50, $tClient['nomClient'].' '.$tClient['prenomClient']);
$pdf->Text(120, 55, $tClient['adresseClient']);
$pdf->Text(120, 60, $tClient['cpClient'].' '.$tClient['villeClient']);

// Infos date
$pdf->Text(120, 80, 'Buire, le '.date("d-m-Y", strtotime($tCommande[0]['dateFacture'])));

/* --- Tableau détail commande --- */
// en-tête
$pdf->SetDrawColor(183); // couleur du fond
$pdf->SetFillColor(221); // couleur des filets
$pdf->SetTextColor(0); // couleur du texte
$pdf->SetY(100);
$pdf->SetX(20);
$pdf->Cell(80, 10, 'Description du produit', 1, 0, 'L', 1);
$pdf->SetX(100);
$pdf->Cell(20, 10, 'Quantité', 1, 0, 'C', 1);
$pdf->SetX(120);
$pdf->Cell(35, 10, 'Prix unitaire HT', 1, 0, 'C', 1);
$pdf->SetX(155);
$pdf->Cell(30, 10, 'Montant HT', 1, 0, 'C', 1);
$pdf->Ln(); // retour à la ligne

// détail commande
$positionLigne = 110;
$totalHT = 0;

foreach ($tDetailCommande as $detailCommande) {
コード例 #19
0
<?php

include_once '../fpdf153/fpdf.php';
include_once '../seguridad.php';
if ($_SESSION["autentificado"] == "admin") {
    include_once '../seguridad_admin.php';
} else {
    include_once '../seguridad_usu.php';
}
include_once '../conectaBD.php';
$correo = $_SESSION["usuario"];
$id = $_REQUEST['id'];
$jornada_id = $_SESSION['jornada_id'];
$usuario = ejecutaConsulta("Select * from usuarios where id='{$id}' AND jornada_id = {$jornada_id};");
$idioma = pg_result($usuario, 0, 'idioma');
$nombre = html_entity_decode(pg_result($usuario, 0, 'nombre'));
$ape1 = html_entity_decode(pg_result($usuario, 0, 'ape1'));
$linea = utf8_decode(ucwords(strtolower(trim($nombre . " " . $ape1))));
$pdf = new FPDF(L, cm, A4);
$pdf->AddPage();
$pdf->Image('../img/certificados/certificado_6_' . $idioma . '.jpg', 0, 0, 29.7, 21);
$pdf->SetFont('Arial', 'B', 30);
$pdf->SetY(0.8);
$pdf->MultiCell(27.7, 16, $linea, 0, C);
$pdf->Output('certificado-2as-jornada-Argentinas-gvSIG-2012.pdf', I);
コード例 #20
0
     }
     $pdf->Output();
     break;
 case 'ver_detalle':
     // Creamos el PDF
     //Creación del objeto de la clase heredada
     $pdf = new FPDF();
     $pdf->AliasNbPages();
     //Primera página
     $pdf->AddPage();
     $id_ticket = $_GET['id_ticket'];
     // Imagen  de encabezado
     $pdf->Image("./images/banner4.jpg", 10, 0, 180, 40, "JPG", "");
     // Titulo del Reporte
     $pdf->SetFont('Arial', 'B', 20);
     $pdf->SetY(45);
     $pdf->Cell(50, 10, 'Detalle del Ticket No. ' . $id_ticket);
     // Configuracion de colores
     $pdf->SetY(60);
     $pdf->SetFillColor(224, 235, 255);
     $pdf->SetTextColor(0);
     $pdf->SetDrawColor(128, 0, 0);
     $pdf->SetLineWidth(0.3);
     $pdf->SetFont('', 'B');
     if ($result = $obj_modelo->GetDetalleTicket($id_ticket)) {
         if ($obj_conexion->GetNumberRows($result) > 0) {
             // Establecemos la cabecera de la tabla
             $pdf->SetFont('Arial', 'B', 10);
             $pdf->SetTextColor(128, 0, 0);
             $pdf->Cell(20, 7, 'Numero', 1, 0, 'C', true);
             $pdf->Cell(40, 7, 'Sorteo', 1, 0, 'C', true);
コード例 #21
0
$lbr2 = 80;
$pdf = new FPDF();
$pdf->SetTitle("Kartu Ujian Seleksi Masuk");
$cardheight = 98;
$countToThree = 3;
$s = "select PMBID, Nama, Alamat, RuangID, Pilihan1, Pilihan2 from `pmb` where Pilihan1 = '{$prodi}' and PMBPeriodID='{$gelombang}' and (RuangID like '_%' or RuangID is not NULL)";
$r = _query($s);
$n = _num_rows($r);
while ($w = _fetch_array($r)) {
    if ($countToThree == 3) {
        $countToThree = 0;
        $pdf->AddPage('P', 'A4');
    }
    $currentheight = $cardheight * $countToThree;
    $pdf->SetFont('Helvetica', 'B', 9);
    $pdf->SetY($currentheight + 28);
    $pdf->Cell($lbr1, 9, "KARTU UJIAN SELEKSI MASUK", 0, 0, 'C');
    $pdf->Cell($lbr2, 9, "JADWAL UJIAN SELEKSI MASUK", 0, 1, 'C');
    $pdf->Ln(9);
    // Tampilkan datanya
    HeaderLogo($currentheight, $pdf);
    AmbilKartu($w['PMBID'], $w['Nama'], $w['Alamat'], $w['Kota'], $w['Pilihan1'], $w['Pilihan2'], 37 + $currentheight, $pdf);
    AmbilJadwal($w['RuangID'], $w['Pilihan1'], $gelombang, 37 + $currentheight, $pdf);
    $pdf->SetY($currentheight + $cardheight);
    if ($countToThree != 2) {
        $pdf->Cell(190, 0, "", 1, 1);
    }
    $countToThree++;
}
$pdf->Output();
// *** Functions ***
コード例 #22
0
}
//Create new pdf file
$pdf = new FPDF();
//Open file
//$pdf->Open();
//Disable automatic page break
$pdf->SetAutoPageBreak(false);
//Add first page
$pdf->AddPage();
//set initial y axis position per page
$y_axis_initial = 25;
$y_axis = 31;
//print column titles for the actual page
$pdf->SetFillColor(232, 232, 232);
$pdf->SetFont('TIMES', 'B', 12);
$pdf->SetY($y_axis_initial);
$pdf->SetX(25);
$pdf->Cell(50, 6, 'Intitule', 1, 0, 'L', 1);
$pdf->Cell(30, 6, 'Quantite', 1, 0, 'C', 1);
$pdf->Cell(80, 6, 'Description', 1, 0, 'R', 1);
if (!isset($row_height)) {
    $row_height = 0;
}
$y_axis = $y_axis + $row_height;
//Select the Products you want to show in your PDF file
$mail = $_SESSION['Email'];
if ($mail == "") {
    $mail = "*****@*****.**";
}
$sqlquery = "SELECT Intitule, Quantite, Description FROM Fourniture WHERE IDClasse = (SELECT IDClasse from Eleve WHERE Mail='{$mail}' )";
//echo($sqlquery);
コード例 #23
0
ファイル: denda.php プロジェクト: edisetiawan/revisi_ta
     $pdf->SetFont('Arial', 'B', 13);
     $pdf->Cell(80);
     $pdf->Cell(30, 10, '', 0, 0, 'C');
     $pdf->Ln();
     $pdf->Cell(80);
     $pdf->Cell(30, 10, 'LAPORAN DENDA', 0, 0, 'C');
     $pdf->Ln();
 }
 //Fields Name position
 $Y_Fields_Name_position = 30;
 //First create each Field Name
 //Gray color filling each Field Name box
 $pdf->SetFillColor(204, 153, 0);
 //Bold Font for Field Name
 $pdf->SetFont('Arial', 'B', 8);
 $pdf->SetY($Y_Fields_Name_position);
 $pdf->SetX(5);
 //1  -->5 sebelah kiri
 $pdf->Cell(21, 8, 'ID Anggota', 1, 0, 'C', 1);
 $pdf->SetX(26);
 //2     40  //geser lebar
 $pdf->Cell(45, 8, 'Judul', 1, 0, 'C', 1);
 //geser judul
 $pdf->SetX(69);
 //3
 $pdf->Cell(30, 8, 'Tanggal Pinjam', 1, 0, 'C', 1);
 $pdf->SetX(98);
 //4
 $pdf->Cell(32, 8, 'Tanggal harus kembali', 1, 0, 'C', 1);
 $pdf->SetX(130);
 //5
コード例 #24
0
ファイル: pdf-motor-permit.php プロジェクト: laiello/ebpls
    					$column_code7 = $column_code7.$row7."\n";
    					$column_code8 = $column_code8.$row8."\n";
    					$column_code9 = $column_code9.$row9."\n";
    					$column_code10 = $column_code10.$row10."\n";
    					$column_code11 = $column_code11.$row11."\n";
    					
					}  */
$pdf->SetLineWidth(2);
$pdf->Line(0, 45, 360, 45);
$pdf->SetLineWidth(0);
$pdf->Cell(270, 5, '', 0, 1, 'C');
$pdf->Cell(270, 5, '', 0, 1, 'C');
$Y_Label_position = 50;
$Y_Table_Position = 55;
$pdf->SetFont('Arial', 'B', 8);
$pdf->SetY($Y_Label_position);
$pdf->SetX(5);
$pdf->Cell(15, 5, 'AMOUNT PAID', 1, 0, 'C');
$pdf->SetX(20);
$pdf->Cell(50, 5, 'DATE', 1, 0, 'C');
$pdf->SetX(70);
$pdf->Cell(50, 5, 'O.R. NUMBER', 1, 0, 'C');
$pdf->SetX(120);
$pdf->Cell(30, 5, 'STICKER NUMBER', 1, 0, 'C');
$pdf->SetX(150);
$pdf->Cell(60, 5, 'PERMIT NUMBRT', 1, 0, 'C');
$pdf->SetX(210);
$pdf->Cell(30, 5, 'CHASSIS NUMBER', 1, 0, 'C');
$pdf->SetX(240);
$pdf->Cell(30, 5, 'MOTOR NUMBER', 1, 0, 'C');
$pdf->SetX(270);
コード例 #25
0
require_once './pdf/fpdf.php';
// neues PDF-Dokument erzeugen
$pdf = new FPDF('P', 'mm', 'A4');
// ... entspricht dem Aufruf von
$pdf->AliasNbPages('{nb}');
// Automatischen Seitenumbruch deaktivieren
$pdf->SetAutoPageBreak(false);
// Seitenabstand definieren
$pdf->SetMargins(25, 15, 15);
// ******************************************************** SEITE ******************************************************** //
// Seite hinzufügen
$pdf->AddPage();
// Logo auf erster Seite einfügen
$pdf->Image('./img/acb_logo_gross.jpg', 95, 10, 25);
// Position auf der X- und Y-Achse
$pdf->SetY(40);
// Schriftart festlegen
$pdf->SetFont('Times', 'BU', 14);
$pdf->Cell(160, 7, utf8_decode('Telefonnummern der Flugleiter/-innen, Aero-Club Butzbach e.V.'), 0, 1, 'C');
// Schriftart festlegen
$pdf->SetFont('Times', '', 11);
$pdf->Cell(160, 5, sprintf(utf8_decode('Stand: %s %d'), utf8_decode($_monate[date('n')]), date('Y')), 0, 1, 'C');
// Position auf der X- und Y-Achse
$pdf->SetXY(20, 280);
// Schriftart und -farbe ändern
$pdf->SetTextColor(128, 128, 128);
$pdf->SetFont('Times', '', 8);
// Ausgabe des Fusszeilentext
$pdf->Cell(0, 10, 'Seite ' . $pdf->PageNo() . ' von {nb}', 0, 0, 'C');
// Position auf der X- und Y-Achse
$x = 20;
コード例 #26
0
$pdf->Cell(40, 5, "Mata Pelajaran", 1, 0, 'C', true);
$pdf->Cell(20, 5, "Kelas", 1, 0, 'C', true);
$pdf->Cell(30, 5, "Nilai Akhir", 1, 0, 'C', true);
$pdf->Cell(30, 5, "Predikat (NA)", 1, 0, 'C', true);
$pdf->SetFillColor(255, 255, 255);
$pdf->SetTextColor(0, 0, 0);
//membuat halaman
$no = 1;
//fungsi mengatur dan posisi table x dan y
$pdf->SetXY(15, 65);
//membuat baris tabel
while (list($kd_mapel, $mapel, $kelas, $nilai) = mysql_fetch_row($hasilnya2)) {
    $pdf->Cell(10, 5, $no, 1, 0, 'C');
    $pdf->Cell(40, 5, $kd_mapel, 1, 0, 'C');
    $pdf->Cell(40, 5, $mapel, 1, 0, 'C');
    $pdf->Cell(20, 5, $kelas, 1, 0, 'C');
    $pdf->Cell(30, 5, $nilai, 1, 0, 'C');
    $pdf->Cell(30, 5, $nilai, 1, 0, 'C');
    $y = 65 + 5 * $no;
    $no++;
    $pdf->SetXY(15, $y);
}
//fungsi show halaman
$pdf->SetY(-15);
//buat garis horizontal
$pdf->Line(7, $pdf->GetY(), 200, $pdf->GetY());
//Arial italic 9
$pdf->SetFont('Arial', 'I', 7);
//nomor halaman
$pdf->Cell(0, -10, 'Halaman ' . $pdf->PageNo() . ' dari {nb}', 0, 0, 'R');
$pdf->Output();
コード例 #27
0
<?php

//header('Content-disposition: attachment; filename='.$solicitud.'.pdf');
//header('Content-type: application/pdf');
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 10);
$url = base_url();
$INC_DIR = $url . "img/";
$pdf->Image($INC_DIR . 'logo.png', 10, 6, 40);
//$pdf->Image('img/logo.png',10,6,40);
$pdf->SetFont('Arial', 'B', 15);
$pdf->Cell(80);
$pdf->Cell(30, 8, "Gracias por preferirnos", 0, 0, 'C');
$pdf->SetY(35);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(189, 8, utf8_decode('De acuerdo a su solicitud, a continuación le presentamos su propuesta.'), 0, 1, 'L');
$pdf->Ln(3);
$pdf->Cell(189, 8, utf8_decode('Propuesto asegurado: ' . $nombre), 1, 1, 'L');
$pdf->Cell(189, 8, utf8_decode('Teléfono: ' . $telefono), 1, 1, 'L');
$pdf->Cell(189, 8, utf8_decode('Celular: ' . $celular), 1, 1, 'L');
$pdf->Cell(189, 8, utf8_decode('Correo Electrónico: ' . $email), 1, 1, 'L');
$pdf->Cell(189, 8, utf8_decode('Cédula: ' . $cedula), 1, 1, 'L');
$pdf->Ln(3);
$pdf->Cell(189, 8, utf8_decode("Compañía de seguros: " . $company . ""), 1, 1, 'L');
$pdf->Ln(5);
$pdf->SetTextColor(255, 0, 0);
$pdf->Cell(59, 5, utf8_decode("Cotización No.: " . $solicitud . ""), 1, 0, 'C');
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(65, 5, utf8_decode('Ramo: AUTO'), 1, 0, 'C');
$pdf->Cell(65, 5, utf8_decode("Fecha: " . $fecha_solicitud . ""), 1, 1, 'C');
コード例 #28
0
ファイル: ebpls_activity_log1.php プロジェクト: laiello/ebpls
$pdf->SetFont('Arial', 'BU', 8);
$pdf->Cell(300, 5, 'ACTIVITY LOG', 0, 1, 'C');
$pdf->SetLineWidth(2);
$pdf->Line(0, 45, 360, 45);
$pdf->SetLineWidth(0);
$pdf->Cell(270, 5, '', 0, 1, 'C');
$pdf->Cell(270, 5, '', 0, 1, 'C');
$pdf->SetLineWidth(2);
$pdf->Line(0, 45, 360, 45);
$pdf->SetLineWidth(0);
//$pdf->Cell(270,5,'',0,1,'C');
//$pdf->Cell(270,5,'',0,1,'C');
$Y_Label_Position = 50;
$Y_Table_Position = 55;
$pdf->SetFont('Arial', 'B', 6);
$pdf->SetY($Y_Label_Position);
$pdf->SetX(5);
$pdf->Cell(10, 5, 'USER ID', 1, 0, 'C');
$pdf->SetX(15);
$pdf->Cell(30, 5, 'USER LEVEL', 1, 0, 'C');
$pdf->SetX(45);
$pdf->Cell(20, 5, 'USERNAME', 1, 0, 'C');
$pdf->SetX(65);
$pdf->Cell(20, 5, 'REMOTE IP', 1, 0, 'C');
$pdf->SetX(85);
$pdf->Cell(25, 5, 'DATE UPDATED', 1, 0, 'C');
$pdf->SetX(110);
$pdf->Cell(180, 5, 'QUERY STRING', 1, 1, 'C');
$date_from = str_replace("/", "", $date_from);
$idate = strtotime($date_from);
$idate = $idate - 60 * 60 * 24;
コード例 #29
0
ファイル: make_certificate.php プロジェクト: Vitosh/PHP
    $pdf->SetLineWidth(0.05);
    $pdf->SetTextColor(255, 255, 255);
    $wb = $w;
    $pdf->Cell(25, 5, $w, "LR", 0, "C", 1);
    $pdf->Cell(25.1, 5, $wb * 11, "LR", 0, "C", 1);
    $pdf->Cell(25.2, 5, $wb * 13, "LR", 0, "C", 1);
    $pdf->Cell(25.3, 5, $wb * 17, "LR", 0, "C", 1);
    $pdf->Cell(25.4, 5, $wb * 19, "LR", 0, "C", 1);
    $pdf->Cell(25.5, 5, $wb * 23, "LR", 0, "C", 1);
    $pdf->Cell(25.6, 5, $wb * 31, "LR", 0, "C", 1);
    $pdf->Ln();
}
$pdf->Ln();
$pdf->Ln();
$pdf->SetFillColor(160, 20, 123);
$pdf->SetTextColor(1, 300, 1);
$pdf->Write(10, "Go to VitoshAcademy", "http://www.vitoshacademy.com");
$pdf->Ln();
$pdf->SetFillColor(123, 440, 120);
$pdf->SetTextColor(100, 0, 0);
$pdf->Write(10, "More PHP here", "http://www.vitoshacademy.com/?s=php&submit=Go");
$pdf->SetY(-40);
$pdf->Cell(0, 10, "Anything is possible. In any color.", "T", "1", "C");
$pdf->Output("certificate.pdf");
echo "Your certificate is generated!";
?>

</body>
</html>

コード例 #30
-1
 public function pdfcreateAction()
 {
     require "fpdf/fpdf.php";
     $order_id = $_GET['order_id'];
     $img_path = $_GET['img_path'];
     $count = $_GET['count'];
     $customer_email = $_GET['customer_email'];
     $customer = Mage::getModel("customer/customer");
     $customer->setWebsiteId(Mage::app()->getWebsite()->getId());
     $customer->loadByEmail($customer_email);
     $orderId = Mage::getModel('sales/order')->loadByIncrementId($order_id)->getEntityId();
     $order = Mage::getModel('sales/order')->load($orderId);
     $billing_address = $order->getBillingAddress();
     //print_r($billing_address->getData());
     $model = Mage::getModel('rcredit/rcredit');
     $order_details = $model->orderhistory($customer_email, $count);
     $customer_info = $model->customercycledetails($customer_email);
     //print_r($customer_info);
     $date = new DateTime($customer_info[pay_date]);
     $pay_date = $date->format('d-m-Y');
     $pdf = new FPDF();
     $pdf->AddPage();
     $linestyle = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 10, 'color' => array(255, 0, 0));
     $pdf->SetFont('Times', '', 11);
     $pdf->Cell(200, 10, 'Corporate Credit Statement', 2, 2, 'C');
     $pdf->SetFont('Times', 'B', 8);
     $pdf->Line(150, 17, 180, 17, $linestyle);
     $pdf->SetX(350);
     $pdf->SetY(13);
     $pdf->Cell(310, 5, 'Customer Billing Address', 2, 2, 'C');
     $pdf->SetFont('Times', '', 8);
     $pdf->SetX(150);
     $pdf->Cell(342, 5, $billing_address[firstname] . '.' . $billing_address[lastname], 2, 2, 'L');
     $pdf->Cell(342, 6, $billing_address[street], 2, 2, 'L');
     $pdf->Cell(342, 7, $billing_address[city] . '.' . $billing_address[country_id] . '-' . $billing_address[postcode], 2, 2, 'L');
     $pdf->Image($img_path, 10, 10, 31, 20, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false);
     $pdf->SetY(20);
     $pdf->SetFont('Times', '', 8);
     $pdf->Line(5, 35, 200, 35, $linestyle);
     // Company Account Numbers
     $pdf->SetX(20);
     $pdf->SetY(28);
     $pdf->SetFont('Times', 'B', 8);
     $pdf->Cell(0, 20, 'VAT/TIN :  ', 0, 0, 'L');
     $pdf->SetX(25);
     $pdf->SetFont('Times', '', 8);
     $pdf->Cell(0, 20, ' 29471119182', 0, 0, 'L');
     $pdf->SetX(85);
     $pdf->SetFont('Times', 'B', 8);
     $pdf->Cell(0, 20, 'CST No:  ', 0, 0, 'L');
     $pdf->SetX(98);
     $pdf->SetFont('Times', '', 8);
     $pdf->Cell(0, 20, ' 29471119182', 0, 0, 'L');
     $pdf->SetX(150);
     $pdf->SetFont('Times', 'B', 8);
     $pdf->Cell(0, 20, 'CIN No :  ', 0, 0, 'L');
     $pdf->SetX(164);
     $pdf->SetFont('Times', '', 8);
     $pdf->Cell(0, 20, ' U52100KA2012PTC066880', 0, 0, 'L');
     $pdf->Line(5, 40, 200, 40, $linestyle);
     //End of company account numbers
     // Starting of customer details
     $pdf->SetX(20);
     $pdf->SetY(33);
     $pdf->SetFont('Times', 'B', 8);
     $pdf->Cell(0, 20, 'Email :  ', 0, 0, 'L');
     $pdf->SetX(25);
     $pdf->SetFont('Times', '', 8);
     $pdf->Cell(0, 20, $customer_email, 0, 0, 'L');
     $pdf->SetX(85);
     $pdf->SetFont('Times', 'B', 8);
     $pdf->Cell(0, 20, 'Company Name:  ', 0, 0, 'L');
     $pdf->SetX(110);
     $pdf->SetFont('Times', '', 8);
     $pdf->Cell(0, 20, $customer_info[company_name], 0, 0, 'L');
     //$pdf->SetX(150);
     //$pdf->SetFont('Times','B',8);
     //$pdf->Cell(0,20,'Account Manager :  ', 0,0,'L');
     //$pdf->SetX(164);
     //$pdf->SetFont('Times','',8);
     //$pdf->Cell(0,20,' AASDV846SV654V', 0,0,'L');
     $pdf->Line(5, 45, 200, 45, $linestyle);
     //End of customer details
     // Starting of customer details
     $pdf->SetX(20);
     $pdf->SetY(38);
     $pdf->SetFont('Times', 'B', 8);
     $pdf->Cell(0, 20, 'Payment Due Date :  ', 0, 0, 'L');
     $pdf->SetX(35);
     $pdf->SetFont('Times', '', 8);
     $pdf->Cell(0, 20, $pay_date, 0, 0, 'L');
     $pdf->SetX(85);
     $pdf->SetFont('Times', 'B', 8);
     $pdf->Cell(0, 20, 'Availed Credit:  ', 0, 0, 'L');
     $pdf->SetX(110);
     $pdf->SetFont('Times', '', 8);
     $pdf->Cell(0, 20, 'Rs ' . $customer_info[utlized_amt] . '/-', 0, 0, 'L');
     $pdf->Line(5, 50, 200, 50, $linestyle);
     //End of customer details
     $pdf->SetX(30);
     $pdf->SetFont('Times', '', 8);
     $pdf->Cell(0, 30, 'Dear ' . $firstname . ',', 0, 0, 'L');
     //$pdf->SetX(20);
     $pdf->SetY(55);
     $pdf->Cell(0, 1, 'Thank you for your interest in buying from us. Please find the below details of your selected products', 0, 0, 'L');
     $i = 10;
     $pdf->SetFont('Times', '', 6);
     $pdf->SetX(5);
     $pdf->SetY(65);
     $pdf->Cell(15, 10, 'Order ID', 1, 0, 'C');
     $pdf->Cell(20, 10, 'Order Date', 1, 0, 'C');
     $pdf->Cell(20, 10, 'Order Amount', 1, 0, 'C');
     $pdf->Cell(20, 10, 'Credit Availed', 1, 0, 'C');
     $pdf->Cell(20, 10, 'Order Status', 1, 0, 'C');
     $pdf->Cell(20, 10, 'Delivery Date', 1, 0, 'C');
     $pdf->Cell(25, 10, 'Payment Status', 1, 0, 'C');
     $pdf->Cell(20, 10, 'Payment Date', 1, 0, 'C');
     $pdf->Cell(30, 10, 'Payment Details', 1, 0, 'C');
     //$pdf->SetX(20);
     $pdf->SetX(5);
     $pdf->SetY(75);
     $pdf->SetX(20);
     foreach ($order_details as $details) {
         $order_date = explode(" ", $details['order_date']);
         $i = $i + 1;
         $pdf->SetX(10);
         $pdf->Cell(15, $i, $details['order_id'], 1, 0, 'C');
         $pdf->Cell(20, $i, $order_date[0], 1, 0, 'C');
         $pdf->Cell(20, $i, $details['order_value'], 1, 0, 'C');
         $pdf->Cell(20, $i, $details['utlized_amt'], 1, 0, 'C');
         $pdf->Cell(20, $i, $details['action'], 1, 0, 'C');
         $pdf->Cell(20, $i, $details['order_complete_date'], 1, 0, 'C');
         $pdf->Cell(25, $i, $details['pay_status'], 1, 0, 'C');
         $pdf->Cell(20, $i, $details['paid_date'], 1, 0, 'C');
         $pdf->Cell(30, $i, $details['trans_details'], 1, 1, 'C');
         //$pdf->SetX(20);
     }
     $pdf->SetFont('Times', 'B', 8);
     $pdf->SetX(80);
     $pdf->Cell(100, 20, 'Total : Rs.' . $details['utlized_amt'] . '/-', 0, 0, 'R');
     $pdf->Output('Shopper Credit Invoice.pdf', 'D');
 }