<!DOCTYPE html>
<html lang="en">

<style>
    table, th, td ,tr{
        border: none;
        padding: 20px;
    }
</style>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- Style sheets CSS and bootstrap -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
    <link rel="stylesheet" href="styles_warden.css">

    <!-- Javascript and jquery -->
    <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

</head>
<body class="viewwarden">
    <nav class="navbar navbar-expand-md justify-content-between navcolor">
    
    <div class="inst">
        <a class="navbar-brand" href="#"><img class="profile" src="iit1.jfif" alt=""></a>
        IIT BHU
    </div>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav ml-auto ms-auto">
            <li class="nav-item active">
                <div class="right">
                    <a class="nav-link" href="/wardenHome">Home</a>
                </div>
            </li>
            <li class="nav-item">
                <div class="right">
                    <a class="nav-link" href="/view_complaints_warden">Show Complaints</a>
                </div>
            </li>
            <li class="nav-item">
                <div class="right">
                    <a class="nav-link" href="#">Notice</a>
                </div>
            </li>
        </ul>
        <div class="right">
            <a href="https://www.google.com/" ><img src="profile1.jpg" class="profile" alt=""></a>    
        </div>
    </div>
</nav>
    <br><br><br>
    <form action="/view_complaints_warden" method="post">
        Sort On Basis Of:<br>
        Room No: <input type="radio" name="cat" id="" value="room_no">
        ID: <input type="radio" name="cat" id="" value="student_ref_id">
        Category:  <input type="radio" name="cat" id="" value="category"><br>

        Type:<br>
        Asc: <input type="radio" name="type" id="" value="ASC">
        Desc: <input type="radio" name="type" id="" value="DESC"><br>
        <button type="submit" name="submit" value="sort">SORT</button>
    </form>
    <br><br>
    <form action="/view_complaints_warden" method="post">
        FILTER BASED ON:
        Category Water <input type="radio" name="cat" value="Water">
        Category Food <input type="radio" name="cat" value="Food">
        Category Electricity <input type="radio" name="cat" value="Electricity">
        Category Hygiene <input type="radio" name="cat" value="Hygine"><br>
        <button type="submit" name="submit" value="filter"> FILTER</button>
    </form>
    <br><br>
    <div class="tablecss">
        <table class="styled-table">
            <thead >
                <tr>
                    <th>
                        Id
                    </th>

                    <th>
                        Room No
                    </th>
                    <th>
                        Category
                    </th>
                    
                    <th>
                        Title
                    </th>
                    
                    <th>
                        Description
                    </th>
                    
                    <th>
                        Status
                    </th>
                    <th>
                        Escalate
                    </th>
                    <th class="changestatus">
                        Change Status
                    </th>
                </tr>
            </thead>
            <tbody>
                    <% arr.forEach(function(ele){ %>
                    <tr>
                        <td><%= ele.student_ref_id %></td>
                        <td><%= ele.room_no %></td>
                        <td><%= ele.category %></td>
                        <td><%= ele.title %></td>
                        <td><%= ele.description %></td>
                        <td><button class="<%= ele.status %> btn btn-large"><%= ele.status %></button></td>
                        
                        <td>
                            <form action="/view_complaints_warden" method="post">
                                <button type="submit" class="btn btn-large buttoncss" name="submit" value=<%=ele.complaint_id%> >Escalate</button>
                            </form>
                        </td>
                        <td>
                            <form action="/view_complaints_warden2" method="post">
                                <select name="status" id="status">
                                    <option value="Solved">Choose Status</option>
                                    <option value="Solved">Solved</option>
                                    <option value="In Progress">In Progress</option>
                                    <option value="Pending">Pending</option>
                                </select>
                                <button type="submit" name="submit" class="btn btn-large buttonbg" value=<%=ele.complaint_id%>>Change</button>
                            </form>
                        </td>
                    </tr>
                <% }) %>
            </tbody>

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