<?php
define('_IN_JOHNCMS', 1);
$headmod = 'manager';
$textl='Futbol Menejer';
require_once("../incfiles/core.php");
require_once("../incfiles/head.php");
require_once("manfunc.php");

$act = functions::check($act);

if($act)
{
echo"<div class='phdr'>".land($act,'im')."</div>
<div class='menu'><img src='flags/$act.jpg' alt='".land($act,'im')."'/></div>
<div class='menu'><a href='table.php?act=champ&amp;land=$act'>".land($act,'lig')."</a></div>
<div class='menu'><a href='table.php?act=cup&amp;land=$act'>$lng[cup] ".land($act,'rod')."</a></div>
<div class='menu'><a href='table.php?act=supercup&amp;land=$act'>$lng[supercup] ".land($act,'rod')."</a></div>";
echo"<div class='phdr'><a href='index.php'>Menedjer</a></div>";
}
else
{
echo'<div class="phdr"><center>'.$lng['fm'].'!</center></div>';

if(!$club_name)
echo"<div class='menu'><b>» <a href='zayv.php'>$lng[choose_club]</a></b></br>$lng[ago_choose] <font color='red'><a href='spravka.php'>($lng[info])</a></font> $lng[and] <font color='red'><a href='pravila.php'>($lng[rules])</a></font> $lng[success]!!!</div>";
else
{
if(!$club_id)
{
$cn=explode(' (',$club_name);
$qci=mysql_query("select * from fman_clubs where name='$cn[0]';");
$dc=mysql_fetch_array($qci);
$club_id=$dc[id];
}

$man = mysql_query("select * from fman_clubs where id='$club_id'");
$m = mysql_fetch_array($man);
$land = mysql_query("select * from fman_lands where code='$m[land]'");
$l = mysql_fetch_array($land);
$qk = @mysql_query("select * from `fman_clubs` where id='" . $datauser['manager2'] . "' LIMIT 1;");
$kom = @mysql_fetch_array($qk);
switch ($kom[level])
{
case "1":
$oput = 100;
break;
case "2":
$oput = 300;
break;
case "3":
$oput = 800;
break;
case "4":
$oput = 1800;
break;
case "5":
$oput = 3800;
break;
case "6":
$oput = 7000;
break;
case "7":
$oput = 12000;
break;
case "8":
$oput = 17000;
break;
case "9":
$oput = 25000;
break;
case "10":
$oput = 30000;
break;
}

if ($kom[oput] >= $oput)
{
$addlevel = $kom[level]+1;
mysql_query("update `fman_clubs` set `level`='" . $addlevel . "' where id='" . $kom[id] . "';");

}
echo'<table style="width:100%; border-left: 1px solid #F0EFED; border-right: 1px solid #F0EFED;" cellspacing="5" cellpadding="0" border="0"><tbody><tr>
<th width="105px" rowspan="10" class="tab_f2"><img width="64" height="64" src="emblems/'.$club_id.'.jpg" align="middle" alt="x"/></th></tr>
<tr>
<td class="tab_r2">
<div class="put" style="font-size: 14px;">';

echo"<img src='flags_icon/$m[land].png' style='max-width: 16px; vertical-align: -1px;'>";echo'&nbsp;<span style="font-size:14px;"><a href="club.php?id='.$club_id.'">'.$club_name.'</a> ['.$m['level'].']</span><table style="width: 120px;"><tbody>
	</tbody></table>';
	?>
	<table style="width: 120px;"><tbody>
<tr>
<td style="width: 120px;">
<div style="border-radius: 12px; height: 6px; background-color: #D5D5D5; width: 100%;">
	<div style="border-radius: 12px; height: 6px; background-color: #8FBC8F; width:<?echo"".($kom[oput]/$oput*100)."";?>%;"></div></div></td></tr>
	</tbody></table>
	</div>

	<div class="put">
	<?
echo"<a href='index.php?act=$m[land]'>$l[lig]</a><br>
<b>$lng[fans]:</b> $m[fan]<br/>
<b>$lng[budjet]:</b> $".number_format($m[budj],0,'.',' ')."<br/>
<b>$lng[oput]:</b> $m[oput]<br/>
</div>
	</td>
	</tr>
</table>";
}

if($rights>=7)echo"<div class='menu' align='center'><b><a href='adminka.php'>$lng[management]</a></b></div>";
if($club_name) {echo"<div class='phdr'><i class='fa fa-futbol-o'></i> $lng[club]</div>
<div class='menu'><i class='fa fa-user-o' style='color: #46B800;'></i> <a href='list-of-players.php?id=$m[id]'>$lng[list_of_players]</a></div>
<div class='menu'><i class='fa fa-calendar-plus-o' style='color: #46B800;'></i> <a href='sostav.php'>$lng[head_team]</a></div>";}

echo"<div  class='phdr'><i class='fa fa-trophy'></i> $lng[turn]</div>
<div class='menu'><i class='fa fa-trophy' style='color: #46B800;'></i> <a href='/tournament/index.php?id=1'>$lng[cup_turn]</a></div>
<div class='menu'><i class='fa fa-trophy' style='color: #46B800;'></i> <a href='table.php?act=lc&land=eu'>$lng[lc]</a></div>
<div class='menu'><i class='fa fa-trophy' style='color: #46B800;'></i> <a href='table.php?act=le&land=eu'>$lng[le]</a></div>
<div class='menu'><i class='fa fa-trophy' style='color: #46B800;'></i> <a href='table.php?act=sc&land=eu'>$lng[sc]</a></div>
<div  class='phdr'><i class='fa fa-building-o'></i> $lng[office]</div>
<div class='menu'><i class='fa fa-calendar-check-o' style='color: #46B800;'></i> <a href='calendar.php'>$lng[calendar]</a></div>
<div class='menu'><i class='fa fa-exchange' style='color: #46B800;'></i> <a href='transfer.php'>$lng[transfers]</a></div>";
if ($club_name) {echo"<div class='menu'><i class='fa fa-globe' style='color: #46B800;'></i> <a href='stad.php?id=$m[id]'>$lng[stadium]</a></div>";}
echo"<div class='menu'><i class='fa fa-list-ul' style='color: #46B800;'></i> <a href='manager.php'>$lng[manager]</a></div>
<div  class='phdr'><i class='fa fa-cog'></i> $lng[service]</div>
<div class='menu'><i class='fa fa-search' style='color: #46B800;'></i> <a href='search.php'>$lng[search]</a></div>
<div class='menu'><i class='fa fa-bar-chart-o' style='color: #46B800;'></i> <a href='rating.php'>$lng[rating]</a></div>
<div class='menu'><i class='fa fa-info-circle' style='color: #46B800;'></i> <a href='faq.php'>$lng[help]</a></div>
<div class='menu'><i class='fa fa-usd' style='color: #46B800;'></i> <a href='bussiness.php'>$lng[club_bussiness]</a></div>";


}
require_once("../incfiles/end.php"); ?>