<style>
    .w-20{
        width:20%;
        float:left;
        padding:0px 10px;
    }
</style>

<div class="container-fluid mt-3 mb-3 bg-white">
    <div class="row">
        <div class="col-sm-12 pt-3 pb-3">
            <ul class="breadcrumb">
                <li class="breadcrumb-item">
                    <a href="<?php echo base_url(); ?>Welcome">Home</a>
                </li>
                <li class="breadcrumb-item">
                    <a href="<?php echo base_url(); ?>TimeTableManagement/subjects">Subjects</a>
                </li>
                <li class="breadcrumb-item">Add New Subject</li>
            </ul>
            
            <div class="">
                <form method="post" action="#">
                    <h2 class="main-heading text-center">Add New Subject</h2><hr>
                    
                    <?php 
                    if($success){
                    ?>
                    <div class="alert alert-success"><?php echo $success; ?></div>
                    <?php
                    }
                    
                    if($error){
                    ?>
                    <div class="alert alert-danger"><?php echo $error; ?></div>
                    <?php
                    }
                    ?>
                    <div class="form-group w-20">
                        <label>Class</label>
                        <select class="form-control" name="class" required>
                            <option value="">-- Select Class --</option>
                            <?php 
                            $all_classes=$this->TimeTableModel->all_classes();
                            if($all_classes){
                                foreach($all_classes as $courses){
                            ?>
                            <option value="<?php echo $courses['course']; ?>"><?php echo $courses['course']; ?></option>
                            <?php
                                }
                            }
                            ?>
                        </select>
                    </div>
                    <div class="form-group w-20">
                        <label>Subject</label>
                        <input type="text" name="subject" class="form-control" placeholder="Enter Subject" required>
                    </div>
                    
                    <div class="form-group w-20">
                        <label>Subject Order</label>
                        <input type="number" name="subject_order" class="form-control" placeholder="Subject Order" required>
                    </div>
                    
                    <div class="form-group w-20">
                        <label>Status</label>
                        <select class="form-control" name="status" required>
                            <option value="active">Active</option>
                            <option value="inactive">Inactive</option>
                        </select>
                    </div>
                    <div class="form-group w-20">
                        <label>&nbsp;&nbsp;</label><br>
                        <button class="btn btn-sm btn-success" type="submit" name="add_subject">Add Subject</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>