<?php

use App\Services\Chapter2Service;
use Livewire\Component;

new class extends Component
{
    public $school;
    public $cutting;
    public $tls1 = [];
    public $tls2 = [];
    public $tls = [];
    protected $srvs;

    public function boot(Chapter2Service $srvs) {
        $this->srvs = $srvs;
    }

    public function mount() {
        $this->tls1 = $this->srvs->cmpte1tls($this->school, $this->cutting, 10, 13);
        $this->tls2 = $this->srvs->cmpte1tls($this->school, $this->cutting, 14, 16);
        $this->tls = $this->srvs->TotalGnl($this->school, $this->cutting);
    }
};
?>

<div>
    <div class="card-block table-border-style">
        <div class="table-responsive">
            <table class="table table-bordered" style="width: 100%">
                <thead>
                    <tr>
                        <th class="text-center py-0">Niveau</th>
                        <th class="text-center py-0">Nombre <br> classes</th>
                        <th class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <th class="text-center py-1" colspan="3">Filles</th>
                                </tr>
                                <tr>
                                    <th class="text-center py-1" style="width: 30%">Red</th>
                                    <th class="text-center py-1" style="width: 30%">N-Red</th>
                                    <th class="text-center py-1" style="width: 40%">Total</th>
                                </tr>
                            </table>
                        </th>
                        <th class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <th class="text-center py-1" colspan="3">Garçons</th>
                                </tr>
                                <tr>
                                    <th class="text-center py-1" style="width: 30%">Red</th>
                                    <th class="text-center py-1" style="width: 30%">N-Red</th>
                                    <th class="text-center py-1" style="width: 40%">Total</th>
                                </tr>
                            </table>
                        </th>
                        <th class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <th class="text-center py-1" colspan="3">Effectif total</th>
                                </tr>
                                <tr>
                                    <th class="text-center py-1" style="width: 30%">Red</th>
                                    <th class="text-center py-1" style="width: 30%">N-Red</th>
                                    <th class="text-center py-1" style="width: 40%">Total</th>
                                </tr>
                            </table>
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr class="p-0">
                        <td class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <td class="text-center py-1" style="width: 30%">Cycle I</td>
                                </tr>
                            </table>
                        </td>
                        <td class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls1[9] < 10 ? '0'.$tls1[9]:$tls1[9]); ?></td>
                                </tr>
                            </table>
                        </td>
                        <td class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls1[0] < 10 ? '0'.$tls1[0]:$tls1[0]); ?></td>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls1[1] < 10 ? '0'.$tls1[1]:$tls1[1]); ?></td>
                                    <td class="text-center py-1" style="width: 40%"><?php echo e($tls1[2] < 10 ? '0'.$tls1[2]:$tls1[2]); ?></td>
                                </tr>
                            </table>
                        </td>
                        <td class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls1[3] < 10 ? '0'.$tls1[3]:$tls1[3]); ?></td>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls1[4] < 10 ? '0'.$tls1[4]:$tls1[4]); ?></td>
                                    <td class="text-center py-1" style="width: 40%"><?php echo e($tls1[5] < 10 ? '0'.$tls1[5]:$tls1[5]); ?></td>
                                </tr>
                            </table>
                        </td>
                        <td class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls1[6] < 10 ? '0'.$tls1[6]:$tls1[6]); ?></td>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls1[7] < 10 ? '0'.$tls1[7]:$tls1[7]); ?></td>
                                    <td class="text-center py-1" style="width: 40%"><?php echo e($tls1[8] < 10 ? '0'.$tls1[8]:$tls1[8]); ?></td>
                                </tr>
                            </table>
                        </td>
                    </tr>

                    <tr class="p-0">
                        <td class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <td class="text-center py-1" style="width: 30%">Cycle II</td>
                                </tr>
                            </table>
                        </td>
                        <td class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls2[9] < 10 ? '0'.$tls2[9]:$tls2[9]); ?></td>
                                </tr>
                            </table>
                        </td>
                        <td class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls2[0] < 10 ? '0'.$tls2[0]:$tls2[0]); ?></td>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls2[1] < 10 ? '0'.$tls2[1]:$tls2[1]); ?></td>
                                    <td class="text-center py-1" style="width: 40%"><?php echo e($tls2[2] < 10 ? '0'.$tls2[2]:$tls2[2]); ?></td>
                                </tr>
                            </table>
                        </td>
                        <td class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls2[3] < 10 ? '0'.$tls2[3]:$tls2[3]); ?></td>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls2[4] < 10 ? '0'.$tls2[4]:$tls2[4]); ?></td>
                                    <td class="text-center py-1" style="width: 40%"><?php echo e($tls2[5] < 10 ? '0'.$tls2[5]:$tls2[5]); ?></td>
                                </tr>
                            </table>
                        </td>
                        <td class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls2[6] < 10 ? '0'.$tls2[6]:$tls2[6]); ?></td>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls2[7] < 10 ? '0'.$tls2[7]:$tls2[7]); ?></td>
                                    <td class="text-center py-1" style="width: 40%"><?php echo e($tls2[8] < 10 ? '0'.$tls2[8]:$tls2[8]); ?></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                
                    <tr class="p-0">
                        <th class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <td class="text-center py-1" style="width: 30%">Total</td>
                                </tr>
                            </table>
                        </th>
                        <th class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls[9] < 10 ? '0'.$tls[9]:$tls[9]); ?></td>
                                </tr>
                            </table>
                        </th>
                        <th class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls[0] < 10 ? '0'.$tls[0]:$tls[0]); ?></td>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls[1] < 10 ? '0'.$tls[1]:$tls[1]); ?></td>
                                    <td class="text-center py-1" style="width: 40%"><?php echo e($tls[2] < 10 ? '0'.$tls[2]:$tls[2]); ?></td>
                                </tr>
                            </table>
                        </th>
                        <th class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls[3] < 10 ? '0'.$tls[3]:$tls[3]); ?></td>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls[4] < 10 ? '0'.$tls[4]:$tls[4]); ?></td>
                                    <td class="text-center py-1" style="width: 40%"><?php echo e($tls[5] < 10 ? '0'.$tls[5]:$tls[5]); ?></td>
                                </tr>
                            </table>
                        </th>
                        <th class="p-0">
                            <table class="m-0" style="width: 100%">
                                <tr>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls[6] < 10 ? '0'.$tls[6]:$tls[6]); ?></td>
                                    <td class="text-center py-1" style="width: 30%"><?php echo e($tls[7] < 10 ? '0'.$tls[7]:$tls[7]); ?></td>
                                    <td class="text-center py-1" style="width: 40%"><?php echo e($tls[8] < 10 ? '0'.$tls[8]:$tls[8]); ?></td>
                                </tr>
                            </table>
                        </th>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div><?php /**PATH C:\Users\EDUCAS\Desktop\App\V4_001\resources\views\components\chapter2\effectif.blade.php ENDPATH**/ ?>