$fpdf->text(20, 95, $municipality);
//province
$fpdf->SetFont('Times', '', 12);
$province = strtolower($applicationForm->province);
$province = ucfirst($province);
$fpdf->text(20, 100, $province);
//greeting
$fpdf->SetFont('Times', '', 12);
$fpdf->text(20, 110, "Dear ");
$position = ucfirst(strtolower($applicationForm->position));
$lastname = $applicationForm->lastname;
$name = "{$position} {$lastname}:";
$fpdf->SetFont('Times', 'B', 12);
$fpdf->text(30, 110, $name);
//body
$fpdf->SetXY(20, 120);
$fpdf->SetFont('Times', '', 12);
$datefrom = date("F d, Y", strtotime($applicationForm->flightinfo_datefrom));
$dateto = date("F d, Y", strtotime($applicationForm->flightinfo_dateto));
$purpose = $applicationForm->flightinfo_purpose;
$content = "        This refers to your proposed travel to {$applicationForm->flightinfo_country}, from {$datefrom} to {$dateto}, to {$purpose}";
$content .= "\n\n";
$content .= "        Relative to the above, please be informed that the request is hereby approved, ";
//check if has no entitlements if it has, include it (ie. (a) payment of international airfare (economy), meal expenses for dinner only, and 20% travel allowance representing incidental expenses )
$content .= $applicationForm->entitlements;
$content .= "\n\n";
$content .= "       It is further understood that this approval shall likewise be subject to the pertinent provisions of all other applicable laws, rules and regulations.";
$fpdf->MultiCell(170, 5, $content, 0);
//closing
$fpdf->SetFont('Times', '', 12);
$fpdf->text(128, 210, "Very truly yours,");
$province = strtolower($applicationForm->province);
$province = ucfirst($province);
//greeting
$fpdf->SetFont('Times', '', 12);
$position = ucfirst(strtolower($applicationForm->position));
$lastname = $applicationForm->lastname;
$firstname = $applicationForm->firstname;
$middlinitial = $applicationForm->middlename != "" ? substr($applicationForm->middlename . ".", 0, 1) : "";
$name = strtoupper("{$position} {$firstname} {$middlinitial} {$lastname}");
$name2 = $position . " " . $applicationForm->lastname;
if ($middleInitial == "") {
    $name = strtoupper("{$position} {$firstname} {$lastname}");
}
$fpdf->SetFont('Times', 'B', 12);
//body
$fpdf->SetXY(20, 90);
$fpdf->SetFont('Times', '', 12);
$datefrom = date("F d, Y", strtotime($applicationForm->flightinfo_datefrom));
$dateto = date("F d, Y", strtotime($applicationForm->flightinfo_dateto));
$purpose = $applicationForm->flightinfo_purpose;
$province = strtoupper($applicationForm->province);
$content = "        Pursuant to DILG Memorandum Circular No. 2006-163 dated November 30, 2006, {$name}, PROVINCE OF {$province}, (whose picture appears below), is hereby authorized to travel to the {$applicationForm->flightinfo_country}, from {$applicationForm->flightinfo_datefrom} to {$applicationForm->flightinfo_dateto}, to {$applicationForm->flightinfo_purpose}";
$content .= "\n\n";
$content .= "        {$name2} is authorized to claim for entitlements, ";
//check if has no entitlements if it has, include it (ie. (a) payment of international airfare (economy), meal expenses for dinner only, and 20% travel allowance representing incidental expenses )
$content .= $applicationForm->entitlements;
$content .= " Further, this authorization shall likewise be subject to the pertinent provisions of all other applicable laws, rules and regulations.";
$fpdf->MultiCell(170, 5, $content, 0, 'B');
//closing
$fpdf->SetFont('Times', '', 12);
//bottom
Beispiel #3
0
 public static function imprimeListadoHistorico($incidencias)
 {
     Fpdf::AddPage();
     Fpdf::Image(App::make('url')->to('/dist/img/wu-header.gif'), 10, 5, 190, 25);
     Fpdf::Ln(25);
     $cabecera = array('NRO', 'TIPO', 'AGENTE', html_entity_decode('DESCRIPCIÓN'), 'MTCN', 'BENEFICIARIO', 'DESTINO', 'MONTO', 'OPERADOR');
     Fpdf::SetFont('Arial', '', 12);
     Fpdf::Cell(190, 8, html_entity_decode('Histórico de Incidencias'), 1, 0, 'C');
     Fpdf::Ln(13);
     // Anchuras de las columnas
     $w = array(10, 15, 30, 30, 20, 25, 25, 15, 20);
     // Cabeceras
     Fpdf::SetFont('Arial', 'B', 7);
     for ($j = 0; $j < count($cabecera); $j++) {
         Fpdf::Cell($w[$j], 8, $cabecera[$j], 1, 0, 'C');
     }
     Fpdf::Ln();
     // Datos
     Fpdf::SetFont('Arial', '', 7);
     foreach ($incidencias as $incidencia) {
         Fpdf::Cell($w[0], 8, $incidencia->codigo, 1, '', "C");
         Fpdf::Cell($w[1], 8, $incidencia->apertura->incidente->tipoIncidente->descripcion, 1, '', "L");
         $current_y = Fpdf::GetY();
         $current_x = Fpdf::GetX();
         if (strlen($incidencia->agente->nombre_fantasia) > 30) {
             Fpdf::MultiCell($w[2], 4, $incidencia->agente->nombre_fantasia, 1, 'L');
         } else {
             Fpdf::MultiCell($w[2], 8, $incidencia->agente->nombre_fantasia, 1, 'L');
         }
         Fpdf::SetXY($current_x + 30, $current_y);
         $current_y = Fpdf::GetY();
         $current_x = Fpdf::GetX();
         $descripcion = $incidencia->apertura->incidente->descripcion . ' -' . $incidencia->apertura->descripcion;
         if (strlen($descripcion) > 35) {
             Fpdf::MultiCell($w[3], 4, $descripcion, 1, 'L');
         } else {
             Fpdf::MultiCell($w[3], 8, $descripcion, 1, 'L');
         }
         Fpdf::SetXY($current_x + 30, $current_y);
         Fpdf::Cell($w[4], 8, $incidencia->mtcn, 1, 0, 'C');
         $current_y = Fpdf::GetY();
         $current_x = Fpdf::GetX();
         if (strlen($incidencia->beneficiario) > 25) {
             Fpdf::MultiCell($w[5], 4, $incidencia->beneficiario, 1, 'L');
         } else {
             Fpdf::MultiCell($w[5], 8, $incidencia->beneficiario, 1, 'L');
         }
         Fpdf::SetXY($current_x + 25, $current_y);
         $current_y = Fpdf::GetY();
         $current_x = Fpdf::GetX();
         if (strlen($incidencia->destino) > 25) {
             Fpdf::MultiCell($w[6], 4, $incidencia->destino, 1, 'L');
         } else {
             Fpdf::MultiCell($w[6], 8, $incidencia->destino, 1, 'L');
         }
         Fpdf::SetXY($current_x + 25, $current_y);
         Fpdf::Cell($w[7], 8, $incidencia->monto, 1, 0, 'C');
         $current_y = Fpdf::GetY();
         $current_x = Fpdf::GetX();
         if (strlen($incidencia->operador->nombre_apellido) > 20) {
             Fpdf::MultiCell($w[8], 4, $incidencia->operador->nombre_apellido, 1, 'L');
             Fpdf::SetXY($current_x - 190, $current_y + 4);
         } else {
             Fpdf::MultiCell($w[8], 8, $incidencia->operador->nombre_apellido, 1, 'L');
             Fpdf::SetXY($current_x - 190, $current_y);
         }
         Fpdf::Ln();
     }
     Fpdf::Output();
 }