function crear_certificado($parametros) { $pdf = new PDF_HTML('L', 'mm', 'Letter', 20, 7); $pdf->AddPage(); $pdf->SetlineWidth(0.264583333); $pdf->setDrawColor(74, 112, 139); $pdf->Rect(17.018, 4.318, $pdf->w - 17.018 - 17.018, $pdf->h - 4.318 - 4.318); $pdf->SetFont('Arial', '', 12); // IMAGENES // QR $url = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" . "status_chofer.php"; $qrFile = generarQR($url); $pdf->Image($qrFile, 18, 8, 0, 30, 'PNG'); unlink($qrFile); $pdf->Image(__DIR__ . '/../img/logo2.png', 235, 8, 0, 30); $pdf->Image(__DIR__ . '/../img/logo.png', 105, 8, 0, 30); $pdf->Ln(15); // TITULO $title = '<p align="center"><b><u>CERTIFICADO DE CAPACITACIÓN PARA EL TRANSPORTE DE MERCANCÍAS PELIGROSAS</u></b></p>'; $pdf->WriteHTML(utf8_decode($title)); // BLOQUE 1 $htmlprev = <<<'EOD' El Prestador de Servicios de Formación Profesional para la Capacitación Básica y Complementaria Obligatoria de los Conductores de Vehículos Empleados en el Transporte de Mercancías Peligrosas por Carretera, <b>#PRESTADOR</b>, certifica que el/la <b>#CHOFER</b>, Matricula <b>#MATRICULA</b>, DNI <b>#DNI</b>, ha participado y completado el curso de Capacitación <b>#CURSO</b> según Resolución S.T N° 110/1997 modificada por Resolución S.T. N° 65/2000 para los Conductores de los Vehículos antes mencionados. EOD; $holders = ["#PRESTADOR", "#CHOFER", "#MATRICULA", "#DNI", "#CURSO"]; $variables = [utf8_decode($parametros['prestador']), utf8_decode($parametros['chofer']), utf8_decode($parametros['matricula']), utf8_decode($parametros['dni']), utf8_decode($parametros['curso'])]; $html = str_replace($holders, $variables, utf8_decode($htmlprev)); $pdf->WriteHTML($html); $pdf->Ln(20); // BLOQUE 2 $html = <<<'EOD' Se expide el presente Certificado, a los efectos de la obtención de la Licencia Nacional habilitante. La vigencia del mismo es de UN (1) año a partir de la fecha de realización del Curso de Capacitación. EOD; $pdf->WriteHTML(utf8_decode($html)); $pdf->Ln(20); // FECHAS $texto = 'Sede del Curso: '; $pdf->Cell(50, 5, utf8_decode($texto), 0, 0, 'L'); $pdf->setFont('Arial', 'B', 12); $pdf->Cell(100, 5, utf8_decode($parametros['sede']), 0, 0, 'L'); $pdf->setFont('Arial', '', 12); $texto = 'Fecha del Curso: '; $pdf->Cell(10, 5, '', 0, 0, 'L'); $pdf->Cell(0, 5, $texto, 0, 0, 'L'); $pdf->setFont('Arial', 'B', 12); $pdf->Cell(0, 5, utf8_decode($parametros['fecha_curso']), 0, 1, 'R'); $pdf->setFont('Arial', '', 12); $pdf->Ln(5); $texto = 'Numero de Transacción: '; $pdf->Cell(50, 5, utf8_decode($texto), 0, 0, 'L'); $pdf->setFont('Arial', 'B', 12); $pdf->Cell(100, 5, utf8_decode($parametros['transaccion']), 0, 0, 'L'); $pdf->setFont('Arial', '', 12); $texto = 'Fecha de Transacción: '; $pdf->Cell(10, 5, '', 0, 0, 'L'); $pdf->Cell(0, 5, utf8_decode($texto), 0, 0, 'L'); $pdf->setFont('Arial', 'B', 12); $pdf->Cell(0, 5, utf8_decode($parametros['fecha_transaccion']), 0, 1, 'R'); $pdf->setFont('Arial', '', 12); $pdf->Ln(45); return $pdf; }
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); // $ourPDF->SetDrawColor(127, 127, 127);