switch ($pdfdoc) { case "rapport_tache": $query_chk = "select id_tache from taches where id_tache=" . $task_id; $res_chk = mysql_query($query_chk, $dbh); if (mysql_num_rows($res_chk) == '1') { //date de génération du rapport $rs = mysql_query("select curdate()"); $date_MySQL = mysql_result($rs, $row); $tasks = new taches(); foreach ($tasks->types_taches as $type_tache) { if ($type_tache->id_type == $type_task_id) { require_once $base_path . "/admin/planificateur/" . $type_tache->name . "/" . $type_tache->name . ".class.php"; eval("\$conn=new " . $type_tache->name . "(\"" . $base_path . "/admin/planificateur/" . $type_tache->name . "\");"); $task_datas = $conn->get_report_datas($task_id); $ourPDF->addPage(); $ourPDF->SetXY(15, 8); $ourPDF->setFont($pmb_pdf_font, 'B', 9); $title = "Type : "; $ourPDF->setFont($pmb_pdf_font, '', 9); $title .= $type_tache->comment; $ourPDF->multiCell($largeur_page - $marge_page_droite - $ourPDF->GetX(), 6, $title, 0, 'L', 0); $ourPDF->SetXY(15, 20); $header = $msg["planificateur_task_name"] . " : " . stripslashes($task_datas["libelle_tache"]) . "\n" . $msg["tache_date_generation"] . " : " . formatdate($date_MySQL) . "\n" . $msg["tache_date_dern_exec"] . " : " . formatdate($task_datas['start_at'][0]) . "\n" . $msg["tache_heure_dern_exec"] . " : " . $task_datas['start_at'][1] . "\n" . $msg["tache_date_fin_exec"] . " : " . formatdate($task_datas['end_at'][0]) . "\n" . $msg["tache_heure_fin_exec"] . " : " . $task_datas['end_at'][1] . "\n" . $msg["tache_statut"] . " : " . $msg["planificateur_state_" . $task_datas["status"]] . " (" . $task_datas["indicat_progress"] . "%)\n"; // $ourPDF->SetTextColor(92, 92, 92); $ourPDF->multiCell($largeur_page - $marge_page_droite - $ourPDF->GetX(), 6, $msg["planificateur_task_name"] . " : " . stripslashes($task_datas["libelle_tache"]), 0, 'L', 0); // $ourPDF->SetFillColor(255, 255, 255); $ourPDF->multiCell($largeur_page - $marge_page_droite - $ourPDF->GetX(), 6, $msg["tache_date_generation"] . " : " . formatdate($date_MySQL) . "\n", 0, 'L', 0); // $ourPDF->SetDrawColor(127, 127, 127); $ourPDF->multiCell($largeur_page - $marge_page_droite - $ourPDF->GetX(), 6, $msg["tache_date_dern_exec"] . " : " . formatdate($task_datas['start_at'][0]) . "\n", 0, 'L', 0); // $ourPDF->SetDrawColor(255, 255, 255); $ourPDF->multiCell($largeur_page - $marge_page_droite - $ourPDF->GetX(), 6, $msg["tache_heure_dern_exec"] . " : " . $task_datas['start_at'][1] . "\n", 0, 'L', 0);
$nome_arquivo = strtolower(str_replace(" ", "_", $nome_arquivo)); $arquivo_destino = "{$caminho}/../temp/{$nome_arquivo}"; $pdf = new PDF_HTML(); $pdf->AddPage('L'); $pdf->setSourceFile($modelo); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $palestra = $perfil == "palestrante" ? ', com o tema "' . utf8_encode($tema_palestra) . '"' : ""; $nome_convertido = utf8_encode($nome); $titulo = "CERTIFICADO"; $corpo = utf8_decode("Certificamos que <b>{$nome_convertido}</b> participou do evento " . NOME_EVENTO . ", realizado " . PERIODO_EVENTO . ", " . LOCAL_EVENTO . ", com carga horária de " . CARGA_HORARIA_EVENTO . " horas, na qualidade de <b>{$perfil}</b>{$palestra}."); // Titulo $pdf->SetFont('Arial', 'B', 32); $pdf->SetTextColor(35, 142, 35); //Verde Floresta $pdf->SetXY(110, 35); $pdf->Write(0, $titulo); // Corpo do texto $pdf->SetFont('Arial', '', 22); $pdf->SetTextColor(35, 142, 35); //Verde Floresta $pdf->SetY("65"); $pdf->SetX("20"); $pdf->WriteHTML($corpo, 9); $pdf->Output($arquivo_destino, 'F'); $retorno = EnviarEmail::enviar("envio_certificado", "", $email, $nome, 0, "", $arquivo_destino); if (file_exists($arquivo_destino)) { unlink($arquivo_destino); } echo "<br><br>O certificado de {$perfil} de <b>" . utf8_encode($nome) . "</b>" . ($retorno ? "" : " nao") . " foi enviado com sucesso"; }
unset($participanteAr[$i]); //Remove do array cada participante sem nome } $i++; } $participanteAr = array_values($participanteAr); //Reorganiza a array $textoPrincipal = $_POST['texto']; str_replace(array("{evento}", "{departamento}"), array($_POST['evento'], $_POST['departamento']), $textoPrincipal); $pdf = new PDF_HTML('L', 'mm'); foreach ($participanteAr as $participante) { $pdf->AddPage(); $pdf->SetLeftMargin(110); $pdf->SetRightMargin(20); $pdf->SetFont('Arial', '', 14); $pdf->SetXY(0, 0); $pdf->SetFillColor(200, 220, 255); $pdf->Rect(0, 0, 90, 210, 'F'); //Borda esquerda com simbolos da PROCEV - REMOVER DEPOIS $pdf->SetFillColor(195, 195, 195); $pdf->Rect(90, 0, 207, 50, 'F'); //Texto superior - REMOVER DEPOIS $pdf->SetFillColor(195, 195, 195); $pdf->Rect(90, 160, 207, 50, 'F'); //Texto inferior - REMOVER DEPOIS $pdf->SetXY(110, 70); //Posicao inicial do texto do certificado -- posicao x = 110mm / posicao y = 70mm //$txt = file_get_contents('fpdf/license.txt'); /*$texto = "EVENTO: ".$_POST['evento']."\nDepartamento :".$_POST['departamento']."\nPeriodo :".$_POST['periodo']. "\nParticipante :".$value;*/ $texto = utf8_decode(" " . "Certifi<B>ca</B>mos que " . $participante . " participou do evento " . $_POST['evento'] . " realizado pelo " . $_POST['departamento'] . " no periodo " . $_POST['periodo'] . " com carga horaria de " . $_POST['carga'] . " horas.");