Файл: moduls/duel/voted.php
Строк: 68
<?
/**
* @package Prime Social
* @link http://primesocial.ru
* @copyright Copyright (C) 2016 Prime Social
* @author BoB | http://primesocial.ru/about
*/
require_once('../../core/start.php');
include_once 'inc.php';
check_auth();
head('Faol duellar');
include_once 'inc.php';
$all = 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[user_id]') != 0 AND `act` = '1' AND `opponent` != '$user[user_id]' AND `user` != '$user[user_id]'"),0);
if (empty($all)) {
echo DIV_AUT . 'Faol duellar yo`q' . CLOSE_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[user_id]') != 0 AND `act` = '1' AND `opponent` != '$user[user_id]' AND `user` != '$user[user_id]' ORDER BY `id` DESC"));
$rand = rand(1000,9999);
if($post['rubric'] == 1) $cat = 'Kim chiroyli?';
if($post['rubric'] == 2) $cat = 'Kim kuchli?';
if($post['rubric'] == 3) $cat = 'Kim modni?';
if($post['rubric'] == 4) $cat = 'Kim yosh ko`rinadi?';
if($post['rubric'] == 5) $cat = 'Kim kulguli?';
if($post['rubric'] == 6) $cat = 'Kimning qaddi qomati chiroyli?';
if($post['rubric'] == 7) $cat = 'Kim jinni?';
if($post['rubric'] == 8) $cat = 'Kim glamurli?';
if($post['rubric'] == 9) $cat = 'Kim yoqimtoy?';
echo DIV_AUT;
echo 'Bo`lim: <b>'.$cat.'</b><br />';
echo CLOSE_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 ".USERS." WHERE `user_id` = '".$post['user']."' LIMIT 1"));
$vote=mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_vote` WHERE `id_duel` = '$post[id]' AND `id_opponent` = '$us[user_id]'"),0);
$man=mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_vote` WHERE `id_duel` = '$post[id]' AND `id_opponent` = '$us[user_id]' AND `man` = '1'"),0);
$woman=mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_vote` WHERE `id_duel` = '$post[id]' AND `id_opponent` = '$us[user_id]' AND `man` = '0'"),0);
$us2 = mysql_fetch_array(mysql_query("SELECT * FROM ".USERS." WHERE `user_id` = '".$post['opponent']."' LIMIT 1"));
$vote2=mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_vote` WHERE `id_duel` = '$post[id]' AND `id_opponent` = '$us2[user_id]'"),0);
$man2=mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_vote` WHERE `id_duel` = '$post[id]' AND `id_opponent` = '$us2[user_id]' AND `man` = '1'"),0);
$woman2=mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_vote` WHERE `id_duel` = '$post[id]' AND `id_opponent` = '$us2[user_id]' AND `man` = '0'"),0);
echo DIV_AUT;
echo 'Ishtrokchi: <a href="'.HOME.'/id'.$us['user_id'].'">'.$us['nick'].'</a><br />';
echo (empty($us['photo']) ? '<img src="'.HOME.'/style/img/empty_photo.gif"/>' : '<a href="'.HOME.'/files/photo/'.$us['photo'].'"><img src="'.HOME.'/files/photo/mini_'.$us['photo'].'"/></a>');
echo '<br /><b>Ovozlar:</b> '.$vote.' ('.round($vote/$count*100,1).'%) <br />
Erkak: ('.round($man/$vote*100,1).'%) / Ayol: ('.round($woman/$vote*100,1).'%)<br />';
echo '<br /><center>VS</center><br />';
echo 'Ishtrokchi: <a href="'.HOME.'/id'.$us2['user_id'].'">'.$us2['nick'].'</a><br />';
echo (empty($us2['photo']) ? '<img src="'.HOME.'/style/img/empty_photo.gif"/>' : '<a href="'.HOME.'/files/photo/'.$us2['photo'].'"><img src="'.HOME.'/files/photo/mini_'.$us2['photo'].'"/></a>');
echo '<br /><b>Ovozlar:</b> '.$vote2.' ('.round($vote2/$count*100,1).'%) <br />
Erkak: ('.round($man2/$vote2*100,1).'%) / Ayol: ('.round($woman2/$vote2*100,1).'%)<br />';
echo CLOSE_DIV;
echo DIV_LI . '<center>Tugash vaqti: <strong>'.vrem($post['time']).'</strong></center>' . CLOSE_DIV;
}
$array = array('Duellar');
nav($array);
require_once('../../core/stop.php');
?>