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

<head>
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="0" />
    <meta http-equiv="pragma" content="no-cache" />

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css">
    <title>Classrooms</title>
</head>

<body>
    <div class="side-menu">
        <div class="brand-name">
            <h1>Navigation</h1>
        </div>
        <ul>
            <li><a href="{{ url_for('index') }}"><img src="{{ url_for('static', filename='img/dashboard.png') }}" alt="">&nbsp; <span>Home</span></a></li>
            <li><a href="{{ url_for('students') }}"><img src="{{ url_for('static', filename='img/students_navbar.png') }}" alt="">&nbsp;<span>Students</span></a></li>
            <li><a href="{{ url_for('teachers') }}"><img src="{{ url_for('static', filename='img/teacher2.png') }}" alt="">&nbsp;<span>Teachers</span></a></li>
            <li><a href="{{ url_for('schools') }}"><img src="{{ url_for('static', filename='img/school.png') }}" alt="">&nbsp;<span>Schools</span></a></li>
            <li><a href="{{ url_for('classrooms') }}"><img src="{{ url_for('static', filename='img/payment.png') }}" alt="">&nbsp;<span>Classrooms</span></a></li>
            <li><a href="{{ url_for('facilities') }}"><img src="{{ url_for('static', filename='img/help-web-button.png') }}" alt="">&nbsp; <span>Facilities</span></a></li>
        </ul>
    </div>
    <div class="container">
        <div class="header">
            <div class="dashboard_title">
                Classrooms
            </div>
        </div>
        <div class="content">
            <div class="cards">
                <div class="card">
                    <div class="box">
                        <h1>2194</h1>
                        <h3>Teachers</h3>
                    </div>
                    <div class="icon-case">
                        <img src="{{ url_for('static', filename='img/students.png') }}" alt="">
                    </div>
                </div>
                <div class="card">
                    <div class="box">
                        <h1>53</h1>
                        <h3>Government</h3>
                    </div>
                    <div class="icon-case">
                        <img src="{{ url_for('static', filename='img/teachers.png') }}" alt="">
                    </div>
                </div>
                <div class="card">
                    <div class="box">
                        <h1>5</h1>
                        <h3>Private</h3>
                    </div>
                    <div class="icon-case">
                        <img src="{{ url_for('static', filename='img/schools.png') }}" alt="">
                    </div>
                </div>
                <div class="card">
                    <div class="box">
                        <h1>150</h1>
                        <h3>Others</h3>
                    </div>
                    <div class="icon-case">
                        <img src="{{ url_for('static', filename='img/income.png') }}" alt="">
                    </div>
                </div>
            </div>
            <div class="content-2">
                <div class="recent-payments">
                    <div class="title">
                        Trend by state
                    </div>
                    <form method="POST" action="/get_trend_from_classrooms">
                        Select state:
                        <select name="state" class="state">
                            <option value="Maharashtra">Maharashtra</option>
                            <option value="Gujarat">Gujarat</option>
                            <option value="Karnataka">Karnataka</option>
                            <option value="Kerela">Kerela</option>
                        </select>
                        Select type:
                        <select name="type" class="type">
                            <option value="category">By Category</option>
                            <option value="rural">By Rural Enrolments</option>                    
                        </select>
                        <input name="get_trend_from_classrooms" type="submit" value="Submit">
                    </form>
                    {% if trend_from_classrooms %}
                    <div>
                        <img src="{{ url_for('static', filename=trend_from_classrooms) }}">
                    </div>
                    {% else %}
                    <div>
                        <img src="{{ url_for('static', filename='img/sample_trend_classrooms.jpeg') }}">
                    </div>
                    {% endif %}
                </div>
            </div>
            <div class="content-2">
                <div class="new-students">
                    <div class="title">
                        Distribution across states of Classroom condition: {% print(classroom_condition) %}
                    </div>
                    <form method="POST" action="/get_distribution_of_classroom_conditions">
                        Select Year:
                        <select name="year" class="year">
                            <option value="2016">2016</option>
                            <option value="2015">2015</option>
                            <option value="2014">2014</option>
                            <option value="2013">2013</option>
                            <option value="2012">2012</option>
                            <option value="2011">2011</option>
                            <option value="2010">2010</option>
                            <option value="2009">2009</option>
                            <option value="2008">2008</option>
                            <option value="2007">2007</option>
                            <option value="2006">2006</option>
                        </select>
                        Select Condition:
                        <select name="condition" class="condition">
                            <option value="good">Good Condition</option>
                            <option value="minor">Need Minor Repair</option>
                            <option value="major">Need Major Repair</option>
                        </select>
                        <input name="get_distribution_of_classroom_conditions" type="submit" value="Submit">
                    </form>
                    <div>
                        <img src="{{ url_for('static', filename=distribution_classroom_by_condition) }}">
                    </div>
                </div>
            </div>
            <div class="content-2">
                <div class="new-students">
                    <div class="title">
                        Top Performing States
                    </div>
                    <table>
                        <tr>
                            <th>Rank</th>
                            <th>Name</th>
                        </tr>
                        <tr>
                            <td>1</td>
                            <td>{% print(classroom_condition_summary['top3'][0]) %}</td>
                        </tr>
                        <tr>
                            <td>2</td>
                            <td>{% print(classroom_condition_summary['top3'][1]) %}</td>
                        </tr>
                        <tr>
                            <td>3</td>
                            <td>{% print(classroom_condition_summary['top3'][2]) %}</td>
                        </tr>
                    </table>
                </div>
                <div class="new-students">
                    <div class="title">
                        Worst Performing States
                    </div>
                    <table>
                        <tr>
                            <th>Rank</th>
                            <th>Name</th>
                        </tr>
                        <tr>
                            <td>1</td>
                            <td>{% print(classroom_condition_summary['bottom3'][0]) %}</td>
                        </tr>
                        <tr>
                            <td>2</td>
                            <td>{% print(classroom_condition_summary['bottom3'][1]) %}</td>
                        </tr>
                        <tr>
                            <td>3</td>
                            <td>{% print(classroom_condition_summary['bottom3'][2]) %}</td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
</body>

</html>