<?

  include_once '../../config.inc.php';
  if (!include '../autorization.php')
  {
    echo 'Access denied!';
    exit ();
  }

  if (!($result_proper = mysql_query ('select * from properties')))
  {
    exit ('<b>Error:</b>' . mysql_error ());
    ;
  }

  $proper = mysql_fetch_array ($result_proper);
  include '../lang/' . $proper['admin_language'];
  echo '
<HTML><BODY STYLE="color: Navy;"><LINK HREF="../style.css" REL="stylesheet" TYPE="text/css"><TABLE WIDTH="600" BORDER=0 CELLSPACING=0 CELLPADDING=1><TR><TD style="background-color:#505090;"><TABLE WIDTH="100%" BORDER=0 CELLSPACING=0 CELLPADDING=5 BGCOLOR="#EFEFF8">
<TR><TD VALIGN=top BGCOLOR="#BFBFDF" STYLE="border-bottom: 1px solid #505090;"><FONT COLOR="navy"><B>';
  echo $admin_Banner_Statistic;
  echo '</B>: </FONT></TD></TR><TR><TD VALIGN=top>

';
  if (!($result = mysql_query ('' . 'SELECT * FROM ban_source WHERE id=' . $_GET['id'])))
  {
    exit ('Invalid query');
    ;
  }

  $row = mysql_fetch_array ($result);
  if (!($result1 = mysql_query ('' . 'SELECT * FROM ban_group WHERE id=' . $row['gr'])))
  {
    exit ('Query failed4');
    ;
  }

  $row1 = mysql_fetch_array ($result1);
  echo '
		<TABLE BORDER="0" CELLSPACING="2" CELLPADDING="2">
		<TR>
			<TD align=right><FONT COLOR="gray" STYLE="font-size:11;">';
  echo $admin_Name;
  echo '</FONT></TD>
			<TD><A HREF="javascript:" onClick="window.open(\'show.php?id=';
  echo $row['image'];
  echo '\',\'popup\',\'width=';
  echo $row1['width'] + 20;
  echo ',height=';
  echo $row1['height'] + 25;
  echo '\');" STYLE="color:blue;" >';
  echo $row['name'];
  echo '</A></TD>
		<TR>
		<TR>
			<TD align=right><FONT COLOR="gray" STYLE="font-size:11;">';
  echo $admin_table5[3];
  echo ':</FONT></TD>
			<TD><FONT COLOR="';
  if ($row['active'] == 'off')
  {
    echo 'red';
  }
  else
  {
    echo 'black';
  }

  echo '">';
  echo $row['active'];
  echo '</FONT></TD>
		<TR>
		</TR>			
			<TD align=right><FONT COLOR="gray" STYLE="font-size:11;">';
  echo $admin_table5[1];
  echo ':</FONT></TD>
			<TD>(';
  echo $row['gr'];
  echo ') - ';
  echo $row1['width'] . 'x' . $row1['height'];
  echo '</TD>
		<TR>
		</TR>			
			<TD align=right><FONT COLOR="gray" STYLE="font-size:11;">';
  echo $admin_table5[2];
  echo ':</FONT></TD>
			<TD>';
  echo date ('d/m/y', substr ($row['image'], 0, -4));
  echo '</TD>
		<TR>
		</TR>			
			<TD align=right><FONT COLOR="gray" STYLE="font-size:11;">';
  echo $admin_Impression_Limit;
  echo '</FONT></TD>
			<TD>';
  echo $row['imp_limit'];
  echo '</TD>
		<TR>
		</TR>			
			<TD align=right><FONT COLOR="gray" STYLE="font-size:11;">';
  echo $admin_Total_Impression;
  echo '</FONT></TD>
			<TD>
			';
  if (0 < $row['imp_limit'])
  {
    echo '			<IMG SRC="../images/line_bar.gif" height=12 WIDTH="1" BORDER="0"><IMG SRC="../images/bar.gif" height=12 WIDTH="';
    echo round ($row['imp_total'] * 100 / $row['imp_limit'], 0);
    echo '" BORDER="0">';
    if (round ($row['imp_total'] * 100 / $row['imp_limit'], 0) < 100)
    {
      echo '<IMG SRC="../images/empty_bar.gif" height=12 WIDTH="';
      echo 100 - round ($row['imp_total'] * 100 / $row['imp_limit'], 0);
      echo '" BORDER="0">';
    }

    echo '<IMG SRC="../images/line_bar.gif" height=12 WIDTH="1" BORDER="0">

			<FONT COLOR="';
    if (round ($row['imp_total'] * 100 / $row['imp_limit'], 1) == 100)
    {
      echo 'red';
    }
    else
    {
      echo 'navy';
    }

    echo '">';
    echo $row['imp_total'];
    echo ' (';
    echo round ($row['imp_total'] * 100 / $row['imp_limit'], 1);
    echo '%)</FONT>
			';
  }
  else
  {
    echo '<B>';
    echo $row['imp_total'];
    echo '</B>';
  }

  echo '			</TD>
		<TR>
		</TR>			
			<TD align=right><FONT COLOR="gray" STYLE="font-size:11;">';
  echo $admin_Total_Click;
  echo '</FONT></TD>
			<TD>
			';
  if (0 < $row['imp_total'])
  {
    echo '			<IMG SRC="../images/line_bar.gif" height=12 WIDTH="1" BORDER="0"><IMG SRC="../images/bar.gif" height=12 WIDTH="';
    echo round ($row['clicks'] * 100 / $row['imp_total'], 0);
    echo '" BORDER="0">';
    if (round ($row['clicks'] * 100 / $row['imp_total'], 0) < 100)
    {
      echo '<IMG SRC="../images/empty_bar.gif" height=12 WIDTH="';
      echo 100 - round ($row['clicks'] * 100 / $row['imp_total'], 0);
      echo '" BORDER="0">';
    }

    echo '<IMG SRC="../images/line_bar.gif" height=12 WIDTH="1" BORDER="0">
			
			';
    echo $row['clicks'];
    echo ' (';
    echo round ($row['clicks'] * 100 / $row['imp_total'], 1);
    echo '%)
			';
  }
  else
  {
    echo $row['clicks'];
  }

  echo '			</TD>
		</TR>
		</TABLE>

<br><INPUT TYPE=button VALUE="';
  echo $admin_Go_back;
  echo '" onClick="window.location=\'add.php\'">
		
</TD></TR></TABLE></TD></TR></TABLE></BODY></HTML>';
?>
