Файл: test.zfarm.mobi/mystylefutboll/commandfutboll.php
Строк: 59
<?php
/////////////////////////
/*
Author MyStyle ZomBi.Biz
Год 2013 Права предоставлены автору Шехову Виталию Александровичу
http://vk.com/online_user
*/
/////////////////////////
what(0, 'futboll');
if(isset($_GET['linkgood']) && num($_GET['linkgood'])!=NULL && isset($_GET['id']) && num($_GET['id'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_commandy` WHERE `type` = 'no' AND `id` = '".num($_GET['linkgood'])."' AND `id_futboll` = '".$user['id_futboll']."' LIMIT 1"),0) && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_command_user` WHERE `type` = 'no' AND `user` = '".num($_GET['id'])."' AND `id_futboll` = '".$user['id_futboll']."' LIMIT 1"),0)!=0){
$post = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_commandy` WHERE `type` = 'no' AND `id` = '".num($_GET['linkgood'])."' AND `id_futboll` = '".$user['id_futboll']."'"));
$post_user = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_command_user` WHERE `type` = 'no' AND `user` = '".num($_GET['id'])."' AND `id_futboll` = '".$user['id_futboll']."'"));
$need1 = 5;
$need2 = 5;
if($user['s_oil']>=$need1 && $user['s_oilheart']>=$need2){
$oil_s = $user['s_oil']-5;
update_user('s_oil',$oil_s);
$oilheart_s = $user['s_oilheart']-5;
update_user('s_oilheart',$oilheart_s);
$type = 'yes';
update_futboll_user_commandy('id',$post['id'],'user',$post_user['user'],'type',$type);
update_futboll_user('user',$post_user['user'],'type',$type);
header("Location: ?futbollcommand");
exit;
}else{
err_soil($need1-$user['s_oil']);
}
}elseif(isset($_GET['commanduserfutboll']) && num($_GET['commanduserfutboll'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_commandy` WHERE `type` = 'no' AND `id` = '".num($_GET['commanduserfutboll'])."' AND `id_futboll` = '".$user['id_futboll']."' LIMIT 1"),0)!=0){
$posts = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_commandy` WHERE `type` = 'no' AND `id` = '".num($_GET['commanduserfutboll'])."'"));
echo '<div class="feedbackPanel">Свободная команда.</div><div>
<div>
<table class="center pt6 pb6" style="margin:0 auto; width: 80%;">
<tr class="whiteBoldLink textshadow">
<td>Ник</td>
<td>Свободность</td>
</tr>
<tr class="blueSecColor textshadow">';
$user['set'] = 11;
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_command_user` WHERE `id_futboll` = '".$user['id_futboll']."'"),0);
if ($k_post==0){
echo '<div class="feedbackPanel">У вас нет свободной команды.</div>';
}
$k_page=k_page($k_post,$user['set']);
$page=page($k_page);
$start=$user['set']*$page-$user['set'];
$q=mysql_query("SELECT * FROM `mystyle_command_user` WHERE `id_futboll` = '".$user['id_futboll']."' LIMIT $start, $user[set]");
while($post=mysql_fetch_array($q))
{
$sr = $start+1;
if($post['type'] == 'no') $type = 'Свободен';
if($post['type'] == 'yes') $type = 'В команде';
echo '<div style="clear:both"></div><li><tr class="blueSecColor textshadow">';
echo '<td>';
echo ''.users($post['user']).'';
echo '</td>';
echo '<td>'.$type.'</td> ';
if($post['type'] == 'no')echo '<td><span class="money nobr textshadow"><a class="btn" href="?commanduserfutboll&linkgood='.$posts['id'].'&id='.$post['user'].'"> <span>Назначить</span></a></td> ';
echo '</tr></li>';
$start++;
}
echo '</table></div></div></div>';
}else{
header("Location: ?futbollcommand");
exit;
}
?>