Location: PHPKode > projects > OpenDataCenter Network Management System > include/mainview_page/manufacturer/view.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/
// ----------------------------------------------------------------------
?>
<?php
$request=mysql_query("SELECT * FROM $name_table_manufacturer WHERE id=\"$id\"") or die ("ERROR!");

while($tmp_request=mysql_fetch_array($request))
{
$manufacturer_name = $tmp_request['name'];
?>
<table class="subtitle" width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td width="80%"><h4><img src="images/manufacturer.gif" alt="manufacturer" align="top"> <?php echo $tmp_request['name']; ?></h4></td>
		<td width="10%" style="text-align:right">[ <a href="index.php?include=mainview&page=manufacturer&action=edit&id=<?php echo $id; ?>"><?php echo TXT_EDIT; ?></a> ]</td>
		<td width="10%" style="text-align:right">[ <a href="index.php?include=mainview&page=manufacturer&action=delete&id=<?php echo $id; ?>"><?php echo TXT_DELETE; ?></a> ]</td>
	<tr>
</table>
<table class="list" width="100%" cellspacing="2" cellpadding="3">
	<tr class="list_title">
		<td width="100%" style="font-weight:normal;"><b><?php echo TXT_DESCRIPTION; ?>:</b> <?php echo $tmp_request['description']; ?></td>
	</tr>
</table>

<table class="subtitle" width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td width="90%"><h4><img src="images/model.gif" alt="model" align="top"> <?php echo TXT_ALL; ?> "<?php echo $manufacturer_name; ?>" <?php echo TXT_MODELS; ?></h4></td>
		<td width="10%" style="text-align:right">[ <a href="index.php?include=mainview&page=model&action=add"><?php echo TXT_ADD; ?></a> ]</td>
	<tr>
</table>
<table class="sortable list" id="sortable" width="100%" cellspacing="2" cellpadding="3">
	<tr class="list_title">
		<td width="10%" valign="top"><?php echo TXT_NAME; ?></td>
		<td width="10%" valign="top"><?php echo TXT_CATEGORY; ?></td>
		<td width="10%" valign="top"><?php echo TXT_HEIGHT; ?></td>
		<td width="40%" valign="top"><?php echo TXT_DESCRIPTION; ?></td>
		<td width="12%" 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_model WHERE manufacturer_id=$id") or die ("ERROR!");

	while($tmp_request=mysql_fetch_array($request))
	{
		$line_color = ($line_count % 2) ? $list1 : $list2;
	?>
		<tr class="<?php echo "$line_color"; ?>">
			<td width="10%" valign="top"><?php print("<a href=\"index.php?include=mainview&page=model&action=view&id=$tmp_request[id]\">$tmp_request[name]</a>"); ?></td>
			<td width="10%" valign="top"><?php 
			$request3=mysql_query("SELECT id,name FROM $name_table_category WHERE id=$tmp_request[category_id]") or die ("ERROR!");

			while($tmp_request3=mysql_fetch_array($request3))
			{
				echo "<a href=\"index.php?include=mainview&page=category&action=view&id=$tmp_request3[id]\">$tmp_request3[name]</a>";
			}
			?></td>
			<td width="10%" valign="top"><?php echo $tmp_request['height']." U"; ?></td>
			<td width="40%" valign="top"><?php echo $tmp_request['description']; ?></td>
			<td width="12%" valign="top">[ <?php print("<a href=\"index.php?include=mainview&page=model&action=edit&id=$tmp_request[id]\">".TXT_EDIT."</a>"); ?> ] [ <?php print("<a href=\"index.php?include=mainview&page=model&action=delete&id=$tmp_request[id]\">".TXT_DELETE."</a>"); ?> ]</td>	
		</tr>
	<?php	
			$line_count++;
	}
?>	
</table>	

<br><center><a href="javascript:history.go(-1);"><?php echo TXT_BACK; ?></a></center>
<?php
}
?>
Return current item: OpenDataCenter Network Management System