本文整理汇总了PHP中NetworkPort::getfield方法的典型用法代码示例。如果您正苦于以下问题:PHP NetworkPort::getfield方法的具体用法?PHP NetworkPort::getfield怎么用?PHP NetworkPort::getfield使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetworkPort
的用法示例。
在下文中一共展示了NetworkPort::getfield方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configureNodesLinks
//.........这里部分代码省略.........
$networkPort->getFromDB($oppositeports_id);
$a_nodes = $pmWeathermapnode->find("
`plugin_monitoring_weathermaps_id`='".$weathermaps_id."'
AND `itemtype`='".$networkPort->fields['itemtype']."'
AND `items_id`='".$networkPort->fields['items_id']."'", "", 1);
if (count($a_nodes) > 0) {
$a_node = current($a_nodes);
$queryl = "SELECT `plugin_monitoring_weathermapnodes_id_1`
FROM `glpi_plugin_monitoring_weathermaplinks`
LEFT JOIN `glpi_plugin_monitoring_weathermapnodes`
ON `glpi_plugin_monitoring_weathermapnodes`.`id` = `plugin_monitoring_weathermapnodes_id_1`
WHERE ((`plugin_monitoring_weathermapnodes_id_1`='".$data['id']."'
AND `plugin_monitoring_weathermapnodes_id_2`='".$a_node['id']."')
OR (`plugin_monitoring_weathermapnodes_id_1`='".$a_node['id']."'
AND `plugin_monitoring_weathermapnodes_id_2`='".$data['id']."'))
AND `plugin_monitoring_weathermaps_id` = '".$weathermaps_id."'";
$resultl = $DB->query($queryl);
if ($DB->numrows($resultl) == '0') {
$device_connected = $pmWeathermapnode->getNodeName($a_node['id']);
}
}
}
}
}
}
}
}
}
if ($device_connected == '') {
$networkPort->getFromDB($data['networkports_id']);
$elements2[$data['id']."-".$data['services_id']] = $name." [".$networkPort->getfield('name')."] (".$data['components_name'].")";
} else {
$networkPort->getFromDB($data['networkports_id']);
$elements[$data['id']."-".$data['services_id']] = $name." [".$networkPort->getfield('name')."] (".$data['components_name'].") > ".$device_connected;
}
}
if (count($elements) > 1
AND count($elements2) > 0) {
$elements = array_merge($elements,array('0'=>Dropdown::EMPTY_VALUE));
$elements = array_merge($elements, $elements2);
} else {
$elements = array_merge($elements, $elements2);
}
Dropdown::showFromArray('linksource', $elements);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>";
echo __('Destination', 'monitoring')." :";
echo "</td>";
echo "<td>";
echo "<div id='nodedestination'>";
$query = "SELECT * FROM `".getTableForItemType("PluginMonitoringWeathermapnode")."`
WHERE `plugin_monitoring_weathermaps_id`='".$weathermaps_id."'
ORDER BY `name`";
$result = $DB->query($query);
示例2: configureNodesLinks
//.........这里部分代码省略.........
if (count($a_nodes) > 0) {
$a_node = current($a_nodes);
$device_connected = $pmWeathermapnode->getNodeName($a_node['id']);
}
}
}
}
if ($device_connected == '' and class_exists("PluginFusinvsnmpNetworkPort")) {
$queryn = "SELECT `glpi_networkports`.`id` FROM `glpi_plugin_fusinvsnmp_networkports`\n \n LEFT JOIN `glpi_networkports`\n ON `glpi_networkports`.`id`=`networkports_id`\n \n WHERE `itemtype`='" . $itemtype . "'\n AND `items_id`='" . $data['items_id'] . "'\n AND `ifdescr`='" . $argument . "'";
$resultn = $DB->query($queryn);
while ($pdata = $DB->fetch_array($resultn)) {
if ($device_connected == '') {
$oppositeports_id = $networkPort->getContact($pdata['id']);
if ($oppositeports_id) {
$networkPort->getFromDB($oppositeports_id);
$a_nodes = $pmWeathermapnode->find("\n `plugin_monitoring_weathermaps_id`='" . $weathermaps_id . "'\n AND `itemtype`='" . $networkPort->fields['itemtype'] . "'\n AND `items_id`='" . $networkPort->fields['items_id'] . "'", "", 1);
if (count($a_nodes) > 0) {
$a_node = current($a_nodes);
$queryl = "SELECT `plugin_monitoring_weathermapnodes_id_1`\n FROM `glpi_plugin_monitoring_weathermaplinks`\n\n LEFT JOIN `glpi_plugin_monitoring_weathermapnodes`\n ON `glpi_plugin_monitoring_weathermapnodes`.`id` = `plugin_monitoring_weathermapnodes_id_1`\n\n WHERE ((`plugin_monitoring_weathermapnodes_id_1`='" . $data['id'] . "'\n AND `plugin_monitoring_weathermapnodes_id_2`='" . $a_node['id'] . "')\n OR (`plugin_monitoring_weathermapnodes_id_1`='" . $a_node['id'] . "'\n AND `plugin_monitoring_weathermapnodes_id_2`='" . $data['id'] . "'))\n AND `plugin_monitoring_weathermaps_id` = '" . $weathermaps_id . "'";
$resultl = $DB->query($queryl);
if ($DB->numrows($resultl) == '0') {
$device_connected = $pmWeathermapnode->getNodeName($a_node['id']);
}
}
}
}
}
}
}
}
}
if ($device_connected == '') {
$networkPort->getFromDB($data['networkports_id']);
$elements2[$data['id'] . "-" . $data['services_id']] = $name . " [" . $networkPort->getfield('name') . "] (" . $data['components_name'] . ")";
} else {
$networkPort->getFromDB($data['networkports_id']);
$elements[$data['id'] . "-" . $data['services_id']] = $name . " [" . $networkPort->getfield('name') . "] (" . $data['components_name'] . ") > " . $device_connected;
}
}
if (count($elements) > 1 and count($elements2) > 0) {
$elements = array_merge($elements, array('0' => Dropdown::EMPTY_VALUE));
$elements = array_merge($elements, $elements2);
} else {
$elements = array_merge($elements, $elements2);
}
Dropdown::showFromArray('linksource', $elements);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>";
echo __('Destination', 'monitoring') . " :";
echo "</td>";
echo "<td>";
echo "<div id='nodedestination'>";
$query = "SELECT * FROM `" . getTableForItemType("PluginMonitoringWeathermapnode") . "`\n WHERE `plugin_monitoring_weathermaps_id`='" . $weathermaps_id . "'\n ORDER BY `name`";
$result = $DB->query($query);
$elements = array();
$elements[0] = Dropdown::EMPTY_VALUE;
$result = $DB->query($query);
while ($data = $DB->fetch_array($result)) {
$itemtype = $data['itemtype'];
$item = new $itemtype();
$item->getFromDB($data['items_id']);
$name = $data['name'];
if ($name == '') {
$name = $item->getName();