Fix encoding with //TRANSLIT

Add school
separate students names with , instead of \n
This commit is contained in:
james 2011-03-24 18:23:19 +00:00
parent aa1ad291ac
commit 2d2546d46e
2 changed files with 9 additions and 6 deletions

View File

@ -60,17 +60,21 @@
$regid=$r['reg_id']; $regid=$r['reg_id'];
$q2=mysql_query("SELECT firstname,lastname FROM students WHERE registrations_id='$regid' ORDER BY lastname"); $q2=mysql_query("SELECT firstname,lastname,schools.school FROM students JOIN schools ON students.schools_id=schools.id WHERE registrations_id='$regid' ORDER BY lastname");
$students=""; $students="";
while($stud=mysql_fetch_object($q2)) { while($stud=mysql_fetch_object($q2)) {
$students.=$stud->firstname." ".$stud->lastname."\n"; $students.=trim($stud->firstname)." ".trim($stud->lastname).", ";
//we just use the last school, it should match
$school=$stud->school;
} }
$students=substr($students,0,-2);
$ret=array(); $ret=array();
foreach($r AS $k=>$v) { foreach($r AS $k=>$v) {
$ret[$k]=iconv("ISO-8859-1","UTF-8",trim($v)); $ret[$k]=iconv("ISO-8859-1","UTF-8//TRANSLIT",trim($v));
} }
$ret['students']=iconv("ISO-8859-1","UTF-8",trim($students)); $ret['students']=iconv("ISO-8859-1","UTF-8//TRANSLIT",trim($students));
$ret['school']=iconv("ISO-8859-1","UTF-8//TRANSLIT",trim($school));
$ret['photo']=""; $ret['photo']="";
} }
//simulate slow loading //simulate slow loading

View File

@ -28,7 +28,6 @@
$r=mysql_fetch_object($q); $r=mysql_fetch_object($q);
$ret=array(); $ret=array();
if($r->test) { if($r->test) {
$ret['status']="ok"; $ret['status']="ok";
@ -76,7 +75,7 @@
$projects["[".$r->projectcategories_id."] ".$r->category." - ".$r->division][]=array( $projects["[".$r->projectcategories_id."] ".$r->category." - ".$r->division][]=array(
"n"=>$r->projectnumber, "n"=>$r->projectnumber,
"t"=>iconv("ISO-8859-1","UTF-8",trim($t)), "t"=>iconv("ISO-8859-1","UTF-8//TRANSLIT",trim($t)),
"p"=>$photo); "p"=>$photo);
} }
$ret['projects']=$projects; $ret['projects']=$projects;