Skip to content
Browse files

merging

  • Loading branch information...
2 parents 532dabd + b344ed2 commit d7753609ed8eb99f2539eba94d367f5102468f1a Spiros Ioannou committed Apr 2, 2012
Showing with 11 additions and 2 deletions.
  1. +1 −0 init.php
  2. +10 −2 php/viewrack.php
View
1 init.php
@@ -381,6 +381,7 @@ function getstatusidofitem($itemid,$dbh)
}
+/* return css and title based on item status */
function attrofstatus($statusid,$dbh)
{
$sql="SELECT * from statustypes WHERE id='$statusid'";
View
12 php/viewrack.php
@@ -119,20 +119,28 @@
function printitemcell($rr,$depth) {
global $rackrow,$items,$scriptname,$_GET;
+ global $dbh;
+
$dns=$items[$rackrow[$rr][$depth]]['dnsname'];
$label=$items[$rackrow[$rr][$depth]]['label'];
$dr=explode(".",$dns); if(count($dr)) $dr=$dr[0];
+ $itemid=$items[$rackrow[$rr][$depth]]['id'];
+
$mixlabel=" ";
if (strlen($label)) $mixlabel=" $label ";
if (strlen($dr))
$mixlabel.=" [DNS:$dr]";
+ $sid=getstatusidofitem($itemid,$dbh);
+ $x=attrofstatus($sid,$dbh);
+ $attr=$x[0];
+ $statustxt=$x[1];
- return "<a href='$scriptname?action=edititem&amp;id={$rackrow[$rr][$depth]}'>".
+ return "<span $attr>&nbsp;</span>&nbsp;<a href='$scriptname?action=edititem&amp;id={$rackrow[$rr][$depth]}'>".
$items[$rackrow[$rr][$depth]]['agtitle']." ".
$items[$rackrow[$rr][$depth]]['model']." ".
- " [ID:".$items[$rackrow[$rr][$depth]]['id']."]".
+ " [ID:$itemid]".
$mixlabel.
"</a>";
}

0 comments on commit d775360

Please sign in to comment.
Something went wrong with that request. Please try again.