Permalink
Browse files

status icons in racks

  • Loading branch information...
1 parent afbc043 commit 1f540215b47ac9baf838c0d0f2097ce0a3b2b37b Spiros Ioannou committed Apr 2, 2012
Showing with 11 additions and 2 deletions.
  1. BIN data/pure.db
  2. +1 −0 init.php
  3. +10 −2 php/viewrack.php
View
Binary file not shown.
View
@@ -380,6 +380,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
@@ -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 1f54021

Please sign in to comment.