示例#1
3
 public function generarFolleto()
 {
     $concursos = $this->concursoMapper->findConcurso("pinchosOurense");
     $establecimientos = $this->establecimientoMapper->findAllValidados();
     $pinchos = $this->pincho->all();
     $pdf = new FPDF();
     $pdf->AddPage();
     $pdf->SetFont('Arial', 'B', 30);
     $pdf->SetTextColor(85, 53, 20);
     $pos_y = 10;
     $pdf->Cell(0, 24, $concursos->getNombre(), 0, 0, "L");
     $pdf->Ln();
     $pdf->SetFont('Arial', '', 16);
     $pdf->SetTextColor(0, 0, 0);
     $pdf->MultiCell(0, 6, $concursos->getDescripcionConcurso(), 0, "L");
     $pdf->SetTextColor(85, 53, 20);
     $pdf->SetFont('Arial', 'B', 13);
     $pdf->Cell(0, 24, "Establecimientos participantes", 0, 0, "L");
     foreach ($establecimientos as $establecimiento) {
         $pdf->Ln();
         $pdf->SetFont('Arial', 'B', 13);
         $pdf->SetTextColor(85, 53, 20);
         $pdf->SetFillColor(182, 145, 107);
         $pdf->Cell(0, 10, utf8_decode($establecimiento->getNombre()), 1, 0, "C", "false");
         $pdf->Ln();
         $pdf->SetFont('Arial', 'I', 13);
         $pdf->SetTextColor(0, 0, 0);
         $pdf->Cell(0, 10, utf8_decode($establecimiento->getDescripcion()), 0, 0, "L");
         $pdf->Ln();
         $pdf->Cell(0, 10, utf8_decode($establecimiento->getLocalizacion()), 0, 0, "L");
         $pdf->Ln();
         $pdf->Cell(0, 10, utf8_decode("Pincho:"), 0, 0, "L");
         foreach ($pinchos as $pincho) {
             if ($pincho->getEstablecimiento() == $establecimiento->getId()) {
                 $pdf->Ln();
                 $pdf->Cell(5);
                 $pdf->Cell(0, 10, utf8_decode($pincho->getNombre()), 0, 0, "L");
                 $pdf->Ln();
                 $pdf->Cell(5);
                 $pdf->Cell(0, 10, utf8_decode($pincho->getDescripcion()), 0, 0, "L");
                 $pdf->Ln();
                 $pdf->Cell(5);
                 if ($pincho->isCeliaco()) {
                     $pdf->Cell(0, 10, utf8_decode("Apto para celiaco"), 0, 0, "L");
                 } else {
                     $pdf->Cell(0, 10, utf8_decode("No apto para celiaco"), 0, 0, "L");
                 }
             }
         }
         $pdf->Ln(5);
     }
     $pdf->Output("folleto.pdf", "D");
 }
示例#2
2
 private function generate_pdf($srcText, $dest)
 {
     // Set some document variables
     $author = "";
     $x = 50;
     $text = "<<<EOT" . $srcText . "EOT";
     // Create fpdf object
     $pdf = new FPDF('P', 'pt', 'Letter');
     // Set base font to start
     $pdf->SetFont('Times', 'B', 24);
     // Add a new page to the document
     $pdf->addPage();
     // Set the x,y coordinates of the cursor
     $pdf->SetXY($x, 50);
     // Write 'Simple PDF' with a line height of 1 at the current position
     $pdf->Write(25, 'Simple PDF');
     // Reset the font
     $pdf->SetFont('Courier', 'I', 10);
     // Set the font color
     $pdf->SetTextColor(255, 0, 0);
     // Reset the cursor, write again.
     $pdf->SetXY($x, 75);
     $pdf->Cell(0, 11, "By: {$author}", 'B', 2, 'L', false);
     // Place an image on the pdf document
     //$pdf->Image('graph.jpg', $x, 100, 150, 112.5, 'JPG');
     // Reset font, color, and coordinates
     $pdf->SetFont('Arial', '', 12);
     $pdf->SetTextColor(0, 0, 0);
     $pdf->SetXY($x, 250);
     // Write out a long text blurb.
     $pdf->write(13, $srcText);
     //        echo "<pre>";
     //        print_r($pdf);exit;
     $fileName = substr($dest, 0, strpos($dest, '.')) . "_" . time() . '.pdf';
     $pdf->Output($fileName, 'F');
 }
示例#3
1
 function SetTextColor($r, $g = -1, $b = -1)
 {
     if (is_string($r)) {
         $this->HTML2RGB($r, $r, $g, $b);
     }
     parent::SetTextColor($r, $g, $b);
 }
 /**
  * Download task list as attachment
  *
  * @access public
  * @param void
  * @return null
  */
 function download_list()
 {
     $task_list = ProjectTaskLists::findById(get_id());
     if (!$task_list instanceof ProjectTaskList) {
         flash_error(lang('task list dnx'));
         $this->redirectTo('task');
     }
     // if
     $this->canGoOn();
     if (!$task_list->canView(logged_user())) {
         flash_error(lang('no access permissions'));
         $this->redirectToReferer(get_url('task'));
     }
     // if
     $output = array_var($_GET, 'output', 'csv');
     $project_name = active_project()->getName();
     $task_list_name = $task_list->getName();
     $task_count = 0;
     if ($output == 'pdf') {
         Env::useLibrary('fpdf');
         $download_name = "{$project_name}-{$task_list_name}-tasks.pdf";
         $download_type = 'application/pdf';
         $pdf = new FPDF();
         $pdf->AddPage();
         $pdf->SetTitle($task_list_name);
         $pdf->SetCompression(true);
         $pdf->SetCreator('ProjectPier');
         $pdf->SetDisplayMode(fullpage, single);
         $pdf->SetSubject(active_project()->getObjectName());
         $pdf->SetFont('Arial', 'B', 16);
         $task_lists = active_project()->getOpenTaskLists();
         $pdf->Cell(0, 10, lang('project') . ': ' . active_project()->getObjectName(), 'C');
         $pdf->Ln();
         foreach ($task_lists as $task_list) {
             $pdf->SetFont('Arial', 'B', 14);
             $pdf->Write(10, lang('task list') . ': ' . $task_list->getObjectName());
             $pdf->Ln();
             $tasks = $task_list->getTasks();
             $line = 0;
             // Column widths
             $w = array(10, 0, 0);
             // Header
             //for($i=0;$i<count($header);$i++)
             //  $this->Cell($w[$i],7,$header[$i],1,0,'C');
             //$this->Ln();
             $pdf->SetFont('Arial', 'I', 14);
             foreach ($tasks as $task) {
                 $line++;
                 if ($task->isCompleted()) {
                     $task_status = lang('completed');
                     $pdf->SetTextColor(100, 200, 100);
                     $task_completion_info = lang('completed task') . ' : ' . format_date($task->getCompletedOn());
                 } else {
                     $task_status = lang('open');
                     $pdf->SetTextColor(255, 0, 0);
                     $task_completion_info = lang('due date') . ' : ' . lang('not assigned');
                     if ($task->getDueDate()) {
                         $task_completion_info = lang('due date') . ' : ' . format_date($task->getDueDate());
                     }
                 }
                 if ($task->getAssignedTo()) {
                     $task_assignee = $task->getAssignedTo()->getObjectName();
                 } else {
                     $task_assignee = lang('not assigned');
                 }
                 $pdf->Cell($w[0], 6, $line);
                 $pdf->Cell($w[2], 6, $task_status, "TLRB");
                 $pdf->Ln();
                 $pdf->Cell($w[0], 6, '');
                 $pdf->SetTextColor(0, 0, 0);
                 $pdf->Cell($w[2], 6, $task_completion_info, "TLRB");
                 $pdf->Ln();
                 $pdf->Cell($w[0], 6, '');
                 $pdf->SetTextColor(0, 0, 0);
                 $pdf->Cell($w[2], 6, $task_assignee, "TLRB");
                 $pdf->Ln();
                 $pdf->Cell($w[0], 6, '');
                 $pdf->SetTextColor(0, 0, 0);
                 $pdf->MultiCell($w[2], 6, $task->getText(), "TLRB");
                 $pdf->Ln();
             }
         }
         $pdf->Output($download_name, 'D');
     } else {
         $download_name = "{$project_name}-{$task_list_name}-tasks.txt";
         $download_type = 'text/csv';
         $download_contents = $task_list->getDownloadText($task_count, "\t", true);
         download_contents($download_contents, $download_type, $download_name, strlen($download_contents));
     }
     die;
 }
