".$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"; echo "FACT Collaboration status of date "; printf("\n", $date); echo " \n"; include ("db.php"); $db_id = mysql_connect($host, $user, $pw); //without institute: //select username, Date(Min(start)) as 'from', if(Max(stop)='2020-12-31 //23:59:59', 'unlimited', Date(Max(stop))) as 'until', //Date(Adddate(Min(start), interval 6 MONTH)) as 'author since', //if(Max(stop)='2020-12-31 23:59:59', 'unlimited', //Date(Adddate(Max(stop), interval 1 year))) as 'author until' from //members where not isnull(start) and not isnull(stop) group by username; $selectcurrent="SELECT userid, firstname, middlename, lastname, inst.institutename, also.institutefullname, inst.institutefullname, inst.instituteadresse "; $selectall="SELECT username, Date(start) AS 'from', if(stop='2020-12-31 23:59:59', 'unlimited', Date(stop)) AS 'until',"; $selectall.=" DATE(ADDDATE(start, INTERVAL 6 MONTH)) AS 'author since', "; $selectall.=" IF(stop='2020-12-31 23:59:59', 'unlimited', DATE(ADDDATE(stop, INTERVAL 1 YEAR))) AS 'author until', "; $selectall.=" inst.institutename, MID(username, LOCATE(' ', username)+1) AS surname, "; $selectall.=" MID(username, 1, LOCATE(' ', username)) AS firstname, "; $selectall.=" firstname, middlename, lastname, also.institutefullname, inst.institutefullname, inst.instituteadresse "; $selectlist="SELECT "; if ($textformat=="latex") $sep="~"; else $sep=" "; switch ($listformat) { case "long": $selectlist.="CONCAT(firstname, ' ', if (not isnull(middlename), middlename, ''), ' ', lastname), "; break; case "short": $selectlist.="CONCAT(LEFT(firstname, 1), '.', if (not isnull(middlename), CONCAT(LEFT(middlename, 1), '.".$sep."'), '".$sep."'), lastname), "; break; } $selectlist.="inst.institutename, also.institutefullname, inst.institutefullname, inst.instituteadresse "; $from=" FROM memberlist.members "; $join=" LEFT JOIN memberlist.institutes inst USING(instituteid) "; $join.=" LEFT JOIN memberlist.institutes also ON also.instituteid=alsoat "; $where.=" WHERE NOT start='1970-01-01 00:00:00' AND NOT isnull(stop) "; $corresponding=""; foreach ($_GET as $key => $name) { if (strpos($key, 'corresponding') !== false) { if ($corresponding=="") $corresponding.=str_replace('corresponding', '', $key); else $corresponding.=", ".str_replace('corresponding', '', $key); } } $current=" AND ADDDATE(start, INTERVAL 6 MONTH) < '".$date."' AND ADDDATE(stop, INTERVAL 1 YEAR) > '".$date."' "; $order=" ORDER BY lastname"; $querycurrent=$selectcurrent.$from.$join.$where.$current; $querycurrent=$querycurrent.$order; $queryall=$selectall.$from.$join.$where.$order.", start"; if ($corresponding=="") { $querylist=$selectlist.$from.$join.$where.$current.$order; } else { $querylist=$selectlist.$from.$join.$where." AND userid IN (".$corresponding.") ".$current.$order; $querylist2=$selectlist.$from.$join.$where." AND userid NOT IN (".$corresponding.") ".$current.$order; } echo "
\n
\n"; // echo $querycurrent."
\n
\n"; // echo $queryall."
\n
\n"; // echo $querylist."
\n
\n"; echo $_GET["corresponding"]; echo "

Current Author List:

\n"; echo "\n"; echo "\n"; echo "\n"; $result = mysql_query($querycurrent); $counter=0; $letter=a; $institutes = []; $instnames = []; $instaddresses = []; $alsos = []; while ($row = mysql_fetch_row($result)) { echo ""; if ($_GET["corresponding".$row[0]]=="yes") echo ""; else echo ""; echo ""; if (!in_array($row[4],$institutes)) { $counter++; $institutes[$counter]=$row[4]; $instnames[$counter]=$row[6]; $instaddresses[$counter]=$row[7]; } echo ""; if ($row[5]) { if (!in_array($row[5], $alsos)) { $alsos[$letter]=$row[5]; $letter++; } echo ""; } else echo ""; } //print_r($institutes); //print_r($alsos); echo "\n"; echo "
*First Middle LastnameInstitute (#)also at
".$row[1]." ".$row[2]." ".$row[3]."".mb_convert_encoding($row[4], 'utf-8', 'iso-8859-1')." (".array_search($row[4], $institutes).")".$row[5]." (".array_search($row[5], $alsos).")
\n
\n"; mysql_free_result($result); echo "

Institute List:

\n"; echo "\n"; echo "\n"; echo "\n"; for ($i = 1; $i <= $counter; $i++) { echo ""; } echo ""; foreach ($alsos as $num => $name) { echo ""; } echo "\n"; echo "
#InstituteInstitute Adresse
".$i."".mb_convert_encoding($instnames[$i], 'utf-8', 'iso-8859-1')."".mb_convert_encoding($instaddresses[$i], 'utf-8', 'iso-8859-1')."
".$num."".mb_convert_encoding($name, 'utf-8', 'iso-8859-1')."
\n
\n"; echo "
\n
\n"; echo "

Full list:

\n"; echo "\n"; echo "\n"; $result = mysql_query($queryall); echo "\n"; while ($row = mysql_fetch_row($result)) echo ""; echo "\n"; echo "
NameInstituteMember sinceMember untilAuthor sinceAuthor until
".$row[0]."".$row[5]."".$row[1]."".$row[2]."".$row[3]."".$row[4]."
\n
\n"; mysql_free_result($result); echo "\n"; echo "

Author List:

\n"; echo "Format:
\n"; if ($_GET["listformat"]=="short") echo " short  "; else echo " short  "; if ($_GET["listformat"]=="long") echo " long
"; else echo " long
"; if ($_GET["textformat"]=="latex") echo " latex  "; else echo " latex  "; if ($_GET["textformat"]=="html") echo " html "; else echo " html "; if ($_GET["textformat"]=="text") echo " text
"; else echo " text
"; echo "
\n"; 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"; ?>