Location: PHPKode > projects > OpenDataCenter Network Management System > include/myaccount_page/mainpage.php
<?php
// ----------------------------------------------------------------------
// Copyright (C) 2007 by GREGORY LE BRAS
// ----------------------------------------------------------------------
// LICENSE
//
// This file is part of ODCNMS - Open DataCenter Network Management System
// 
// ODCNMS is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// Foobar is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with Foobar; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
// ----------------------------------------------------------------------
// Original Author of file: GREGORY LE BRAS - http://www.odcnms.org/
// ----------------------------------------------------------------------
?>
<div class="title"><img src="images/user.png" alt="My Account" align="bottom"> <?php echo TXT_MY_ACCOUNT; ?></div>

<table class="subtitle" width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td width="100%"><h4><img src="images/account_information.gif" alt="Account Information" align="top"> <?php echo TXT_ACCOUNT_INFORMATION; ?></h4></td>
	<tr>
</table>

<div style="margin: 10px 0px 0px 0px; font-size: 110%;">
	<div style="margin-bottom: 5px;"><b><?php echo TXT_USERNAME; ?>:</b> <?php echo "$login"; ?></div>
	<div><b><?php echo TXT_STATUS; ?>:</b> <?php 
	
	$request=mysql_query("SELECT administrator FROM $name_table_users WHERE username=\"$login\"") or die ("ERROR!");

	while($tmp_request=mysql_fetch_array($request))
	{
		if ($tmp_request['administrator']=="1")
		{
			echo TXT_ADMINISTRATOR;
		}
		else if ($tmp_request['administrator']=="0")
		{
			echo TXT_SIMPLE_USER;
		}
		else
		{
			echo TXT_SUPER." ".TXT_ADMINISTRATOR;
		}
	}
	?></div>
</div>

<table class="subtitle" width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td width="100%"><h4><img src="images/history.gif" alt="History" align="top"> 10 <?php echo TXT_LATEST; ?> <?php echo TXT_HISTORIES; ?></h4></td>
	<tr>
</table>
<table class="list" width="100%" cellspacing="2" cellpadding="3">
	<tr class="list_title">
		<td width="20%"><?php echo TXT_DATE; ?></td>
		<td width="20%"><?php echo TXT_TIME; ?></td>
		<td width="80%"><?php echo TXT_ACTION; ?></td>
	</tr>
<?php
	$list1 = "list1"; 
	$list2 = "list2"; 
	$line_count = 0; 
	
	$request=mysql_query("SELECT id FROM $name_table_users WHERE username=\"$login\"") or die ("ERROR!");

	while($tmp_request=mysql_fetch_array($request))
	{
	
	$request2=mysql_query("SELECT * FROM $name_table_users_log WHERE users_id=\"$tmp_request[id]\" ORDER BY id DESC LIMIT 10") or die ("ERROR!");
	
		while($tmp_request2=mysql_fetch_array($request2))
		{
			$line_color = ($line_count % 2) ? $list1 : $list2;
	?>
		<tr class="<?php echo "$line_color"; ?>">
			<td width="20%"><?php echo $tmp_request2['date']; ?></td>
			<td width="20%"><?php echo $tmp_request2['time']; ?></td>
			<td width="80%"><?php echo $tmp_request2['description']; ?></td>	
		</tr>
	<?php	
			$line_count++;
		}
	}

?>	
</table>
Return current item: OpenDataCenter Network Management System