".$lang_label["del_server_ok"].""; else echo "

".$lang_label["del_server_no"]."

"; } if (isset($_GET["update"])) { $name=entrada_limpia($_POST["name"]); $address=entrada_limpia($_POST["address"]); $description=entrada_limpia($_POST["description"]); $id_server=entrada_limpia($_POST["server"]); $sql = "UPDATE tserver SET name='".$name."', ip_address='".$address."', description='".$description."' WHERE id_server='".$id_server."'"; $result=mysql_query($sql); if ($result) echo "

".$lang_label["upd_server_ok"]."

"; else echo "

".$lang_label["upd_server_no"]."

"; } if (isset($_GET["server"])) { $id_server=entrada_limpia($_GET["server"]); echo "

".$lang_label["view_servers"]."

"; echo "

".$lang_label["update_server"]." ".$lang_label["help"]."

"; $query="SELECT * FROM tserver WHERE id_server=".$id_server; $result=mysql_query($query); if (mysql_num_rows($result)){ $row=mysql_fetch_array($result); $name = $row["name"]; $address = $row["ip_address"]; $status = $row["status"]; $laststart = $row["laststart"]; $keepalive = $row["keepalive"]; $network_server = $row["network_server"]; $data_server = $row["data_server"]; $snmp_server = $row["snmp_server"]; $master = $row["master"]; $checksum = $row["checksum"]; $description = $row["description"]; echo '
'; echo ""; echo "'; echo '
"; echo "".$lang_label["name"].""; echo "
".$lang_label['ip_address'].""; echo "
".$lang_label['description']."'.$lang_label["no_server"].''; } echo '
'; echo '
'; } else { $sql='SELECT * FROM tserver'; echo "

".$lang_label["view_servers"]."

"; echo "

".$lang_label["manage_servers"]." ".$lang_label["help"]."

"; // Connect DataBase $result=mysql_query($sql); if (mysql_num_rows($result)){ echo ""; echo "
".$lang_label["name"]; echo "".$lang_label['status']; echo "".$lang_label['ip_address']; echo "".$lang_label['description']; echo "".$lang_label['network']; echo "".$lang_label['data']; echo "".$lang_label['snmp']; echo "".$lang_label['master']; echo "".$lang_label['checksum']; echo "".$lang_label['laststart']; echo "".$lang_label['lastupdate']; echo "".$lang_label['action']; $color=1; while ($row=mysql_fetch_array($result)){ $name = $row["name"]; $address = $row["ip_address"]; $status = $row["status"]; $laststart = $row["laststart"]; $keepalive = $row["keepalive"]; $network_server = $row["network_server"]; $data_server = $row["data_server"]; $snmp_server = $row["snmp_server"]; $master = $row["master"]; $checksum = $row["checksum"]; $description = $row["description"]; $id_server = $row["id_server"]; if ($color == 1){ $tdcolor = "datos"; $color = 0; } else { $tdcolor = "datos2"; $color = 1; } echo "
"; echo "$name"; echo ""; if ($status ==0){ echo ""; } else { echo ""; } echo ""; echo "$address"; echo "".substr($description,0,25); echo ""; if ($network_server == 1){ echo ""; } echo ""; if ($data_server == 1){ echo ""; } echo ""; if ($snmp_server == 1){ echo ""; } echo ""; if ($master == 1){ echo ""; } echo ""; if ($checksum == 1){ echo ""; } echo "".substr($keepalive,0,25); echo "".substr($laststart,0,25); echo " "; } echo '
'; } else { echo ''.$lang_label["no_server"].''; } } } else { audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Agent view"); require ("general/noaccess.php"); } } ?>