public function Output($name = '', $dest = '') { // invalid symbols: "%*:<>?| and \x00-\x1F\x7F and \x80-\xFF $name = preg_replace('/[\\x00-\\x1F\\x22\\x25\\x2A\\x3A\\x3C\\x3E\\x3F\\x7C\\x7F-\\xFF]+/', '', $name); $name = str_replace('\\', '/', $name); if (in_array($dest, array('I', 'D'))) { $name = basename($name); } return parent::Output($name, $dest); }
/** * Generate and save or stream a PDF file * * @access public * @since 1.0.0 * @param string $path optional absolute path to the directory, if * not supplied the PDF will be streamed as a downloadable file (used * for admin previewing of the PDF) * * @return mixed nothing if a $path is supplied, otherwise a PDF download */ public function generate_pdf($path = '') { global $current_user, $post; // include the pdf library $root_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR; require_once $root_dir . '/../lib/tfpdf/tfpdf.php'; $image = wp_get_attachment_metadata($this->get_image_id()); // determine orientation: landscape or portrait if ($image['width'] > $image['height']) { $orientation = 'L'; } else { $orientation = "P"; } // End If Statement // Create the pdf // TODO: we're assuming a standard DPI here of where 1 point = 1/72 inch = 1 pixel // When writing text to a Cell, the text is vertically-aligned in the middle $fpdf = new tFPDF($orientation, 'pt', array($image['width'], $image['height'])); $fpdf->AddPage(); $fpdf->SetAutoPageBreak(false); // Add custom font $custom_font = apply_filters('sensei_certificates_custom_font', false); if ($custom_font) { if (isset($custom_font['family']) && isset($custom_font['file'])) { $fpdf->AddFont($custom_font['family'], '', $custom_font['file'], true); } } else { // Add multibyte font $fpdf->AddFont('DejaVu', '', 'DejaVuSansCondensed.ttf', true); } // set the certificate image $upload_dir = wp_upload_dir(); $fpdf->Image($upload_dir['basedir'] . '/' . $image['file'], 0, 0, $image['width'], $image['height']); // this is useful for displaying the text cell borders when debugging the PDF layout, // though keep in mind that we translate the box position to align the text to bottom // edge of what the user selected, so if you want to see the originally selected box, // display that prior to the translation $show_border = 0; // Get Student Data get_currentuserinfo(); $fname = $current_user->first_name; $lname = $current_user->last_name; $student_name = $current_user->display_name; if ('' != $fname && '' != $lname) { $student_name = $fname . ' ' . $lname; } // Get Course Data $course = array(); $course['post_title'] = __('Course Title', 'sensei-certificates'); $course_end_date = date('Y-m-d'); // Get the certificate template $certificate_template_custom_fields = get_post_custom($post->ID); // Define the data we're going to load: Key => Default value $load_data = array('certificate_font_style' => array(), 'certificate_font_color' => array(), 'certificate_font_size' => array(), 'certificate_font_family' => array(), 'image_ids' => array(), 'certificate_template_fields' => array()); // Load the data from the custom fields foreach ($load_data as $key => $default) { // set value from db (unserialized if needed) or use default $this->{$key} = isset($certificate_template_custom_fields['_' . $key][0]) && '' !== $certificate_template_custom_fields['_' . $key][0] ? is_array($default) ? maybe_unserialize($certificate_template_custom_fields['_' . $key][0]) : $certificate_template_custom_fields['_' . $key][0] : $default; } // End For Loop // Set default fonts setlocale(LC_TIME, get_locale()); if (false !== strpos(get_locale(), 'en')) { $date_format = apply_filters('sensei_certificate_date_format', 'jS F Y'); $date = date($date_format, strtotime($course_end_date)); } else { $date_format = apply_filters('sensei_certificate_date_format', '%Y %B %e'); $date = strftime($date_format, strtotime($course_end_date)); } $certificate_heading = __('Certificate of Completion', 'sensei-certificates'); // Certificate of Completion if (isset($this->certificate_template_fields['certificate_heading']['text']) && '' != $this->certificate_template_fields['certificate_heading']['text']) { $certificate_heading = $this->certificate_template_fields['certificate_heading']['text']; $certificate_heading = str_replace(array('{{learner}}', '{{course_title}}', '{{completion_date}}', '{{course_place}}'), array($student_name, $course['post_title'], $date, get_bloginfo('name')), $certificate_heading); } // End If Statement $certificate_message = __('This is to certify that', 'sensei-certificates') . " \r\n\r\n" . $student_name . " \r\n\r\n" . __('has completed the course', 'sensei-certificates'); // This is to certify that {{learner}} has completed the course if (isset($this->certificate_template_fields['certificate_message']['text']) && '' != $this->certificate_template_fields['certificate_message']['text']) { $certificate_message = $this->certificate_template_fields['certificate_message']['text']; $certificate_message = str_replace(array('{{learner}}', '{{course_title}}', '{{completion_date}}', '{{course_place}}'), array($student_name, $course['post_title'], $date, get_bloginfo('name')), $certificate_message); } // End If Statement $certificate_course = $course['post_title']; // {{course_title}} if (isset($this->certificate_template_fields['certificate_course']['text']) && '' != $this->certificate_template_fields['certificate_course']['text']) { $certificate_course = $this->certificate_template_fields['certificate_course']['text']; $certificate_course = str_replace(array('{{learner}}', '{{course_title}}', '{{completion_date}}', '{{course_place}}'), array($student_name, $course['post_title'], $date, get_bloginfo('name')), $certificate_course); } // End If Statement $certificate_completion = $date; // {{completion_date}} if (isset($this->certificate_template_fields['certificate_completion']['text']) && '' != $this->certificate_template_fields['certificate_completion']['text']) { $certificate_completion = $this->certificate_template_fields['certificate_completion']['text']; $certificate_completion = str_replace(array('{{learner}}', '{{course_title}}', '{{completion_date}}', '{{course_place}}'), array($student_name, $course['post_title'], $date, get_bloginfo('name')), $certificate_completion); } // End If Statement $certificate_place = sprintf(__('At %s', 'sensei-certificates'), get_bloginfo('name')); // At {{course_place}} if (isset($this->certificate_template_fields['certificate_place']['text']) && '' != $this->certificate_template_fields['certificate_place']['text']) { $certificate_place = $this->certificate_template_fields['certificate_place']['text']; $certificate_place = str_replace(array('{{learner}}', '{{course_title}}', '{{completion_date}}', '{{course_place}}'), array($student_name, $course['post_title'], $date, get_bloginfo('name')), $certificate_place); } // End If Statement $output_fields = array('certificate_heading' => 'text_field', 'certificate_message' => 'textarea_field', 'certificate_course' => 'text_field', 'certificate_completion' => 'text_field', 'certificate_place' => 'text_field'); foreach ($output_fields as $meta_key => $function_name) { // Check if the field has a set position if (isset($this->certificate_template_fields[$meta_key]['position']['x1'])) { $font_settings = $this->get_certificate_font_settings($meta_key); call_user_func_array(array($this, $function_name), array($fpdf, ${$meta_key}, $show_border, array($this->certificate_template_fields[$meta_key]['position']['x1'], $this->certificate_template_fields[$meta_key]['position']['y1'], $this->certificate_template_fields[$meta_key]['position']['width'], $this->certificate_template_fields[$meta_key]['position']['height']), $font_settings)); } // End If Statement } // End For Loop // download file $fpdf->Output('certificate-preview-' . $post->ID . '.pdf', 'I'); }
$pdf->cell(45, 6, $LANG['group'], 1, 0, "C", 1); $pdf->cell(25, 6, $LANG['author'], 1, 1, "C", 1); $pdf->SetFont('DejaVu', '', 9); foreach (explode('@|@', addslashes($_POST['text'])) as $line) { $elem = explode('@;@', $line); if (!empty($elem[0])) { $pdf->cell(70, 6, $elem[0], 1, 0, "L"); $pdf->cell(25, 6, $elem[1], 1, 0, "C"); $pdf->cell(25, 6, $elem[2], 1, 0, "C"); $pdf->cell(45, 6, $elem[3], 1, 0, "C"); $pdf->cell(25, 6, $elem[4], 1, 1, "C"); } } $pdfFile = "renewal_pdf_" . date("Y-m-d", mktime(0, 0, 0, date('m'), date('d'), date('y'))) . ".pdf"; //send the file $pdf->Output($_SESSION['settings']['path_to_files_folder'] . "/" . $pdfFile); echo '[{"file" : "' . $_SESSION['settings']['url_to_files_folder'] . '/' . $pdfFile . '"}]'; break; /** * CASE purging logs */ /** * CASE purging logs */ case "purgeLogs": db::debugMode(true); if (!empty($_POST['purgeFrom']) && !empty($_POST['purgeTo']) && !empty($_POST['logType']) && isset($_SESSION['user_admin']) && $_SESSION['user_admin'] == 1) { if ($_POST['logType'] == "items_logs") { DB::query("SELECT * FROM " . prefix_table("log_items") . " WHERE action=%s " . "AND date BETWEEN %i AND %i", "at_shown", intval(strtotime($_POST['purgeFrom'])), intval(strtotime($_POST['purgeTo']))); $nbElements = DB::count(); // Delete
include '../includes/libraries/tfpdf/tfpdf.php'; $pdf = new tFPDF(); //Add font for utf-8 $pdf->AddFont('DejaVu', '', 'DejaVuSansCondensed.ttf', true); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('DejaVu', '', 16); $pdf->Cell(0, 10, $txt['print_out_pdf_title'], 0, 1, 'C', false); $pdf->SetFont('DejaVu', '', 12); $pdf->Cell(0, 10, $txt['pdf_del_date'] . " " . date($_SESSION['settings']['date_format'] . " " . $_SESSION['settings']['time_format'], mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y"))) . ' ' . $txt['by'] . ' ' . $_SESSION['login'], 0, 1, 'C', false); $pdf->SetFont('DejaVu', '', 10); $pdf->SetFillColor(192, 192, 192); $pdf->cell(65, 6, $txt['label'], 1, 0, "C", 1); $pdf->cell(55, 6, $txt['login'], 1, 0, "C", 1); $pdf->cell(70, 6, $txt['pw'], 1, 1, "C", 1); $pdf->SetFont('DejaVu', '', 9); foreach ($full_listing as $item) { $pdf->cell(65, 6, stripslashes($item['label']), 1, 0, "L"); $pdf->cell(55, 6, stripslashes($item['login']), 1, 0, "C"); $pdf->cell(70, 6, stripslashes($item['pw']), 1, 1, "C"); } $pdf_file = "print_out_pdf_" . date("Y-m-d", mktime(0, 0, 0, date('m'), date('d'), date('y'))) . ".pdf"; //send the file $pdf->Output($_SESSION['settings']['cpassman_dir'] . "/files/" . $pdf_file); echo '[{"output":"' . $_SESSION['settings']['cpassman_url'] . '/files/' . $pdf_file . '"}]'; } break; case "store_personal_saltkey": $_SESSION['my_sk'] = str_replace(" ", "+", urldecode($_POST['sk'])); break; }
/** MakeChart: @mod: reference to module object @bdata: reference to array of bracket-table data @chartfile: path/name of file to be created or replaced @stylefile optional name of .css file to use instead of logged data @titles optional, mode enum for type of titles to include in boxes: 0 for(printer-ready) no labels in unplayed matches 1 for normal labels in all boxes (default) 2 for including match numbers in 'plan' mode Returns: TRUE on success, or lang-key for error message if: bad no. of teams, css parsing failed */ public function MakeChart(&$mod, &$bdata, $chartfile, $stylefile = FALSE, $titles = 1) { $db = cmsms()->GetDb(); $sql = 'SELECT COUNT(1) AS count FROM ' . cms_db_prefix() . 'module_tmt_teams WHERE bracket_id=? AND flags!=2'; $teamscount = (int) $db->GetOne($sql, array($bdata['bracket_id'])); if ($teamscount == 0) { return 'info_nomatch'; } //if no team, then no match list($minteams, $maxteams) = $mod->GetLimits($bdata['type']); if ($teamscount > $maxteams || $teamscount < $minteams) { return 'err_value'; } $css = new tmtStyler(); if (!$stylefile && $bdata['chartcss']) { $stylefile = $bdata['chartcss']; } if ($stylefile) { $config = cmsms()->GetConfig(); $csspath = cms_join_path($config['uploads_path'], $mod->GetPreference('uploads_dir'), $stylefile); if (file_exists($csspath)) { if (!$css->Parse($csspath)) { return 'err_styles'; } } } $this->mod = $mod; $this->layout = array(); $this->ldata = array(); $this->dashes = array(3, 3); $this->dots = array(0.2, 4); //high-use variables sent downstream in array,for extraction there $params = array(); $params['teamscount'] = $teamscount; //inter-box gaps $lw = $css->pxsize($css->GetWithDefault('.line', 'width', '2px')); //line width $bhm = $css->pxsize($css->GetSide('.box', 'margin', 'right')); //horz margin $gw = $css->pxsize($css->GetWithDefault('.chart', 'gapwidth', '20px')); //gap width $gw = max($lw + 4, $bhm * 2 + $gw); $params['gw'] = $gw; //includes box margins, if any $bvm = $css->pxsize($css->GetSide('.box', 'margin', 'top')); //vert margin $params['gh'] = max(2, $bvm * 2); //includes box margins, if any //chart margins $tp = $css->pxsize($css->GetSide('.chart', 'padding', 'top')); if ($tp < 2) { $tp = 2; } if ($titles == 0 && $tp < 40) { $tp = 40; } $th = $css->pxsize($css->GetWithDefault('.chart', 'font-size', '12pt')); //space for title string $params['tm'] = $tp + $th; //top $p = $css->pxsize($css->GetSide('.chart', 'padding', 'right')); $rm = $bhm + $p >= 5 ? $p : 5; if ($titles == 0 && $rm < 40) { $rm = 40; } $params['rm'] = $rm; //right $p = $css->pxsize($css->GetSide('.chart', 'padding', 'bottom')); $bm = $bvm + $p >= 5 ? $p : 5; if ($titles == 0 && $bm < 40) { $bm = 40; } $params['bm'] = $bm; //bottom $p = $css->pxsize($css->GetSide('.chart', 'padding', 'left')); $lm = $bhm + $p >= 5 ? $p : 5; if ($titles == 0 && $lm < 40) { $lm = 40; } $params['lm'] = $lm; //left //box parameters $bh = $css->pxsize($css->GetWithDefault('.box', 'height', '40px')); $params['bh'] = $bh; //content-height $params['bw'] = $css->pxsize($css->GetWithDefault('.box', 'width', '100px')); //content-width $bp = $css->pxsize($css->GetWithDefault('.box', 'padding', '0')); $params['bp'] = $bp; //all-sides' padding $blw = $css->pxsize($css->GetWithDefault('.box', 'border-width', '1px')); $params['blw'] = $blw; //all sides' border-width $params['bhm'] = $bhm; //l/r margin $params['bvm'] = $bvm; //t/b margin $this->Layout($params, $db, $bdata['bracket_id']); //setup boxes' size, position and chart size $this->Boxes($bdata, $db, $titles); //setup boxes' text and style if ($titles == 0) { //print-chart min size $min = $css->pxsize($css->GetWithDefault('.chart', 'minwidth', '770pt')); if ($this->ldata['width'] < $min) { $this->ldata['width'] = $min; } $min = $css->pxsize($css->GetWithDefault('.chart', 'minheight', '526pt')); if ($this->ldata['height'] < $min) { $this->ldata['height'] = $min; } } $cw = $this->ldata['width']; $ch = $this->ldata['height']; //check for custom .ttf files $config = cmsms()->GetConfig(); $rel = $mod->GetPreference('uploads_dir'); $custom = cms_join_path($config['uploads_path'], $rel); if (is_dir($custom)) { $pat = cms_join_path($custom, '*.ttf'); //tPDF recognises only lower-case filenames if (glob($pat, GLOB_NOSORT)) { define('_SYSTEM_TTFONTS', $ttfpath); } } $enc = $mod->GetPreference('export_encoding', 'UTF-8'); $utf = strcasecmp($enc, 'UTF-8') == 0; $pdf = new tFPDF($cw > $ch ? 'L' : 'P', 'px', array($cw, $ch), $utf); $pdf->SetAutoPageBreak(FALSE); $pdf->AddPage(); if ($titles > 0) { $back = $css->hex2rgb($css->GetWithDefault('.chart', 'background-color', FALSE)); //TODO support image-background if ($back) { $pdf->SetFillColor($back[0], $back[1], $back[2]); $pdf->Rect(0, 0, $cw, $ch, 'F'); //no chart border } } //display title $class = '.chart'; $title = $bdata['name'] ? $bdata['name'] : $mod->MissingName(); $ft = $css->GetWithDefault($class, 'font-family', 'sans'); $style = $css->GetWithDefault($class, 'font-weight', 'normal'); $attr = $style != 'bold' ? '' : 'b'; $style = $css->GetWithDefault($class, 'font-style', 'normal'); if (strpos($style, 'italic') !== FALSE || strpos($style, 'oblique') !== FALSE) { $attr .= 'i'; } $style = $css->GetWithDefault($class, 'text-decoration', 'none'); if (strpos($style, 'underline') !== FALSE) { $attr .= 'u'; } $pdf->AddFont($ft, $attr); $pdf->SetFont($ft, $attr, (int) ($th * 72 / 96 - 0.01) + 1); //tFPDF needs font size as pts if ($titles > 0) { $c = $css->hex2rgb($css->GetWithDefault($class, 'color', '#000')); $pdf->SetTextColor($c[0], $c[1], $c[2]); } $pdf->SetXY($lm, $tp); $pdf->Cell($this->ldata['width'] - $lm - $rm, $th, $title, 0, 0, 'C'); $params = array(); $params['pdf'] =& $pdf; $params['gw'] = $gw; $params['lw'] = $lw; if ($titles > 0) { $lc = $css->hex2rgb($css->GetWithDefault('.line', 'color', '#000')); } else { $lc = FALSE; } $params['lc'] = $lc; $params['ls'] = $css->GetWithDefault('.line', 'style', 'solid'); $params['blw'] = $blw; $params['bp'] = $bp; $params['boxstyles'] = array(); foreach (array('deflt' => '', 'nonf' => ':nonfirm', 'firm' => ':firm', 'done' => ':played', 'final' => ':winner') as $type => $suffix) { $class = '.box' . $suffix; $ft = $css->GetWithDefault($class, 'font-family', 'sans'); $style = $css->GetWithDefault($class, 'font-weight', 'normal'); $attr = $style != 'bold' ? '' : 'b'; $style = $css->GetWithDefault($class, 'font-style', 'normal'); if (strpos($style, 'italic') !== FALSE || strpos($style, 'oblique') !== FALSE) { $attr .= 'i'; } $style = $css->GetWithDefault($class, 'text-decoration', 'none'); if (strpos($style, 'underline') !== FALSE) { $attr .= 'u'; } $pdf->AddFont($ft, $attr); $size = $css->pxsize($css->GetWithDefault($class, 'font-size', $bh / 4)); if ($titles > 0) { $bc = $css->hex2rgb($css->GetWithDefault($class, 'border-color', $lc)); $fc = $css->hex2rgb($css->GetWithDefault($class, 'background-color', $back)); //TODO support image/url $tc = $css->hex2rgb($css->GetWithDefault($class, 'color', $lc)); } else { $bc = FALSE; $fc = FALSE; $tc = FALSE; } $params['boxstyles'][$type] = array('bw' => $css->pxsize($css->GetWithDefault($class, 'border-width', $lw)), 'bc' => $bc, 'bs' => $css->GetWithDefault($class, 'border-style', 'solid'), 'fill' => $fc, 'font' => $ft, 'color' => $tc, 'size' => (int) ($size * 72 / 96 - 0.01) + 1, 'attr' => $attr); } $this->Draw($params); if ($bdata['name']) { $pdf->SetTitle($bdata['name'], TRUE); } $pdf->Output($chartfile, 'F'); return TRUE; }
public function Output() { $file = "temporal/" . basename(tempnam("temporal/", 'tmp')); rename($file, $file . '.pdf'); $file .= '.pdf'; parent::Output($file, 'F'); chmod($file, 0555); //header('Location: temporal/'.$file); return $file; }
<?php // Optionally define the filesystem path to your system fonts // otherwise tFPDF will use [path to tFPDF]/font/unifont/ directory // define("_SYSTEM_TTFONTS", "C:/Windows/Fonts/"); require 'tfpdf.php'; $pdf = new tFPDF(); $pdf->AddPage(); // Add a Unicode font (uses UTF-8) $pdf->AddFont('DejaVu', '', 'DejaVuSansCondensed.ttf', true); $pdf->SetFont('DejaVu', '', 14); // Load a UTF-8 string from a file and print it $txt = file_get_contents('HelloWorld.txt'); $pdf->Write(8, $txt); // Select a standard font (uses windows-1252) $pdf->SetFont('Arial', '', 14); $pdf->Ln(10); $pdf->Write(5, 'The file size of this PDF is only 12 KB.'); $pdf->Output();
$template = readTemplate($fname,$dummy); if ($template) $text = $template->txt; else { $fname = defaultTemplateLanguage(); $template = readTemplate($fname,$dummy); if (!$template) die("Impossible to load a valid template"); else $text = $template->getV1(); } $fbgname = getTemplateBackgroundFilename(); if (!file_exists($fbgname)) $fbgname = ""; if (!isset($_GET["t"])) printCertificate(null,null,null,null,null); else { $CERTIFICATES = true; // flag require_once "extrarep.php"; // does all the work over db } sql_close(); $pdf->SetDisplayMode("fullpage","single"); $pdf->Output(preg_replace("/\W/","",$_SESSION["c_name"])." - Certificates.pdf", "I"); ?>
$pdf->Image('img/NoteA.png'); } elseif ($score < $scoreMax * 0.5 && $score > $scoreMax * 0.4) { $pdf->Image('img/NoteB.png'); } elseif ($score < $scoreMax * 0.7 && $score > $scoreMax * 0.5) { $pdf->Image('img/NoteC.png'); } elseif ($score < $scoreMax * 0.9 && $score > $scoreMax * 0.7) { $pdf->Image('img/NoteD.png'); } else { $pdf->Image('img/NoteE.png'); } } else { if ($score < $scoreMax * 0.1) { $pdf->Image('img/NoteA.png'); } elseif ($score < $scoreMax * 0.3 && $score > $scoreMax * 0.1) { $pdf->Image('img/NoteB.png'); } elseif ($score < $scoreMax * 0.5 && $score > $scoreMax * 0.3) { $pdf->Image('img/NoteC.png'); } elseif ($score < $scoreMax * 0.6 && $score > $scoreMax * 0.5) { $pdf->Image('img/NoteD.png'); } else { $pdf->Image('img/NoteE.png'); } } //enregistrement $date = date("d_m_Y_H_i"); $nomClient = $_POST["client"]; $pdf->Output('../PDF/' . $nomClient . '_' . $date . '.pdf'); $nomPDF = $nomClient . '_' . $date . '.pdf'; $stmt = $recupform->runQuery("INSERT INTO pdf(name, Client) VALUES ('{$nomPDF}','{$nomClient}')"); $stmt->execute(); $pdf->Output();
$pdf->Ln(); $pdf->SetFontSize(10); $pdf->Write(5,romance(cased_mysql_result($result,0,"name"))." - ".cased_mysql_result($result,0,"country")." - ".formatTime(cased_mysql_result($result,0,"best"),1)); $pdf->Ln(10); } $result = strict_query("SELECT $compstable.name, average, countries.name AS country FROM $compstable ". "JOIN (SELECT comp_id, MIN(average) AS average FROM $timestable WHERE cat_id=1 GROUP BY comp_id) avg ON avg.comp_id=$compstable.id ". "JOIN countries ON $compstable.country_id=countries.id ". "WHERE gender=\"f\" AND average!=\"\" ORDER BY average LIMIT 3"); if (sql_num_rows($result)) { $pdf->SetFont("","B",12); $pdf->Write(5,"Fastest females"); $pdf->Ln(); $pdf->SetFontSize(10); $count = 0; while ($row=cased_mysql_fetch_array($result)) { $pdf->Write(5,++$count.". ".romance($row["name"])." - ".$row["country"]." - ".formatTime($row["average"],1)); $pdf->Ln(); } } $pdf->SetDisplayMode("fullpage","single"); $pdf->Output(preg_replace("/\W/","",$_SESSION["c_name"])." - Classifications.pdf", "I"); sql_close(); } ?>
/** * Előregisztráció belépési nyilatkozat visszaadása pdf-ben */ public function belepesi_nyilatkozat() { // tartalom lekérdezése $content = $this->pre_register_model->alldata_query($this->registry->params['id']); // Optionally define the filesystem path to your system fonts // otherwise tFPDF will use [path to tFPDF]/font/unifont/ directory // define("_SYSTEM_TTFONTS", "C:/Windows/Fonts/"); require LIBS . '/tfpdf/tfpdf.php'; // require(LIBS . '/tfpdf/grid.php'); // $pdf = new PDF_Grid(); // $pdf->grid = true; $pdf = new tFPDF(); $pdf->SetTitle('Belépési nyilatkozat', true); $pdf->SetAutoPageBreak(false, 10); $pdf->AddPage(); // Add a Unicode font (uses UTF-8) $pdf->AddFont('Arial', '', 'arial.ttf', true); $pdf->AddFont('ArialBold', '', 'arialb.ttf', true); $pdf->AddFont('ArialItalic', '', 'arial_i.ttf', true); //$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true); $sor0 = 3.5; //8-es betűméretű sor magassága $sor1 = 4; //9-es betűméretű sor magassága $sor2 = 4.5; $beh = 6; // sor eleji behúzás $pdf->Rect(160, 11, 6, 6); $pdf->Rect(166, 11, 6, 6); $pdf->Rect(172, 11, 6, 6); $pdf->Rect(178, 11, 6, 6); $pdf->Rect(184, 11, 6, 6); $pdf->SetFont('ArialBold', '', 13); $pdf->SetXY(10, 17); $pdf->Cell(0, 10, 'Belépési Nyilatkozat', 0, 1, 'C'); $pdf->Ln(8); $pdf->SetFont('Arial', '', 9); //$pdf->SetXY(10,50); $pdf->Cell($beh); //$pdf->Cell(0,0,'Alulírott, a mai napon kijelentem, hogy a MULTI JOB Iskolaszövetkezetbe (Címünk: 1137 Budapest, Szent István krt. 2. I/2.)'); $pdf->Cell(58, $sor2, 'Alulírott, a mai napon kijelentem, hogy a ', 0, 0, 'L'); $pdf->SetFont('ArialBold', '', 9); $pdf->Cell(50, $sor2, 'MULTI JOB Iskolaszövetkezetbe ', 0, 0, 'L'); $pdf->SetFont('Arial', '', 9); $pdf->Cell(0, $sor2, '(Címünk: 1137 Budapest, Szent István krt. 2. I/2.)', 0, 1, 'L'); $pdf->Cell(0, $sor2, 'tagként kívánok belépni.', 0, 1, 'L'); //$pdf->Ln(4); $pdf->Cell($beh); $pdf->Cell(0, $sor2, 'Ezen belépési nyilatkozat aláírásával egyidejűleg kijelentem, hogy a Szövetkezet Alapszabályát, Szervezeti Működési', 0, 1, 'L'); $pdf->Cell(0, $sor2, ' Szabályzatát magamra nézve kötelező érvényűnek elfogadom.', 0, 1, 'L'); $pdf->Cell($beh); $pdf->Cell(0, $sor2, 'A szövetkezet feladatainak megvalósításában személyes munkámmal kívánok részt venni.', 0, 1, 'L'); $pdf->Cell($beh); $pdf->Cell(0, $sor2, 'A szövetkezet tartozásaiért vagyoni hozzájárulásom (megváltott részjegy) erejéig felelősséget vállalok.', 0, 1, 'L'); $pdf->Cell($beh); $pdf->Cell(0, $sor2, 'Vállalom, hogy a jelen nyilatkozatban megjelölt lakcímem megváltozását 5 munkanapon belül a Multi Job Iskolaszövetkezetnek', 0, 1, 'L'); $pdf->MultiCell(0, $sor2, 'bejelentem. Amennyiben ezt elmulasztom és ezzel az Iskolaszövetkezetnek többletköltséget okozok, azt az én kötelességem viselni.'); $pdf->MultiCell(0, $sor2, 'Tudomásul veszem, hogy amennyiben a címváltozás bejelentésének elmaradása miatt az év elején az Iskolaszövetkezet által a személyi jövedelemadó bevallásához – igazoltan – elküldött igazolása nem érkezik meg hozzám, azért és a bevallás elmaradásáért a felelősség kizárólag engem terhel.'); $pdf->Ln(2); $pdf->SetFont('ArialBold', '', 11); $pdf->Cell(0, $sor2, 'Büntetőjogi felelősségem tudatában kijelentem, hogy az alábbi adatok megfelelnek a valóságnak.', 0, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 9); $pdf->Cell($beh); $pdf->Cell(0, $sor2, 'Jelen nyilatkozat aláírásával hozzájárulásomat adom, hogy a személyi adataimat igazoló – a jelen nyilatkozatban feltüntetett –', 0, 1, 'L'); $pdf->MultiCell(0, $sor2, 'okmányaimat a Multi Job Iskolaszövetkezet lefénymásolja, a fénymásolat és jelen nyilatkozat által rögzített adataimat a munkaviszonyaimmal összefüggő célokra felhasználja és tárolja.' . "\n" . 'Hozzájárulok, hogy adataimat a Multi Job Iskolaszövetkezet személyi azonosításra nem alkalmas módon statisztikai célokra felhasználja, továbbadja.'); $pdf->Cell($beh); $pdf->Cell(0, $sor2, 'Büntetőjogi felelősségem tudatában kijelentem – és aláírásommal megerősítem – azt is, hogy a személyi adataimnál (az 1.', 0, 1, 'L'); $pdf->MultiCell(0, $sor2, 'pontban) feltüntetett bankszámlaszámot én jelöltem meg, azt legjobb tudásom, gondosságom alapján helyesen adtam meg. A bankszámlaszám hibás megjelöléséből származó minden anyagi kárért a felelősség és az ennek korrigálásával járó adminisztratív feladatok elvégzésével járó minden felelősség kizárólag engem terhel.'); $pdf->Ln(9); $pdf->SetFont('ArialBold', '', 12); $pdf->Cell(0, $sor1, '1. Személyi adatok:', 0, 1, 'L'); $pdf->Ln(3); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(12, $sor1, 'Név:', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(70, $sor1, $content['name'], 0, 0, 'L'); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(41, $sor1, 'Anyja neve (leánykori):', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, $sor1, $content['mother_name'], 0, 1, 'L'); $pdf->Ln(3); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(28, $sor1, 'Születési hely:', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(53.5, $sor1, $content['birth_place'], 0, 0, 'L'); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(25, $sor1, 'Születési idő:', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, $sor1, $content['birth_time'], 0, 1, 'L'); $pdf->Ln(3); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(40, $sor1, 'Diákigazolvány szám: ', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, $sor1, $content['student_card_number'], 0, 1, 'L'); $pdf->SetFont('Arial', '', 8); $pdf->Cell(0, $sor1, '(-ha van vonalkód az alatta lévő szám, -újon a kártyaszám, -ideiglenesen az igazolás sorszámát)', 0, 1, 'L'); $pdf->Ln(3); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(20, $sor1, 'TAJ szám:', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(62, $sor1, $content['taj_number'], 0, 0, 'L'); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(30, $sor1, 'Állampolgárság:', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(100, $sor1, $content['nationality'], 0, 1, 'L'); $pdf->Ln(3); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(33, $sor1, 'Adóazonosító jel:', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, $sor1, $content['tax_id'], 0, 1, 'L'); $pdf->Ln(3); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(35, $sor1, 'Bankszámla-szám:', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, $sor1, $content['bank_account_number'], 0, 1, 'L'); $pdf->Ln(2); $pdf->SetFont('ArialBold', '', 11); $pdf->Cell(0, $sor1, 'CSAK SAJÁT NÉVRE SZÓLÓ BANKSZÁMLASZÁMOT FOGADUNK EL!', 0, 1, 'C'); $pdf->Ln(2); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(46, $sor1, 'Számlavezető bank neve:', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, $sor1, $content['bank_name'], 0, 1, 'L'); $pdf->Ln(3); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(30, $sor1, 'Állandó lakcím:', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, $sor1, $content['permanent_address'], 0, 1, 'L'); $pdf->Ln(3); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(32, $sor1, 'Elérhetőségi cím:', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, $sor1, $content['contact_address'], 0, 1, 'L'); $pdf->Ln(3); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(22, $sor1, 'E-mail cím:', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(60, $sor1, $content['email_address'], 0, 0, 'L'); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(23, $sor1, 'Mobil szám:', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, $sor1, $content['telefon_number'], 0, 1, 'L'); $pdf->Ln(3); $pdf->SetFont('ArialBold', '', 10); $pdf->MultiCell(0, $sor1, 'Büntetőjogi felelősségem tudatában kijelentem hogy, nappali tagozatos hallgatója vagyok az alábbi oktatási intézménynek.'); $pdf->Ln(3); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(70, $sor1, 'Eddigi legmagasabb iskolai végzettség:', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); if ($content['school_type'] == 1) { $school_type = 'Általános iskola'; } elseif ($content['school_type'] == 2) { $school_type = 'Középiskola'; } elseif ($content['school_type'] == 3) { $school_type = 'Főiskola / egyetem'; } $pdf->Cell(0, $sor1, $school_type, 0, 1, 'L'); $pdf->Ln(3); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(70, $sor1 + 1, 'Jelenlegi oktatási intézmény (jelenlegi) neve, pontos címe:', 0, 1, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->MultiCell(0, $sor1, $content['school_data']); $pdf->Ln(6); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(63, $sor1, 'Belépés dátuma (a Multi Job ISz-be):', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(44, $sor1, '...................................', 0, 0, 'L'); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(30, $sor1, '(Kilépés dátuma:', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0, $sor1, '...................................)', 0, 1, 'L'); // Load a UTF-8 string from a file and print it //$txt = file_get_contents('HelloWorld.txt'); //$pdf->Write(8,$txt); // második oldal ------------------------- $pdf->AddPage(); $pdf->SetFont('ArialBold', '', 12); $pdf->Cell(0, $sor1, '2. Vagyoni hozzájárulás:', 0, 1, 'L'); $pdf->Ln(3); $pdf->SetFont('Arial', '', 9); $pdf->MultiCell(0, $sor1, 'Kötelezem magam, hogy a belépést követő első munkabéremből az 1.000.Ft (azaz egyezer forint) értékű részjegyet megváltom. Kilépéskor, kizáráskor a vagyoni hozzájárulást a szövetkezet visszafizeti.'); $pdf->Cell(0, $sor1, 'Szövetkezettel kötött megállapodást, a mai naptól számítva magamra nézve kötelező érvényűnek tekintem.', 0, 1, 'L'); $pdf->Ln(2); $pdf->SetFont('ArialBold', '', 9); $pdf->MultiCell(0, $sor1, 'Kijelentem, hogy az általam megadott e-mail címre küldött hivatalos leveleket, szerződéseket, bérjegyzéket, M30-as személyi jövedelemadó igazolást, hivatalosan megküldöttnek tekintem, valamint munkáajánlatokat és munkákkal kapcsolatos fontos információkat, egyéb hasznos tudnivalókat küldhet!'); $pdf->Ln(2); $pdf->MultiCell(0, $sor1, 'Tudomásul veszem, hogy a levont személyi jövedelemadóból alapesetben nem vagyok jogosult családi adókedvezményre vagy súlyos fogyatékos magánszemélyek személyi kedvezményére. '); $pdf->Ln(2); $pdf->SetFont('ArialItalic', '', 9); $pdf->MultiCell(0, $sor1, '(Ha jogosult bármelyikre, igényeljen hozzá nyilatkozatot belépésnél, mert az adóelőleg számításánál csak akkor tudjuk figyelembe venni e kedvezményeket, ha érvényes nyilatkozatot ad le a magánszemély! )'); $pdf->Ln(2); $pdf->SetFont('ArialBold', '', 9); $pdf->MultiCell(0, $sor1, 'A nyilatkozat tartalmát érintő bármely változás esetén, köteles vagyok haladéktalanul új nyilatkozatot tenni, vagy a korábbi nyilatkozatot visszavonni. '); $pdf->Ln(2); $pdf->SetFont('ArialItalic', '', 9); $pdf->MultiCell(0, $sor1, '(Amennyiben a nyilatkozattételkor fennálló körülmények ellenére a személyi – vagy családi kedvezmény érvényesítését jogalap nélkül kéri, aminek következtében az adóbevallása alapján 10 ezer forintot meghaladó befizetési különbözet mutatkozik, a befizetési különbözet 12 százalékát különbözeti-bírságként kell megfizetnie! )'); $pdf->Ln(8); $pdf->SetFont('ArialBold', '', 12); $pdf->Cell(21, $sor1, 'Budapest,', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(70, $sor1, '............................................................', 0, 0, 'L'); $pdf->Line(120, 101, 160, 101); $pdf->SetXY(133, 103); $pdf->SetFont('ArialBold', '', 11); $pdf->Cell(0, $sor1, 'aláírás', 0, 1, 'L'); $pdf->Ln(5); $pdf->SetFont('ArialBold', '', 12); $pdf->Cell(0, $sor1, 'Fontos tudnivalók', 0, 1, 'L'); $pdf->Ln(3); $pdf->SetFont('Arial', '', 8); $pdf->Cell(6, $sor0, '1.', 0, 0, 'L'); $pdf->MultiCell(0, $sor0, 'A munkavállaló tudomásul veszi, hogy az őt érintő munkaviszonyból eredő munkáltatói jogokat és kötelességeket Szücs Róbert elnök – mint munkáltató gyakorolja, illetve teljesíti. '); $pdf->Ln(2); $pdf->Cell(6, $sor0, '2.', 0, 0, 'L'); $pdf->MultiCell(0, $sor0, 'Tagsági viszonyt létesítésnek feltételei: iskolalátogatási igazolás, személyi igazolvány szám, belépési nyilatkozat, részjegy, adószám, TAJ-szám (külföldi állampolgárságú diák munkavállalónál: nappalis iskolalátogatási igazolás, a Magyarországon való jogszerű tartózkodást biztosító – magyar hatóság által kiadott - hatósági engedély száma, belépési nyilatkozat, részjegy, belföldi kézbesítési cím vagy kézbesítési megbízott, adószám és ha van TAJ-szám).'); $pdf->Ln(2); $pdf->Cell(6, $sor0, '3.', 0, 0, 'L'); $pdf->MultiCell(0, $sor0, 'A munkaviszony határozott időre jön létre, minden egyes munkához külön munkaszerződést kell kötni. '); $pdf->Ln(2); $pdf->Cell(6, $sor0, '4.', 0, 0, 'L'); $pdf->MultiCell(0, $sor0, 'A munkavállaló személyi alapbérét, munkakörét és a munkavégzés helyét az aktuális diákmunka szerződés tartalmazza. '); $pdf->Ln(2); $pdf->Cell(6, $sor0, '5.', 0, 0, 'L'); $pdf->MultiCell(0, $sor0, 'A munkarendet a Multi Job ISz. határozza meg. A napi munkaidő nem haladhatja meg a 12 órát és annak 8 hét átlagában a teljes munkaidőnek meg kell felelnie. Tudomásul veszem, hogy 18 év alatti munkavállalóként nem dolgozhatok napi 8 óránál többet!'); $pdf->Ln(2); $pdf->Cell(6, $sor0, '6.', 0, 0, 'L'); $pdf->MultiCell(0, $sor0, 'Az elvégzett munka után járó munkabért, a tárgyhót követő hónap 10. napjáig, banki átutalással kifizeti a munkaadó. Az egyéb juttatás feltételeit a Szövetkezet anyagi érdekeltségi rendszere határozza meg. Az 1997. évi LXXX. tv. (Tbj. tv.) 5. § (1) bekezdés b) pontja alapján a diákbér társadalombiztosítási (azaz nyugdíj- és egészségbiztosítási) járulékalapot NEM képező jövedelem. Az 1999. évi 47. APEH iránymutatás alapján 27%-os mértékű EHO-t NEM kell megfizetni a diákbér után.'); $pdf->Ln(2); $pdf->Cell(6, $sor0, '7.', 0, 0, 'L'); $pdf->MultiCell(0, $sor0, 'A munkavállaló közvetlen szakmai felettese az aktuális projekt vezető.'); $pdf->Ln(2); $pdf->Cell(6, $sor0, '8.', 0, 0, 'L'); $pdf->MultiCell(0, $sor0, 'A munkavállaló kötelezettséget vállal arra, hogy a feladatkörébe tartozó munkát lelkiismeretesen elvégzi, a kapott utasításokat teljesíti, betartja a munkavédelmi rendelkezéseket és előírásokat, valamint a munkafegyelemre vonatkozó egyéb szabályokat. Károkozás, vagy munkafegyelem megsértése esetén felelősséggel tartozik.'); $pdf->Ln(2); $pdf->SetFont('ArialBold', '', 8); $pdf->Cell(6, $sor0, '9.', 0, 0, 'L'); $pdf->MultiCell(0, $sor0, 'A bérkifizetés feltétele, hogy az ID számmal ellátott teljesítési igazolásokat minden munkavégzést követő 5 munkanapon belül a munkavállaló eljuttassa az aktuális projektvezetőhöz!'); $pdf->Ln(2); $pdf->SetFont('Arial', '', 8); $pdf->Cell(6, $sor1, '10.', 0, 0, 'L'); $pdf->MultiCell(0, $sor0, 'Külföldi állampolgárságú munkavállaló esetében Nyilatkozat: Kijelentem, hogy az adóévben jövedelmeimről adóbevallást nyújtok be. A külszolgálatra, külföldi kiküldetésre tekintve kapott összeg adóköteles részének megállapítására az általános – az átmeneti szabály alkalmazását választom.* A megfelelő szövegrész aláhúzandó. '); $pdf->Ln(2); $pdf->Cell(6, $sor0, '11.', 0, 0, 'L'); $pdf->MultiCell(0, $sor0, 'Nyilatkozat munkavédelmi és tűzvédelmi oktatásról Teljes felelősségem tudatában nyilatkozom, hogy a mai napon megtartott munkavédelmi és tűzvédelmi oktatás teljes körű anyagát munkakörömhöz kapcsolódó általános és speciális ismereteket megkaptam, azokat a munkavégzés során alkalmazom és betartom.'); $pdf->Ln(2); $pdf->SetFont('ArialBold', '', 8); $pdf->Cell(6, $sor0, '12.', 0, 0, 'L'); $pdf->MultiCell(0, $sor0, 'A Felek jelen szerződés aláírásával kifejezetten és egybehangzóan megállapodnak, hogy a Munkáltató jogosult a Munkavállalót a munkaszerződés alapján megillető mindenkori munkabére nettó 1,7 %-át, de bérfizetésenként legalább 300,-Ft (háromszáz forint) összeget, maximum 1000,-Ft (ezer forint) a Kandó Kámán Műszaki Főiskola Multi Job Iskolaszövetkezet működési költéseihez történő tagi hozzájárulásként a munkabér kifizetését megelőzően levonni. Munkavállaló kijelenti, hogy a tagi hozzájárulás felhasználásáról a Munkáltató megfelelően tájékoztatta és ezen megállapodást ennek ismeretében kötötte. '); $pdf->Ln(7); $pdf->SetFont('ArialBold', '', 10); $pdf->Cell(19, $sor1, 'Budapest,', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->Cell(70, $sor1, '...................................................', 0, 0, 'L'); $pdf->SetXY(120, 262); $pdf->Cell(70, $sor1, '...................................................', 0, 0, 'L'); $pdf->SetFont('ArialBold', '', 10); $pdf->SetXY(128, 266); $pdf->Cell(0, $sor1, '(munkavállaló) diák', 0, 1, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->SetXY(120, 277); $pdf->Cell(70, $sor1, '...................................................', 0, 0, 'L'); $pdf->SetFont('ArialBold', '', 10); $pdf->SetXY(135, 281); $pdf->Cell(0, $sor1, 'munkaadó', 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->SetXY(40, 280); $pdf->Cell(0, $sor1, 'p.h.', 0, 0, 'L'); //$pdf->Output('belepesi_nyilatkozat_' . $content['user_id'] . '.pdf','D'); $pdf->Output(); }