forked from science-ation/science-ation
Properly address french mailing labels to schools
This commit is contained in:
parent
7cb46d5aee
commit
4a3aaac8af
@ -61,10 +61,12 @@ if($report)
|
|||||||
|
|
||||||
switch($report)
|
switch($report)
|
||||||
{
|
{
|
||||||
|
//IF(schools.sciencehead=\"\",\"Science Department Head\",schools.sciencehead) AS co,
|
||||||
case "schools":
|
case "schools":
|
||||||
$q=mysql_query("SELECT
|
$q=mysql_query("SELECT
|
||||||
schools.school AS name,
|
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.address AS address,
|
||||||
schools.city AS city,
|
schools.city AS city,
|
||||||
schools.province_code AS province,
|
schools.province_code AS province,
|
||||||
@ -140,14 +142,25 @@ if($report)
|
|||||||
|
|
||||||
while($r=mysql_fetch_object($q))
|
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")
|
if($type=="pdf")
|
||||||
{
|
{
|
||||||
$rep->newLabel();
|
$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")
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
lpdf.php
2
lpdf.php
@ -212,7 +212,7 @@ class lpdf
|
|||||||
$tmpY+=($lineheight/72)*$l;
|
$tmpY+=($lineheight/72)*$l;
|
||||||
if($co)
|
if($co)
|
||||||
{
|
{
|
||||||
$l=$this->addLabelText($tmpY,trim(mb_strtoupper("C/O $co")));
|
$l=$this->addLabelText($tmpY,trim(mb_strtoupper($co)));
|
||||||
$tmpY+=($lineheight/72)*$l;
|
$tmpY+=($lineheight/72)*$l;
|
||||||
}
|
}
|
||||||
if($address[strlen($address)-1]==".") $address=substr($address,0,-1);
|
if($address[strlen($address)-1]==".") $address=substr($address,0,-1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user