Файл: moduls/duel/finished.php
Строк: 72
<?
/**
* @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('Tugallangan duellar');
include_once 'inc.php';
$all = mysql_result(mysql_query("SELECT COUNT(*) FROM `duel` WHERE `act` = '2'"),0);
if (empty($all)) {
echo DIV_AUT . 'Tugallangan duellar yo`q' . CLOSE_DIV;
} else {
$post = mysql_fetch_array(mysql_query("SELECT * FROM `duel` WHERE `act` = '2' 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 '<table cellspacing="0" cellpadding="0" width="100%" ><tr>';
echo '<td class="white" width="46%" >';
echo 'Ishtrokchi: <a href="'.HOME.'/id'.$us['user_id'].'">'.$us['nick'].'</a><br /><br />';
if($vote > $vote2) {
echo '<img src="http://i.tabor.ru/imgs/winner.gif" alt=""><b> G`olib</b><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 '</td>';
echo '<td class="white" style="text-align:left;font-weight:bold;" width="8%" >';
echo 'VS';
echo '</td>';
echo '<td class="white" width="46%" >';
echo 'Ishtrokchi: <a href="'.HOME.'/id'.$us2['user_id'].'">'.$us2['nick'].'</a><br />';
if($vote < $vote2) {
echo '<img src="http://i.tabor.ru/imgs/winner.gif" alt=""><b> G`olib</b><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 '</td>';
echo '</tr></table>';
echo '<div class="white">Duel tugallangan</div>';
}
$array = array('Duel');
nav($array);
require_once('../../core/stop.php');
?>