/**
  * Download task list as attachment
  *
  * @access public
  * @param void
  * @return null
  */
 function download_list()
 {
     $task_list = ProjectTaskLists::findById(get_id());
     if (!$task_list instanceof ProjectTaskList) {
         flash_error(lang('task list dnx'));
         $this->redirectTo('task');
     }
     // if
     $this->canGoOn();
     if (!$task_list->canView(logged_user())) {
         flash_error(lang('no access permissions'));
         $this->redirectToReferer(get_url('task'));
     }
     // if
     $output = array_var($_GET, 'output', 'csv');
     $project_name = active_project()->getName();
     $task_list_name = $task_list->getName();
     $task_count = 0;
     if ($output == 'pdf') {
         Env::useLibrary('fpdf');
         $download_name = "{$project_name}-{$task_list_name}-tasks.pdf";
         $download_type = 'application/pdf';
         $pdf = new FPDF();
         $pdf->AddPage();
         $pdf->SetTitle($task_list_name);
         $pdf->SetCompression(true);
         $pdf->SetCreator('ProjectPier');
         $pdf->SetDisplayMode(fullpage, single);
         $pdf->SetSubject(active_project()->getObjectName());
         $pdf->SetFont('Arial', 'B', 16);
         $task_lists = active_project()->getOpenTaskLists();
         $pdf->Cell(0, 10, lang('project') . ': ' . active_project()->getObjectName(), 'C');
         $pdf->Ln();
         foreach ($task_lists as $task_list) {
             $pdf->SetFont('Arial', 'B', 14);
             $pdf->Write(10, lang('task list') . ': ' . $task_list->getObjectName());
             $pdf->Ln();
             $tasks = $task_list->getTasks();
             $line = 0;
             // Column widths
             $w = array(10, 0, 0);
             // Header
             //for($i=0;$i<count($header);$i++)
             //  $this->Cell($w[$i],7,$header[$i],1,0,'C');
             //$this->Ln();
             $pdf->SetFont('Arial', 'I', 14);
             foreach ($tasks as $task) {
                 $line++;
                 if ($task->isCompleted()) {
                     $task_status = lang('completed');
                     $pdf->SetTextColor(100, 200, 100);
                     $task_completion_info = lang('completed task') . ' : ' . format_date($task->getCompletedOn());
                 } else {
                     $task_status = lang('open');
                     $pdf->SetTextColor(255, 0, 0);
                     $task_completion_info = lang('due date') . ' : ' . lang('not assigned');
                     if ($task->getDueDate()) {
                         $task_completion_info = lang('due date') . ' : ' . format_date($task->getDueDate());
                     }
                 }
                 if ($task->getAssignedTo()) {
                     $task_assignee = $task->getAssignedTo()->getObjectName();
                 } else {
                     $task_assignee = lang('not assigned');
                 }
                 $pdf->Cell($w[0], 6, $line);
                 $pdf->Cell($w[2], 6, $task_status, "TLRB");
                 $pdf->Ln();
                 $pdf->Cell($w[0], 6, '');
                 $pdf->SetTextColor(0, 0, 0);
                 $pdf->Cell($w[2], 6, $task_completion_info, "TLRB");
                 $pdf->Ln();
                 $pdf->Cell($w[0], 6, '');
                 $pdf->SetTextColor(0, 0, 0);
                 $pdf->Cell($w[2], 6, $task_assignee, "TLRB");
                 $pdf->Ln();
                 $pdf->Cell($w[0], 6, '');
                 $pdf->SetTextColor(0, 0, 0);
                 $pdf->MultiCell($w[2], 6, $task->getText(), "TLRB");
                 $pdf->Ln();
             }
         }
         $pdf->Output($download_name, 'D');
     } else {
         $download_name = "{$project_name}-{$task_list_name}-tasks.txt";
         $download_type = 'text/csv';
         $download_contents = $task_list->getDownloadText($task_count, "\t", true);
         download_contents($download_contents, $download_type, $download_name, strlen($download_contents));
     }
     die;
 }
示例#2
0
 function exportPdf()
 {
     $db = JFactory::getDBO();
     while (ob_get_level()) {
         ob_end_clean();
     }
     header("Content-Encoding: None", true);
     require JPATH_COMPONENT . DS . 'helpers' . DS . 'fpdf.php';
     include_once JPATH_COMPONENT . DS . 'helpers' . DS . 'font' . DS . 'helvetica.php';
     $quiz_id = intval(JRequest::getVar("id", ""));
     //create a FPDF object
     $pdf = new FPDF();
     //set font for the entire document
     $pdf->SetFont('Arial', 'B', 20);
     $pdf->SetTextColor(50, 60, 100);
     //set up a page
     $pdf->AddPage();
     @$pdf->SetDisplayMode(real, 'default');
     $pdf->SetXY(10, 5);
     $pdf->SetFontSize(8);
     $z = 25;
     $t = $z + 10;
     $pdf->SetXY(10, $t);
     $pdf->SetFontSize(7);
     $pdf->Cell(25, 10, JText::_("GURU_NAME"), 'LRTB', '', 'L', 0);
     $pdf->Cell(39, 10, JText::_("GURU_EMAIL"), 'LRTB', '', 'L', 0);
     $pdf->Cell(100, 10, JText::_("GURU_PROGRAM"), 'LRTB', '', 'L', 0);
     $pdf->Ln();
     $pid = JRequest::getVar("course", 0);
     $result = array();
     $user = JFactory::getUser();
     $sql = "select `id` from #__guru_program where `author` like '%|" . intval($user->id) . "|%' OR `author`='" . intval($user->id) . "'";
     $db->setQuery($sql);
     $db->query();
     $courses_ids = $db->loadColumn();
     $sql = "select `id`, `name` from #__guru_program where `author` like '%|" . intval($user->id) . "|%' OR `author`='" . intval($user->id) . "'";
     $db->setQuery($sql);
     $db->query();
     $courses_names = $db->loadAssocList("id");
     if (!isset($courses_ids) || count($courses_ids) <= 0) {
         $courses_ids = array("0" => "0");
     }
     if (intval($pid) != 0) {
         $courses_ids = array(intval($pid));
     }
     $sql = "select distinct(`userid`) from #__guru_buy_courses where `course_id` in (" . implode(",", $courses_ids) . ")";
     $db->setQuery($sql);
     $db->query();
     $students_ids = $db->loadColumn();
     if (isset($students_ids) && count($students_ids) > 0) {
         $sql = "select distinct(c.`userid`), A.`courses`, u.* from #__guru_buy_courses c, (select `userid`, GROUP_CONCAT(`course_id` SEPARATOR '-') as courses from #__guru_buy_courses where `course_id` in (" . implode(",", $courses_ids) . ") group by `userid`) as A, #__users u, #__guru_customer cust where `course_id` in (" . implode(",", $courses_ids) . ") and c.`userid`=A.`userid` and u.`id`=c.`userid` and cust.`id`=u.`id`";
         $db->setQuery($sql);
         $db->query();
         $result = $db->loadAssocList();
     }
     $new_id = 0;
     $nr = 1;
     for ($i = 0; $i < count($result); $i++) {
         $name = $result[$i]["name"];
         $email = $result[$i]["email"];
         $courses = $result[$i]["courses"];
         $student_courses = array();
         $courses = explode("-", $courses);
         if (isset($courses) && count($courses) > 0) {
             foreach ($courses as $key => $value) {
                 $student_courses[] = $courses_names[$value]["name"];
             }
         }
         $pdf->SetFontSize(7);
         $pdf->Cell(25, 10, $name, 'LRTB', '', 'L', 0);
         $pdf->Cell(39, 10, $email, 'LRTB', '', 'L', 0);
         $pdf->Cell(100, 10, implode(", ", $student_courses), 'LRTB', '', 'L', 0);
         $pdf->Ln();
     }
     //Output the document
     $pdf->Output('ExportResult.pdf', 'I');
 }
