<!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>Facilities</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">
                Facilities
            </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_facilities">
                        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_facilities" type="submit" value="Submit">
                    </form>
                    {% if trend_from_facilities %}
                    <div>
                        <img src="{{ url_for('static', filename=trend_from_facilities) }}">
                    </div>
                    {% else %}
                    <div>
                        <img src="{{ url_for('static', filename='img/sample_trend_facilities.jpeg') }}">
                    </div>
                    {% endif %}
                </div>
            </div>
            <div class="content-2">
                <div class="new-students">
                    <div class="title">
                        Distribution across states
                    </div>
                    <form method="POST" action="/get_distribution_from_facilities">
                        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="government">Government</option>
                            <option value="private">Private</option>
                            <option value="others">Madrasas and Others</option>
                        </select>
                        <input name="get_distribution_from_facilities" type="submit" value="Submit">
                    </form>
                    {% if distribution_from_facilities %}
                    <div>
                        <img src="{{ url_for('static', filename=distribution_from_facilities) }}">
                    </div>
                    {% else %}
                    <div>
                        <img src="{{ url_for('static', filename='img/sample_distribution_facilities.jpeg') }}">
                    </div>
                    {% endif %}
                </div>
            </div>
            {% if distribution_from_facilities %}
            <div class="cards">
                <div class="card">
                    <div class="box">
                        <h1>2194</h1>
                        <h3>Government</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>Private</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>Others</h3>
                    </div>
                    <div class="icon-case">
                        <img src="{{ url_for('static', filename='img/schools.png') }}" alt="">
                    </div>
                </div>
            </div>
            {% else %}
            <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>Maharashtra</td>
                        </tr>
                        <tr>
                            <td>2</td>
                            <td>Gujarat</td>
                        </tr>
                        <tr>
                            <td>3</td>
                            <td>Karnataka</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>West Bengal</td>
                        </tr>
                        <tr>
                            <td>2</td>
                            <td>Orissa</td>
                        </tr>
                        <tr>
                            <td>3</td>
                            <td>Bihar</td>
                        </tr>
                    </table>
                </div>
            </div>
            {% endif %}
        </div>
    </div>
</body>

</html>