<?

function dispAdminHome() {

include_once "admin/admin_tables.php";
include_once "admin/functions_sql_admin.php";
include_once "admin/admin_menu.php";
include_once "admin/admin_videos.php";
include_once "admin/admin_news.php";
include_once "admin/admin_edito.php";
include_once "admin/admin_links.php";
include_once "admin/admin_members.php";
include_once "admin/admin_users.php";
include_once "admin/admin_blacklist.php";

if ($_SESSION["user_right"] >= $GLOBALS["REPORTER"] )
{
  $str = '<div id="main_body">';
  $str .= '<table width="100%">
		<tr>
		 <td height="589" valign="top">

			<table width="100%" border="0" cellspacing="0" cellpadding="4">
				<tr>
				<td  width="20%" valign="top">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
					<td bgcolor="#000000">
					<!-- Start of news content -->
						<table width="100%" border="0" cellspacing="1" cellpadding="2">
							<tr>
							<td bgcolor="#000000">
								<b>
								<font color="#ffffff">
								&nbsp;a d m i n
								</font>
								</b>
							</td>
							</tr>
							<tr>
							<td bgcolor="#303030">
							<table width="100%" cellpadding="2" cellspacing="2" align="center">';

$str .= dispAdminMenu();

$str .= '
							</table>
							</td>
							</tr>
						</table>
					</td>
					</tr>
				</table>
				</td>

				<td  width="85%" valign="top" align="center">
		';


				if ($_GET['section_admin']) {
					$section_admin= $_GET['section_admin'];
					$str .= $tab_section_admin[$section_admin]();
				}
				else
				{


	$total_size_videos = 0;
	$nb_videos_publics = 0;
	$nb_videos_tendus = 0;
	$nb_videos_privates = 0;
	$nb_videos_eptv = 0;
	$nb_videos_bonus = 0;
	$nb_videos_adm = 0;

	$result = getAllVideos();
				for ($nb_videos = 0; $video = mysql_fetch_array($result); $nb_videos++) {

				$total_size_videos += $video["video_size"];

				if ($video["video_tendu"] == 0)
					$nb_videos_publics++;
				else if ($video["video_tendu"] == 1)
					$nb_videos_tendus++;
				else if ($video["video_tendu"] == 2)
					$nb_videos_privates++;

				if ($video["video_type"] == 'eptvprod')
					$nb_videos_eptv++;
				else if ($video["video_type"] == 'eptvbonus')
					$nb_videos_bonus++;
				else if ($video["video_type"] == 'eptv.adm')
					$nb_videos_adm++;
				;}


	$result = getLastNews(2);
				for ($nb_news = 0; $news = mysql_fetch_array($result); $nb_news++) {
				;}


	$result = getAllMembers();
				for ($nb_members = 0; $member = mysql_fetch_array($result); $nb_members++) {
				;}


	$nb_users_basics = 0;		// right = 1
	$nb_users_guests = 0;		// right = 2
	$nb_users_epitregs = 0;		// right = 4
	$nb_users_reporters = 0;	// right = 5
	$nb_users_privguests = 0;	// right = 6

	$result = getAllUsers();
				for ($nb_users = 0; $user = mysql_fetch_array($result); $nb_users++) {

				if ($user["user_right"] == 1)
					$nb_users_basics++;
				else if ($user["user_right"] == 2)
					$nb_users_guests++;
				else if ($user["user_right"] == 4)
					$nb_users_epitregs++;
				else if ($user["user_right"] == 5)
					$nb_users_reporters++;
				else if ($user["user_right"] == 6)
					$nb_users_privguests++;
				;}

	$result = getAllBlacklist();
				for ($nb_blacklist = 0; $user = mysql_fetch_array($result); $nb_blacklist++) {
				;}




$str .= '

	<table width="80%" border="0" cellspacing="0" cellpadding="0">
		<tr>
		<td bgcolor="#000000">
		<table width="100%" border="0" cellspacing="1" cellpadding="2">
			<tr>
			<td>
				<b>
				<font color="#ffffff">
				&nbsp w e l c o m e &nbsp t o &nbsp a d m i n i s t r a c h e u n
				</font>
				</b>
			</td>
			</tr>

			<tr>
			<td bgcolor="#303030">
			<table cellpadding="0" cellspacing="0" width="100%">
				<tr>
				<td>
				<table width="80%" border="0" cellspacing="0" cellpadding="4">



				<TR>
					<TD><b>
					Nombre total de Vid&eacute;os:
					</b></TD>
					<TD><b>'
					.$nb_videos.
					'</b></TD>
				</TR>


				<TR>
					<TD><small>
					&nbsp &nbsp Taille totale des Vid&eacute;os:
					</small></TD>
					<TD align=left><small>'
					.$total_size_videos.
					' Mo</small></TD>
				</TR>

				<TR>
					<TD><small>
					&nbsp &nbsp Nombre de Vid&eacute;os Publics:
					</small></TD>
					<TD align=left><small>'
					.$nb_videos_publics.
					'</small></TD>
				</TR>
				<TR>
					<TD><small>
					&nbsp &nbsp Nombre de Vid&eacute;os Tendus:
					</small></TD>
					<TD align=left><small>'
					.$nb_videos_tendus.
					'</small></TD>
				</TR>
				<TR>
					<TD><small>
					&nbsp &nbsp Nombre de Vid&eacute;os Priv&eacute;es:
					</small></TD>
					<TD align=left><small>'
					.$nb_videos_privates.
					'</small></TD>
				</TR>

				<TR><TD></TD></TR>

				<TR>
					<TD><small>
					&nbsp &nbsp Nombre de Vid&eacute;os Eptv:
					</small></TD>
					<TD align=left><small>'
					.$nb_videos_eptv.
					'</small></TD>
				</TR>
				<TR>
					<TD><small>
					&nbsp &nbsp Nombre de Vid&eacute;os Bonus:
					</small></TD>
					<TD align=left><small>'
					.$nb_videos_bonus.
					'</small></TD>
				</TR>
				<TR>
					<TD><small>
					&nbsp &nbsp Nombre de Vid&eacute;os .Adm:
					</small></TD>
					<TD align=left><small>'
					.$nb_videos_adm.
					'</small></TD>
				</TR>

				<TR><TD></TD></TR>


				<TR>
					<TD><b>
					Nombre total de News:
					</b></TD>
					<TD><b>'
					.$nb_news.
					'</b></TD>
				</TR>



				<TR><TD></TD></TR>

				<TR>
					<TD><b>
					Nombre total de Membres:
					</b></TD>
					<TD align=left><b>'
					.$nb_members.
					'</b></TD>
				</TR>

				<TR><TD></TD></TR>

				<TR>
					<TD><b>
					Nombre total d\'Inscrits:
					</b></TD>
					<TD align=left><b>'
					.$nb_users.
					'</b></TD>
				</TR>

				<TR>
					<TD><small>
					&nbsp &nbsp Nombre de Guest Priv&eacute;s:
					</small></TD>
					<TD align=left><small>'
					.$nb_users_privguests.
					'</small></TD>
				</TR>
				<TR>
					<TD><small>
					&nbsp &nbsp Nombre de Reporter:
					</small></TD>
					<TD align=left><small>'
					.$nb_users_reporters.
					'</small></TD>
				</TR>
				<TR>
					<TD><small>
					&nbsp &nbsp Nombre de Epit* enregistr&eacute;s:
					</small></TD>
					<TD align=left><small>'
					.$nb_users_epitregs.
					'</small></TD>
				</TR>
				<TR>
					<TD><small>
					&nbsp &nbsp Nombre de Guest enregistr&eacute;s:
					</small></TD>
					<TD align=left><small>'
					.$nb_users_guests.
					'</small></TD>
				</TR>
				<TR>
					<TD><small>
					&nbsp &nbsp Nombre de Basic User enregistr&eacute;s:
					</small></TD>
					<TD align=left><small>'
					.$nb_users_basics.
					'</small></TD>
				</TR>


				<TR><TD></TD></TR>

				<TR>
					<TD><b>
					Nombre total de Blacklist&eacute;s:
					</b></TD>
					<TD align=left><b>'
					.$nb_blacklist.
					'</b></TD>
				</TR>



				</TR>
				</table>
				</td>
				</tr>
			</table>
			</td>
			</tr>
		</table>
		</td>
		</tr>
	</table>

	';


		}


		$str .= '

				</td>
				</tr>
			</table>
			</td>
			</tr>


	</table>

	';

}
else

{
$str = '

	<table width="100%">
		<tr>

				<td  width="85%" valign="top" align="center">

				<BR>
				<b>
				Arf, pas tout de suite...
				</b>

				</td>
				</tr>
		</tr>
	</table>
';
}


echo $str;






}







?>