foreach ($p_id_pedido_item as $chave => $id_pedido_item) {
    $valida = valida_numero($id_pedido_item);
    if ($valida != 'TRUE') {
        echo 'Ocorreu um erro ao validar o número dos pedido(s) selecionado(s). O número
de um dos pedidos não é válido';
        exit;
    }
    if ($anexar == 'on') {
        $pdf = new FPDF('P', 'cm', 'A4');
        //papel personalizado
        $pdf->Open();
        $pdf->SetMargins(1, 2);
        //seta as margens do documento
        $pdf->SetAuthor('Vsites 2009');
        $pdf->SetFont('times', '', 7);
        $pdf->SetDisplayMode(100, 'continuous');
        //define o nivel de zoom do documento PDF
        $coluna = 0;
        $linha = 0;
        $posicaoH = 0;
        $posicaoV = 0;
    }
    $bloco = '';
    $ped = $pedidoDAO->selecPedidoPorIdOficio($id_pedido_item, $controle_id_empresa);
    if ($ped->id_pedido != '') {
        $linha_bloco = 1;
        $ordem = $ped->ordem;
        $id_pedido = $ped->id_pedido;
        $id_servico = $ped->id_servico;
        $id_conveniado = $ped->id_conveniado;
        $contato = $ped->contato;
<?php

require 'fpdf16/fpdf.php';
require 'connection.php';
validate_user();
$pdf = new FPDF();
$pdf->AliasNbPages();
$pdf->SetTopMargin(20);
$pdf->SetLeftMargin(45);
$pdf->SetAutoPageBreak(1, 0.5);
$pdf->SetDisplayMode(100);
$pdf->SetAutoPageBreak(true, 10);
$pdf->AddPage();
//$pdf->AddPage('L');
$pdf->SetDisplayMode(110, "single");
$pdf->SetTitle("Netherhall House");
$border = 0;
$pdf->SetFont('Arial', 'B', 10);
$pdf->SetFillColor(255, 255, 255);
$request = filter_input_array(INPUT_POST);
if ($request[name] != "") {
    $r = mysql_query("SELECT * FROM residents LEFT JOIN countries on residents.country_id = countries.country_id WHERE name LIKE '%{$request[name]}%' OR surname LIKE '%{$request[name]}%'");
} else {
    $today = date("Y", time()) . "-" . date("m", time()) . "-" . date("d", time());
    if (!isset($request[academic_year]) || $request[academic_year] == "current") {
        // >= 28 days = 4 weeks
        //$condition_search=" AND bookings.arrival <= '$today' AND bookings.departure >= '$today' AND DATEDIFF(bookings.departure,bookings.arrival) >= 28  ";
        // 06-Feb-2010 - They want to see all the residents in the current residents list. So I remove the condition about days.
        $condition_search = " AND bookings.arrival <= '{$today}' AND bookings.planned_departure >= '{$today}' ";
    } elseif ($request[academic_year] == "short") {
        // < 28 days = 4 weeks
$stud_deptID = $student_model->getStud_DeptID();
$signatorial_model = new SignatorialList_Model();
$signatorial_model->getListofSignatoryByDept($stud_deptID, $stud_status);
$listOfSignatories["name"] = $signatorial_model->getSign_Name();
$listOfSignatories["id"] = $signatorial_model->getSign_ID();
$clearance_model = new ClearanceStatus();
foreach ($listOfSignatories["id"] as $key => $value) {
    $status = $clearance_model->getOverallSignatoryClearanceStatus($stud_id, $value, $current_sysemID);
    if ($status == "No Requirements") {
        $status = "Cleared";
    }
    $listOfSignatories["status"][$key] = $status;
}
//var_dump($listOfSignatories);
$fpdf = new FPDF('P', 'mm', 'Legal');
$fpdf->SetDisplayMode('fullpage', 'continuous');
$fpdf->SetTitle("SOCS Clearance - Export Copy");
$fpdf->SetCreator("USEP SOCS");
$fpdf->SetAuthor("University of Southeastern Philippines");
$fpdf->SetSubject("Electronic Clearance (export copy)");
$fpdf->SetMargins(15, 15, 15);
$fpdf->AddPage();
$fpdf->SetY('15');
$fpdf->Image('logo.jpg', 13, $fpdf->GetY() - 5, 25);
printBody();
$fpdf->Cell(0, 0, "Registrar's Copy", 0, 1, 'R', false);
$fpdf->Ln(4);
$fpdf->Cell(0, 0, "", 1, 1, 'L', true);
$fpdf->Ln(4);
$fpdf->Cell(0, 0, "Adviser's Copy", 0, 1, 'R', false);
$fpdf->SetY($fpdf->GetY() + 10);
示例#6
0
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Webfinance; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
//
// $Id: gen_facture.php 532 2007-06-14 10:39:19Z thierry $
// Génère un PDF pour une facture
require "../inc/main.php";
# If user is not logged, generate a PDF with an explicit error message
if (!isset($_SESSION['id_user']) || $_SESSION['id_user'] < 1) {
    $pdf = new FPDF('P', 'mm', 'A4');
    $pdf->SetMargins(10, 10, 10);
    $pdf->SetDisplayMode('fullwidth');
    $pdf->SetAutoPageBreak(true);
    $pdf->AddPage();
    $pdf->SetFont('Arial', '', 12);
    $pdf->Cell(190, 20, _("You are not authenticated"));
    $pdf->SetSubject(_('Error'));
    $pdf->SetTitle(_('Error'));
    $pdf->Output(_("Error") . ".pdf", "I");
    die;
}
# Check if the invoice id is defined
if (!isset($_GET['id']) or !is_numeric($_GET['id'])) {
    die(_("Error: Missing invoice id"));
}
$docs = false;
if ($_GET['docs'] == 1) {
示例#7
0
    public static function createEmptyRenderError($filename,$filepath){


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

        $pdf = new FPDF('P','mm','Letter');

        $pdf->SetAuthor('ASA AP');
        $pdf->SetTitle('Render error');
        //set font for the entire document
        $pdf->SetFont('Helvetica','B',20);
        $pdf->SetTextColor(255,0,0);
        //set up a page
        $pdf->AddPage('P');
        $pdf->SetDisplayMode(90,'default');

        //Set x and y position for the main text, reduce font size and write content
        $pdf->SetXY (30,55);
        $pdf->SetFontSize(15);
        $pdf->Write(5,'Existing document '.$filename.' can\'t be rendered');
        //Output the document
        $pdf->Output($filepath,'F');
        $pdf->Close();

        return $filepath;
    }
 /**
  * valida email
  * @param string $email
  */
 public function geraProcessosDetran($orgao, $resultado, $anexar, $id_empresa, $id_usuario, $id_pedido, $ordem, $res_oficio)
 {
     if ($orgao == '') {
         $orgao = 'Detran';
     }
     if ($resultado == '') {
         $resultado = 'Nada Constou';
     }
     // Variaveis de Tamanho
     $mesq = "10";
     // Margem Esquerda (mm)
     $msup = "10";
     // Margem Superior (mm) margem mínima dois pois ficou cortando)
     /*Uma dica: estes tamanhos você pode verificar com uma régua ou na própria caixa da etiqueta, seja bem preciso e sugiro que faça o teste na impressora que vai ser utilizada, pois pode acontecer de na impressão começar a subir ou descer, portanto, você deverá aumentar ou diminuir a altura da etiqueta.
      */
     $m = date(m);
     $mes = traduzMes($m);
     $anexoDAO = new AnexoDAO();
     $impressoDAO = new ImpressoDAO();
     $atividadeDAO = new AtividadeDAO();
     $res = $impressoDAO->buscaPorId(28);
     $imprimir_topo = $res->topo;
     $id_impresso = $res->id_impresso;
     $imprimir_timbre = $res->timbre;
     $imprimir_sub = $res->sub;
     $imprimir_linha = $res->linhas;
     $frase = '';
     #if($anexar!='on'){
     $pdf = new FPDF('P', 'cm', 'A4');
     //papel personalizado
     $pdf->Open();
     $pdf->SetMargins(1, 2);
     //seta as margens do documento
     $pdf->SetAuthor('Softfox 2011');
     $pdf->SetFont('times', '', 7);
     $pdf->SetDisplayMode(100, 'continuous');
     //define o nivel de zoom do documento PDF
     $coluna = 0;
     $linha = 0;
     $posicaoH = 0;
     $posicaoV = 0;
     #}
     $impressao_ordem = '';
     $linha = 0;
     $frase .= $imprimir_topo;
     $bloco = '';
     if ($res_oficio->id_pedido != '') {
         $linha_bloco = 1;
         $orgao_regiao = $res_oficio->certidao_cidade;
         $orgao_regiao .= '-' . $res_oficio->certidao_estado;
         $impressao_ordem = '#' . $res_oficio->id_pedido . '/' . $res_oficio->ordem . ' ';
         $responsavel_endereco = $res_oficio->endereco . ' ' . $res_oficio->numero . ' ' . $res_oficio->complemento;
         $data_atual = $res_oficio->cidade . ', ' . date(d) . ' de ' . $mes . ' de 20' . date(y) . '.';
         $topo = str_replace('<certidao_nome>', $res_oficio->certidao_nome, $imprimir_topo);
         $topo = str_replace('<certidao_cnpj>', $res_oficio->certidao_cnpj, $topo);
         $topo = str_replace('<certidao_cpf>', $res_oficio->certidao_cpf, $topo);
         $topo = str_replace('<orgao>', $orgao, $topo);
         $topo = str_replace("<resultado>", $resultado, $topo);
         $topo = str_replace("<orgao_regiao>", $orgao_regiao, $topo);
         $topo = str_replace('<responsavel_empresa>', $res_oficio->fantasia, $topo);
         $topo = str_replace('<responsavel_endereco>', $responsavel_endereco, $topo);
         $topo = str_replace('<responsavel_cidade>', $res_oficio->cidade, $topo);
         $topo = str_replace('<responsavel_estado>', $res_oficio->estado, $topo);
         $topo = str_replace("<data>", $data_atual, $topo);
         $topo = str_replace('<impressao_ordem>', $impressao_ordem, $topo);
         $sub = str_replace('<responsavel_empresa>', $res_oficio->fantasia, $imprimir_sub);
         $sub = str_replace('<responsavel_endereco>', $responsavel_endereco, $sub);
         $sub = str_replace('<responsavel_cidade>', $res_oficio->cidade, $sub);
         $sub = str_replace('<responsavel_estado>', $res_oficio->estado, $sub);
         $sub = str_replace('<responsavel_cep>', $res_oficio->cep, $sub);
         $sub = str_replace('<responsavel_tel>', $res_oficio->tel, $sub);
         $sub = str_replace('<responsavel_fax>', $res_oficio->fax, $sub);
         $sub = str_replace('<responsavel_email>', $res_oficio->email, $sub);
         $pdf->AddPage();
         $pdf->Image('../images/header.jpg', '0', '0', '19', '3,04', 'JPG');
         $pdf->SetFont('', 'B', 12);
         $pdf->Cell('', 2, 'NÃO EMITIMOS E NEM VENDEMOS CERTIDÕES E SIM PRAZOS E SOLUÇÕES', '', 1, 'C');
         $pdf->SetFont('', 'B', 14);
         $pdf->Cell('', 2, 'Declaração de Busca', '', 1, 'C');
         $pdf->SetFont('', '', 12);
         $pdf->Write(1, $topo, '');
         $pdf->SetFont('', '', 12);
         $pdf->Cell('', 1, '', '', 1, 'C');
         $pdf->Cell('', 1, '', '', 1, 'C');
         $pdf->Cell('', 1, '', '', 1, 'C');
         $pdf->Cell('', 1, '', '', 1, 'C');
         $pdf->Cell('', 1, '', '', 1, 'C');
         $pdf->Cell('', 1, '', '', 1, 'C');
         $pdf->Cell('', 1, $data_atual, '', 1, 'C');
         $pdf->Cell('', 1, $impressao_ordem, '', 1, 'R');
         $pdf->ln();
         $pdf->ln();
         $pdf->ln();
         $pdf->ln();
         $pdf->Cell('', 1, $res_oficio->fantasia, '', 1, 'C');
         $pdf->ln();
         $pdf->ln();
         $pdf->Write(0.5, $sub, '');
         $pdf->Line(1, 25, 20, 25);
         $pdf->Ln();
         $pdf->Cell('', 0.5, $rodape, '', 1, 'C');
         $rodape = $responsavel_endereco . ', ' . $res_oficio->cidade . '-' . $res_oficio->estado . ' CEP: ' . $res_oficio->cep;
         $pdf->Cell('', 0.5, $rodape, '', 1, 'C');
         $rodape = 'Tel/Fax: ' . $res_oficio->tel . '/' . $res_oficio->fax . ' E-mail:' . $res_oficio->email;
         $pdf->Cell('', 0.5, $rodape, '', 1, 'C');
         $rodape = 'www.cartoriopostal.com.br';
         $pdf->Cell('', 0.5, $rodape, '', 1, 'C');
         if ($anexar == 'on' and $res_oficio->id_servico == '16') {
             $pdf->Close();
             //imprime a saida
             $num_a = $anexoDAO->listaAnexoPedidoNome($res_oficio->id_pedido_item, 'Declaração de Busca');
             if (COUNT($num_a) == 0) {
                 $file_path = "../anexosnovos/" . date('m') . '' . date('Y') . '/';
                 #alterado => "../anexos/"
                 if (!is_dir($file_path)) {
                     mkdir($file_path, 0777);
                 }
                 #alterado
                 $arq_anexo = $file_path . 'decla_busca_' . $res_oficio->id_pedido_item . '_' . time() . '.pdf';
                 $pdf->Output($arq_anexo, 'F');
                 //imprime a saida
                 $anexo->anexo = $arq_anexo;
                 $anexo->anexo_nome = 'Declaração de Busca';
                 $anexo->id_pedido_item = $res_oficio->id_pedido_item;
                 $anexo->id_usuario = $id_usuario;
                 $anexoDAO->inserir($anexo);
                 $ativ = $atividadeDAO->inserir('209', '', $id_usuario, $res_oficio->id_pedido_item);
                 return 'Declaração anexada para ' . $impressao_ordem . '<br>';
             } else {
                 return 'Declaração não pode ser anexada para ' . $impressao_ordem . ' porque o anexo já existe<br>';
             }
         } else {
             if ($anexar == 'on' and $res_oficio->id_servico != '16') {
                 return '<b>Declaração não pode ser anexada para ' . $impressao_ordem . ' porque o serviço não é "Pesquisa Detran</b>"<br>';
             }
         }
     }
     if ($anexar != 'on') {
         return $pdf->Output();
         //imprime a saida
     } else {
         return 1;
     }
 }
function report_head($report_id)
{
    $q = new mysql_squid_builder();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM `squid_reports` WHERE ID='{$report_id}'"));
    build_progress($report_id, "Building Report...", 15);
    $pdf = new FPDF();
    $pdf->SetFont('times', '', 12);
    $pdf->SetTextColor(50, 60, 100);
    $linetime = report_by_category_pdf_range_dayz($report_id) . " - ( " . report_by_category_pdf_sumsize($report_id) . " )";
    //set up a page
    $pdf->AddPage('P');
    $pdf->SetTitle($ligne["report_name"]);
    $pdf->SetDisplayMode(real, 'default');
    $pdf->SetXY(5, 10);
    $pdf->SetFontSize(32);
    $pdf->Write(5, $ligne["report_name"]);
    $pdf->Ln();
    $pdf->Ln();
    $pdf->SetFontSize(18);
    $x1 = $pdf->GetX();
    $y1 = $pdf->GetY();
    $pdf->Line(0, $y1, 210, $y1);
    $pdf->SetFont('times', 'I', 12);
    $pdf->Write(15, $ligne["description"] . " {$linetime}");
    $pdf->SetFont('times', 'I', 12);
    $pdf->Write(15, " " . @implode(" and ", $GLOBALS["EXPLAIN_QUERY"]));
    $pdf->Ln();
    $pdf->SetFontSize(16);
    $pdf->SetFont('times', '', 12);
    return $pdf;
}
示例#10
0
            if ($classe->title === "") {
                $classe->title = $classe->name;
            }
        }
    }
}
$imgo = $map->drawlegend();
$nomer = $imgo->imagepath . "leg" . $nomeImagem . ".PNG";
$imgo->saveImage($nomer);
$pathlegenda = $dir_tmp . "/" . basename($imgo->imageurl) . "/" . basename($nomer);
$titulo = $_GET['titulo'];
substituiCon($map_file, $postgis_mapa);
require dirname(__FILE__) . '/../../pacotes/fpdf/fpdf.php';
$pdf = new FPDF("L", "mm", "A4");
$pdf->SetAutoPageBreak(false);
$pdf->SetDisplayMode(70, "single");
$pdf->SetMargins(0, 0, 0);
$pdf->AddPage("L");
$pdf->SetLineWidth(0.6);
$wMapaMax = 222;
$hMapaMax = 171;
$mapasize = getimagesize($pathMapa);
$wMapa = $mapasize[0];
$hMapa = $mapasize[1];
if ($wMapa / $wMapaMax > $hMapa / $hMapaMax) {
    $nW = $wMapaMax;
    $nH = $hMapa * $nW / $wMapa;
} else {
    $nH = $hMapaMax;
    $nW = $wMapa * $nH / $hMapa;
}
示例#11
0
// Altura da Etiqueta (mm)
$ehet = "3,2";
// Espaço horizontal entre as Etiquetas (mm)
$pdf = new FPDF('P', 'mm', 'Letter');
// Cria um arquivo novo tipo carta, na
vertical . $pdf->Open();
// inicia documento
$pdf->AddPage();
// adiciona a primeira pagina
$pdf->SetMargins('5', '12,7');
// Define as margens do documento
$pdf->SetAuthor("Jonas Ferreira");
// Define o autor
$pdf->SetFont('helvetica', '', 7);
// Define a fonte
$pdf->SetDisplayMode($zoom, $layout = 'continuous');
$coluna = 0;
$linha = 0;
//MONTA A ARRAY PARA ETIQUETAS
while ($dados = mysql_fetch_array($busca)) {
    $nome = $dados["nomefantasia"];
    $ende = $dados["endereco"];
    $bairro = $dados["bairro"];
    $estado = $dados["estado"];
    $cida = $dados["cidade"];
    $local = $cida . " - " . $estado;
    $cep = "CEP: " . $dados["cep"];
    if ($linha == "10") {
        $pdf->AddPage();
        $linha = 0;
    }
示例#12
0
文件: guruQuiz.php 项目: JozefAB/qk
 function exportFilePdf()
 {
     while (ob_get_level()) {
         ob_end_clean();
     }
     header("Content-Encoding: None", true);
     require JPATH_COMPONENT . DS . 'helpers' . DS . 'fpdf.php';
     include_once JPATH_COMPONENT . DS . 'helpers' . DS . 'font' . DS . 'helvetica.php';
     $quiz_id = intval(JRequest::getVar("id", ""));
     //create a FPDF object
     $pdf = new FPDF();
     //set font for the entire document
     $pdf->SetFont('Arial', 'B', 20);
     $pdf->SetTextColor(50, 60, 100);
     //set up a page
     $pdf->AddPage();
     $pdf->SetDisplayMode(real, 'default');
     $pdf->SetXY(10, 5);
     $pdf->SetFontSize(8);
     $db = JFactory::getDBO();
     $sql = "select name from #__guru_quiz where id=" . $quiz_id;
     $db->setQuery($sql);
     $name = $db->loadColumn();
     $name = $name["0"];
     $pdf->Write(5, 'Student Quiz Result for ' . "'" . $name . "'");
     $pdf->SetXY(10, 15);
     $pdf->SetFontSize(8);
     $pdf->Cell(20, 10, 'Times', 1, 0, 'C', 0);
     $pdf->Cell(20, 10, 'Students', 1, 0, 'C', 0);
     $pdf->Cell(20, 10, 'Avg Score', 1, 0, 'C', 0);
     //display the title with a border around it
     $res = guruAdminModelguruQuiz::NbOfTimesandStudents($quiz_id);
     $z = 25;
     $scoresByUserId = array();
     $maxNoOfTimes = 0;
     for ($i = 0; $i < count($res); $i++) {
         $newElem = new stdClass();
         $newElem->user_id = $res[$i]["user_id"];
         $newElem->scores = explode(",", $res[$i]["score_by_user"]);
         if (count($newElem->scores) > $maxNoOfTimes) {
             $maxNoOfTimes = count($newElem->scores);
         }
         array_push($scoresByUserId, $newElem);
     }
     $newvect = array();
     for ($i = 0; $i < $maxNoOfTimes; $i++) {
         $newElem = new stdClass();
         $newElem->noOfTimes = $i + 1;
         $newElem->noOfStudents = 0;
         $newElem->sumScores = 0;
         for ($j = 0; $j < count($scoresByUserId); $j++) {
             if (count($scoresByUserId[$j]->scores) >= $i + 1) {
                 $newElem->noOfStudents += 1;
                 $newElem->sumScores += $scoresByUserId[$j]->scores[$i];
             }
         }
         $newElem->avgScore = $newElem->sumScores / $newElem->noOfStudents;
         array_push($newvect, $newElem);
     }
     for ($i = 0; $i < count($newvect); $i++) {
         if ($i + 1 == 1) {
             $nboftimes = $i + 1 . "st";
         } elseif ($i + 1 == 2) {
             $nboftimes = $i + 1 . "nd";
         } elseif ($i + 1 == 3) {
             $nboftimes = $i + 1 . "rd";
         } elseif ($i + 1 > 3) {
             $nboftimes = $i + 1 . "th";
         }
         $studtot = $newvect[$i]->noOfStudents;
         $avg = intval($newvect[$i]->avgScore * 100);
         $pdf->SetXY(10, $z);
         $pdf->SetFontSize(7);
         $pdf->Cell(20, 10, $nboftimes, 1, 0, 'C', 0);
         $pdf->Cell(20, 10, $studtot, 1, 0, 'C', 0);
         $pdf->Cell(20, 10, $avg, 1, 0, 'C', 0);
         $z += 10;
     }
     $t = $z + 10;
     $pdf->SetXY(10, $t);
     $pdf->SetFontSize(7);
     $pdf->Cell(25, 10, 'First Name', 'LRTB', '', 'L', 0);
     $pdf->Cell(25, 10, 'Last Name', 'LRTB', '', 'L', 0);
     $pdf->Cell(39, 10, 'Email', 'LRTB', '', 'L', 0);
     $pdf->Cell(15, 10, '#', 'LRTB', '', 'L', 0);
     $pdf->Cell(20, 10, 'Username', 'LRTB', '', 'L', 0);
     $pdf->Cell(20, 10, 'Date Taken', 'LRTB', '', 'L', 0);
     $pdf->Cell(20, 10, 'Score', 'LRTB', '', 'L', 0);
     $pdf->Ln();
     //-----------------------------------------
     $pid = JRequest::getVar("pid", 0, 'post', 'int');
     $db = JFactory::getDBO();
     $sql = "select u.id, u.username, u.email, c.firstname, c.lastname, tq.date_taken_quiz, tq.score_quiz, tq.`id` as tq_id  from #__guru_customer c, #__users u, #__guru_quiz_taken tq where c.id=u.id and c.id = tq.user_id and u.id IN (select  user_id from #__guru_quiz_taken where quiz_id=" . $quiz_id . ") and tq.quiz_id=" . $quiz_id . " order by c.id desc";
     $db->setQuery($sql);
     $tmp = $db->loadObjectList();
     $new_id = 0;
     $nr = 1;
     for ($i = 0; $i < count($tmp); $i++) {
         $firstname = $tmp[$i]->firstname;
         $lastname = $tmp[$i]->lastname;
         $username = $tmp[$i]->username;
         $email = $tmp[$i]->email;
         $date = date("d/n/Y ", strtotime($tmp[$i]->date_taken_quiz));
         $score = $tmp[$i]->score_quiz;
         $score = explode("|", $score);
         $score = intval($score[0] / $score[1] * 100);
         if ($tmp[$i]->id == $new_id) {
             $nr = $nr + 1;
         } else {
             $nr = 1;
         }
         if ($nr == 1) {
             $nr = $nr . "st";
         } elseif ($nr == 2) {
             $nr = $nr . "nd";
         } elseif ($nr == 3) {
             $nr = $nr . "rd";
         } elseif ($nr > 3) {
             $nr = $nr . "td";
         }
         $pdf->SetFontSize(7);
         $pdf->Cell(25, 10, $firstname, 'LRTB', '', 'L', 0);
         $pdf->Cell(25, 10, $lastname, 'LRTB', '', 'L', 0);
         $pdf->Cell(39, 10, $email, 'LRTB', '', 'L', 0);
         $pdf->Cell(15, 10, $nr, 'LRTB', '', 'L', 0);
         $pdf->Cell(20, 10, $username, 'LRTB', '', 'L', 0);
         $pdf->Cell(20, 10, $date, 'LRTB', '', 'L', 0);
         $pdf->Cell(20, 10, $score, 'LRTB', '', 'L', 0);
         $pdf->Ln();
         $new_id = $tmp[$i]->id;
     }
     //Output the document
     $pdf->Output('Scores.pdf', 'I');
 }
示例#13
0
function GeneratePresentation($realty_id)
{
    global $app_list_strings;
    $pdf = new FPDF();
    $pdf->AddFont('TimesNewRomanPSMT', '', 'times.php');
    $pdf->AddFont('Times-Italic', 'I', 'timesi.php');
    $pdf->SetAuthor('OfficeWorld');
    $pdf->SetTitle('Presentation');
    $pdf->SetFont('TimesNewRomanPSMT', '', 25);
    $pdf->SetTextColor(100, 100, 100);
    $pdf->AddPage('L');
    $pdf->SetDisplayMode('real', 'default');
    $realty = new Realty();
    $realty->retrieve($realty_id);
    $image_main = '';
    $image_map = array();
    $image_plan = array();
    $images = array();
    $address = array();
    $currency = $realty->currency == 'RUR' ? 'рублей' : 'долларов';
    $operation_text = $app_list_strings['operation_realty_list'][$realty->operation];
    /*if($realty->address_country!='') $address[]=$realty->address_country;
    	if($realty->address_region!='') $address[]=$realty->address_region;
    	if($realty->address_city!='') $address[]=$realty->address_city;*/
    if ($realty->metro != '') {
        $address[] = $realty->metro;
    }
    if ($realty->address_street != '') {
        $address[] = $realty->address_street;
    }
    if ($realty->address_house != '') {
        $address[] = $realty->address_house;
    }
    if ($realty->address_apartment != '') {
        $address[] = "кв." . $realty->address_apartment;
    }
    $address = implode(', ', $address);
    if (is_dir('upload/gallery_images/' . $realty->id)) {
        $db_img = DBManagerFactory::getInstance();
        $sql_img = "SELECT galleria_c FROM realty_cstm WHERE id_c = '" . $realty->id . "'";
        $result_img = $db_img->query($sql_img);
        $row_img = $db_img->fetchByAssoc($result_img);
        $img_str = $row_img['galleria_c'];
        $image = explode('|', $img_str);
        foreach ($image as $key => $value) {
            $value = str_replace('^,^', '|', $value);
            $value = str_replace('^', '', $value);
            $image_t = explode('|', $value);
            if ($image_t[2] == 'main') {
                $image_main = $image_t[1];
            } elseif ($image_t[8] == 'on') {
                $image_map = $image_t;
            } elseif ($image_t[9] == 'on') {
                $image_plan = $image_t;
            } elseif ($image_t[7] == 'on') {
                $images[] = $image_t;
            }
        }
    }
    $pdf->SetXY(0, 5);
    $text = decode("{$operation_text}\n{$address}");
    $pdf->MultiCell(297, 7, $text, 0, 'C');
    $y = $pdf->GetY() + 5;
    if ($image_main != '') {
        $img = "upload/gallery_images/{$realty->id}/{$image_main}";
        list($w_i, $h_i) = getimagesize($img);
        if ($w_i - $h_i > $w_i * 0.3) {
            $y += (184 - $y - $h_i * 284 / $w_i) / 2;
            $pdf->Image($img, 6, 15 + $y, 284, 0);
        } else {
            $x = (284 - $w_i * (184 - $y) / $h_i) / 2;
            $pdf->Image($img, 6 + $x, $y, 0, 184 - $y);
        }
    }
    //Footer
    $pdf->Image('custom/Presentation/footer_main.png', 0, 172, 297, 0);
    //Page2
    $pdf->SetTextColor(255, 255, 255);
    if (isset($image_map[1])) {
        $pdf->AddPage('L');
        $img = "upload/gallery_images/{$realty->id}/{$image_map[1]}";
        list($w_i, $h_i) = getimagesize($img);
        if ($w_i - $h_i > $w_i * 0.3) {
            $y = (178 - $h_i * 284 / $w_i) / 2;
            $pdf->Image($img, 6, 15 + $y, 284, 0);
        } else {
            $x = (284 - $w_i * 178 / $h_i) / 2;
            $pdf->Image($img, 6 + $x, 15, 0, 178);
        }
        //Header
        $pdf->Image('custom/Presentation/header.png', 0, 0, 297, 0);
        $pdf->SetXY(0, 5);
        $pdf->SetFontSize(30);
        $text = decode($image_map[0]);
        $pdf->MultiCell(297, 7, $text, 0, 'C');
        //Footer
        $pdf->Image('custom/Presentation/footer.png', 0, 187, 297, 0);
    }
    //Page3
    if (isset($image_plan[1])) {
        $pdf->AddPage('L');
        $img = "upload/gallery_images/{$realty->id}/{$image_plan[1]}";
        list($w_i, $h_i) = getimagesize($img);
        if ($w_i - $h_i > $w_i * 0.3) {
            $y = (178 - $h_i * 284 / $w_i) / 2;
            $pdf->Image($img, 6, 15 + $y, 284, 0);
        } else {
            $x = (284 - $w_i * 178 / $h_i) / 2;
            $pdf->Image($img, 6 + $x, 15, 0, 178);
        }
        //Header
        $pdf->Image('custom/Presentation/header.png', 0, 0, 297, 0);
        $pdf->SetXY(0, 5);
        $pdf->SetFontSize(30);
        $text = decode($image_plan[0]);
        $pdf->MultiCell(297, 7, $text, 0, 'C');
        //Footer
        $pdf->Image('custom/Presentation/footer.png', 0, 187, 297, 0);
    }
    //Page OtherImages
    foreach ($images as $image) {
        $pdf->AddPage('L');
        $img = "upload/gallery_images/{$realty->id}/{$image[1]}";
        list($w_i, $h_i) = getimagesize($img);
        if ($w_i - $h_i > $w_i * 0.3) {
            $y = (178 - $h_i * 284 / $w_i) / 2;
            $pdf->Image($img, 6, 15 + $y, 284, 0);
        } else {
            $x = (284 - $w_i * 178 / $h_i) / 2;
            $pdf->Image($img, 6 + $x, 15, 0, 178);
        }
        //Header
        $pdf->Image('custom/Presentation/header.png', 0, 0, 297, 0);
        $pdf->SetXY(0, 5);
        $pdf->SetFontSize(30);
        $text = decode($image[0]);
        $pdf->MultiCell(297, 7, $text, 0, 'C');
        //Footer
        $pdf->Image('custom/Presentation/footer.png', 0, 187, 297, 0);
    }
    //Page last
    $pdf->AddPage('L');
    //Header
    $pdf->Image('custom/Presentation/header.png', 0, 0, 297, 0);
    $pdf->SetXY(0, 5);
    $text = decode("Описание помещения");
    $pdf->MultiCell(297, 7, $text, 0, 'C');
    //Body
    $pdf->SetTextColor(0, 0, 0);
    $pdf->SetFillColor(200, 200, 255);
    $pdf->SetY(40);
    //if($realty->operation=='rent'){
    $pdf->SetFontSize(24);
    drawProp($pdf, "Основная информация", '', true, 8);
    $pdf->SetFontSize(16);
    drawProp($pdf, "Вид объекта", $app_list_strings['kind_of_realty_list'][$realty->kind_of_realty], false, 8);
    drawProp($pdf, "Количество комнат", $realty->rooms_quantity, true, 8);
    drawProp($pdf, "Этаж/Этажность", "{$realty->floor}/{$realty->number_of_floors}", false, 8);
    $pdf->SetFontSize(20);
    drawProp($pdf, "Текущая цена", "{$realty->cost} {$currency}", true, 10);
    $pdf->SetY($pdf->GetY() + 20);
    $pdf->SetFillColor(255, 200, 200);
    $pdf->SetFontSize(24);
    drawProp($pdf, "Параметры объекта:", '', true, 8);
    $pdf->SetFontSize(16);
    drawProp($pdf, "Общая площадь", $realty->square . " кв.м", false, 8);
    drawProp($pdf, "Жилая площадь", $realty->living_square . " кв.м", true, 8);
    drawProp($pdf, "Площадь кухни", $realty->kitchen_square . " кв.м", false, 8);
    drawProp($pdf, "Состояние объекта", $app_list_strings['state_of_object_list'][$realty->state_of_object], true, 8);
    /*}else{
    		$pdf->SetFontSize(18);
    		drawProp($pdf, "Общая площадь", $realty->square_total." кв.м", true);
    		$pdf->SetFontSize(28);
    		$realty->cost_buying=number_format($realty->cost_buying, 0, ',', ' ');
    	}*/
    //Footer
    $pdf->Image('custom/Presentation/footer.png', 0, 187, 297, 0);
    /* $pdf->SetTextColor(255,255,255);
    	$pdf->SetXY(20,190); 
        $pdf->SetFontSize(14);
    	$text=decode("+7 (499) 707-50-57\n+7 (926) 531-09-93");
    	$pdf->MultiCell(100, 1, $text, 0, 'L'); */
    $pdf->Output("custom/Presentation/pdf/ID-{$realty->id}.pdf");
    return "custom/Presentation/pdf/ID-{$realty->id}.pdf";
}
		$gepiSchoolName=getSettingValue('gepiSchoolName');

	}

	// création du document
	$pdf->SetCreator($gepiSchoolName);
	// auteur du document
	$pdf->SetAuthor($gepiSchoolName);
	// mots clé
	$pdf->SetKeywords('');
	// sujet du document
	$pdf->SetSubject('Bilan journalier des absences');
	// titre du document
	$pdf->SetTitle('Bilan journalier des absences');
	// méthode d'affichage du document à son ouverture
	$pdf->SetDisplayMode('fullwidth', 'single');
	// compression du document
	$pdf->SetCompression(TRUE);
	// change automatiquement de page à 5mm du bas
	$pdf->SetAutoPageBreak(TRUE, 5);


/* **************************** */
/* début de la boucle des pages */

// comptage du nombre de page traité
$nb_page_traite = 0;

// initialiser la variable compteur de ligne passé pour le tableau
$nb_ligne_passe = 0;
    $study_type = "stc";
}
if ($_POST["search_study_type"] == 'Заочна') {
    $study_type = "zao";
}
$pdf = new FPDF();
//set document properties
$pdf->SetAuthor('Alexandr Slovinskiy');
$pdf->SetTitle('Order Annex');
//set font for the entire document
$pdf->AddFont('Times', '', 'times.php');
$pdf->SetFont('Times', '');
$pdf->SetTextColor(0, 0, 0);
//set up a page
$pdf->AddPage('L');
$pdf->SetDisplayMode(real, 'default');
//display the title with a border around it
//Set x and y position for the main text, reduce font size and write content
$pdf->Image('img/form_1-12-2.jpg', 10, 15, 280);
$pdf->SetFontSize(9);
$pdf->SetXY(261, 29.5);
$pdf->Write(5, $_POST["order_number"]);
$pdf->SetXY(197.5, 37);
$pdf->Write(5, $_POST["day"]);
$pdf->SetXY(205, 37);
$pdf->Write(5, $_POST["month"]);
$pdf->SetXY(225.4, 37);
$pdf->Write(5, substr($_POST["year"], 2, 2));
$pdf->SetXY(196, 63);
if ($_POST["search_finance"] == 'b') {
    $pdf->Write(5, "за державним замовленням");
 /**
  * Download task list as attachment
  *
  * @access public
  * @param void
  * @return null
  */
 function download_list()
 {
     $task_list = ProjectTaskLists::findById(get_id());
     if (!$task_list instanceof ProjectTaskList) {
         flash_error(lang('task list dnx'));
         $this->redirectTo('task');
     }
     // if
     $this->canGoOn();
     if (!$task_list->canView(logged_user())) {
         flash_error(lang('no access permissions'));
         $this->redirectToReferer(get_url('task'));
     }
     // if
     $output = array_var($_GET, 'output', 'csv');
     $project_name = active_project()->getName();
     $task_list_name = $task_list->getName();
     $task_count = 0;
     if ($output == 'pdf') {
         Env::useLibrary('fpdf');
         $download_name = "{$project_name}-tasks.pdf";
         $download_type = 'application/pdf';
         $pdf = new FPDF("P", "mm");
         $pdf->AddPage();
         $pdf->SetTitle($project_name);
         $pdf->SetCompression(true);
         $pdf->SetCreator('ProjectPier');
         $pdf->SetDisplayMode('fullpage', 'single');
         $pdf->SetSubject(active_project()->getObjectName());
         $pdf->SetFont('Arial', 'B', 16);
         $task_lists = active_project()->getOpenTaskLists();
         $pdf->Cell(0, 10, lang('project') . ': ' . active_project()->getObjectName(), 'B', 0, 'C');
         $pdf->Ln(14);
         $w = array(0 => 12, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 120, 140);
         foreach ($task_lists as $task_list) {
             $pdf->SetFont('Arial', 'B', 14);
             $pdf->Write(10, lang('task list') . ': ' . $task_list->getObjectName());
             $pdf->Ln(14);
             $tasks = $task_list->getTasks();
             $pdf->SetFont('Arial', 'I', 14);
             $pdf->SetFillColor(230, 230, 230);
             $pdf->Cell($w[1], 6, '#', 1, 0, 'C', true);
             $pdf->Cell($w[3], 6, lang('status'), 1, 0, 'C', true);
             $pdf->Cell($w[10], 6, lang('info'), 1, 0, 'C', true);
             $pdf->Cell(0, 6, lang(user), 1, 0, 'C', true);
             $pdf->Ln();
             foreach ($tasks as $task) {
                 $line++;
                 if ($task->isCompleted()) {
                     $task_status = lang('completed');
                     $task_status_color_R = 0;
                     $task_status_color_G = 150;
                     $task_status_color_B = 0;
                     $task_completion_info = lang('completed task') . ' : ' . format_date($task->getCompletedOn()) . ' @ ' . format_time($task->getCompletedOn());
                 } else {
                     $task_status = lang('open');
                     $task_status_color_R = 200;
                     $task_status_color_G = 0;
                     $task_status_color_B = 0;
                     $task_completion_info = lang('due date') . ' : ' . lang('not assigned');
                     $task_completion_info_color_R = 200;
                     $task_completion_info_color_G = 0;
                     $task_completion_info_color_B = 0;
                     if ($task->getDueDate()) {
                         $task_completion_info = lang('due date') . ' : ' . format_date($task->getDueDate()) . ' @ ' . format_time($task->getDueDate());
                         $task_completion_info_color_R = 0;
                         $task_completion_info_color_G = 0;
                         $task_completion_info_color_B = 0;
                     }
                 }
                 if ($task->getAssignedTo()) {
                     $task_assignee = $task->getAssignedTo()->getObjectName();
                     $task_assignee_color_R = 0;
                     $task_assignee_color_G = 0;
                     $task_assignee_color_B = 0;
                 } else {
                     $task_assignee = lang('not assigned');
                     $task_assignee_color_R = 200;
                     $task_assignee_color_G = 0;
                     $task_assignee_color_B = 0;
                 }
                 $pdf->SetFillColor(245, 245, 245);
                 $pdf->Cell($w[1], 6, $line, 1, 0, 'C', true);
                 $pdf->SetTextColor($task_status_color_R, $task_status_color_G, $task_status_color_B);
                 $pdf->Cell($w[3], 6, $task_status, 1, 0, 'C', true);
                 $pdf->SetTextColor($task_completion_info_color_R, $task_completion_info_color_G, $task_completion_info_color_B);
                 $pdf->Cell($w[10], 6, $task_completion_info, 1, 0, 'C', true);
                 $pdf->SetTextColor($task_assignee_color_R, $task_assignee_color_G, $task_assignee_color_B);
                 $pdf->Cell(0, 6, $task_assignee, 1, 0, 'C', true);
                 $pdf->SetTextColor(0, 0, 0);
                 $pdf->Ln();
                 $pdf->MultiCell(0, 6, $task->getText(), 1);
                 //$pdf->Ln();
             }
         }
         $pdf->Output($download_name, 'I');
     }
     if ($output == 'txt') {
         $download_name = "{$project_name}-tasks.txt";
         $download_type = 'text/csv';
         $txt_lang_1 = lang('project');
         $txt_lang_2 = lang('milestone');
         $txt_lang_3 = lang('task list');
         $txt_lang_4 = lang('status');
         $txt_lang_5 = lang('description');
         $txt_lang_6 = lang('id');
         $txt_lang_7 = lang('status');
         $txt_lang_8 = lang('completion info');
         $txt_lang_9 = lang('assigned to');
         $s .= "{$txt_lang_1}\t{$txt_lang_2}\t{$txt_lang_3}\t{$txt_lang_4}\t{$txt_lang_5}\t{$txt_lang_6}\t{$txt_lang_7}\t{$txt_lang_8}\t{$txt_lang_9}";
         $s .= "\n";
         $task_lists = active_project()->getOpenTaskLists();
         foreach ($task_lists as $task_list) {
             /*$s .= $task_list->getObjectName();
               $s .= "\n";
               $task_list_desc = $task_list->getDescription();
               $task_list_desc = strtr($task_list_desc,"\r\n\t","   ");
               $task_list_desc_100 = substr($task_list_desc,0,100);
               $s .= $task_list_desc_100;
               $s .= "\n";*/
             $milestone = $task_list->getMilestone();
             $tasks = $task_list->getTasks();
             foreach ($tasks as $task) {
                 $s .= $project_name;
                 $s .= "\t";
                 $milestone_name = lang(none);
                 if ($milestone instanceof ProjectMilestone) {
                     $milestone_name = $milestone->getName();
                 }
                 $s .= $milestone_name;
                 $s .= "\t";
                 $s .= $task_list->getObjectName();
                 $s .= "\t";
                 $task_list_name = $task_list->getName();
                 if ($task_list->isCompleted()) {
                     $task_list_status = lang('completed');
                 } else {
                     $task_list_status = lang('open');
                 }
                 $s .= $task_list_status;
                 $s .= "\t";
                 $task_list_desc2 = $task_list->getDescription();
                 $task_list_desc2 = strtr($task_list_desc2, "\r\n\t", "   ");
                 $task_list_desc2_100 = substr($task_list_desc2, 0, 50);
                 $s .= $task_list_desc2_100;
                 $s .= "\t";
                 $s .= $task->getId();
                 $s .= "\t";
                 if ($task->isCompleted()) {
                     $task_status = lang('completed');
                     $task_completion_info = format_date($task->getCompletedOn()) . " @ " . format_time($task->getCompletedOn());
                 } else {
                     $task_status = lang('open');
                     $task_completion_info = format_date($task->getDueDate()) . " @ " . format_time($task->getDueDate());
                 }
                 $s .= $task_status;
                 $s .= "\t";
                 $s .= $task_completion_info;
                 $s .= "\t";
                 if ($task->getAssignedTo()) {
                     $task_assignee = $task->getAssignedTo()->getObjectName();
                 } else {
                     $task_assignee = lang('not assigned');
                 }
                 $s .= $task_assignee;
                 $s .= "\n";
             }
         }
         $download_contents = $s;
         download_headers($download_name, $download_type, strlen($download_contents), true);
         echo $download_contents;
     } else {
         $download_name = "{$project_name}-{$task_list_name}-tasks.csv";
         $download_type = 'text/csv';
         $download_contents = $task_list->getDownloadText($task_count, "\t", true);
         download_contents($download_contents, $download_type, $download_name, strlen($download_contents));
     }
     die;
 }
示例#17
-1
 function PrintChecks()
 {
     ////////////////////////////
     // label-specific variables
     $page_width = 8.5;
     $page_height = 11;
     $top_margin = 0;
     $left_margin = 2.5;
     $columns = 1;
     $gutter = 3 / 16;
     $rows = 3;
     // only used for making page breaks, no position calculations
     $label_height = 2.85;
     $label_width = 6;
     // cell margins
     $cell_left = 0.25;
     $cell_top = 0.25;
     $cell_bot = 0.25;
     //
     ////////////////////////////
     $img_ratio = 1.4;
     // loqisaur
     $img_ratio = 0.47;
     // cyan
     $img_ratio = 1.71;
     // marvelous labs
     $logo_width = 0.66;
     // loqisaur
     $logo_width = 0.2;
     // cyan
     $logo_width = 0.5;
     // marvelous labs
     $pdf = new FPDF('P', 'in', array($page_width, $page_height));
     $pdf->AddFont('Twcen', '', 'twcen.php');
     $pdf->AddFont('Micr', '', 'micr.php');
     $pdf->AddFont('Courier', '', 'courier.php');
     $pdf->SetMargins($left_margin, $top_margin);
     $pdf->SetDisplayMode("fullpage", "continuous");
     $pdf->AddPage();
     $lpos = 0;
     foreach ($this->checks as $check) {
         $pos = $lpos % ($rows * $columns);
         // calculate coordinates of top-left corner of current cell
         //    margin        cell offset
         $x = $left_margin + $pos % $columns * ($label_width + $gutter);
         //    margin        cell offset
         $y = $top_margin + floor($pos / $columns) * $label_height;
         /////////////////
         // set up check template
         $pdf->SetFont('Twcen', '', 11);
         // print check number
         $pdf->SetXY($x + 5.25, $y + 0.33);
         $pdf->Cell(1, 11 / 72, $check['check_number'], 0, 'R');
         $logo_offset = 0;
         // offset to print name if logo is inserted
         if (array_key_exists('logo', $check) && $check['logo'] != "") {
             // logo should be: 0.71" x 0.29"
             $logo_offset = $logo_width + 0.005;
             // width of logo
             $pdf->Image($check['logo'], $x + $cell_left, $y + $cell_top + 0.12, $logo_width);
         }
         $pdf->SetFont('Twcen', '', 7);
         // name
         $pdf->SetXY($x + $cell_left + $logo_offset, $y + $cell_top + 0.1);
         $pdf->SetFont('Twcen', '', 10);
         $pdf->Cell(2, 10 / 72, $check['from_name'], 0, 2);
         $pdf->SetFont('Twcen', '', 7);
         $pdf->Cell(2, 7 / 72, $check['from_address1'], 0, 2);
         $pdf->Cell(2, 7 / 72, $check['from_address2'], 0, 2);
         // date
         $pdf->Line($x + 3.5, $y + 0.58, $x + 3.5 + 1.2, $y + 0.58);
         $pdf->SetXY($x + 3.5, $y + 0.48);
         $date_str = $this->matchcase($check['from_name'], "date");
         $pdf->Cell(1, 7 / 72, $date_str);
         // pay to the order of
         $pdf->Line($x + $cell_left, $y + 1.1, $x + $cell_left + 4.1, $y + 1.1);
         $pdf->SetXY($x + $cell_left, $y + 0.88);
         $pay_str = $this->matchcase($check['from_name'], "pay to the order of");
         $pdf->MultiCell(0.6, 7 / 72, $pay_str, '', '', 'L');
         // amount box
         $pdf->Rect($x + 4.5, $y + 0.83, 1.1, 0.25);
         // dollars
         $pdf->Line($x + $cell_left, $y + 1.5, $x + $cell_left + 5.37, $y + 1.5);
         $pdf->SetXY($x + $cell_left + 4.37, $y + 1.4);
         $dollar_str = $this->matchcase($check['from_name'], "dollars");
         $pdf->Cell(1, 7 / 72, $dollar_str, '', '', 'R');
         // bank info
         $pdf->SetXY($x + $cell_left, $y + 1.6);
         $pdf->Cell(2, 7 / 72, $check['bank_1'], 0, 2);
         $pdf->Cell(2, 7 / 72, $check['bank_2'], 0, 2);
         $pdf->Cell(2, 7 / 72, $check['bank_3'], 0, 2);
         $pdf->Cell(2, 7 / 72, $check['bank_4'], 0, 2);
         // memo
         $pdf->Line($x + $cell_left, $y + 2.225, $x + $cell_left + 2.9, $y + 2.225);
         $pdf->SetXY($x + $cell_left, $y + 2.125);
         $memo_str = $this->matchcase($check['from_name'], "memo");
         $pdf->Cell(1, 7 / 72, $memo_str);
         // signature line
         $pdf->Line($x + 3.25, $y + 2.225, $x + 3.25 + 2.375, $y + 2.225);
         ////////////////////////
         // fill in values for this check
         $pdf->SetFont('Courier', '', 11);
         // date
         if ($check['date'] != "") {
             $pdf->SetXY($x + 3.5 + 0.3, $y + 0.38);
             $pdf->Cell(1, 0.25, $check['date']);
         }
         // pay to
         if ($check['pay_to'] != "") {
             $pdf->SetXY($x + $cell_left + 0.5, $y + 0.88);
             $pdf->Cell(1, 0.25, $check['pay_to']);
         }
         // amount
         if ($check['amount'] > 0) {
             $dollars = intval($check['amount']);
             $cents = round(($check['amount'] - $dollars) * 100);
             //$dollars_str = TextualNumber::GetText($dollars);
             $numtxt = new TextualNumber($dollars);
             $dollars_str = $numtxt->numToWords($dollars);
             $amt_string = "***" . ucfirst(strtolower($dollars_str)) . " dollars";
             if ($cents > 0) {
                 $amt_string .= " and " . $cents . "/100";
             } else {
                 $amt_string .= " and 00/100";
             }
             $amt_string .= "***";
             $pdf->SetFont('Courier', '', 9);
             $pdf->SetXY($x + $cell_left, $y + 1.28);
             $pdf->Cell(1, 0.25, $amt_string);
             #$amt = '$'.sprintf("%01.2f",$check['amount']);
             $amt = '$' . number_format($check['amount'], 2);
             $pdf->SetXY($x + 4.5 + 0.06, $y + 0.83);
             $pdf->Cell(1, 0.25, $amt);
         }
         // memo
         $pdf->SetFont('Courier', '', 8);
         $pdf->SetXY($x + $cell_left + 0.3, $y + 2.02);
         $pdf->Cell(1, 0.25, $check['memo']);
         $pdf->SetFont('Courier', '', 11);
         // routing and account number
         $pdf->SetFont('Micr', '', 10);
         $routingstring = "t" . $check['routing_number'] . "t" . $check['account_number'] . "o" . $check['check_number'];
         if (array_key_exists('codeline', $check)) {
             $routingstring = $check['codeline'];
         }
         $pdf->SetXY($x + $cell_left, $y + 2.47);
         $pdf->Cell(5, 10 / 72, $routingstring);
         // signature
         if (substr($check['signature'], -3) == 'png') {
             $sig_offset = 1.75;
             // width of signature
             $pdf->Image($check['signature'], $x + $cell_left + 3.4, $y + 1.88, $sig_offset);
         } else {
             $pdf->SetFont('Arial', 'i', 10);
             if ($check['signature'] != "") {
                 $pdf->SetXY($x + $cell_left + 3.4, $y + 2.01);
                 $pdf->Cell(1, 0.25, $check['signature']);
             }
         }
         // pre-authorized disclaimer
         $pdf->SetFont('Arial', '', 6);
         if (isset($check['pre_auth'])) {
             $pdf->SetXY($x + $cell_left + 3.3, $y + 2.155);
             $pdf->Cell(1, 0.25, "This check is pre-authorized by your depositor");
         }
         if ($pos == $rows * $columns - 1 && !($lpos == count($this->checks) - 1)) {
             $pdf->AddPage();
         }
         $lpos++;
     }
     $pdf->Output();
 }