<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta
            name="viewport"
            content="width=device-width, initial-scale=1, shrink-to-fit=no"
    />
    <meta name="description" content="" />
    <title>ABC University</title>

    <link
            rel="canonical"
            href="https://getbootstrap.com/docs/4.5/examples/album/"
    />

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

    <link href="css/album.css" rel="stylesheet" />
</head>
<body>
<header>
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
        <a class="navbar-brand" href="/departments"> ABC University </a>
        <div class="navbar">
            <div class="navbar-nav">
                <a class="nav-link" href="/departments"> Departments</a>
                <a class="nav-link" href="/employees">Employees</a>
                <a class="nav-link" href="/counselings">Student Counselings</a>
                <a class="nav-link active" href="/performances">
                    Student Performances <span class="sr-only">(current)</span>
                </a>
            </div>
        </div>
    </nav>
</header>
<div class="container">

    <% if (message) {   %>
        <div class="row justify-content-md-center">
            <div class="alert alert-primary" role="alert">
                <%= message %>
            </div>
        </div>

    <% } %>

    <h1 class="text-justify"> Student Performances </h1>
    <div class="col-md-12 col-md-offset-2  justify-content-center">
        <a role="button" class="btn btn-primary btn-xs" href="/create-performance">Create a new record</a>

    </div>

    <div class="col-md-12 col-md-offset-2">

        <table class="table table-striped custab">
            <thead>
            <tr>
                <th>Student ID</th>
                <th>Semester Name</th>
                <th>Paper ID</th>
                <th>Paper Name</th>
                <th>Marks</th>

            </tr>

            <%

            performances.forEach(performance => {

            %>

                <tr>
                    <td><%=  performance.Student_ID  %></td>
                    <td><%=  performance.Semster_Name  %></td>
                    <td><%=  performance.Paper_ID %></td>
                    <td><%=  performance.Paper_Name %></td>
                    <td><%=  performance.Marks %></td>

                    <td class="text-center"><a class='btn btn-info btn-xs' href="/performances/update/<%= performance._id %>" ><span class="glyphicon glyphicon-edit"></span> Edit</a>
                        <a  href="/performances/delete/<%= performance._id %>" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-remove"></span> Del</a></td>

                </tr>

            <%
            });
            %>



            </thead>

        </table>


    </div>
</body>
</html>
