Файл: mylaf.ru/mods/battleavatars/voted.php
Строк: 112
<?
include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/user.php';
only_reg();
$set['title']='Активные битвы'; // заголовок страницы
include_once '../../sys/inc/thead.php';
title();
include_once 'inc.php';
$k_post_vote=mysql_result(mysql_query("SELECT COUNT(*) FROM `duel` WHERE (SELECT COUNT(*) FROM `duel_vote` WHERE `duel`.`id` = `duel_vote`.`id_duel` AND `id_user` = '$user[id]') != 0 AND `act` = '1' AND `opponent` != '$user[id]' AND `user` != '$user[id]'"),0);
$k_page=$k_post_vote;
$page=page($k_page);
$start=$page-1;
if ($k_page==0)
{
echo '<div class="msg">Нет активных битв за которые вы голосовали</div>';
}else{
$post=mysql_fetch_array(mysql_query("SELECT * FROM `duel` WHERE (SELECT COUNT(*) FROM `duel_vote` WHERE `duel`.`id` = `duel_vote`.`id_duel` AND `id_user` = '$user[id]') != 0 AND `act` = '1' AND `opponent` != '$user[id]' AND `user` != '$user[id]' ORDER BY `id` DESC LIMIT $start, 1"));
$rand = rand(1000,9999);
echo "<div class='gmenu'>";
if($post['rubric'] == 1) $cat = 'Кто красивее?';
if($post['rubric'] == 2) $cat = 'Кто сильнее?';
if($post['rubric'] == 3) $cat = 'Кто моднее?';
if($post['rubric'] == 4) $cat = 'Кто выглядит моложе?';
if($post['rubric'] == 5) $cat = 'Кто смешнее?';
if($post['rubric'] == 6) $cat = 'У кого лучше фигура?';
if($post['rubric'] == 7) $cat = 'Кто сексуальнее?';
if($post['rubric'] == 8) $cat = 'Кто гламурнее?';
if($post['rubric'] == 9) $cat = 'Кто аппетитнее?';
echo "<b><center>$cat</center></b>";
echo "</div>";
$count=mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_vote` WHERE `id_duel` = '$post[id]'"),0);
$us = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '".$post['user']."' LIMIT 1"));
$vote=mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_vote` WHERE `id_duel` = '$post[id]' AND `id_opponent` = '$us[id]'"),0);
$man=mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_vote` WHERE `id_duel` = '$post[id]' AND `id_opponent` = '$us[id]' AND `man` = '1'"),0);
$woman=mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_vote` WHERE `id_duel` = '$post[id]' AND `id_opponent` = '$us[id]' AND `man` = '0'"),0);
$us2 = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '".$post['opponent']."' LIMIT 1"));
$vote2=mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_vote` WHERE `id_duel` = '$post[id]' AND `id_opponent` = '$us2[id]'"),0);
$man2=mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_vote` WHERE `id_duel` = '$post[id]' AND `id_opponent` = '$us2[id]' AND `man` = '1'"),0);
$woman2=mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_vote` WHERE `id_duel` = '$post[id]' AND `id_opponent` = '$us2[id]' AND `man` = '0'"),0);
echo "<table style='width:100%;border:1px solid skyblue' cellspacing='0' cellpadding='0'><tbody><tr>";
echo "<td class='webpanel'>n";
avatar2($post['user']);
echo "<a href='who.votes.php?duel=$post[id]&us=$post[user]'><b>Голосов:</b> $vote (".@round($vote/$count*100,1)."%) <br />n";
echo "M: (".@round($man/$vote*100,1)."%) / Ж: (".@round($woman/$vote*100,1)."%)</a>n";
echo "</td>n";
echo "<td class='webpanel'>n";
avatar2($post['opponent']);
echo "<a href='who.votes.php?duel=$post[id]&us=$post[opponent]'><b>Голосов:</b> $vote2 (".@round($vote2/$count*100,1)."%) <br />n";
echo "M: (".@round($man2/$vote2*100,1)."%) / Ж: (".@round($woman2/$vote2*100,1)."%)</a>n";
echo "</td></tr></tbody></table>n";
}
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
echo '
<a href="my.battle.php"><div class="gmenu"><img src="/style/icons/eshe.png"> Моя битва аватаров</div></a>
<a href="finished.php"><div class="gmenu"><img src="/style/icons/eshe.png"> Завершенные</div></a>
<a href="./"><div class="gmenu"><img src="/style/icons/duel.png"> Битвы аватаров</div></a>';
include_once '../../sys/inc/tfoot.php';
?>