<html>
<head>
	<title>6.889 Fall 2016</title>
	<link rel="stylesheet" type="text/css" href="../style.css" />
</head>
<body>
<center>
<table style="width: 75%;" class="sflinks"><tr><td>
<topheader>6.889 Advanced Topics in the Theory of Cryptography</topheader>

<p>
This page will be maintained with a semi up-to-date lecture schedule and other miscellaneous resources like the scribe list. 
This is <b>not</b> the <a href="https://stellar.mit.edu/S/course/6/fa16/6.889">official course website</a>.
</p>

<section>Useful stuff</section>

<ul>
	<li><it>Location &amp; time:</it> Tuesdays and Thursdays 1-2:30pm in 1-190</li>
	<li><it>Lecturers:</it> Aloni Cohen, Justin Holmgren, Sunoo Park, and Adam Sealfon</li>
	<li><it>Instructor in charge:</it> Professor Shafi Goldwasser</li>
	<li><it>Office hours:</it> By appointment. We're happy to chat about anything crypto-related; email us anytime.</li>
	<li><it>Email the instructors at:</it> 6.889-staff [&aacute;t] mit [d&ouml;t] edu</li>
	<li><?php
		if (date("YmdHis") >= "20160204140000")
			echo '<a href="scribe">Scribe sign-up page</a>';
		else
			echo '<span style="color:red;">Scribe sign-ups will open at 2pm on Thursday, February 4th. Check back soon!</span>';
	?></li>
	<li><a href="6889-hw-template.zip">LaTeX homework template</a></li>
</ul>

<section>Class schedule</section>

<table>
<?php
	include("../connect.php");
	if (mysqli_connect_errno()) {
		die("Connection error");
	}
	$deadlineColor = "#609c2f";
	$today = new DateTime();
	mysqli_select_db($link, "6889_fa16") or die(mysqli_error());
	$result = mysqli_query($link, "SELECT * FROM lectures ORDER BY lectureDate") or die(mysqli_error());
	while ($row = mysqli_fetch_array($result)) {
		$d = strtotime($row['lectureDate']);
		$lecDate = new DateTime($row['lectureDate']." 13:00:00");
		if ($lecDate <= $today) $rowColor = "#999";
		else $rowColor = "#000";

		$id = $row['id'];
		$topic = $row['topic'];
		$note = $row['note'];
		$feedbackLink = $row['feedbackLink'];
		$weekday = date('D', $d);
		if ($weekday != "Tue" && $weekday != "Thu") {
			$weekday = "<span style='color:red;'>".$weekday."</span>";
		}
		echo "<tr>";
		echo "<td style='color:#666; vertical-align:top;'>$weekday,</td>";
		$d_str = date('M j', $d);
		echo "<td style='color:#666; vertical-align:top; max-width:100%; white-space:nowrap;'>$d_str</td>";
		echo "<td style='color:$rowColor; max-width:100%; white-space:nowrap;'><b>Lecture $id:</b> $topic";
		if ($note != "") echo "&nbsp;<span style='color: #666;'>($note)</span>";
		$res2 = mysqli_query($link, "SELECT * FROM importantDates WHERE theDate='".$row['lectureDate']."'") or die(mysqli_error());
		if ($row2 = mysqli_fetch_array($res2)) {
			echo "<br /><span style='color: $deadlineColor'><it>".$row2['description']."</it></span>";
		}

		if ($rowColor == "#999") {
		    if ($feedbackLink != "") {
		      echo " | <a href=\"$feedbackLink\">Lecture Feedback</a>";
		    }
		}
		echo "</td>";
		echo "</tr>";
		$res3 = mysqli_query($link, "SELECT lectureDate FROM lectures WHERE id>'$id' ORDER BY id LIMIT 1") or die(mysqli_error());
		if ($row3 = mysqli_fetch_array($res3)) $nextDate = $row3['lectureDate'];
		else $nextDate = "2017-01-01";
		$res4 = mysqli_query($link, "SELECT * FROM importantDates WHERE theDate>'".$row['lectureDate']."' AND theDate<'".$nextDate."'") or die(mysqli_error());
		while ($row4 = mysqli_fetch_array($res4)) {
			$d2 = strtotime($row4['theDate']);
			$weekday2 = date('D', $d2);
			$d_str2 = date('M j', $d2);
			echo "<tr>";
			echo "<td style='color:#666; vertical-align:top;'>$weekday2,</td>";
			echo "<td style='color:#666; vertical-align:top;'>$d_str2</td>";
			echo "<td style='color:$deadlineColor'><it>".$row4['description']."</it></td>";
			echo "</tr>";
		}
	}
?>
</table>

</td></tr></table>
</center>
</body>
</html>