示例#5
0
function generatePDF($print_id, $print_type = 1)
{
    include "config.php";
    require_once 'fpdf/fpdf.php';
    $db = go\DB\DB::create($db_params, 'mysql');
    $db->query('SET CHARACTER SET cp1251');
    $get_print = $db->query('SELECT `finish_number`, `valve_type_id` FROM {numbers} WHERE `print_id`=?', array($_GET['print_id']))->assoc();
    $get_print_info = $db->query('SELECT DISTINCT(`nm`.`order`) as `order`, `us`.`name` as `name`, `nm`.`print_id` as `print_id` FROM {numbers} `nm` LEFT JOIN {users} `us` ON (`nm`.`user_id` = `us`.`id`) WHERE `print_id`=?', array($_GET['print_id']))->row();
    define('FPDF_FONTPATH', 'fpdf/fonts');
    $pdf = new FPDF("L", "mm", array("88", "7"));
    $pdf->AddFont('Arial-BoldMT', 'B', 'arial_bold.php');
    $pdf->SetFont('Arial-BoldMT', 'B', 11);
    $pdf->SetTextColor(0);
    //Add info for this order
    $pdf->AddPage('L');
    $pdf->SetAutoPageBreak(false);
    $pdf->SetXY(0, 0);
    $pdf->Cell(43, 7, $get_print_info['name'], 0, 0, "C", 0);
    $pdf->Cell(4, 7, '', 0, 0, "C", 0);
    $pdf->Cell(43, 7, $get_print_info['order'], 0, 0, "C", 0);
    //End of add
    for ($i = 0; $i < count($get_print); $i++) {
        $pdf->AddPage('L');
        $pdf->SetAutoPageBreak(false);
        $pdf->SetXY(0, 0);
        $pdf->Cell(43, 7, 'Ser.: ' . $get_print[$i]['finish_number'], 0, 0, "C", 0);
        $pdf->Cell(4, 7, '', 0, 0, "C", 0);
        if ($i + $print_type < count($get_print)) {
            $pdf->Cell(43, 7, 'Ser.: ' . $get_print[$i + $print_type]['finish_number'], 0, 0, "C", 0);
        }
        $pdf->SetAutoPageBreak(false);
        $i += $print_type;
    }
    return $pdf->Output($get_print_info['print_id'] . '.pdf', 'I');
}
示例#6
0
        $pdf->Cell(0, 6, '', 0, 0);
        //   $pdf->Ln();
        //   $pdf->Ln();
        // $pdf->Ln();
        //   $pdf->Ln();
        //   echo "<p class='espaciar2'><img src=$img width='100' height='150' alt='' class='captionated' /></p>
        // <p> <strong>ID:</strong><br>	<strong>Titulo:</strong><br>	<strong>Autor:</strong><br><strong>Prestado a:</strong></p>
        //<p class='espaciar'>$id<br>	$ti<br>	$aut<br> <strong>$prestt</strong> <br><br><br><br><br>		</p>";
        //   echo "<a href='JavaScript:newPopup('http://www.quackit.com/html/html_help.cfm');'>Open a popup window</a>";
        //   <a href="JavaScript:newPopup('http://www.quackit.com/html/html_help.cfm');">Open a popup window</a>
        //   echo "<tr><td>$id</td><td>$ti</td><td>$aut</td><td>$an</td><td>$edi</td><td>$gen</td><td>$nump</td><td>$stat</td></tr>";
        // }
    }
    $espaciadoV = $espaciadoV + 1;
    $espaciadoH = $espaciadoH + 6;
    mysql_free_result($result2);
    mysql_free_result($result3);
}
//echo"</table>";
mysql_free_result($result);
mysql_free_result($result4);
mysql_close($link);
$pdf->Ln();
$pdf->Ln();
$pdf->Write(5, 'Consulte información detallada sobre sus libros en:     ', '');
$pdf->SetTextColor(0, 0, 255);
$pdf->SetFont('', 'U');
$pdf->Write(5, 'Biblioteca Personal', 'http://localhost/BibliotecaPersonal2/indexP.php');
$pdf->Output();
//mysql_free_result($result);
//  mysql_close($link);
示例#7
0
 /** THE FOLLOWING SHOULD BE REPEATED FOR EACH STUDENT **/
 if (count($reports)) {
     foreach ($reports as $id => $report) {
         $teacherName = $report['classInfo']['first_name'] . " " . $report['classInfo']['last_name'];
         $rcv = 0;
         /** used for row shading **/
         $pdf->AddPage('P');
         $pdf->SetMargins($lm, $tm);
         //$pdf->SetTitle($className."_".$termName."_".$sname."_ProgressReport.pdf");
         /** START BUILDING THE PAGE **/
         /** First the heading **/
         $y_coord = $tm;
         $x_coord = $lm;
         $pdf->SetFillColor(255, 255, 255);
         /** Page Title **/
         $pdf->SetTextColor(51, 102, 102);
         $pdf->SetFont('Times', 'B', $titlefs);
         $pdf->SetXY($x_coord, $y_coord);
         $title = $pdf->Cell($headingw, $titleh, 'Questar III Student Progress Report', 0, 1, 'C', 0);
         $y_coord += $titleh;
         $pdf->SetTextColor(0, 0, 0);
         $pdf->SetFont('Times', 'B', $colheadingfs);
         $pdf->SetXY($x_coord, $y_coord);
         $pdf->Cell($headingw, 0.4, $report['studentName'], 0, 2, 'L', 0);
         $pdf->Cell($headingw, 0.4, $report['classInfo']['course_name'] . ' ~ ' . $teacherName, 0, 2, 'L', 0);
         $pdf->Cell($headingw, 0.4, "School Year " . $schoolYear . " ~ " . $report['classInfo']['term_name'], 0, 2, 'L', 0);
         $pdf->Cell($headingw, 0.4, "Printed on " . $currentDate, 0, 2, 'L', 0);
         /** SUMMARY SECTION **/
         $y_coord = $tm + $titleh;
         $x_coord = $lm + $headingw;
         $pdf->SetFont('Times', 'B', $colheadingfs + 1);
示例#8
0
$pdf->AddPage();
$pdf->SetFont("Helvetica", "B", 22);
$pdf->Cell(0, 20, "Certificate", "B", 1, "C");
$pdf->Ln();
$pdf->SetFont("Helvetica", "B", 16);
$pdf->Cell(0, 20, "OF PHP Knowledge", "I", 0, "C");
$pdf->Ln();
$pdf->Cell(0, 20, "Issued to VitoshAcademy.Com", "I", 0, "C");
$pdf->Ln();
$pdf->Cell(0, 20, "By VitoshAcademy.Com", "I", 0, "C");
$pdf->Ln();
$pdf->SetFont("Helvetica", "B", 11);
$pdf->SetDrawColor(255, 0, 255);
$pdf->SetLineWidth(0.1);
$pdf->SetFillColor(192, 192, 192);
$pdf->SetTextColor(255, 0, 0);
$pdf->Cell(25, 5, "N", "LTR", 0, "C", 1);
$pdf->Cell(25.1, 5, "N * 11", "LTR", 0, "C", 1);
$pdf->Cell(25.2, 5, "N * 13", "LTR", 0, "C", 1);
$pdf->Cell(25.3, 5, "N * 17", "LTR", 0, "C", 1);
$pdf->Cell(25.4, 5, "N * 19", "LTR", 0, "C", 1);
$pdf->Cell(25.5, 5, "N * 23", "LTR", 0, "C", 1);
$pdf->Cell(25.6, 5, "N * 31", "LTR", 0, "C", 1);
$pdf->Ln();
$bool_draw = True;
for ($w = 7; $w <= 50; $w = $w + 7) {
    if ($bool_draw == True) {
        $pdf->SetFillColor(105, 110, 115);
        $pdf->SetTextColor(1, 300, 1);
        $bool_draw = False;
    } else {
示例#9
0
 function exportPdf()
 {
     $db = JFactory::getDBO();
     while (ob_get_level()) {
         ob_end_clean();
     }
     header("Content-Encoding: None", true);
     require JPATH_COMPONENT . DS . 'helpers' . DS . 'fpdf.php';
     include_once JPATH_COMPONENT . DS . 'helpers' . DS . 'font' . DS . 'helvetica.php';
     $quiz_id = intval(JRequest::getVar("id", ""));
     //create a FPDF object
     $pdf = new FPDF();
     //set font for the entire document
     $pdf->SetFont('Arial', 'B', 20);
     $pdf->SetTextColor(50, 60, 100);
     //set up a page
     $pdf->AddPage();
     @$pdf->SetDisplayMode(real, 'default');
     $pdf->SetXY(10, 5);
     $pdf->SetFontSize(8);
     $z = 25;
     $t = $z + 10;
     $pdf->SetXY(10, $t);
     $pdf->SetFontSize(7);
     $pdf->Cell(25, 10, JText::_("GURU_NAME"), 'LRTB', '', 'L', 0);
     $pdf->Cell(39, 10, JText::_("GURU_EMAIL"), 'LRTB', '', 'L', 0);
     $pdf->Cell(100, 10, JText::_("GURU_PROGRAM"), 'LRTB', '', 'L', 0);
     $pdf->Ln();
     $pid = JRequest::getVar("course", 0);
     $result = array();
     $user = JFactory::getUser();
     $sql = "select `id` from #__guru_program where `author` like '%|" . intval($user->id) . "|%' OR `author`='" . intval($user->id) . "'";
     $db->setQuery($sql);
     $db->query();
     $courses_ids = $db->loadColumn();
     $sql = "select `id`, `name` from #__guru_program where `author` like '%|" . intval($user->id) . "|%' OR `author`='" . intval($user->id) . "'";
     $db->setQuery($sql);
     $db->query();
     $courses_names = $db->loadAssocList("id");
     if (!isset($courses_ids) || count($courses_ids) <= 0) {
         $courses_ids = array("0" => "0");
     }
     if (intval($pid) != 0) {
         $courses_ids = array(intval($pid));
     }
     $sql = "select distinct(`userid`) from #__guru_buy_courses where `course_id` in (" . implode(",", $courses_ids) . ")";
     $db->setQuery($sql);
     $db->query();
     $students_ids = $db->loadColumn();
     if (isset($students_ids) && count($students_ids) > 0) {
         $sql = "select distinct(c.`userid`), A.`courses`, u.* from #__guru_buy_courses c, (select `userid`, GROUP_CONCAT(`course_id` SEPARATOR '-') as courses from #__guru_buy_courses where `course_id` in (" . implode(",", $courses_ids) . ") group by `userid`) as A, #__users u, #__guru_customer cust where `course_id` in (" . implode(",", $courses_ids) . ") and c.`userid`=A.`userid` and u.`id`=c.`userid` and cust.`id`=u.`id`";
         $db->setQuery($sql);
         $db->query();
         $result = $db->loadAssocList();
     }
     $new_id = 0;
     $nr = 1;
     for ($i = 0; $i < count($result); $i++) {
         $name = $result[$i]["name"];
         $email = $result[$i]["email"];
         $courses = $result[$i]["courses"];
         $student_courses = array();
         $courses = explode("-", $courses);
         if (isset($courses) && count($courses) > 0) {
             foreach ($courses as $key => $value) {
                 $student_courses[] = $courses_names[$value]["name"];
             }
         }
         $pdf->SetFontSize(7);
         $pdf->Cell(25, 10, $name, 'LRTB', '', 'L', 0);
         $pdf->Cell(39, 10, $email, 'LRTB', '', 'L', 0);
         $pdf->Cell(100, 10, implode(", ", $student_courses), 'LRTB', '', 'L', 0);
         $pdf->Ln();
     }
     //Output the document
     $pdf->Output('ExportResult.pdf', 'I');
 }
示例#10
0
    $sys = "Ethanol-N-Heptane";
}
$pdf = new FPDF();
$pdf->AddPage();
//Logo
$pdf->Image('vlabs.jpg', 10, 8, 70);
//Arial bold 15
$pdf->SetFont('Arial', 'B', 15);
//Move to the right
$pdf->Cell(80);
//Title
$pdf->Cell(70, 10, 'Vapour Liquid Equilibrium', 1, 0, 'C');
//Line break
$pdf->Ln(20);
$pdf->SetFont('Times', 'B', 18);
$pdf->SetTextColor(51, 153, 255);
$pdf->Cell(40, 10, 'Report for ' . $name);
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 12);
$pdf->SetTextColor(128);
$pdf->Cell(40, 10, 'System : ' . $sys);
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 12);
$pdf->SetTextColor(128);
$pdf->Cell(100, 5, 'Date of experiment : ' . $date);
$pdf->Ln();
$pdf->Ln();
# Connect to the database and report any errors on connect.
$cid = mysql_connect($db_host, $db_user, $db_password);
if (!$cid) {
    die("ERROR: " . mysql_error() . "\n");
示例#11
0
 public function SetTextColor($r, $g = null, $b = null)
 {
     $c = $this->parseColours($r, $g, $b);
     return parent::SetTextColor($c["red"], $c["green"], $c["blue"]);
 }
示例#12
0
	function Footer() {
		// Positionnement à 1.5cm du bas
		$this->SetY(-15);
		// Adresse
		$this->Cell(196, 5, 'Projet Champagne', 0, 0, 'C');
	}

}

// Instanciation de la classe PDF
$pdf = new FPDF('P', 'mm', 'A4');
$pdf->AddPage();
$pdf->AddFont('DejaVu', '', 'DejaVuSansCondensed.ttf', true);
$pdf->SetFont('DejaVu', '', 12);
$pdf->SetTextColor(0);

// Infos de la commande calées à gauche
$pdf->Text(20, 80, 'N° de facture : '.$tCommande[0]['id']);
$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
示例#13
0
 function set_text_color($r, $g, $b)
 {
     parent::SetTextColor($r, $g, $b);
 }
示例#14
0
include "../../libraries/tcpdf/font/times.php";
//fpdf
$this->load->library('fpdf');
//fpdf
$nombre = "";
$fpdf = new FPDF();
ob_end_clean();
//inicializa pagina pdf
$fpdf->Open();
$fpdf->AddPage();
$fpdf->SetAuthor("codigoweblibre.comli.co - codigoweblibre.wordpress.com", true);
$fpdf->SetCreator("codigoweblibre.comli.co - codigoweblibre.wordpress.com", true);
//Cabecera
$fpdf->SetFont('Arial', 'B', 12);
$fpdf->SetTextColor("0", "8", "8");
//rojo
//$fpdf->Image(base_url() . 'img/User.png', 10, 10, -100);
$fpdf->SetFontSize(10);
$fpdf->Image('imagenes/banner.png', 8, 10, 192, 22, 'PNG');
$fpdf->Cell(100, 30, ' ', 0, 1, 'C');
$fpdf->Image('imagenes/bandera2.png', 8, 35, 192, 1, 'PNG');
$fpdf->Cell(0, 6, 'UNIDAD EJECUTORA DE TITULACION', 0, 1, 'C');
$fpdf->Cell(0, 6, 'DEL MINISTERIO DE OBRAS PUBLICAS, SERVICIOS Y VIVIENDA', 0, 1, 'C');
$fpdf->SetFont('Arial', 'BU', 10);
$fpdf->Cell(0, 3, '', 0, 1, 'C');
$fpdf->Cell(0, 6, 'REPORTE DE PERSONAL POR FECHA DE MODIFICACION', 0, 1, 'C');
$fpdf->Ln();
$fpdf->SetFont('Arial', 'B', 10);
$fpdf->Cell(45, 7, "Nombre ", 1);
$fpdf->SetFont('Arial', 'B', 10);
示例#15
0
 $sql = "SELECT * from categories where class_id=" . $class_id;
 $result = $db->query($sql);
 $catcount = $result->num_rows;
 while ($row = $result->fetch_assoc()) {
     $cat_names_array[$row['category_name']] = $row['category_weight'];
 }
 $catcount = count($cat_names_array);
 if ($catcount) {
     $y_coord = $tm;
     $x_coord = $lm;
     $pdf->AddPage('P');
     //print "Adding Page ".$page++."<br>";
     $pdf->SetMargins($lm, $tm, 8.5);
     $pdf->SetFillColor(204, 204, 204);
     /** black **/
     $pdf->SetTextColor(0, 0, 0);
     $pdf->SetXY($x_coord, $y_coord);
     /** Display a Page Title **/
     $pageTitle = "Class Summary for " . $termName . " - " . $class_name . " - " . $teacherName;
     $pdf->SetFont('Times', 'B', $titlefs);
     $pdf->Cell($pw, $titleh, $pageTitle, 0, 1, 'C', 1);
     $y_coord += $titleh;
     $pdf->SetXY($x_coord, $y_coord);
     $pdf->SetFont('Times', 'B', $catfs);
     $numCats = count($cat_names_array);
     $overallavw = 1.0;
     $studentw = 2.0;
     $rightleft = $overallavw + $studentw;
     $catw = ($pw - ($overallavw + $studentw)) / $numCats;
     /** Student Names **/
     $pdf->Cell($studentw, 2 * $cath, 'Student Names', 0, 0, 'C', 1);
示例#16
0
文件: report.php 项目: nyxstudio/php1
    array_push($data, $row);
}
//setting judul laporan dan header tabel
$judul = "LAPORAN DATA MAHASISWA";
$header = array(array("label" => "No. Pegawai", "length" => 30, "align" => "L"), array("label" => "Nama", "length" => 50, "align" => "L"), array("label" => "Email", "length" => 40, "align" => "L"), array("label" => "Telepon", "length" => 30, "align" => "L"), array("label" => "Jenis Kelamin", "length" => 30, "align" => "L"));
//sertakan library FPDF dan bentuk objek
require_once "fpdf/fpdf.php";
$pdf = new FPDF();
$pdf->AddPage();
//tampilkan judul laporan
$pdf->SetFont('Arial', 'B', '16');
$pdf->Cell(0, 20, $judul, '0', 1, 'C');
//buat header tabel
$pdf->SetFont('Arial', '', '10');
$pdf->SetFillColor(11, 11, 11);
$pdf->SetTextColor(255);
$pdf->SetDrawColor(11, 11, 11);
foreach ($header as $kolom) {
    $pdf->Cell($kolom['length'], 5, $kolom['label'], 1, '0', $kolom['align'], true);
}
$pdf->Ln();
//tampilkan data tabelnya
$pdf->SetFillColor(224, 235, 255);
$pdf->SetTextColor(0);
$pdf->SetFont('');
$fill = false;
foreach ($data as $baris) {
    $i = 0;
    foreach ($baris as $cell) {
        $pdf->Cell($header[$i]['length'], 5, $cell, 1, '0', $kolom['align'], $fill);
        $i++;
示例#17
0
// Create me a new pdf object:
$pdf = new FPDF();
// Add a page to that object
$pdf->AddPage();
$pdf->setleftmargin(10);
$pdf->setX(10);
$pdf->setY(10);
// Longwinded way with lots of repitititititition ...
// --------------------------------------------------
// Add some text
$pdf->SetFont('Arial', 'B', 16);
// width, height, text, no border, next line - below & left margin, alignement
$pdf->Cell(80, 10, 'Welcome to Well House Manor!', 0, 1, "C");
$pdf->Cell(80, 10, 'Monday to Friday', 0, 1, "C");
$pdf->SetFont('Arial', 'I', 10);
$pdf->SetTextColor(20, 20, 128);
$pdf->Cell(80, 8, '06:30 - Reception opens', 0, 1, "C");
$pdf->Cell(80, 8, '07:00 - 09:00 - Breakfast', 0, 1, "C");
$pdf->Cell(80, 8, '09:00 - Course starts for day', 0, 1, "C");
$pdf->Cell(80, 8, '11:00 - Last Checkout time', 0, 1, "C");
$pdf->Cell(80, 8, '14:00 - Open for Cream Teas', 0, 1, "C");
$pdf->Cell(80, 8, '14:00 - Museum Opens', 0, 1, "C");
$pdf->Cell(80, 8, '15:00 - First Checkin time', 0, 1, "C");
$pdf->Cell(80, 8, '17:00 - Course finished for day', 0, 1, "C");
$pdf->Cell(80, 8, '17:00 - End of Cream Teas', 0, 1, "C");
$pdf->Cell(80, 8, '17:00 - Museum Closes', 0, 1, "C");
$pdf->Cell(80, 8, '21:00 - Reception closes', 0, 1, "C");
// shorter way without repitition ...
// ----------------------------------
$pdf->SetFont('Arial', 'B', 16);
$pdf->Cell(80, 10, 'Welcome to Well House Manor!', 0, 1, "C");
示例#18
0
 //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);
         //$pdf->Cell(30,7,'Hora Sorteo',1,0,'C',true);
         $pdf->Cell(30, 7, 'Signo', 1, 0, 'C', true);
         $pdf->Cell(30, 7, 'Monto', 1, 0, 'C', true);
         $pdf->Cell(40, 7, 'Apuesta Ganadora', 1, 0, 'C', true);
         $pdf->SetFont('Arial', '', 8);
示例#19
0
$pdf->Cell(0, 5, 'IKATAN BIDAN INDONESIA KABUPATEN SIDOARJO ', 0, 1, 'C');
$pdf->SetFont('Arial', '', '10');
$pdf->Cell(0, 5, 'Jl. Sunandar Priyo Sudarmo No.154 Telp. (031) 8056911', 0, 1, 'C');
$pdf->Cell(0, 5, 'Sidoarjo - Jawa Timur - Indonesia', 0, 1, 'C');
$pdf->Image('../_pwi/_assets_cetak_pdf/rsbbd_01.jpg', 58, 12, 25, 25);
// tampil garis line
$pdf->Line(45, 38, 250, 38);
$pdf->Line(45, 39, 250, 39);
$pdf->Ln();
$pdf->Cell(0, 5, '', 0, 1, 'C');
$pdf->Cell(0, 5, 'Laporan Ganti Jadwal Pegawai Tetap, Bulan ' . $bln . ' Tahun ' . $tahun, 0, 1, 'C');
$pdf->Ln();
$pdf->Cell(0, 5, 'Gedung Rawat Inap Dan UGD', 0, 1, 'C');
$pdf->Ln();
$pdf->SetFillColor(224, 235, 255);
$pdf->SetTextColor(0);
$pdf->Cell(1, 7, '', '', 0, 'L');
#buat header tabel
foreach ($tabel_anggota as $kolom) {
    $pdf->Cell($kolom['length'], 7, $kolom['label'], 1, '0', $kolom['align'], true);
}
#tampilkan data tabel
$pdf->Ln();
$pdf->Cell(1, 7, '', '', 0, 'L');
$fill = false;
foreach ($data_tabel as $baris) {
    $i = 0;
    $no = 0;
    foreach ($baris as $cell) {
        $pdf->Cell($tabel_anggota[$i]['length'], 7, $cell, 1, '0', $kolom['align']);
        $i++;
示例#20
0
文件: fpdfout.php 项目: JLockerbie/BS
<?php

$name = $_POST['name'];
$characteristics = $_POST['characteristics'];
$image = $_POST['image'];
require 'fpdf17/fpdf.php';
//create a FPDF object
$pdf = new FPDF();
//set document properties
$pdf->SetAuthor('Anon');
$pdf->SetTitle($name);
//set font for the entire document
$pdf->SetFont('Helvetica', 'B', 20);
$pdf->SetTextColor(50, 60, 100);
//set up a page
$pdf->AddPage('P');
//$pdf->SetDisplayMode(real,'default');
//insert an image and make it a link
$pdf->Image('logo.png', 10, 20, 33, 0);
//display the title without a border around it
$pdf->SetXY(50, 20);
$pdf->SetDrawColor(50, 60, 100);
$pdf->Cell(100, 10, $name, 0, 0, 'C', 0);
// Insert a dynamic image from a URL
$pdf->Image($image, 75, 30, 0, 50);
//Set x and y position for the main text, reduce font size and write content
$pdf->SetXY(10, 90);
$pdf->SetFontSize(10);
$pdf->Write(5, $characteristics);
//Output the document
$pdf->Output();
    $_SESSION['year'] = $_POST["year"];
}
if ($_POST["search_study_type"] == 'Денна') {
    $study_type = "stc";
}
if ($_POST["search_study_type"] == 'Заочна') {
    $study_type = "zao";
}
$pdf = new FPDF();
//set document properties
$pdf->SetAuthor('Alexandr Slovinskiy');
$pdf->SetTitle('Order Annex');
//set font for the entire document
$pdf->AddFont('Times', '', 'times.php');
$pdf->SetFont('Times', '');
$pdf->SetTextColor(0, 0, 0);
//set up a page
$pdf->AddPage('L');
$pdf->SetDisplayMode(real, 'default');
//display the title with a border around it
//Set x and y position for the main text, reduce font size and write content
$pdf->Image('img/form_1-12-2.jpg', 10, 15, 280);
$pdf->SetFontSize(9);
$pdf->SetXY(261, 29.5);
$pdf->Write(5, $_POST["order_number"]);
$pdf->SetXY(197.5, 37);
$pdf->Write(5, $_POST["day"]);
$pdf->SetXY(205, 37);
$pdf->Write(5, $_POST["month"]);
$pdf->SetXY(225.4, 37);
$pdf->Write(5, substr($_POST["year"], 2, 2));
 }
 //email Invoice
 $to = $email;
 $from = "*****@*****.**";
 $subject = "HPVC2015-Registration";
 $message = "<p>Congatulations your payment is Succesfull.</p><p>Find the attachment for Invoice</p><p>Your Unique Code for uploading report is :<b>" . $tkn . "</b></p><p>The Code will expire immediately after uploading report</p>";
 require "fpdf/fpdf.php";
 $pdf = new FPDF();
 $pdf->AddPage();
 $pdf->SetFont("Arial", "B", 11);
 //$pdf->Image('img/header.jpg',10,null,190,0);
 $pdf->Ln();
 $pdf->Ln();
 $pdf->Ln();
 $pdf->Cell(40, 10, "Congratulations", 0, 0, "");
 $pdf->SetTextColor(241, 98, 97);
 $pdf->Cell(0, 10, $cap_nm, 0, 1, "");
 $pdf->SetTextColor(241, 98, 97);
 $pdf->SetFont("Arial", "B", 14);
 $pdf->Cell(0, 10, "Your Payment is Succesfull.", 0, 1, "");
 $pdf->SetFont("Arial", "B", 11);
 $pdf->SetTextColor(0, 0, 0);
 $pdf->Cell(50, 10, "Team Name:", 0, 0, "");
 $pdf->SetTextColor(241, 98, 97);
 $pdf->Cell(0, 10, $team_nm, 0, 1, "");
 $pdf->SetTextColor(0, 0, 0);
 $pdf->Cell(50, 10, "Reference No:", 0, 0, "");
 $pdf->SetTextColor(241, 98, 97);
 $pdf->Cell(0, 10, $refno, 0, 1, "");
 $pdf->SetTextColor(0, 0, 0);
 $pdf->Cell(50, 10, "Transaction ID:", 0, 0, "");
 /**
  * Render a single-line text field to the PDF
  *
  * @access public
  * @since 1.0.0
  * @param FPDF $fpdf fpdf library object
  * @param string $field_name the field name
  * @param mixed $value string or int value to display
  * @param int $show_border a debugging/helper option to display a border
  *        around the position for this field
  */
 private function text_field($fpdf, $value, $show_border, $position, $font = array())
 {
     if ($value) {
         if (empty($font)) {
             $font = array('font_color' => $this->certificate_font_color, 'font_family' => $this->certificate_font_family, 'font_style' => $this->certificate_font_style, 'font_size' => $this->certificate_font_size);
         }
         // End If Statement
         // Test each font element
         if (empty($font['font_color'])) {
             $font['font_color'] = $this->certificate_font_color;
         }
         if (empty($font['font_family'])) {
             $font['font_family'] = $this->certificate_font_family;
         }
         if (empty($font['font_style'])) {
             $font['font_style'] = $this->certificate_font_style;
         }
         if (empty($font['font_size'])) {
             $font['font_size'] = $this->certificate_font_size;
         }
         // get the field position
         list($x, $y, $w, $h) = $position;
         // font color
         $font_color = $this->hex2rgb($font['font_color']);
         $fpdf->SetTextColor($font_color[0], $font_color[1], $font_color[2]);
         // Check for Border and Center align
         $border = 0;
         $center = 'J';
         if (isset($font['font_style']) && !empty($font['font_style']) && false !== strpos($font['font_style'], 'C')) {
             $center = 'C';
             $font['font_style'] = str_replace('C', '', $font['font_style']);
         }
         // End If Statement
         if (isset($font['font_style']) && !empty($font['font_style']) && false !== strpos($font['font_style'], 'O')) {
             $border = 1;
             $font['font_style'] = str_replace('O', '', $font['font_style']);
         }
         // End If Statement
         $custom_font = $this->set_custom_font($fpdf, $font);
         // Set the field text styling based on the font type
         $fonttype = '';
         if (!$custom_font) {
             $fonttype = $this->get_font_type($value);
             switch ($fonttype) {
                 case 'mb':
                     $fpdf->SetFont('DejaVu', '', $font['font_size']);
                     break;
                 case 'latin':
                     $fpdf->SetFont($font['font_family'], $font['font_style'], $font['font_size']);
                     break;
                 default:
                     $fpdf->SetFont($font['font_family'], $font['font_style'], $font['font_size']);
                     break;
             }
         }
         // show a border for debugging purposes
         if ($show_border) {
             $fpdf->setXY($x, $y);
             $fpdf->Cell($w, $h, '', 1);
         }
         // End If Statement
         if (0 < $border) {
             $show_border = 1;
             $fpdf->SetDrawColor($font_color[0], $font_color[1], $font_color[2]);
         }
         // End If Statement
         // align the text to the bottom edge of the cell by translating as needed
         $y = $font['font_size'] > $h ? $y - ($font['font_size'] - $h) / 2 : $y + ($h - $font['font_size']) / 2;
         $fpdf->setXY($x, $y);
         // Decode string based on font type
         if ('latin' == $fonttype) {
             $value = utf8_decode($value);
         }
         // and write out the value
         $fpdf->Cell($w, $h, $value, $show_border, $position, $center);
     }
     // End If Statement
 }
示例#24
0
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont("Arial", "", 12);
$pdf->Cell(0, 0, "SOMMAIRE", 0, 0, C);
$pdf->Text(10, 25, "Title 1 ");
$pdf->Text(20, 30, "Title 2 ");
$pdf->Text(30, 35, "Title 3 ");
$pdf->Text(20, 40, "Titre super ");
$pdf->Text(10, 45, "Title Great ");
$pdf->Text(20, 50, "Title super ");
$pdf->AddPage();
$pdf->SetFont("Arial", "B", 32);
$pdf->SetXY(0, 30);
$pdf->Cell(0, 0, "SAMPLE DOC Oumar Exe ", 0, 0, C);
$pdf->SetFont("Arial", "", 12);
$pdf->SetTextColor(130, 0, 0);
$pdf->Text(10, 45, "Title 1 ");
$pdf->SetTextColor(0);
$pdf->SetTextColor(0, 130, 0);
$pdf->Text(20, 50, "Title 2 ");
$pdf->SetTextColor(0);
$pdf->SetTextColor(20, 20, 130);
$pdf->Text(30, 55, "Title 3 ");
$pdf->SetTextColor(0);
$pdf->SetXY(10, 60);
$pdf->Text(10, 60, "BONJOUR COUCOU GRAND Darktsar Oumar Exe TRAORE  ");
$cordX = $pdf->SetX($pdf->GetStringWidth("BONJOUR COUCOU GRAND Darktsar Oumar Exe TRAORE  "));
$cordX = $pdf->GetX() + 9;
$pdf->SetFont("Arial", "B", 12);
$pdf->Text($cordX, 60, "SAMPLE ");
$pdf->SetFont("Arial", "", 12);
示例#25
0
文件: index.php 项目: apelburg/test
$pdf=new FPDF();
$pdf->AddFont('ArialMT','','arial.php');
$pdf->AddFont('Arial-BoldMT','','arialbd.php');
$pdf->AddFont('Arial-BoldItalicMT','','arialbi.php');
$pdf->AddPage();
$pdf->SetFont('Arial-BoldMT','',14); // задаем шрифт и его размер
$reportName="НАКЛАДНАЯ /ОБРАЗЦЫ /";
$pdf->Cell( 0, 15, $reportName, 0, 0, 'C' );
$pdf->SetFont('Arial-BoldMT','',8); // задаем шрифт и его размер

$pdf->Cell(10,20,'',0,1,'l');
$pdf->ln(0);
$pdf->Cell(10,5,'',0,0,'l');

$pdf->SetTextColor(214,3,0); // красный
$pdf->Cell(50,5,'Дата составления заявки',1,0,'l');
$pdf->SetTextColor(22,50,255); // синий
$pdf->Cell(90,5,date("d-m-Y",time()),1,0,'l');
$pdf->ln(5);
$pdf->Cell(10,30,'',0,0,'l');

$pdf->SetTextColor(214,3,0); // красный
$pdf->Cell(50,25,'Название фирмы',1,0,'l');
$pdf->Image('logo.jpg',80,37,'70','');
$pdf->Cell(90,25,'',1,0,'l');

$pdf->ln(20);
$pdf->Cell(10,5,'',0,0,'l');
$pdf->Cell(50,5,'Контактное лицо',1,0,'l');
$pdf->SetFont('ArialMT','',8); // задаем шрифт и его размер
示例#26
0
// 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;
$y = 63;
// alle Flugleiter des Vereins ermitteln
$data = getFlugleiterliste();
// Schriftfarbe setzen
$pdf->SetTextColor(0, 0, 0);
foreach ($data as $mitglied) {
    // Schriftart festlegen
    $pdf->SetFont('Times', 'B', 11);
    // Schriftfarbe setzen
    $pdf->SetTextColor(0, 0, 0);
				// passage des creneaux en revus
				while ( $nb_creneaux > $k )
				{

					// nom du creneau sur lequelle nous travaillons actuellement
					$nom_creneau = $creneaux[$k];

					if ( !empty($tab_donnee_sup[$nb_ligne_passe][$nom_creneau]['A']) and $tab_donnee_sup[$nb_ligne_passe][$nom_creneau]['A'] === '1' and empty($tab_donnee_sup[$nb_ligne_passe][$nom_creneau]['R']))
					{

						// si la couleur à était demandé alors on l'initialise
						if ( $couleur_fond === '1' )
						{

							// couleur de caractère
							$pdf->SetTextColor(255, 0, 0);
							// couleur du fond de cellule
							$pdf->SetFillColor(255, 223, 223);

						}

						// construction de la cellule du tableau
						$pdf->Cell($largeur_1_creneau, $hau_donnee, 'A', 1, 0, 'C', $couleur_fond);

						// remise de la couleur du caractère à noir
						$pdf->SetTextColor(0, 0, 0);

					}
					elseif ( !empty($tab_donnee_sup[$nb_ligne_passe][$nom_creneau]['R']) and $tab_donnee_sup[$nb_ligne_passe][$nom_creneau]['R'] === '1'  and empty($tab_donnee_sup[$nb_ligne_passe][$nom_creneau]['A']) )
					{
示例#28
0
 public function fee_month()
 {
     $date_from = $this->input->get("date_from");
     $date_to = $this->input->get("date_to");
     $event = $this->input->get("event");
     require_once "../assets/fpdf/fpdf.php";
     $pdf = new FPDF();
     $pdf->AliasNbPages();
     $pdf->AddPage('L', 'A4');
     //title
     $pdf->SetFont('Arial', 'B', 16);
     $pdf->Cell(0, 10, 'Report Absensi Moderasi HM Sampoerna', 0, 0, 'C');
     $pdf->Ln(10);
     $pdf->SetFont('Arial', '', 10);
     $pdf->Cell(0, 5, 'Periode Tanggal : ' . $date_from . ' s/d ' . $date_to, 0, 0, 'C');
     $pdf->Ln(5);
     $pdf->Cell(0, 5, 'Event : ' . $this->event_model->get_event_name($this->input->get("event")), 0, 0, 'L');
     $pdf->Ln(10);
     //header
     $pdf->SetFont('Arial', 'B', 8);
     $pdf->SetDrawColor(0, 0, 0);
     $pdf->SetTextColor(0, 0, 0);
     $pdf->Cell(10, 14, 'No', 1, 0, 'C');
     $pdf->Cell(40, 14, 'Moderator', 1, 0, 'C');
     $from = date_create(format_ymd($date_from));
     $to = date_create(format_ymd($date_to));
     $j = 0;
     while ($from <= $to) {
         $pdf->SetXY(60 + $j, 35);
         $pdf->Cell(6, 7, date_format($from, "d"), 1, 0, 'C');
         $pdf->SetXY(60 + $j, 42);
         $pdf->Cell(6, 7, date_format($from, "m"), 1, 0, 'C');
         date_add($from, date_interval_create_from_date_string('1 days'));
         $j += 6;
     }
     $pdf->SetXY($j + 60, 35);
     $pdf->Cell(0, 14, 'Jumlah', 1, 0, 'C');
     $pdf->Ln(14);
     //rows
     $pdf->SetFont('Arial', '', 8);
     $pdf->SetDrawColor(0, 0, 0);
     $pdf->SetTextColor(0, 0, 0);
     $result = $this->user_event_model->get_user_month()->result();
     $total = 0;
     $i = 1;
     $j = 0;
     foreach ($result as $r) {
         $pdf->Cell(10, 7, $i++, 1, 0, 'C');
         $pdf->Cell(40, 7, $r->user, 1, 0, 'L');
         $from = date_create(format_ymd($date_from));
         $to = date_create(format_ymd($date_to));
         $j = 0;
         $jum = 0;
         while ($from <= $to) {
             $jumlah = $this->absent_model->check_exist_month($r->user_kode, $event, date_format($from, 'Y-m-d'));
             $pdf->Cell(6, 7, number_format($jumlah), 1, 0, 'C');
             $jum += $jumlah;
             date_add($from, date_interval_create_from_date_string('1 days'));
             $j++;
         }
         $pdf->Cell(0, 7, number_format($jum), 1, 0, 'C');
         $total += $jum;
         $pdf->Ln(7);
     }
     $pdf->SetFillColor(240, 240, 240);
     $pdf->SetFont('Arial', 'B', 8);
     $pdf->Cell(50 + 6 * $j, 7, 'Total : ', 1, 0, 'R', true);
     $pdf->Cell(0, 7, number_format($total), 1, 0, 'C', true);
     $pdf->SetFont('Arial', '', 10);
     $this->_footer($pdf);
     $pdf->Output("Fee Moderasi HM Sampoerna", "I");
 }
$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');
$pdf->Ln(5);
$pdf->SetTextColor(0, 102, 204);
$pdf->Cell(189, 5, utf8_decode('Descripción del Bien Cotizado'), 1, 1, 'C');
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(37, 5, utf8_decode('Año del Vehículo'), 1, 0, 'C');
$pdf->Cell(37, 5, utf8_decode('Marca'), 1, 0, 'C');
$pdf->Cell(37, 5, utf8_decode('Modelo'), 1, 0, 'C');
$pdf->Cell(37, 5, utf8_decode('Uso'), 1, 0, 'C');
$pdf->Cell(41, 5, utf8_decode('Valor acordado'), 1, 1, 'C');
$pdf->Cell(37, 5, utf8_decode($anio_auto), 1, 0, 'C');
$pdf->Cell(37, 5, utf8_decode($marca), 1, 0, 'C');
示例#30
-3
 public function post_id_upc_terms_handler()
 {
     $this->id = preg_split('/[^\\d]/', $this->id, 0, PREG_SPLIT_NO_EMPTY);
     $pdf = new FPDF('P', 'mm', 'Letter');
     $pdf->SetMargins(6.35, 6.35, 6.35);
     // quarter-inch margins
     $pdf->SetAutoPageBreak(false);
     $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
     $pdf->AddFont('Gill', 'B', 'GillSansMTPro-Heavy.php');
     $margins = $pdf->GetMargins();
     $margins['top'] = 0.0;
     $check_left_x = $margins['left'] > 3.175 ? $margins['right'] : 3.175 - $margins['left'];
     $real_check_top_y = 183.675 - $margins['top'];
     $check_right_x = 203.2 - $margins['left'];
     $real_check_bottom_y = 255.112 - $margins['top'];
     $line_height = 5;
     $envelope_window_tab = 15;
     $right_col1 = 130;
     $right_col2 = 170;
     $my_address = array('610 E 4th St', 'Duluth, MN 55805', 'Tel: 218.728.0884', 'www.wholefoods.coop');
     $check_date = date('F j, Y');
     $dbc = $this->connection;
     $dbc->setDefaultDB($this->config->get('OP_DB'));
     $signage = new COREPOS\Fannie\API\item\FannieSignage(array());
     foreach ($this->id as $card_no) {
         $pdf->AddPage();
         $account = \COREPOS\Fannie\API\member\MemberREST::get($card_no);
         $primary = array();
         foreach ($account['customers'] as $c) {
             if ($c['accountHolder']) {
                 $primary = $c;
                 break;
             }
         }
         $check_number = rand(100000, 999995);
         for ($i = 0; $i < 3; $i++) {
             $pdf->SetFont('Gill', '', 10);
             $check_top_y = $real_check_top_y - $i * 90;
             $check_bottom_y = $real_check_bottom_y - $i * 90;
             $pdf->SetXY($check_left_x, $check_top_y);
             $pdf->Ln($line_height * 4.25);
             foreach ($my_address as $line) {
                 $pdf->SetX($check_left_x + $envelope_window_tab + 20);
                 if ($line == 'www.wholefoods.coop') {
                     $pdf->SetFont('Gill', 'B', 9);
                 }
                 $pdf->Cell(0, $line_height, $line, 0, 1);
             }
             $pdf->SetFont('Gill', 'B', 10);
             $pdf->SetXY($check_left_x + $right_col1, $check_top_y);
             $pdf->Cell(30, $line_height, 'Check Number:', 0, 0, 'R');
             $pdf->SetFont('Gill', '', 10);
             $pdf->SetTextColor(0xff, 0x58, 0);
             $pdf->SetX($check_left_x + $right_col2);
             $pdf->Cell(30, $line_height, $check_number, 0, 0, 'R');
             $pdf->SetFont('Gill', 'B', 10);
             $pdf->SetTextColor(0, 0, 0);
             $pdf->SetXY($check_left_x + $right_col1, $check_top_y + 1.5 * $line_height);
             $pdf->Cell(30, $line_height, 'Date:', 0, 0, 'R');
             $pdf->SetFont('Gill', '', 10);
             $pdf->SetTextColor(0xff, 0x58, 0);
             $pdf->SetX($check_left_x + $right_col2);
             $pdf->Cell(30, $line_height, $check_date, 0, 0, 'R');
             $pdf->SetXY($check_left_x + $right_col1, $check_top_y + 3 * $line_height);
             $pdf->SetFont('Gill', 'B', 10);
             $pdf->SetTextColor(0, 0, 0);
             $pdf->Cell(30, $line_height, 'Amount:', 0, 0, 'R');
             $pdf->SetXY($check_left_x + $right_col1 + 30, $check_top_y + 3 * $line_height);
             $pdf->SetFont('Gill', '', 10);
             $pdf->SetTextColor(0xff, 0x58, 0);
             $pdf->MultiCell(40, $line_height, str_repeat(' ', 2) . $this->terms, 0, 'R');
             $pdf->SetTextColor(0, 0, 0);
             $their_address = array($primary['firstName'] . ' ' . $primary['lastName']);
             $their_address[] = $account['addressFirstLine'];
             if ($account['addressSecondLine']) {
                 $their_address[] = $account['addressSecondLine'];
             }
             $their_address[] = $account['city'] . ', ' . $account['state'] . ' ' . $account['zip'];
             $pdf->SetXY($check_left_x + $envelope_window_tab, $check_top_y + 11 * $line_height);
             $pdf->SetFont('Gill', 'B', 10);
             foreach ($their_address as $line) {
                 $pdf->SetX($check_left_x + $envelope_window_tab);
                 $pdf->Cell(0, $line_height, $line, 0, 1);
             }
             $pdf->SetFont('Gill', '', 10);
             $pdf->SetXY($check_left_x, $check_bottom_y + $line_height - 1);
             $pdf->SetTextColor(0, 0, 0);
             $pdf->SetFont('Gill', 'B', 10);
             $pdf->Cell(0, $line_height, 'Redeemable only at Whole Foods Co-op', 0, 0, 'C');
             $pdf->SetFont('Gill', '', 10);
             $pdf->SetXY($check_left_x + 145, $check_top_y + 6 * $line_height + 1);
             $pdf->SetFont('Gill', '', 8);
             $pdf->MultiCell(50, $line_height - 2, 'Limit one per day. Cannot be applied to previous purchases. No cash value.');
             $pdf->SetFont('Gill', '', 10);
             $pdf->SetFillColor(0xcc, 0xcc, 0xcc);
             $pdf->Rect($check_left_x + 84, $check_top_y + 28, 39, 15, 'F');
             $pdf->SetFillColor(0, 0, 0);
             $signage->drawBarcode(ltrim($this->upc, '0'), $pdf, $check_left_x + 87, $check_top_y + 30, array('height' => 11, 'fontsize' => 0));
             $pdf->Image('logo.rgb.noalpha.png', $check_left_x + $envelope_window_tab, $check_top_y + 20, 20);
             $pdf->SetFont('Gill', 'B', '31');
             $pdf->SetXY($check_left_x + $envelope_window_tab, $check_top_y + 0.5 * $line_height);
             $pdf->SetTextColor(0xff, 0x58, 0);
             $pdf->Cell(0, 3 * $line_height, 'We Appreciate You!');
             $pdf->SetFont('Gill', '', '10');
             $pdf->SetTextColor(0, 0, 0);
             $pdf->Image(dirname(__FILE__) . '/../GiveUsMoneyPlugin/img/sig.png', $check_right_x - 63.5, $check_top_y + 9 * $line_height, 63.5);
             $pdf->SetXY($check_right_x - 63.5, $check_top_y + 12 * $line_height);
             $pdf->Cell(63.5, $line_height, 'Authorized By Signature', 'T');
             $check_number++;
         }
     }
     $pdf->Output();
 }