<!DOCTYPE HTML>
<html lang="la">
<head>
	<title>Index generalis Melissae – Auctores praecipui</title>
	<meta name="author" content="Bernd Platzdasch"><!-- 30.10.2017 / 23.12.2017 / 4.11.2018 -->
	<meta charset="UTF-8">
	<link rel="stylesheet" type="text/css" href="css/main.css">
		<script src="js/store.js" type="text/javascript"></script>
	<style>	
		table { border-collapse: collapse; margin: 1em 0em 4em 0; width: 100%; }
		td { text-align: left; border: 0px solid lightgrey; padding: 0.3em; padding-right: 1em;}
		td.nr1 { text-align: right; width: 4em; background-color: #fff;  }
		td.nr2 { text-align: right; background-color: #fff; }
		td.nomen1 { background-color: #fff; padding-left: 0.5em; }
		td.nomen2 { background-color: #fff; padding-left: 0.5em; }
	</style>
	<script>
		function storeSS(id) {
			var value = document.getElementById(id).innerHTML;
			value = value.replace(/&amp;/g, '&');
			sessionStorage.setItem("ID", "symbolae");
			sessionStorage.setItem("auctor", value);
			document.location.href = "symbolae.php";
		}
	</script>
</head>
<body onload="store_mnu();">
	<?php
		require_once $_SERVER['DOCUMENT_ROOT'] . '/db_connection.php';
		include("header.inc.php"); 
		include("php/namen.inc.php");
	?>
	<div class="border">
		<div id="main">
			<h1>Quot symbolas auctores praecipui scripserint</h1>
			<table>
				<?php
					$sql_select = "SELECT COUNT(DISTINCT Autor, IID) AS zaehler, Autor FROM melissa GROUP BY Autor ORDER BY zaehler DESC, Autor ASC";
					$res = $db->query($sql_select);
					$w = 1;
					$zaehler = 0;
					while ($row = $res->fetch_object()) {
						$autor = trim($row->Autor);
						$autor = erster_name($autor);
						$anzahl = $row->zaehler;
						$ww = 1;
						if ($w % 2 == 0) { $ww = 2; }
						if (($autor != "") 
							AND ($anzahl > 4)
							AND ($autor != "Melissa")
							AND ($autor != "Auctores varii")
							AND ($autor != "Societas Latina")
							AND ($autor != "Studiorum Universitas Catholica Lovaniensis")) {
							$zaehler++;
								echo "<tr>
										<td class='nr$ww'>$anzahl</td>
										<td class='nomen$ww'>
											<a href='#' id='$zaehler' onClick='storeSS($zaehler); return false;'>$autor</a>
										</td></tr>";
							$w++;
							}
						}
					$db->close();
				?>
			</table>
			<p>&#160;</p>
		</div>
	</div>
<?php include("footer.inc.php"); ?>
</body>
</html>
