"; } if(!$result = mysql_query($query, $connection)) { echo mysql_errno() . " " . mysql_error(); exit; } return $result; } /*********************************************************************************************************** ** function getHostInfo(): ************************************************************************************************************/ function getHostInfo($id) { $sql = "select name, address, os, serial, type from hosts where id = '$id'"; $result = execsql($sql); $row = mysql_fetch_array($result); return $row; } /*********************************************************************************************************** ** function getServiceInfo(): ************************************************************************************************************/ function getServiceInfo($id) { $sql = "select name from services where id = '$id'"; $result = execsql($sql); $row = mysql_fetch_array($result); return $row; } /*********************************************************************************************************** ** function getInterfaceInfo(): ************************************************************************************************************/ function getInterfaceInfo($id) { $sql = "select name from interfaces where id = '$id'"; $result = execsql($sql); $row = mysql_fetch_array($result); return $row; } /*********************************************************************************************************** ** function getHostServices(): ************************************************************************************************************/ function getHostServices($id) { $sql = "select services.id, services.name from services left join host_service on host_service.service_id = services.id where host_service.host_id = '$id'"; $result = execsql($sql); while ($row = mysql_fetch_array($result)) $services[] = $row; return $services; } /*********************************************************************************************************** ** function getHostInterfaces(): ************************************************************************************************************/ function getHostInterfaces($id) { $sql = "select interfaces.id, interfaces.name from interfaces left join host_interface on host_interface.interface_id = interfaces.id where host_interface.host_id = '$id'"; $result = execsql($sql); while ($row = mysql_fetch_array($result)) $interfaces[] = $row; return $interfaces; } /*********************************************************************************************************** ** function debug(): ************************************************************************************************************/ function debug($debug) { echo '
'.$debug.'
'; } ?>