Location: PHPKode > projects > OpenDataCenter Network Management System > include/administration_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/administration.gif" alt="administration" align="bottom"> <?php echo TXT_ADMINISTRATION; ?></div>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td width="45%" valign="top">
			<table class="subtitle" width="100%" cellspacing="0" cellpadding="0">
				<tr>
					<td width="100%"><h4><img src="images/user.gif" alt="user" align="top"> 5 <?php echo TXT_USERS; ?></h4></td>
				<tr>
			</table>
			<table class="sortable list" id="sortable" width="100%" cellspacing="2" cellpadding="3">
				<tr class="list_title">
					<td valign="top"><?php echo TXT_USERNAME; ?></td>
					<td valign="top"><?php echo TXT_STATUS; ?></td>
					<td width="20%" valign="top" class="unsortable"><?php echo TXT_ACTION; ?></td>
				</tr>
			<?php
				$list1 = "list1"; 
				$list2 = "list2"; 
				$line_count = 0; 
				
				$request=mysql_query("SELECT * FROM $name_table_users ORDER BY username ASC LIMIT 5") or die ("ERROR!");

				while($tmp_request=mysql_fetch_array($request))
				{
					$line_color = ($line_count % 2) ? $list1 : $list2;
				?>
					<tr class="<?php echo "$line_color"; ?>">
			<td valign="top"><?php print("<a href=\"index.php?include=administration&page=user&action=view&id=$tmp_request[id]\">$tmp_request[username]</a>"); ?></td>
			<td valign="top"><?php 
			switch ($tmp_request['administrator'])
			{
				case '0':
					echo "<font style='padding:2px;background:#0000ff;color:#fff'>".TXT_SIMPLE_USER."</font>";					
				break;
				
				case '1':
					echo "<font style='padding:2px;background:#ff0000;color:#fff'>".TXT_ADMINISTRATOR."</font>";					
				break;
				
				case '2':
					echo "<font style='padding:2px;background:#00ff00;color:#fff'>".TXT_SUPER." ".TXT_ADMINISTRATOR."</font>";					
				break;					
			}

			?></td>
			<td width="20%" valign="top">[ <?php print("<a href=\"index.php?include=administration&page=user&action=edit&id=$tmp_request[id]\">".TXT_EDIT."</a>"); ?> ] [ <?php print("<a href=\"index.php?include=administration&page=user&action=delete&id=$tmp_request[id]\">".TXT_DELETE."</a>"); ?> ]</td>
			</tr>
				<?php	
						$line_count++;
				}
			?>	
			</table>	
		</td>
		<td width="5%" valign="top"></td>
		<td width="45%" valign="top">
					
		</td>		
	</tr>
</table>
Return current item: OpenDataCenter Network Management System