12345678910111213141516171819 |
- <?php
- $sum = 0;
- foreach($answers as $item){
- $sum += $item->count;
- }
- foreach($answers as $item){
- $percent = ($sum)?round($item->count/$sum*100):0;
- ?>
- <div class="p-1">
- <p><?=$item->text?></p>
- <div class="row ml-1">
- <div class="progress col-10 pl-0" style="height: 10px;">
- <div class="progress-bar bg-amic" role="progressbar" style="width: <?=$percent?>%;" aria-valuenow="<?=$percent?>" aria-valuemin="0" aria-valuemax="100"></div>
- </div>
- <div class="percent col-2"><?=$percent?>%</div>
- </div>
- </div>
- <?
- }
|