}
function upoput($var,$oput,$id,$mas)
{
// Функция повышения опыта
$str = '';
if ($var == 1)
{
if ($oput >= 15)
{
$addoput = $oput - 15;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='2' where id='" . $id . "';");
}
}
elseif ($var == 2)
{
if ($oput >= 30)
{
$addoput = $oput - 30;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='3' where id='" . $id . "';");
}
}
elseif ($var == 3)
{
if ($oput >= 60)
{
$addoput = $oput - 60;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='4' where id='" . $id . "';");
}
}
elseif ($var == 4)
{
if ($oput >= 100)
{
$addoput = $oput - 100;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='5' where id='" . $id . "';");
}
}
elseif ($var == 5)
{
if ($oput >= 150)
{
$addoput = $oput - 150;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='6' where id='" . $id . "';");
}
}
elseif ($var == 6)
{
if ($oput >= 200)
{
$addoput = $oput - 200;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='7' where id='" . $id . "';");
}
}
elseif ($var == 7)
{
if ($oput >= 300)
{
$addoput = $oput - 300;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='8' where id='" . $id . "';");
}
}
elseif ($var == 8)
{
if ($oput >= 400)
{
$addoput = $oput - 400;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='9' where id='" . $id . "';");
}
}
elseif ($var == 9)
{
if ($oput >= 550)
{
$addoput = $oput - 550;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='10' where id='" . $id . "';");
}
}
elseif ($var == 10)
{
if ($oput >= 750)
{
$addoput = $oput - 750;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='11' where id='" . $id . "';");
}
}
elseif ($var == 11)
{
if ($oput >= 1000)
{
$addoput = $oput - 1000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='12' where id='" . $id . "';");
}
}
elseif ($var == 12)
{
if ($oput >= 1500)
{
$addoput = $oput - 1500;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='13' where id='" . $id . "';");
}
}
elseif ($var == 13)
{
if ($oput >= 2000)
{
$addoput = $oput - 2000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='14' where id='" . $id . "';");
}
}
elseif ($var == 14)
{
if ($oput >= 3000)
{
$addoput = $oput - 3000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='15' where id='" . $id . "';");
}
}
elseif ($var == 15)
{
if ($oput >= 4000)
{
$addoput = $oput - 4000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='16' where id='" . $id . "';");
}
}
elseif ($var == 16)
{
if ($oput >= 5500)
{
$addoput = $oput - 5500;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='17' where id='" . $id . "';");
}
}
elseif ($var == 17)
{
if ($oput >= 7500)
{
$addoput = $oput - 7500;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='18' where id='" . $id . "';");
}
}
elseif ($var == 18)
{
if ($oput >= 10000)
{
$addoput = $oput - 10000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='19' where id='" . $id . "';");
}
}
elseif ($var == 19)
{
if ($oput >= 15000)
{
$addoput = $oput - 15000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='20' where id='" . $id . "';");
}
}
elseif ($var == 20)
{
if ($oput >= 20000)
{
$addoput = $oput - 20000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='21' where id='" . $id . "';");
}
}
elseif ($var == 21)
{
if ($oput >= 25000)
{
$addoput = $oput - 25000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='22' where id='" . $id . "';");
}
}
elseif ($var == 22)
{
if ($oput >= 30000)
{
$addoput = $oput - 30000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='23' where id='" . $id . "';");
}
}
elseif ($var == 23)
{
if ($oput >= 35000)
{
$addoput = $oput - 35000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='24' where id='" . $id . "';");
}
}
elseif ($var == 24)
{
if ($oput >= 40000)
{
$addoput = $oput - 40000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='25' where id='" . $id . "';");
}
}
elseif ($var == 25)
{
if ($oput >= 45000)
{
$addoput = $oput - 45000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='26' where id='" . $id . "';");
}
}
elseif ($var == 26)
{
if ($oput >= 50000)
{
$addoput = $oput - 50000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='27' where id='" . $id . "';");
}
}
elseif ($var == 27)
{
if ($oput >= 55000)
{
$addoput = $oput - 55000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='28' where id='" . $id . "';");
}
}
elseif ($var == 28)
{
if ($oput >= 60000)
{
$addoput = $oput - 60000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='29' where id='" . $id . "';");
}
}
elseif ($var == 29)
{
if ($oput >= 65000)
{
$addoput = $oput - 65000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='30' where id='" . $id . "';");
}
}
elseif ($var == 30)
{
if ($oput >= 70000)
{
$addoput = $oput - 70000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='31' where id='" . $id . "';");
}
}
elseif ($var == 31)
{
if ($oput >= 75000)
{
$addoput = $oput - 75000;
$str = mysql_query("update `m_player` set `opit`='" . $addoput . "', `".$mas."`='32' where id='" . $id . "';");
}
}
return $str;
}
// Отбор
if ($act == "otbor")
{
$q = @mysql_query("select * from `m_player` where id='" . $id . "';");
$arr = @mysql_fetch_array($q);
$total = mysql_num_rows($q);
if ($total == 0 || $datauser[manager] != $arr[kom])
{
echo '<div class="c">Игрока не существует</div>';
require_once ("../incfiles/end.php");
exit;
}
echo upoput($arr[otbor],$arr[opit],$arr[id],otbor);
header('location: train.php');
require_once ("../incfiles/end.php");
exit;
}
// Опека
if ($act == "opeka")
{
$q = @mysql_query("select * from `m_player` where id='" . $id . "';");
$arr = @mysql_fetch_array($q);
$total = mysql_num_rows($q);
if ($total == 0 || $datauser[manager] != $arr[kom])
{
echo '<div class="c">Игрока не существует</div>';
require_once ("../incfiles/end.php");
exit;
}
echo upoput($arr[opeka],$arr[opit],$arr[id],opeka);
header('location: train.php');
require_once ("../incfiles/end.php");
exit;
}
// Дриблинг
if ($act == "drib")
{
$q = @mysql_query("select * from `m_player` where id='" . $id . "';");
$arr = @mysql_fetch_array($q);
$total = mysql_num_rows($q);
if ($total == 0 || $datauser[manager] != $arr[kom])
{
echo '<div class="c">Игрока не существует</div>';
require_once ("../incfiles/end.php");
exit;
}
echo upoput($arr[drib],$arr[opit],$arr[id],drib);
header('location: train.php');
require_once ("../incfiles/end.php");
exit;
}
// Прием
if ($act == "priem")
{
$q = @mysql_query("select * from `m_player` where id='" . $id . "';");
$arr = @mysql_fetch_array($q);
$total = mysql_num_rows($q);
if ($total == 0 || $datauser[manager] != $arr[kom])
{
echo '<div class="c">Игрока не существует</div>';
require_once ("../incfiles/end.php");
exit;
}
echo upoput($arr[priem],$arr[opit],$arr[id],priem);
header('location: train.php');
require_once ("../incfiles/end.php");
exit;
}
// Выносливость
if ($act == "vonos")
{
$q = @mysql_query("select * from `m_player` where id='" . $id . "';");
$arr = @mysql_fetch_array($q);
$total = mysql_num_rows($q);
if ($total == 0 || $datauser[manager] != $arr[kom])
{
echo '<div class="c">Игрока не существует</div>';
require_once ("../incfiles/end.php");
exit;
}
echo upoput($arr[vonos],$arr[opit],$arr[id],vonos);
header('location: train.php');
require_once ("../incfiles/end.php");
exit;
}
// Пас
if ($act == "pas")
{
$q = @mysql_query("select * from `m_player` where id='" . $id . "';");
$arr = @mysql_fetch_array($q);
$total = mysql_num_rows($q);
if ($total == 0 || $datauser[manager] != $arr[kom])
{
echo '<div class="c">Игрока не существует</div>';
require_once ("../incfiles/end.php");
exit;
}
echo upoput($arr[pas],$arr[opit],$arr[id],pas);
header('location: train.php');
require_once ("../incfiles/end.php");
exit;
}
// Сила удара
if ($act == "sila")
{
$q = @mysql_query("select * from `m_player` where id='" . $id . "';");
$arr = @mysql_fetch_array($q);
$total = mysql_num_rows($q);
if ($total == 0 || $datauser[manager] != $arr[kom])
{
echo '<div class="c">Игрока не существует</div>';
require_once ("../incfiles/end.php");
exit;
}
echo upoput($arr[sila],$arr[opit],$arr[id],sila);
header('location: train.php');
require_once ("../incfiles/end.php");
exit;
}
// Точность удара
if ($act == "tocnost")
{
$q = @mysql_query("select * from `m_player` where id='" . $id . "';");
$arr = @mysql_fetch_array($q);
$total = mysql_num_rows($q);
if ($total == 0 || $datauser[manager] != $arr[kom])
{
echo '<div class="c">Игрока не существует</div>';
require_once ("../incfiles/end.php");
exit;
}
echo upoput($arr[tocnost],$arr[opit],$arr[id],tocnost);
header('location: train.php');
require_once ("../incfiles/end.php");
exit;
}
// ТРЕНИРОВКА
function oput($var,$oput,$id,$mas)
{
// Функция опыта
$str = '';
if ($var == 1)
{
if ($oput >= 15)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(15)';}
else
{$str = $var.'<br/>(15)';}
}
elseif ($var == 2)
{
if ($oput >= 30)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(30)';}
else
{$str = $var.'<br/>(30)';}
}
elseif ($var == 3)
{
if ($oput >= 60)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(60)';}
else
{$str = $var.'<br/>(60)';}
}
elseif ($var == 4)
{
if ($oput >= 100)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(100)';}
else
{$str = $var.'<br/>(100)';}
}
elseif ($var == 5)
{
if ($oput >= 150)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(150)';}
else
{$str = $var.'<br/>(150)';}
}
elseif ($var == 6)
{
if ($oput >= 200)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(200)';}
else
{$str = $var.'<br/>(200)';}
}
elseif ($var == 7)
{
if ($oput >= 300)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(300)';}
else
{$str = $var.'<br/>(300)';}
}
elseif ($var == 8)
{
if ($oput >= 400)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(400)';}
else
{$str = $var.'<br/>(400)';}
}
elseif ($var == 9)
{
if ($oput >= 550)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(550)';}
else
{$str = $var.'<br/>(550)';}
}
elseif ($var == 10)
{
if ($oput >= 750)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(750)';}
else
{$str = $var.'<br/>(750)';}
}
elseif ($var == 11)
{
if ($oput >= 1000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(1000)';}
else
{$str = $var.'<br/>(1000)';}
}
elseif ($var == 12)
{
if ($oput >= 1500)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(1500)';}
else
{$str = $var.'<br/>(1500)';}
}
elseif ($var == 13)
{
if ($oput >= 2000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(2000)';}
else
{$str = $var.'<br/>(2000)';}
}
elseif ($var == 14)
{
if ($oput >= 3000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(3000)';}
else
{$str = $var.'<br/>(3000)';}
}
elseif ($var == 15)
{
if ($oput >= 4000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(4000)';}
else
{$str = $var.'<br/>(4000)';}
}
elseif ($var == 16)
{
if ($oput >= 5500)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(5500)';}
else
{$str = $var.'<br/>(5500)';}
}
elseif ($var == 17)
{
if ($oput >= 7500)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(7500)';}
else
{$str = $var.'<br/>(7500)';}
}
elseif ($var == 18)
{
if ($oput >= 10000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(10000)';}
else
{$str = $var.'<br/>(10000)';}
}
elseif ($var == 19)
{
if ($oput >= 15000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(15000)';}
else
{$str = $var.'<br/>(15000)';}
}
elseif ($var == 20)
{
if ($oput >= 20000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(20000)';}
else
{$str = $var.'<br/>(20000)';}
}
elseif ($var == 21)
{
if ($oput >= 25000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(25000)';}
else
{$str = $var.'<br/>(25000)';}
}
elseif ($var == 22)
{
if ($oput >= 30000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(30000)';}
else
{$str = $var.'<br/>(30000)';}
}
elseif ($var == 23)
{
if ($oput >= 35000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(35000)';}
else
{$str = $var.'<br/>(35000)';}
}
elseif ($var == 24)
{
if ($oput >= 40000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(40000)';}
else
{$str = $var.'<br/>(40000)';}
}
elseif ($var == 25)
{
if ($oput >= 45000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(45000)';}
else
{$str = $var.'<br/>(45000)';}
}
elseif ($var == 26)
{
if ($oput >= 50000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(50000)';}
else
{$str = $var.'<br/>(50000)';}
}
elseif ($var == 27)
{
if ($oput >= 55000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(55000)';}
else
{$str = $var.'<br/>(55000)';}
}
elseif ($var == 28)
{
if ($oput >= 60000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(60000)';}
else
{$str = $var.'<br/>(60000)';}
}
elseif ($var == 29)
{
if ($oput >= 65000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(65000)';}
else
{$str = $var.'<br/>(65000)';}
}
elseif ($var == 30)
{
if ($oput >= 70000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(70000)';}
else
{$str = $var.'<br/>(70000)';}
}
elseif ($var == 31)
{
if ($oput >= 75000)
{$str = $var.' <a href="train.php?act='.$mas.'&id='.$id.'"><img src="img/up.gif" alt=""/></a><br/>(75000)';}
else
{$str = $var.'<br/>(75000)';}
}
return $str;
}
$req = mysql_query("SELECT * FROM `m_player` where `kom`='".$datauser[manager]."' order by line asc, poz asc;");
$total = mysql_num_rows($req);
echo '<div class="phdr"><b>Тренировка</b></div>';
echo '<div class="c"><br/><br/>';
echo '
<table border="0" width="100%" bgcolor=" DAE1E8 " cellspacing="1" cellpadding="4">
<tr bgcolor="40B832" align="center" class="whiteheader">
<td><b>Поз</b></td>
<td><b>Игрок</b></td>
<td><b>Опыт</b></td>
<td><b>От</b></td>
<td><b>Оп</b></td>
<td><b>Др</b></td>
<td><b>Пм</b></td>
<td><b>Вн</b></td>
<td><b>Пс</b></td>
<td><b>Сл</b></td>
<td><b>Тч</b></td>
</tr>
';
while ($arr = mysql_fetch_array($req))
{
$allmas = $arr[otbor]+$arr[opeka]+$arr[drib]+$arr[priem]+$arr[vunos]+$arr[pas]+$arr[sila_ud]+$arr[to_ud];
if ($allmas != $arr[mas])
{
$rmm=ceil($allmas/100*$arr[fiz]);
mysql_query("update `m_player` set `mas`='" . $allmas . "', `rm`='" . $rmm . "' where id='" . $arr[id] . "';");
}
echo ceil(ceil($i / 2) - ($i / 2)) == 0 ? '<tr bgcolor="ffffff">' : '<tr bgcolor="f3f3f3">';
echo '
<td align="center">'.$arr[poz].'</td>
<td><a href="player.php?id='.$arr[id].'">'.$arr[name].'</a></td>
<td align="center"><font color="green"><b>'.$arr[opit].'</b></font></td>
<td align="center">'.oput($arr[otbor],$arr[opit],$arr[id],otbor).'</td>
<td align="center">'.oput($arr[opeka],$arr[opit],$arr[id],opeka).'</td>
<td align="center">'.oput($arr[drib],$arr[opit],$arr[id],drib).'</td>
<td align="center">'.oput($arr[priem],$arr[opit],$arr[id],priem).'</td>
<td align="center">'.oput($arr[vonos],$arr[opit],$arr[id],vonos).'</td>
<td align="center">'.oput($arr[pas],$arr[opit],$arr[id],pas).'</td>
<td align="center">'.oput($arr[sila],$arr[opit],$arr[id],sila).'</td>
<td align="center">'.oput($arr[tocnost],$arr[opit],$arr[id],tocnost).'</td>
';
echo '</tr>';
++$i;
}
echo '</table>';
echo '</div><br/>';
echo '<div class="list1"><p>
Футболисты получают опыт за сыгранные матчи.<br/>
При достижении некоторого значения, накопленный опыт можно потратить на повышение выбранного умения.<br/>
Значения всех умений и необходимого для повышения опыта указаны в таблице.<br/>
При достижении этого опыта, около умения появится кнопка для повышения.<br/>
</p></div><br/>';
echo '<div class="c"><p align="center">
<span class="button"><a href="butcer.php?act=oput"></a></span>
</p></div>';
echo '<br/><form xmlns="http://www.w3.org/1999/xhtml" name="mess" action="butcer.php?act=oput" method="post"><center><input type="submit" value="Прокачать игроков" /></center></form><br/>';
}
require_once ("../incfiles/end.php");
?>