<?php
 use App\Models\AgeGroup; $agegroups = array();
 $agegroups = AgeGroup::all();
 $key = 1;
?>
<div class="card">
    <div class="card-header">
        <h5>Age Groups</h5>
    </div>
    <div class="card-block table-border-style">
        <div class="table-responsive">
            <table class="table table-hover">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>Title</th>
                        <th>Min Age</th>
                        <th>Max Age</th>
                        <th><i>i</i></th>
                    </tr>
                </thead>
                <tbody>
                    @foreach($agegroups as $agegroup)
                    <tr>
                        <th scope="row"><?php echo $key; ?></th>
                        <td>{{$agegroup->name}}</td>
                        <td>{{$agegroup->min}}</td>
                        <td>{{$agegroup->max}}</td>
                        <td><a href="<?php echo url('/indicator/agegroups?id=')?>{{$agegroup->id}}" class="ti-pencil"></a> &nbsp;
                        <?php if($agegroup->status == 1){ ?>
                        <a href="<?php echo url('/indicator/disableage?id=')?>{{$agegroup->id}}" class="ti-close label label-danger"></a> </td>
                        <?php } ?>
                    </tr>
                    <?php $key++;?>
                    @endforeach
                </tbody>
            </table>
        </div>
    </div>
</div>