Файл: CMS/votes/cfg.php
Строк: 20
<?php
define('ROOT','../');
include('../core/inc.php');
function show_votes($idk, $sum) {
global $db;
$rows = $db->selectPage( $max, "SELECT * FROM ?_vote_answer WHERE `answer_vote_id` = ? ORDER BY `answer_id`;", $idk );
$v = '';
if (empty($sum)) $sum = 1;
if (empty($max)) $max = 1;
if (!empty($rows) && is_array($rows)) {
foreach($rows as $row) {
$res = !empty($row['answer_result']) ? intval($row['answer_result']) : 0;
$proc = round(($res * 100) / $sum, 1);
$maxproc = round($proc * 2);
$v .= '<b>' . $row['answer_option'] . '</b> (Голосов: ' . $res . ')<br />';
$v .= '<img src="graph.php?rat=' . $maxproc . '&per=' . $proc . '" alt="' . $proc . '%" /><br /><br />';
}
}
return $v;
}
$id = !empty($_GET['id']) ? (int) $_GET['id'] : 0;
$mod = !empty($_GET['m']) ? (string) $_GET['m'] : '';
$page = !empty($_GET['page']) ? (int) $_GET['page'] : 1;
?>