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

if($act=="trans"){$zu="pl_id>0 and club_id=0";$v = 'transferlar';}
else{$zu="pl_id=0 and club_id=0"; $v = 'menejerlar';}

if($id)
{
	$qcj=mysql_query("select * from fman_clubs where id=$id;");
	$t=mysql_fetch_array($qcj);
	$zu="club_id=$id";
	$v=" клуба $t[name]";
}

echo"<div class='phdr' align='center'>Menejer yangiliklari</div>";
$q=mysql_query("select * from fman_news where ".$zu." order by time desc limit $start,$kmess;");
$qr=mysql_query("SELECT COUNT(*) FROM `fman_news` WHERE ".$zu.";");
$total=mysql_result($qr,0);
if($total>$kmess)
{
	echo '<div class="topmenu">' . functions::display_pagination('news.php?act='.$act.'&amp;', $start, $total, $kmess) . '</div>';
}
while($a=mysql_fetch_array($q))
{
	$text=html_entity_decode($a[text]);
	echo"<div class='menu'>".functions::display_date($a[time])."<br/>";
	if(!$a[pl_id])echo"$text<br/>"; else{

	echo"&#160;<i class='fa fa-male' style='color: #1B2C56;'></i>&#160;&#160;$a[name]<br/><i class='fa fa-arrow-left' style='color: red;'></i>&#160;&#160;";
	if($a[id1])
	{
		$q3=mysql_query("select name from fman_clubs where id=$a[id1];");
		$data1=mysql_fetch_array($q3);
		echo"<a href='club.php?id=$a[id1]'>$data1[name]</a>";
	}
	else
		echo"erkin agent";

	echo"<br/><i class='fa fa-arrow-right' style='color: green;'></i>&#160;&#160;";
	
	if($a[id2])
	{
		$q4=mysql_query("select name from fman_clubs where id=$a[id2];");
		$data2=mysql_fetch_array($q4);
		echo"<a href='club.php?id=$a[id2]'>$data2[name]</a>";
	}
	else
		echo"Klubi yo'q";}
	echo"</div>";
}
if ($total > $kmess) 
{
	echo '<div class="topmenu">' . functions::display_pagination('news.php?act='.$act.'&amp;id='.$id.'&amp;', $start, $total, $kmess) . '</div>' .
	'<form action="news.php?act='.$act.'&amp;id='.$id.'" method="post"><p>' .
	'<input type="text" name="page" size="2"/>' .
	'<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' .
	'</p></form>';
}
echo '<div class="bmenu">Hammasi: ' . $total . '</div>';
echo"<div class='phdr'>";
if($id)echo"<a href='club.php?id=$id'>$t[name]</a><br/>";
echo"<a href='index.php'>Menejer</a></div>";
require_once("../incfiles/end.php"); 
?>
