Location: PHPKode > projects > Electronic Design Automation - Index > eda-index-1.0MLH/web/viewprojects.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[0]` ORDER BY date DESC";
$result = getdata($sql);
$num_rows = mysql_num_rows($result);
?>

<center><h2>
<?php if ($num_rows == 0) { 
echo "($no $datatype2[0] $found)";
} elseif ($num_rows == 1) {
echo "($num_rows $datatype1[0] $found)";
} elseif ($num_rows > 1) {
echo "($num_rows $datatype2[0] $found)";
}
if (!$pview) { ?>
 <a href="<?php echo $path; ?>addproject.php"><img src="<?php echo $path; ?>images/0_small.png" width="16" height="16" border="0" alt="<?php echo "$createnew $datatype1[0]"; ?>" title="<?php echo "$createnew $datatype1[0]"; ?>"/></a> <a href="<?php echo $path; ?>viewprojects.php?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="projects"><table cellpadding="2" cellspacing="1" border="<?php if ($pview == 1) { echo "1"; } else { echo "0"; } ?>" align="center">
<tr bgcolor="<?php if ($pview == 0) { echo $thcolor2; } else { echo white; } ?>">
<th width="400" align="left">&nbsp;<?php echo $description; ?></th>
<th width="150" align="center"><?php echo $createdby; ?></th>
<th width="100" align="center"><?php echo $date; ?></th>
<?php if (!$pview) { ?>
<th width="100" align="center"><?php echo "$add $items"; ?></th>
<?php } ?>
</tr>
<?php } ?>
<?php $rowcolor = ""; ?>

<?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="left">&nbsp;<?php if ($pview == 0) { ?><a href="<?php echo $path; ?>editproject.php?pid=<?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?pid=<?php echo $data[0]; ?>&amp;type=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[0]; ?>"><?php echo $data[1]; ?></a> <?php if ($data[4]) { ?><a href="<?php echo $path; ?>viewnote.php?type=0&amp;pid=<?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[4]"; ?>" title="<?php echo "$note: $data[4]"; ?>"/></a><?php } } else { echo $data[1]; } ?></td>
<td align="center"><?php echo $data[2]; ?></td>
<td align="center"><?php echo $data[5]; ?></td>
<?php if (!$pview) { ?>
<td valign="top" align="center">
<a href="<?php echo $path; ?>additem.php?pid=<?php echo $data[0]; ?>&amp;type=1"><img src="<?php echo $path; ?>images/1_small.png" width="16" height="16" alt="<?php echo "$add $datatype1[1]"; ?>" title="<?php echo "$add $datatype1[1]"; ?>" border="0"/></a>
<a href="<?php echo $path; ?>additem.php?pid=<?php echo $data[0]; ?>&amp;type=2"><img src="<?php echo $path; ?>images/2_small.png" width="16" height="16" alt="<?php echo "$add $datatype1[2]"; ?>" title="<?php echo "$add $datatype1[2]"; ?>" border="0"/></a>
<a href="<?php echo $path; ?>additem.php?pid=<?php echo $data[0]; ?>&amp;type=3"><img src="<?php echo $path; ?>images/3_small.png" width="16" height="16" alt="<?php echo "$add $datatype1[3]"; ?>" title="<?php echo "$add $datatype1[3]"; ?>" border="0"/></a>
<a href="<?php echo $path; ?>additem.php?pid=<?php echo $data[0]; ?>&amp;type=4"><img src="<?php echo $path; ?>images/4_small.png" width="16" height="16" alt="<?php echo "$add $datatype1[4]"; ?>" title="<?php echo "$add $datatype1[4]"; ?>" border="0"/></a>
</td>
<?php } ?>
</tr>

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

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