コード例 #1
0
<?php

$total = $_POST['total'];
$name = $_POST['NameChild'];
$date = $_POST['DateChild'];
$t = time();
$day = date("Y-m-d", $t);
$pdfname = $name . $day . ".txt";
$pdf = new PDF_HTML();
$pdf->AliasNbPages();
$pdf->SetAutoPageBreak(true, 20);
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 20);
$pdf->WriteHTML('<para><h1>PATIENT HEALTH QUESTIONAIRE: PHQ-A <em><br><br>(adolescent 2-17 years old)</em></h1><br></para>');
$pdf->SetFont('Arial', '', 18);
$htmlTable1 = '
<TABLE>
<TR>
<br>
<br>
<TD>Name:' . $_POST['NameChild'] . '<br><br></TD>
<TD>Date:' . $_POST['DateChild'] . '<br><br><br><br></TD>
</TR>
</TABLE>
<br>
<pre>
<br>
1.Feeling down or depressed or hopeless-' . $_POST['Q1'] . '<br><br>
2.Little interest or pleasure in doing things-' . $_POST['Q2'] . '<br><br>
3. Trouble falling or staying asleep, or sleeping too much-' . $_POST['Q3'] . '<br><br>
4. Feeling tired or having little energy-' . $_POST['Q4'] . '<br><br>
コード例 #2
0
<?php

