diff --git a/app/projectinfo.php b/app/projectinfo.php index 83becbc7..ecbc12a7 100644 --- a/app/projectinfo.php +++ b/app/projectinfo.php @@ -60,14 +60,22 @@ $regid=$r['reg_id']; - $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"); + $q2=mysql_query("SELECT firstname,lastname,webfirst,weblast,schools.school FROM students JOIN schools ON students.schools_id=schools.id WHERE registrations_id='$regid' ORDER BY lastname"); $students=""; while($stud=mysql_fetch_object($q2)) { - $students.=trim($stud->firstname)." ".trim($stud->lastname).", "; + + if($stud->webfirst=="yes") + $students.="$stud->firstname "; + if($stud->weblast=="yes") + $students.="$stud->lastname "; + if($stud->webfirst=="yes" || $stud->weblast=="yes") + $students.=", "; + //we just use the last school, it should match $school=$stud->school; } - $students=substr($students,0,-2); + if(strlen($students)) + $students=substr($students,0,-2); $ret=array(); foreach($r AS $k=>$v) {