<div class="row">
    <div class="col-lg-3 col-6">
        <!-- small box -->
        <div class="small-box bg-info">
            <div class="inner">

                <?php
                 //select unread messages fromthe database

                      $sql = "SELECT COUNT(name) FROM classes WHERE teacher_name =:teacher";
                      $conn->query($sql);
                      $conn->bind(":teacher", $teacher_name);
                      $result = $conn->fetchColumn();
                ?>
                <h3><?php echo $result;?></h3>

                <p>Classes</p>
            </div>
            <div class="icon">
                <i class="fas fa-address-book"></i>
            </div>
            <a href="<?php echo $conn->teacher_url(); ?>class" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
        </div>
    </div>
    <!-- ./col -->
<!--    <div class="col-lg-3 col-6">-->
        <!-- small box -->
<!--        <div class="small-box bg-warning">-->
            <?php
            //fetch classes that teacher is teaching
//            $sql = "SELECT * FROM classes WHERE teacher_name =:teacher";
//            $conn->query($sql);
//            $conn->bind(":teacher", $teacher_name);
//            $result = $conn->fetchMultiple();
//            $all_students = '';
//            foreach ($result as $student_details){
//                $classes_id = $student_details->id;
//                $sql = "SELECT COUNT(name) FROM student WHERE classesID =:classesid";
//                $conn->query($sql);
//                $conn->bind(":classesid", $classes_id);
//                $all_students = $conn->fetchColumn();
//            }

            ?>
<!--            <div class="inner">-->
<!--                <h3>--><?php ////global $all_students; echo $all_students; ?><!--</h3>-->
<!---->
<!--                <p>Students</p>-->
<!--            </div>-->
<!--            <div class="icon">-->
<!--                <i class="fas fa-users"></i>-->
<!--            </div>-->
<!--            <a href="student" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>-->
<!--        </div>-->
<!--    </div>-->
    <!-- ./col -->
    <div class="col-lg-3 col-6">
        <!-- small box -->
        <div class="small-box bg-danger">
            <div class="inner">
                <?php
                $sql = "SELECT COUNT(id) FROM sections WHERE teacher_name =:teacher";
                $conn->query($sql);
                $conn->bind(":teacher", $teacher_name);
                $all_sections = $conn->fetchColumn();
                ?>
                <h3><?php echo $all_sections; ?></h3>

                <p>Sections</p>
            </div>
            <div class="icon">
                <i class="fas fa-list-ol"></i>
            </div>
            <a href="<?php echo $conn->teacher_url(); ?>section" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
        </div>
    </div>
    <!-- ./col -->


    <div class="col-lg-3 col-6">
        <!-- small box -->
        <div class="small-box bg-info" style="background: #585f60 !important;">
            <div class="inner">

                <?php
                //select unread messages from the database
                $sql = "SELECT COUNT(id) FROM subjects WHERE teacher_name=:teacher";
                $conn->query($sql);
                $conn->bind(":teacher", $teacher_name);
                $subjects = $conn->fetchColumn();
                ?>
                <h3><?php echo $subjects;?></h3>

                <p>Total Subjects</p>
            </div>
            <div class="icon">
                <i class="fas fa-table"></i>
            </div>
            <a href="<?php echo $conn->teacher_url(); ?>subject" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
        </div>
    </div>
    <!-- ./col -->
    <div class="col-lg-3 col-6">
        <!-- small box -->
        <div class="small-box bg-success" style="background: #f0ad4e !important;">
            <div class="inner">
                <?php
                $on = 'on';
                $sql ="SELECT COUNT(id) from teachers WHERE status =:on";
                $conn->query($sql);
                $conn->bind(":on", $on);
                $teachers = $conn->fetchColumn();
                ?>
                <h3><?php echo $teachers; ?><!-- <sup style="font-size: 20px">%</sup> --></h3>

                <p>All Teachers</p>
            </div>
            <div class="icon">
                <i class="fas fa-book"></i>
            </div>
            <a href="<?php echo $conn->teacher_url(); ?>teacher" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
        </div>
    </div>
</div>