require 'WriteHTML.php';
$pdf = new PDF_HTML();
$pdf->AliasNbPages();
$pdf->SetAutoPageBreak(true, 15);
$pdf->AddPage();
$pdf->Image('logo.png', 18, 13, 33);
$pdf->SetFont('Arial', 'B', 14);
$pdf->WriteHTML('<para><h1>PHPGang Programming Blog, Tutorials, jQuery, Ajax, PHP, MySQL and Demos</h1><br>
Website: <u>www.phpgang.com</u></para><br><br>How to Convert HTML to PDF with fpdf example');
$pdf->SetFont('Arial', 'B', 7);
$htmlTable = '<TABLE>
<TR>
<TD>Name:</TD>
<TD>' . $_POST['name'] . '</TD>
</TR>
<TR>
<TD>Email:</TD>
<TD>' . $_POST['email'] . '</TD>
</TR>
<TR>
<TD>URl:</TD>
<TD>' . $_POST['url'] . '</TD>
</TR>
<TR>
<TD>Comment:</TD>
<TD>' . $_POST['comment'] . '</TD>
</TR>
</TABLE>';
$pdf->WriteHTML2("<br><br><br>{$htmlTable}");
コード例 #3
0
function crear_certificado($parametros)
{
    $pdf = new PDF_HTML('L', 'mm', 'Letter', 20, 7);
    $pdf->AddPage();
    $pdf->SetlineWidth(0.264583333);
    $pdf->setDrawColor(74, 112, 139);
    $pdf->Rect(17.018, 4.318, $pdf->w - 17.018 - 17.018, $pdf->h - 4.318 - 4.318);
    $pdf->SetFont('Arial', '', 12);
    // IMAGENES
    // QR
    $url = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" . "status_chofer.php";
    $qrFile = generarQR($url);
    $pdf->Image($qrFile, 18, 8, 0, 30, 'PNG');
    unlink($qrFile);
    $pdf->Image(__DIR__ . '/../img/logo2.png', 235, 8, 0, 30);
    $pdf->Image(__DIR__ . '/../img/logo.png', 105, 8, 0, 30);
    $pdf->Ln(15);
    // TITULO
    $title = '<p align="center"><b><u>CERTIFICADO DE CAPACITACIÓN PARA EL TRANSPORTE DE MERCANCÍAS PELIGROSAS</u></b></p>';
    $pdf->WriteHTML(utf8_decode($title));
    // BLOQUE 1
    $htmlprev = <<<'EOD'
El Prestador de Servicios de Formación Profesional para la Capacitación Básica y Complementaria Obligatoria de los Conductores de Vehículos Empleados
en el Transporte de Mercancías Peligrosas por Carretera, <b>#PRESTADOR</b>, certifica que el/la <b>#CHOFER</b>, Matricula <b>#MATRICULA</b>, DNI <b>#DNI</b>,
ha participado y completado el curso de Capacitación <b>#CURSO</b> según Resolución S.T N° 110/1997 modificada por Resolución S.T. N° 65/2000 para
los Conductores de los Vehículos antes mencionados.
EOD;
    $holders = ["#PRESTADOR", "#CHOFER", "#MATRICULA", "#DNI", "#CURSO"];
    $variables = [utf8_decode($parametros['prestador']), utf8_decode($parametros['chofer']), utf8_decode($parametros['matricula']), utf8_decode($parametros['dni']), utf8_decode($parametros['curso'])];
    $html = str_replace($holders, $variables, utf8_decode($htmlprev));
    $pdf->WriteHTML($html);
    $pdf->Ln(20);
    // BLOQUE 2
    $html = <<<'EOD'
Se expide el presente Certificado, a los efectos de la obtención de la Licencia Nacional habilitante.
La vigencia del mismo es de UN (1) año a partir de la fecha de realización del Curso de Capacitación.
EOD;
    $pdf->WriteHTML(utf8_decode($html));
    $pdf->Ln(20);
    // FECHAS
    $texto = 'Sede del Curso: ';
    $pdf->Cell(50, 5, utf8_decode($texto), 0, 0, 'L');
    $pdf->setFont('Arial', 'B', 12);
    $pdf->Cell(100, 5, utf8_decode($parametros['sede']), 0, 0, 'L');
    $pdf->setFont('Arial', '', 12);
    $texto = 'Fecha del Curso: ';
    $pdf->Cell(10, 5, '', 0, 0, 'L');
    $pdf->Cell(0, 5, $texto, 0, 0, 'L');
    $pdf->setFont('Arial', 'B', 12);
    $pdf->Cell(0, 5, utf8_decode($parametros['fecha_curso']), 0, 1, 'R');
    $pdf->setFont('Arial', '', 12);
    $pdf->Ln(5);
    $texto = 'Numero de Transacción: ';
    $pdf->Cell(50, 5, utf8_decode($texto), 0, 0, 'L');
    $pdf->setFont('Arial', 'B', 12);
    $pdf->Cell(100, 5, utf8_decode($parametros['transaccion']), 0, 0, 'L');
    $pdf->setFont('Arial', '', 12);
    $texto = 'Fecha de Transacción: ';
    $pdf->Cell(10, 5, '', 0, 0, 'L');
    $pdf->Cell(0, 5, utf8_decode($texto), 0, 0, 'L');
    $pdf->setFont('Arial', 'B', 12);
    $pdf->Cell(0, 5, utf8_decode($parametros['fecha_transaccion']), 0, 1, 'R');
    $pdf->setFont('Arial', '', 12);
    $pdf->Ln(45);
    return $pdf;
}
コード例 #4
0
 $selecionados = substr($selecionados, 0, strlen($selecionados) - 2);
 $a_usuarios = $o_usuario->busca("id IN({$selecionados})", "perfis, nome");
 if ($a_usuarios) {
     $modelo = "{$caminho}/../certificado/" . TEMPLATE_CERTIFICADO;
     foreach ($a_usuarios as $usuario) {
         $nome = $usuario->nome;
         $email = $usuario->email;
         $perfis_usuario = $usuario->perfis;
         $tema_palestra = $usuario->tema_palestra;
         foreach ($a_perfis as $perfil) {
             if (strstr($perfis_usuario, $perfil)) {
                 require_once "{$caminho}/../certificado/lib/write_html.php";
                 $nome_arquivo = "Certificado " . NOME_EVENTO . " {$perfil} " . Funcoes::remove_acentos(utf8_encode($nome)) . ".pdf";
                 $nome_arquivo = strtolower(str_replace(" ", "_", $nome_arquivo));
                 $arquivo_destino = "{$caminho}/../temp/{$nome_arquivo}";
                 $pdf = new PDF_HTML();
                 $pdf->AddPage('L');
                 $pdf->setSourceFile($modelo);
                 $tplIdx = $pdf->importPage(1);
                 $pdf->useTemplate($tplIdx);
                 $palestra = $perfil == "palestrante" ? ', com o tema "' . utf8_encode($tema_palestra) . '"' : "";
                 $nome_convertido = utf8_encode($nome);
                 $titulo = "CERTIFICADO";
                 $corpo = utf8_decode("Certificamos que <b>{$nome_convertido}</b> participou do evento " . NOME_EVENTO . ", realizado " . PERIODO_EVENTO . ", " . LOCAL_EVENTO . ", com carga horária de " . CARGA_HORARIA_EVENTO . " horas, na qualidade de <b>{$perfil}</b>{$palestra}.");
                 // Titulo
                 $pdf->SetFont('Arial', 'B', 32);
                 $pdf->SetTextColor(35, 142, 35);
                 //Verde Floresta
                 $pdf->SetXY(110, 35);
                 $pdf->Write(0, $titulo);
                 // Corpo do texto
コード例 #5
0
ファイル: actionpdf.php プロジェクト: projukti/ORLIV
require "connection.php";
$state_name = $_REQUEST['state_name'];
$branch_code = $_REQUEST['branch_name'];
$fetch_branch = mysql_fetch_array(mysql_query("select * from audit_branch where branch_code='{$branch_code}'"));
$fetch_state = mysql_fetch_array(mysql_query("select * from audit_states where id='" . $fetch_branch['state_id'] . "'"));
$sql = "select * from audit_physical_stock_info where branch_code='{$branch_code}' limit 1";
$result = mysql_query($sql);
$total_result = mysql_num_rows($result);
if ($total_result > 0) {
    $result_arr = mysql_fetch_array($result, MYSQL_ASSOC);
    $audt_code = $result_arr['audt_code'];
    $entry_date = $result_arr['entry_date'];
}
$entry_date = date_create($entry_date);
$entry_date = date_format($entry_date, 'd-m-Y');
$pdf = new PDF_HTML();
$pdf->AliasNbPages();
$pdf->SetAutoPageBreak(true, 15);
$pdf->AddPage();
//$pdf->Image('logo.png',18,13,33);
$pdf->SetFont('Arial', 'B', 14);
//$pdf->WriteHTML('');
$pdf->SetFont('Arial', 'B', 7);
$htmlTable = '
<TABLE>
<TR>
	<TD>Audit Code</TD>
	<TD>Assets Type</TD>
	<TD width="200">Classification</TD>
	<TD>Book Quantity</TD>
	<TD>Available Qunatity</TD>
コード例 #6
0
ファイル: ex.php プロジェクト: rohmad-st/fpdf
<?php

require 'WriteHTML.php';
$pdf = new PDF_HTML();
$pdf->AddPage();
$pdf->SetFont('Arial');
$pdf->WriteHTML('You can<br><p align="center">center a line</p>and add a horizontal rule:<br><hr>');
$pdf->Output();
コード例 #7
0
ファイル: ex.php プロジェクト: nanpeixoto/cide
<?php

require ('WriteHTML.php');

$pdf = new PDF_HTML ();
$pdf->AddPage ();
$pdf->SetFont ( 'Arial' );

$html1 = 'Default <font face="courier">Courier <font face="helvetica">Helvetica <font face="times">Times <font face="dejavusans">dejavusans </font>Times </font>Helvetica </font>Courier </font>Default';
$html2 = '<small>small text</small> normal <small>small text</small> normal <sub>subscript</sub> normal <sup>superscript</sup> normal';
$html3 = "<font size='10' color='#ff7f50'>The</font> <font size='10' color='#6495ed'>quick</font> <font size='14' color='#dc143c'>brown</font> <font size='18' color='#008000'>fox</font> <font size='22'><a href='http://www.tcpdf.org'>jumps</a></font> <font size='22' color='#a0522d'>over</font> <font size='18' color='#da70d6'>the</font> <font size='14' color='#9400d3'>lazy</font> <font size='10' color='#4169el'>dog</font>.";

$html = $html1 . '<br>' . $html2 . '<br>' . $html3 . '<br>' . $html3 . '<br>' . $html2;

// output the HTML content
$pdf->writeHTML ( $html, true, false, true, false, '' );
$pdf->Output ( 'materia-PDF.pdf', 'I' );
?>
コード例 #8
0
ファイル: rapport_tache.inc.php プロジェクト: bouchra012/PMB
$marge_page_gauche = ${$var};
// la marge droite des pages
$var = "pdflettreresa_marge_page_droite";
$marge_page_droite = ${$var};
// la largeur des pages
$var = "pdflettreresa_largeur_page";
$largeur_page = ${$var};
// la hauteur des pages
$var = "pdflettreresa_hauteur_page";
$hauteur_page = ${$var};
// le format des pages
$var = "pdflettreresa_format_page";
$format_page = ${$var};
$taille_doc = array($largeur_page, $hauteur_page);
//$ourPDF = new $fpdf($format_page, 'mm', $taille_doc);
$ourPDF = new PDF_HTML();
$ourPDF->Open();
switch ($pdfdoc) {
    case "rapport_tache":
        $query_chk = "select id_tache from taches where id_tache=" . $task_id;
        $res_chk = mysql_query($query_chk, $dbh);
        if (mysql_num_rows($res_chk) == '1') {
            //date de génération du rapport
            $rs = mysql_query("select curdate()");
            $date_MySQL = mysql_result($rs, $row);
            $tasks = new taches();
            foreach ($tasks->types_taches as $type_tache) {
                if ($type_tache->id_type == $type_task_id) {
                    require_once $base_path . "/admin/planificateur/" . $type_tache->name . "/" . $type_tache->name . ".class.php";
                    eval("\$conn=new " . $type_tache->name . "(\"" . $base_path . "/admin/planificateur/" . $type_tache->name . "\");");
                    $task_datas = $conn->get_report_datas($task_id);
コード例 #9
0
ファイル: index.php プロジェクト: jaimeirazabal1/rtf
function leerdoc($documento)
{
    //require('fpdf/fpdf.php');
    require_once 'rtf2html.php';
    require_once 'aux_pdf.php';
    $reader = new RtfReader();
    $rtf = file_get_contents("{$documento}");
    // or use a string
    $reader->Parse($rtf);
    $formatter = new RtfHtml();
    $pdf = new PDF_HTML();
    $pdf->SetFont('Arial', '', 12);
    $pdf->AddPage();
    $text = $formatter->Format($reader->root);
    if (ini_get('magic_quotes_gpc') == '1') {
        $text = stripslashes($text);
    }
    $pdf->WriteHTML($text);
    $pdf->Output();
    exit;
}
コード例 #10
0
require '../func/connect.php';
require 'fpdf/html2pdf.php';
//getting the items info
$sql = "SELECT * from sale natural join product natural join cart";
$res = $conn->query($sql);
$current_date = date('Y/m/d');
//getting the customer info
$sql_customer = "SELECT * from sale natural join cart";
$res_customer = $conn->query($sql_customer);
$row_customer = $res_customer->fetch_assoc();
$customer_name = $row_customer['customer_name'];
$customer_phone = $row_customer['customer_phone'];
//generating pdf file
//$pdf = new FPDF();
$pdf = new PDF_HTML();
$pdf->AddPage();
$pdf->SetFillColor(0, 102, 0);
////// logo
$size = "60";
$absx = (210 - $size) / 2;
$pdf->Image('../image/hello_cash.jpg', $absx, 5, $size);
///
$pdf->SetFont('Arial', 'B', 10);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(0, 10, '', 0, 1);
$pdf->Cell(0, 10, '', 0, 1);
// empty space
$pdf->Cell(0, 5, '', 0, 1);
$pdf->Cell(0, 10, 'Shop No. 441, Orchard Point, Mirpur Road, Dhanmondi-7, Dhaka.', 0, 1, "C");
$pdf->Cell(0, 0, 'Cell: +8801977677776, +8801717050090', 0, 1, "C");
コード例 #11
0
     //   $titre2=requetemysql::gestion_string_norm("Siret: ".requetemysql::gestion_string_norm($info_veto[0]['siret'])." N° TVA :".requetemysql::gestion_string_norm($info_veto[0]['num_tva']));
     //   $w=$pdf->GetStringWidth(stripslashes($titre2))+6;
     //  $pdf->SetX((210-$w)/2);
     //  $pdf->Cell($w,2,$titre2,0,1,'C',false);
     $pdf->Output('../sauvegarde/animaux/' . $_POST['animal_id'] . '/euthanasie_' . $variable . '.pdf', F);
     echo json_encode($variable);
 } elseif ($_GET['action'] == 'autre_certif') {
     $filename = '../sauvegarde/animaux/' . $_POST['animal_id'];
     $variable = round(microtime(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...');
         }
     }
     $pdf = new PDF_HTML();
     $pdf->AddPage();
     $pdf->SetFont('Times', '', 12);
     $pdf->WriteHTML(utf8_decode(stripslashes($_POST['message'])));
     $pdf->Output('../sauvegarde/animaux/' . $_POST['animal_id'] . '/certificat_' . $variable . '.pdf', F);
     echo json_encode($variable);
 } elseif ($_GET['action'] == 'drop_client_animal') {
     $info_client = $_POST['client'];
     $sql = " CREATE TEMPORARY TABLE tmptable_1 SELECT * FROM client WHERE id2 = :clien_id;\r\n\tUPDATE tmptable_1 SET id2 = NULL, permission2=:permission;\t\r\n\tINSERT INTO client SELECT * FROM tmptable_1;\r\n\tDROP TEMPORARY TABLE IF EXISTS tmptable_1;";
     $st2 = $db->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
     $st2->execute(array(':clien_id' => $info_client[0]['id2'], ':permission' => $_SESSION['login']));
     $st2->closeCursor();
     $sql = " CREATE TEMPORARY TABLE tmptable_2 SELECT * FROM animal WHERE id = :animal_id;\r\n\tUPDATE tmptable_2 SET id = NULL, permission=:permission ;\t\r\n\tINSERT INTO animal SELECT * FROM tmptable_2;\r\n\tDROP TEMPORARY TABLE IF EXISTS tmptable_2;";
     $st2 = $db->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
     $st2->execute(array(':animal_id' => $_POST['animal_id'], ':permission' => $_SESSION['login']));
     $st2->closeCursor();
コード例 #12
0
ファイル: ex.php プロジェクト: rohmad-st/fpdf
<?php

require 'html2pdf.php';
if (isset($_POST['text'])) {
    $pdf = new PDF_HTML();
    $pdf->SetFont('Arial', '', 12);
    $pdf->AddPage();
    $text = $_POST['text'];
    if (ini_get('magic_quotes_gpc') == '1') {
        $text = stripslashes($text);
    }
    $pdf->WriteHTML($text);
    $pdf->Output();
    exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>HTML2PDF</title>
<style type="text/css">
input, textarea {
	font-family: lucida console;
	font-size: 9pt;
	border: 1px solid #B0B0B0;
}
body {
	font-family: lucida console;
	font-size: 9pt;
	background-color: #F0F0F0;
}
コード例 #13
0
ファイル: pmbesDSI.class.php プロジェクト: bouchra012/PMB
 function exportBannette($id_bannette)
 {
     global $msg, $PMBusername;
     global $ourPDF;
     if (SESSrights & DSI_AUTH) {
         if (!$id_bannette) {
             throw new Exception("Missing parameter: id_bannette");
         }
         $bannette = new bannette($id_bannette);
         //		$action_diff_aff .= "<strong>".$msg['dsi_dif_export'].": ".$bannette->nom_bannette."</strong><br />" ;
         //		$ourPDF = $bannette->construit_contenu_PDF();
         $resultat_html = $bannette->construit_contenu_HTML();
         $ourPDF = new PDF_HTML();
         $ourPDF->AddPage();
         $ourPDF->SetFont('Arial');
         $ourPDF->WriteHTML($resultat_html);
         return $ourPDF;
     } else {
         return sprintf($msg["planificateur_rights_bad_user_rights"], $PMBusername);
     }
 }
コード例 #14
0
ファイル: teste.php プロジェクト: kailIII/certificados-1
 require 'fpdf/WriteHTML.php';
 $participanteAr = explode("\n", $_POST['participantes']);
 //Cria uma array com cada participante
 $i = 0;
 foreach ($participanteAr as $p) {
     if (strlen($p) <= 1) {
         unset($participanteAr[$i]);
         //Remove do array cada participante sem nome
     }
     $i++;
 }
 $participanteAr = array_values($participanteAr);
 //Reorganiza a array
 $textoPrincipal = $_POST['texto'];
 str_replace(array("{evento}", "{departamento}"), array($_POST['evento'], $_POST['departamento']), $textoPrincipal);
 $pdf = new PDF_HTML('L', 'mm');
 foreach ($participanteAr as $participante) {
     $pdf->AddPage();
     $pdf->SetLeftMargin(110);
     $pdf->SetRightMargin(20);
     $pdf->SetFont('Arial', '', 14);
     $pdf->SetXY(0, 0);
     $pdf->SetFillColor(200, 220, 255);
     $pdf->Rect(0, 0, 90, 210, 'F');
     //Borda esquerda com simbolos da PROCEV - REMOVER DEPOIS
     $pdf->SetFillColor(195, 195, 195);
     $pdf->Rect(90, 0, 207, 50, 'F');
     //Texto superior - REMOVER DEPOIS
     $pdf->SetFillColor(195, 195, 195);
     $pdf->Rect(90, 160, 207, 50, 'F');
     //Texto inferior - REMOVER DEPOIS