prepare("SELECT p.id, p.name, p.instructor, p.location, ts.name AS time_sequence, tb.name AS time_block FROM programs AS p INNER JOIN time_blocks AS tb ON (tb.id=p.time_block) INNER JOIN time_sequences AS ts ON (ts.id=tb.sequence) ORDER BY p.name ASC, ts.id ASC, tb.name ASC"); $sql->execute(); while($row=$sql->fetch(PDO::FETCH_ASSOC)){ echo "
"; echo "

".$row['name']."

"; echo "
"; echo "

".$lang['instructor'].": ".$row['instructor']." | ".$lang['location'].": ".$row['location']." | ".$lang['timeblock'].": ".$row['time_sequence']."/".$row['time_block']."

"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $num=1; $sql2=$db->prepare("SELECT u.name, u.class FROM registrations AS r INNER JOIN users AS u ON (u.id=r.user) WHERE r.program=:pid ".$whereand." ORDER BY u.name ASC"); $sql2->execute(array(":pid"=>$row['id'])); while($row2=$sql2->fetch(PDO::FETCH_ASSOC)){ echo ""; echo ""; echo ""; echo ""; echo ""; } echo ""; echo "
".$lang['num']."".$lang['name']."".$lang['class']."
".$num."".$row2['name']."".$row2['class']."
"; echo "
"; } ?>