Example #1
0
$ourPDF->Open();
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);