$connList = $powerConn->GetConnectionsByPDU(); $tooltip .= __($row["Label"]) . ": " . count($connList) . "/" . ($template->NumOutlets + 1) . "<br>\n"; break; case "Uptime": $tooltip .= __($row["Label"]) . ": " . $pdu->GetSmartCDUUptime() . "<br>\n"; break; case "PanelID": $pan = new PowerPanel(); $pan->PanelID = $pdu->PanelID; $pan->GetPanel(); $tooltip .= __($row["Label"]) . ": {$pan->PanelLabel}<br>\n"; break; case "PanelVoltage": $pan = new PowerPanel(); $pan->PanelID = $pdu->PanelID; $pan->GetPanel(); $tooltip .= __($row["Label"]) . ": " . $pan->PanelVoltage . " / " . intval($pan->PanelVoltage / 1.73) . "<br>\n"; break; case "PanelPole": $tooltip .= __($row["Label"]) . ": " . $pdu->GetAllBreakerPoles() . "<br>\n"; break; case "PrimaryContact": $pc = new People(); $pc->PersonID = $dev->PrimaryContact; if ($pc->PersonID > 0) { $pc->GetPerson(); $tooltip .= __($row["Label"]) . ": " . $pc->LastName . ", " . $pc->FirstName . "<br>\n"; } else { $tooltip .= __($row["Label"]) . ": " . __("Unassigned") . "<br>\n"; } break;
<?php require_once "../db.inc.php"; require_once "../facilities.inc.php"; $pnl = new PowerPanel(); $searchTerm = ""; if (isset($_REQUEST["q"])) { $searchTerm = $_REQUEST["q"]; } //This will ensure that an empty json record set is returned if this is called directly or in some strange manner if ($searchTerm != "") { $pnl->PanelID = $searchTerm; $pnl->GetPanel(); } header('Content-Type: application/json'); echo json_encode($pnl);