'.__('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,$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); $table->cellpadding=4; $table->cellspacing=4; $table->width=450; $table->align=array ("right"); $table->data[] = array (''); print_table ($table2); } 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 at'),__('Updated at'),__('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, $LOCALE->fmt_time($row["laststart"],"MYSQL","DATE").' '.$LOCALE->fmt_time($row["laststart"],"MYSQL","TIME"), $LOCALE->fmt_time($row["keepalive"],"MYSQL","DATE").' '.$LOCALE->fmt_time($row["keepalive"],"MYSQL","TIME"), '' ); } print_table ($table); //Lagend $table->cellpadding = 2; $table->cellspacing = 0; $table->data[] = array ( ''.__('Network Server').'', ''.__('Master').'', ''.__('Data Server').'', ''.__('MD5 Check').'', ''.__('SNMP Console').'' ); print_table ($table); } else { echo "
".__('There are no servers configured into the database')."
"; } } ?>