Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- div class="full_width">
- <div class="rows title">POLLING</div>
- </div>
- <div class="part">
- <div class="polling">
- <p><?php echo $polling[0]['content']; ?></p>
- <form>
- <ul>
- <?php
- $no=0;
- foreach($polling as $polls){
- $no++;
- $id_pool = $polls['id'];
- $pool = $polls['answer'];
- //echo "<pre>";
- //print_r($pool);
- //echo "</pre>";
- $pilih = (explode(",",$pool));
- $hitung = count($pilih);
- //$id = 1;
- $no=1;
- for ($x=0; $x<=$hitung-1; $x++) {
- if ($pilih[$x] != ''){
- //total polling
- $votes = $this->polling_detail->jum_vote($polls['id'],$no);
- //echo "<pre>";
- //print_r($votes);
- //echo "</pre>";
- //total votes 175
- $sum = $this->polling_detail->polling_sum($polls['id']);
- //echo "<pre>";
- //print_r($jum_sum);
- //echo "</pre>";
- //$votes = ['count'];
- //var_dump($votes);
- foreach ($votes as $jml) {
- //$prosentase = sprintf("%2.2f",(($j['jum']/$rows['jml_vote'])*100));
- //$prosentase = sprintf("%2.2f",(($j['jum']/$rows['jml_vote'])*100));
- $percentage = sprintf("%2.2f",(($jml['count']/$sum[0]['count'])*100));
- echo "<li data-value='$percentage'>
- <label for='$no'>$pilih[$x]</label>
- </li>";
- //$no++;
- }
- }
- }
- }
- ?>
- </ul>
- </form>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment