%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/old/components/com_sppolls/layouts/ |
Upload File : |
<?php defined ('_JEXEC') or die('resticted aceess'); $options = $displayData['options']; $total_votes = 0; foreach ($options as $key => $option) { $total_votes = $total_votes + $option->votes; } // output $output = '<div class="sp-poll-result">'; foreach ($options as $value) { if($total_votes) { $percentage = round($value->votes/$total_votes, 2)*100; } else { $percentage = 0; } $output .= '<div class="sp-poll-resul-item">'; $output .= '<p class="poll-info"><span class="poll-question">' . $value->poll . '</span><span class="poll-votes">' . $value->votes . ' Votes</span></p>'; $output .= '<div class="progress">'; $progress = ' progress-bar-default'; if($percentage>60) { $progress = ' progress-bar-danger'; } elseif($percentage>50) { $progress = ' progress-bar-warning'; } elseif($percentage>40) { $progress = ' progress-bar-success'; } elseif($percentage>30) { $progress = ' progress-bar-info'; } elseif($percentage>20) { $progress = ' progress-bar-primary'; } $output .= '<div class="progress-bar'. $progress .'" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="min-width: 2em; width: ' . $percentage . '%;">'; $output .= $percentage . '%'; $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; $total_vote[] = $value->votes; } $output .= '</div>'; echo $output;