<?php
require_once __DIR__ . '/../library/auth.php';

$school_id = $_SESSION['school_id'];
allow_roles(['admin', 'teacher']);

$page_title = 'Add Class';
require_once __DIR__ . '/../include/header.php';
require_once __DIR__ . '/../include/sidebar.php';
?>

<div class="content-wrapper">
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1>Add Class</h1>
                </div>
            </div>
        </div>
    </section>

    <section class="content">
        <div class="container-fluid">
            <div class="card card-primary">
                <div class="card-header">
                    <h3 class="card-title">Class Details</h3>
                </div>

                <form action="<?php echo WEB_ROOT; ?>Classes/process.php?action=add" method="post">
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-6 form-group">
                                <label>Class Name <span class="text-danger">*</span></label>
                                <input type="text" name="class_name" class="form-control" placeholder="Enter class name" required>
                            </div>

                            <div class="col-md-6 form-group">
                                <label>Section</label>
                                <input type="text" name="section" class="form-control" placeholder="Enter section">
                            </div>

                            <div class="col-md-6 form-group">
                                <label>House</label>
                                <input type="text" name="house" class="form-control" placeholder="Enter house">
                            </div>
                        </div>
                    </div>

                    <div class="card-footer">
                        <button type="submit" class="btn btn-primary">Save Class</button>
                        <a href="<?php echo WEB_ROOT; ?>Classes/index.php" class="btn btn-secondary">Back</a>
                    </div>
                </form>
            </div>
        </div>
    </section>
</div>

<?php
require_once __DIR__ . '/../include/footer.php';
?>