<?php $__env->startSection('content'); ?>

<style>
    table {
        width: 100%;
    }
    table tr td{
        padding : 3px !important;
        border: 1px solid black !important;
    }
</style>

<div class="container">
 <div class="col-sm-12 col-12" id="mainpage">
  <div class="row">

   <div class="col-sm-9 col-12">

      <ul class="list-group p-0">
       <li class="list-group-item">
        <span class="student"><?php echo app('translator')->get('frontend.gender_wise_student_info'); ?> </span>
      </li>

      <li class="list-group-item">

        <div class="col-12">

            <table class="">
                <?php if($class): ?>
                <?php $__currentLoopData = $class; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                <?php
                $count_student = DB::connection('mysql_second')->table('running_student_info')->where('class_id',$c->id)->count();
                $total_student = 0;
                ?>
                <?php if($count_student > 0): ?>
                <tr>
                    <td style="text-align: center" class="table-success"><?php echo e($c->class_name); ?></td>
                    <td style="padding: 0px !important;border-bottom:0px !important;">
                        <table style="border : none;">
                            <tr>
                                <?php if($group): ?>
                                <?php $__currentLoopData = $group; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $g): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php if($c->id == $g->class_id): ?>
                                <td class="table-success" style="border : 1px solid black;padding:0px !important;text-align:center;border-bottom:0px !important;"><?php echo e($g->group_name); ?>

                                    <table>
                                        <tr>
                                            <td class="table-info" style="border:1px solid black;border-bottom:0px;"><?php echo app('translator')->get('frontend.male'); ?></td>
                                            <td class="table-info" style="border:1px solid black;border-bottom:0px;"><?php echo app('translator')->get('frontend.female'); ?></td>
                                        </tr>
                                        <tr>
                                            <?php
                                            $male_student = DB::connection('mysql_second')->table('running_student_info')->where('running_student_info.class_id',$c->id)->where('running_student_info.group_id',$g->id)
                                            ->join('student_personal_info','student_personal_info.id','running_student_info.student_id')
                                            ->where('student_personal_info.gender','Male')
                                            ->count();

                                            $female_student = DB::connection('mysql_second')->table('running_student_info')->where('running_student_info.class_id',$c->id)->where('running_student_info.group_id',$g->id)
                                            ->join('student_personal_info','student_personal_info.id','running_student_info.student_id')
                                            ->where('student_personal_info.gender','Female')
                                            ->count();

                                            $total_student = $total_student + $male_student + $female_student;

                                            ?>
                                            <td class="bg-white" style="border:1px solid black;border-bottom:0px;"><?php echo e($male_student); ?></td>
                                            <td class="bg-white" style="border:1px solid black;border-bottom:0px;"><?php echo e($female_student); ?></td>
                                        </tr>
                                    </table>
                                </td>
                                <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php endif; ?>
                            </tr>
                        </table>
                    </td>
                    <td class="table-success" style="text-align: center">
                       <?php echo app('translator')->get('frontend.total'); ?> <?php echo e($total_student); ?>

                    </td>
                </tr>
                <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>
            </table>

        </div>

    </li>
  </ul>
  <br>

</div>



  <?php echo $__env->make('frontend.sidebar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>





</div>
</div>
</div>





<?php $__env->stopSection(); ?>

<?php echo $__env->make('frontend.index', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/gzmcfenigov/public_html/resources/views/frontend/gender_wise_student.blade.php ENDPATH**/ ?>