Example #1
0
 public function listAction()
 {
     $receipt = new \FPDI();
     // PDFの余白(上左右)を設定
     $receipt->SetMargins(0, 0, 0);
     // ヘッダーの出力を無効化
     $receipt->setPrintHeader(false);
     // フッターの出力を無効化
     $receipt->setPrintFooter(false);
     // フォントを登録
     $fontPathRegular = $this->getLibPath() . '/tcpdf/fonts/migmix-2p-regular.ttf';
     //         $regularFont = $receipt->addTTFfont($fontPathRegular, '', '', 32);
     $font = new TCPDF_FONTS();
     $regularFont = $font->addTTFfont($fontPathRegular);
     $fontPathBold = $this->getLibPath() . '/tcpdf/fonts/migmix-2p-bold.ttf';
     //         $boldFont = $receipt->addTTFfont($fontPathBold, '', '', 32);
     $font = new TCPDF_FONTS();
     $boldFont = $font->addTTFfont($fontPathBold);
     // ページを追加
     $receipt->AddPage();
     // テンプレートを読み込み
     //         $receipt->setSourceFile($this->getLibPath() . '/tcpdf/tpl/receipt.pdf');
     //         $receipt->setSourceFile($this->getLibPath() . '/tcpdf/tpl/template.pdf');
     //         $receipt->setSourceFile($this->getLibPath() . '/tcpdf/tpl/w01_1.pdf');
     $receipt->setSourceFile($this->getLibPath() . '/tcpdf/tpl/senijiten.pdf');
     // 読み込んだPDFの1ページ目のインデックスを取得
     $tplIdx = $receipt->importPage(1);
     // 読み込んだPDFの1ページ目をテンプレートとして使用
     $receipt->useTemplate($tplIdx, null, null, null, null, true);
     // 書き込む文字列のフォントを指定
     $receipt->SetFont($regularFont, '', 11);
     // 書き込む文字列の文字色を指定
     $receipt->SetTextColor(0, 0, 255);
     // X : 42mm / Y : 108mm の位置に
     $receipt->SetXY(59, 248);
     // 文字列を書き込む
     $receipt->Write(0, isset($_POST['name']) ? $_POST['name'] . 'さん' : '名無しさん');
     /*         $response = new Response(
                 // Output関数の第一引数にはファイル名、第二引数には出力タイプを指定する
                 // 今回は文字列で返してほしいので、ファイル名はnull、出力タイプは S = String を選択する
                 $receipt->Output(null, 'S'),
                 200,
                 array('content-type' => 'application/pdf')
             );
     
             // レスポンスヘッダーにContent-Dispositionをセットし、ファイル名をreceipt.pdfに指定
             $response->headers->set('Content-Disposition', 'attachment; filename="receipt.pdf"');
     
             return $response;
      */
     //         $receipt->
     $receipt->output('newpdf.pdf', 'I');
 }
Example #2
0
function renderPDF($id,$mode)
{
	$pdf = new FPDI();
	
	$db_catalogue_pages = new catalogue_pages;
	$db_catalogue_pages->get_one_catalogue_pages($id);
	$db_catalogue_pages->load();
	$template_id = $db_catalogue_pages->get_pag_template();
	
	$template = new catalogue_templates;

	$template->getOne($template_id);
	$template->load();

	$pdf->addPage("Landscape","Letter");

	$db_catalogue_objects = new catalogue_objects;
	$db_catalogue_objects->get_all($id);

	$pdf->SetFont('Arial','',14);

	$pdf->Image("pdftemplates/".$template->get_tem_file().".jpg",0,0);
	while($db_catalogue_objects->load())
	{
		$var = explode("_",$db_catalogue_objects->get_obj_var());
		if($var[0] == "image")
		{
			if(file_exists($db_catalogue_objects->field->obj_image)) $pdf->Image($db_catalogue_objects->field->obj_image,($db_catalogue_objects->field->obj_posx*0.353),($db_catalogue_objects->field->obj_posy*0.353),"50","50");
		}
		$pdf->SetXY($db_catalogue_objects->field->obj_posx*0.353,($db_catalogue_objects->field->obj_posy*0.35) + 60);
		$pdf->Write(5,$db_catalogue_objects->field->obj_text);
	}

	$db_catalogue_objects->close();
	$db_catalogue_pages->close();
	//if($mode=="I") $pdf->Output("page_".$id.".pdf", "I");
	//else $pdf->Output("pages/page_".$id.".pdf", "F");
	$pdf->Output("pages/page_".$id.".pdf", "F");
	
}
Example #3
0
 // use the imported page
 $pdf->useTemplate($templateId);
 $pdf->SetAutoPageBreak(false);
 //$db = new SQLite3('/home1/columch7/public_html/Columbia.db');
 $db = new SQLite3($columbiaDB);
 $ID = $_GET["ID"];
 $AUTH = $_GET["AUTH"];
 $results = $db->query('SELECT * FROM benton_new_patients where ID =' . $ID . ' and AUTH = ' . $AUTH);
 //$results = $db->query('SELECT * FROM Pasco_new_patients where ID=24');
 $row = $results->fetchArray();
 //print var_dump($row);
 //exit();
 //Name
 $pdf->SetFont('Helvetica');
 $pdf->SetXY(36, 36.5);
 $pdf->Write(10, $row["FIRST_NAME"] . " " . $row["LAST_NAME"]);
 //Phone
 if (strlen($row["PHONE"]) > 4) {
     $pdf->SetXY(150, 36.5);
     $pdf->Write(10, $row["PHONE"]);
 }
 //Cell Phone
 if (strlen($row["CELL_PHONE"]) > 4) {
     $pdf->SetXY(150, 43);
     $pdf->Write(10, $row["CELL_PHONE"]);
 }
 //Street Address
 $pdf->SetXY(25, 43);
 $pdf->Write(10, $row["ADDRESS"]);
 //Email
 $pdf->SetXY(135.5, 49.5);
