Location: PHPKode > projects > Electronic Design Automation - Index > eda-index-1.0MLH/web/viewitems.php
<?<?php
require("config.inc.php");
require("top.inc.php");

#########################################################################
# Electronic Design Automation - Index (EDA - Index)			#
#########################################################################
#									#
# Copyright (c) 2003 by Bruno Thomsen (hide@address.com)	#
# My Homepage: http://www.spacecave.dk/					#
# Project Homepage: http://eda-index.sourceforge.net/			#
# Project @ SourceForge.net: http://sourceforge.net/projects/eda-index/	#
# Project @ Freshmeat.net: http://freshmeat.net/projects/eda-index/	#
# Project Demo: http://eda-index.sourceforge.net/demo/			#
#									#
# This program 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.					#
#									#
# This program 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.				#
#									#
#########################################################################

?>

<?php
opendb($dbhost,$dbuser,$dbpass,$dbname);
$sql = "SELECT *,DATE_FORMAT(date,'$dateformat') as newdate FROM `$tabels[$type]` ORDER BY date DESC";
$result = getdata($sql);
$num_rows = mysql_num_rows($result);
?>

<center><h2>
<?php if ($num_rows == 0) { 
echo "($no $datatype2[$type] $found)";
} elseif ($num_rows == 1) {
echo "($num_rows $datatype1[$type] $found)";
} elseif ($num_rows > 1) {
echo "($num_rows $datatype2[$type] $found)";
}
if (!$pview) { ?>
&nbsp;<a href="<?php echo $path; ?>viewitems.php?type=<?php echo $type; ?>&amp;pview=1" target="pview"><img src="<?php echo $path; ?>images/pview.png" width="16" height="16" border="0" alt="<?php echo $pfview; ?>" title="<?php echo $pfview; ?>"/></a>
<?php } ?>
</h2></center>

<?php if ($num_rows > 0) { ?>
<map id="<?php echo $datatype3[$type]; ?>"><table cellpadding="2" cellspacing="1" border="<?php if ($pview) { echo "1"; } else { echo "0"; } ?>" align="center">
<tr bgcolor="<?php if ($pview) { echo "white"; } else { echo $thcolor1; } ?>">
<th width="100" align="center"><?php echo "$datatype3[$type] $nr"; ?></th>
<?php if ($type == 4) { ?>
<th width="295" align="left">&nbsp;<?php echo $description; ?></th>
<th width="100" align="center"><?php echo $pldtype; ?></th>
<?php } else { ?>
<th width="400" align="left">&nbsp;<?php echo $description; ?></th>
<?php } ?>
<?php if ($type == 1) { ?>
<th width="100" align="center"><?php echo "$datatype3[2] $ref"; ?></th>
<th width="100" align="center"><?php echo "$datatype3[3] $ref"; ?></th>
<?php } elseif ($type == 2) { ?>
<th width="100" align="center"><?php echo "$datatype3[1] $ref"; ?></th>
<th width="100" align="center"><?php echo "$datatype3[3] $ref"; ?></th>
<?php } elseif (($type == 3) || ($type == 4)) { ?>
<th width="100" align="center"><?php echo "$datatype3[1] $ref"; ?></th>
<th width="100" align="center"><?php echo "$datatype3[2] $ref"; ?></th>
<?php } ?>
<th width="150" align="center"><?php echo $createdby; ?></th>
<th width="100" align="center"><?php echo $date; ?></th>
</tr>
<?php } ?>

<?php
while ($data = mysql_fetch_array($result)) {

if ($rowcolor == "$rowcolor1") {
$rowcolor = "$rowcolor2";
} else {
$rowcolor = "$rowcolor1";
}
?>

<tr <?php if ($pview == 0) { ?>bgcolor="<?php echo $rowcolor; ?>" class='p2' onmouseover="TG(this,'<?php echo $rowhl; ?>')" onmouseout="TG(this,'<?php echo $rowcolor; ?>')"<?php } else { ?>bgcolor="white"<?php } ?>>
<td align="center"><?php if (!$pview) { if (!$data[12]) { ?><img src="<?php echo $path; ?>images/<?php echo $empty; ?>" width="16" height="16" border="0" alt="" title=""/><?php } else { ?><img src="<?php echo $path; ?>images/cad.png" width="16" height="16" border="0" alt="<?php echo $data[12]; ?>" title="<?php echo $data[12]; ?>"/><?php } } ?> <?php echo "$prefix[$type]$data[2]$data[3]"; ?></td>
<td align="left">&nbsp;<?php if (!$pview) { ?><a href="<?php echo $path; ?>edititem.php?type=<?php echo $type; ?>&amp;id=<?php echo $data[0]; ?>"><img src="<?php echo $path; ?>images/edit.png" width="20" height="16" border="0" alt="<?php echo $edit; ?>" title="<?php echo $edit; ?>"/></a><?php if ($del) { ?> <a href="<?php echo $path; ?>delete.php?type=<?php echo $type; ?>&amp;id=<?php echo $data[0]; ?>" target="delete"><img src="<?php echo $path; ?>images/delete.png" width="20" height="16" border="0" alt="<?php echo $delete; ?>" title="<?php echo $delete; ?>"/></a><?php } ?> <a href="<?php echo $path; ?>viewsingleproject.php?pid=<?php echo $data[1]; ?>"><?php if ($data[1] == 0) { ?><font color="<?php echo $prj0link; ?>"><?php echo $data[4]; ?></font><?php } else { echo $data[4]; } ?></a> <?php if ($data[11]) { ?><a href="<?php echo $path; ?>viewnote.php?type=<?php echo $type; ?>&amp;id=<?php echo $data[0]; ?>" target="note"><img src="<?php echo $path; ?>images/note.png" width="19" height="16" border="0" alt="<?php echo "$note: $data[11]"; ?>" title="<?php echo "$note: $data[11]"; ?>"/></a><?php } } else { echo $data[4]; } ?></td>
<?php if ($type == 4) { ?>
<td align="center"><?php echo $data[13]; ?></td>
<?php } else { } ?>
<?php if (empty($data[5])) { ?>
<td align="center"><?php echo $none; ?></td>
<?php } else { ?>
<?php if ($type == 1) { ?>
<td align="center"><?php echo "$prefix[2]$data[5]$data[6]"; ?></td>
<?php } elseif (($type == 2) || ($type == 3) || ($type == 4)) { ?>
<td align="center"><?php echo "$prefix[1]$data[5]$data[6]"; ?></td>
<?php } } ?>
<?php if (empty($data[7])) { ?>
<td align="center"><?php echo $none; ?></td>
<?php } else {
if ($type == 1) { ?>
<td align="center"><?php echo "$prefix[3]$data[7]$data[8]"; ?></td>
<?php } elseif ($type == 2) { ?>
<td align="center"><?php echo "$prefix[3]$data[7]$data[8]"; ?></td>
<?php } elseif (($type == 3) || ($type == 4)) { ?>
<td align="center"><?php echo "$prefix[2]$data[7]$data[8]"; ?></td>
<?php } } ?>
<td align="center"><?php echo $data[9]; ?></td>
<?php if ($type == 4) { ?>
<td align="center"><?php echo $data[14]; ?></td>
<?php } else { ?>
<td align="center"><?php echo $data[13]; ?></td>
<?php } ?>
</tr>

<?php
} closedb();
?>

<?php if ($num_rows > 0) { ?>
</table></map><br/>
<?php } ?>

<?<?php
require("bottom.inc.php");
?>
Return current item: Electronic Design Automation - Index