Location: PHPKode > projects > Electronic Design Automation - Index > eda-index-1.0MLH/web/viewsingleproject.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.				#
#									#
#########################################################################

?>

<center>
<?php if ($pid == 0) { ?>
<h2><?php echo $project; ?></h2>
<?php }
opendb($dbhost,$dbuser,$dbpass,$dbname);
$sql = "SELECT *,DATE_FORMAT(date,'$dateformat') as newdate FROM `$tabels[0]` WHERE `pid` = '$pid'";
$result = getdata($sql);
while ($data = mysql_fetch_array($result)) {
?>

<h2><b><?php echo $data[1]; ?></b></h2><h3><?php echo "$data[2] - $data[5]"; ?></h3>

<?php if (!$pview) { ?>
<map id="projectbar"><table cellpadding="1" cellspacing="10" border="0" align="center">
<tr><td>
<?php if ($pid > 0) { ?>
<a href="<?php echo $path; ?>editproject.php?pid=<?php echo $pid; ?>"><img src="<?php echo $path; ?>images/edit.png" width="20" height="16" border="0" alt="<?php echo "$edit $datatype1[0]"; ?>" title="<?php echo "$edit $datatype1[0]"; ?>" /></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 } } ?>
<a href="<?php echo $path; ?>viewsingleproject.php?pid=<?php echo $data[0]; ?>&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>
</td>
<td>
<a href="<?php echo $path; ?>additem.php?type=1&amp;pid=<?php echo $pid; ?>"><img src="<?php echo $path; ?>images/1_small.png" width="16" height="16" border="0" alt="<?php echo "$add $datatype1[1] $to $datatype1[0]"; ?>" title="<?php echo "$add $datatype1[1] $to $datatype1[0]"; ?>" /></a>
 <a href="<?php echo $path; ?>additem.php?type=2&amp;pid=<?php echo $pid; ?>"><img src="<?php echo $path; ?>images/2_small.png" width="16" height="16" border="0" alt="<?php echo "$add $datatype1[2] $to $datatype1[0]"; ?>" title="<?php echo "$add $datatype1[2] $to $datatype1[0]"; ?>" /></a>
 <a href="<?php echo $path; ?>additem.php?type=3&amp;pid=<?php echo $pid; ?>"><img src="<?php echo $path; ?>images/3_small.png" width="16" height="16" border="0" alt="<?php echo "$add $datatype1[3] $to $datatype1[0]"; ?>" title="<?php echo "$add $datatype1[3] $to $datatype1[0]"; ?>" /></a>
 <a href="<?php echo $path; ?>additem.php?type=4&amp;pid=<?php echo $pid; ?>"><img src="<?php echo $path; ?>images/4_small.png" width="16" height="16" border="0" alt="<?php echo "$add $datatype1[4] $to $datatype1[0]"; ?>" title="<?php echo "$add $datatype1[4] $to $datatype1[0]"; ?>" /></a>
</td></tr>
</table></map>
<?php } } closedb(); ?>
</center>

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

<center><h2>
<?php if ($num_rows == 0) { 
} elseif ($num_rows == 1) {
echo "($num_rows $datatype1[$type] $found)";
} elseif ($num_rows > 1) {
echo "($num_rows $datatype2[$type] $found)";
} ?>
</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 } ?> <?php if ($data[1] == 0) { ?><font color="<?php echo $prj0link; ?>"><?php echo $data[4]; ?></font><?php } else { echo $data[4]; } ?> <?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 } $type++; } ?>

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