function FlyerRendering($inputFile, $outputPostfix, $anschnitt)
{
    /*------------------------------------------------------------------------------------
     * Bitte tragt hier eure lokalen Freifunk Daten ein.
     *------------------------------------------------------------------------------------
     *
     * Hinweiss Community-Logo: 
     * Moegliche Format sind GIF, JPG und PNG.
     *
     * Laenge des Community Namen:
     * Falls der Community-Name zu lang ist und es zu einem Zeilenumbruch kommt,
     * dann sollte $communityNameFontSize verkleiner werden
     *
    -------------------------------------------------------------------------------------*/
    // Community Name fuer Hauptseite
    $communityNameText = "Freifunk Duckburg";
    $communityNameFontSize = 48.0;
    //in pt
    $communityNamePositionOffsetX = 0.0;
    // +/- in mm
    $communityNamePositionOffsetY = 0.0;
    // +/- in mm
    // Logo auf Kontaktseite
    $kontaktLogoDateiName = "logo-template.png";
    $kontaktLogoWidth = 66.25;
    //in mm  // Muss kleiner 98.0 mm sein! Hier bitte die gewuenschte Breite des Logos auf dem Flyer eintragen.
    $kontaktLogoPositionY = 47.0;
    //in mm  // Die Hoeheneinstellung ist etwas frickelig. Es klappt aber :-)
    // Texte fuer Seite mit Kontaktdaten
    $kontaktTitelText = "Kontakt";
    $kontaktInfoTexte = [["Webseite", "http://ffdb.freifunk.net"], ["Mail", "*****@*****.**"], ["Mailingliste", "*****@*****.**"], ["Twitter", "@FreiFunkDB"], ["Treffen", "Jeden zweiten Montag"], ["", "Und wo? Siehe unsere Webseite"], ["", ""], ["", ""]];
    // Text Fusszeile
    $kontaktFusszeileText = "Freifunk Duckburg e.V.";
    /*-----------------------------------------------------------------------------------
     *
     * Ab hier sollte nichts mehr geander werden!
     *
     ------------------------------------------------------------------------------------*/
    // Breite der einzelnen Seiten
    $wRechts = 99.0;
    //mm
    $wMitte = 98.0;
    //mm
    $wLinks = 97.0;
    //mm
    // Community Name
    $communityNamePositionX = $wLinks + $wMitte + $communityNamePositionOffsetX;
    //mm
    $communityNamePositionY = 12.2 + $communityNamePositionOffsetY;
    //mm
    // Kontakt Titel
    $kontaktTitelPositionX = $wLinks + 3.975;
    //mm
    $kontaktTitelPositionY = 10.425;
    //mm
    $kontaktTitelFontSize = 15.0;
    //pt
    // Kontakt Info
    $kontaktInfoTextPositionX = $kontaktTitelPositionX + 25.0;
    //mm
    $kontaktInfoPositionY = $kontaktTitelPositionY + 7.0;
    //mm
    $kontaktInfoZeilenOffsetY = 4.7;
    //mm
    $kontaktInfoFontSize = 10.9;
    //pt
    // Kontakt Logo
    $kontaktLogoPositionX = $wLinks + $wMitte / 2 - $kontaktLogoWidth / 2;
    // Kontakt Footer
    $kontaktFooterPositionX = $wLinks;
    //mm
    $kontaktFooterPositionY = 95.40000000000001;
    //mm
    $kontaktFooterWidth = $wMitte;
    //mm
    $kontaktFooterFontSize = 10.9;
    //pt
    echo "\n";
    // Output-Dasteiname zusammenbauen
    $outputFile = $outputPostfix . "-" . $inputFile;
    // initiate FPDI
    $pdf = new FPDI();
    echo "Input: {$inputFile}\n";
    $pageCount = $pdf->setSourceFile($inputFile);
    // Importiere Vorder- und Rueckseite
    $Vorderseite = $pdf->ImportPage(1);
    $Rueckseite = $pdf->ImportPage(2);
    // Seitenabmessungen holen
    $size = $pdf->getTemplateSize($Vorderseite);
    $dokumentBreite = round($size['w'], 2);
    $dokumentHoehe = round($size['h'], 2);
    echo "Dokumenten Breite: {$dokumentBreite} mm\n";
    echo "Dokumenten Hoehe: {$dokumentHoehe} mm\n";
    echo "Anschnitt: {$anschnitt} mm\n";
    // Vorderseite uebernehmen
    // Anfang eines bloeden Hacks wegen des FooterZeilen-Textes.
    // Der Footertext laesst sich nur einfügen, wenn die Seite eine A4 Seite ist.
    // Keine Ahnung warum!
    $pdf->AddPage('L');
    $tplVorderseite = $pdf->importPage(1);
    $pdf->useTemplate($tplVorderseite);
    //Margin ist wegen der Rand-Platzierung des Community Names wichtig.
    $pdf->SetMargins(0, 0, 0);
    // erstmal alle Fonts laden
    echo "Lade Fonts...\n";
    $pdf->AddFont('lato-bold');
    $pdf->AddFont('lato-regular');
    $pdf->AddFont('alternategothic');
    // Rendern Titel Text
    echo "Verarbeite Titel Text...\n";
    $pdf->SetFont('lato-bold');
    $pdf->SetFontSize($kontaktTitelFontSize);
    $pdf->SetTextColor(0, 0, 0);
    //schwarz
    $pdf->SetXY($kontaktTitelPositionX + $anschnitt, $kontaktTitelPositionY + $anschnitt);
    $pdf->Write(0, iconv('UTF-8', 'windows-1252', $kontaktTitelText));
    // Rendern Info Text
    echo "Verarbeite Info Text...\n";
    $pdf->SetTextColor(0, 0, 0);
    //schwarz
    $pdf->SetFontSize($kontaktInfoFontSize);
    foreach ($kontaktInfoTexte as $a) {
        $pdf->SetFont('lato-bold');
        $pdf->SetXY($kontaktTitelPositionX + $anschnitt, $kontaktInfoPositionY + $anschnitt);
        $pdf->Write(0, iconv('UTF-8', 'windows-1252', $a[0]));
        $pdf->SetFont('lato-regular');
        $pdf->SetXY($kontaktInfoTextPositionX + $anschnitt, $kontaktInfoPositionY + $anschnitt);
        $pdf->Write(0, iconv('UTF-8', 'windows-1252', $a[1]));
        $kontaktInfoPositionY = $kontaktInfoPositionY + $kontaktInfoZeilenOffsetY;
    }
    // Rendern Community Logo
    echo "Verarbeite Logo...\n";
    $pdf->Image($kontaktLogoDateiName, $kontaktLogoPositionX + $anschnitt, $kontaktLogoPositionY + $anschnitt, $kontaktLogoWidth, 0);
    // Rendern Fusszeilen Text
    echo "Verarbeite Fusszeile...\n";
    $pdf->SetFont('lato-regular');
    $pdf->SetFontSize($kontaktFooterFontSize);
    $pdf->SetTextColor(255, 255, 255);
    //weiss
    $pdf->SetXY($kontaktFooterPositionX + $anschnitt, $kontaktFooterPositionY + $anschnitt);
    $pdf->Cell($kontaktFooterWidth, 0, iconv('UTF-8', 'windows-1252', $kontaktFusszeileText), 0, 0, 'C');
    // Rendern Community Name
    echo "Verarbeite Community Name...\n";
    $pdf->SetFont('alternategothic');
    $pdf->SetFontSize($communityNameFontSize);
    $pdf->SetTextColor(0, 0, 0);
    //schwarz
    $pdf->SetXY($communityNamePositionX + $anschnitt, $communityNamePositionY + $anschnitt);
    $pdf->MultiCell($wRechts, 10, iconv('UTF-8', 'windows-1252', $communityNameText), 0, 'C');
    // Das war's mit dem Editieren
    // Original PDF Rueckseit uebernehmen
    $pdf->AddPage('L', array($dokumentBreite, $dokumentHoehe));
    $tplRueckseite = $pdf->importPage(2);
    $pdf->useTemplate($tplRueckseite);
    // und erstmal abspeichern
    echo "Zwischenspeichern...\n";
    $pdf->Output($outputFile);
    // Hier geht jetzt der Hack wegen der Footerzeile weiter
    // Die gerade abgespeicherte Datei wird erneut eingelesen
    // um dann im Seiten-Format der Ursprungsdatei erneut abgespeichert zu werden.
    // Is' doof, muss aber sein
    $pdf_2 = new FPDI();
    echo "Erneut laden...\n";
    $pageCount = $pdf_2->setSourceFile($outputFile);
    echo "Feinschliff...\n";
    $Vorderseite_2 = $pdf_2->ImportPage(1);
    $Rueckseite_2 = $pdf_2->ImportPage(2);
    $pdf_2->AddPage('L', array($dokumentBreite, $dokumentHoehe));
    $tplForderseite = $pdf_2->importPage(1);
    $pdf_2->useTemplate($tplForderseite);
    $pdf_2->AddPage('L', array($dokumentBreite, $dokumentHoehe));
    $tplRueckseite = $pdf_2->importPage(2);
    $pdf_2->useTemplate($tplRueckseite);
    echo "Output: {$outputFile}\n";
    $pdf_2->Output($outputFile);
    unset($pdf);
    unset($pdf_2);
}
Example #5
0
 function ten_tardiness_second($second_offenders = array())
 {
     $this->load->library('fpdf');
     define('FPDF_FONTPATH', $this->config->item('fonts_path'));
     $this->load->library('fpdi');
     // initiate FPDI
     $pdf = new FPDI('P', 'mm', 'Legal');
     $pdf->SetLeftMargin(20);
     $pdf->SetRightMargin(15);
     // add a page
     $pdf->AddPage();
     // set the sourcefile
     $pdf->setSourceFile('dtr/template/notice2nd.pdf');
     // select the first page
     $tplIdx = $pdf->importPage(1);
     // use the page we imported
     $pdf->useTemplate($tplIdx);
     $offices = Input::get('offices');
     $office_id = $offices[0];
     $m1 = 'Jul';
     $m2 = 'Aug';
     $m3 = 'Sep';
     $m4 = 'Oct';
     $m5 = 'Nov';
     $m6 = 'Dec';
     $mo1 = '07';
     $mo2 = '08';
     $mo3 = '09';
     $mo4 = '10';
     $mo5 = '11';
     $mo6 = '12';
     $pdf->SetFont('Arial', '', '12');
     $pdf->SetXY(155, 50);
     $pdf->Write(0, date('F d, Y'));
     $pdf->SetX(35);
     $pdf->SetFont('Arial', 'B', '');
     $pdf->Cell(0, 6, "HON. EDWARD S. HAGEDORN ", '', 1, 'L', FALSE);
     $pdf->SetFont('Arial', '', '');
     $pdf->SetX(35);
     $pdf->Cell(0, 6, "City Mayor", '', 1, 'L', FALSE);
     $pdf->SetX(35);
     $pdf->Cell(0, 6, "Puerto Princesa City", '', 1, 'L', FALSE);
     $pdf->Cell(0, 6, "", '', 1, 'C', FALSE);
     $pdf->Cell(0, 6, "Thru: ATTY. SHIRLEY R. DAGANTA", '', 1, 'C', FALSE);
     $pdf->Cell(0, 6, "CG Assistant Dept. Head II", '', 1, 'C', FALSE);
     $pdf->Cell(0, 6, "Assistant City Legal Officer II", '', 1, 'C', FALSE);
     $pdf->Ln(12);
     $pdf->SetX(35);
     $pdf->SetFont('Arial', 'B', '');
     $pdf->Write(0, 'Madam:');
     $pdf->SetFont('Arial', '', '');
     $pdf->Ln(6);
     $pdf->SetX(35);
     $pdf->MultiCell(0, 6, "                Please be informed that despite the first notice issued to him/her as per records in this office, it has been observed that the he/she has continuously incurred the following tardiness and undertime, viz:", 0, 'L', false);
     //$pdf->SetX(35);
     //$pdf->Cell(0,6," $number of your employees has incurred the following, viz:",'',0,'L',false);
     $pdf->SetFont('Arial', 'BI', 10);
     $pdf->Ln(2);
     $pdf->SetFillColor(210, 210, 210);
     //$pdf->SetX(20);
     //header
     $pdf->Cell(50, 8, "Name", 'RLTB', 0, 'C', 1);
     $pdf->Cell(20, 4, $m1, '1', 0, 'C', 1);
     $pdf->Cell(20, 4, $m2, '1', 0, 'C', 1);
     $pdf->Cell(20, 4, $m3, '1', 0, 'C', 1);
     $pdf->Cell(20, 4, $m4, '1', 0, 'C', 1);
     $pdf->Cell(20, 4, $m5, '1', 0, 'C', 1);
     $pdf->Cell(20, 4, $m6, '1', 1, 'C', 1);
     $pdf->SetFont('Arial', '', 9);
     $pdf->SetFillColor(240, 240, 240);
     $pdf->Cell(50, 4, "", 'RLB', 0, 'C', false);
     $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "UT", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
     $pdf->Cell(10, 4, "UT", '1', 1, 'C', 1);
     $pdf->SetFillColor(215, 255, 215);
     $year1 = Input::get('year');
     $tardis = $second_offenders;
     if (is_array($tardis)) {
         foreach ($tardis as $tardi) {
             $name = $this->Employee->get_employee_info($tardi, $field = '');
             $late1 = $this->Tardiness->count_late($name['employee_id'], $mo1, $year1, 1, 3);
             $late2 = $this->Tardiness->count_late($name['employee_id'], $mo2, $year1, 1, 3);
             $late3 = $this->Tardiness->count_late($name['employee_id'], $mo3, $year1, 1, 3);
             $late4 = $this->Tardiness->count_late($name['employee_id'], $mo4, $year1, 1, 3);
             $late5 = $this->Tardiness->count_late($name['employee_id'], $mo5, $year1, 1, 3);
             $late6 = $this->Tardiness->count_late($name['employee_id'], $mo6, $year1, 1, 3);
             $under_time1 = $this->Tardiness->count_late($name['employee_id'], $mo1, $year1, 2, 4);
             $under_time2 = $this->Tardiness->count_late($name['employee_id'], $mo2, $year1, 2, 4);
             $under_time3 = $this->Tardiness->count_late($name['employee_id'], $mo3, $year1, 2, 4);
             $under_time4 = $this->Tardiness->count_late($name['employee_id'], $mo4, $year1, 2, 4);
             $under_time5 = $this->Tardiness->count_late($name['employee_id'], $mo5, $year1, 2, 4);
             $under_time6 = $this->Tardiness->count_late($name['employee_id'], $mo6, $year1, 2, 4);
             $late1['tardi_count'] = $this->Tardiness->is_tardy_zero($late1['tardi_count']);
             $late2['tardi_count'] = $this->Tardiness->is_tardy_zero($late2['tardi_count']);
             $late3['tardi_count'] = $this->Tardiness->is_tardy_zero($late3['tardi_count']);
             $late4['tardi_count'] = $this->Tardiness->is_tardy_zero($late4['tardi_count']);
             $late5['tardi_count'] = $this->Tardiness->is_tardy_zero($late5['tardi_count']);
             $late6['tardi_count'] = $this->Tardiness->is_tardy_zero($late6['tardi_count']);
             $under_time1['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time1['tardi_count']);
             $under_time2['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time2['tardi_count']);
             $under_time3['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time3['tardi_count']);
             $under_time4['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time4['tardi_count']);
             $under_time5['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time5['tardi_count']);
             $under_time6['tardi_count'] = $this->Tardiness->is_tardy_zero($under_time6['tardi_count']);
             //start employee tardy
             $pdf->Cell(50, 4, ucwords(strtolower(utf8_decode($name['fname'] . ' ' . $name['mname'] . ' ' . $name['lname']))), 'RLTB', 0, 'L', false);
             $pdf->Cell(10, 4, $late1['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $under_time1['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $late2['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $under_time2['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $late3['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $under_time3['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $late4['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $under_time4['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $late5['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $under_time5['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $late6['tardi_count'], '1', 0, 'C', FALSE);
             $pdf->Cell(10, 4, $under_time6['tardi_count'], '1', 1, 'C', FALSE);
         }
     }
     $pdf->Cell(50, 4, "", 'RLTB', 0, 'L', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 0, 'C', FALSE);
     $pdf->Cell(10, 4, "", '1', 1, 'C', FALSE);
     // line break
     $pdf->Ln(5);
     $pdf->SetFont('Arial', '', '12');
     $pdf->SetX(35);
     $pdf->MultiCell(0, 6, "             Section 8, Rule XVII of the Omnibus Rules Implementing Book V of Executive Order No. 292, states that: \n\t\t\t\t   'Officers and employees who have incurred tardiness and undertime, regardless of the number of minutes per day, ten (10) times a month for at least two (2) consecutive months during the year or for at least two (2) months in a semester shall be subject to disciplinary action.'\n\t\t\t\t   Violation of the said rule carries the following penalties:\n\t\t\n\t\t\t\t   1.\tFirst Offense - Reprimand;\n\t\t\t\t   2.\tSecond Offense - Suspension for one (1) day to thirty (30) days; and\n\t\t\t\t   3.\tThird Offense - Dismissal.\n\t\t\n\t\t\t\t   For your appropriate action.\n\t\t", '', 1, 'L', false);
     $pdf->Cell(0, 6, " Very truly yours,              ", 0, 'R', FALSE);
     $pdf->Cell(0, 6, "              ", '', 1, 'R', FALSE);
     $pdf->Cell(0, 6, "               ", '', 1, 'R', FALSE);
     $pdf->SetFont('Arial', 'B', '');
     $pdf->Cell(0, 6, " FELIMON R. SABAS              ", '', 1, 'R', FALSE);
     $pdf->SetFont('Arial', '', '');
     $pdf->Cell(0, 6, " CG Department Head II              ", '', 1, 'R', FALSE);
     $pdf->Cell(0, 6, " (City Personnel Officer)              ", '', 1, 'R', FALSE);
     $pdf->MultiCell(0, 6, "\n\t\tNOTED:\n\t\t\n\t\tBY AUTHORITY OF THE CITY MAYOR:", 0, 'L', FALSE);
     $pdf->SetFont('Arial', 'B', '');
     $pdf->Cell(0, 6, "    ATTY. AGUSTIN M. ROCAMORA", '', 1, 'L', FALSE);
     $pdf->SetFont('Arial', '', '');
     $pdf->Cell(0, 6, "       City Administrator II", '', 1, 'L', FALSE);
     header('Cache-Control: maxage=3600');
     //Adjust maxage appropriately
     header('Pragma: public');
     //If the parameter is D = download F = save as file
     $pdf->Output('dtr/reports/ten_tardiness_second.pdf', 'F');
 }
file_put_contents('img.png', $unencodedData);
//Show the image
//echo '<img src="'.$_POST['img_val'].'" />';
$pdf = new FPDI();
$pdf->setSourceFile('TemplateReporte.pdf');
// seteamos la fuente, el estilo y el tamano
$pdf->SetFont('Times', 'B', 10);
// seteamos la posicion inicial
$pdf->SetXY(25, 80);
date_default_timezone_set('America/Bogota');
setlocale(LC_ALL, "es_ES");
$dias = array("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sábado");
$meses = array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
//agregamos una pagina
$pdf->AddPage();
$pdf->SetFont('Arial');
// seleccionamos la primera pagina del docuemnto importado
$tplIdx = $pdf->importPage(1);
// usamos la pagina importado como template
$pdf->useTemplate($tplIdx);
//seteamos la posicion X
$pdf->SetX(25);
//salto de linea
$pdf->Ln(55.2);
$pdf->SetFontSize(9);
$pdf->Write(0, utf8_decode("                                   " . $dias[date('w')] . " " . date('d') . " de " . $meses[date('n') - 1] . " del " . date('Y')));
$pdf->Image('img.png', 50, 110, 200);
unlink('img.png');
$pdf->Ln(155);
$pdf->Write(0, utf8_decode("                    Relación de costos anuales sobre proyectos ejecutados con éxito."));
$pdf->Output();
	$pdf->Cell(0, 0, "La cuota se calculará mensualmente de acuerdo a la cantidad de trabajadores y a la masa salarial bruta del período de cobertura.");
	$pdf->SetFont("Arial", "B", 9);

	$pdf->Ln(59.8);
	$pdf->Cell(56);
	$pdf->Cell(120, 0, $row2["PR_MAIL"]);

	// Muestro el texto de arriba de las firmas..
	$pdf->SetFont("Arial", "", 9);
	$pdf->Ln(4);
	$texto = explode("\n", "Por medio de la presente ".$row2["RAZON_SOCIAL"]." autoriza a Provincia ART S.A. a entregar a Provincia Seguros S.A. la información sobre la nómina (datos de Empleados, Masa Salarial, C.U.I.L., Nombre, etc.) e información complementaria que a criterio de la aseguradora permita tener un conocimiento de la actividad y del comportamiento del riesgo inherente a la cobertura.");
	for ($i=0; $i<count($texto); $i++) {
		$str = trim($texto[$i]);

		$pdf->WordWrap($str, 188);
		$pdf->Write(4, $str);

		$pdf->Ln(2);
	}

	$pdf->SetX(8);
	$pdf->SetY(250);
	$pdf->Cell(120, 0, "Buenos Aires, ".date("d")." de ".GetMonthName(date("m"))." de ".date("Y"));

	updateFechaImpresion((isset($idFormulario)?$idFormulario:0));
}
else {
	$pdf->AddPage();
	$pdf->SetTextColor(255, 0, 0);
	$pdf->SetFont("Arial", "B", 14);
Example #8
0
 function Write($h, $txt, $link = '')
 {
     if ($this->CurrentFont['type'] == 'Type0') {
         $this->SJISWrite($h, $txt, $link);
     } else {
         parent::Write($h, $txt, $link);
     }
 }
<?php

if (isset($_POST['nombre'])) {
    $nombre = $_POST['nombre'];
    $myfile = fopen("data/diplomas.txt", "a");
    date_default_timezone_set('America/Santiago');
    fwrite($myfile, $nombre . "\t" . date('d/m/Y H:i:s', time()) . "\n");
    fclose($myfile);
    $nombre = iconv('UTF-8', 'windows-1252', html_entity_decode($nombre));
    // http://www.setasign.com/products/fpdi/demos/simple-demo/
    require_once 'include/fpdf17/fpdf.php';
    require_once 'include/FPDI-1.5.4/fpdi.php';
    $pdf = new FPDI();
    $pdf->setSourceFile("media/felicitaciones.pdf");
    $tplIdx = $pdf->importPage(1);
    $size = $pdf->getTemplateSize($tplIdx);
    $pdf->AddPage('L', array($size['w'], $size['h']));
    $pdf->useTemplate($tplIdx);
    //$pdf->useTemplate($tplIdx, 10, 10, 100);
    $pdf->SetFont('Helvetica', 'B', 30);
    $pdf->SetTextColor(0, 0, 0);
    $mid_x = $size['w'] / 2;
    $str_w = $pdf->GetStringWidth($nombre) / 2;
    $pos_x = $mid_x - $str_w;
    $pdf->SetXY($pos_x, 65);
    $pdf->Write(0, $nombre);
    $pdf->Output();
} else {
    header("Location: index.php");
    die;
}
Example #10
0
 function decrypt_text($value, $key1, $key2)
 {
     if (!$value || !$key1 || !$key2) {
         return false;
     }
     $crypttext = base64_decode($value);
     $decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key1, $crypttext, MCRYPT_MODE_ECB, $key2);
     return trim($decrypttext);
 }
 $row = $results->fetchArray();
 //print var_dump($row);
 //exit();
 //Name
 $pdf->SetFont('Helvetica');
 $pdf->SetXY(30, 42.1);
 $pdf->Write(10, $row["FIRST_NAME"] . " " . $row["LAST_NAME"]);
 //Street Address
 $pdf->SetXY(22, 49.5);
 $pdf->Write(10, $row["ADDRESS"]);
 //Email
 $pdf->SetXY(130, 61);
 $pdf->Write(10, $row["EMAIL"]);
 //City
 $pdf->SetXY(15, 61.5);
 $pdf->Write(10, $row["CITY"]);
 //State
 $pdf->SetXY(72.5, 61.5);
 $pdf->Write(10, $row["STATE"]);
 //Zip
 $pdf->SetXY(100, 61.5);
 $pdf->Write(10, $row["ZIP"]);
        $row = mysql_fetch_assoc($sql);
    }
}
$pdf = new FPDI();
$pageCount = $pdf->setSourceFile("img/dogovir2015.pdf");
$pageNo = 1;
$templateId = $pdf->importPage($pageNo);
$size = $pdf->getTemplateSize($templateId);
$pdf->AddPage('P', array($size['w'], $size['h']));
$pdf->useTemplate($templateId);
$pdf->AddFont('Times', '', 'times.php');
$pdf->SetFont('Times', '', 10);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFontSize(11);
$pdf->SetXY(20, 40);
$pdf->Write(5, $row['lastname'] . " " . $row['firstname'] . " " . $row['patronymic']);
$pdf->SetXY(20, 47);
$pdf->Write(5, $row['pasp_serial'] . " " . $row['pasp_number'] . " виданий " . $row['pasp_issue'] . " " . date("d.m.Y", $row['pasp_date']));
$pdf->SetXY(20, 80);
$pdf->Write(5, $row['lastname'] . " " . $row['firstname'] . " " . $row['patronymic']);
$pdf->SetXY(35, 87);
if ($row['study_type'] == "Денна") {
    $pdf->Write(5, "денною");
}
if ($row['study_type'] == "Заочна") {
    $pdf->Write(5, "заочною");
}
$pdf->SetXY(160, 87);
if ($row['type'] == "mag") {
    $pdf->Write(5, "магістр");
}
Example #12
0
 function decrypt_text($value, $key1, $key2)
 {
     if (!$value || !$key1 || !$key2) {
         return false;
     }
     $crypttext = base64_decode($value);
     $decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key1, $crypttext, MCRYPT_MODE_ECB, $key2);
     return trim($decrypttext);
 }
 $row = $results->fetchArray();
 //print var_dump($row);
 //exit();
 //Name
 $pdf->SetFont('Helvetica');
 $pdf->SetXY(37, 38);
 $pdf->Write(10, $row["FIRST_NAME"] . " " . $row["LAST_NAME"]);
 //Phone
 $pdf->SetXY(137, 38);
 $pdf->Write(10, $row["PHONE"]);
 //Street Address
 $pdf->SetXY(26, 44.5);
 $pdf->Write(10, $row["ADDRESS"]);
 //Cell Phone
 $pdf->SetXY(139, 45);
 $pdf->Write(10, $row["CELL_PHONE"]);
 //City
 $pdf->SetXY(20, 51.5);
 $pdf->Write(10, $row["CITY"]);
 //State
 $pdf->SetXY(108, 51.5);
 $pdf->Write(10, $row["STATE"]);
Example #13
0
 public function download_tag()
 {
     $r1 = Input::has('r1') ? Input::get('r1') : 'Mr Sam Sample';
     $r2 = Input::has('r2') ? Input::get('r2') : 'Sample Street';
     $r3 = Input::has('r3') ? Input::get('r3') : 'Sampletown VIC 3000';
     $r4 = Input::has('r4') ? Input::get('r4') : 'phone +61 414 141 414';
     if ($user = Auth::user()) {
         $member = Member::where('user_id', '=', $user->id)->first();
         $r1 = $member->firstname . ' ' . $member->lastname;
         $r2 = $member->address;
         $r3 = $member->suburb . ' ' . $member->state . ' ' . $member->postcode;
         $r4 = 'phone ' . $member->phone;
     }
     $pdf = new FPDI('L');
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     $pdf->AddPage();
     $pdf->setSourceFile(realpath(dirname(__FILE__)) . '/../../public/assets/pdf/luggage_tags.pdf');
     $pdf->SetTextColor(0, 0, 0);
     $tplIdx = $pdf->importPage(1);
     $pdf->useTemplate($tplIdx);
     $pdf->SetFont('museosansrounded1000');
     $pdf->SetXY(121, 40);
     $pdf->Write(20, $r1);
     $pdf->SetXY(121, 45);
     $pdf->Write(20, $r2);
     $pdf->SetXY(121, 50);
     $pdf->Write(20, $r3);
     $pdf->SetXY(121, 55);
     $pdf->Write(20, $r4);
     $pdf->Output('luggage-tag.pdf');
 }
Example #14
0
file_put_contents('img.png', $unencodedData);
//Show the image
//echo '<img src="'.$_POST['img_val'].'" />';
$pdf = new FPDI();
$pdf->setSourceFile('TemplateReporte.pdf');
// seteamos la fuente, el estilo y el tamano
$pdf->SetFont('Times', 'B', 10);
// seteamos la posicion inicial
$pdf->SetXY(25, 80);
date_default_timezone_set('America/Bogota');
setlocale(LC_ALL, "es_ES");
$dias = array("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sábado");
$meses = array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
//agregamos una pagina
$pdf->AddPage();
$pdf->SetFont('Arial');
// seleccionamos la primera pagina del docuemnto importado
$tplIdx = $pdf->importPage(1);
// usamos la pagina importado como template
$pdf->useTemplate($tplIdx);
//seteamos la posicion X
$pdf->SetX(25);
//salto de linea
$pdf->Ln(55.2);
$pdf->SetFontSize(9);
$pdf->Write(0, utf8_decode("                                   " . $dias[date('w')] . " " . date('d') . " de " . $meses[date('n') - 1] . " del " . date('Y')));
$pdf->Image('img.png', 50, 110, 200);
unlink('img.png');
$pdf->Ln(155);
$pdf->Write(0, utf8_decode("                    Relación cantidad de Proyectos Finalizados con éxito y Cancelados."));
$pdf->Output();
     $pdf = new FPDI();
     // add a page
     $pdf->AddPage();
     // set the source file
     $pdf->setSourceFile("../image/patron_image/certificat_sanitaire.pdf");
     // import page 1
     $tplIdx = $pdf->importPage(1);
     // use the imported page and place it at point 10,10 with a width of 100 mm
     $pdf->useTemplate($tplIdx, 0, 0, 0);
     // now write some text above the imported page
     $pdf->SetFont('Helvetica');
     $pdf->SetFontSize(12);
     $pdf->SetTextColor(0, 0, 0);
     foreach ($array_sani as $row) {
         $pdf->SetXY($row['posx'], $row['posy']);
         $pdf->Write(0, requetemysql::gestion_string_maj(remplissage_formulaire($row, $info_veto, $info_client, $info_animal)));
     }
     $pdf->Output('../sauvegarde/animaux/' . $_POST['animal_id'] . '/certif_sanitaire_' . $variable . '.pdf', F);
     echo json_encode($variable);
 } elseif ($_GET['action'] == 'modif_lot') {
     $sql = "UPDATE medicament set lot=:lot WHERE nom=:nom and permission=:permission LIMIT 1";
     $st2 = $db->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
     $st2->execute(array(':lot' => $_POST['lot'], ':nom' => $_POST['nom'], ':permission' => $_SESSION['login']));
     $st2->closeCursor();
     echo json_encode("ok");
 } elseif ($_GET['action'] == 'medic') {
     $medicament = requetemysql::recup_medic(array('nom' => $_GET['recherche']));
     if (empty($medicament)) {
         //throw new Exception("Aucun medicament dans la base de donnee !");
     }
     echo $medicament;
 setlocale(LC_ALL, "es_ES");
 $dias = array("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sábado");
 $meses = array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
 //agregamos una pagina
 $pdf->AddPage();
 $pdf->SetFont('Arial');
 // seleccionamos la primera pagina del docuemnto importado
 $tplIdx = $pdf->importPage(1);
 // usamos la pagina importado como template
 $pdf->useTemplate($tplIdx);
 //seteamos la posicion X
 $pdf->SetX(25);
 //salto de linea
 $pdf->Ln(55.2);
 $pdf->SetFontSize(9);
 $pdf->Write(0, utf8_decode("                                   " . $dias[date('w')] . " " . date('d') . " de " . $meses[date('n') - 1] . " del " . date('Y')));
 $pdf->Ln(10);
 $pdf->SetFontSize(15);
 $pdf->write(15, '                                                    ' . $proBasic["nombreProyecto"]);
 $pdf->Ln(10);
 $pdf->SetFontSize(12);
 $pdf->write(15, '                                                               ' . utf8_decode($proBasic["nombreProyecto"]));
 $pdf->Ln(6);
 $pdf->write(15, '                                                               ' . $proBasic["fechaInicio"]);
 $pdf->Ln(6);
 $pdf->write(15, '                                                               ' . $proBasic["fechaFin"]);
 $pdf->Ln(6);
 $pdf->write(15, '                                                               ' . utf8_decode($proBasic["estadoProyecto"]));
 $pdf->Ln(6);
 $pdf->write(15, '                                                               ' . $proBasic["ejecutado"] . '%');
 $pdf->Ln(5);
    function preview($rows, $report_name = '')
    {
        $html = '
		
		<table width="100%" border="0">
	  <tr>
		<td colspan="3" align="center">' . $report_name . '</td>
	  </tr>
	  <tr>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	  </tr>
	</table>
			
	<table width="100%" border="1">
	<tbody><tr>
	  <td width="10%"><strong>Employee ID</strong></td>
	  <td width="9%"><strong>Name</strong></td>
	  <td width="4%"><strong>Sex</strong></td>
	  <td width="10%"><strong>Position/<br />
		Designation</strong></td>
	  <td width="13%"><strong>Office / Department</strong></td>
	  <td width="11%"><strong>Employment Status</strong></td>
	  <td width="6%"><strong>Salary Grade</strong></td>
	  <td width="9%"><strong>Eligibility</strong></td>
	  <td width="11%"><strong>Education</strong></td>
	  <td width="8%"><strong>Birthday</strong></td>
	  <td width="9%"><strong>Address</strong></td></tr>';
        $office = new Orm_office();
        foreach ($rows as $row) {
            $office->get_by_office_id($row->office_id);
            $type_employment = $this->options->type_employment();
            $birth_date = $row->birth_date;
            if ($row->birth_date == '0000-00-00') {
                $birth_date = '';
            }
            $html .= '
	<tr>
		<td>' . $row->id . '</td>
		 <td>' . $row->lname . ',' . $row->fname . ' ' . $row->mname . '</td>
		 <td>' . $row->sex . '</td>
		 <td>' . $row->position . '</td>
		 <td>' . $office->office_name . '</td>
		 <td>' . $type_employment[$row->permanent] . '</td>
		 <td>' . $row->salary_grade . '-' . $row->step . '</td>
		 <td>' . $row->eligibility . '</td>
		 <td>' . $row->education . '</td>
		 <td>' . $birth_date . '</td>
		 <td>' . $row->res_address . '</td>
	</tr>';
        }
        $html .= '
<tr><td><p>&nbsp;</p></td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td><td>&nbsp;</td></tr>
</tbody></table>';
        // Signatories
        $sr_prepared = $this->Settings->get_selected_field('sr_prepared');
        $sr_prepared_position = $this->Settings->get_selected_field('sr_prepared_position');
        $sr_certified = $this->Settings->get_selected_field('sr_certified');
        $sr_certified_position = $this->Settings->get_selected_field('sr_certified_position');
        $html .= '
	<table width="100%" border="0">
	  <tr>
		<td width="38%">&nbsp;</td>
		<td width="23%">&nbsp;</td>
		<td width="39%">&nbsp;</td>
	  </tr>
	  <tr>
		<td align="center">PREPARED BY:</td>
		<td>&nbsp;</td>
		<td align="center">CERTIFIED CORRECT:</td>
	  </tr>
	  <tr>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
		<td align="center">&nbsp;</td>
	  </tr>
	  <tr>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
		<td align="center">&nbsp;</td>
	  </tr>
	  <tr>
		<td align="center">' . $sr_prepared . '</td>
		<td>&nbsp;</td>
		<td align="center">' . $sr_certified . '</td>
	  </tr>
	  <tr>
		<td align="center">' . $sr_prepared_position . '</td>
		<td>&nbsp;</td>
		<td align="center">' . $sr_certified_position . '</td>
	  </tr>
	</table>
	';
        $this->load->library('MPDF52/mpdf');
        //$this->mpdf->WriteHTML('<p>Hello There hahahaha</p>');
        //$this->mpdf->Output('mpdf.pdf','I');
        // LOAD a stylesheet
        $stylesheet = file_get_contents(base_url() . 'css/mpdf/mpdfstyletables.css');
        $this->mpdf->WriteHTML($stylesheet, 1);
        // The parameter 1 tells that this is css/style only and no body/html/text
        $this->mpdf->WriteHTML($html);
        $this->mpdf->Output('dtr/template/pds/archives/pds_' . date('Y_m_d') . '.pdf', 'F');
        return 'dtr/template/pds/archives/pds_' . date('Y_m_d') . '.pdf';
        exit;
        $this->load->helper('settings');
        $this->load->library('fpdf');
        //define('FPDF_FONTPATH',$this->config->item('fonts_path'));
        $this->load->library('fpdi');
        // initiate FPDI
        $pdf = new FPDI('L', 'mm', 'Letter');
        // add a page
        $pdf->AddPage();
        // set the sourcefile
        //$pdf->setSourceFile('dtr/template/service_record/service_record.pdf');
        // import page 1
        //$tplIdx = $pdf->importPage(1);
        // use the imported page and place it at point 10,10 with a width of 100 mm
        //$pdf->useTemplate($tplIdx, 1, 1, 210);
        // now write some text above the imported page
        $pdf->SetFont('Arial');
        $pdf->SetTextColor(0, 0, 0);
        $pdf->SetXY(15, 60);
        $pdf->SetFont('Arial', '', 16);
        $pdf->Cell(0, 3, "Report Name", '', 1, 'C', false);
        //$pdf->Ln(4);
        //$e = new Employee_m();
        //$e->get_by_employee_id( $employee_id );
        $pdf->SetFont('Arial', '', 12);
        //$pdf->Cell(0,8,"Employee No.:".$e->id ,'',1,'L',false);
        //$pdf->Ln(2);
        //$pdf->SetFont('Arial', '', 12);
        //$pdf->Cell(0,8,"Employee Name:".$e->lname.', '.$e->fname.' '.$e->mname ,'',1,'L',false);
        $pdf->Ln(4);
        $pdf->Cell(0, 8, "Emp ID    Name                  Sex     Position/Designation    Office    Employment Status     Salary Grade Eligibility Education Birth Day   Address", '1', 1, 'L', false);
        $pdf->Ln(4);
        $i = 1;
        $this->load->helper('text');
        //$pdf->Cell(30,12, word_wrap('msayado maahhn ndhah ahhhehe so ano gagawin mo now', 10) ,'1',1,'L',false);
        //$pdf->MultiCell(30,3,word_wrap("hello this is a sample nlong text with line break ", 15) ,'1',1,'L',false);
        //$pdf->MultiCell(30,3,word_wrap("hello this is a sample nlong text with line break ", 15) ,'0',1,'L',false);
        foreach ($rows as $row) {
            $pdf->SetFont('Arial', '', 11);
            $pdf->SetX(10);
            //$pdf->Write(0, $row->id);
            $pdf->Cell(15, 12, $row->id, '1', 0, 'L', false);
            $pdf->SetX(29);
            //$pdf->Write(0, $row->lname.', '.$row->fname.''.$row->mname);
            $pdf->Cell(30, 12, word_wrap($row->lname . ', ' . $row->fname . '' . $row->mname, 10), '1', 1, 'L', false);
            $pdf->SetFont('Arial', '', 8);
            $pdf->SetX(62);
            $pdf->Write(0, $row->sex);
            $pdf->SetX(75);
            //$pdf->Write(0, $row->company);
            $pdf->Write(0, $row->position);
            //$pdf->SetFont('Arial', '', 12);
            $pdf->SetX(160);
            $pdf->Write(0, $row->movement);
            //$pdf->SetX(150);
            //$pdf->Write(0, $row->salary_grade);
            $pdf->SetFont('Arial', '', 8);
            $pdf->SetX(185);
            //$pdf->Write(0, $row->status);
            if ($row->govt_service == 1) {
                $row->govt_service = 'Yes';
            } else {
                $row->govt_service = 'No';
            }
            $pdf->SetX(190);
            //$pdf->Write(0, $row->govt_service);
            $pdf->SetFont('Arial', '', 12);
            if ($i == 6 || $i == 10 || $i == 13 || $i == 16 || $i == 19 || $i == 22) {
                $pdf->Ln(8);
            } else {
                $pdf->Ln(7);
            }
            $i++;
        }
        $pdf->Cell(0, 8, "--------------------------------------------------------- Nothing Follows ---------------------------------------------------------", '', 1, 'C', false);
        // Signatories
        $pdf->Ln(15);
        $pdf->SetX(20);
        $pdf->Cell(90, 5, "PREPARED BY:", '0', 0, 'C', false);
        $pdf->Cell(90, 5, "CERTIFIED CORRECT:", '0', 1, 'C', false);
        $pdf->Ln(10);
        $sr_prepared = $this->Settings->get_selected_field('sr_prepared');
        $sr_prepared_position = $this->Settings->get_selected_field('sr_prepared_position');
        $sr_certified = $this->Settings->get_selected_field('sr_certified');
        $sr_certified_position = $this->Settings->get_selected_field('sr_certified_position');
        $pdf->SetX(20);
        $pdf->Cell(90, 5, $sr_prepared, '0', 0, 'C', false);
        //4th param border
        $pdf->Cell(90, 5, $sr_certified, '0', 1, 'C', false);
        $pdf->SetX(20);
        $pdf->Cell(90, 5, $sr_prepared_position, '0', 0, 'C', false);
        $pdf->Cell(90, 5, $sr_certified_position, '0', 1, 'C', false);
        // Output
        $pdf->Output('dtr/template/pds/archives/pds_' . date('Y_m_d') . '.pdf', 'F');
        return 'dtr/template/pds/archives/pds_' . date('Y_m_d') . '.pdf';
    }
Example #18
0
     } else {
         $source = "docs/certificate.pdf";
     }
     $pagecount = $pdf->setSourceFile($source);
     $tplidx = $pdf->importPage(1);
     $pdf->addPage('L');
     $pdf->useTemplate($tplidx, 0, 0, 0);
     $date = date('jS F Y');
     $pdf->AddFont('DejaVu', '', 'DejaVuSansCondensed.ttf', true);
     $pdf->SetFont('DejaVu', '', 30);
     $pdf->SetTextColor(0, 0, 0);
     $pdf->SetXY(0, 95);
     $pdf->Cell(297, 15, $name, 0, 0, 'C', 0);
     $pdf->SetFont('Arial', '', 18);
     $pdf->SetXY(170, 160);
     $pdf->Write(0, $date);
     $attachment = $pdf->output('Certificate.pdf', 'S');
     header('Pragma: public');
     header('Expires: -1');
     header('Content-Transfer-Encoding: binary');
     header('Content-Type: application/pdf');
     header('Content-Disposition: attachment;filename="ISOS%20Certificate.pdf"');
     header('Cache-Control: max-age=0');
     // output the file
     echo $attachment;
     exit;
     break;
 case 'violationlist':
     $v = new Violation($_POST['vSelect']);
     $v->makeInactive();
     $v->saveToDB();
Example #19
0
public static function appendVoidText($path_to_dir,$filename,$page=''){

        require_once(Yii::app()->basePath.'/extensions/Fpdf/fpdf.php');
        require_once(Yii::app()->basePath.'/extensions/Fpdi/fpdi.php');

        $pdf = new FPDI();
        $pdf->setSourceFile($path_to_dir.'/'.$filename);
        $tplIdx = $pdf->importPage(1, '/MediaBox');
        $pdf->addPage();
        $pdf->useTemplate($tplIdx, true);
        //die("after set sourse");
        try{

            $pdf->SetFont('Helvetica','B',20);
            $pdf->SetTextColor(255,0,0);
            $pdf->SetXY (10,5);
            $pdf->SetFontSize(10);
            $pdf->Write(5,'VOID void VOID void VOID void VOID void VOID void VOID void VOID void VOID void VOID void VOID ');
            $pdf->Output($path_to_dir.'/'.$filename,'F');
        }catch (Exception $e) {
            $result['error']="Could not render this file";
            die('Could not render this file');
        }
        $result['path_to_dir']=$path_to_dir;
        $result['filename']=$filename;
        $result['ext']='pdf';
        return $result;
    }
Example #20
0
 private function _generatePdfSamplePage($filePath)
 {
     //error_reporting(E_ALL);
     //Zend_Loader::registerAutoload(false);
     //require_once('TCPDF.php');
     require_once 'PdfTool/fpdf/fpdf.php';
     require_once 'PdfTool/fpdi/fpdi.php';
     // initiate FPDI
     $pdf = new FPDI();
     // add a page
     $pdf->AddPage();
     // set the sourcefile
     $pageCount = $pdf->setSourceFile($filePath);
     //print_r($pageCount);
     //die();
     // import page 1
     $tplIdx = $pdf->importPage(1);
     // use the imported page and place it at point 10,10 with a width of 100 mm
     $pdf->useTemplate($tplIdx, 10, 10, 100);
     // now write some text above the imported page
     $pdf->SetFont('Arial');
     $pdf->SetTextColor(255, 0, 0);
     $pdf->SetXY(10, 10);
     $pdf->Write(0, "SAMPLE FOR VIEWING ONLY");
     $pdf->Output('sample.pdf', 'I');
     /*$pdf=new FPDF();
     		$pdf->AddPage();
     		$pdf->SetFont('Arial','B',16);
     		$pdf->Cell(40,10,'Hello World!');
     		$pdf->Output();*/
     die;
 }
Example #21
0
require_once 'pdf/fpdi.php';
// initiate FPDI
$pdf = new FPDI();
// add a page
$pdf->AddPage();
// set the sourcefile
$pdf->setSourceFile('Guía de Traslado.pdf');
// import page 1
$tplIdx = $pdf->importPage(1);
// use the imported page and place it at point 10,10 with a width of 100 mm
$pdf->useTemplate($tplIdx, 0, 0, null);
// now write some text above the imported page
$pdf->SetFont('Arial', '', 10);
$pdf->SetTextColor(255, 0, 0);
$pdf->SetXY(40, 31);
$pdf->Write(0, "Establecimiento");
$pdf->SetXY(40, 35);
$pdf->Write(0, "HEYMAN GRACIELA BEATRIZ");
$pdf->SetXY(40, 39);
$pdf->Write(0, "HEYMAN GRACIELA BEATRIZ");
$pdf->SetXY(40, 43);
$pdf->Write(0, "27059421862");
$pdf->SetXY(40, 47);
$pdf->Write(0, "CHA.72 PC.12 PARQUE INDUSTRIAL");
$pdf->SetXY(40, 51);
$pdf->Write(0, "General Guemes");
$pdf->SetXY(40, 55);
$pdf->Write(0, "Chaco");
$pdf->SetFont('Arial', '', 8);
$pdf->SetXY(16, 35);
$pdf->Write(0, "Razon Social");
Example #22
0
// initiate FPDI
$pdf = new FPDI();
$pdf->AddPage();
if (LANG == 'pt-br') {
    $pdf->setSourceFile('pdf/gurps4e-oficial-pt-br_uncompress.pdf');
    $tplIdx = $pdf->importPage(1);
    $pdf->useTemplate($tplIdx, 5, 5, 200, 0, true);
} else {
    $pdf->setSourceFile('pdf/gurps4e-oficial-en.pdf');
    $tplIdx = $pdf->importPage(1);
    $pdf->useTemplate($tplIdx, -5, 7, 220, 0, true);
}
$pdf->SetFont('Helvetica', '', 9);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY(72, 15.5);
$pdf->Write(0, $personagem->getNome());
$pdf->SetXY(134, 15.5);
$pdf->Write(0, $jogador->getNome());
$pdf->SetXY(188, 15.5);
$pdf->Write(0, $personagem->getTotalPonto());
$pdf->SetFontSize(7);
$pdf->SetXY(71.5, 21.5);
$pdf->WriteCenter(9, 0, number_format($personagem->getPeso(), 1, ',', '.'));
$pdf->SetXY(89, 21.5);
$pdf->Write(0, $personagem->getAlturaTexto());
$pdf->SetFontSize(9);
$pdf->SetXY(149, 21.5);
$pdf->Write(0, $personagem->getIdade());
$pdf->SetXY(79, 27.5);
$pdf->Write(0, $personagem->getAparencia());
$pdf->SetFont('Helvetica', '', 16);
Example #23
0
/**
 * Creates a PDF form for the copy center to print
 *
 * @param unknown $context            
 * @param unknown $exam            
 * @param unknown $userrequests            
 * @param unknown $useraccepts            
 * @param unknown $category            
 * @param unknown $totalpages            
 * @param unknown $course            
 */
function emarking_create_printform($context, $exam, $userrequests, $useraccepts, $category, $course)
{
    global $CFG;
    require_once $CFG->dirroot . "/mod/assign/feedback/editpdf/fpdi/fpdi2tcpdf_bridge.php";
    require_once $CFG->dirroot . "/mod/assign/feedback/editpdf/fpdi/fpdi.php";
    $originalsheets = $exam->totalpages + $exam->extrasheets;
    $copies = $exam->totalstudents + $exam->extraexams;
    $totalpages = emarking_exam_total_pages_to_print($exam);
    $pdf = new FPDI();
    $pdf->setSourceFile($CFG->dirroot . "/mod/emarking/img/printformtemplate.pdf");
    // Adds the form page from the template
    $pdf->AddPage();
    $tplIdx = $pdf->importPage(1);
    $pdf->useTemplate($tplIdx, 0, 0, 0, 0, $adjustPageSize = true);
    // Copy / Printing
    $pdf->SetXY(32, 48.5);
    $pdf->Write(1, "x");
    // Date
    $pdf->SetXY(153, 56);
    $pdf->Write(1, core_text::strtoupper(date('d')));
    $pdf->SetXY(163, 56);
    $pdf->Write(1, core_text::strtoupper(date('m')));
    $pdf->SetXY(173, 56);
    $pdf->Write(1, core_text::strtoupper(date('Y')));
    // Requested by
    $pdf->SetXY(95, 69);
    $pdf->Write(1, core_text::strtoupper($useraccepts->firstname . " " . $useraccepts->lastname));
    // Cost center
    $pdf->SetXY(95, 75.5);
    $pdf->Write(1, core_text::strtoupper($category->idnumber));
    // UAI campus
    $pdf->SetXY(95, 80.8);
    $pdf->Write(1, core_text::strtoupper(""));
    // Originals
    $pdf->SetXY(35, 106.5);
    $pdf->Write(1, core_text::strtoupper($originalsheets));
    // Copies
    $pdf->SetXY(60, 106.5);
    $pdf->Write(1, core_text::strtoupper("--"));
    // Number of printings
    $pdf->SetXY(84, 106.5);
    $pdf->Write(1, core_text::strtoupper($copies));
    // Black and white
    $pdf->SetXY(106, 106.5);
    $pdf->Write(1, "x");
    // Total pages
    $pdf->SetXY(135, 106.5);
    $pdf->Write(1, core_text::strtoupper($totalpages));
    // Number of printings Total
    $pdf->SetXY(84, 133.8);
    $pdf->Write(1, core_text::strtoupper(""));
    // Total pages Total
    $pdf->SetXY(135, 133.8);
    $pdf->Write(1, core_text::strtoupper(""));
    // Páginas totales Total
    $pdf->SetXY(43, 146);
    $pdf->Write(1, core_text::strtoupper($course->fullname . " , " . $exam->name));
    // Recepcionado por Nombre
    $pdf->SetXY(30, 164.5);
    $pdf->Write(1, core_text::strtoupper(""));
    // Recepcionado por RUT
    $pdf->SetXY(127, 164.5);
    $pdf->Write(1, core_text::strtoupper(""));
    $pdf->Output("PrintForm" . $exam->id . ".pdf", "I");
    // se genera el nuevo pdf
}
Example #24
0
 function decrypt_text($value, $key1, $key2)
 {
     if (!$value || !$key1 || !$key2) {
         return false;
     }
     $crypttext = base64_decode($value);
     $decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key1, $crypttext, MCRYPT_MODE_ECB, $key2);
     return trim($decrypttext);
 }
 $row = $results->fetchArray();
 //print var_dump($row);
 //exit();
 //Name
 $pdf->SetFont('Helvetica');
 $pdf->SetXY(35, 28.8);
 $pdf->Write(10, $row["FIRST_NAME"] . " " . $row["LAST_NAME"]);
 //Street Address
 $pdf->SetXY(24, 36.2);
 $pdf->Write(10, $row["ADDRESS"]);
 //Email
 $pdf->SetXY(21, 51.1);
 $pdf->Write(10, $row["EMAIL"]);
 //City
 $pdf->SetXY(18, 43.7);
 $pdf->Write(10, $row["CITY"]);
 //Zip
 $pdf->SetXY(100, 43.7);
 $pdf->Write(10, $row["ZIP"]);
 //Home Phone
 $pdf->SetXY(161, 28.8);
 $pdf->Write(10, $row["PHONE"]);
Example #25
0
     if (!$value || !$key1 || !$key2) {
         return false;
     }
     $crypttext = base64_decode($value);
     $decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key1, $crypttext, MCRYPT_MODE_ECB, $key2);
     return trim($decrypttext);
 }
 //loads the data from the table into the array $row
 $row = $results->fetchArray();
 //print var_dump($row);
 //exit();
 //instructions for where and how to place each piece of information on the pdf form
 //Name
 $pdf->SetFont('Arial');
 $pdf->SetXY(36, 35.5);
 $pdf->Write(10, $row["FIRST_NAME"] . " " . $row["LAST_NAME"]);
 //Phone
 $pdf->SetXY(147, 35.5);
 $pdf->Write(10, $row["HOME_PHONE"]);
 //Cell Phone
 if (strlen($row["CELL_PHONE"]) > 3) {
     $pdf->SetXY(142, 42.2);
     $pdf->Write(10, $row["CELL_PHONE"]);
 }
 //Street Address
 $pdf->SetXY(27, 42.2);
 $pdf->Write(10, $row["ADDRESS"]);
 //Email
 $pdf->SetXY(136, 48.5);
 $pdf->Write(10, $row["EMAIL"]);
 //City
Example #26
0
// // Указываем номер импортируемой страницы
// $tplIdx = $pdf->importPage(1);
// //указываем размер страницы
// //$pdf->useTemplate($tplIdx, 0, 0, 210, 297, true);
// $pdf->useTemplate($tplIdx, 0, 0, 210, 297, true);
//Ставим поля по нулям
$pdf->SetMargins(0, 0, 0, 0);
$pdf->SetAutoPageBreak(false);
//указываем шрифт и размер
$pdf->SetFont('Arial-BoldMT', '', '13');
//указываем цвет текста
$pdf->SetTextColor(0, 0, 0);
////////////////////////////////////////////////////////Добавляем данные в полис//////////////////////////////
//Время начала действия договора
$pdf->SetXY(120.8, 42.5);
$pdf->Write(0, $contract_data['start_time'][0]);
$pdf->SetXY(125.8, 42.5);
$pdf->Write(0, $contract_data['start_time'][1]);
$pdf->SetXY(137.3, 42.5);
$pdf->Write(0, $contract_data['start_time'][3]);
$pdf->SetXY(142.3, 42.5);
$pdf->Write(0, $contract_data['start_time'][4]);
//Дата начала
$pdf->SetXY(156, 42.5);
$pdf->Write(0, $contract_data['start_date'][0]);
$pdf->SetXY(161, 42.5);
$pdf->Write(0, $contract_data['start_date'][1]);
$pdf->SetXY(168.7, 42.5);
$pdf->Write(0, $contract_data['start_date'][3]);
$pdf->SetXY(173.9, 42.5);
$pdf->Write(0, $contract_data['start_date'][4]);
        $row = mysql_fetch_assoc($sql);
    }
}
$pdf = new FPDI();
$pageCount = $pdf->setSourceFile("img/ugoda2014.pdf");
$pageNo = 1;
$templateId = $pdf->importPage($pageNo);
$size = $pdf->getTemplateSize($templateId);
$pdf->AddPage('P', array($size['w'], $size['h']));
$pdf->useTemplate($templateId);
$pdf->AddFont('Times', '', 'times.php');
$pdf->SetFont('Times', '', 10);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFontSize(11);
$pdf->SetXY(35, 61);
$pdf->Write(5, $row['lastname'] . " " . $row['firstname'] . " " . $row['patronymic']);
$pdf->SetXY(55, 70);
if ($row['type'] == "mag") {
    $pdf->Write(5, "6-й курс, " . $row['faculty']);
}
if ($row['type'] == "spc") {
    $pdf->Write(5, "5-й курс " . $row['faculty']);
}
if ($row['study_type'] == "Денна") {
    $type = ", денна форма навчання";
}
if ($row['study_type'] == "Заочна") {
    $type = ", заочна форма навчання";
}
$pdf->SetXY(68, 76);
if ($row['type'] == "mag") {
Example #28
0
             }
         }
         $display_logo = true;
     }
 }
 if ($display_logo) {
     $pdf->Image($logo, 0.5, 0.4, 2.5, 0.9, null, null, 'N', true, 300, null, false, false, 0, true);
 } else {
     //set position for header text, if enabled
     $pdf->SetXY($x + 0.5, $y + 0.4);
 }
 //header
 if ($fax_header != '') {
     $pdf->SetLeftMargin(0.5);
     $pdf->SetFont($pdf_font, "", 10);
     $pdf->Write(0.3, $fax_header);
 }
 //fax, cover sheet
 $pdf->SetTextColor(0, 0, 0);
 $pdf->SetFont($pdf_font, "B", 55);
 $pdf->SetXY($x + 4.55, $y + 0.25);
 $pdf->Cell($x + 3.5, $y + 0.4, $text['label-fax-fax'], 0, 0, 'R', false, null, 0, false, 'T', 'T');
 $pdf->SetFont($pdf_font, "", 12);
 $pdf->SetFontSpacing(0.0425);
 $pdf->SetXY($x + 4.55, $y + 1.0);
 $pdf->Cell($x + 3.5, $y + 0.4, $text['label-fax-cover-sheet'], 0, 0, 'R', false, null, 0, false, 'T', 'T');
 $pdf->SetFontSpacing(0);
 //field labels
 $pdf->SetFont($pdf_font, "B", 12);
 if ($fax_recipient != '' || sizeof($fax_numbers) > 0) {
     $pdf->Text($x + 0.5, $y + 2.0, strtoupper($text['label-fax-recipient']) . ":");
Example #29
0
 function cto_apps($id = '')
 {
     $c = CompensatoryTimeoff::find($id);
     $name = $this->Employee->get_employee_info($c->employee_id);
     $office_name = $this->Office->get_office_name($name['office_id']);
     $this->load->library('fpdf');
     define('FPDF_FONTPATH', $this->config->item('fonts_path'));
     $this->load->library('fpdi');
     $pdf = new FPDI('P', 'mm', 'Legal');
     // add a page
     $pdf->AddPage();
     // set the sourcefile
     $pdf->setSourceFile('dtr/template/app_for_offset.pdf');
     // select the first page
     $tplIdx = $pdf->importPage(1);
     // use the page we imported
     $pdf->useTemplate($tplIdx);
     // set font, font style, font size.
     $pdf->SetFont('Arial', 'B', 12);
     // set initial placement
     $pdf->SetXY(158, 10.5);
     $pdf->Write(0, 'Tracking no: ' . $id);
     $pdf->Ln(9);
     $pdf->SetX(158);
     $pdf->Ln(20);
     // go to 25 X (indent)
     $pdf->SetX(12);
     $this->Office->fields = array('office_code');
     $office = $this->Office->get_office_info($name['office_id']);
     // write office
     $pdf->SetFont('Arial', 'B', 10);
     $pdf->Write(0, $office['office_name']);
     $pdf->SetFont('Arial', 'B', 12);
     //lname
     $pdf->SetX(99);
     $pdf->Write(0, $name['lname']);
     //fname
     $pdf->SetX(145);
     $pdf->Write(0, $name['fname']);
     //mname
     $pdf->SetX(187);
     $pdf->Write(0, $name['mname'][0] . '.');
     $pdf->Ln(10);
     //date of file
     $pdf->SetX(20);
     $pdf->Write(0, $c->date_file);
     //position
     $pdf->SetFont('Arial', 'B', 10);
     $pdf->SetX(63);
     $pdf->Write(0, $name['position']);
     $pdf->SetFont('Arial', 'B', 12);
     // We need to check what salary grade the office use
     if ($office['salary_grade_type'] == 'hospital') {
         $this->Salary_grade->salary_grade_type = 'hospital';
     }
     //monthly salary
     $pdf->SetX(140);
     $pdf->Write(0, 'P ' . number_format($this->Salary_grade->get_monthly_salary($name['salary_grade'], $name['step']), 2));
     $days = 'day';
     if ($c->days > 1) {
         $days = 'days';
     }
     $pdf->Ln(13);
     $pdf->SetX(30);
     $pdf->Write(0, $c->days . ' ' . $days);
     $pdf->SetX(140);
     //$pdf->Write(0, 'daily rate here');
     $pdf->Ln(13);
     $pdf->SetX(50);
     $pdf->Write(0, $this->Helps->get_month_name($c->month) . ' ' . $c->dates . ', ' . $c->year);
     $cto_balances_as_of = date("F d, Y", strtotime($c->date_file . "-1 day"));
     $pdf->SetXY(30, 106);
     $pdf->Write(0, $cto_balances_as_of);
     // Compute balances
     // (balance + earn) - spent
     $cto = CompensatoryTimeoff::getBalance($c->employee_id);
     //$balance = $cto->days;
     $balance = $cto;
     $cto = CompensatoryTimeoff::getEarnedSpent($c->employee_id);
     //$earn = $cto->days;
     $earn = $cto;
     $cto = CompensatoryTimeoff::getEarnedSpent($c->employee_id, 'spent');
     //$spent = $cto->days;
     $spent = $cto;
     $total_balance = $balance + $earn - $spent;
     $pdf->SetXY(35, 116);
     $pdf->Write(0, $total_balance);
     $pdf->SetX(87);
     $pdf->Write(0, '');
     // hours here
     // Get office head
     $office = $this->Office->get_office_info($name['office_id']);
     // If detailed
     if ($name['detailed_office_id'] != 0) {
         $detailed_office = $this->Office->get_office_info($name['detailed_office_id']);
         $office['office_head'] = $detailed_office['office_head'];
         $office['position'] = $detailed_office['position'];
     }
     // If Employee is Department head
     $o = new Office_m();
     $o->get_by_employee_id($c->employee_id);
     if ($o->exists()) {
         $office['office_head'] = 'CARMENCITA O. REYES';
         $office['position'] = 'Governor';
     }
     // We need to work out for this as exception
     if ($c->employee_id == '61') {
         $office['office_head'] = 'ANTONIO L. UY, JR. M.D.';
         $office['position'] = 'Vice Governor';
     }
     $pdf->Ln(6);
     $pdf->SetX(120);
     $pdf->Cell(73, 4, strtoupper($office['office_head']), '0', 0, 'C', FALSE);
     $pdf->Ln(5);
     $pdf->SetFont('Arial', '', 10);
     $pdf->SetX(120);
     $pdf->Cell(73, 4, $office['position'], '0', 0, 'C', FALSE);
     $pdf->SetFont('Arial', 'B', 12);
     // Statement of CTO signatory
     $statement_certified = Setting::getField('cto_certification');
     $statement_certified_position = Setting::getField('cto_certification_position');
     $pdf->Ln(5);
     $pdf->SetX(22);
     $pdf->Cell(73, 4, strtoupper($statement_certified), '0', 0, 'C', FALSE);
     $pdf->Ln(5);
     $pdf->SetFont('Arial', '', 10);
     $pdf->SetX(22);
     $pdf->Cell(73, 4, $statement_certified_position, '0', 0, 'C', FALSE);
     $pdf->SetFont('Arial', 'B', 12);
     // ====================Second Form =============
     $pdf->Ln(44);
     $pdf->SetX(12);
     // write office
     $pdf->SetFont('Arial', 'B', 10);
     $pdf->Write(0, $office['office_name']);
     $pdf->SetFont('Arial', 'B', 12);
     //lname
     $pdf->SetX(99);
     $pdf->Write(0, $name['lname']);
     //fname
     $pdf->SetX(145);
     $pdf->Write(0, $name['fname']);
     //mname
     $pdf->SetX(187);
     $pdf->Write(0, $name['mname'][0] . '.');
     $pdf->Ln(10);
     //date of file
     $pdf->SetX(20);
     $pdf->Write(0, $c->date_file);
     //position
     $pdf->SetFont('Arial', 'B', 10);
     $pdf->SetX(63);
     $pdf->Write(0, $name['position']);
     $pdf->SetFont('Arial', 'B', 12);
     //monthly salary
     $pdf->SetX(140);
     $pdf->Write(0, 'P ' . number_format($this->Salary_grade->get_monthly_salary($name['salary_grade'], $name['step']), 2));
     $pdf->Ln(13);
     $pdf->SetX(30);
     $pdf->Write(0, $c->days . ' ' . $days);
     $pdf->SetX(140);
     //$pdf->Write(0, 'daily rate here');
     $pdf->Ln(13);
     $pdf->SetX(50);
     $pdf->Write(0, $this->Helps->get_month_name($c->month) . ' ' . $c->dates . ', ' . $c->year);
     $cto_balances_as_of = date("F d, Y", strtotime($c->date_file . "-1 day"));
     $pdf->Ln(30);
     $pdf->SetX(30);
     //$pdf->Write(0, $cto_balances_as_of);
     $pdf->Ln(10);
     $pdf->SetX(35);
     //$pdf->Write(0, $total_balance);
     $pdf->Ln(6);
     $pdf->SetX(120);
     $pdf->Cell(73, 4, strtoupper($office['office_head']), '0', 0, 'C', FALSE);
     $pdf->Ln(5);
     $pdf->SetFont('Arial', '', 10);
     $pdf->SetX(120);
     $pdf->Cell(73, 4, $office['position'], '0', 0, 'C', FALSE);
     $pdf->SetFont('Arial', 'B', 12);
     $pdf->Ln(5);
     $pdf->SetX(22);
     $pdf->Cell(73, 4, strtoupper($statement_certified), '0', 0, 'C', FALSE);
     $pdf->Ln(5);
     $pdf->SetFont('Arial', '', 10);
     $pdf->SetX(22);
     $pdf->Cell(73, 4, $statement_certified_position, '0', 0, 'C', FALSE);
     $pdf->SetFont('Arial', 'B', 12);
     header('Cache-Control: maxage=3600');
     //Adjust maxage appropriately
     header('Pragma: public');
     $pdf->Output('dtr/reports/cto-apps-' . intval($c->employee_id) . '.pdf', 'I');
     //return Redirect::to('dtr/reports/leave-apps-'.$rows['employee_id'].'.pdf', 'refresh');
 }
Example #30
-2
 function page4($employee_id)
 {
     $this->load->helper('settings');
     $this->load->library('fpdf');
     //define('FPDF_FONTPATH',$this->config->item('fonts_path'));
     $this->load->library('fpdi');
     //print_r($personal_info);
     // initiate FPDI
     $pdf = new FPDI('P', 'mm', 'Legal');
     // add a page
     $pdf->AddPage();
     // set the sourcefile
     $pdf->setSourceFile('dtr/template/pds/page4.pdf');
     // import page 1
     $tplIdx = $pdf->importPage(1);
     // use the imported page and place it at point 10,10 with a width of 100 mm
     $pdf->useTemplate($tplIdx, 1, 1, 210);
     // now write some text above the imported page
     $pdf->SetFont('Arial');
     $pdf->SetTextColor(0, 0, 0);
     $pdf->SetXY(8, 14);
     $q = new Question();
     $q->order_by('question_no');
     $questions = $q->get_by_employee_id($employee_id);
     foreach ($questions as $question) {
         if ($question->question_no == 1) {
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 2) {
             $pdf->Ln(21);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 3) {
             $pdf->Ln(26);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 4) {
             $pdf->Ln(21);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 5) {
             $pdf->Ln(26);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 6) {
             $pdf->Ln(26);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 7) {
             $pdf->Ln(21);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 8) {
             $pdf->Ln(35);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 9) {
             $pdf->Ln(12);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
         if ($question->question_no == 10) {
             $pdf->Ln(13);
             if ($question->answer == 1) {
                 $setx = 138.5;
             } else {
                 $setx = 164;
             }
             $pdf->SetX($setx);
             $pdf->Write(0, 'X');
         }
     }
     $pdf->SetXY(8, 233);
     //$pdf->Write(0, 'X');
     $r = new Reference();
     $references = $r->get_by_employee_id($employee_id);
     foreach ($references as $reference) {
         $pdf->SetX(8);
         $pdf->Write(0, $reference->name);
         $pdf->SetX(72);
         $pdf->Write(0, $reference->address);
         $pdf->SetX(134);
         $pdf->Write(0, $reference->tel_no);
         $pdf->Ln(4);
     }
     // CTC NO
     $pdf->SetXY(15, 275);
     $pdf->Write(0, $reference->ctc_no);
     $pdf->Ln(13);
     $pdf->SetX(15);
     $pdf->Write(0, $reference->issue_at);
     $pdf->Ln(13);
     $pdf->SetX(15);
     $pdf->Write(0, $reference->issue_on);
     $pdf->SetX(90);
     $pdf->Write(0, date('F d, Y'));
     // Output
     $pdf->Output('dtr/template/pds/page4_' . $employee_id . '.pdf', 'F');
     //header("location:".base_url()."resources/pdfs/archives/page4_".$employee_id.'.pdf');
     $this->pds[] = 'dtr/template/pds/page4_' . $employee_id . '.pdf';
 }