public function test()
 {
     $info_veto = requetemysql::info_veterinaire(array('login' => $_SESSION['login']));
     if (empty($info_veto)) {
         throw new Exception("Aucun animal dans la base de donnée !");
     }
     $liste_cat_delivre = array("tablette", "tablettes", "comprimé", "compimés", "flacon", "ml", "pipette", "pipettes");
     $liste_tournures = array(array(nom => ""), array(nom => "Comprimés/gélules", seq1 => "Administer", defaut => "p1220", nombre => array(1, 1, 4, 0.25), nature => array("", "comprimé", "comprimés", "gélule", "gélules"), rythme => array("", "par jour", "matin et soir", "matin, midi et soir"), duree => array("3 jours", "5 jours", "7 jours", "10 jours", "15 jours", "1 mois", "3 mois"), suite => array("", "puis 1 jour sur 2", "puis 1 jour sur 2, 4 fois", "puis 2 fois par semaine")), array(nom => "Solution buvable", seq1 => "Administer", defaut => "p1110", nombre => array(0, 10, 40, 1), nature => array("", " graduations : la dose correspondant au poids", "ml", "graduations"), rythme => array("", "une fois par jour", "matin et soir", "matin, midi et soir"), duree => array("3 jours", "5 jours", "7 jours", "10 jours", "15 jours", "1 mois", "3 mois"), suite => array("", "puis 1 jour sur 2", "puis 1 jour sur 2, 4 fois", "puis 2 fois par semaine")), array(nom => "collyre", seq1 => ">Instiller", defaut => "p1220", nombre => array(1, 1, 3, 1), nature => array("", "goutte", "giclée"), rythme => array("", "par jour", "matin et soir", "matin, midi et soir", "toutes les 2 heures"), duree => array("3 jours", "5 jours", "7 jours", "10 jours", "15 jours", "1 mois", "3 mois"), suite => array("", "puis 1 jour sur 2", "puis 1 jour sur 2, 4 fois", "puis 2 fois par semaine")), array(nom => "suspension auriculaire", seq1 => "Instiller", defaut => "p2130", nombre => array(1, 1, 3, 1), nature => array("", "goutte", "giclée"), rythme => array("", "par jour", "matin et soir", "matin, midi et soir", "toutes les 2 heures"), duree => array("3 jours", "5 jours", "7 jours", "10 jours", "15 jours", "1 mois", "3 mois"), suite => array("", "puis 1 jour sur 2", "puis 1 jour sur 2, 4 fois", "puis 2 fois par semaine")), array(nom => "shampoing", seq1 => "Mouiller, shampoiner, laisser agir 5 minutes et rincer", defaut => "310", rythme => array("", "tous les jours", "un jour sur deux", "une fois par semaine", "tous les 15 jours", "tous les mois"), duree => array("15 jours", "1 mois", "3 mois"), suite => array("", "puis une fois par mois", "puis tous les 15 jours")), array(nom => "friction", defaut => "1p1242", dilution1 => array("Diluer", ""), dilution2 => array(0, 10, 50, 2), nature => array("", "ml"), dilution => array("", "dans un litre d'eau", "dans 1/2 litre d'eau", "dans un fond de verre d'eau"), seq1 => "Frictionner l'animal", rythme => array("", "tous les jours", "matin et soir", "un jour sur deux", "deux fois par semaine", "une fois par semaine", "tous les 15 jours", "tous les mois"), duree => array("7 jours.", "15 jours.", "1 mois.", "3 mois.")), array(nom => "injection", defaut => "p112", seq1 => "Injecter", nombre => array(0, 0, 40, 1), nature => array("", "ml", "graduations"), rythme => array("", "par jour", "matin et soir", "un jour sur deux"), duree => array("3 jours.", "5 jours.", "7 jours.", "10 jours.", "15 jours.", "1 mois.", "3 mois.")), array(nom => "spot-on", defaut => "3", seq1 => "Instiller entre les épaules la quantité de la pipette", rythme => array("", "toutes les semaines.", "tous les 15 jours.", "tous les mois.", "tous les 2 mois.")));
     render('_labo', array('title' => "Laboratoire d'Aerogard, zone de test et de recherche...", 'liste_tournures' => $liste_tournures, 'liste_cat_delivre' => $liste_cat_delivre, 'info_veto' => $info_veto));
 }
 public function _session_en_cours()
 {
     if (isset($_SESSION['login'])) {
         $info_tour = requetemysql::info_veterinaire(array('login' => $_SESSION['login']));
         if (empty($info_tour)) {
             $info_tour = array();
         } else {
             $info_tour = json_decode($info_tour, true);
         }
     }
     render('_chargement', array('title' => TXT_CHARGEMENT_CONTROLLER_TITTLE, 'action' => TXT_CHARGEMENT_CONTROLLER_ACTION, 'info_tour' => $info_tour));
 }
