<!DOCTYPE html>
<html lang="en">
	<head>
		<title>Student Dashboard</title>

		<!-- Meta tag Keywords -->
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<meta charset="UTF-8" />
		<meta
			name="description"
			content="Student Assignment Submission System"
		/>
		<meta
			name="author"
			content="Abhishek Joshi, Shabarish Ramaswamy, Aakriti Sharma, Shlok Naik"
		/>

		<!-- Chrome, Firefox OS and Opera -->
		<meta name="theme-color" content="#000" />
		<!-- Windows Phone -->
		<meta name="msapplication-navbutton-color" content="#000" />
		<!-- iOS Safari -->
		<meta name="apple-mobile-web-app-status-bar-style" content="#000" />

		<!-- //Meta tag Keywords -->

		<!-- Bootstrap -->
		<!-- CSS only -->
		<link
			rel="stylesheet"
			href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
			integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z"
			crossorigin="anonymous"
		/>

		<!-- JS, Popper.js, and jQuery -->
		<script
			src="https://code.jquery.com/jquery-3.5.1.min.js"
			integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
			crossorigin="anonymous"
		></script>
		<script
			src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"
			integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN"
			crossorigin="anonymous"
		></script>
		<script
			src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"
			integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV"
			crossorigin="anonymous"
		></script>

		<!-- CSS -->
		<link rel="stylesheet" href="css/style.css" />

		<!-- FontAwesome -->
		<link
			rel="stylesheet"
			href="https://use.fontawesome.com/releases/v5.14.0/css/all.css"
			integrity="sha384-HzLeBuhoNPvSl5KYnjx0BT+WB0QEEqLprO+NBkkk5gbc67FTaL7XIGa2w1L0Xbgc"
			crossorigin="anonymous"
		/>
	</head>
	<body>
		<form action="/create-class" method="POST">
			<input type="text" name="name" placeholder="Class Name" />
			<button type="submit">Create Class</button>
		</form>
		<form action="/join-class" method="POST">
			<input type="text" name="code" placeholder="Class Code" />
			<button type="submit">Join Class</button>
		</form>
		<br />

        <a href="/logout">Logout</a>

        <br>

        <h5>My Classes</h5>
        <p>Admin:</p>
        <ul>
            <% croomAdm.forEach(cr => {
                %><li><a href="/classroom/<%= cr.code %>"><%= cr.name %> (<%= cr.code %>)</a></li><%
            }); %>
        </ul>

        <br>

        <p>Member:</p>
        <ul>
            <% croomMem.forEach(cr => {
                %><li><a href="/classroom/<%= cr.code %>"><%= cr.name %></a></li><%
            }); %>
        </ul>

        <br>
        <h5>Pending:</h5>
		<% croomMem.forEach(room => { room.assignments.forEach(assignment => {
		if(new Date().getTime()<assignment.dueDate){
            for(let i=0;i<assignment.submissions.length;i++)
            {
                if(assignment.submissions[i]==me)
                {
                    break;
                }
                else if(i+1==assignment.submissions.length)
                {
                    %><a href="/classroom/<%= room.code %>"><%= assignment.title %></a> - Due: <script>document.write(new Date(parseInt('<%= assignment.dueDate %>')).getTime().toLocaleString())</script><br><%
                    break;
                }
            }
            
        } }); }); %>
	</body>
</html>
