<?php  header('Content-type: text/html; charset=utf-8'); ?>
<html>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<body bgcolor="white">
<?php
	include("scripts/sqlinfo.inc");
	include("../cdbmysql.php");

	mysql_connect($host, $user, $pass);
	mysql_selectdb("pyrot");

	$db = new CDBMySQL($host, $user, $pass, "pyrot");

	$result=mysql_query("select * from event where datum>now() order by datum limit 1");
	printf("<center><table width=400>");
	if($r=mysql_fetch_array($result)){
		printf("<tr><td><span class=\"header1\">Nästa skjutning</span></td></tr>");
		printf("<tr><td>%s %s, %s<br>Plats: %s<br>",$r["datum"],$r["tid"],$r["rubrik"],$r["plats"]);
		if($r["chief"]!="0") {
			$cname = "";
			$db->Query("SELECT namn FROM medlemmar WHERE col_id = " . $r["chief"]);
			if ($db->ReadRow()) {
				$cname = $db->RowData["namn"];
			}
			printf("Ansvarig: <a href=\"members.php?id=%s\">%s</a><br>%s<br> <br>",
			 	$r["chief"], $cname, $r["info"]
				);
		} else {
			printf("Ansvarig: Ingen &auml;nnu<br>%s",
			 	$r["info"] );
		}

		printf("<a href=\"events.php\">Fler skjutningar</a><hr></td></tr></table></center>");
	}
	$limit=3;
	include("news.php");

	$db->Close();
?>
</body>
</html>