Index: /trunk/www/dch/memberlist.php
===================================================================
--- /trunk/www/dch/memberlist.php	(revision 18887)
+++ /trunk/www/dch/memberlist.php	(revision 18887)
@@ -0,0 +1,80 @@
+<html>
+<head>
+  <meta name="Author" content="Daniela Dorner" />
+  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+  <title>FACT Project</title>
+  <link rel="StyleSheet" type="text/css" href="../style.css" />
+</head>
+<?php
+
+    echo (file_get_contents("../shifteval/header.html"));
+
+    if (!empty($_GET["date"]))
+        $date=$_GET["date"];
+    else
+        $date=date("Ymd");
+
+    $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 "<body>\n";
+    echo "<form action='memberlist.php' METHOD='GET'>\n";
+    echo "<b>FACT Collaboration</b> status of date ";
+    printf("<input name='date' type='text' size='10' maxlength='10' value='%s'>\n", $date);
+    echo "<input type='submit' value='Show'> \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;
+
+    $query="SELECT username, Date(start) AS 'from', if(stop='2020-12-31 23:59:59', 'unlimited', Date(stop)) AS 'until',";
+    $query.=" DATE(ADDDATE(start, INTERVAL 6 MONTH)) AS 'author since', ";
+    $query.=" IF(stop='2020-12-31 23:59:59', 'unlimited', DATE(ADDDATE(stop, INTERVAL 1 YEAR))) AS 'author until', ";
+    $query.=" institutename, MID(username, LOCATE(' ', username)+1) AS surname, ";
+    $query.=" MID(username, 1, LOCATE(' ', username)) AS firstname ";
+    $query.=" FROM memberlist.members LEFT JOIN memberlist.institutes USING(instituteid) ";
+    $query.=" WHERE NOT start='0000-00-00 00:00:00' AND NOT stop='0000-00-00 00:00:00' ";
+    $querycurrent=$query." AND ADDDATE(start, INTERVAL 6 MONTH) < '".$date."' AND ADDDATE(stop, INTERVAL 1 YEAR) > '".$date."' ";
+    $querycurrent=$querycurrent." ORDER BY surname";
+    $queryall=$query." ORDER BY surname";
+
+    echo "<br>\n<br>\n";
+    echo "<h3>Current Author List:</h3>\n";
+    echo "<table border='1'>\n";
+    echo "<thead><tr><th>Surname</th><th>Firstname</th><th>institute</th></tr></thead>\n";
+    echo "<tbody>\n";
+    $result  = mysql_query($querycurrent);
+    while ($row = mysql_fetch_row($result))
+        echo "<tr><td>".$row[6]."</td><td>".$row[7]."</td><td>".$row[5]."</td></tr>";
+    echo "<tbody>\n";
+    echo "</table>\n<br>\n";
+    mysql_free_result($result);
+
+    echo "<br>\n<br>\n";
+    echo "<h3>Full list:</h3>\n";
+    echo "<table border='1'>\n";
+    echo "<thead><tr><th>Name</th><th>Institute</th><th>Member since</th><th>Member until</th><th>Author since</th><th>Author until</th></tr></thead>\n";
+    $result  = mysql_query($queryall);
+    echo "<tbody>\n";
+    while ($row = mysql_fetch_row($result))
+        echo "<tr><td>".$row[0]."</td><td>".$row[5]."</td><td>".$row[1]."</td><td>".$row[2]."</td><td>".$row[3]."</td><td>".$row[4]."</td></tr>";
+    echo "</tbody>\n";
+    echo "</table>\n<br>\n";
+    mysql_free_result($result);
+
+    mysql_close($db_id);
+
+    echo "</form>\n";
+    echo "</body>\n";
+    echo "</html>\n";
+
+?>
