Location: PHPKode > projects > OpenDataCenter Network Management System > include/mainview_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/mainview.gif" alt="Main view" align="bottom"> <?php echo TXT_MAINVIEW; ?></div>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td width="35%" valign="top">
			<table class="subtitle" width="100%" cellspacing="0" cellpadding="0">
				<tr>
					<td width="100%"><h4><img src="images/stats.gif" alt="Stats" align="top"> <?php echo TXT_STATS; ?></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_NAME; ?></td>
					<td valign="top"><?php echo TXT_NUMBER; ?></td>
				</tr>
        <tr class="list1">
          <td valign="top"><img src="images/location.gif" alt="Location" align="top"> <?php echo TXT_LOCATION; ?></td>
          <td valign="top"><?php echo $all_location[0]; ?></td>
        </tr>
        <tr class="list2">
          <td valign="top"><img src="images/rack.gif" alt="Rack" align="top"> <?php echo TXT_RACK; ?></td>
          <td valign="top"><?php echo $all_rack[0]; ?></td>
        </tr>
        <tr class="list1">
          <td valign="top"><img src="images/patch_panel.gif" alt="Patch Panel" align="top"> <?php echo TXT_PATCH_PANEL; ?></td>
          <td valign="top"><?php echo $all_patch_panel[0]; ?></td>
        </tr>
        <tr class="list2">
          <td valign="top"><img src="images/port.gif" alt="Port" align="top"> <?php echo TXT_PORT; ?></td>
          <td valign="top"><?php echo $all_port[0]; ?></td>
        </tr>    
        <tr class="list1">
          <td valign="top"><img src="images/customer.gif" alt="Customer" align="top"> <?php echo TXT_CUSTOMER; ?></td>
          <td valign="top"><?php echo $all_customer[0]; ?></td>
        </tr>
        <tr class="list2">
          <td valign="top"><img src="images/network.gif" alt="Network" align="top"> <?php echo TXT_NETWORK; ?></td>
          <td valign="top"><?php echo $all_network[0]; ?></td>
        </tr> 
        <tr class="list1">
          <td valign="top"><img src="images/subnetwork.gif" alt="Subnet" align="top"> <?php echo TXT_SUBNET; ?></td>
          <td valign="top"><?php echo $all_subnet[0]; ?></td>
        </tr>
        <tr class="list2">
          <td valign="top"><img src="images/ipaddress.gif" alt="IP ADDRESS" align="top"> <?php echo TXT_IP_ADDRESS; ?></td>
          <td valign="top"><?php echo $all_ip_address[0]; ?></td>
        </tr> 
        <tr class="list1">
          <td valign="top"><img src="images/vlan.gif" alt="VLAN" align="top"> <?php echo TXT_VLAN; ?></td>
          <td valign="top"><?php echo $all_vlan[0]; ?></td>
        </tr>
        <tr class="list2">
          <td valign="top"><img src="images/manufacturer.gif" alt="Manufacturer" align="top"> <?php echo TXT_MANUFACTURER; ?></td>
          <td valign="top"><?php echo $all_manufacturer[0]; ?></td>
        </tr> 
        <tr class="list1">
          <td valign="top"><img src="images/category.gif" alt="Category" align="top"> <?php echo TXT_CATEGORY; ?></td>
          <td valign="top"><?php echo $all_category[0]; ?></td>
        </tr>
        <tr class="list2">
          <td valign="top"><img src="images/model.gif" alt="Model" align="top"> <?php echo TXT_MODEL; ?></td>
          <td valign="top"><?php echo $all_model[0]; ?></td>
        </tr>  
        <tr class="list1">
          <td valign="top"><img src="images/device.gif" alt="Device" align="top"> <?php echo TXT_DEVICE; ?></td>
          <td valign="top"><?php echo $all_device[0]; ?></td>
        </tr>  
        <tr class="list2">
          <td valign="top"><img src="images/slot.gif" alt="Slot" align="top"> <?php echo TXT_SLOT; ?></td>
          <td valign="top"><?php echo $all_slot[0]; ?></td>
        </tr>  
        <tr class="list1">
          <td valign="top"><img src="images/interface.gif" alt="Interface" align="top"> <?php echo TXT_INTERFACE; ?></td>
          <td valign="top"><?php echo $all_interface[0]; ?></td>
        </tr>          
			</table>
		</td>
		<td width="2%" valign="top"></td>
		<td width="68%" valign="top">
		<table class="subtitle" width="100%" cellspacing="0" cellpadding="0">
				<tr>
					<td width="100%"><h4><img src="images/history.gif" alt="History" align="top"> 15 Latest Histories</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_DATE; ?></td>
					<td valign="top"><?php echo TXT_TIME; ?></td>
					<td valign="top"><?php echo TXT_ACTION; ?></td>
					<td valign="top"><?php echo TXT_WHAT; ?></td>
					<td valign="top"><?php echo TXT_DESCRIPTION; ?></td>
					<td valign="top"><?php echo TXT_USER; ?></td>
				</tr>
			<?php
				$list1 = "list1"; 
				$list2 = "list2"; 
				$line_count = 0; 
				
				$request=mysql_query("SELECT * FROM $name_table_users_log ORDER BY id DESC LIMIT 15") 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 echo $tmp_request['date']; ?></td>
						<td valign="top"><?php echo $tmp_request['time']; ?></td>						
						<td valign="top"><?php echo $tmp_request['action']; ?></td>						
						<td valign="top"><?php echo $tmp_request['what']; ?></td>						
						<td valign="top"><?php echo $tmp_request['description']; ?></td>						
						<td valign="top"><?php 
              $request_user=mysql_query("SELECT username,administrator FROM $name_table_users WHERE id=$tmp_request[users_id]") or die ("ERROR!");
        			
        			while($tmp_request_user=mysql_fetch_array($request_user))
        			{
        				echo $tmp_request_user['username'];
        			}

            ?></td>						
					</tr>
				<?php	
						$line_count++;
				}
			?>	
			</table>			
		</td>		
	</tr>
</table>
Return current item: OpenDataCenter Network Management System