forked from science-ation/science-ation
Fix school list
This commit is contained in:
parent
c995e226c7
commit
b26d9a3dc4
@ -847,12 +847,15 @@ function get_special_awards($conferenceId){
|
||||
function get_schools($conferenceId){
|
||||
$data = array();
|
||||
$returnval = array();
|
||||
$q = mysql_query("SELECT MAX(id) AS id, school, city FROM schools GROUP BY school, city");
|
||||
while($record = mysql_fetch_assoc($q)) $data[] = $record;
|
||||
//$q = mysql_query("SELECT MAX(id) AS id, school, city FROM schools GROUP BY school, city");
|
||||
$q = mysql_query("SELECT * FROM schools WHERE conferences_id='{$conferenceId}' ORDER BY school");
|
||||
while($record = mysql_fetch_assoc($q))
|
||||
$data[] = $record;
|
||||
$prevRecord = null;
|
||||
for($n = 0; $n < count($data); $n++){
|
||||
$record = $data[$n];
|
||||
$title = $data[$n]['school'];
|
||||
//if there's more with the same name, add the city
|
||||
if(array_key_exists($n + 1, $data) && $data[$n + 1]['school'] == $title){
|
||||
$title .= " ({$record['city']})";
|
||||
}else if($prevRecord != null && $prevRecord['school'] == $title){
|
||||
|
@ -89,6 +89,13 @@ $translations = array(
|
||||
// draw the info area
|
||||
echo "<h4>" . i18n("School Information") . "</h4>";
|
||||
$currentSchool = $u['schools_id'];
|
||||
if($currentSchool){
|
||||
$q=mysql_query("SELECT * FROM schools WHERE id='$currentSchool' AND conferences_id='{$conference['id']}'");
|
||||
if(!mysql_num_rows($q)) {
|
||||
echo "Your current school selection is invalid. Please select your school";
|
||||
$currentSchool=null;
|
||||
}
|
||||
}
|
||||
if($currentSchool){
|
||||
echo i18n("You are currently listed as a member of") . "<br/>";
|
||||
echo '<div id="infobox" style="margin:10px;padding:5px;border:solid;border-width:1px;font-weight:bold">';
|
||||
|
Loading…
Reference in New Issue
Block a user