<?php

//require ("fpdf/fpdf.php");
$uid = $this->session->userdata('uid');
if (!$uid) {
    die("You must login to do that.");
}
$sid = $this->db->query("SELECT `store` FROM `employees` WHERE `uniq_id` = (SELECT `employee_id` FROM `warnings` WHERE `warning_id` = {$warning_id} LIMIT 0,1)");
$sid = $sid->first_row();
$verified = $this->cpm_functions->verify_access($uid, $sid->store);
if ($verified) {
    $pdf = new FPDF();
    $pdf->addFont("barCode39fHR", "", "bar39fh.php");
    $pdf->SetRightMargin(160);
    $pdf->SetTopMargin(118);
    $pdf->SetAutoPageBreak(TRUE, 62);
    $pdf->AddPage();
    $pdf->addFont("BarCode39fHR", "", "bar39fh.php");
    $bottom = $this->cpm_pdflayouts->warning_bottom($warning_id);
    $information = $this->cpm_pdflayouts->warning_info($warning_id);
    if ($information !== FALSE && $bottom !== FALSE) {
        foreach ($information as $val) {
            switch ($val["type"]) {
                case "SetRightMargin":
                    $pdf->SetRightMargin($val[0]);
                    break;
                case "SetTopMargin":
                    $pdf->SetTopMargin($val[0]);
                    break;
                case "MultiCell":
                    $pdf->MultiCell($val[0], $val[1], $val[2], $val[3], $val[4]);
示例#2
0
<?php

define('FPDF_FONTPATH', '.');
require '../../fpdf.php';
$pdf = new FPDF();
$pdf->addFont('Calligrapher', '', 'calligra.php');
$pdf->addPage();
$pdf->setFont('Calligrapher', '', 35);
$pdf->cell(0, 10, 'Enjoy new fonts with FPDF!');
$pdf->output();
<?php

//require ('fpdf/fpdf.php');
$term = $this->db->query("SELECT `reason_desc`,`termination_details`,`no_rehire_desc`,`employee_id`,`users`.`first_name` AS `mfname`,`users`.`last_name` AS `mlname`,`employees`.`first_name` AS `efname`,`employees`.`last_name` AS `elname`,`manager_id`,`termination_date`,`last_day_worked`,`separation`,`reason`,`rehire`,`reference_warning`,`scanned`,`status`,`terminations`.`store` FROM\n\t`terminations` JOIN `employees` ON `employee_id` = `uniq_id`  JOIN `users` ON `user_id` = `manager_id` JOIN `termination_descriptions` ON `terminations`.`termination_id` = `termination_descriptions`.`termination_id` JOIN `termination_definitions` ON `reason` = `reason_code` WHERE `terminations`.`termination_id` = {$tid}");
$term = $term->first_row();
$sName = $this->db->query("SELECT `store_name` FROM `stores` WHERE `store_id` = {$term->store}")->first_row()->store_name;
$employee_name = ucwords(strtolower("{$term->efname} {$term->elname}"));
$manager_name = ucwords(strtolower("{$term->mfname} {$term->mlname}"));
$rehire = "No";
if ($term->rehire == 1) {
    $rehire = "Yes";
} elseif ($term->rehire == 2) {
    $rehire = "Conditionally";
}
$pdf = new FPDF();
$pdf->addFont('barCode39fHR', '', 'bar39fh.php');
$pdf->SetRightMargin(160);
$pdf->SetTopMargin(118);
$pdf->SetAutoPageBreak(TRUE, 62);
$pdf->AddPage();
$pdf->setFont('barCode39fHR', '', 24);
$pdf->Text(10, 20, "*4-{$tid}*");
$pdf->setFont('Arial', 'B', 18);
$pdf->Text(15, 35, 'Voluntary Termination');
$pdf->setFont('Arial', '', 10);
$pdf->Text(15, 40, "Employee:      {$employee_name} ({$term->employee_id})");
$pdf->Text(15, 45, "Issued by:       {$manager_name} ({$term->manager_id}) / {$sName}");
$pdf->Text(15, 55, "Termination Date:\t{$term->termination_date}");
$pdf->Text(15, 60, "Last Day: \t\t\t{$term->last_day_worked}");
$pdf->Text(15, 65, "Reason: {$term->reason_desc}");
$pdf->Text(100, 40, "Would you rehire? {$rehire}");