This commit is contained in:
KANE LAZENI 2026-02-17 04:58:27 +00:00
parent c5c22c4e9e
commit 0f2f05810b
866 changed files with 55 additions and 34 deletions

View File

@ -1,37 +1,52 @@
<?php
// À ajouter en haut de votre fichier, avant la génération du PDF
// 1. Inclure la bibliothèque phpqrcode
include 'phpqrcode/qrlib.php';
// 2. Préparer les données pour le QR code
$qrData = $assure['tagCarteQr'];
// 3. Générer le QR code temporaire
// $qrCodePath = sys_get_temp_dir() . '/qrcode_' . $assure['numeroBeneficiaire'] . '.png';
// $cheminDossier = $_SESSION['dossierSociete'].'/qrcodes/';
$qrCodePath = $_SESSION['dossierSociete'].'/qrcodes/' . $assure['numeroBeneficiaire'] . '.png';
// QRcode::png($qrData, $qrCodePath, QR_ECLEVEL_M, 4, 2);
QRcode::png($qrData, $qrCodePath, QR_ECLEVEL_H, 4, 2); // recommandé pour cartes PVC
// ... Votre code existant pour le PDF ...
// kane 23/09/2025 => rendre la carte personalisable par societeuser
// Fond blanc
$pdf->SetFillColor(255, 255, 255);
$pdf->Rect(0, 0, 85.6, 54, 'F');
// LOGO SOCIÉTÉ en haut à gauche
if (file_exists($logoSocietePath)) {
$pdf->Image($logoSocietePath, 3, 3, 15);
$pdf->Image($logoSocietePath, 3, 3, 15);
}
$logoGarantPath = (!is_null($assure["logo_garant"])) ? $_SESSION['dossierSociete'] . '/Tarifs/Img/garants/'.$assure["logo_garant"] : '';
$logoGarantPath = (!is_null($assure["logo_garant"])) ? $_SESSION['dossierSociete'] . '/Tarifs/Img/garants/'.$assure["logo_garant"] : $_SESSION['dossierSociete'] . '/Tarifs/Img/garants/logo_garant.png';
if (!is_file($logoGarantPath)) {
$logoGarantPath = $_SESSION['dossierSociete'] . '/Tarifs/Img/garants/logo_garant.png';
$logoGarantPath = $_SESSION['dossierSociete'] . '/Tarifs/Img/garants/logo_garant.png';
}
// LOGO GARANT en haut à droite
if (is_file($logoGarantPath)) {
$pdf->Image($logoGarantPath, 67, 1, 15);
$pdf->Image($logoGarantPath, 67, 1, 15);
}
// EN-TÊTE : "CARTE D'ASSURANCE"
$pdf->SetFont('Arial', 'B', 8);
$pdf->SetTextColor(33, 46, 83);
$pdf->SetXY(0, 5);
// $pdf->Cell(85.6, 4, utf8_decode(_('CARTE SANTÉ')), 0, 1, 'C');
$pdf->Cell(85.6, 4, mb_convert_encoding(_('CARTE SANTÉ'), "ISO-8859-1", "UTF-8"), 0, 1, 'C');
$pdf->SetTextColor(0);
// Informations de contact de la société
$pdf->SetFont('Arial', '', 5);
$pdf->SetXY(0, 9);
$pdf->MultiCell(85.6, 3, mb_convert_encoding(_('Siège social').': '. $assure['adresseGeoSociete'].' ', "ISO-8859-1", "UTF-8"), 0, 'C');
$pdf->SetXY(0, 12);
@ -72,11 +87,11 @@ $pdf->Cell(25, 3, ' : '.substr(mb_convert_encoding($assure['prenomsBeneficiaire'
// Né(e) le - si disponible
if (!empty($assure['dateNaissance'])) {
$pdf->SetFont('Arial', '', 6);
$pdf->SetXY(5, 30);
$pdf->Cell($colonneAlignement - 5, 3, mb_convert_encoding(_('Né(e) le'), "ISO-8859-1", "UTF-8"), 0, 0);
$pdf->SetFont('Arial', 'B', 6);
$pdf->Cell(25, 3, ' : '.dateLang($assure['dateNaissance'], $_SESSION['lang']), 0, 1);
$pdf->SetFont('Arial', '', 6);
$pdf->SetXY(5, 30);
$pdf->Cell($colonneAlignement - 5, 3, mb_convert_encoding(_('Né(e) le'), "ISO-8859-1", "UTF-8"), 0, 0);
$pdf->SetFont('Arial', 'B', 6);
$pdf->Cell(25, 3, ' : '.dateLang($assure['dateNaissance'], $_SESSION['lang']), 0, 1);
}
$pdf->SetFont('Arial', '', 6);
@ -107,35 +122,41 @@ $pdf->SetXY(5, 45);
$pdf->Cell($colonneAlignement - 5, 3, mb_convert_encoding(_('Nom & prénoms'), "ISO-8859-1", "UTF-8"), 0, 0);
$pdf->SetFont('Arial', 'B', 6);
$pdf->Cell(15, 3, ' : '.substr(mb_convert_encoding($assure['adherent'], "ISO-8859-1", "UTF-8"), 0, 15), 0, 1);
// Photo de l'assuré (positionnée à droite) - taille réduite
// $photoPath = $_SESSION['dossierPhoto_C'].$_SESSION['dossierSociete'].'/Photos/'.$assure['lienPhoto'];
$photo=$assure['lienPhoto'];
$faceRegistered=$assure['faceRegistered'];
$photoPath = $_SESSION['lienPhotoFace'].$assure['lienPhoto'];
// Photo de l'assuré (positionnée à droite) - taille réduite
$photoPath = $_SESSION['dossierPhoto_C'].$_SESSION['dossierSociete'].'/Photos/'.$assure['lienPhoto'];
$photoX = 57;
$photoY = 17;
if($faceRegistered=="1" && file_exists($photoPath))
{
$data = decryptImage($photoPath);
$data = base64_decode($data);
$temp = $_SESSION['lienPhotoFace'].'tmp_'.uniqid().'.jpg';
file_put_contents($temp, $data);
$pdf->Image($temp, $photoX, $photoY, 25, 25); // Réduction de 30x30 à 25x25
unlink($temp);
// Vérifier si l'URL est accessible
$headers = @get_headers($photoPath);
if (!empty($assure['lienPhoto']) && $headers && strpos($headers[0], '200')) {
$pdf->Image($photoPath, $photoX, $photoY, 25, 25);
} else {
// Cadre pour la photo si non disponible
$pdf->Rect($photoX, $photoY, 25, 25);
$pdf->SetFont('Arial', '', 4);
$pdf->SetXY($photoX, $photoY + 12);
// $messagePhotoManquant=_('Photo non disponible');
$messagePhotoManquant="X";
$pdf->Cell(25, 3, mb_convert_encoding($messagePhotoManquant, "ISO-8859-1", "UTF-8"), 0, 1, 'C');
// Cadre pour la photo si non disponible
$pdf->Rect($photoX, $photoY, 25, 25);
$pdf->SetFont('Arial', '', 4);
$pdf->SetXY($photoX, $photoY + 12);
$pdf->Cell(25, 3, mb_convert_encoding(_('Photo non disponible'), "ISO-8859-1", "UTF-8"), 0, 1, 'C');
}
// ============ AJOUT DU QR CODE ============
// Position : en bas à droite de la carte
if (file_exists($qrCodePath)) {
$qrX = 60; // Position X (à droite)
$qrY = 43; // Position Y (en bas)
$qrSize = 10; // Taille du QR code (10mm)
$pdf->Image($qrCodePath, $qrX, $qrY, $qrSize, $qrSize);
// Supprimer le fichier temporaire après utilisation
@unlink($qrCodePath);
}
// ==========================================
// Nom du souscripteur en bas
$pdf->SetFont('Arial', 'B', 6);
$pdf->SetXY(0, 49);
$pdf->Cell(85.6, 3, mb_convert_encoding($assure['souscripteur'], "ISO-8859-1", "UTF-8"), 0, 1, 'C');
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 773 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 769 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 881 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 861 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 854 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 854 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 871 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 877 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 853 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 871 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 840 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 851 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 873 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 870 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 851 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 871 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 851 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 869 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 847 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 853 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 877 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 876 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 876 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 868 B

Some files were not shown because too many files have changed in this diff Show More