View difference between Paste ID: aZBduTp3 and JWdB0Uvg
SHOW: | | - or go back to the newest paste.
1-
div class="full_width">
1+
<div class="full_width">
2-
                    <div class="rows title">POLLING</div>
2+
  <div class="rows title">POLLING</div>
3-
                </div>
3+
  <div class="part">
4-
                <div class="part">
4+
5
                        <p><?php
6-
						<p><?php echo $polling[0]['content']; ?></p>
6+
echo $polling[0]['content'];
7
?></p>
8-
						
8+
9
                        
10-
								<?php 
10+
11-
								$no=0;
11+
                                <?php
12-
								foreach($polling as $polls){
12+
$no = 0;
13-
									$no++;
13+
foreach ($polling as $polls)
14-
                                    $id_pool = $polls['id'];
14+
  {
15-
									$pool    = $polls['answer'];
15+
    $no++;
16-
									//echo "<pre>";
16+
    $id_pool = $polls['id'];
17-
                                    //print_r($pool);
17+
    $pool    = $polls['answer'];
18-
                                    //echo "</pre>";
18+
    //echo "<pre>";
19-
									
19+
    //print_r($pool);
20-
							
20+
    //echo "</pre>";
21-
                            $pilih = (explode(",",$pool));
21+
    $pilih   = (explode(",", $pool));
22-
							$hitung = count($pilih);
22+
    $hitung  = count($pilih);
23
    //$id = 1;
24-
				
24+
    $no      = 1;
25-
							//$id = 1;
25+
      {
26-
                            $no=1;
26+
        //total polling    
27-
							for ($x=0; $x<=$hitung-1; $x++) {
27+
        $votes = $this->polling_detail->jum_vote($polls['id'], $no);
28-
							 if ($pilih[$x] != ''){
28+
        //echo "<pre>";
29-
                                //total polling	
29+
        //print_r($votes);
30-
                                $votes   = $this->polling_detail->jum_vote($polls['id'],$no);
30+
        //echo "</pre>";
31-
                                //echo "<pre>";
31+
        //total votes 175
32-
                                //print_r($votes);
32+
        $sum   = $this->polling_detail->polling_sum($polls['id']);
33-
                                //echo "</pre>";
33+
        //echo "<pre>";
34-
                                //total votes 175
34+
        //print_r($jum_sum);
35-
                                $sum    = $this->polling_detail->polling_sum($polls['id']);
35+
        //echo "</pre>";
36-
                                //echo "<pre>";
36+
        //$votes = ['count'];
37-
                                //print_r($jum_sum);
37+
        //var_dump($votes);
38-
                                //echo "</pre>";
38+
        foreach ($votes as $x=>$jml)
39-
                                //$votes = ['count'];
39+
          {
40-
                                //var_dump($votes);
40+
            //$prosentase = sprintf("%2.2f",(($j['jum']/$rows['jml_vote'])*100));
41-
                                
41+
            //$prosentase = sprintf("%2.2f",(($j['jum']/$rows['jml_vote'])*100));
42-
42+
            $percentage = sprintf("%2.2f", (($jml['count'] / $sum[0]['count']) * 100));
43-
                                foreach ($votes as $jml) {
43+
            echo "<li data-value='$percentage'>
44-
                                    //$prosentase = sprintf("%2.2f",(($j['jum']/$rows['jml_vote'])*100));
44+
                                            <label for='$no'>{$pilih[$x]}</label>
45-
                                    //$prosentase = sprintf("%2.2f",(($j['jum']/$rows['jml_vote'])*100));
45+
46-
                                    
46+
            //$no++;
47-
                                    $percentage = sprintf("%2.2f",(($jml['count']/$sum[0]['count'])*100));
47+
          }
48-
                                    
48+
      }
49-
                                    echo "<li data-value='$percentage'>
49+
  }
50-
                                            <label for='$no'>$pilih[$x]</label>
50+
?>
51
                               
52-
52+
53-
53+
54-
                                    
54+
55-
                                    //$no++;
55+
                    </div>
56-
56+
</div> 
57-
                                    }
57+
</div>