Fix: Correction affichage pays sur fiches adhrents

This commit is contained in:
Laurent Destailleur 2006-11-26 18:05:08 +00:00
parent 2a3650febc
commit 0655fa1a50
3 changed files with 45 additions and 25 deletions

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -18,7 +19,6 @@
*
* $Id$
* $Source$
*
*/
/* Inspire de PDF_Label
@ -370,6 +370,8 @@ class PDF_card extends FPDF {
*/
function _Croix($x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$taille=5)
{
//$this->Color('#888888');
$this->SetLineWidth($epaisseur);
$lg=$taille/2;
// croix haut gauche
@ -385,6 +387,7 @@ class PDF_card extends FPDF {
$this->Line($x2,$y2-$lg,$x2,$y2+$lg);
$this->Line($x2-$lg,$y2,$x2+$lg,$y2);
//$this->Color('#000000');
}
}
?>

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -18,10 +19,10 @@
*
* $Id$
* $Source$
*
*/
/*! \file htdocs/adherents/cartes/carte.php
/**
\file htdocs/adherents/cartes/carte.php
\ingroup adherent
\brief Page de creation d'une carte PDF
\version $Revision$
@ -70,15 +71,19 @@ if (!isset($annee)){
}
// requete en prenant que les adherents a jour de cotisation
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, ".$db->pdate("d.datefin")." as datefin, adresse,cp,ville,pays, t.libelle as type, d.naiss, d.email, d.photo";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1 AND datefin > now()";
$sql .= " ORDER BY d.rowid ASC ";
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, ".$db->pdate("d.datefin")." as datefin,";
$sql.= " d.adresse, d.cp, d.ville, d.naiss, d.email, d.photo,";
$sql.= " t.libelle as type,";
$sql.= " p.libelle as pays";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.pays = p.rowid";
$sql.= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1 AND datefin >= now()";
$sql.= " ORDER BY d.rowid ASC";
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
$i = 0;
while ($i < $num)
{
@ -100,6 +105,7 @@ if ($result)
$objp->rowid,
$annee
);
// imprime le texte specifique sur la carte
//$pdf->Add_PDF_card(sprintf("%s\n%s\n%s\n%s\n%s, %s\n%s", $objp->type." n° ".$objp->rowid,ucfirst(strtolower($objp->prenom))." ".strtoupper($objp->nom),"<".$objp->email.">", ucwords(strtolower($objp->adresse)), $objp->cp, strtoupper($objp->ville), ucfirst(strtolower($objp->pays))),$annee,"Association FreeLUG http://www.freelug.org/");
$pdf->Add_PDF_card(preg_replace ($patterns, $replace, ADHERENT_CARD_TEXT),preg_replace ($patterns, $replace, ADHERENT_CARD_HEADER_TEXT),preg_replace ($patterns, $replace, ADHERENT_CARD_FOOTER_TEXT));
@ -108,9 +114,12 @@ if ($result)
$db->close();
$pdf->Output();
}else{
llxHeader();
print "Erreur de la base de données";
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
}
else
{
dolibarr_print_error($db);
llxFooter('$Date$ - $Revision$');
}
?>

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -18,10 +19,10 @@
*
* $Id$
* $Source$
*
*/
/*! \file htdocs/adherents/cartes/etiquette.php
/**
\file htdocs/adherents/cartes/etiquette.php
\ingroup adherent
\brief Page de creation d'etiquettes
\version $Revision$
@ -58,10 +59,14 @@ if (!isset($annee)){
}
// requete en prenant que les adherents a jour de cotisation
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, ".$db->pdate("d.datefin")." as datefin, adresse,cp,ville,pays, t.libelle as type, d.naiss, d.email, d.photo";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1 AND datefin > now()";
$sql .= " ORDER BY d.rowid ASC ";
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, ".$db->pdate("d.datefin")." as datefin,";
$sql.= " d.adresse, d.cp, d.ville, d.naiss, d.email, d.photo,";
$sql.= " t.libelle as type,";
$sql.= " p.libelle as pays";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.pays = p.rowid";
$sql.= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1 AND datefin >= now()";
$sql.= " ORDER BY d.rowid ASC";
$result = $db->query($sql);
if ($result)
@ -78,9 +83,12 @@ if ($result)
$db->close();
$pdf->Output();
}else{
llxHeader();
print "Erreur de la base de données : ".$db->error();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
}
else
{
dolibarr_print_error($db);
llxFooter('$Date$ - $Revision$');
}
?>