".$sup."";
break;
case "latex":
return " $^".$sup."$";
break;
default:
break;
}
}
function GetBla($style, $text)
{
switch($style)
{
case "html":
return str_replace("'", "\'", str_replace("ä", 'ä', str_replace("ü", 'ü', mb_convert_encoding($text, 'utf-8', 'iso-8859-1'))));
break;
case "text":
return str_replace("'", "\'", str_replace("ä", 'ä', str_replace("ü", 'ü', mb_convert_encoding($text, 'utf-8', 'iso-8859-1'))));
break;
case "latex":
return str_replace("'", "\'", str_replace("ä", '{\"a}', str_replace("ü", '{\"u}', mb_convert_encoding($text, 'utf-8', 'iso-8859-1'))));
break;
default:
break;
}
}
function GetEndl($style, $comma)
{
switch($style)
{
case "latex":
return $comma." \\
\n";
break;
case "html":
return $comma." <br>
\n";
break;
case "text":
return $comma." \n";
break;
default:
return $comma."
\n";
break;
}
}
echo "\n";
echo "
\n";
echo "\n";
echo "\n";
echo "FACT Project\n";
echo "\n";
echo "\n";
echo "\n";
//echo (file_get_contents("../shifteval/header.html"));
if (!empty($_GET["date"]))
$date=$_GET["date"];
else
$date=date("Ymd");
if (!empty($_GET["listformat"]))
$listformat=$_GET["listformat"];
else
$listformat="long";
if (!empty($_GET["textformat"]))
$textformat=$_GET["textformat"];
else
$textformat="latex";
$starttimestamp = new DateTime($startdate);
date_add($starttimestamp, date_interval_create_from_date_string("12 hours"));
$stoptimestamp = new DateTime($stopdate);
date_add($stoptimestamp, date_interval_create_from_date_string("12 hours"));
echo "\n";
$counter=0;
$letter=a;
$institutes = [];
$instnames = [];
$instaddresses = [];
$alsos = [];
$result = mysql_query($querylist);
while ($row = mysql_fetch_row($result))
{
if (!in_array($row[1],$institutes))
{
$counter++;
$institutes[$counter]=$row[1];
$instnames[$counter]=$row[3];
$instaddresses[$counter]=$row[4];
}
if ($corresponding=="" || $textformat!="latex")
echo $row[0].GetSup($textformat, array_search($row[1], $institutes));
else
echo " \speaker{".$row[0]."} ".GetSup($textformat, array_search($row[1], $institutes));
if ($row[2])
{
if (!in_array($row[2], $alsos))
{
$alsos[$letter]=$row[2];
$letter++;
}
}
if ($row[2])
echo GetSup($textformat, array_search($row[2], $alsos));
echo GetEndl($textformat, ",");
}
mysql_free_result($result);
if ($querylist2)
{
$result = mysql_query($querylist2);
while ($row = mysql_fetch_row($result))
{
if (!in_array($row[1],$institutes))
{
$counter++;
$institutes[$counter]=$row[1];
$instnames[$counter]=$row[3];
$instaddresses[$counter]=$row[4];
}
echo " ".$row[0]." ".GetSup($textformat, array_search($row[1], $institutes));
if ($row[2])
{
if (!in_array($row[2], $alsos))
{
$alsos[$letter]=$row[2];
$letter++;
}
}
if ($row[2])
echo GetSup($textformat, array_search($row[2], $alsos));
echo GetEndl($textformat, ",");
}
mysql_free_result($result);
}
for ($i = 1; $i <= $counter; $i++)
echo GetSup($textformat, $i)." ".GetBla($textformat, $instnames[$i]).", ".
GetBla($textformat, $instaddresses[$i]).GetEndl($textformat, "");
foreach ($alsos as $num => $name)
echo GetSup($textformat, $num)." also at ".GetBla($textformat, $name).GetEndl($textformat, "");
mysql_close($db_id);
echo "\n";
echo "\n";
echo "\n";
?>