function info_clini()
{
    $info_veto = requetemysql::info_veterinaire(array('login' => $_SESSION['login']));
    if (empty($info_veto)) {
        throw new Exception("Aucun animal dans la base de donnée !");
    }
    return $info_veto;
}
Beispiel #4
0
         $donne_mois = requetemysql::stat(array('debut' => $value[0], 'fin' => $value[1], 'choix' => $_POST['mon_choix']));
         $donne_mois2 = requetemysql::stat(array('debut' => $value[2], 'fin' => $value[3], 'choix' => $_POST['mon_choix']));
         $array_tempo = array('mois' => date("Y-m", $value[0] / 1000), 'ca_a' => $donne_mois[0]['total'] ? $donne_mois[0]['total'] : "0", 'ca_b' => $donne_mois2[0]['total'] ? $donne_mois2[0]['total'] : "0");
         array_push($donnee_an, $array_tempo);
     }
     echo json_encode($donnee_an);
 } elseif ($data3 == "print_reglement_veto") {
     $print_reglement_veto = json_decode($_POST['liste_reglement_honoraires'], true);
     $filename = '../sauvegarde/clinique/facture_veto/' . $print_reglement_veto['nom'];
     $info_veto = requetemysql::info_veterinaire(array('login' => strtolower($print_reglement_veto['nom'])));
     if (empty($info_veto)) {
         throw new Exception("Erreur dans la recherche des informations sur le vétérinaire");
     } else {
         $info_veto = json_decode($info_veto, true);
     }
     $info_client = requetemysql::info_veterinaire(array('login' => strtolower($_SESSION['login'])));
     if (empty($info_client)) {
         throw new Exception("Erreur dans la recherche des informations sur le vétérinaire");
     } else {
         $info_client = json_decode($info_client, true);
     }
     if (!file_exists($filename)) {
         if (!mkdir($filename, 0755, true)) {
             die('Echec lors de la création des répertoires...');
         }
     }
     $pdf = new FPDF();
     $pdf->AliasNbPages();
     $pdf->AddPage();
     $pdf->Image('../image/logo/essai1.jpg', 10, 6, 30);
     $pdf->SetFont('Times', '', 18);
Beispiel #5
0
         if ($max_y2 > $max_y) {
             $max_y = $max_y2;
         }
     }
     if (date("w", $date_debut) == $header[count($header) - 1]["valeur"]) {
         $x2 = $max_y;
         $x2 += $hauteur;
         $x3 = 10;
         $max_y = 0;
     } else {
         $x3 += $w[0];
     }
     $date_debut = mktime(0, 0, 0, date("m", $date_debut), date("d", $date_debut) + 1, date("Y", $date_debut));
 }
 while (list($key_planning, $value_planning) = each($planning)) {
     $info_veto2 = requetemysql::info_veterinaire(array('login' => strtolower($value_planning['login'])));
     if (empty($info_veto2)) {
         throw new Exception("Erreur dans la recherche des informations sur le vétérinaire cible");
     } else {
         $info_veto2 = json_decode($info_veto2, true);
     }
     $pdf->AddPage();
     $pdf->Image('../image/logo/essai1.jpg', 10, 6, 30);
     $pdf->SetFont('Times', '', 18);
     $titre3 = utf8_decode(stripslashes(ucfirst($info_veto[0]['nom'])));
     $w = $pdf->GetStringWidth(stripslashes($titre3)) + 6;
     $pdf->SetX((210 - $w) / 2);
     $pdf->Cell($w, 7, $titre3, 0, 'C');
     $pdf->Ln();
     $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['adresse']))) + 6;
     $pdf->SetX((210 - $w) / 2);
         $pdf->MultiCell(0, 20, "", 'TRB', 'L', false);
         $mon_url = '../sauvegarde/clinique/impression_tarif/' . $login_veto . '/tarifs_' . date("d_m_y") . uniqid() . '.pdf';
         //$pdf->Output($mon_url, F);
         $pdf->Output($mon_url, F);
         echo json_encode($mon_url);
     } else {
         header('HTTP/1.1 400 Bad Request');
         exit("Vous n'avez pas les droits d'accéder à cette section");
     }
 } else {
     if ($data3 == 'print_tarif2') {
         if ($_POST['login_veto'] == $_SESSION['login2'] || $_POST['tour_veto'] == $_SESSION['login2']) {
             $login_veto = $_POST['login_veto'];
             $tour_veto = $_POST['tour_veto'];
             $filename = '../sauvegarde/clinique/impression_tarif/' . $login_veto;
             $info_veto = requetemysql::info_veterinaire(array('login' => strtolower($login_veto)));
             if (empty($info_veto)) {
                 throw new Exception("Erreur dans la recherche des informations sur le vétérinaire");
             } else {
                 $info_veto = json_decode($info_veto, true);
             }
             $tarifs = $_POST['tarifs'];
             if (!file_exists($filename)) {
                 if (!mkdir($filename, 0755, true)) {
                     die('Echec lors de la création des répertoires...');
                 }
             }
             $pdf = new FPDF();
             $pdf->AddPage();
             $pdf->SetFont('Times', '', 18);
             $titre3 = utf8_decode(stripslashes(ucfirst($info_veto[0]['nom'])));
function creation_resume($animal_id, $info_analyse, $info_radio, $info_formulaire, $variable)
{
    $filename = '../sauvegarde/animaux/' . $animal_id;
    if (!file_exists($filename)) {
        if (!mkdir($filename, 0755, true)) {
            die('Echec lors de la création des répertoires...');
        }
    }
    $info_veto = requetemysql::info_veterinaire(array('login' => strtolower($_SESSION['login'])));
    if (empty($info_veto)) {
        throw new Exception("Erreur dans la recherche des informations sur le vétérinaire");
    } else {
        $info_veto = json_decode($info_veto, true);
    }
    if ($_SESSION['login'] != $_SESSION['login2']) {
        $info_veto2 = requetemysql::info_veterinaire(array('login' => strtolower($_SESSION['login2'])));
        if (empty($info_veto2)) {
            throw new Exception("Erreur dans la recherche des informations sur le vétérinaire qui a réalisé la consultation");
        } else {
            $info_veto2 = json_decode($info_veto2, true);
        }
    }
    $pdf = new FPDF();
    $pdf->AddPage();
    $pdf->Image('../image/logo/essai1.jpg', 10, 6, 30);
    $pdf->SetFont('Times', '', 18);
    $titre3 = utf8_decode(stripslashes(ucfirst($info_veto[0]['nom'])));
    $w = $pdf->GetStringWidth(stripslashes($titre3)) + 6;
    $pdf->SetX((210 - $w) / 2);
    $pdf->Cell($w, 7, $titre3, 0, 'C');
    $pdf->Ln();
    $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['adresse']))) + 6;
    $pdf->SetX((210 - $w) / 2);
    $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['adresse'])), 0, 'C');
    $pdf->Ln();
    $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune']))) + 6;
    $pdf->SetX((210 - $w) / 2);
    $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune'])), 0, 'C');
    $pdf->Ln();
    $pdf->SetFont('Times', '', 12);
    $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['tel']))) + 6;
    $pdf->SetX((210 - $w) / 2);
    $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['tel'])), 0, 'C');
    $pdf->Ln(20);
    $pdf->MultiCell(85, 5, "Le " . date("d.m.y"), 0, 'L');
    $pdf->SetFont('Times', 'B', 12);
    $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Résumé de la consultation du " . $info_formulaire['date_consultation'] . ", concernant :" . $_POST['caracteristique']), '0', 'L');
    $pdf->SetFont('Times', '', 12);
    if ($_SESSION['login'] != $_SESSION['login2']) {
        $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Cette consultation a été réalisée par " . $info_veto2[0]['nom_vet'] . ", exerçant à :" . $info_veto2[0]['adresse'] . " " . $info_veto2[0]['code'] . " " . $info_veto2[0]['commune'] . ". Téléphone :" . $info_veto2[0]['tel']), '0', 'L');
        $pdf->Ln();
    }
    $pdf->SetFont('Times', '', 14);
    $pdf->SetFillColor(153, 153, 153);
    $pdf->SetTextColor(0, 0, 0);
    $pdf->SetDrawColor(153, 153, 153);
    $pdf->SetLineWidth(0.3);
    $pdf->MultiCell(190, 10, requetemysql::gestion_string_maj("Motif de consultation :" . $info_formulaire['barre_resume']), '0', 'L', true);
    $pdf->Ln();
    $pdf->SetFont('Times', '', 12);
    $pdf->MultiCell(190, 5, requetemysql::gestion_string_maj("Détail :" . $info_formulaire['clinique']), 0, 'L');
    $pdf->Ln(15);
    $pdf->Cell(50, 20, utf8_decode("signature du vétérinaire :"), 0, 0, false);
    if (count($info_analyse) > 0) {
        $pdf->AddPage();
        $pdf->Image('../image/logo/essai1.jpg', 10, 6, 30);
        $pdf->SetFont('Times', '', 18);
        $titre3 = utf8_decode(stripslashes(ucfirst($info_veto[0]['nom'])));
        $w = $pdf->GetStringWidth(stripslashes($titre3)) + 6;
        $pdf->SetX((210 - $w) / 2);
        $pdf->Cell($w, 7, $titre3, 0, 'C');
        $pdf->Ln();
        $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['adresse']))) + 6;
        $pdf->SetX((210 - $w) / 2);
        $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['adresse'])), 0, 'C');
        $pdf->Ln();
        $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune']))) + 6;
        $pdf->SetX((210 - $w) / 2);
        $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune'])), 0, 'C');
        $pdf->Ln();
        $pdf->SetFont('Times', '', 12);
        $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['tel']))) + 6;
        $pdf->SetX((210 - $w) / 2);
        $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['tel'])), 0, 'C');
        $pdf->Ln(20);
        $pdf->MultiCell(85, 5, "Le " . date("d.m.y"), 0, 'L');
        $pdf->SetFont('Times', 'B', 12);
        $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Résultat d'analyse du " . $info_formulaire['date_consultation'] . ", concernant :" . $_POST['caracteristique']), '0', 'L');
        $pdf->SetFont('Times', '', 12);
        if ($_SESSION['login'] != $_SESSION['login2']) {
            $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Ces analyses ont été réalisées par " . $info_veto2[0]['nom_vet'] . ", exerçant à :" . $info_veto2[0]['adresse'] . " " . $info_veto2[0]['code'] . " " . $info_veto2[0]['commune'] . ". Téléphone :" . $info_veto2[0]['tel']), '0', 'L');
        }
        $pdf->Ln();
        // Largeurs des colonnes
        $w = array(190 / 4, 190 / 6, 190 / 6, 190 / 4, 190 / 6);
        $header = array(utf8_decode('Référence'), utf8_decode('Résultat'), utf8_decode('Unité'), utf8_decode('Méthode'), utf8_decode("date d'analyse"));
        // En-tête
        for ($i = 0; $i < count($header); $i++) {
            $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C');
        }
        $pdf->Ln();
        // Données
        foreach ($info_analyse as $row) {
            $pdf->Cell($w[0], 6, requetemysql::gestion_string_maj($row['nom']), 'LR', 0, 'C');
            $pdf->Cell($w[1], 6, requetemysql::gestion_string_norm($row['resultat']), 'LR', 0, 'R');
            $pdf->Cell($w[2], 6, requetemysql::gestion_string_norm($row['unite']), 'LR', 0, 'C');
            $pdf->Cell($w[3], 6, requetemysql::gestion_string_norm($row['methode']), 'LR', 0, 'C');
            $pdf->Cell($w[4], 6, requetemysql::gestion_string_norm($row['ma_date']), 'LR', 0, 'C');
            $pdf->Ln();
        }
        // Trait de terminaison
        $pdf->Cell(array_sum($w), 0, '', 'T');
        $pdf->Ln(8);
        $pdf->Cell(50, 20, utf8_decode("Commentaire :"), 'LTB', 0, false);
        $pdf->MultiCell(0, 20, requetemysql::gestion_string_maj($info_formulaire['commentaire']), 'TRB', 'L', false);
    }
    if (count($info_radio) > 0 || $info_formulaire['result_radio'] != '') {
        $pdf->AddPage();
        $pdf->Image('../image/logo/essai1.jpg', 10, 6, 30);
        $pdf->SetFont('Times', '', 18);
        $titre3 = utf8_decode(stripslashes(ucfirst($info_veto[0]['nom'])));
        $w = $pdf->GetStringWidth(stripslashes($titre3)) + 6;
        $pdf->SetX((210 - $w) / 2);
        $pdf->Cell($w, 7, $titre3, 0, 'C');
        $pdf->Ln();
        $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['adresse']))) + 6;
        $pdf->SetX((210 - $w) / 2);
        $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['adresse'])), 0, 'C');
        $pdf->Ln();
        $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune']))) + 6;
        $pdf->SetX((210 - $w) / 2);
        $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune'])), 0, 'C');
        $pdf->Ln();
        $pdf->SetFont('Times', '', 12);
        $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['tel']))) + 6;
        $pdf->SetX((210 - $w) / 2);
        $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['tel'])), 0, 'C');
        $pdf->Ln(20);
        $pdf->MultiCell(85, 5, "Le " . date("d.m.y"), 0, 'L');
        $pdf->SetFont('Times', 'B', 12);
        $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Compte-rendu de l'examen radiologique du " . $info_formulaire['date_consultation'] . ", concernant :" . $_POST['caracteristique']), '0', 'L');
        $pdf->SetFont('Times', '', 12);
        if ($_SESSION['login'] != $_SESSION['login2']) {
            $pdf->MultiCell(190, 7, requetemysql::gestion_string_maj("Ces radios ont été réalisées par " . $info_veto2[0]['nom_vet'] . ", exerçant à :" . $info_veto2[0]['adresse'] . " " . $info_veto2[0]['code'] . " " . $info_veto2[0]['commune'] . ". Téléphone :" . $info_veto2[0]['tel']), '0', 'L');
        }
        $pdf->Ln();
        // Largeurs des colonnes
        $w = array(190 / 4, 190 / 4, 190 / 4, 190 / 4);
        $header = array(utf8_decode('Personnel exposé aux RX'), utf8_decode('constantes'), utf8_decode('date'), utf8_decode('Zone radiographiée'));
        // En-tête
        for ($i = 0; $i < count($header); $i++) {
            $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C');
        }
        $pdf->Ln();
        // Données
        foreach ($info_radio as $row) {
            $pdf->Cell($w[0], 6, requetemysql::gestion_string_maj($row['perso']), 'LR', 0, 'R');
            $pdf->Cell($w[1], 6, requetemysql::gestion_string_norm($row['expo']), 'LR', 0, 'R');
            $pdf->Cell($w[2], 6, requetemysql::gestion_string_norm($row['ma_date']), 'LR', 0, 'C');
            $pdf->Cell($w[3], 6, requetemysql::gestion_string_norm($row['zone']), 'LR', 0, 'C');
            $pdf->Ln();
        }
        // Trait de terminaison
        $pdf->Cell(array_sum($w), 0, '', 'T');
        $pdf->Ln(4);
        $pdf->MultiCell(0, 10, utf8_decode("Résultat de la lecture de cliché :"), 'LTRB', 'C', false);
        $pdf->Ln(4);
        $pdf->Write(5, requetemysql::gestion_string_maj($info_formulaire['result_radio']));
    }
    $mon_url = '../sauvegarde/animaux/' . $_POST['animal_id'] . '/resume_consult_' . $variable . '.pdf';
    $pdf->Output($mon_url, F);
    return $mon_url;
}
Beispiel #8
0
 /**
  * print_result4
  * print all the jobs realized by member since reference date selected in the second part (start date to share job between member)
  *
  * @param array $arr :
  * @param array $arr['team'] team with param (login, nom, adresse, code, commune, tel1, tel2, mail)
  * @param array $arr['team2'] team2 with param (login, total_job, total_jobv2, liste_job)
  * @param date $arr['date_ref'] format DD/MM/YYYY date selected to begin share job between member
  * @param string $arr['date_debut'] date of the begin of the selected month format : DD/MM/YYYY
  * @param string $arr['date_fin'] date of the end of the selected month format : DD/MM/YYYY
  * @param array $arr['agenda'] array of schedule for the month sort by job and by login
  * @return json json of ok
  */
 public static function print_result4($arr)
 {
     try {
         require 'fpdf/fpdf.php';
         require 'fpdi/fpdi.php';
         $filename = 'planning/';
         if (!file_exists($filename)) {
             if (!mkdir($filename, 0755, true)) {
                 die('Echec lors de la création des répertoires...');
             }
         }
         if ($arr['cas'] == 1) {
             $pdf = new FPDF();
         }
         $intersect = array_uintersect($arr['team'], $arr['team2'], 'compareDeepValue');
         if (isset($_SESSION['login2'])) {
             $info_veto = requetemysql::info_veterinaire(array('login' => strtolower($_SESSION['login'])));
             if (empty($info_veto)) {
                 throw new Exception("Erreur dans la recherche des informations sur le vétérinaire");
             } else {
                 $info_veto = json_decode($info_veto, true);
             }
         }
         $transformation_object = array_map(function ($e) {
             return is_object($e) ? $e->login : $e['login'];
         }, $arr['team2']);
         //			var_error_log("liste_pointv2");
         //			var_error_log($transformation_object);
         foreach ($intersect as $info_veto2) {
             if ($arr['cas'] == 2) {
                 $pdf = new FPDF();
             }
             $mon_index = array_search($info_veto2->login, $transformation_object);
             var_error_log($mon_index);
             $pdf->AddPage();
             $pdf->Image('../images/logo/essai1.jpg', 10, 6, 30);
             if (isset($_SESSION['login2'])) {
                 $pdf->SetFont('Times', '', 18);
                 $titre3 = utf8_decode(stripslashes(ucfirst($info_veto[0]['nom'])));
                 $w = $pdf->GetStringWidth(stripslashes($titre3)) + 6;
                 $pdf->SetX((210 - $w) / 2);
                 $pdf->Cell($w, 7, $titre3, 0, 'C');
                 $pdf->Ln();
                 $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['adresse']))) + 6;
                 $pdf->SetX((210 - $w) / 2);
                 $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['adresse'])), 0, 'C');
                 $pdf->Ln();
                 $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune']))) + 6;
                 $pdf->SetX((210 - $w) / 2);
                 $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['code'] . " " . $info_veto[0]['commune'])), 0, 'C');
                 $pdf->Ln();
                 $pdf->SetFont('Times', '', 12);
                 $w = $pdf->GetStringWidth(utf8_decode(stripslashes($info_veto[0]['tel']))) + 6;
                 $pdf->SetX((210 - $w) / 2);
                 $pdf->Cell($w, 7, utf8_decode(stripslashes($info_veto[0]['tel'])), 0, 'C');
                 $pdf->Ln(15);
             }
             $pdf->Cell(90);
             $pdf->MultiCell(85, 5, requetemysql::gestion_string_maj($info_veto2->nom) . "\n" . requetemysql::gestion_string_norm($info_veto2->adresse) . "\n" . requetemysql::gestion_string_norm($info_veto2->code) . ' ' . requetemysql::gestion_string_norm($info_veto2->commune), 0, 'C');
             $pdf->Ln(25);
             $pdf->MultiCell(85, 5, "Le " . date("d.m.y"), 0, 'L');
             if (isset($_SESSION['login2'])) {
                 $pdf->MultiCell(85, 5, requetemysql::gestion_string_maj(TXT_CHARGEMENT_EXPORT8 . stripslashes(ucfirst($info_veto[0]['nom']))), 0, 'L');
             } else {
                 $pdf->MultiCell(85, 5, requetemysql::gestion_string_maj(TXT_CHARGEMENT_EXPORT23), 0, 'L');
             }
             $pdf->SetFont('Times', '', 18);
             $pdf->SetFillColor(153, 153, 153);
             $pdf->SetTextColor(0, 0, 0);
             $pdf->SetDrawColor(153, 153, 153);
             $pdf->SetLineWidth(0.3);
             $pdf->SetFont('', 'B');
             $pdf->MultiCell(0, 12, utf8_decode(TXT_CHARGEMENT_EXPORT24 . requetemysql::gestion_string_maj(htmlentities($info_veto2->login)) . " sur la période du :" . requetemysql::gestion_string_norm($arr['date_ref']) . " au " . requetemysql::gestion_string_norm($arr['date_fin'])), 0, '', true);
             // Largeurs des colonnes
             $w = array(190 / 6, 190 / 6, 190 / 6, 190 / 2);
             $header = array(utf8_decode(TXT_CHARGEMENT_EXPORT26), utf8_decode(TXT_CHARGEMENT_EXPORT27) . " " . requetemysql::gestion_string_norm($arr['date_ref']) . "-" . requetemysql::gestion_string_norm($arr['date_debut']), utf8_decode(TXT_CHARGEMENT_EXPORT27) . " " . requetemysql::gestion_string_norm($arr['date_ref']) . "-" . requetemysql::gestion_string_norm($arr['date_fin']), utf8_decode(TXT_CHARGEMENT_EXPORT28));
             // Données
             $pdf->SetFont('Times', '', 8);
             // En-tête
             for ($i = 0; $i < count($header); $i++) {
                 $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C');
             }
             $pdf->Ln();
             foreach ($arr['team2'][$mon_index]->total_job as $row) {
                 foreach ($row as $k => $v) {
                     $pdf->Cell($w[0], 6, requetemysql::gestion_string_maj($k), 1, 0, 'C');
                     $pdf->Cell($w[1], 6, requetemysql::gestion_string_maj($v), 1, 0, 'C');
                     foreach ($arr['team2'][$mon_index]->total_jobv2 as $row2) {
                         foreach ($row2 as $k2 => $v2) {
                             if ($k2 == $k) {
                                 $pdf->Cell($w[2], 6, requetemysql::gestion_string_maj($v2), 1, 0, 'C');
                             }
                         }
                     }
                     $retour1 = true;
                     foreach ($arr['team2'][$mon_index]->liste_job as $row3) {
                         foreach ($row3 as $k3 => $v3) {
                             if ($k3 == $k) {
                                 $retour1 = false;
                                 $pdf->MultiCell($w[3], 6, requetemysql::gestion_string_maj(implode(",", $v3)) . " " . $arr['agenda'][$k][$info_veto2->login], 1, 'L', false);
                             }
                         }
                     }
                     if ($retour1) {
                         $pdf->Ln();
                     }
                 }
             }
             // Trait de terminaison
             $pdf->Cell(array_sum($w), 0, '', 'T');
             $pdf->Ln(20);
             if ($arr['cas'] == 2) {
                 $mon_url = $filename . 'resume_activite_' . requetemysql::gestion_string_maj(htmlentities($info_veto2->login)) . '_' . uniqid() . '.pdf';
                 //$pdf->Output($mon_url, F);
                 $pdf->Output('../' . $mon_url, F);
                 $filename = $mon_url;
                 $files_name = explode("/", $filename);
                 if (!preg_match("#^[a-z0-9._-]+@(hotmail|live|msn).[a-z]{2,4}\$#", $info_veto2->mail)) {
                     $passage_ligne = "\r\n";
                 } else {
                     $passage_ligne = "\n";
                 }
                 //=====Déclaration des messages au format texte et au format HTML.
                 $message_txt = TXT_CHARGEMENT_EXPORT32 . $info_veto2->nom . TXT_CHARGEMENT_EXPORT33 . stripslashes(ucfirst($info_veto[0]['nom'])) . TXT_CHARGEMENT_EXPORT34 . requetemysql::gestion_string_norm($arr['date_ref']) . " - " . requetemysql::gestion_string_norm($arr['date_fin']);
                 $message_txt .= TXT_CHARGEMENT_EXPORT35;
                 $message_txt = utf8_decode($message_txt);
                 $message_html = TXT_CHARGEMENT_EXPORT36 . $info_veto2->nom . TXT_CHARGEMENT_EXPORT37 . stripslashes(ucfirst($info_veto[0]['nom'])) . TXT_CHARGEMENT_EXPORT38 . requetemysql::gestion_string_norm($arr['date_ref']) . " - " . requetemysql::gestion_string_norm($arr['date_fin']) . " : </p>";
                 $message_html .= TXT_CHARGEMENT_EXPORT39;
                 $message_html = utf8_decode($message_html);
                 //=====Lecture et mise en forme de la pièce jointe analyse.
                 $fichier = fopen('../' . $filename, "r");
                 $attachement = fread($fichier, filesize('../' . $filename));
                 $attachement = chunk_split(base64_encode($attachement));
                 fclose($fichier);
                 //==========
                 //==========
                 //=====Création de la boundary
                 $boundary = "-----=" . md5(rand());
                 $boundary_alt = "-----=" . md5(rand());
                 //==========
                 //=====Définition du sujet.
                 $sujet = TXT_CHARGEMENT_EXPORT40;
                 //=========
                 //=====Création du header de l'e-mail
                 $header = "From: \"" . NOMMAILSERVEUR . "\"<" . MAILSERVEUR . ">" . $passage_ligne;
                 $header .= "Reply-to: \"" . NOMMAILSERVEUR . "\" <" . MAILSERVEUR . ">" . $passage_ligne;
                 $header .= "Bcc: \"archives urgences vet\" <*****@*****.**>" . $passage_ligne;
                 $header .= "MIME-Version: 1.0" . $passage_ligne;
                 $header .= "Content-Type:  multipart/mixed;" . $passage_ligne . " boundary=\"{$boundary}\"" . $passage_ligne;
                 //=====Création du message.
                 $message = $passage_ligne . "--" . $boundary . $passage_ligne;
                 $message .= "Content-Type: multipart/alternative;" . $passage_ligne . " boundary=\"{$boundary_alt}\"" . $passage_ligne;
                 $message .= $passage_ligne . "--" . $boundary_alt . $passage_ligne;
                 //=====Ajout du message au format texte.
                 $message .= "Content-Type: text/plain; charset=\"ISO-8859-1\"" . $passage_ligne;
                 $message .= "Content-Transfer-Encoding: 8bit" . $passage_ligne;
                 $message .= $passage_ligne . $message_txt . $passage_ligne;
                 //==========
                 $message .= $passage_ligne . "--" . $boundary_alt . $passage_ligne;
                 //=====Ajout du message au format HTML
                 $message .= "Content-Type: text/html; charset=\"ISO-8859-1\"" . $passage_ligne;
                 $message .= "Content-Transfer-Encoding: 8bit" . $passage_ligne;
                 $message .= $passage_ligne . $message_html . $passage_ligne;
                 //==========
                 $message .= $passage_ligne . "--" . $boundary_alt . "--" . $passage_ligne;
                 //==========
                 $message .= $passage_ligne . "--" . $boundary . $passage_ligne;
                 //=====Ajout de la pièce jointe.
                 $message .= "Content-Type: application/pdf; name=\"" . $files_name[count($files_name) - 1] . "\"" . $passage_ligne;
                 $message .= "Content-Transfer-Encoding: base64" . $passage_ligne;
                 $message .= "Content-Disposition: attachment; filename=\"" . $files_name[count($files_name) - 1] . "\"" . $passage_ligne;
                 $message .= $passage_ligne . $attachement . $passage_ligne . $passage_ligne;
                 //==========
                 $message .= $passage_ligne . "--" . $boundary . "--" . $passage_ligne;
                 //=====Envoi de l'e-mail.
                 mail($info_veto2->mail, $sujet, $message, $header);
                 //==========
                 usleep(100000);
             }
         }
         if ($arr['cas'] == 1) {
             $mon_url = $filename . 'resume_activite_' . uniqid() . '.pdf';
             //$pdf->Output($mon_url, F);
             $pdf->Output('../' . $mon_url, F);
             return json_encode($mon_url);
         } else {
             if ($arr['cas'] == 2) {
                 return json_encode("ok");
             }
         }
     } catch (Exception $e) {
         return 'Exception -> ';
         var_dump($e->getMessage());
     }
 }