Properly address french mailing labels to schools

This commit is contained in:
james 2007-09-27 15:29:48 +00:00
parent 7cb46d5aee
commit 4a3aaac8af
2 changed files with 17 additions and 4 deletions

View File

@ -61,10 +61,12 @@ if($report)
switch($report)
{
//IF(schools.sciencehead=\"\",\"Science Department Head\",schools.sciencehead) AS co,
case "schools":
$q=mysql_query("SELECT
schools.school AS name,
IF(schools.sciencehead=\"\",\"Science Department Head\",schools.sciencehead) AS co,
schools.schoollang,
schools.sciencehead AS co,
schools.address AS address,
schools.city AS city,
schools.province_code AS province,
@ -140,14 +142,25 @@ if($report)
while($r=mysql_fetch_object($q))
{
//handle C/O differently for schools, becuase, well, french schools are picky!
if($report=="schools") {
if($r->sciencehead)
$coname=$r->sciencehead;
else
$coname=i18n("Science Department Head",array(),array(),$r->schoollang);
$co=i18n("C/O %1",array($coname),array("Name of person"),$r->schoollang);
}
else $co="C/O $r->co";
if($type=="pdf")
{
$rep->newLabel();
$rep->mailingLabel($r->name,$r->co,$r->address,$r->city,$r->province,$r->postalcode);
$rep->mailingLabel($r->name,$co,$r->address,$r->city,$r->province,$r->postalcode);
}
else if($type=="csv")
{
$table['data'][]=array($r->name,$r->co,$r->address,$r->city,$r->province,$r->postalcode);
$table['data'][]=array($r->name,$co,$r->address,$r->city,$r->province,$r->postalcode);
}
}

View File

@ -212,7 +212,7 @@ class lpdf
$tmpY+=($lineheight/72)*$l;
if($co)
{
$l=$this->addLabelText($tmpY,trim(mb_strtoupper("C/O $co")));
$l=$this->addLabelText($tmpY,trim(mb_strtoupper($co)));
$tmpY+=($lineheight/72)*$l;
}
if($address[strlen($address)-1]==".") $address=substr($address,0,-1);