Skip to content
admin_home.php 7.02 KiB
Newer Older
Seblu's avatar
Seblu committed
<?

function dispAdminHome() {

Seblu's avatar
Seblu committed
include_once "include/admin_tables.php";
include_once "include/functions_sql_admin.php";
include_once "include/admin_menu.php";
include_once "include/admin_videos.php";
include_once "include/admin_news.php";
include_once "include/admin_edito.php";
include_once "include/admin_links.php";
include_once "include/admin_members.php";
include_once "include/admin_users.php";
include_once "include/admin_blacklist.php";
Seblu's avatar
Seblu committed

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

Seblu's avatar
Seblu committed
			<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
Seblu's avatar
Seblu committed
								</font>
								</b>
Seblu's avatar
Seblu committed
							</td>
							</tr>
							<tr>
Seblu's avatar
Seblu committed
							<td bgcolor="#303030">
Seblu's avatar
Seblu committed
							<table width="100%" cellpadding="2" cellspacing="2" align="center">';
Seblu's avatar
Seblu committed

Seblu's avatar
Seblu committed
$str .= dispAdminMenu();
Seblu's avatar
Seblu committed

Seblu's avatar
Seblu committed
$str .= '
							</table>
							</td>
							</tr>
						</table>
					</td>
					</tr>
				</table>
				</td>
Seblu's avatar
Seblu committed

Seblu's avatar
Seblu committed
				<td  width="85%" valign="top" align="center">
		';


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

Seblu's avatar
Seblu committed

Seblu's avatar
Seblu committed
	$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++) {
Seblu's avatar
Seblu committed

Seblu's avatar
Seblu committed
				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>
Seblu's avatar
Seblu committed
				</b>
Seblu's avatar
Seblu committed
			</td>
			</tr>
Seblu's avatar
Seblu committed

Seblu's avatar
Seblu committed
			<tr>
Seblu's avatar
Seblu committed
			<td bgcolor="#303030">
Seblu's avatar
Seblu committed
			<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>
Seblu's avatar
Seblu committed
					<TD><b>'
Seblu's avatar
Seblu committed
					.$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>
Seblu's avatar
Seblu committed
					<TD><b>'
Seblu's avatar
Seblu committed
					.$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>
Seblu's avatar
Seblu committed

Seblu's avatar
Seblu committed
	';


		}


		$str .= '

				</td>
				</tr>
			</table>
			</td>
			</tr>
Seblu's avatar
Seblu committed


	</table>
Seblu's avatar
Seblu committed
</div>
Seblu's avatar
Seblu committed
	';

}
else
{
$str = '

	<table width="100%">
		<tr>
Seblu's avatar
Seblu committed

Seblu's avatar
Seblu committed
				<td  width="85%" valign="top" align="center">
Seblu's avatar
Seblu committed

Seblu's avatar
Seblu committed
				<BR>
				<b>
Seblu's avatar
Seblu committed
				Arf, pas tout de suite...
Seblu's avatar
Seblu committed
				</b>
Seblu's avatar
Seblu committed

Seblu's avatar
Seblu committed
				</td>
				</tr>
Seblu's avatar
Seblu committed
		</tr>
	</table>