'.__('Server deleted successfully').''; } else { echo '

'.__('There was a problem deleting the server').'

'; } } elseif (isset($_GET["update"])) { $name = get_parameter_post ("name"); $address = get_parameter_post ("address"); $description = get_parameter_post ("description"); $id_server = get_parameter_post ("server"); $sql = sprintf ("UPDATE tserver SET name = '%s', ip_address = '%s', description = '%s' WHERE id_server = %d", $name, $address, $description, $id_server); $result = process_sql ($sql); if ($result !== false) { echo '

'.__('Server updated successfully').'

'; } else { echo '

'.__('There was a problem updating the server').'

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

".__('Pandora servers')." > ".__('Update Server')."

"; $sql = sprintf("SELECT name, ip_address, description FROM tserver WHERE id_server = %d",$id_server); $row = get_db_row_sql ($sql); echo '
'; print_input_hidden ("server",$id_server); $table->cellpadding=4; $table->cellspacing=4; $table->width=450; $table->class="databox_color"; $table->data[] = array (__('Name'),print_input_text ('name',$row["name"],'',50,0,true)); $table->data[] = array (__('IP Address'),print_input_text ('address',$row["ip_address"],'',50,0,true)); $table->data[] = array (__('Description'),print_input_text ('description',$row["description"],'',50,0,true)); print_table ($table); echo '
'; echo ''; echo "
"; } else { $result = get_db_all_rows_in_table ("tserver"); echo "

".__('Pandora servers')." > ".__('Manage servers')."

"; if ($result !== false) { $table->cellpadding = 4; $table->cellspacing = 4; $table->width = "90%"; $table->class = "databox"; $table->align = array ('',"center","center","center","center","center","center","center"); $table->head = array (__('Name'),__('Status'),__('IP Address'),__('Description'),__('Type'),__('Started'),__('Updated'),__('Delete')); foreach ($result as $row) { $server = ""; if($row["network_server"] == 1) { $server .= ' '; } if ($row["data_server"] == 1) { $server .= ' '; } if ($row["snmp_server"] == 1) { $server .= ' '; } if ($row["master"] == 1) { $server .= ' '; } if ($row["checksum"] == 1) { $server .= ' '; } $table->data[] = array ( ''.$row["name"].'', '', $row["ip_address"], substr($row["description"],0,25), $server, human_time_comparation ($row["laststart"]), human_time_comparation ($row["keepalive"]), '' ); } print_table ($table); //Legend echo ""; echo ""; echo ''; echo ''; echo ''; echo ''; echo ''; echo "
'.__('Network Server').''.__('Master').''.__('Data Server').''.__('MD5 Check').''.__('SNMP Console').'
"; } else { echo "
".__('There are no servers configured into the database')."
"; } } ?>