diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index b6a8142245..0712fb8c97 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,105 @@ +2008-06-26 Esteban Sanchez + + * ajax.php: Sed id_user in config array. + + * godmode/menu.php, general/header.php, operation/menu.php: Replaced + lang_label with lang_string(). + + * general/logon_ok.php: Reduced one indentation level. + + * godmode/agentes/agent_manager.php: Replaced lang_label with + lang_string(). Use pandora functions. + + * include/functions_html.php, godmode/agentes/configurar_agente.php: + Tab and blankspaces style correction. + + * godmode/reporting/map_builder.php: Complete rewritten to provide an + intuitive way of build the maps. It's cool, useful and very simple. + + * godmode/reporting/reporting_builder.php: Deleted an output debug. + + * godmode/setup/setup.php: Rewritten to use pandora functions. Added a + colorpicker for color settings. + + * include/config.php: Reset pandora password. We must solve things + with this file... + + * include/functions.php: Check if input is an array on safe_input(). + Use filename as id in array returned by list_files(). + + * include/functions_db.php: Renamed return_coordinate_* functions. + Style correction. + + * include/javascript/jquery.js: Updated to 1.2.6. + + * include/javascript/jquery.ui.datepicker.js: Code minimized. + + * include/javascript/pandora.js: Style correction. + + * include/javascript/wz_jsgraphics.js: Added a class to the elements + of a line, so it can be modified using javascript. + + * /include/styles/pandora.css: Added style to some tables dropdowns. + Added new styles relative to visual map editor. + + * operation/reporting/reporting_viewer.php: Style correction. Added + jQuery UI. + + * operation/visual_console/index.php: Use Pandora functions. + + * operation/visual_console/render_view.php: Drawing the map is now on + functions_visual_map.php. Added a countdown if a refresh time is set. + Use pandora functions. Style correction. + + * reporting/fgraph.php: Style correction. Use graphic_error() if + there's no data on grafico_modulo_sparse(). + + * images/trash.png: Added to repository. Image used on trash area on + visual map editor. + + * images/console/background/africa.jpg, + images/console/background/asia.jpg, + images/console/background/europe.jpg, + images/console/background/north_america.jpg, + images/console/background/oceania.jpg, + images/console/background/shouth_america.jpg, + images/console/background/world.jpg: Added to repository. Useful and + cool map backgrounds. + + * include/functions_visual_map.php: Added to repository. Implements + visual map functions like drawing the map. + + * include/javascript/jquery.colorpicker.js: Added to repository. + Implements a color picker widget. + + * /include/javascript/jquery.countdown.js: Added to repository. + Implements a countdown widget. + + * include/javascript/jquery.ui.core.js: Added to repository. jQuery UI + core. + + * include/javascript/jquery.ui.draggable.js: Added to repository. + jQuery draggable plugin. + + * include/javascript/jquery.ui.droppable.js: Added to repository. + jQuery droppable plugin. + + * include/javascript/pandora_visual_console.js: Added to repository. + Function useful to visual map interface. + + * include/languages/countdown_*.js: Added to repository. Countdown + localization. + + * include/languages/date_es_la.js, include/languages/date_gl.js, + include/languages/time_es_la.js, include/languages/time_gl.js: Added + to repository. Missing localizations. + + * include/styles/color-picker.css: Added to repository. Colorpicker + style sheet. + + * include/styles/countdown.css: Added to repository. Countdown style + sheet. + 2008-06-24 Sancho Lerena * include/functions_db.php: Fixed typo. diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php index 38f4075a98..679da88676 100644 --- a/pandora_console/ajax.php +++ b/pandora_console/ajax.php @@ -47,6 +47,7 @@ define ('AJAX', true); $page = (string) get_parameter ('page'); $page .= '.php'; +$config["id_user"] = $_SESSION["id_usuario"]; session_write_close (); if (file_exists ($page)) { $id_user = $_SESSION["id_usuario"]; diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index cb7f0d4482..5209d6ee46 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -35,12 +35,12 @@ if (isset ($_SESSION["id_usuario"])){ echo " "; else echo " "; - echo "".$lang_label["has_connected"]. ' + echo "".lang_string ("has_connected"). ' ['. $_SESSION["id_usuario"]. ']'; // Second column echo ""; - echo " ". $lang_label["information"].""; + echo " ". lang_string ("information").""; // Third column echo ""; @@ -53,7 +53,7 @@ if (isset ($_SESSION["id_usuario"])){ echo ""; - echo " ". $lang_label["logout"].""; + echo " ". lang_string ("logout").""; echo ""; $server_status = check_server_status (); diff --git a/pandora_console/general/logon_ok.php b/pandora_console/general/logon_ok.php index a1b1e887fd..367f5b8dad 100644 --- a/pandora_console/general/logon_ok.php +++ b/pandora_console/general/logon_ok.php @@ -17,180 +17,186 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - require("include/functions_reporting.php"); - - echo "
"; - $nick = $_SESSION['id_usuario']; - echo "

" . $lang_label["welcome_title"] . "

"; - echo "

"; - echo $lang_label["main_text"]; - echo "

"; +require("include/functions_reporting.php"); - // Private messages pending to read ! +echo "
"; +$nick = $_SESSION['id_usuario']; +echo "

" . $lang_label["welcome_title"] . "

"; +echo "

"; +echo $lang_label["main_text"]; +echo "

"; - $sql='SELECT COUNT(*) FROM tmensajes WHERE id_usuario_destino="'.$nick.'" - AND estado="FALSE";'; - $resultado = mysql_query ($sql); - $row = mysql_fetch_array ($resultado); - if ($row["COUNT(*)"] != 0){ - echo "

". $lang_label["new_message_bra"] . ' - ' - .$row["COUNT(*)"] . ' ' - .$lang_label["new_message_ket"] . '

'; - } +// Private messages pending to read ! - echo ""; - echo "
"; +$sql='SELECT COUNT(*) FROM tmensajes WHERE id_usuario_destino="'.$nick.'" +AND estado="FALSE";'; +$resultado = mysql_query ($sql); +$row = mysql_fetch_array ($resultado); +if ($row["COUNT(*)"] != 0){ + echo "

". $lang_label["new_message_bra"] . ' + ' + .$row["COUNT(*)"] . ' ' + .$lang_label["new_message_ket"] . '

'; +} - // Site news ! - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - echo '

' . $lang_label["site_news"] . '

'; - $sql_news = "SELECT * FROM tnews ORDER by timestamp DESC LIMIT 3"; - if ($result_news = mysql_query ($sql_news)){ - echo ''; - while ($row = mysql_fetch_array ($result_news)) { - echo ''; - echo "
".$row["subject"].""; - echo "
".$lang_label["by"]." ".$row["author"]. " ".$lang_label["at"]." ".$row["timestamp"].""; - echo '
'; - echo clean_output_breaks($row["text"]); - } - echo "
"; - } - echo "
"; - // Site stats - // Summary - // ~~~~~~~~~~~~~~~ - $data = general_stats($id_user,0); - $monitor_checks = $data[0]; - $monitor_ok = $data[1]; - $monitor_bad = $data[2]; - $monitor_unknown = $data[3]; - $monitor_alert = $data[4]; - $total_agents = $data[5]; - $data_checks = $data[6]; - $data_unknown = $data[7]; - $data_alert = $data[8]; - $data_alert_total = $data[9]; - $monitor_alert_total = $data[10]; - $data_not_init = $data[11]; - $monitor_not_init = $data[12]; - // Calculate global indicators +echo ""; +echo "
"; - $total_checks = $data_checks + $monitor_checks; - $notinit_percentage = (($data_not_init + $monitor_not_init) / ($total_checks / 100)); - $module_sanity = format_numeric (100 - $notinit_percentage); - $total_alerts = $data_alert + $monitor_alert; - $total_fired_alerts = $monitor_alert_total+$data_alert_total; - if ( $total_fired_alerts > 0) - $alert_level = format_numeric (100 - ($total_alerts / ($total_fired_alerts / 100))); - else - $alert_level = 100; - - if ($monitor_checks > 0){ - $monitor_health = format_numeric ( 100- (($monitor_bad + $monitor_unknown) / ($monitor_checks/100)) , 1); - } else - $monitor_health = 100; - if ($data_checks > 0){ - $data_health = format_numeric ( (($data_checks -($data_unknown + $data_alert)) / $data_checks ) * 100,1);; - } else - $data_health = 100; - if (($data_checks != 0) OR ($data_checks != 0)){ - $global_health = format_numeric ((($data_health * $data_checks) + ($monitor_health * $monitor_checks)) / $total_checks); - } else - $global_health = 100; - - if ($global_health < 0) - $global_health; - - echo ""; - //echo "

".$lang_label["tactical_indicator"]."

"; - //echo ""; - - echo "
".lang_string("Monitor health").""; - echo "
"; - - echo "
".lang_string("Data health").""; - echo "
"; - - echo "
".lang_string("Global health").""; - echo "
"; - - echo "
".lang_string("Module sanity").""; - echo "
"; - - - echo "
".lang_string("Alert level").""; - echo "
"; - echo "
"; - - $query1 = "SELECT COUNT(id_usuario) FROM tusuario"; - $result = mysql_query ($query1); - $row = mysql_fetch_array ($result); - $users_defined = $row[0]; - - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "
".$lang_label["Pandora_FMS_summary"]."
"."Total agents"."".$total_agents."
"."Total checks"."".$total_checks."
"."Monitor BAD".""; - if ($monitor_bad > 0) - echo $monitor_bad; - else - echo "-"; - echo "
"."Alerts defined"."".$total_alerts."
"."Total users"."".$users_defined."
"; - - echo "
"; - - echo "
"; - // Show last activity from this user - echo "

" . $lang_label["user_last_activity"] . "

"; - // Show table header - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - - // Skip offset records - $query1="SELECT * FROM tsesion WHERE (TO_DAYS(fecha) > TO_DAYS(NOW()) - 7) - AND ID_usuario = '" . $nick . "' ORDER BY fecha DESC limit 15"; - - $result = mysql_query ($query1); - $contador = 5; // Max items - $color = 1; - while (($row = mysql_fetch_array ($result)) and ($contador > 0)) { - - if ($color == 1){ - $tdcolor = "datos"; - $color = 0; - } else { - $tdcolor = "datos2"; - $color = 1; - } - - $usuario = $row["ID_usuario"]; +// Site news ! +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +echo '

' . $lang_label["site_news"] . '

'; +$sql_news = "SELECT * FROM tnews ORDER by timestamp DESC LIMIT 3"; +if ($result_news = mysql_query ($sql_news)){ + echo '
' . $lang_label["user"] . '' . $lang_label["action"] . '' . $lang_label["date"] . '' . $lang_label["src_address"] . '' . $lang_label["comments"] . '
'; + while ($row = mysql_fetch_array ($result_news)) { echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - - $contador--; + echo "
' . $usuario . '' . $row["accion"]. '' . $row["fecha"]. '' . $row["IP_origen"]. '' . $row["descripcion"]. '
".$row["subject"].""; + echo "
".$lang_label["by"]." ".$row["author"]. " ".$lang_label["at"]." ".$row["timestamp"].""; + echo '
'; + echo clean_output_breaks($row["text"]); } - echo "
"; - echo "
"; // activity +} +echo "
"; +// Site stats +// Summary +// ~~~~~~~~~~~~~~~ +$data = general_stats($id_user,0); +$monitor_checks = $data[0]; +$monitor_ok = $data[1]; +$monitor_bad = $data[2]; +$monitor_unknown = $data[3]; +$monitor_alert = $data[4]; +$total_agents = $data[5]; +$data_checks = $data[6]; +$data_unknown = $data[7]; +$data_alert = $data[8]; +$data_alert_total = $data[9]; +$monitor_alert_total = $data[10]; +$data_not_init = $data[11]; +$monitor_not_init = $data[12]; +// Calculate global indicators - echo ''; // class "jus" +$total_checks = $data_checks + $monitor_checks; +$notinit_percentage = (($data_not_init + $monitor_not_init) / ($total_checks / 100)); +$module_sanity = format_numeric (100 - $notinit_percentage); +$total_alerts = $data_alert + $monitor_alert; +$total_fired_alerts = $monitor_alert_total+$data_alert_total; +if ( $total_fired_alerts > 0) { + $alert_level = format_numeric (100 - ($total_alerts / ($total_fired_alerts / 100))); +} else { + $alert_level = 100; +} + +if ($monitor_checks > 0){ + $monitor_health = format_numeric ( 100- (($monitor_bad + $monitor_unknown) / ($monitor_checks/100)) , 1); +} else { + $monitor_health = 100; +} + +if ($data_checks > 0) { + $data_health = format_numeric ( (($data_checks -($data_unknown + $data_alert)) / $data_checks ) * 100,1);; +} else { + $data_health = 100; +} + +if ($data_checks != 0 || $data_checks != 0) { + $global_health = format_numeric ((($data_health * $data_checks) + ($monitor_health * $monitor_checks)) / $total_checks); +} else { + $global_health = 100; +} + +if ($global_health < 0) + $global_health; + +echo ""; +//echo "

".$lang_label["tactical_indicator"]."

"; +//echo ""; + +echo "
".lang_string("Monitor health").""; +echo "
"; + +echo "
".lang_string("Data health").""; +echo "
"; + +echo "
".lang_string("Global health").""; +echo "
"; + +echo "
".lang_string("Module sanity").""; +echo "
"; + + +echo "
".lang_string("Alert level").""; +echo "
"; +echo "
"; + +$query1 = "SELECT COUNT(id_usuario) FROM tusuario"; +$result = mysql_query ($query1); +$row = mysql_fetch_array ($result); +$users_defined = $row[0]; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
".$lang_label["Pandora_FMS_summary"]."
"."Total agents"."".$total_agents."
"."Total checks"."".$total_checks."
"."Monitor BAD".""; +if ($monitor_bad > 0) + echo $monitor_bad; +else + echo "-"; +echo "
"."Alerts defined"."".$total_alerts."
"."Total users"."".$users_defined."
"; + +echo "
"; + +echo "
"; +// Show last activity from this user +echo "

" . $lang_label["user_last_activity"] . "

"; +// Show table header +echo ''; +echo ''; +echo ''; +echo ''; +echo ''; +echo ''; + +// Skip offset records +$query1="SELECT * FROM tsesion WHERE (TO_DAYS(fecha) > TO_DAYS(NOW()) - 7) +AND ID_usuario = '" . $nick . "' ORDER BY fecha DESC limit 15"; + +$result = mysql_query ($query1); +$contador = 5; // Max items +$color = 1; +while ($row = mysql_fetch_array ($result) && $contador > 0) { + + if ($color == 1){ + $tdcolor = "datos"; + $color = 0; + } else { + $tdcolor = "datos2"; + $color = 1; + } + + $usuario = $row["ID_usuario"]; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + $contador--; +} + +echo "
' . $lang_label["user"] . '' . $lang_label["action"] . '' . $lang_label["date"] . '' . $lang_label["src_address"] . '' . $lang_label["comments"] . '
' . $usuario . '' . $row["accion"]. '' . $row["fecha"]. '' . $row["IP_origen"]. '' . $row["descripcion"]. '
"; +echo "
"; // activity + +echo '
'; // class "jus" ?> diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 64113e71ca..9b409844b0 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -30,12 +30,12 @@ if (give_acl($id_user, 0, "AW")!=1) { exit; } -echo "

".$lang_label["agent_conf"]; +echo "

".lang_string ("agent_conf"); if (isset($_GET["create_agent"])){ $create_agent = 1; - echo " > ".$lang_label["create_agent"]; + echo " > ".lang_string ("create_agent"); } else { - echo " > ".$lang_label["update_agent"]; + echo " > ".lang_string ("update_agent"); } echo "

"; echo "
"; @@ -58,17 +58,10 @@ if (isset($_GET["disk_conf_delete"])){ echo '
'; -if ($create_agent == 1) { - echo ""; -} else { - echo ""; - echo ""; -} -echo ''; +echo '
'; echo ""; -echo ' -"; } @@ -110,13 +103,10 @@ echo '"; @@ -125,111 +115,84 @@ echo ''; echo ''; echo ''; - +print_input_text ('comentarios', $comentarios, '', 55, 255); // Learn mode / Normal mode echo '
'.$lang_label["agent_name"].' -'; +echo ''.lang_string ("agent_name").''; +print_input_text ('agente', $nombre_agente, '', 30, 100); if (isset ($id_agente) && $id_agente != "") { echo " @@ -84,9 +77,9 @@ if (file_exists ($config["remote_config"] . "/" . $agent_md5 . ".md5")) { } echo '
'; -echo ''.$lang_label["ip_address"].''; +echo ''.lang_string ("ip_address").''; echo ''; -echo ''; +print_input_text ('direccion', $direccion_agente, '', 16, 100); if ($create_agent != 1) { echo "    "; @@ -101,7 +94,7 @@ if ($create_agent != 1) { } echo ""; - echo " ".$lang_label["delete_sel"]; + echo " ".lang_string ("delete_sel"); echo "'; print_select_from_sql ('SELECT id_agente, nombre FROM tagente', 'id_parent', $id_parent, '', 'None', '0'); -echo '
'.$lang_label["group"].''; -echo '"; +echo '
'.lang_string ("group").''; +echo ''; +print_select_from_sql ('SELECT id_grupo, nombre FROM tgrupo ORDER BY nombre', + 'grupo', $grupo, '', '', ''); echo "
"; echo "".lang_string("interval")."'; echo '
'.lang_string("os").''; -echo ' - -'; echo lang_string("Network server"); echo ''; -echo ''; +print_select_from_sql ('SELECT id_server, name FROM tserver WHERE network_server = 1 ORDER BY name', + 'network_server', $id_network_server, '', $none, $none_value); // Plugin Server echo '
'; echo lang_string("Plugin server"); echo ''; -echo ''; +print_select_from_sql ('SELECT id_server, name FROM tserver WHERE plugin_server = 1 ORDER BY name', + 'plugin_server', $id_plugin_server, '', $none, $none_value); // WMI Server echo '
'; echo lang_string("WMI server"); echo ''; -echo ''; +print_select_from_sql ('SELECT id_server, name FROM tserver WHERE wmi_server = 1 ORDER BY name', + 'wmi_server', $id_wmi_server, '', $none, $none_value); // Prediction Server echo '
'; echo lang_string("Prediction server"); echo ''; -echo ''; +print_select_from_sql ('SELECT id_server, name FROM tserver WHERE prediction_server = 1 ORDER BY name', + 'prediction_server', $id_prediction_server, '', $none, $none_value); // Description echo '
'; echo lang_string ("description"); echo ''; -echo '
'; echo lang_string ("module_definition"); echo ''; -if ($modo == "1"){ - echo $lang_label["learning_mode"].' - '; - echo $lang_label["normal_mode"].' - '; -} else { - echo $lang_label["learning_mode"].' - '; - echo $lang_label["normal_mode"].' - '; -} - +echo lang_string ("learning_mode"); +print_radio_button_extended ("modo", 1, '', $modo, false, '', 'style="margin-right: 40px;"'); +echo lang_string ("normal_mode"); +print_radio_button_extended ("modo", 0, '', $modo, false, '', 'style="margin-right: 40px;"'); // Status (Disabled / Enabled) echo '
'.lang_string("status").''; echo ''; -if ($disabled == "1"){ - echo $lang_label["disabled"].' - '; - echo $lang_label["active"].' - '; -} else { - echo $lang_label["disabled"].' - '; - echo $lang_label["active"].' - '; -} +echo lang_string ("disabled"); +print_radio_button_extended ("disabled", 1, '', $disabled, false, '', 'style="margin-right: 40px;"'); +echo lang_string ("active"); +print_radio_button_extended ("disabled", 0, '', $disabled, false, '', 'style="margin-right: 40px;"'); // Remote configuration echo '
'.lang_string("Remote configuration").''; @@ -244,15 +207,15 @@ if (file_exists($filename)){ } echo '
'; -if ($create_agent == 1){ - echo " - "; +if ($create_agent == 1) { + print_submit_button (lang_string ('create'), 'crtbutton', false, 'class="sub wand"'); + print_input_hidden ('create_agent', 1); } else { - echo " - "; + print_submit_button (lang_string ('update'), 'updbutton', false, 'class="sub upd"'); + print_input_hidden ('update_agent', 1); + print_input_hidden ('id_agente', $id_agente); } + echo "
"; ?> diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index b860316a33..0f3412c255 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -98,6 +98,12 @@ $alert_d6 = "1"; $alert_d7 = "1"; $alert_recovery = "0"; $alert_priority = "0"; +$id_network_server = 0; +$id_plugin_server = 0; +$id_prediction_server = 0; +$id_wmi_server = 0; +$grupo = 0; +$id_os = 0; // ================================ // Create AGENT @@ -111,7 +117,7 @@ if ( isset ($_POST["create_agent"])) { // Create a new and shining agent $intervalo = entrada_limpia ($_POST["intervalo"]); $comentarios = entrada_limpia ($_POST["comentarios"]); $modo = entrada_limpia ($_POST["modo"]); - $id_parent = get_parameter_post ("id_parent", 0); + $id_parent = get_parameter_post ("id_parent", 0); $id_network_server = get_parameter_post ("network_server", 0); $id_plugin_server = get_parameter_post ("plugin_server", 0); $id_prediction_server = get_parameter_post ("prediction_server", 0); @@ -124,9 +130,9 @@ if ( isset ($_POST["create_agent"])) { // Create a new and shining agent $sql1='SELECT nombre FROM tagente WHERE nombre = "'.$nombre_agente.'"'; $result=mysql_query($sql1); if ($row=mysql_fetch_array($result)){ - $agent_creation_error = lang_string("agent_exists"); - $agent_created_ok = 0; - } else { + $agent_creation_error = lang_string("agent_exists"); + $agent_created_ok = 0; + } else { $sql_insert ="INSERT INTO tagente (nombre, direccion, id_grupo, intervalo, comentarios,modo, id_os, disabled, id_network_server, id_plugin_server, id_wmi_server, id_prediction_server, id_parent) VALUES ('$nombre_agente', '$direccion_agente', $grupo , $intervalo , '$comentarios',$modo, $id_os, $disabled, $id_network_server, $id_plugin_server, $id_wmi_server, $id_prediction_server, $id_parent)"; $result = mysql_query($sql_insert); if ($result) { @@ -171,30 +177,30 @@ echo ""; + echo "
  • "; else - echo "
  • "; + echo "
  • "; echo "  ".$lang_label["setup_agent"].""; echo "
  • "; if ($tab == "module") - echo "
  • "; + echo "
  • "; else - echo "
  • "; + echo "
  • "; echo " ".$lang_label["modules"].""; echo "
  • "; if ($tab == "alert") - echo "
  • "; + echo "
  • "; else - echo "
  • "; + echo "
  • "; echo " ". $lang_label["Alerts"].""; echo "
  • "; if ($tab == "template") - echo "
  • "; + echo "
  • "; else - echo "
  • "; + echo "
  • "; echo " ".$lang_label["ntemplates"].""; echo "
  • "; @@ -210,26 +216,26 @@ echo "
    "; if (isset($_POST["create_agent"])){ if ($agent_created_ok == 0){ echo "

    ".$lang_label["create_agent_no"]."

    "; - echo $agent_creation_error; - } else { + echo $agent_creation_error; + } else { echo "

    ".$lang_label["create_agent_ok"]."

    "; - } + } } // Fix / Normalize module data // =========================== if (isset($_GET["fix_module"])){ - $id_module = $_GET["fix_module"]; + $id_module = $_GET["fix_module"]; $id_agent = $_GET["id_agente"]; - // get info about this module - $sql1 = "SELECT AVG(datos) FROM tagente_datos WHERE id_agente_modulo = $id_module AND id_agente = $id_agent"; - $result=mysql_query($sql1); - if ($row=mysql_fetch_array($result)){ + // get info about this module + $sql1 = "SELECT AVG(datos) FROM tagente_datos WHERE id_agente_modulo = $id_module AND id_agente = $id_agent"; + $result=mysql_query($sql1); + if ($row=mysql_fetch_array($result)){ $media = $row[0]; $media = $media * 1.3; $sql1 = "DELETE FROM tagente_datos WHERE datos > $media AND id_agente_modulo = $id_module AND id_agente = $id_agent"; - $result=mysql_query($sql1); + $result=mysql_query($sql1); echo "

    ".$lang_label["delete_data_above"]." $media

    "; } } @@ -252,23 +258,23 @@ if (isset($_GET["delete_alert"])){ // if modified some parameter // Delete Alert component (from a combined) // ========================================== if (isset($_GET["delete_alert_comp"])){ // if modified some parameter - $id_borrar_modulo = $_GET["delete_alert_comp"]; - // get info about agent - $sql1='DELETE FROM tcompound_alert WHERE id_aam = '.$id_borrar_modulo; - $result=mysql_query($sql1); - if (! $result) - echo "

    ".$lang_label["delete_alert_no"]."

    "; - else - echo "

    ".$lang_label["delete_alert_ok"]."

    "; + $id_borrar_modulo = $_GET["delete_alert_comp"]; + // get info about agent + $sql1='DELETE FROM tcompound_alert WHERE id_aam = '.$id_borrar_modulo; + $result=mysql_query($sql1); + if (! $result) + echo "

    ".$lang_label["delete_alert_no"]."

    "; + else + echo "

    ".$lang_label["delete_alert_ok"]."

    "; } // Create alert // ============= if (isset($_POST["insert_alert"])){ // if created alert - $combined = get_parameter ("combined",0); + $combined = get_parameter ("combined",0); $id_agente_modulo = get_parameter ("agente_modulo",0); - $maximo = get_parameter ("maximo",0); - $minimo = get_parameter ("minimo",0); + $maximo = get_parameter ("maximo",0); + $minimo = get_parameter ("minimo",0); $descripcion= get_parameter ('descripcion', ''); $campo_1 = get_parameter ('campo_1', ''); $campo_2 = get_parameter ('campo_2', ''); @@ -282,22 +288,22 @@ if (isset($_POST["insert_alert"])){ // if created alert $time_to= get_parameter ("time_to"); $other = get_parameter ("other",0); $disable_alert = get_parameter ("disable_alert"); - $alert_d1 = get_parameter("alert_d1",0); - $alert_d2 = get_parameter("alert_d2",0); - $alert_d3 = get_parameter("alert_d3",0); - $alert_d4 = get_parameter("alert_d4",0); - $alert_d5 = get_parameter("alert_d5",0); - $alert_d6 = get_parameter("alert_d6",0); - $alert_d7 = get_parameter("alert_d7",0); - $alert_recovery = get_parameter("alert_recovery", 1); - $alert_priority = get_parameter("alert_priority", 0); - $campo2_rec = get_parameter ("campo_2_rec",""); - $campo3_rec = get_parameter ("campo_3_rec",""); + $alert_d1 = get_parameter("alert_d1",0); + $alert_d2 = get_parameter("alert_d2",0); + $alert_d3 = get_parameter("alert_d3",0); + $alert_d4 = get_parameter("alert_d4",0); + $alert_d5 = get_parameter("alert_d5",0); + $alert_d6 = get_parameter("alert_d6",0); + $alert_d7 = get_parameter("alert_d7",0); + $alert_recovery = get_parameter("alert_recovery", 1); + $alert_priority = get_parameter("alert_priority", 0); + $campo2_rec = get_parameter ("campo_2_rec",""); + $campo3_rec = get_parameter ("campo_3_rec",""); - if ($combined == 1) - $alert_id_agent = $id_agente; - else - $alert_id_agent = 0; + if ($combined == 1) + $alert_id_agent = $id_agente; + else + $alert_id_agent = 0; if ($time_threshold == -1) { $time_threshold = $other; } @@ -318,18 +324,18 @@ if (isset($_POST["insert_alert"])){ // if created alert '$disable_alert', '$time_from', '$time_to', - $alert_id_agent, - $alert_d1, - $alert_d2, - $alert_d3, - $alert_d4, - $alert_d5, - $alert_d6, - $alert_d7, - $alert_recovery, - $alert_priority, - '$campo2_rec', - '$campo2_rec' )"; + $alert_id_agent, + $alert_d1, + $alert_d2, + $alert_d3, + $alert_d4, + $alert_d5, + $alert_d6, + $alert_d7, + $alert_recovery, + $alert_priority, + '$campo2_rec', + '$campo2_rec' )"; $result=mysql_query($sql_insert); if (! $result) { echo "

    ".$lang_label["create_alert_no"]."

    "; @@ -343,17 +349,17 @@ if (isset($_POST["insert_alert"])){ // if created alert // Combined ALERT - Add component // ================================ if (isset($_POST["add_alert_combined"])){ // Update an existing alert - $alerta_id_aam = get_parameter ("update_alert",-1); - $component_item = get_parameter ("component_item",-1); - $component_operation = get_parameter ("component_operation","AND"); - $sql_insert = "INSERT INTO tcompound_alert (id, id_aam, operation) - VALUES ($alerta_id_aam, $component_item, '$component_operation')"; - $result=mysql_query($sql_insert); - if (! $result) { - echo "

    ".lang_string ("Problem adding component alert")."

    "; - } else { - echo "

    ".lang_string ("Alert component added ok")."

    "; - } + $alerta_id_aam = get_parameter ("update_alert",-1); + $component_item = get_parameter ("component_item",-1); + $component_operation = get_parameter ("component_operation","AND"); + $sql_insert = "INSERT INTO tcompound_alert (id, id_aam, operation) + VALUES ($alerta_id_aam, $component_item, '$component_operation')"; + $result=mysql_query($sql_insert); + if (! $result) { + echo "

    ".lang_string ("Problem adding component alert")."

    "; + } else { + echo "

    ".lang_string ("Alert component added ok")."

    "; + } } @@ -361,44 +367,44 @@ if (isset($_POST["add_alert_combined"])){ // Update an existing alert // ============= if (isset($_POST["update_alert"])){ // Update an existing alert $id_agente_modulo = get_parameter ("agente_modulo",0); - $id_aam = get_parameter ("id_aam",0); - $maximo = get_parameter ("maximo",0); - $minimo = get_parameter ("minimo",0); - $descripcion= get_parameter ('descripcion', ''); - $campo_1 = get_parameter ('campo_1', ''); - $campo_2 = get_parameter ('campo_2', ''); - $campo_3 = get_parameter ('campo_3', ''); - $tipo_alerta = get_parameter ("tipo_alerta",3); - $alert_text = get_parameter ("alert_text",''); - $time_threshold = get_parameter ("time_threshold",900); - $max_alerts = get_parameter ("max_alerts",1); - $min_alerts = get_parameter ("min_alerts",0); - $time_from = get_parameter ("time_from"); - $time_to= get_parameter ("time_to"); - $other = get_parameter ("other",0); - $disable_alert = get_parameter ("disable_alert"); - $alert_d1 = get_parameter("alert_d1",0); - $alert_d2 = get_parameter("alert_d2",0); - $alert_d3 = get_parameter("alert_d3",0); - $alert_d4 = get_parameter("alert_d4",0); - $alert_d5 = get_parameter("alert_d5",0); - $alert_d6 = get_parameter("alert_d6",0); - $alert_d7 = get_parameter("alert_d7",0); - $alert_recovery = get_parameter("alert_recovery", 1); - $alert_priority = get_parameter("alert_priority", 0); - $campo2_rec = get_parameter ("campo_2_rec",""); - $campo3_rec = get_parameter ("campo_3_rec",""); - $alert_d1 = get_parameter("alert_d1",0); - $alert_d2 = get_parameter("alert_d2",0); - $alert_d3 = get_parameter("alert_d3",0); - $alert_d4 = get_parameter("alert_d4",0); - $alert_d5 = get_parameter("alert_d5",0); - $alert_d6 = get_parameter("alert_d6",0); - $alert_d7 = get_parameter("alert_d7",0); - $alert_recovery = get_parameter("alert_recovery", 1); - $alert_priority = get_parameter("alert_priority", 0); - $campo2_rec = get_parameter ("campo_2_rec",""); - $campo3_rec = get_parameter ("campo_3_rec",""); + $id_aam = get_parameter ("id_aam",0); + $maximo = get_parameter ("maximo",0); + $minimo = get_parameter ("minimo",0); + $descripcion= get_parameter ('descripcion', ''); + $campo_1 = get_parameter ('campo_1', ''); + $campo_2 = get_parameter ('campo_2', ''); + $campo_3 = get_parameter ('campo_3', ''); + $tipo_alerta = get_parameter ("tipo_alerta",3); + $alert_text = get_parameter ("alert_text",''); + $time_threshold = get_parameter ("time_threshold",900); + $max_alerts = get_parameter ("max_alerts",1); + $min_alerts = get_parameter ("min_alerts",0); + $time_from = get_parameter ("time_from"); + $time_to= get_parameter ("time_to"); + $other = get_parameter ("other",0); + $disable_alert = get_parameter ("disable_alert"); + $alert_d1 = get_parameter("alert_d1",0); + $alert_d2 = get_parameter("alert_d2",0); + $alert_d3 = get_parameter("alert_d3",0); + $alert_d4 = get_parameter("alert_d4",0); + $alert_d5 = get_parameter("alert_d5",0); + $alert_d6 = get_parameter("alert_d6",0); + $alert_d7 = get_parameter("alert_d7",0); + $alert_recovery = get_parameter("alert_recovery", 1); + $alert_priority = get_parameter("alert_priority", 0); + $campo2_rec = get_parameter ("campo_2_rec",""); + $campo3_rec = get_parameter ("campo_3_rec",""); + $alert_d1 = get_parameter("alert_d1",0); + $alert_d2 = get_parameter("alert_d2",0); + $alert_d3 = get_parameter("alert_d3",0); + $alert_d4 = get_parameter("alert_d4",0); + $alert_d5 = get_parameter("alert_d5",0); + $alert_d6 = get_parameter("alert_d6",0); + $alert_d7 = get_parameter("alert_d7",0); + $alert_recovery = get_parameter("alert_recovery", 1); + $alert_priority = get_parameter("alert_priority", 0); + $campo2_rec = get_parameter ("campo_2_rec",""); + $campo3_rec = get_parameter ("campo_3_rec",""); if ($time_threshold == -1) { $time_threshold = $other; } @@ -418,18 +424,18 @@ if (isset($_POST["update_alert"])){ // Update an existing alert time_to = '$time_to', time_from = '$time_from', disable = '$disable_alert', - monday = '$alert_d1', - tuesday = '$alert_d2', - wednesday = '$alert_d3', - thursday = '$alert_d4', - friday = '$alert_d5', - saturday = '$alert_d6', - sunday = '$alert_d7', - recovery_notify = $alert_recovery, - priority = $alert_priority, - al_f2_recovery = '$campo2_rec', - al_f3_recovery = '$campo3_rec', - id_alerta = $tipo_alerta + monday = '$alert_d1', + tuesday = '$alert_d2', + wednesday = '$alert_d3', + thursday = '$alert_d4', + friday = '$alert_d5', + saturday = '$alert_d6', + sunday = '$alert_d7', + recovery_notify = $alert_recovery, + priority = $alert_priority, + al_f2_recovery = '$campo2_rec', + al_f3_recovery = '$campo3_rec', + id_alerta = $tipo_alerta WHERE id_aam = ".$id_aam; $result=mysql_query($sql_insert); if (! $result) { @@ -457,14 +463,14 @@ if (isset($_POST["update_agent"])) { // if modified some agent paramenter $id_plugin_server = get_parameter ("plugin_server", 0); $id_wmi_server = get_parameter ("wmi_server", 0); $id_prediction_server = get_parameter_post ("prediction_server", 0); - $id_parent = get_parameter_post ("id_parent", 0); + $id_parent = get_parameter_post ("id_parent", 0); if ($direccion_agente != $old_agent_address){ agent_add_address ($id_agente, $direccion_agente); } $sql_update ="UPDATE tagente SET disabled = ".$disabled.", id_parent = $id_parent, id_os = ".$id_os." , modo = ".$modo." , nombre = '".$nombre_agente."', direccion = '".$direccion_agente."', id_grupo = '".$grupo."', intervalo = '".$intervalo."', comentarios = '".$comentarios."', id_network_server = '$id_network_server', id_plugin_server = $id_plugin_server, id_wmi_server = $id_wmi_server, - id_prediction_server = $id_prediction_server + id_prediction_server = $id_prediction_server WHERE id_agente = '".$id_agente."'"; // Delete one of associateds IP's ? @@ -500,14 +506,14 @@ if (isset($_GET["id_agente"])) { $grupo = $row["id_grupo"]; $ultima_act = $row["ultimo_contacto"]; $comentarios = $row["comentarios"]; - $id_plugin_server = $row["id_plugin_server"]; + $id_plugin_server = $row["id_plugin_server"]; $id_network_server = $row["id_network_server"]; - $id_prediction_server = $row["id_prediction_server"]; - $id_wmi_server = $row["id_wmi_server"]; + $id_prediction_server = $row["id_prediction_server"]; + $id_wmi_server = $row["id_wmi_server"]; $modo = $row["modo"]; $id_os = $row["id_os"]; $disabled=$row["disabled"]; - $id_parent = $row["id_parent"]; + $id_parent = $row["id_parent"]; } else { echo "

    ".$lang_label["agent_error"]."

    "; echo ""; @@ -576,8 +582,8 @@ if (isset($_GET["update_alert"])){ $alerta_campo1 = $row["al_campo1"]; $alerta_campo2 = $row["al_campo2"]; $alerta_campo3 = $row["al_campo3"]; - $alerta_campo2_rec = $row["al_f2_recovery"]; - $alerta_campo3_rec = $row["al_f3_recovery"]; + $alerta_campo2_rec = $row["al_f2_recovery"]; + $alerta_campo3_rec = $row["al_f3_recovery"]; $alerta_dis_max = $row["dis_max"]; $alerta_dis_min = $row["dis_min"]; $tipo_alerta = $row["id_alerta"]; @@ -590,17 +596,17 @@ if (isset($_GET["update_alert"])){ $time_from = $row["time_from"]; $time_to = $row["time_to"]; $alerta_id_agentemodulo = $row["id_agente_modulo"]; // Only to show, cannot be changed - $alert_id_agent = $row["id_agent"]; - $alert_d1 = $row["monday"]; - $alert_d2 = $row["tuesday"]; - $alert_d3 = $row["wednesday"]; - $alert_d4 = $row["thursday"]; - $alert_d5 = $row["friday"]; - $alert_d6 = $row["saturday"]; - $alert_d7 = $row["sunday"]; - $alert_recovery = $row["recovery_notify"]; - $alert_priority = $row["priority"]; - } + $alert_id_agent = $row["id_agent"]; + $alert_d1 = $row["monday"]; + $alert_d2 = $row["tuesday"]; + $alert_d3 = $row["wednesday"]; + $alert_d4 = $row["thursday"]; + $alert_d5 = $row["friday"]; + $alert_d6 = $row["saturday"]; + $alert_d7 = $row["sunday"]; + $alert_recovery = $row["recovery_notify"]; + $alert_priority = $row["priority"]; + } } // GET DATA for MODULE UPDATE OR MODULE INSERT @@ -725,41 +731,40 @@ if (((!isset($_POST["nc"]) OR ($_POST["nc"]==-1))) && (!isset($_POST["oid"])) && $form_tcp_port= "0"; } $sql_insert = "INSERT INTO tagente_modulo - (id_agente, id_tipo_modulo, nombre, descripcion, max, min, snmp_oid, snmp_community, - id_module_group, module_interval, ip_target, tcp_port, tcp_rcv, tcp_send, id_export, - plugin_user, plugin_pass, plugin_parameter, id_plugin, post_process, prediction_module, - max_timeout, disabled, id_modulo) - VALUES ($id_agente, $form_id_tipo_modulo, '$form_name', '$form_description', $form_maxvalue, $form_minvalue, '$form_snmp_oid', '$form_snmp_community', $form_id_module_group, $form_interval, '$form_ip_target', $form_tcp_port, '$form_tcp_rcv', '$form_tcp_send', $form_id_export, '$form_plugin_user', '$form_plugin_pass', '$form_plugin_parameter', $form_id_plugin, $form_post_process, $form_id_prediction_module, $form_max_timeout, $form_disabled, $form_id_modulo)"; + (id_agente, id_tipo_modulo, nombre, descripcion, max, min, snmp_oid, snmp_community, + id_module_group, module_interval, ip_target, tcp_port, tcp_rcv, tcp_send, id_export, + plugin_user, plugin_pass, plugin_parameter, id_plugin, post_process, prediction_module, + max_timeout, disabled, id_modulo) + VALUES ($id_agente, $form_id_tipo_modulo, '$form_name', '$form_description', $form_maxvalue, $form_minvalue, '$form_snmp_oid', '$form_snmp_community', $form_id_module_group, $form_interval, '$form_ip_target', $form_tcp_port, '$form_tcp_rcv', '$form_tcp_send', $form_id_export, '$form_plugin_user', '$form_plugin_pass', '$form_plugin_parameter', $form_id_plugin, $form_post_process, $form_id_prediction_module, $form_max_timeout, $form_disabled, $form_id_modulo)"; $result=mysql_query($sql_insert); - if (! $result){ - echo "

    ".$lang_label["add_module_no"]."

    "; - echo "DEBUG: $sql_insert"; - } else { - echo "

    ".$lang_label["add_module_ok"]."

    "; - $id_agente_modulo = mysql_insert_id(); - // Create with different estado if proc type or data type - if ( - ($form_id_tipo_modulo == 2) || // data_proc + if (! $result){ + echo "

    ".$lang_label["add_module_no"]."

    "; + echo "DEBUG: $sql_insert"; + } else { + echo "

    ".$lang_label["add_module_ok"]."

    "; + $id_agente_modulo = mysql_insert_id(); + // Create with different estado if proc type or data type + if (($form_id_tipo_modulo == 2) || // data_proc ($form_id_tipo_modulo == 6) || // icmp_proc ($form_id_tipo_modulo == 9) || // tcp_proc ($form_id_tipo_modulo == 18) || //snmp proc - ($form_id_tipo_modulo == 21) || // async proc - ($form_id_tipo_modulo == 100) // Keepalive - ){ + ($form_id_tipo_modulo == 21) || // async proc + ($form_id_tipo_modulo == 100) // Keepalive + ) { + $sql_insert2 = "INSERT INTO tagente_estado + (id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp) + VALUES ( + $id_agente_modulo, 0,'0000-00-00 00:00:00',0,0,'".$id_agente."',0 + )"; + } else { $sql_insert2 = "INSERT INTO tagente_estado - (id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp) - VALUES ( - $id_agente_modulo, 0,'0000-00-00 00:00:00',0,0,'".$id_agente."',0 - )"; - } else { - $sql_insert2 = "INSERT INTO tagente_estado - (id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp) - VALUES ( - $id_agente_modulo, 0,'0000-00-00 00:00:00',0,100,'".$id_agente."',0 - )"; - } - $result=mysql_query($sql_insert2); - } + (id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp) + VALUES ( + $id_agente_modulo, 0,'0000-00-00 00:00:00',0,100,'".$id_agente."',0 + )"; + } + $result=mysql_query($sql_insert2); + } } // MODULE DELETION @@ -814,10 +819,10 @@ switch ($tab) { require "module_manager_editor.php"; break; case "alert": - if (($form_alerttype == "") AND (!isset($_GET["update_alert"]))) - require "alert_manager.php"; - else - require "alert_manager_editor.php"; + if (($form_alerttype == "") && (!isset($_GET["update_alert"]))) + require "alert_manager.php"; + else + require "alert_manager_editor.php"; break; case "template": require "agent_template.php"; diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index da2f75b2d0..312a5b94fa 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -27,7 +27,7 @@ if (comprueba_login() == 0){ ?> -
    :: ::
    +
    :: ::
    '; + echo '
    '; if (isset($_GET["sec"]) && $_GET["sec"] == "gagente"){ if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/agentes/manage_config"){ @@ -61,7 +61,7 @@ if (comprueba_login() == 0){ } else echo ""; + echo ""; } } } @@ -71,14 +71,14 @@ if (comprueba_login() == 0){ echo ''; if (isset($_GET["sec"]) && $_GET["sec"] == "gmodules"){ if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/modules/manage_nc_groups" || $_GET["sec2"] == "godmode/modules/manage_nc_groups_form") echo ""; } if (isset($_GET["sec"]) && $_GET["sec"] == "gmodules"){ @@ -86,7 +86,7 @@ if (comprueba_login() == 0){ echo ""; } // Network Profiles if (isset($_GET["sec"]) && $_GET["sec"] == "gmodules"){ @@ -94,7 +94,7 @@ if (comprueba_login() == 0){ echo ""; } } @@ -104,7 +104,7 @@ if (comprueba_login() == 0){ } else echo ''; + echo ''; if (isset($_GET["sec"]) && $_GET["sec"] == "galertas"){ if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/alerts/plugin"){ @@ -120,7 +120,7 @@ if (comprueba_login() == 0){ echo ''; } // Reporting // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -128,7 +128,7 @@ if (comprueba_login() == 0){ echo ''; + echo ''; // Custom report builder if (isset($_GET["sec"]) && $_GET["sec"] == "greporting"){ @@ -137,7 +137,7 @@ if (comprueba_login() == 0){ } else { echo ""; + echo ""; } // Custom graph builder @@ -147,7 +147,7 @@ if (comprueba_login() == 0){ } else { echo ""; + echo ""; } // Custom map builder @@ -157,7 +157,7 @@ if (comprueba_login() == 0){ } else { echo ""; + echo ""; } } @@ -169,7 +169,7 @@ if (comprueba_login() == 0){ echo ''; // SERVERS // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -179,14 +179,14 @@ if (comprueba_login() == 0){ } else echo ''; + echo ''; if (isset($_GET["sec"]) && $_GET["sec"] == "gservers"){ if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/servers/manage_recontask"|| $_GET["sec2"] == "godmode/servers/manage_recontask_form"){ echo ""; } // AUDIT // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -194,7 +194,7 @@ if (comprueba_login() == 0){ echo ''; // Main SETUP // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -202,14 +202,14 @@ if (comprueba_login() == 0){ echo ''; if (isset($_GET["sec"]) && $_GET["sec"] == "gsetup"){ if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/setup/links"){ echo ""; } if (isset($_GET["sec"]) && $_GET["sec"] == "gsetup"){ @@ -217,7 +217,7 @@ if (comprueba_login() == 0){ echo "
    "; } else echo ""; + echo "
    "; } } if ((give_acl($id_user, 0, "DM")==1)){ @@ -232,7 +232,7 @@ if (comprueba_login() == 0){ } else { echo '
  • '; } - echo ''.$lang_label["db_maintenance"].'
  • '; + echo ''.lang_string ("db_maintenance").''; if (isset($_GET["sec"]) && $_GET["sec"] == "gdbman"){ @@ -241,31 +241,31 @@ if (comprueba_login() == 0){ echo "
    "; } else echo ""; + echo "
    "; if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/db/db_purge"){ echo "
    "; } else echo ""; + echo "
    "; if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/db/db_refine"){ echo "
    "; } else echo ""; + echo "
    "; if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/db/db_audit"){ echo "
    "; } else echo ""; + echo "
    "; if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/db/db_event"){ echo "
    "; } else echo ""; + echo "
    "; if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/db/db_sanity"){ echo "
    "; diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index b8d432c526..f1b6404d86 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -16,587 +16,553 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -?> - -".$lang_label["delete_ok"].""; - else - $result = "

    ".$lang_label["delete_no"]."

    "; - echo $result; -} +$name = ''; +$id_group = 0; +$width = 0; +$height = 0; +$background = ''; -// Delete module SQL code -if (isset($_GET["delete_map"])){ - $id = $_GET["delete_map"]; - $sql = "DELETE FROM tlayout_data WHERE id_layout = $id"; - $sql2 = "DELETE FROM tlayout WHERE id = $id"; - $res=mysql_query($sql); - $res2=mysql_query($sql2); - if ($res AND $res2) - $result = "

    ".$lang_label["delete_ok"]."

    "; - else - $result = "

    ".$lang_label["delete_no"]."

    "; - echo $result; -} - -// Create new report. First step -if (isset($_GET["create_map"])){ - $createmode = 2; -} - -if (isset($_GET["update_module"])){ - if (isset($_GET["update_module"])) - $id_element = $_GET["update_module"]; - else { - audit_db($id_user,$REMOTE_ADDR, "Hack attempt","Parameter trash in map builder"); - include ("general/noaccess.php"); +if ($create_layout) { + $name = (string) get_parameter ('name'); + $id_group = (int) get_parameter ('id_group'); + $width = (int) get_parameter ('width'); + $height = (int) get_parameter ('height'); + $background = (string) get_parameter ('background'); + if ($background != '') { + $bg_info = getimagesize ('images/console/background/'.$background); + $width = $bg_info[0]; + $height = $bg_info[1]; + } + $sql = sprintf ('INSERT INTO tlayout (name, id_group, background, height, width) + VALUES ("%s", %d, "%s", %d, %d)', + $name, $id_group, $background, $height, $width); + $result = mysql_query ($sql); + if ($result) { + echo '

    '.lang_string ("create_ok").'

    '; + $id_layout = mysql_insert_id (); + } else { + echo '

    '.lang_string ("create_no").'

    '; + } + if (defined ('AJAX')) { exit; } - $pos_x = get_parameter ("pos_x",0); - $pos_y = get_parameter ("pos_y",0); - $my_height = get_parameter ("height"); - $my_width = get_parameter ("width"); - $my_label = get_parameter ("label"); - $my_image = get_parameter ("image"); - - $sql = "UPDATE tlayout_data SET - pos_x = '$pos_x', - pos_y = '$pos_y', - width = '$my_width', - height = '$my_height', - image = '$my_image', - label = '$my_label' - WHERE id = $id_element"; - if ($res=mysql_query($sql)) - $result = "

    ".$lang_label["modify_ok"]."

    "; - else { - $result = "

    ".$lang_label["modify_no"]."

    "; - echo $sql; - echo "

    "; - } - echo $result; - } -// Add module SQL code -if (isset($_GET["add_module"])){ - if (isset($_POST["id_map"])) - $id_map = $_POST["id_map"]; - else { - audit_db($id_user,$REMOTE_ADDR, "Hack attempt","Parameter trash in map builder"); - include ("general/noaccess.php"); + +if ($delete_layout) { + $sql = sprintf ('DELETE FROM tlayout_data WHERE id_layout = %d', $id_layout); + mysql_query ($sql); + $sql = sprintf ('DELETE FROM tlayout WHERE id = %d', $id_layout); + $result = mysql_query ($sql); + if ($result) { + echo '

    '.lang_string ("delete_ok").'

    '; + } else { + echo '

    '.lang_string ("delete_no").'

    '; + } + $id_layout = 0; +} + +if ($update_layout) { + $name = (string) get_parameter ('name'); + $id_group = (int) get_parameter ('id_group'); + $width = (int) get_parameter ('width'); + $height = (int) get_parameter ('height'); + $background = (string) get_parameter ('background'); + $bg_info = getimagesize ('images/console/background/'.$background); + if (! $width) + $width = $bg_info[0]; + if (! $height) + $height = $bg_info[1]; + $sql = sprintf ('UPDATE tlayout SET name = "%s", background = "%s", + height = %d, width = %d + WHERE id = %d', + $name, $background, $height, $width, $id_layout); + $result = mysql_query ($sql); + if ($result) { + echo '

    '.lang_string ("update_ok").'

    '; + } else { + echo '

    '.lang_string ("update_no").'

    '; + } + if (defined ('AJAX')) { exit; } - $my_id_map = get_parameter ("id_map",0); - $my_id_agent = get_parameter ("id_agent",0); - $my_id_module = get_parameter ("id_module",0); - $my_period = get_parameter ("period",3600); - $my_type = get_parameter ("type",0); - $my_pos_x = get_parameter ("pos_x",0); - $my_pos_y = get_parameter ("pos_y",0); - $my_height = get_parameter ("height"); - $my_width = get_parameter ("width"); - $my_label = get_parameter ("label"); - $my_image = get_parameter ("image"); - $my_map_linked = get_parameter ("map_linked"); - $my_parent_item = get_parameter ("parent_item"); - $my_label_color = get_parameter ("label_color",""); - $my_link_color = get_parameter ("link_color",0); - $sql = "INSERT INTO tlayout_data (id_layout, pos_x, pos_y, height, width, label, image, type, period, id_agente_modulo, id_layout_linked, parent_item, label_color, no_link_color) VALUES ('$my_id_map', '$my_pos_x', '$my_pos_y', '$my_height', '$my_width', '$my_label', '$my_image', '$my_type', '$my_period', '$my_id_module', '$my_map_linked', '$my_parent_item', '$my_label_color', '$my_link_color')"; - if ($res=mysql_query($sql)) - $result = "

    ".$lang_label["create_ok"]."

    "; - else { - $result = "

    ".$lang_label["create_no"]."

    "; - } - echo $result; } -// Create item SQL code -if (isset($_POST["createmode"])){ - $createmode = $_POST["createmode"]; - $map_name = entrada_limpia($_POST["map_name"]); - $map_background = entrada_limpia($_POST["map_background"]); - $map_width = entrada_limpia($_POST["map_width"]); - $map_height = entrada_limpia($_POST["map_height"]); +if ($get_background_info) { + $file = (string) get_parameter ('background'); - - // INSERT REPORT DATA - if ($createmode == 1){ - $form_id_user = $id_user; - $sql = "INSERT INTO tlayout (name, background, width, height, id_group) VALUES ('$map_name', '$map_background', '$map_width', '$map_height', 1)"; - if ($res=mysql_query($sql)) - $result = "

    ".$lang_label["create_ok"]."

    "; - else - $result = "

    ".$lang_label["create_no"]."

    "; - $id_map = mysql_insert_id(); - // UPDATE REPORT DATA - } else { - $id_map = entrada_limpia($_POST["id_map"]); - $sql = "UPDATE tlayout SET name = '$map_name', height= '$map_height', width = '$map_width', background = '$map_background' WHERE id = $id_map"; - if ($res=mysql_query($sql)) - $result = "

    ".$lang_label["modify_ok"]."

    "; - else - $result = "

    ".$lang_label["modify_no"]."

    "; - } - echo $result; - if ($id_map != ""){ - $_GET["id"] = $id_map; - $createmode=0; + $info = getimagesize ('images/console/background/'.$file); + $info['width'] = $info[0]; + $info['height'] = $info[1]; + if (defined ('AJAX')) { + echo json_encode ($info); + exit; } } -// GET DATA OF REPORT -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) { - if (isset($_GET["id"])) - $id_map = $_GET["id"]; - elseif (isset($_POST["id_map"])) - $id_map = $_POST["id_map"]; - else - $id_map = -1; - - if (isset($_POST["id_agent"])) - $id_agent = $_POST["id_agent"]; - else - $id_agent = 0; - if ($createmode != 2){ - $createmode = 0; - $sql = "SELECT * FROM tlayout WHERE id = $id_map"; - $res=mysql_query($sql); - if ($row = mysql_fetch_array($res)){ - $map_name = $row["name"]; - $map_background = $row["background"]; - $map_width = $row["width"]; - $map_height = $row["height"]; - } +if ($get_layout_data) { + $id_layout_data = (int) get_parameter ('id_layout_data'); + $layout_data = get_db_row ('tlayout_data', 'id', $id_layout_data); + $layout_data['id_agent'] = give_agent_id_from_module_id ($layout_data['id_agente_modulo']); + if (defined ('AJAX')) { + echo json_encode ($layout_data); + exit; + } +} + +if ($create_layout_data) { + $layout_data_type = (string) get_parameter ("type"); + $layout_data_label = (string) get_parameter ("label"); + $layout_data_image = (string) get_parameter ("image"); + $layout_data_id_agent_module = (int) get_parameter ("module"); + $layout_data_label_color = (string) get_parameter ("label_color"); + $layout_data_parent_item = (int) get_parameter ("parent_item"); + $layout_data_period = (int) get_parameter ("period"); + $layout_data_map_linked = (int) get_parameter ("map_linked"); + + $sql = sprintf ('INSERT INTO tlayout_data (id_layout, label, id_layout_linked, + label_color, image, type, id_agente_modulo, parent_item, period, link_color) + VALUES (%d, "%s", %d, "%s", "%s", %d, %d, %d, %d, 1)', + $id_layout, $layout_data_label, + $layout_data_map_linked, + $layout_data_label_color, + $layout_data_image, $layout_data_type, + $layout_data_id_agent_module, + $layout_data_parent_item, $layout_data_period * 3600); + $result = mysql_query ($sql); + + if ($result) { + echo '

    '.lang_string ("create_ok").'

    '; } else { - $map_name = ""; - $map_background = ""; - $map_width = ""; - $map_height = ""; - $createmode = 1; + echo '

    '.lang_string ("create_no").'

    '; } - - echo "

    ".$lang_label["reporting"]." > "; - echo $lang_label["map_builder"]."

    "; - echo "
    "; - echo ""; - if ($createmode == 0){ - echo ""; + if (defined ('AJAX')) { + exit; } +} - - echo ""; - echo ""; - echo "'; +} - echo "
    "; - echo $lang_label["report_name"]; - echo ""; - echo ""; - echo "
    "; - echo $lang_label["background"]; - echo ""; - // echo ""; - - echo '
    "; - echo $lang_label["width"]; - echo ""; - echo ""; - - echo "
    "; - echo $lang_label["height"]; - echo ""; - echo ""; - - // Button - echo "
    "; - echo ""; - echo "
    "; - if ($createmode == 0) - echo ""; - else - echo ""; - echo "
    "; - echo "
    "; - - if ($createmode == 0){ - // Part 2 - Add new items to report - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - echo "

    ".$lang_label["map_item_add"]; - ?> - - "; - echo "

    "; - echo "
    "; - - // Show combo with agents - // ---------------------- - - echo ""; - echo ""; - echo ""; - - echo ""; - echo ""; - echo "'; - - - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "
    ".$lang_label["source_agent"].""; - echo ""; - echo ""; - - // Modules combo - // ----------------------- - echo "
    "; - echo ""; - if (isset($id_agent)) - echo ""; - - echo "
    "; - echo "".$lang_label["modules"].""; - echo ""; - echo ""; - - // Component type - echo "
    "; - echo "".$lang_label["reporting_type"].""; - echo ""; - echo ""; - - // Period - echo "
    "; - echo "".$lang_label["period"].""; - echo ""; - echo ""; - - echo "
    "; - echo "".$lang_label["pos_x"].""; - echo ""; - - echo ""; - echo "".$lang_label["pos_y"].""; - echo ""; - - - echo "
    "; - echo "".$lang_label["height"].""; - echo ""; - - echo ""; - echo "".$lang_label["width"].""; - echo ""; - - echo "
    "; - echo "".$lang_label["label"].""; - echo ""; - - echo "
    "; - echo "".$lang_label["image"].""; - - echo ''; - - echo "
    "; - echo "".$lang_label["map_linked"].""; - echo ""; - echo ""; - - echo "
    "; - echo "".$lang_label["parent_item"].""; - echo ""; - echo ""; - - echo "
    "; - echo "".$lang_label["label_color"].""; - echo ""; - echo ""; - - echo ""; - echo "".$lang_label["link_color"].""; - echo "
    "; - - - echo ""; - echo "
    "; - echo ""; - echo "
    "; - echo ""; - - - echo "
    "; - - // Part 3 - List of already assigned report items - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - echo "

    ".$lang_label["report_items"]."

    "; - $sql = "SELECT * FROM tlayout_data WHERE id_layout = $id_map"; - $res=mysql_query($sql); - - if (mysql_num_rows($res)) { - echo ""; - echo " - - - - - - - - - - "; - - $color = 0; - while ($row = mysql_fetch_array($res)){ - // Calculate table line color - if ($color == 1){ - $tdcolor = "datos"; - $color = 0; - } - else { - $tdcolor = "datos2"; - $color = 1; - } - $id_layoutdata = $row["id"]; - $type = $row["type"]; - switch ($type){ - case "0": $type_desc = "Single graph"; break; - case "1": $type_desc = "Module graph"; break; - case "2": $type_desc = "Line"; break; - } - $id_element = $row["id"]; - $period = $row["period"]; - $id_am = $row["id_agente_modulo"]; - $x = $row["pos_x"]; - $y = $row["pos_y"]; - $myimage = $row["image"]; - $width= $row["width"]; - $height = $row["height"]; - $label = $row["label"]; - $name = "N/A"; - $agent_name = "N/A"; - if ($id_am != ""){ - $agent_name = dame_nombre_agente_agentemodulo ($id_am); - $module_name = dame_nombre_modulo_agentemodulo ($id_am); - } - echo ""; - echo ""; - echo ""; - - echo ""; - - echo ""; - - echo "'; - - echo ""; - echo ""; - echo ""; - echo ""; - echo "
    ".$lang_label["type"]."".$lang_label["module_name"]."".$lang_label["label"]."".$lang_label["image"]."".$lang_label["pos_x"]."".$lang_label["pos_y"]."".$lang_label["width"]."".$lang_label["height"]."".$lang_label["delete"]."".$lang_label["update"]."
    ".$type_desc."".$agent_name." / "; - echo $module_name.""; - echo ""; - echo '"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - } - echo "
    "; - } else { - echo "
    ".$lang_label["no_repitem_def"]."
    "; - } +if ($delete_layout_data) { + $ids_layout_data = (array) get_parameter ('ids_layout_data'); + + foreach ($ids_layout_data as $id_layout_data) { + $sql = sprintf ('UPDATE tlayout_data SET parent_item = 0 WHERE parent_item = %d', + $id_layout_data); + $result = mysql_query ($sql); + $sql = sprintf ('DELETE FROM tlayout_data WHERE id = %d', + $id_layout_data); + $result = mysql_query ($sql); } + + if (defined ('AJAX')) { + exit; + } +} + +if ($update_layout_data) { + $id_layout_data = (int) get_parameter ('id_layout_data'); + $layout_data_type = (int) get_parameter ("type"); + $layout_data_label = (string) get_parameter ("label"); + $layout_data_image = (string) get_parameter ("image"); + $layout_data_id_agent_module = (int) get_parameter ("module"); + $layout_data_label_color = (string) get_parameter ("label_color"); + $layout_data_parent_item = (int) get_parameter ("parent_item"); + $layout_data_period = (int) get_parameter ("period"); + $layout_data_map_linked = (int) get_parameter ("map_linked"); + + $sql = sprintf ('UPDATE tlayout_data SET + image = "%s", label = "%s", + label_color = "%s", + id_agente_modulo = %d, + type = %d, parent_item = %d, + period = %d, id_layout_linked = %d + WHERE id = %d', + $layout_data_image, $layout_data_label, + $layout_data_label_color, + $layout_data_id_agent_module, + $layout_data_type, $layout_data_parent_item, + $layout_data_period * 3600, + $layout_data_map_linked, + $id_layout_data); + $result = mysql_query ($sql); + + if ($result) { + echo '

    '.lang_string ("modify_ok").'

    '; + } else { + echo '

    '.lang_string ("modify_no").'

    '; + } +} + +if ($id_layout) { + $layout = get_db_row ('tlayout', 'id', $id_layout); + $name = $layout['name']; + $background = $layout['background']; + $id_group = $layout['id_group']; + $width = $layout['width']; + $height = $layout['height']; +} + +if (! $edit_layout && ! $id_layout) { + echo "

    ".lang_string ("reporting")." > ".lang_string ("map_builder")."

    "; + + $table->width = '500px'; + $table->data = array (); + $table->head = array (); + $table->head[0] = lang_string ('map_name'); + $table->head[1] = lang_string ('group'); + $table->head[2] = lang_string ('delete'); + $table->align = array (); + $table->align[2] = 'center'; + + $maps = get_db_all_rows_in_table ('tlayout'); + foreach ($maps as $map) { + $data = array (); + + $data[0] = ''.$map['name'].''; + $data[1] = ' '; + $data[1] .= dame_nombre_grupo ($map['id_group']); + $data[2] = ' + '; + array_push ($table->data, $data); + } + print_table ($table); + + echo '
    '; + echo '
    '; + print_input_hidden ('edit_layout', 1); + print_submit_button (lang_string ('create'), '', false, 'class="sub wand"'); + echo '
    '; + echo '
    '; } else { - // Map LIST Selection screen - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - echo "

    ".$lang_label["reporting"]." > "; - echo $lang_label["map_builder"]."

    "; - - $color=1; - $sql="SELECT * FROM tlayout"; - $res=mysql_query($sql); + echo "

    ".lang_string ("reporting")." > "; + echo lang_string ("map_builder")."

    "; - if (mysql_num_rows($res)) { - echo ""; - echo " - - - - - - "; - - while ($row = mysql_fetch_array($res)){ - if ((dame_admin($id_user)==1)){ - // Calculate table line color - if ($color == 1){ - $tdcolor = "datos"; - $color = 0; - } - else { - $tdcolor = "datos2"; - $color = 1; - } - echo ""; - echo ""; - echo ""; - echo ""; - $id_map = $row["id"]; - echo ""; - echo ""; - } - } - echo "
    ".$lang_label["map_name"]."".$lang_label["background"]."".$lang_label["size"]."".$lang_label["Manage"]."".$lang_label["delete"]."
    ".$row["name"]."".$row["background"]."".$row["width"]."x".$row["height"]."
    "; - echo ""; - } else { - echo "
    ".$lang_label["no_map_def"]."
    "; - echo "
    "; + $backgrounds_list = list_files ('images/console/background/', "jpg", 1, 0); + $backgrounds_list = array_merge ($backgrounds_list, list_files ('images/console/background/', "png", 1, 0)); + $groups = get_user_groups ($config['id_user']); + + $table->width = '300px'; + $table->data = array (); + $table->data[0][0] = lang_string ('name'); + $table->data[0][1] = print_input_text ('name', $name, '', 15, 50, true); + $table->data[1][0] = lang_string ('group'); + $table->data[1][1] = print_select ($groups, 'id_group', $id_group, '', '', '', true); + $table->data[2][0] = lang_string ('background'); + $table->data[2][1] = print_select ($backgrounds_list, 'background', $background, '', 'None', '', true); + + if ($id_layout) { + $table->data[3][0] = lang_string ('width'); + $table->data[3][1] = print_input_text ('width', $width, '', 3, 5, true); + $table->data[4][0] = lang_string ('height'); + $table->data[4][1] = print_input_text ('height', $height, '', 3, 5, true); + } + echo ''; + print_table ($table); + + echo '
    '; + if ($id_layout) { + print_submit_button (lang_string ('update'), 'update_layout', false, 'class="sub upd"'); + print_input_hidden ('update_layout', 1); + print_input_hidden ('id_layout', $id_layout); + } else { + print_submit_button (lang_string ('create'), 'create_layout', false, 'class="sub wand"'); + print_input_hidden ('create_layout', 1); + } + echo '
    '; + echo ''; + + if ($id_layout) { + /* Show visual map preview */ + echo '

    '.lang_string ('preview').'

    '; + print_pandora_visual_map ($id_layout, false, true); + + $images_list = array (); + $all_images = list_files ('images/console/icons/', "png", 1, 0); + foreach ($all_images as $image_file) { + if (strpos ($image_file, "_bad")) + continue; + if (strpos ($image_file, "_ok")) + continue; + $image_file = substr ($image_file, 0, strlen ($image_file) - 4); + $images_list[$image_file] = $image_file; + } + + echo '
    '; + /* Layout data trash */ + echo '
    '; + echo '
    '; + echo '

    '.lang_string ('Map element trash').'

    '; + echo lang_string ('Drag an element here to delete from the map'); + echo ' '; + print_input_hidden ('delete_layout_data', 1); + print_input_hidden ('id_layout', $id_layout); + + echo '
    '; + print_submit_button (lang_string ('delete'), 'delete_buttons', true, 'class="sub delete"'); + echo '
    '; + echo '
    '; + echo ''; + + /* Layout_data editor form */ + $intervals = array (); + $intervals[1] = lang_string ('Hour'); + $intervals[2] = "2 ".lang_string ('Hours'); + $intervals[3] = "3 ".lang_string ('Hours'); + $intervals[6] = "6 ".lang_string ('Hours'); + $intervals[12] = "12 ".lang_string ('Hours'); + $intervals[24] = lang_string ('Last day'); + $intervals[48] = "2 ". lang_string ('days'); + $intervals[168] = lang_string ('Last week'); + $intervals[360] = lang_string ('15 days'); + $intervals[720] = lang_string ('Last Month'); + $intervals[1440] = lang_string ('Two Months'); + $intervals[4320] = lang_string ('Six Months'); + + $all_agents = get_agents_in_group ($id_group); + $agents = array (); + foreach ($all_agents as $agent) { + $agents[$agent['id_agente']] = $agent['nombre']; + } + asort ($agents); + + echo '
    '; + echo '

    '.lang_string ('Map element editor').'

    '; + echo lang_string ('Drag an element here to edit the properties'); + + $table->data = array (); + $table->id = 'table_layout_data'; + + $table->data[0][0] = lang_string ('label'); + $table->data[0][1] = print_input_text ('label', '', '', 20, 200, true); + $table->data[1][0] = lang_string ('label_color'); + $table->data[1][1] = print_input_text ('label_color', '#000000', '', 7, 7, true); + $table->data[2][0] = lang_string ('type'); + $table->data[2][1] = print_select (get_layout_data_types (), 'type', '', '', '', '', true); + $table->data[3][0] = lang_string ('agent'); + $table->data[3][1] = print_select ($agents, 'agent', '', '', '--', 0, true); + $table->data[4][0] = lang_string ('module'); + $table->data[4][1] = print_select (array (), 'module', '', '', '--', 0, true); + $table->data[5][0] = lang_string ('period'); + $table->data[5][1] = print_select ($intervals, 'period', '', '', '--', 0, true); + $table->data[6][0] = lang_string ('image'); + $table->data[6][1] = print_select ($images_list, 'image', '', '', 'None', '', true); + $table->data[6][1] .= '
    '; + $table->data[7][0] = lang_string ('parent'); + $table->data[7][1] = print_select_from_sql ('SELECT id, label FROM tlayout_data WHERE id_layout = '.$id_layout, + 'parent_item', '', '', 'None', '', true); + $table->data[8][0] = lang_string ('map_linked'); + $table->data[8][1] = print_select_from_sql ('SELECT id, name FROM tlayout WHERE id != '.$id_layout, + 'map_linked', '', '', 'None', '', true); + + echo '
    '; + print_table ($table); + print_input_hidden ('create_layout_data', 1); + print_input_hidden ('update_layout_data', 0); + print_input_hidden ('id_layout', $id_layout); + print_input_hidden ('id_layout_data', 0); + echo '
    '; + print_submit_button (lang_string ('create'), 'create_layout_data_button', false, 'class="sub wand"'); + echo '
    '; + echo ''; + echo '
    '; + echo '
    '; } - echo ""; - echo "
    "; - echo ""; - echo ""; - echo "
    "; } ?> + + + + + + + + + + + diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index e0741c7c8c..0a3308d1d9 100644 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -229,7 +229,6 @@ if ($edit_sla_report_content) { if ($delete_sla) { $id_sla = (int) get_parameter ('id_sla'); $sql = sprintf ('DELETE FROM treport_content_sla_combined WHERE id = %d', $id_sla); - echo $sql; $result = mysql_query ($sql); if ($result) echo "

    ".lang_string ('delete_sla_ok')."

    "; @@ -308,7 +307,6 @@ if ($edit_sla_report_content) { print_submit_button (lang_string ('create'), 'add', false, 'class="sub wand"'); echo '
    '; echo ''; - } else if ($edit_report || $id_report) { /* Edit and creation report form */ if (isset($_POST["id_agent"])) @@ -438,7 +436,6 @@ if ($edit_sla_report_content) { $table->head[6] = lang_string ('delete'); } - $sql = sprintf ('SELECT * FROM treport_content WHERE id_report = %d ORDER BY `order`', $id_report); $report_contents = get_db_all_rows_sqlfree ($sql); if (sizeof ($report_contents)) { diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index 5bab9be85b..80afc8d090 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -19,132 +19,98 @@ // Load global vars require("include/config.php"); -if (comprueba_login() == 0) - if ((give_acl($id_user, 0, "PM")==1) or (dame_admin($id_user)==1)) { - if (isset($_GET["update"])){ - $config["block_size"]=$_POST["block_size"]; - $config["language"]=$_POST["language_code"]; - $config["days_compact"]=$_POST["days_compact"]; - $config["days_purge"]=$_POST["days_purge"]; - $config["graph_res"]=$_POST["graph_res"]; - $config["step_compact"]=$_POST["step_compact"]; - $config["show_unknown"]=$_POST["show_unknown"]; - $config["show_lastalerts"]=$_POST["show_lastalerts"]; - $config["style"] = $_POST["style"]; - $config["remote_config"] = $_POST["remote_config"]; - - $config["graph_color1"] = $_POST["graph_color1"]; - $config["graph_color2"] = $_POST["graph_color2"]; - $config["graph_color3"] = $_POST["graph_color3"]; - - $result2=mysql_query("UPDATE tconfig SET VALUE='".$config["remote_config"]."' WHERE TOKEN='remote_config'"); - $result2=mysql_query("UPDATE tconfig SET VALUE='".$config["block_size"]."' WHERE TOKEN='block_size'"); - $result2=mysql_query("UPDATE tconfig SET VALUE='".$config["language"]."' WHERE TOKEN='language_code'"); - $result2=mysql_query("UPDATE tconfig SET VALUE='".$config["days_purge"]."' WHERE TOKEN='days_purge'"); - $result2=mysql_query("UPDATE tconfig SET VALUE='".$config["days_compact"]." ' WHERE TOKEN='days_compact'"); - $result2=mysql_query("UPDATE tconfig SET VALUE='".$config["graph_res"]."' WHERE TOKEN='graph_res'"); - $result2=mysql_query("UPDATE tconfig SET VALUE='".$config["step_compact"]."' WHERE TOKEN='step_compact'"); - $result2=mysql_query("UPDATE tconfig SET VALUE='".$config["show_unknown"]."' WHERE token='show_unknown'"); - $result2=mysql_query("UPDATE tconfig SET VALUE='".$config["show_lastalerts"]."' WHERE token='show_lastalerts'"); - $result2=mysql_query("UPDATE tconfig SET VALUE='".$config["style"]."' WHERE token='style'"); - $result2=mysql_query("UPDATE tconfig SET VALUE='".$config["graph_color1"]."' WHERE token='graph_color1'"); - $result2=mysql_query("UPDATE tconfig SET VALUE='".$config["graph_color2"]."' WHERE token='graph_color2'"); - $result2=mysql_query("UPDATE tconfig SET VALUE='".$config["graph_color3"]."' WHERE token='graph_color3'"); - - } - echo "

    ".$lang_label["setup_screen"]." > "; - echo $lang_label["general_config"]."

    "; - echo "
    "; - echo ''; - echo ''; - echo ''; - - echo ''; - - echo ''; - - echo ''; - - echo ''; - - echo ''; - - echo ''; - - echo ''; - - echo ''; - echo ''; - - echo ''; - echo ''; - echo ''; - - echo "
    '.$lang_label["language_code"].'
    '.lang_string ("Remote config directory"); - echo '
    '.lang_string("Graph color (min)"); - echo '
    '.lang_string("Graph color (avg)"); - echo '
    '.lang_string("Graph color (max)"); - echo '
    '.$lang_label["days_compact"]; - echo '
    '.$lang_label["days_purge"]; - echo '
    '.$lang_label["graph_res"]; - echo '
    '.$lang_label["step_compact"].'
    '.$lang_label["show_unknown"].'
    '.$lang_label["show_lastalerts"]; - echo '
    '.$lang_label["style_template"].''; - echo ''; - - - echo '
    '.$lang_label["block_size"]; - echo '
    "; - echo ""; - echo ""; - echo "
    "; - echo ''; - echo "
    "; +if (comprueba_login()) { + audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access Database Management"); + require ("general/noaccess.php"); } -else { - audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Database Management"); - require ("general/noaccess.php"); - } +if (! give_acl ($config['id_user'], 0, "PM") || ! dame_admin ($config['id_user'])) { + audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access Database Management"); + require ("general/noaccess.php"); +} + +$update_settings = (bool) get_parameter ('update_settings'); + +if ($update_settings) { + $config["block_size"] = (int) get_parameter ('block_size'); + $config["language"] = (string) get_parameter ('language_code'); + $config["days_compact"] = (int) get_parameter ('days_compact'); + $config["days_purge"] = (int) get_parameter ('days_purge'); + $config["graph_res"] = (int) get_parameter ('graph_res'); + $config["step_compact"] = (int) get_parameter ('step_compact'); + $config["show_unknown"] = (int) get_parameter ('show_unknown'); + $config["show_lastalerts"] = (int) get_parameter ('show_lastalerts'); + $config["style"] = (string) get_parameter ('style', 'pandora.css'); + $config["remote_config"] = (string) get_parameter ('remote_config'); + $config["graph_color1"] = (string) get_parameter ('graph_color1'); + $config["graph_color2"] = (string) get_parameter ('graph_color2'); + $config["graph_color3"] = (string) get_parameter ('graph_color3'); + + $config["style"] = substr ($config["style"], 0, strlen ($config["style"]) - 4); + mysql_query ("UPDATE tconfig SET VALUE='".$config["remote_config"]."' WHERE token = 'remote_config'"); + mysql_query ("UPDATE tconfig SET VALUE='".$config["block_size"]."' WHERE token = 'block_size'"); + mysql_query ("UPDATE tconfig SET VALUE='".$config["language"]."' WHERE token = 'language_code'"); + mysql_query ("UPDATE tconfig SET VALUE='".$config["days_purge"]."' WHERE token = 'days_purge'"); + mysql_query ("UPDATE tconfig SET VALUE='".$config["days_compact"]." ' WHERE token = 'days_compact'"); + mysql_query ("UPDATE tconfig SET VALUE='".$config["graph_res"]."' WHERE token = 'graph_res'"); + mysql_query ("UPDATE tconfig SET VALUE='".$config["step_compact"]."' WHERE token = 'step_compact'"); + mysql_query ("UPDATE tconfig SET VALUE='".$config["show_unknown"]."' WHERE token = 'show_unknown'"); + mysql_query ("UPDATE tconfig SET VALUE='".$config["show_lastalerts"]."' WHERE token = 'show_lastalerts'"); + mysql_query ("UPDATE tconfig SET VALUE='".$config["style"]."' WHERE token = 'style'"); + mysql_query ("UPDATE tconfig SET VALUE='".$config["graph_color1"]."' WHERE token = 'graph_color1'"); + mysql_query ("UPDATE tconfig SET VALUE='".$config["graph_color2"]."' WHERE token = 'graph_color2'"); + mysql_query ("UPDATE tconfig SET VALUE='".$config["graph_color3"]."' WHERE token = 'graph_color3'"); +} + +echo "

    ".lang_string ("setup_screen")." > "; +echo lang_string ("general_config")."

    "; + +$file_styles = list_files('include/styles/', "pandora", 1, 0); + +$table->width = '500px'; +$table->data = array (); +$table->data[0][0] = lang_string ('language_code'); +$table->data[0][1] = print_select_from_sql ('SELECT id_language, name FROM tlanguage', 'language_code', $config["language"], '', '', '', true); +$table->data[1][0] = lang_string ('Remote config directory'); +$table->data[1][1] = print_input_text ('remote_config', $config["remote_config"], '', 30, 100, true); +$table->data[2][0] = lang_string ('Graph color (min)'); +$table->data[2][1] = print_input_text ('graph_color1', $config["graph_color1"], '', 8, 8, true); +$table->data[3][0] = lang_string ('Graph color (avg)'); +$table->data[3][1] = print_input_text ('graph_color2', $config["graph_color2"], '', 8, 8, true); +$table->data[4][0] = lang_string ('Graph color (max)'); +$table->data[4][1] = print_input_text ('graph_color3', $config["graph_color3"], '', 8, 8, true); +$table->data[5][0] = lang_string ('days_compact'); +$table->data[5][1] = print_input_text ('days_compact', $config["days_compact"], '', 5, 5, true); +$table->data[6][0] = lang_string ('days_purge'); +$table->data[6][1] = print_input_text ('days_purge', $config["days_purge"], '', 5, 5, true); +$table->data[7][0] = lang_string ('graph_res'); +$table->data[7][1] = print_input_text ('graph_res', $config["graph_res"], '', 5, 5, true); +$table->data[8][0] = lang_string ('step_compact'); +$table->data[8][1] = print_input_text ('step_compact', $config["step_compact"], '', 5, 5, true); +$table->data[9][0] = lang_string ('show_unknown'); +$table->data[9][1] = print_checkbox ('show_unknown', 1, $config["show_unknown"], true); +$table->data[10][0] = lang_string ('show_lastalerts'); +$table->data[10][1] = print_checkbox ('show_lastalerts', 1, $config["show_lastalerts"], true); +$table->data[11][0] = lang_string ('style_template'); +$table->data[11][1] = print_select ($file_styles, 'style', $config["style"], '', '', '', true); +$table->data[12][0] = lang_string ('block_size'); +$table->data[12][1] = print_input_text ('block_size', $config["block_size"], '', 5, 5, true); + +echo ''; +print_input_hidden ('update_settings', 1); +print_table ($table); +echo '
    '; +print_submit_button (lang_string ('update'), 'update_button', false, 'class="sub upd"'); +echo '
    '; +echo '
    '; +?> + + + + + diff --git a/pandora_console/images/console/background/africa.jpg b/pandora_console/images/console/background/africa.jpg new file mode 100644 index 0000000000..53d799ef89 Binary files /dev/null and b/pandora_console/images/console/background/africa.jpg differ diff --git a/pandora_console/images/console/background/asia.jpg b/pandora_console/images/console/background/asia.jpg new file mode 100644 index 0000000000..5439d4aad2 Binary files /dev/null and b/pandora_console/images/console/background/asia.jpg differ diff --git a/pandora_console/images/console/background/europe.jpg b/pandora_console/images/console/background/europe.jpg new file mode 100644 index 0000000000..9d42bbf751 Binary files /dev/null and b/pandora_console/images/console/background/europe.jpg differ diff --git a/pandora_console/images/console/background/north_america.jpg b/pandora_console/images/console/background/north_america.jpg new file mode 100644 index 0000000000..aa87b5d82e Binary files /dev/null and b/pandora_console/images/console/background/north_america.jpg differ diff --git a/pandora_console/images/console/background/oceania.jpg b/pandora_console/images/console/background/oceania.jpg new file mode 100644 index 0000000000..4afb335505 Binary files /dev/null and b/pandora_console/images/console/background/oceania.jpg differ diff --git a/pandora_console/images/console/background/south_america.jpg b/pandora_console/images/console/background/south_america.jpg new file mode 100644 index 0000000000..8d4af0bd0c Binary files /dev/null and b/pandora_console/images/console/background/south_america.jpg differ diff --git a/pandora_console/images/console/background/world.jpg b/pandora_console/images/console/background/world.jpg new file mode 100644 index 0000000000..8c98f19406 Binary files /dev/null and b/pandora_console/images/console/background/world.jpg differ diff --git a/pandora_console/images/trash.png b/pandora_console/images/trash.png new file mode 100644 index 0000000000..095efd5bf3 Binary files /dev/null and b/pandora_console/images/trash.png differ diff --git a/pandora_console/include/config.php b/pandora_console/include/config.php index 140919c796..f7c3d985e0 100644 --- a/pandora_console/include/config.php +++ b/pandora_console/include/config.php @@ -2,7 +2,7 @@ // Begin of automatic config file $config["dbname"]="pandora"; // MySQL DataBase name $config["dbuser"]="pandora"; // DB User -$config["dbpass"]="wrvjsevp"; // DB Password +$config["dbpass"]="pandora"; // DB Password $config["dbhost"]="localhost"; // DB Host $config["homedir"]="/var/www/pandora_console/"; // Config homedir $config["homeurl"]="http://192.168.13.211/pandora_console"; // Base URL diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 4c5e763b08..5f89be53ef 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -45,6 +45,13 @@ function pandora_help ($help_id, $return = false) { function safe_input ($value) { if (is_numeric ($value)) return $value; + if (is_array ($value)) { + $retval = array (); + foreach ($value as $id => $val) { + $retval[$id] = htmlentities (utf8_decode ($val), ENT_QUOTES); + } + return $retval; + } return htmlentities (utf8_decode ($value), ENT_QUOTES); } @@ -238,27 +245,27 @@ function unmanaged_error ($error = "") { */ function list_files ($directory, $stringSearch, $searchHandler, $return) { $errorHandler = false; - $result = array(); + $result = array (); if (! $directoryHandler = @opendir ($directory)) { echo ("
    \nerror: directory \"$directory\" doesn't exist!\n
    \n"); return $errorHandler = true; } if ($searchHandler == 0) { while (false !== ($fileName = @readdir ($directoryHandler))) { - @array_push ($result, $fileName); + $result[$fileName] = $fileName; } } if ($searchHandler == 1) { while(false !== ($fileName = @readdir ($directoryHandler))) { if(@substr_count ($fileName, $stringSearch) > 0) { - @array_push ($result, $fileName); + $result[$fileName] = $fileName; } } } if (($errorHandler == true) && (@count ($result) === 0)) { echo ("
    \nerror: no filetype \"$fileExtension\" found!\n
    \n"); } else { - sort ($result); + asort ($result); if ($return == 0) { return $result; } diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index bcdf87e6cd..398596f418 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -1401,7 +1401,7 @@ function return_value_agent_module ($id_agentmodule) { * * @return The X axis coordinate value. */ -function return_coordinate_X_layoutdata ($id_layoutdata) { +function get_layoutdata_x ($id_layoutdata) { return (float) get_db_value ('pos_x', 'tlayout_data', 'id', $id_layoutdata); } @@ -1412,7 +1412,7 @@ function return_coordinate_X_layoutdata ($id_layoutdata) { * * @return The X axis coordinate value. */ -function return_coordinate_y_layoutdata ($id_layoutdata){ +function get_layoutdata_y ($id_layoutdata){ return (float) get_db_value ('pos_y', 'tlayout_data', 'id', $id_layoutdata); } @@ -1470,8 +1470,7 @@ function return_moduledata_avg_value ($id_agent_module, $period, $date = 0) { return ($previous_data['datos'] + $sum) / ($total + 1); if ($total > 0) return $sum / $total; - else - return 0; + return 0; } /** diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 0bcb4890db..4c3afff4b2 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -428,7 +428,7 @@ function print_radio_button_extended ($name, $value, $label, $checkedvalue, $dis $output .= ' />'; if ($label != '') { - $output .= '' . "\n"; + $output .= '' . "\n"; } if ($return) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php new file mode 100644 index 0000000000..fd01a9fc23 --- /dev/null +++ b/pandora_console/include/functions_visual_map.php @@ -0,0 +1,139 @@ +"; + $layout_datas = get_db_all_rows_field_filter ('tlayout_data', 'id_layout', $id_layout); + $lines = array (); + + foreach ($layout_datas as $layout_data) { + // Linked to other layout ?? - Only if not module defined + if (($layout_data['id_layout_linked'] != 0) && ($layout_data['id_agente_modulo'] == 0)) { + $status = return_status_layout ($layout_data['id_layout_linked']); + } else { + $id_agent = get_db_value ("id_agente", "tagente_estado", "id_agente_modulo", $layout_data['id_agente_modulo']); + $id_agent_module_parent = get_db_value ("id_agente_modulo", "tlayout_data", "id", $layout_data["parent_item"]); + // Item value + $status = return_status_agent_module ($layout_data['id_agente_modulo']); + if ($layout_data['no_link_color'] == 1) + $status_parent = -1; + else + $status_parent = return_status_agent_module ($id_agent_module_parent); + } + + // STATIC IMAGE (type = 0) + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if ($layout_data['type'] == 0) { + // Link image + //index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1 + + // Draw image + echo '
    '; + if ($show_links) { + if ($layout_data['id_layout_linked'] == "" || $layout_data['id_layout_linked'] == 0) { + echo ""; + } else { + echo ''; + } + } + if ($status == 0) { + if ($layout_data['width'] != "" && $layout_data['width'] != 0) + echo ''; + else + echo ''; + } else { + if ($layout_data['width'] != "" && $layout_data['width'] != 0) + echo ''; + else + echo ''; + } + echo ""; + + // Draw label + echo "
    "; + echo $layout_data['label']; + echo "
    "; + } + // SINGLE GRAPH (type = 1) + if ($layout_data['type'] == 1) { // single graph + + // Draw image + echo '
    '; + if ($show_links) { + if (($layout_data['id_layout_linked'] == "") || ($layout_data['id_layout_linked'] == 0)) { + echo ''; + } else { + echo ''; + } + } + echo ''; + echo ""; + echo "
    "; + } else if ($layout_data['type'] == 2) { + $line['id'] = $layout_data['id']; + $line['x'] = $layout_data['pos_x']; + $line['y'] = $layout_data['pos_y']; + $line['width'] = $layout_data['width']; + $line['height'] = $layout_data['height']; + $line['color'] = $layout_data['label_color']; + array_push ($lines, $line); + } + + // Get parent relationship - Create line data + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if ($layout_data["parent_item"] != "" && $layout_data["parent_item"] != 0) { + $parent_x = get_layoutdata_x ($layout_data["parent_item"]); + $parent_y = get_layoutdata_y ($layout_data["parent_item"]); + $line['id'] = $layout_data['id']; + $line['node_begin'] = 'layout-data-'.$layout_data["parent_item"]; + $line['node_end'] = 'layout-data-'.$layout_data["id"]; + $line['width'] = $parent_x + 15; + $line['height'] = $parent_y + 15; + $line['color'] = $status_parent ? '#00dd00' : '#dd0000'; + array_push ($lines, $line); + } + } + if ($draw_lines) { + /* If you want lines in the map, call using Javascript: + draw_lines (lines, id_div); + on body load, where id_div is the id of the div which holds the map */ + echo "\n".''."\n"; + } + // End main div + echo ""; +} + +function get_layout_data_types () { + $types = array (0 => lang_string ("static_graph"), + 1 => lang_string ("module_graph")); + return $types; +} + +?> diff --git a/pandora_console/include/javascript/jquery.colorpicker.js b/pandora_console/include/javascript/jquery.colorpicker.js new file mode 100644 index 0000000000..1f0516462d --- /dev/null +++ b/pandora_console/include/javascript/jquery.colorpicker.js @@ -0,0 +1,50 @@ +/* jQuery ColorPicker + Written by Virgil Reboton(vreboton@gmail.com) + + ColorPicker function structures and attahcment is base on + jQuery UI Date Picker v3.3beta + by Marc Grabanski (m@marcgrabanski.com) and Keith Wood (kbwood@virginbroadband.com.au). + + ColorPicker render data is base on + http://www.mattkruse.com/javascript/colorpicker/ + by Matt Kruse + +*/ + + +(function($){function colorPicker() +{this._nextId=0;this._inst=[];this._curInst=null;this._colorpickerShowing=false;this._colorPickerDiv=$('
    ');} +$.extend(colorPicker.prototype,{markerClassName:'hasColorPicker',_register:function(inst){var id=this._nextId++;this._inst[id]=inst;return id;},_getInst:function(id){return this._inst[id]||id;},_doKeyDown:function(e){var inst=$.colorPicker._getInst(this._colId);if($.colorPicker._colorpickerShowing){switch(e.keyCode){case 9:$.colorPicker.hideColorPicker();break;case 27:$.colorPicker.hideColorPicker();break;}} +else if(e.keyCode==40){$.colorPicker.showFor(this);}},_resetSample:function(e){var inst=$.colorPicker._getInst(this._colId);inst._sampleSpan.css('background-color',inst._input.value);alert(inst._input.value);},_hasClass:function(element,className){var classes=element.attr('class');return(classes&&classes.indexOf(className)>-1);},showFor:function(control){control=(control.jquery?control[0]:(typeof control=='string'?$(control)[0]:control));var input=(control.nodeName&&control.nodeName.toLowerCase()=='input'?control:this);if($.colorPicker._lastInput==input){return;} +if($.colorPicker._colorpickerShowing){return;} +var inst=$.colorPicker._getInst(input._colId);$.colorPicker.hideColorPicker();$.colorPicker._lastInput=input;if(!$.colorPicker._pos){$.colorPicker._pos=$.colorPicker._findPos(input);$.colorPicker._pos[1]+=input.offsetHeight;} +var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css('position')=='fixed';});if(isFixed&&$.browser.opera){$.colorPicker._pos[0]-=document.documentElement.scrollLeft;$.colorPicker._pos[1]-=document.documentElement.scrollTop;} +inst._colorPickerDiv.css('position',($.blockUI?'static':(isFixed?'fixed':'absolute'))).css('left',$.colorPicker._pos[0]+'px').css('top',$.colorPicker._pos[1]+1+'px');$.colorPicker._pos=null;$.colorPicker._showColorPicker(inst);return this;},_findPos:function(obj){while(obj&&(obj.type=='hidden'||obj.nodeType!=1)){obj=obj.nextSibling;} +var curleft=curtop=0;if(obj&&obj.offsetParent){curleft=obj.offsetLeft;curtop=obj.offsetTop;while(obj=obj.offsetParent){var origcurleft=curleft;curleft+=obj.offsetLeft;if(curleft<0){curleft=origcurleft;} +curtop+=obj.offsetTop;}} +return[curleft,curtop];},_checkExternalClick:function(event){if(!$.colorPicker._curInst) +{return;} +var target=$(event.target);if((target.parents("#colorPickerDiv").length==0)&&$.colorPicker._colorpickerShowing&&!($.blockUI)) +{if(target.text()!=$.colorPicker._curInst._colorPickerDiv.text()) +$.colorPicker.hideColorPicker();}},hideColorPicker:function(s){var inst=this._curInst;if(!inst){return;} +if(this._colorpickerShowing) +{this._colorpickerShowing=false;this._lastInput=null;this._colorPickerDiv.css('position','absolute').css('left','0px').css('top','-1000px');if($.blockUI) +{$.unblockUI();$('body').append(this._colorPickerDiv);} +this._curInst=null;} +if(inst._input[0].value!=$.css(inst._sampleSpan,'background-color')) +{inst._sampleSpan.css('background-color',inst._input[0].value);}},_connectColorPicker:function(target,inst){var input=$(target);if(this._hasClass(input,this.markerClassName)){return;} +$(input).attr('autocomplete','OFF');inst._input=$(input);inst._sampleSpan=$(' ');input.after(inst._sampleSpan);inst._sampleSpan.click(function(){input.focus();});input.focus(this.showFor);input.addClass(this.markerClassName).keydown(this._doKeyDown);input[0]._colId=inst._id;},_showColorPicker:function(id){var inst=this._getInst(id);this._updateColorPicker(inst);inst._colorPickerDiv.css('width',inst._startTime!=null?'10em':'6em');inst._colorPickerDiv.show('fast');if(inst._input[0].type!='hidden') +{inst._input[0].focus();} +this._curInst=inst;this._colorpickerShowing=true;},_updateColorPicker:function(inst){inst._colorPickerDiv.empty().append(inst._generateColorPicker());if(inst._input&&inst._input[0].type!='hidden') +{inst._input[0].focus();$("td.color",inst._timePickerDiv).unbind().mouseover(function(){inst._sampleSpan.css('background-color',$.css(this,'background-color'));}).click(function(){inst._setValue(this);});}}});function ColorPickerInstance() +{this._id=$.colorPicker._register(this);this._input=null;this._colorPickerDiv=$.colorPicker._colorPickerDiv;this._sampleSpan=null;} +$.extend(ColorPickerInstance.prototype,{_get:function(name){return(this._settings[name]!=null?this._settings[name]:$.colorPicker._defaults[name]);},_getValue:function(){if(this._input&&this._input[0].type!='hidden'&&this._input[0].value!="") +{return this._input[0].value;} +return null;},_setValue:function(sel){if(this._input&&this._input[0].type!='hidden') +{this._input[0].value=$.attr(sel,'title');$(this._input[0]).change();} +$.colorPicker.hideColorPicker();},_generateColorPicker:function(){var colors=new Array("#000000","#000033","#000066","#000099","#0000CC","#0000FF","#330000","#330033","#330066","#330099","#3300CC","#3300FF","#660000","#660033","#660066","#660099","#6600CC","#6600FF","#990000","#990033","#990066","#990099","#9900CC","#9900FF","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#003300","#003333","#003366","#003399","#0033CC","#0033FF","#333300","#333333","#333366","#333399","#3333CC","#3333FF","#663300","#663333","#663366","#663399","#6633CC","#6633FF","#993300","#993333","#993366","#993399","#9933CC","#9933FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#006600","#006633","#006666","#006699","#0066CC","#0066FF","#336600","#336633","#336666","#336699","#3366CC","#3366FF","#666600","#666633","#666666","#666699","#6666CC","#6666FF","#996600","#996633","#996666","#996699","#9966CC","#9966FF","#CC6600","#CC6633","#CC6666","#CC6699","#CC66CC","#CC66FF","#FF6600","#FF6633","#FF6666","#FF6699","#FF66CC","#FF66FF","#009900","#009933","#009966","#009999","#0099CC","#0099FF","#339900","#339933","#339966","#339999","#3399CC","#3399FF","#669900","#669933","#669966","#669999","#6699CC","#6699FF","#999900","#999933","#999966","#999999","#9999CC","#9999FF","#CC9900","#CC9933","#CC9966","#CC9999","#CC99CC","#CC99FF","#FF9900","#FF9933","#FF9966","#FF9999","#FF99CC","#FF99FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#66CC00","#66CC33","#66CC66","#66CC99","#66CCCC","#66CCFF","#99CC00","#99CC33","#99CC66","#99CC99","#99CCCC","#99CCFF","#CCCC00","#CCCC33","#CCCC66","#CCCC99","#CCCCCC","#CCCCFF","#FFCC00","#FFCC33","#FFCC66","#FFCC99","#FFCCCC","#FFCCFF","#00FF00","#00FF33","#00FF66","#00FF99","#00FFCC","#00FFFF","#33FF00","#33FF33","#33FF66","#33FF99","#33FFCC","#33FFFF","#66FF00","#66FF33","#66FF66","#66FF99","#66FFCC","#66FFFF","#99FF00","#99FF33","#99FF66","#99FF99","#99FFCC","#99FFFF","#CCFF00","#CCFF33","#CCFF66","#CCFF99","#CCFFCC","#CCFFFF","#FFFF00","#FFFF33","#FFFF66","#FFFF99","#FFFFCC","#EEEEEE","#111111","#222222","#333333","#444444","#555555","#666666","#777777","#888888","#999999","#A5A5A5","#AAAAAA","#BBBBBB","#C3C3C3","#CCCCCC","#D2D2D2","#DDDDDD","#E1E1E1","#FFFFFF");var total=colors.length;var width=18;var html="";for(var i=0;i";} +html+='';if(((i+1)>=total)||(((i+1)%width)==0)) +{html+="";}} +html+="
    ";return html}});$.fn.attachColorPicker=function(){return this.each(function(){var nodeName=this.nodeName.toLowerCase();if(nodeName=='input') +{var inst=new ColorPickerInstance();$.colorPicker._connectColorPicker(this,inst);}});};$.fn.getValue=function(){var inst=(this.length>0?$.colorPicker._getInst(this[0]._colId):null);return(inst?inst._getValue():null);};$.fn.setValue=function(value){var inst=(this.length>0?$.colorPicker._getInst(this[0]._colId):null);if(inst)inst._setValue(value);};$(document).ready(function(){$.colorPicker=new colorPicker();$(document.body).append($.colorPicker._colorPickerDiv).mousedown($.colorPicker._checkExternalClick);});})(jQuery); diff --git a/pandora_console/include/javascript/jquery.countdown.js b/pandora_console/include/javascript/jquery.countdown.js new file mode 100644 index 0000000000..5ed7390237 --- /dev/null +++ b/pandora_console/include/javascript/jquery.countdown.js @@ -0,0 +1,7 @@ +/* http://keith-wood.name/countdown.html + Countdown for jQuery v1.2.2. + Written by Keith Wood (kbwood@virginbroadband.com.au) January 2008. + Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and + MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. + Please attribute the author if you use it. */ +(function($){function Countdown(){this._nextId=0;this._inst=[];this.regional=[];this.regional['']={labels:['Years','Months','Weeks','Days','Hours','Minutes','Seconds'],labelsSingle:['Year','Month','Week','Day','Hour','Minute','Second'],compactLabels:['y','m','w','d'],compactLabelsSingle:['y','m','w','d'],timeSeparator:':'};this._defaults={format:'dHMS',compact:false,description:'',expiryUrl:null,alwaysExpire:false,onExpiry:null,onTick:null,serverTime:null};$.extend(this._defaults,this.regional[''])}$.extend(Countdown.prototype,{markerClassName:'hasCountdown',_register:function(a){var b=this._nextId++;this._inst[b]=a;return b},_getInst:function(a){return this._inst[a]||a},setDefaults:function(a){extendRemove(this._defaults,a||{})},_attachCountdown:function(a,b){a=$(a);if(a.is('.'+this.markerClassName)){return}a.addClass(this.markerClassName);a[0]._cdnId=b._id;b._target=a;this._updateCountdown(b._id)},_updateCountdown:function(a){var b=this._getInst(a);b._target.html(b._generateHTML());var c=b._get('onTick');if(c){c.apply(b._target[0],[b._periods])}var d=(b._since?b._now.getTime()<=b._since.getTime():b._now.getTime()>=b._until.getTime());if(d){if(b._timer||b._get('alwaysExpire')){var e=b._get('onExpiry');if(e){e.apply(b._target[0],[])}var f=b._get('expiryUrl');if(f){window.location=f}}b._timer=null}else{var g=b._get('format');b._timer=setTimeout('$.countdown._updateCountdown('+b._id+')',(g.match('s|S')?1:(g.match('m|M')?30:600))*980)}},_changeCountdown:function(a,b){var c=this._getInst(a._cdnId);if(c){extendRemove(c._settings,b||{});c._adjustSettings();this._updateCountdown(c._id)}},_destroyCountdown:function(a){a=$(a);if(!a.is('.'+this.markerClassName)){return}a.removeClass(this.markerClassName);a.empty();clearTimeout(this._inst[a[0]._cdnId]._timer);this._inst[a[0]._cdnId]=null;a[0]._cdnId=undefined}});var Y=0;var O=1;var W=2;var D=3;var H=4;var M=5;var S=6;function CountdownInstance(a){this._id=$.countdown._register(this);this._target=null;this._timer=null;this._now=null;this._periods=[0,0,0,0,0,0,0];this._settings=extendRemove({},a||{});this._adjustSettings()}$.extend(CountdownInstance.prototype,{_get:function(a){return(this._settings[a]!=null?this._settings[a]:$.countdown._defaults[a])},_adjustSettings:function(){var a=new Date();var b=this._get('serverTime');this._offset=(b?b.getTime()-a.getTime():0);this._since=this._get('since');if(this._since){this._since=this._determineTime(this._since,null);this._since.setMilliseconds(0)}this._until=this._determineTime(this._get('until'),a);this._until.setMilliseconds(0)},_determineTime:function(k,l){var m=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b};var n=function(a,b){return 32-new Date(a,b,32).getDate()};var o=function(a){var b=new Date();var c=b.getFullYear();var d=b.getMonth();var e=b.getDate();var f=b.getHours();var g=b.getMinutes();var h=b.getSeconds();var i=/([+-]?[0-9]+)\s*(s|S|m|M|h|H|d|D|w|W|o|O|y|Y)?/g;var j=i.exec(a);while(j){switch(j[2]||'s'){case's':case'S':h+=parseInt(j[1]);break;case'm':case'M':g+=parseInt(j[1]);break;case'h':case'H':f+=parseInt(j[1]);break;case'd':case'D':e+=parseInt(j[1]);break;case'w':case'W':e+=parseInt(j[1])*7;break;case'o':case'O':d+=parseInt(j[1]);e=Math.min(e,n(c,d));break;case'y':case'Y':c+=parseInt(j[1]);e=Math.min(e,n(c,d));break}j=i.exec(a)}b=new Date(c,d,e,f,g,h,0);return b};return(k==null?l:(typeof k=='string'?o(k):(typeof k=='number'?m(k):k)))},_generateHTML:function(){var b=this._get('format');var c=[];c[Y]=(b.match('y')?'?':(b.match('Y')?'!':null));c[O]=(b.match('o')?'?':(b.match('O')?'!':null));c[W]=(b.match('w')?'?':(b.match('W')?'!':null));c[D]=(b.match('d')?'?':(b.match('D')?'!':null));c[H]=(b.match('h')?'?':(b.match('H')?'!':null));c[M]=(b.match('m')?'?':(b.match('M')?'!':null));c[S]=(b.match('s')?'?':(b.match('S')?'!':null));this._periods=periods=this._calculatePeriods(c,new Date());var d=false;var e=0;for(var f=0;f0);c[f]=(c[f]=='?'&&!d?null:c[f]);e+=(c[f]?1:0)}var g=this._get('compact');var h=(g?this._get('compactLabels'):this._get('labels'));var i=(g?this._get('compactLabelsSingle'):this._get('labelsSingle'))||h;var j=this._get('timeSeparator');var k=this._get('description')||'';var l=function(a){return(a<10?'0':'')+a};var m=function(a){return(c[a]?periods[a]+(periods[a]==1?i[a]:h[a])+' ':'')};var n=function(a){return(c[a]?'
    '+periods[a]+'
    '+(periods[a]==1?i[a]:h[a])+'
    ':'')};return(g?'
    '+m(Y)+m(O)+m(W)+m(D)+(c[H]?l(this._periods[H]):'')+(c[M]?(c[H]?j:'')+l(this._periods[M]):'')+(c[S]?(c[H]||c[M]?j:'')+l(this._periods[S]):''):'
    '+n(Y)+n(O)+n(W)+n(D)+n(H)+n(M)+n(S))+'
    '+(k?'
    '+k+'
    ':'')},_calculatePeriods:function(c,d){this._now=d;this._now.setMilliseconds(0);var e=new Date(this._now.getTime());if(this._since&&d.getTime()this._until.getTime()){this._now=d=e}}e.setTime(e.getTime()-this._offset);var f=[0,0,0,0,0,0,0];if(c[Y]||c[O]){var g=Math.max(0,(e.getFullYear()-d.getFullYear())*12+e.getMonth()-d.getMonth()+(e.getDate())[^>]*$|^#(\w+)$/;var y=/^.[^:#\[\.]*$/;v.fn=v.prototype={init:function(a,b){a=a||document;if(a.nodeType){this[0]=a;this.length=1;return this}else if(typeof a=="string"){var c=x.exec(a);if(c&&(c[1]||!b)){if(c[1])a=v.clean([c[1]],b);else{var d=document.getElementById(c[3]);if(d)if(d.id!=c[3])return v().find(a);else{this[0]=d;this.length=1;return this}else a=[]}}else return new v(b).find(a)}else if(v.isFunction(a))return new v(document)[v.fn.ready?"ready":"load"](a);return this.setArray(a.constructor==Array&&a||(a.jquery||a.length&&a!=window&&!a.nodeType&&a[0]!=undefined&&a[0].nodeType)&&v.makeArray(a)||[a])},jquery:"1.2.4a",size:function(){return this.length},length:0,get:function(a){return a==undefined?v.makeArray(this):this[a]},pushStack:function(a){var b=v(a);b.prevObject=this;return b},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this},each:function(a,b){return v.each(this,a,b)},index:function(a){var b=-1;this.each(function(i){if(this==a)b=i});return b},attr:function(a,b,c){var d=a;if(a.constructor==String)if(b==undefined)return this.length&&v[c||"attr"](this[0],a)||undefined;else{d={};d[a]=b}return this.each(function(i){for(a in d)v.attr(c?this.style:this,a,v.prop(this,d[a],c,i,a))})},css:function(a,b){if((a=='width'||a=='height')&&parseFloat(b)<0)b=undefined;return this.attr(a,b,"curCSS")},text:function(a){if(typeof a!="object"&&a!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(a));var b="";v.each(a||this,function(){v.each(this.childNodes,function(){if(this.nodeType!=8)b+=this.nodeType!=1?this.nodeValue:v.fn.text([this])})});return b},wrapAll:function(b){if(this[0])v(b,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var a=this;while(a.firstChild)a=a.firstChild;return a}).append(this);return this},wrapInner:function(a){return this.each(function(){v(this).contents().wrapAll(a)})},wrap:function(a){return this.each(function(){v(this).wrapAll(a)})},append:function(){return this.domManip(arguments,true,false,function(a){if(this.nodeType==1)this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,true,function(a){if(this.nodeType==1)this.insertBefore(a,this.firstChild)})},before:function(){return this.domManip(arguments,false,false,function(a){this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,false,true,function(a){this.parentNode.insertBefore(a,this.nextSibling)})},end:function(){return this.prevObject||v([])},find:function(b){var c=v.map(this,function(a){return v.find(b,a)});return this.pushStack(/[^+>] [^+>]/.test(b)||b.indexOf("..")>-1?v.unique(c):c)},clone:function(d){var e=this.map(function(){if(v.browser.msie&&!v.isXMLDoc(this)){var a=this.cloneNode(true),container=document.createElement("div");container.appendChild(a);return v.clean([container.innerHTML])[0]}else return this.cloneNode(true)});var f=e.find("*").andSelf().each(function(){if(this[A]!=undefined)this[A]=null});if(d===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var a=v.data(this,"events");for(var b in a)for(var c in a[b])v.event.add(f[i],b,a[b][c],a[b][c].data)});return e},filter:function(b){return this.pushStack(v.isFunction(b)&&v.grep(this,function(a,i){return b.call(a,i)})||v.multiFilter(b,this))},not:function(a){if(a.constructor==String)if(y.test(a))return this.pushStack(v.multiFilter(a,this,true));else a=v.multiFilter(a,this);var b=a.length&&a[a.length-1]!==undefined&&!a.nodeType;return this.filter(function(){return b?v.inArray(this,a)<0:this!=a})},add:function(a){return!a?this:this.pushStack(v.merge(this.get(),a.constructor==String?v(a).get():a.length!=undefined&&(!a.nodeName||v.nodeName(a,"form"))?a:[a]))},is:function(a){return a?v.multiFilter(a,this).length>0:false},hasClass:function(a){return this.is("."+a)},val:function(b){if(b==undefined){if(this.length){var c=this[0];if(v.nodeName(c,"select")){var d=c.selectedIndex,values=[],options=c.options,one=c.type=="select-one";if(d<0)return null;for(var i=one?d:0,max=one?d+1:options.length;i=0||v.inArray(this.name,b)>=0);else if(v.nodeName(this,"select")){var a=b.constructor==Array?b:[b];v("option",this).each(function(){this.selected=(v.inArray(this.value,a)>=0||v.inArray(this.text,a)>=0)});if(!a.length)this.selectedIndex=-1}else this.value=b})},html:function(a){return a==undefined?(this.length?this[0].innerHTML:null):this.empty().append(a)},replaceWith:function(a){return this.after(a).remove()},eq:function(i){return this.slice(i,i+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments))},map:function(b){return this.pushStack(v.map(this,function(a,i){return b.call(a,i,a)}))},andSelf:function(){return this.add(this.prevObject)},data:function(a,b){var c=a.split(".");c[1]=c[1]?"."+c[1]:"";if(b==null){var d=this.triggerHandler("getData"+c[1]+"!",[c[0]]);if(d==undefined&&this.length)d=v.data(this[0],a);return d==null&&c[1]?this.data(c[0]):d}else return this.trigger("setData"+c[1]+"!",[c[0],b]).each(function(){v.data(this,a,b)})},removeData:function(a){return this.each(function(){v.removeData(this,a)})},domManip:function(d,e,f,g){var h=this.length>1,elems;return this.each(function(){if(!elems){elems=v.clean(d,this.ownerDocument);if(f)elems.reverse()}var b=this;if(e&&v.nodeName(this,"table")&&v.nodeName(elems[0],"tr"))b=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var c=v([]);v.each(elems,function(){var a=h?v(this).clone(true)[0]:this;if(v.nodeName(a,"script")){c=c.add(a)}else{if(a.nodeType==1)c=c.add(v("script",a).remove());g.call(b,a)}});c.each(evalScript)})}};v.prototype.init.prototype=v.prototype;function evalScript(i,a){if(a.src)v.ajax({url:a.src,async:false,dataType:"script"});else v.globalEval(a.text||a.textContent||a.innerHTML||"");if(a.parentNode)a.parentNode.removeChild(a)}v.extend=v.fn.extend=function(){var a=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(a.constructor==Boolean){deep=a;a=arguments[1]||{};i=2}if(typeof a!="object"&&typeof a!="function")a={};if(length==1){a=this;i=0}for(;i-1}},swap:function(a,b,c){var d={};for(var e in b){d[e]=a.style[e];a.style[e]=b[e]}c.call(a);for(var e in b)a.style[e]=d[e]},css:function(b,c,d){if(c=="width"||c=="height"){var e,props={position:"absolute",visibility:"hidden",display:"block"},which=c=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){e=c=="width"?b.offsetWidth:b.offsetHeight;var a=0,border=0;v.each(which,function(){a+=parseFloat(v.curCSS(b,"padding"+this,true))||0;border+=parseFloat(v.curCSS(b,"border"+this+"Width",true))||0});e-=Math.round(a+border)}if(v(b).is(":visible"))getWH();else v.swap(b,props,getWH);return Math.max(0,e)}return v.curCSS(b,c,d)},curCSS:function(c,d,e){var f;function color(a){if(!v.browser.safari)return false;var b=document.defaultView.getComputedStyle(a,null);return!b||b.getPropertyValue("color")==""}if(d=="opacity"&&v.browser.msie){f=v.attr(c.style,"opacity");return f==""?"1":f}if(v.browser.opera&&d=="display"){var g=c.style.outline;c.style.outline="0 solid black";c.style.outline=g}if(d.match(/float/i))d=D;if(!e&&c.style&&c.style[d])f=c.style[d];else if(document.defaultView&&document.defaultView.getComputedStyle){if(d.match(/float/i))d="float";d=d.replace(/([A-Z])/g,"-$1").toLowerCase();var h=document.defaultView.getComputedStyle(c,null);if(h&&!color(c))f=h.getPropertyValue(d);else{var j=[],stack=[];for(var a=c;a&&color(a);a=a.parentNode)stack.unshift(a);for(var i=0;i]*?)\/>/g,function(a,b,c){return c.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?a:b+">"});var e=v.trim(d).toLowerCase(),div=k.createElement("div");var f=!e.indexOf("",""]||!e.indexOf("",""]||e.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!e.indexOf("",""]||(!e.indexOf("",""]||!e.indexOf("",""]||v.browser.msie&&[1,"div
    ","
    "]||[0,"",""];div.innerHTML=f[1]+d+f[2];while(f[0]--)div=div.lastChild;if(v.browser.msie){var g=!e.indexOf(""&&e.indexOf("=0;--j)if(v.nodeName(g[j],"tbody")&&!g[j].childNodes.length)g[j].parentNode.removeChild(g[j]);if(/^\s/.test(d))div.insertBefore(k.createTextNode(d.match(/^\s*/)[0]),div.firstChild)}d=v.makeArray(div.childNodes)}if(d.length===0&&(!v.nodeName(d,"form")&&!v.nodeName(d,"select")))return;if(d[0]==undefined||v.nodeName(d,"form")||d.options)l.push(d);else l=v.merge(l,d)});return l},attr:function(c,d,e){if(!c||c.nodeType==3||c.nodeType==8)return undefined;var f=v.isXMLDoc(c)?{}:v.props;if(d=="selected"&&v.browser.safari)c.parentNode.selectedIndex;if(f[d]){if(e!=undefined)c[f[d]]=e;return c[f[d]]}else if(v.browser.msie&&d=="style")return v.attr(c.style,"cssText",e);else if(e==undefined&&v.browser.msie&&v.nodeName(c,"form")&&(d=="action"||d=="method"))return c.getAttributeNode(d).nodeValue;else if(c.tagName){if(e!=undefined){if(d=="type"&&v.nodeName(c,"input")&&c.parentNode)throw"type property can't be changed";c.setAttribute(d,""+e)}if(v.browser.msie&&/href|src/.test(d)&&!v.isXMLDoc(c))return c.getAttribute(d,2);return c.getAttribute(d)}else{if(d=="opacity"&&v.browser.msie){if(e!=undefined){c.zoom=1;c.filter=(c.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(e).toString()=="NaN"?"":"alpha(opacity="+e*100+")")}return c.filter&&c.filter.indexOf("opacity=")>=0?(parseFloat(c.filter.match(/opacity=([^)]*)/)[1])/100).toString():""}d=d.replace(/-([a-z])/ig,function(a,b){return b.toUpperCase()});if(e!=undefined)c[d]=e;return c[d]}},trim:function(a){return(a||"").replace(/^\s+|\s+$/g,"")},makeArray:function(a){var b=[];if(a.constructor!=Array)for(var i=0,length=a.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild)}},function(a,b){v.fn[a]=function(){return this.each(b,arguments)}});v.each(["Height","Width"],function(i,b){var c=b.toLowerCase();v.fn[c]=function(a){return this[0]==window?v.browser.opera&&document.body["client"+b]||v.browser.safari&&window["inner"+b]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+b]||document.body["client"+b]:this[0]==document?Math.max(Math.max(document.body["scroll"+b],document.documentElement["scroll"+b]),Math.max(document.body["offset"+b],document.documentElement["offset"+b])):a==undefined?(this.length?v.css(this[0],c):null):this.css(c,a.constructor==String?a:a+"px")}});var E=v.browser.safari&&parseInt(v.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+E+"+)"),quickID=new RegExp("^("+E+"+)(#)("+E+"+)"),quickClass=new RegExp("^([#.]?)("+E+"*)");v.extend({expr:{"":function(a,i,m){return m[2]=="*"||v.nodeName(a,m[2])},"#":function(a,i,m){return a.getAttribute("id")==m[2]},":":{lt:function(a,i,m){return im[3]-0},nth:function(a,i,m){return m[3]-0==i},eq:function(a,i,m){return m[3]-0==i},first:function(a,i){return i==0},last:function(a,i,m,r){return i==r.length-1},even:function(a,i){return i%2==0},odd:function(a,i){return i%2},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a},"last-child":function(a){return v.nth(a.parentNode.lastChild,1,"previousSibling")==a},"only-child":function(a){return!v.nth(a.parentNode.lastChild,2,"previousSibling")},parent:function(a){return a.firstChild},empty:function(a){return!a.firstChild},contains:function(a,i,m){return(a.textContent||a.innerText||v(a).text()||"").indexOf(m[3])>=0},visible:function(a){return"hidden"!=a.type&&v.css(a,"display")!="none"&&v.css(a,"visibility")!="hidden"},hidden:function(a){return"hidden"==a.type||v.css(a,"display")=="none"||v.css(a,"visibility")=="hidden"},enabled:function(a){return!a.disabled},disabled:function(a){return a.disabled},checked:function(a){return a.checked},selected:function(a){return a.selected||v.attr(a,"selected")},text:function(a){return"text"==a.type},radio:function(a){return"radio"==a.type},checkbox:function(a){return"checkbox"==a.type},file:function(a){return"file"==a.type},password:function(a){return"password"==a.type},submit:function(a){return"submit"==a.type},image:function(a){return"image"==a.type},reset:function(a){return"reset"==a.type},button:function(a){return"button"==a.type||v.nodeName(a,"button")},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},has:function(a,i,m){return v.find(m[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},animated:function(a){return v.grep(v.timers,function(b){return a==b.elem}).length}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+E+"+)")],multiFilter:function(a,b,c){var d,cur=[];while(a&&a!=d){d=a;var f=v.filter(a,b,c);a=f.t.replace(/^\s*,\s*/,"");cur=c?b=f.r:v.merge(cur,f.r)}return cur},find:function(t,a){if(typeof t!="string")return[t];if(a&&a.nodeType!=1&&a.nodeType!=9)return[];a=a||document;var b=[a],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=v.trim(t);var d=false;var e=quickChild;var m=e.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;b[i];i++)for(var c=b[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);b=r;t=t.replace(e,"");if(t.indexOf(" ")==0)continue;d=true}else{e=/^([>+~])\s*(\w*)/i;if((m=e.exec(t))!=null){r=[];var f={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=b.length;j=0;if(!a&&c||a&&!c)b.push(r[i])}return b},filter:function(t,r,b){var d;while(t&&t!=d){d=t;var p=v.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=y.test(m[3])?v.filter(m[3],r,true).r:v(r).not(m[3]);else if(m[1]==".")r=v.classFilter(r,m[2],b);else if(m[1]=="["){var e=[],type=m[3];for(var i=0,rl=r.length;i=0)^b)e.push(a)}r=e}else if(m[1]==":"&&m[2]=="nth-child"){var f={},e=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,d=test[3]-0;for(var i=0,rl=r.length;i=0)h=true;if(h^b)e.push(g)}r=e}else{var j=v.expr[m[1]];if(typeof j=="object")j=j[m[2]];if(typeof j=="string")j=eval("false||function(a,i){return "+j+";}");r=v.grep(r,function(a,i){return j(a,i,m,r)},b)}}return{r:r,t:t}},dir:function(a,b){var c=[];var d=a[b];while(d&&d!=document){if(d.nodeType==1)c.push(d);d=d[b]}return c},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType==1&&++e==b)break;return a},sibling:function(n,a){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!a||n!=a))r.push(n)}return r}});v.event={add:function(e,f,g,h){if(e.nodeType==3||e.nodeType==8)return;if(v.browser.msie&&e.setInterval!=undefined)e=window;if(!g.guid)g.guid=this.guid++;if(h!=undefined){var i=g;g=function(){return i.apply(this,arguments)};g.data=h;g.guid=i.guid}var j=v.data(e,"events")||v.data(e,"events",{}),handle=v.data(e,"handle")||v.data(e,"handle",function(){var a;if(typeof v=="undefined"||v.event.triggered)return a;a=v.event.handle.apply(arguments.callee.elem,arguments);return a});handle.elem=e;v.each(f.split(/\s+/),function(a,b){var c=b.split(".");b=c[0];g.type=c[1];var d=j[b];if(!d){d=j[b]={};if(!v.event.special[b]||v.event.special[b].setup.call(e)===false){if(e.addEventListener)e.addEventListener(b,handle,false);else if(e.attachEvent)e.attachEvent("on"+b,handle)}}d[g.guid]=g;v.event.global[b]=true});e=null},guid:1,global:{},remove:function(d,e,f){if(d.nodeType==3||d.nodeType==8)return;var g=v.data(d,"events"),ret,index;if(g){if(e==undefined||(typeof e=="string"&&e.charAt(0)=="."))for(var h in g)this.remove(d,h+(e||""));else{if(e.type){f=e.handler;e=e.type}v.each(e.split(/\s+/),function(a,b){var c=b.split(".");b=c[0];if(g[b]){if(f)delete g[b][f.guid];else for(f in g[b])if(!c[1]||g[b][f].type==c[1])delete g[b][f];for(ret in g[b])break;if(!ret){if(!v.event.special[b]||v.event.special[b].teardown.call(d)===false){if(d.removeEventListener)d.removeEventListener(b,v.data(d,"handle"),false);else if(d.detachEvent)d.detachEvent("on"+b,v.data(d,"handle"))}ret=null;delete g[b]}}})}for(ret in g)break;if(!ret){var i=v.data(d,"handle");if(i)i.elem=null;v.removeData(d,"events");v.removeData(d,"handle")}}},trigger:function(a,b,c,d,f){b=v.makeArray(b||[]);if(a.indexOf("!")>=0){a=a.slice(0,-1);var g=true}if(!c){if(this.global[a])v("*").add([window,document]).trigger(a,b)}else{if(c.nodeType==3||c.nodeType==8)return undefined;var h,ret,fn=v.isFunction(c[a]||null),event=!b[0]||!b[0].preventDefault;if(event)b.unshift(this.fix({type:a,target:c}));b[0].type=a;if(g)b[0].exclusive=true;if(v.isFunction(v.data(c,"handle")))h=v.data(c,"handle").apply(c,b);if(!fn&&c["on"+a]&&c["on"+a].apply(c,b)===false)h=false;if(event)b.shift();if(f&&v.isFunction(f)){ret=f.apply(c,h==null?b:b.concat(h));if(ret!==undefined)h=ret}if(fn&&d!==false&&h!==false&&!(v.nodeName(c,'a')&&a=="click")){this.triggered=true;try{c[a]()}catch(e){}}this.triggered=false}return h},handle:function(a){var b;a=v.event.fix(a||window.event||{});var c=a.type.split(".");a.type=c[0];var d=v.data(this,"events")&&v.data(this,"events")[a.type],args=Array.prototype.slice.call(arguments,1);args.unshift(a);for(var j in d){var e=d[j];args[0].handler=e;args[0].data=e.data;if(!c[1]&&!a.exclusive||e.type==c[1]){var f=e.apply(this,args);if(b!==false)b=f;if(f===false){a.preventDefault();a.stopPropagation()}}}if(v.browser.msie)a.target=a.preventDefault=a.stopPropagation=a.handler=a.data=null;return b},fix:function(a){var b=a;a=v.extend({},b);a.preventDefault=function(){if(b.preventDefault)b.preventDefault();b.returnValue=false};a.stopPropagation=function(){if(b.stopPropagation)b.stopPropagation();b.cancelBubble=true};if(!a.target)a.target=a.srcElement||document;if(a.target.nodeType==3)a.target=b.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement==a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){var c=document.documentElement,body=document.body;a.pageX=a.clientX+(c&&c.scrollLeft||body&&body.scrollLeft||0)-(c.clientLeft||0);a.pageY=a.clientY+(c&&c.scrollTop||body&&body.scrollTop||0)-(c.clientTop||0)}if(!a.which&&((a.charCode||a.charCode===0)?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button)a.which=(a.button&1?1:(a.button&2?3:(a.button&4?2:0)));return a},special:{ready:{setup:function(){bindReady();return},teardown:function(){return}},mouseenter:{setup:function(){if(v.browser.msie)return false;v(this).bind("mouseover",v.event.special.mouseenter.handler);return true},teardown:function(){if(v.browser.msie)return false;v(this).unbind("mouseover",v.event.special.mouseenter.handler);return true},handler:function(a){if(G(a,this))return true;arguments[0].type="mouseenter";return v.event.handle.apply(this,arguments)}},mouseleave:{setup:function(){if(v.browser.msie)return false;v(this).bind("mouseout",v.event.special.mouseleave.handler);return true},teardown:function(){if(v.browser.msie)return false;v(this).unbind("mouseout",v.event.special.mouseleave.handler);return true},handler:function(a){if(G(a,this))return true;arguments[0].type="mouseleave";return v.event.handle.apply(this,arguments)}}}};v.fn.extend({bind:function(a,b,c){return a=="unload"?this.one(a,b,c):this.each(function(){v.event.add(this,a,c||b,c&&b)})},one:function(b,c,d){return this.each(function(){v.event.add(this,b,function(a){v(this).unbind(a);return(d||c).apply(this,arguments)},d&&c)})},unbind:function(a,b){return this.each(function(){v.event.remove(this,a,b)})},trigger:function(a,b,c){return this.each(function(){v.event.trigger(a,b,this,true,c)})},triggerHandler:function(a,b,c){if(this[0])return v.event.trigger(a,b,this[0],false,c);return undefined},toggle:function(){var b=arguments;return this.click(function(a){this.lastToggle=0==this.lastToggle?1:0;a.preventDefault();return b[this.lastToggle].apply(this,arguments)||false})},hover:function(a,b){return this.bind('mouseenter',a).bind('mouseleave',b)},ready:function(a){bindReady();if(v.isReady)a.call(document,v);else v.readyList.push(function(){return a.call(this,v)});return this}});v.extend({isReady:false,readyList:[],ready:function(){if(!v.isReady){v.isReady=true;if(v.readyList){v.each(v.readyList,function(){this.apply(document)});v.readyList=null}v(document).triggerHandler("ready")}}});var F=false;function bindReady(){if(F)return;F=true;if(document.addEventListener&&!v.browser.opera)document.addEventListener("DOMContentLoaded",v.ready,false);if(v.browser.msie&&window==top)(function(){if(v.isReady)return;try{document.documentElement.doScroll("left")}catch(error){setTimeout(arguments.callee,0);return}v.ready()})();if(v.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(v.isReady)return;for(var i=0;i=0){var g=c.slice(f,c.length);c=c.slice(0,f)}e=e||function(){};var h="GET";if(d)if(v.isFunction(d)){e=d;d=null}else{d=v.param(d);h="POST"}var i=this;v.ajax({url:c,type:h,dataType:"html",data:d,complete:function(a,b){if(b=="success"||b=="notmodified")i.html(g?v("
    ").append(a.responseText.replace(//g,"")).find(g):a.responseText);i.each(e,[a.responseText,b,a])}});return this},serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return v.nodeName(this,"form")?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(i,b){var c=v(this).val();return c==null?null:c.constructor==Array?v.map(c,function(a,i){return{name:b.name,value:a}}):{name:b.name,value:c}}).get()}});v.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){v.fn[o]=function(f){return this.bind(o,f)}});var H=(new Date).getTime();v.extend({get:function(a,b,c,d){if(v.isFunction(b)){c=b;b=null}return v.ajax({type:"GET",url:a,data:b,success:c,dataType:d})},getScript:function(a,b){return v.get(a,null,b,"script")},getJSON:function(a,b,c){return v.get(a,b,c,"json")},post:function(a,b,c,d){if(v.isFunction(b)){c=b;b={}}return v.ajax({type:"POST",url:a,data:b,success:c,dataType:d})},ajaxSetup:function(a){v.extend(v.ajaxSettings,a)},ajaxSettings:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){var c,jsre=/=\?(&|$)/g,status,data;s=v.extend(true,s,v.extend(true,{},v.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=v.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?"}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json"}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){c="jsonp"+H++;if(s.data)s.data=(s.data+"").replace(jsre,"="+c+"$1");s.url=s.url.replace(jsre,"="+c+"$1");s.dataType="script";window[c]=function(a){data=a;success();complete();window[c]=undefined;try{delete window[c]}catch(e){}if(g)g.removeChild(h)}}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get"){var d=(new Date()).getTime();var f=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+d+"$2");s.url=f+((f==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+d:"")}if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null}if(s.global&&!v.active++)v.event.trigger("ajaxStart");if((!s.url.indexOf("http")||!s.url.indexOf("//"))&&s.dataType=="script"&&s.type.toLowerCase()=="get"){var g=document.getElementsByTagName("head")[0];var h=document.createElement("script");h.src=s.url;if(s.scriptCharset)h.charset=s.scriptCharset;if(!c){var i=false;h.onload=h.onreadystatechange=function(){if(!i&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){i=true;success();complete();g.removeChild(h)}}}g.appendChild(h);return undefined}var j=false;var k=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();k.open(s.type,s.url,s.async,s.username,s.password);try{if(s.data)k.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)k.setRequestHeader("If-Modified-Since",v.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");k.setRequestHeader("X-Requested-With","XMLHttpRequest");k.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default)}catch(e){}if(s.beforeSend)s.beforeSend(k);if(s.global)v.event.trigger("ajaxSend",[k,s]);var l=function(a){if(!j&&k&&(k.readyState==4||a=="timeout")){j=true;if(m){clearInterval(m);m=null}status=a=="timeout"&&"timeout"||!v.httpSuccess(k)&&"error"||s.ifModified&&v.httpNotModified(k,s.url)&&"notmodified"||"success";if(status=="success"){try{data=v.httpData(k,s.dataType)}catch(e){status="parsererror"}}if(status=="success"){var b;try{b=k.getResponseHeader("Last-Modified")}catch(e){}if(s.ifModified&&b)v.lastModified[s.url]=b;if(!c)success()}else v.handleError(s,k,status);complete();if(s.async)k=null}};if(s.async){var m=setInterval(l,13);if(s.timeout>0)setTimeout(function(){if(k){k.abort();if(!j)l("timeout")}},s.timeout)}try{k.send(s.data)}catch(e){v.handleError(s,k,null,e)}if(!s.async)l();function success(){if(s.success)s.success(data,status);if(s.global)v.event.trigger("ajaxSuccess",[k,s])}function complete(){if(s.complete)s.complete(k,status);if(s.global)v.event.trigger("ajaxComplete",[k,s]);if(s.global&&!--v.active)v.event.trigger("ajaxStop")}return k},handleError:function(s,a,b,e){if(s.error)s.error(a,b,e);if(s.global)v.event.trigger("ajaxError",[a,s,e])},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||r.status==1223||v.browser.safari&&r.status==undefined}catch(e){}return false},httpNotModified:function(a,b){try{var c=a.getResponseHeader("Last-Modified");return a.status==304||c==v.lastModified[b]||v.browser.safari&&a.status==undefined}catch(e){}return false},httpData:function(r,a){var b=r.getResponseHeader("content-type");var c=a=="xml"||!a&&b&&b.indexOf("xml")>=0;var d=c?r.responseXML:r.responseText;if(c&&d.documentElement.tagName=="parsererror")throw"parsererror";if(a=="script")v.globalEval(d);if(a=="json")d=eval("("+d+")");return d},param:function(a){var s=[];if(a.constructor==Array||a.jquery)v.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value))});else for(var j in a)if(a[j]&&a[j].constructor==Array)v.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this))});else s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+")}});v.fn.extend({show:function(b,c){return b?this.animate({height:"show",width:"show",opacity:"show"},b,c):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(v.css(this,"display")=="none"){var a=v("<"+this.tagName+" />").appendTo("body");this.style.display=a.css("display");if(this.style.display=="none")this.style.display="block";a.remove()}}).end()},hide:function(a,b){return a?this.animate({height:"hide",width:"hide",opacity:"hide"},a,b):this.filter(":visible").each(function(){this.oldblock=this.oldblock||v.css(this,"display");this.style.display="none"}).end()},_toggle:v.fn.toggle,toggle:function(a,b){return v.isFunction(a)&&v.isFunction(b)?this._toggle(a,b):a?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},a,b):this.each(function(){v(this)[v(this).is(":hidden")?"show":"hide"]()})},slideDown:function(a,b){return this.animate({height:"show"},a,b)},slideUp:function(a,b){return this.animate({height:"hide"},a,b)},slideToggle:function(a,b){return this.animate({height:"toggle"},a,b)},fadeIn:function(a,b){return this.animate({opacity:"show"},a,b)},fadeOut:function(a,b){return this.animate({opacity:"hide"},a,b)},fadeTo:function(a,b,c){return this.animate({opacity:b},a,c)},animate:function(h,i,j,k){var l=v.speed(i,j,k);return this[l.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var f=v.extend({},l);var g=v(this).is(":hidden"),self=this;for(var p in h){if(h[p]=="hide"&&g||h[p]=="show"&&!g)return v.isFunction(f.complete)&&f.complete.apply(this);if(p=="height"||p=="width"){f.display=v.css(this,"display");f.overflow=this.style.overflow}}if(f.overflow!=null)this.style.overflow="hidden";f.curAnim=v.extend({},h);v.each(h,function(a,b){var e=new v.fx(self,f,a);if(/toggle|show|hide/.test(b))e[b=="toggle"?g?"show":"hide":b](h);else{var c=b.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(c){var d=parseFloat(c[2]),unit=c[3]||"px";if(unit!="px"){self.style[a]=(d||1)+unit;start=((d||1)/e.cur(true))*start;self.style[a]=start+unit}if(c[1])d=((c[1]=="-="?-1:1)*d)+start;e.custom(start,d,unit)}else e.custom(start,b,"")}});return true})},queue:function(a,b){if(v.isFunction(a)||(a&&a.constructor==Array)){b=a;a="fx"}if(!a||(typeof a=="string"&&!b))return I(this[0],a);return this.each(function(){if(b.constructor==Array)I(this,a,b);else{I(this,a).push(b);if(I(this,a).length==1)b.apply(this)}})},stop:function(a,b){var c=v.timers;if(a)this.queue([]);this.each(function(){for(var i=c.length-1;i>=0;i--)if(c[i].elem==this){if(b)c[i](true);c.splice(i,1)}});if(!b)this.dequeue();return this}});var I=function(a,b,c){if(!a)return undefined;b=b||"fx";var q=v.data(a,b+"queue");if(!q||c)q=v.data(a,b+"queue",c?v.makeArray(c):[]);return q};v.fn.dequeue=function(a){a=a||"fx";return this.each(function(){var q=I(this,a);q.shift();if(q.length)q[0].apply(this)})};v.extend({speed:function(a,b,c){var d=a&&a.constructor==Object?a:{complete:c||!c&&b||v.isFunction(a)&&a,duration:a,easing:c&&b||b&&b.constructor!=Function&&b};d.duration=(d.duration&&d.duration.constructor==Number?d.duration:{slow:600,fast:200}[d.duration])||400;d.old=d.complete;d.complete=function(){if(d.queue!==false)v(this).dequeue();if(v.isFunction(d.old))d.old.apply(this)};return d},easing:{linear:function(p,n,a,b){return a+b*p},swing:function(p,n,a,b){return((-Math.cos(p*Math.PI)/2)+0.5)*b+a}},timers:[],timerId:null,fx:function(a,b,c){this.options=b;this.elem=a;this.prop=c;if(!b.orig)b.orig={}}});v.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(v.fx.step[this.prop]||v.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(v.css(this.elem,this.prop,a));return r&&r>-10000?r:parseFloat(v.curCSS(this.elem,this.prop))||0},custom:function(b,c,d){this.startTime=(new Date()).getTime();this.start=b;this.end=c;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var e=this;function t(a){return e.step(a)}t.elem=this.elem;v.timers.push(t);if(v.timerId==null){v.timerId=setInterval(function(){var a=v.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var b=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)b=false;if(b){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(v.css(this.elem,"display")=="none")this.elem.style.display="block"}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)v.attr(this.elem.style,p,this.options.orig[p])}if(b&&v.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=v.easing[this.options.easing||(v.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};v.fx.step={scrollLeft:function(a){a.elem.scrollLeft=a.now},scrollTop:function(a){a.elem.scrollTop=a.now},opacity:function(a){v.attr(a.elem.style,"opacity",a.now)},_default:function(a){a.elem.style[a.prop]=a.now+a.unit}};v.fn.offset=function(){var b=0,top=0,elem=this[0],results;if(elem)with(v.browser){var c=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(C),fixed=v.css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var d=elem.getBoundingClientRect();add(d.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),d.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop)}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&v.css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent}while(c&&c.tagName&&!/^body|html$/i.test(c.tagName)){if(!/^inline|table.*$/i.test(v.css(c,"display")))add(-c.scrollLeft,-c.scrollTop);if(mozilla&&v.css(c,"overflow")!="visible")border(c);c=c.parentNode}if((safari2&&(fixed||v.css(offsetChild,"position")=="absolute"))||(mozilla&&v.css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop))}results={top:top,left:b}}function border(a){add(v.curCSS(a,"borderLeftWidth",true),v.curCSS(a,"borderTopWidth",true))}function add(l,t){b+=parseInt(l)||0;top+=parseInt(t)||0}return results};v.each(["Height","Width"],function(i,b){var c=b=="Height"?"Top":"Left",br=b=="Height"?"Bottom":"Right";v.fn["inner"+b]=function(){return this[b.toLowerCase()]()+num(this,"padding"+c)+num(this,"padding"+br)};v.fn["outer"+b]=function(a){return this["inner"+b]()+num(this,"border"+c+"Width")+num(this,"border"+br+"Width")+(!!a?num(this,"margin"+c)+num(this,"margin"+br):0)}});function num(a,b){a=a.jquery?a[0]:a;return a&&parseInt(v.curCSS(a,b,true))||0}})(); +(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else +return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else +return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else +selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else +this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else +return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else +jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else +jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
    ","
    "]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else +ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else +while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else +for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
    ").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else +xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else +jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else +for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else +s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else +e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})(); \ No newline at end of file diff --git a/pandora_console/include/javascript/jquery.ui.core.js b/pandora_console/include/javascript/jquery.ui.core.js new file mode 100644 index 0000000000..d459c8668e --- /dev/null +++ b/pandora_console/include/javascript/jquery.ui.core.js @@ -0,0 +1 @@ +(function(C){C.ui={plugin:{add:function(E,F,H){var G=C.ui[E].prototype;for(var D in H){G.plugins[D]=G.plugins[D]||[];G.plugins[D].push([F,H[D]])}},call:function(D,F,E){var H=D.plugins[F];if(!H){return }for(var G=0;G').addClass(D).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[D]=!!((!(/auto|default/).test(E.css("cursor"))||(/^[1-9]/).test(E.css("height"))||(/^[1-9]/).test(E.css("width"))||!(/none/).test(E.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(E.css("backgroundColor"))));try{C("body").get(0).removeChild(E.get(0))}catch(F){}return C.ui.cssCache[D]},disableSelection:function(D){D.unselectable="on";D.onselectstart=function(){return false};if(D.style){D.style.MozUserSelect="none"}},enableSelection:function(D){D.unselectable="off";D.onselectstart=function(){return true};if(D.style){D.style.MozUserSelect=""}},hasScroll:function(G,E){var D=/top/.test(E||"top")?"scrollTop":"scrollLeft",F=false;if(G[D]>0){return true}G[D]=1;F=G[D]>0?true:false;G[D]=0;return F}};var B=C.fn.remove;C.fn.remove=function(){C("*",this).add(this).trigger("remove");return B.apply(this,arguments)};function A(E,F,G){var D=C[E][F].getter||[];D=(typeof D=="string"?D.split(/,?\s+/):D);return(C.inArray(G,D)!=-1)}C.widget=function(E,D){var F=E.split(".")[0];E=E.split(".")[1];C.fn[E]=function(J){var H=(typeof J=="string"),I=Array.prototype.slice.call(arguments,1);if(H&&A(F,E,J)){var G=C.data(this[0],E);return(G?G[J].apply(G,I):undefined)}return this.each(function(){var K=C.data(this,E);if(H&&K&&C.isFunction(K[J])){K[J].apply(K,I)}else{if(!H){C.data(this,E,new C[F][E](this,J))}}})};C[F][E]=function(I,H){var G=this;this.widgetName=E;this.widgetBaseClass=F+"-"+E;this.options=C.extend({disabled:false},C[F][E].defaults,H);this.element=C(I).bind("setData."+E,function(L,J,K){return G.setData(J,K)}).bind("getData."+E,function(K,J){return G.getData(J)}).bind("remove",function(){return G.destroy()});this.init()};C[F][E].prototype=C.extend({},C.widget.prototype,D)};C.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(D){return this.options[D]},setData:function(D,E){this.options[D]=E;if(D=="disabled"){this.element[E?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")}},enable:function(){this.setData("disabled",false)},disable:function(){this.setData("disabled",true)}};C.ui.mouse={mouseInit:function(){var D=this;this.element.bind("mousedown."+this.widgetName,function(E){return D.mouseDown(E)});if(C.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},mouseDestroy:function(){this.element.unbind("."+this.widgetName);(C.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},mouseDown:function(F){(this._mouseStarted&&this.mouseUp(F));this._mouseDownEvent=F;var E=this,G=(F.which==1),D=(typeof this.options.cancel=="string"?C(F.target).is(this.options.cancel):false);if(!G||D||!this.mouseCapture(F)){return true}this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){E._mouseDelayMet=true},this.options.delay)}if(this.mouseDistanceMet(F)&&this.mouseDelayMet(F)){this._mouseStarted=(this.mouseStart(F)!==false);if(!this._mouseStarted){F.preventDefault();return true}}this._mouseMoveDelegate=function(H){return E.mouseMove(H)};this._mouseUpDelegate=function(H){return E.mouseUp(H)};C(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false},mouseMove:function(D){if(C.browser.msie&&!D.button){return this.mouseUp(D)}if(this._mouseStarted){this.mouseDrag(D);return false}if(this.mouseDistanceMet(D)&&this.mouseDelayMet(D)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,D)!==false);(this._mouseStarted?this.mouseDrag(D):this.mouseUp(D))}return !this._mouseStarted},mouseUp:function(D){C(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(D)}return false},mouseDistanceMet:function(D){return(Math.max(Math.abs(this._mouseDownEvent.pageX-D.pageX),Math.abs(this._mouseDownEvent.pageY-D.pageY))>=this.options.distance)},mouseDelayMet:function(D){return this._mouseDelayMet},mouseStart:function(D){},mouseDrag:function(D){},mouseStop:function(D){},mouseCapture:function(D){return true}};C.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery) \ No newline at end of file diff --git a/pandora_console/include/javascript/jquery.ui.datepicker.js b/pandora_console/include/javascript/jquery.ui.datepicker.js index c1f1b3c4d5..e12cf6a459 100644 --- a/pandora_console/include/javascript/jquery.ui.datepicker.js +++ b/pandora_console/include/javascript/jquery.ui.datepicker.js @@ -1,1450 +1 @@ -/* - * jQuery UI Datepicker - * - * Copyright (c) 2006, 2007, 2008 Marc Grabanski - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Datepicker - * - * Depends: - * ui.core.js - * - * Marc Grabanski (m@marcgrabanski.com) and Keith Wood (kbwood@virginbroadband.com.au). - */ - -(function($) { // hide the namespace - -/* Date picker manager. - Use the singleton instance of this class, $.datepicker, to interact with the date picker. - Settings for (groups of) date pickers are maintained in an instance object - (DatepickerInstance), allowing multiple different settings on the same page. */ - -function Datepicker() { - this.debug = false; // Change this to true to start debugging - this._nextId = 0; // Next ID for a date picker instance - this._inst = []; // List of instances indexed by ID - this._curInst = null; // The current instance in use - this._disabledInputs = []; // List of date picker inputs that have been disabled - this._datepickerShowing = false; // True if the popup picker is showing , false if not - this._inDialog = false; // True if showing within a "dialog", false if not - this.regional = []; // Available regional settings, indexed by language code - this.regional[''] = { // Default regional settings - clearText: 'Clear', // Display text for clear link - clearStatus: 'Erase the current date', // Status text for clear link - closeText: 'Close', // Display text for close link - closeStatus: 'Close without change', // Status text for close link - prevText: '<Prev', // Display text for previous month link - prevStatus: 'Show the previous month', // Status text for previous month link - nextText: 'Next>', // Display text for next month link - nextStatus: 'Show the next month', // Status text for next month link - currentText: 'Today', // Display text for current month link - currentStatus: 'Show the current month', // Status text for current month link - monthNames: ['January','February','March','April','May','June', - 'July','August','September','October','November','December'], // Names of months for drop-down and formatting - monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting - monthStatus: 'Show a different month', // Status text for selecting a month - yearStatus: 'Show a different year', // Status text for selecting a year - weekHeader: 'Wk', // Header for the week of the year column - weekStatus: 'Week of the year', // Status text for the week of the year column - dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting - dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting - dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday - dayStatus: 'Set DD as first week day', // Status text for the day of the week selection - dateStatus: 'Select DD, M d', // Status text for the date selection - dateFormat: 'mm/dd/yy', // See format options on parseDate - firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... - initStatus: 'Select a date', // Initial Status text on opening - isRTL: false // True if right-to-left language, false if left-to-right - }; - this._defaults = { // Global defaults for all the date picker instances - showOn: 'focus', // 'focus' for popup on focus, - // 'button' for trigger button, or 'both' for either - showAnim: 'show', // Name of jQuery animation for popup - defaultDate: null, // Used when field is blank: actual date, - // +/-number for offset from today, null for today - appendText: '', // Display text following the input box, e.g. showing the format - buttonText: '...', // Text for trigger button - buttonImage: '', // URL for trigger button image - buttonImageOnly: false, // True if the image appears alone, false if it appears on a button - closeAtTop: true, // True to have the clear/close at the top, - // false to have them at the bottom - mandatory: false, // True to hide the Clear link, false to include it - hideIfNoPrevNext: false, // True to hide next/previous month links - // if not applicable, false to just disable them - changeMonth: true, // True if month can be selected directly, false if only prev/next - changeYear: true, // True if year can be selected directly, false if only prev/next - yearRange: '-10:+10', // Range of years to display in drop-down, - // either relative to current year (-nn:+nn) or absolute (nnnn:nnnn) - changeFirstDay: true, // True to click on day name to change, false to remain as set - showOtherMonths: false, // True to show dates in other months, false to leave blank - showWeeks: false, // True to show week of the year, false to omit - calculateWeek: this.iso8601Week, // How to calculate the week of the year, - // takes a Date and returns the number of the week for it - shortYearCutoff: '+10', // Short year values < this are in the current century, - // > this are in the previous century, - // string value starting with '+' for current year + value - showStatus: false, // True to show status bar at bottom, false to not show it - statusForDate: this.dateStatus, // Function to provide status text for a date - - // takes date and instance as parameters, returns display text - minDate: null, // The earliest selectable date, or null for no limit - maxDate: null, // The latest selectable date, or null for no limit - speed: 'normal', // Speed of display/closure - beforeShowDay: null, // Function that takes a date and returns an array with - // [0] = true if selectable, false if not, - // [1] = custom CSS class name(s) or '', e.g. $.datepicker.noWeekends - beforeShow: null, // Function that takes an input field and - // returns a set of custom settings for the date picker - onSelect: null, // Define a callback function when a date is selected - onClose: null, // Define a callback function when the datepicker is closed - numberOfMonths: 1, // Number of months to show at a time - stepMonths: 1, // Number of months to step back/forward - rangeSelect: false, // Allows for selecting a date range on one date picker - rangeSeparator: ' - ' // Text between two dates in a range - }; - $.extend(this._defaults, this.regional['']); - this._datepickerDiv = $('
    '); -} - -$.extend(Datepicker.prototype, { - /* Class name added to elements to indicate already configured with a date picker. */ - markerClassName: 'hasDatepicker', - - /* Debug logging (if enabled). */ - log: function () { - if (this.debug) - console.log.apply('', arguments); - }, - - /* Register a new date picker instance - with custom settings. */ - _register: function(inst) { - var id = this._nextId++; - this._inst[id] = inst; - return id; - }, - - /* Retrieve a particular date picker instance based on its ID. */ - _getInst: function(id) { - return this._inst[id] || id; - }, - - /* Override the default settings for all instances of the date picker. - @param settings object - the new settings to use as defaults (anonymous object) - @return the manager object */ - setDefaults: function(settings) { - extendRemove(this._defaults, settings || {}); - return this; - }, - - /* Attach the date picker to a jQuery selection. - @param target element - the target input field or division or span - @param settings object - the new settings to use for this date picker instance (anonymous) */ - _attachDatepicker: function(target, settings) { - // check for settings on the control itself - in namespace 'date:' - var inlineSettings = null; - for (attrName in this._defaults) { - var attrValue = target.getAttribute('date:' + attrName); - if (attrValue) { - inlineSettings = inlineSettings || {}; - try { - inlineSettings[attrName] = eval(attrValue); - } catch (err) { - inlineSettings[attrName] = attrValue; - } - } - } - var nodeName = target.nodeName.toLowerCase(); - var instSettings = (inlineSettings ? - $.extend(settings || {}, inlineSettings || {}) : settings); - if (nodeName == 'input') { - var inst = (inst && !inlineSettings ? inst : - new DatepickerInstance(instSettings, false)); - this._connectDatepicker(target, inst); - } else if (nodeName == 'div' || nodeName == 'span') { - var inst = new DatepickerInstance(instSettings, true); - this._inlineDatepicker(target, inst); - } - }, - - /* Detach a datepicker from its control. - @param target element - the target input field or division or span */ - _destroyDatepicker: function(target) { - var nodeName = target.nodeName.toLowerCase(); - var calId = target._calId; - target._calId = null; - var $target = $(target); - if (nodeName == 'input') { - $target.siblings('.ui-datepicker-append').replaceWith('').end() - .siblings('.ui-datepicker-trigger').replaceWith('').end() - .removeClass(this.markerClassName) - .unbind('focus', this._showDatepicker) - .unbind('keydown', this._doKeyDown) - .unbind('keypress', this._doKeyPress); - var wrapper = $target.parents('.ui-datepicker-wrap'); - if (wrapper) - wrapper.replaceWith(wrapper.html()); - } else if (nodeName == 'div' || nodeName == 'span') - $target.removeClass(this.markerClassName).empty(); - if ($('input[_calId=' + calId + ']').length == 0) - // clean up if last for this ID - this._inst[calId] = null; - }, - - /* Enable the date picker to a jQuery selection. - @param target element - the target input field or division or span */ - _enableDatepicker: function(target) { - target.disabled = false; - $(target).siblings('button.ui-datepicker-trigger').each(function() { this.disabled = false; }).end() - .siblings('img.ui-datepicker-trigger').css({opacity: '1.0', cursor: ''}); - this._disabledInputs = $.map(this._disabledInputs, - function(value) { return (value == target ? null : value); }); // delete entry - }, - - /* Disable the date picker to a jQuery selection. - @param target element - the target input field or division or span */ - _disableDatepicker: function(target) { - target.disabled = true; - $(target).siblings('button.ui-datepicker-trigger').each(function() { this.disabled = true; }).end() - .siblings('img.ui-datepicker-trigger').css({opacity: '0.5', cursor: 'default'}); - this._disabledInputs = $.map($.datepicker._disabledInputs, - function(value) { return (value == target ? null : value); }); // delete entry - this._disabledInputs[$.datepicker._disabledInputs.length] = target; - }, - - /* Is the first field in a jQuery collection disabled as a datepicker? - @param target element - the target input field or division or span - @return boolean - true if disabled, false if enabled */ - _isDisabledDatepicker: function(target) { - if (!target) - return false; - for (var i = 0; i < this._disabledInputs.length; i++) { - if (this._disabledInputs[i] == target) - return true; - } - return false; - }, - - /* Update the settings for a date picker attached to an input field or division. - @param target element - the target input field or division or span - @param name string - the name of the setting to change or - object - the new settings to update - @param value any - the new value for the setting (omit if above is an object) */ - _changeDatepicker: function(target, name, value) { - var settings = name || {}; - if (typeof name == 'string') { - settings = {}; - settings[name] = value; - } - if (inst = this._getInst(target._calId)) { - extendRemove(inst._settings, settings); - this._updateDatepicker(inst); - } - }, - - /* Set the dates for a jQuery selection. - @param target element - the target input field or division or span - @param date Date - the new date - @param endDate Date - the new end date for a range (optional) */ - _setDateDatepicker: function(target, date, endDate) { - if (inst = this._getInst(target._calId)) { - inst._setDate(date, endDate); - this._updateDatepicker(inst); - } - }, - - /* Get the date(s) for the first entry in a jQuery selection. - @param target element - the target input field or division or span - @return Date - the current date or - Date[2] - the current dates for a range */ - _getDateDatepicker: function(target) { - var inst = this._getInst(target._calId); - if (inst) { - inst._setDateFromField($(target)); - } - return (inst ? inst._getDate() : null); - }, - - /* Handle keystrokes. */ - _doKeyDown: function(e) { - var inst = $.datepicker._getInst(this._calId); - if ($.datepicker._datepickerShowing) - switch (e.keyCode) { - case 9: $.datepicker._hideDatepicker(null, ''); - break; // hide on tab out - case 13: $.datepicker._selectDay(inst, inst._selectedMonth, inst._selectedYear, - $('td.ui-datepicker-days-cell-over', inst._datepickerDiv)[0]); - return false; // don't submit the form - break; // select the value on enter - case 27: $.datepicker._hideDatepicker(null, inst._get('speed')); - break; // hide on escape - case 33: $.datepicker._adjustDate(inst, - (e.ctrlKey ? -1 : -inst._get('stepMonths')), (e.ctrlKey ? 'Y' : 'M')); - break; // previous month/year on page up/+ ctrl - case 34: $.datepicker._adjustDate(inst, - (e.ctrlKey ? +1 : +inst._get('stepMonths')), (e.ctrlKey ? 'Y' : 'M')); - break; // next month/year on page down/+ ctrl - case 35: if (e.ctrlKey) $.datepicker._clearDate(inst); - break; // clear on ctrl+end - case 36: if (e.ctrlKey) $.datepicker._gotoToday(inst); - break; // current on ctrl+home - case 37: if (e.ctrlKey) $.datepicker._adjustDate(inst, -1, 'D'); - break; // -1 day on ctrl+left - case 38: if (e.ctrlKey) $.datepicker._adjustDate(inst, -7, 'D'); - break; // -1 week on ctrl+up - case 39: if (e.ctrlKey) $.datepicker._adjustDate(inst, +1, 'D'); - break; // +1 day on ctrl+right - case 40: if (e.ctrlKey) $.datepicker._adjustDate(inst, +7, 'D'); - break; // +1 week on ctrl+down - } - else if (e.keyCode == 36 && e.ctrlKey) // display the date picker on ctrl+home - $.datepicker._showDatepicker(this); - }, - - /* Filter entered characters - based on date format. */ - _doKeyPress: function(e) { - var inst = $.datepicker._getInst(this._calId); - var chars = $.datepicker._possibleChars(inst._get('dateFormat')); - var chr = String.fromCharCode(e.charCode == undefined ? e.keyCode : e.charCode); - return e.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); - }, - - /* Attach the date picker to an input field. */ - _connectDatepicker: function(target, inst) { - var input = $(target); - if (input.is('.' + this.markerClassName)) - return; - var appendText = inst._get('appendText'); - var isRTL = inst._get('isRTL'); - if (appendText) { - if (isRTL) - input.before('' + appendText); - else - input.after('' + appendText); - } - var showOn = inst._get('showOn'); - if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field - input.focus(this._showDatepicker); - if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked - input.wrap(''); - var buttonText = inst._get('buttonText'); - var buttonImage = inst._get('buttonImage'); - var trigger = $(inst._get('buttonImageOnly') ? - $('').addClass('ui-datepicker-trigger').attr({ src: buttonImage, alt: buttonText, title: buttonText }) : - $('
    "}}html+=(showStatus?'
    '+(this._get("initStatus")||" ")+"
    ":"")+(!closeAtTop&&!this._inline?controls:"")+'
    '+($.browser.msie&&parseInt($.browser.version)<7&&!this._inline?'':"");return html},_generateMonthYearHeader:function(drawMonth,drawYear,minDate,maxDate,selectedDate,secondary){minDate=(this._rangeStart&&minDate&&selectedDate";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){html+='"}}html+=""}if(secondary||!this._get("changeYear")){html+=drawYear}else{var years=this._get("yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=new Date().getFullYear()+parseInt(years[0],10);endYear=new Date().getFullYear()+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='"}html+="
    ";return html},_addStatus:function(text){return" onmouseover=\"jQuery('#ui-datepicker-status-"+this._id+"').html('"+text+"');\" onmouseout=\"jQuery('#ui-datepicker-status-"+this._id+"').html(' ');\""},_adjustDate:function(offset,period){var year=this._drawYear+(period=="Y"?offset:0);var month=this._drawMonth+(period=="M"?offset:0);var day=Math.min(this._selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=new Date(year,month,day);var minDate=this._getMinMaxDate("min",true);var maxDate=this._getMinMaxDate("max");date=(minDate&&datemaxDate?maxDate:date);this._selectedDay=date.getDate();this._drawMonth=this._selectedMonth=date.getMonth();this._drawYear=this._selectedYear=date.getFullYear()},_getNumberOfMonths:function(){var numMonths=this._get("numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(minMax,checkRange){var date=this._determineDate(minMax+"Date",null);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return date||(checkRange?this._rangeStart:null)},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(offset,curYear,curMonth){var numMonths=this._getNumberOfMonths();var date=new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1);if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(date)},_isInRange:function(date){var newMinDate=(!this._rangeStart?null:new Date(this._selectedYear,this._selectedMonth,this._selectedDay));newMinDate=(newMinDate&&this._rangeStart=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(){var shortYearCutoff=this._get("shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get("dayNamesShort"),dayNames:this._get("dayNames"),monthNamesShort:this._get("monthNamesShort"),monthNames:this._get("monthNames")}},_formatDate:function(day,month,year){if(!day){this._currentDay=this._selectedDay;this._currentMonth=this._selectedMonth;this._currentYear=this._selectedYear}var date=(day?(typeof day=="object"?day:new Date(year,month,day)):new Date(this._currentYear,this._currentMonth,this._currentDay));return $.datepicker.formatDate(this._get("dateFormat"),date,this._getFormatConfig())}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null){target[name]=null}}return target}$.fn.datepicker=function(options){var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$(document).ready(function(){$(document.body).append($.datepicker._datepickerDiv).mousedown($.datepicker._checkExternalClick)})})(jQuery) \ No newline at end of file diff --git a/pandora_console/include/javascript/jquery.ui.draggable.js b/pandora_console/include/javascript/jquery.ui.draggable.js new file mode 100644 index 0000000000..f4610f037d --- /dev/null +++ b/pandora_console/include/javascript/jquery.ui.draggable.js @@ -0,0 +1 @@ +(function(A){A.widget("ui.draggable",A.extend(A.ui.mouse,{init:function(){var B=this.options;if(B.helper=="original"&&!(/(relative|absolute|fixed)/).test(this.element.css("position"))){this.element.css("position","relative")}this.element.addClass("ui-draggable");(B.disabled&&this.element.addClass("ui-draggable-disabled"));this.mouseInit()},mouseStart:function(F){var H=this.options;if(this.helper||H.disabled||A(F.target).is(".ui-resizable-handle")){return false}var C=!this.options.handle||!A(this.options.handle,this.element).length?true:false;A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==F.target){C=true}});if(!C){return false}if(A.ui.ddmanager){A.ui.ddmanager.current=this}this.helper=A.isFunction(H.helper)?A(H.helper.apply(this.element[0],[F])):(H.helper=="clone"?this.element.clone():this.element);if(!this.helper.parents("body").length){this.helper.appendTo((H.appendTo=="parent"?this.element[0].parentNode:H.appendTo))}if(this.helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(this.helper.css("position"))){this.helper.css("position","absolute")}this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};this.cssPosition=this.helper.css("position");this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:F.pageX-this.offset.left,top:F.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.offsetParent[0]==document.body&&A.browser.mozilla){B={top:0,left:0}}this.offset.parent={top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};var E=this.element.position();this.offset.relative=this.cssPosition=="relative"?{top:E.top-(parseInt(this.helper.css("top"),10)||0)+this.offsetParent[0].scrollTop,left:E.left-(parseInt(this.helper.css("left"),10)||0)+this.offsetParent[0].scrollLeft}:{top:0,left:0};this.originalPosition=this.generatePosition(F);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(H.cursorAt){if(H.cursorAt.left!=undefined){this.offset.click.left=H.cursorAt.left+this.margins.left}if(H.cursorAt.right!=undefined){this.offset.click.left=this.helperProportions.width-H.cursorAt.right+this.margins.left}if(H.cursorAt.top!=undefined){this.offset.click.top=H.cursorAt.top+this.margins.top}if(H.cursorAt.bottom!=undefined){this.offset.click.top=this.helperProportions.height-H.cursorAt.bottom+this.margins.top}}if(H.containment){if(H.containment=="parent"){H.containment=this.helper[0].parentNode}if(H.containment=="document"||H.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(H.containment=="document"?document:window).width()-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),(A(H.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}if(!(/^(document|window|parent)$/).test(H.containment)){var D=A(H.containment)[0];var G=A(H.containment).offset();this.containment=[G.left+(parseInt(A(D).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left,G.top+(parseInt(A(D).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top,G.left+Math.max(D.scrollWidth,D.offsetWidth)-(parseInt(A(D).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),G.top+Math.max(D.scrollHeight,D.offsetHeight)-(parseInt(A(D).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}}this.propagate("start",F);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(A.ui.ddmanager&&!H.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,F)}this.helper.addClass("ui-draggable-dragging");this.mouseDrag(F);return true},convertPositionTo:function(C,D){if(!D){D=this.position}var B=C=="absolute"?1:-1;return{top:(D.top+this.offset.relative.top*B+this.offset.parent.top*B-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollTop)*B+(this.cssPosition=="fixed"?this.offsetParent[0].scrollTop:0)*B+this.margins.top*B),left:(D.left+this.offset.relative.left*B+this.offset.parent.left*B-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollLeft)*B+(this.cssPosition=="fixed"?this.offsetParent[0].scrollLeft:0)*B+this.margins.left*B)}},generatePosition:function(E){var F=this.options;var B={top:(E.pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollTop)-(this.cssPosition=="fixed"?this.offsetParent[0].scrollTop:0)),left:(E.pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollLeft)-(this.cssPosition=="fixed"?this.offsetParent[0].scrollLeft:0))};if(!this.originalPosition){return B}if(this.containment){if(B.leftthis.containment[2]){B.left=this.containment[2]}if(B.top>this.containment[3]){B.top=this.containment[3]}}if(F.grid){var D=this.originalPosition.top+Math.round((B.top-this.originalPosition.top)/F.grid[1])*F.grid[1];B.top=this.containment?(!(Dthis.containment[3])?D:(!(Dthis.containment[2])?C:(!(C
    ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body")})},stop:function(C,B){A("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this)})}});A.ui.plugin.add("draggable","scroll",{start:function(D,C){var E=C.options;var B=A(this).data("draggable");E.scrollSensitivity=E.scrollSensitivity||20;E.scrollSpeed=E.scrollSpeed||20;B.overflowY=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-y"))){return F}F=F.parent()}while(F[0].parentNode);return A(document)}(this);B.overflowX=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-x"))){return F}F=F.parent()}while(F[0].parentNode);return A(document)}(this);if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){B.overflowYOffset=B.overflowY.offset()}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){B.overflowXOffset=B.overflowX.offset()}},drag:function(D,C){var E=C.options;var B=A(this).data("draggable");if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){if((B.overflowYOffset.top+B.overflowY[0].offsetHeight)-D.pageY=0;H--){var E=I.snapElements[H].left,B=E+I.snapElements[H].width,R=I.snapElements[H].top,M=R+I.snapElements[H].height;if(!((E-L=K&&I<=G)||(H>=K&&H<=G)||(IG))&&((D>=E&&D<=B)||(C>=E&&C<=B)||(DB));break;default:return false;break}};A.ui.ddmanager={current:null,droppables:[],prepareOffsets:function(D,F){var B=A.ui.ddmanager.droppables;var E=F?F.type:null;for(var C=0;C/g,">"); return ta.value; } + diff --git a/pandora_console/include/javascript/pandora_visual_console.js b/pandora_console/include/javascript/pandora_visual_console.js new file mode 100644 index 0000000000..b14d310aba --- /dev/null +++ b/pandora_console/include/javascript/pandora_visual_console.js @@ -0,0 +1,83 @@ +/************************************** + These functions require jQuery library + **************************************/ + +/** + * Draw a line between two elements in a div + * + * @param line Line to draw. JavaScript object with the following properties: + - x1 X coordinate of the first point. If not set, it will get the coord from node_begin position + - y1 Y coordinate of the first point. If not set, it will get the coord from node_begin position + - x2 X coordinate of the second point. If not set, it will get the coord from node_end position + - y2 Y coordinate of the second point. If not set, it will get the coord from node_end position + - color Color of the line to draw + - node_begin Id of the beginning node + - node_end Id of the finishing node + * @param id_div Div to draw the lines in + */ +function draw_line (line, id_div) { + div = document.getElementById (id_div); + brush = new jsGraphics (div); + brush.setStroke (2); + brush.setColor (line['color']); + if (line['x1']) { + x1 = line['x']; + } else { + x1 = parseInt ($('#'+line['node_begin']).css ('margin-left')) + 15; + } + if (line['y1']) { + y1 = line['y1']; + } else { + y1 = parseInt ($('#'+line['node_begin']).css ('margin-top')) + 15; + } + if (line['x2']) { + x2 = line['x2']; + } else { + x2 = parseInt ($('#'+line['node_end']).css ('margin-left')) + 15; + } + if (line['y2']) { + y2 = line['y2']; + } else { + y2 = parseInt ($('#'+line['node_end']).css ('margin-top')) + 15; + } + brush.drawLine (x1, y1, x2, y2); + brush.paint (); +} + +/** + * Draw all the lines in an array on a div + * + * @param lines Array with lines objects (see draw_line) + * @param id_div Div to draw the lines in + */ +function draw_lines (lines, id_div) { + jQuery.each (lines, function () { + draw_line (this, id_div); + }); +} + +/** + * Delete all the lines on a div + * + * The lines has the class 'map-line', so all the elements with this + * class are removed. + * + * @param id_div Div to delete the lines in + */ +function delete_lines (id_div) { + $('#' + id_div + ' .map-line').remove (); +} + + +/** + * Re-draw all the lines in an array on a div + * + * It deletes all the lines and create then again. + * + * @param lines Array with lines objects (see draw_line) + * @param id_div Div to draw the lines in + */ +function refresh_lines (lines, id_div) { + delete_lines (id_div); + draw_lines (lines, id_div); +} diff --git a/pandora_console/include/javascript/wz_jsgraphics.js b/pandora_console/include/javascript/wz_jsgraphics.js index f8e8e702e4..d0c3814b21 100644 --- a/pandora_console/include/javascript/wz_jsgraphics.js +++ b/pandora_console/include/javascript/wz_jsgraphics.js @@ -87,7 +87,7 @@ function pntN() function mkDiv(x, y, w, h) { - this.htm += ''; if (isset($_GET["sec"]) && $_GET["sec"] == "estado"){ @@ -48,14 +48,14 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { } else { echo ""; + echo ""; if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/agentes/estado_grupo"){ echo ""; if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/agentes/networkmap"){ echo "
    "; @@ -69,28 +69,28 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { } else { echo ""; + echo "
    "; if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/agentes/estado_alertas"){ echo "
    "; } else { echo ""; + echo "
    "; if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/agentes/status_monitor") { echo ""; if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/agentes/exportdata") { echo "
    "; } else { echo ""; + echo "
    "; } @@ -101,7 +101,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { echo '
    '; } echo '
    '; + echo ''.lang_string ("visual_console").''; if ( isset($_GET["sec"]) && $_GET["sec"] == "visualc") { $sql="SELECT * FROM tlayout"; @@ -127,7 +127,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { echo '
    '; } echo '
    '; + echo ''.lang_string ("view_servers").''; } @@ -138,7 +138,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "IR")==1) { } else { echo ''; + echo ''; if (isset($_GET["sec"]) && $_GET["sec"] == "incidencias"){ if(isset($_GET["sec2"]) && $_GET["sec2"] == "operation/incidents/incident_search") { @@ -146,14 +146,14 @@ if (give_acl($_SESSION["id_usuario"], 0, "IR")==1) { } else { echo ""; + echo ""; if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/incidents/incident_statistics") { echo "
    "; } else { echo ""; + echo "
    "; } } @@ -167,7 +167,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { } else { echo ''; + echo ''; // Event statistics submenu if (isset($_GET["sec"]) && $_GET["sec"] == "eventos"){ if(isset($_GET["sec2"]) && $_GET["sec2"] == "operation/events/event_statistics") { @@ -175,7 +175,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { } else { echo ""; + echo ""; } // Users @@ -184,7 +184,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { } else { echo ''; + echo ''; // User edit (submenu) if (isset($_GET["sec"]) && $_GET["sec"] == "usuarios"){ @@ -193,7 +193,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { } else { echo ""; + echo ""; // User statistics require UM if (give_acl($_SESSION["id_usuario"], 0, "UM")==1) { @@ -202,7 +202,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { } else { echo ""; + echo ""; } } @@ -212,7 +212,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { } else { echo ''; + echo ''; if ((give_acl($_SESSION["id_usuario"], 0, "AW")==1)){ // SNMP Console alert (submenu) @@ -222,7 +222,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { } else { echo ""; + echo ""; } } @@ -232,7 +232,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { } else { echo ''; + echo ''; // New message (submenu) if (isset($_GET["sec"]) && $_GET["sec"] == "messages"){ @@ -241,7 +241,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { } else { echo ""; + echo ""; } // Reporting @@ -258,7 +258,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { } else { echo '
  • '; } - echo ''. $lang_label["reporting"].'
  • '; + echo ''. lang_string ("reporting").''; // Custom reporting if (isset($_GET["sec"]) && $_GET["sec"] == "reporting"){ @@ -269,7 +269,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { } else { echo ""; + echo ""; } // Custom graph viewer @@ -279,7 +279,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) { } else { echo ""; + echo ""; } } diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php index fe3ac6cb98..4711a7857e 100644 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -1,4 +1,4 @@ -'; + diff --git a/pandora_console/operation/visual_console/index.php b/pandora_console/operation/visual_console/index.php index f4a804a20b..b2a594213e 100644 --- a/pandora_console/operation/visual_console/index.php +++ b/pandora_console/operation/visual_console/index.php @@ -29,45 +29,39 @@ if (comprueba_login() != 0) { echo "

    ".$lang_label["visual_console"]." > "; echo $lang_label["summary"]."

    "; -$sql="SELECT * FROM tlayout"; -$res=mysql_query($sql); -if (mysql_num_rows($res)) { +$layouts = get_db_all_rows_in_table ('tlayout'); - echo ""; - echo " - - - - "; - $color=1; - while ($row = mysql_fetch_array($res)){ - // Calculate table line color - if ($color == 1){ - $tdcolor = "datos"; - $color = 0; - } - else { - $tdcolor = "datos2"; - $color = 1; - } - echo ""; - // Name - echo ""; - $id_layout = $row["id"]; - // Group - echo ""; - // # elements - $sql2="SELECT COUNT(*) FROM tlayout_data WHERE id_layout = $id_layout"; - $res2=mysql_query($sql2); - $row2 = mysql_fetch_array($res2); - echo ""; - // View icon - echo ""; - } - echo "
    ".$lang_label["name"]."".$lang_label["group"]."".$lang_label["elements"]."".$lang_label["view"]."
    ".$row["name"]."".$row2[0]."
    "; -} else { +if (sizeof ($layouts) == 0) { echo "
    ".$lang_label["no_layout_def"]."
    "; + return; } +$table->width = '500px'; +$table->data = array (); +$table->head = array (); +$table->head[0] = lang_string ('name'); +$table->head[1] = lang_string ('group'); +$table->head[2] = lang_string ('elements'); +$table->head[3] = lang_string ('view'); +$table->align = array (); +$table->align[2] = 'center'; +$table->align[3] = 'center'; + +foreach ($layouts as $layout) { + $data = array (); + + $data[0] = $layout['name']; + $data[1] = ' '; + $data[1] .= dame_nombre_grupo ($layout["id_group"]); + $data[2] = get_db_value ('COUNT(*)', 'tlayout_data', 'id_layout', $layout['id']); + $data[3] = ''; + + array_push ($table->data, $data); +} + +print_table ($table); + ?> diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php index 838630a8b0..1c596f0a29 100644 --- a/pandora_console/operation/visual_console/render_view.php +++ b/pandora_console/operation/visual_console/render_view.php @@ -1,4 +1,4 @@ -".$layout_name; if ($config["pure"] == 0){ - echo lang_string("Full screen mode"); - echo " "; - echo ""; - echo ""; - echo ""; + echo lang_string("Full screen mode"); + echo " "; + echo ""; + echo ""; + echo ""; } else { - echo lang_string("Back to normal mode"); - echo " "; - echo ""; - echo ""; - echo ""; + echo lang_string("Back to normal mode"); + echo " "; + echo ""; + echo ""; + echo ""; } echo ""; -echo "
    "; -$sql="SELECT * FROM tlayout_data WHERE id_layout = $id_layout"; -$res=mysql_query($sql); -$lines = 0; -while ($row = mysql_fetch_array($res)){ - $id_agentmodule = $row["id_agente_modulo"]; - $pos_x = $row["pos_x"]; - $pos_y = $row["pos_y"]; - $height = $row["height"]; - $width = $row["width"]; - $period = $row["period"]; - $image = $row["image"]; - $type = $row["type"]; - $label = $row["label"]; - $label_color = $row["label_color"]; - $parent_item = $row["parent_item"]; - $link_layout = $row["id_layout_linked"]; - $no_link_color = $row["no_link_color"]; - - // Linked to other layout ?? - Only if not module defined - if (($link_layout != 0) && ($id_agentmodule == 0)) { - $status = return_status_layout ($link_layout); - } else { - $id_agent = get_db_value ("id_agente", "tagente_estado", "id_agente_modulo", $id_agentmodule); - $id_agent_module_parent = get_db_value ("id_agente_modulo", "tlayout_data", "id", $parent_item); - // Item value - $status = return_status_agent_module ($id_agentmodule); - if ($no_link_color == 1) - $status_parent = -1; - else - $status_parent = return_status_agent_module ($id_agent_module_parent); - } - - // STATIC IMAGE (type = 0) - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - if ($type == 0) { - // Link image - //index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1 - if (($link_layout == "") OR ($link_layout == 0)){ - $link_string = ""; - } else { - $link_string = ""; - } - // Draw image - echo ""; - } - // SINGLE GRAPH (type = 1) - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - if ($type == 1) { // single graph - if (($link_layout == "") OR ($link_layout == 0)){ - $link_string = ""; - } else { - $link_string = ""; - } - // Draw image - echo ""; - } - if ($type == 2){ - $lines_data[$lines][0]=$pos_x; - $lines_data[$lines][1]=$pos_y; - $lines_data[$lines][2]=$width; - $lines_data[$lines][3]=$height; - $lines_data[$lines][4]="#".$label_color; - $lines++; - } - - // Get parent relationship - Create line data - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - if (($parent_item != "") AND ($parent_item != 0)){ - $ppos_x = return_coordinate_X_layoutdata($parent_item); - $ppos_y = return_coordinate_Y_layoutdata($parent_item); - $lines_data[$lines][0]=$pos_x+15; - $lines_data[$lines][1]=$pos_y+15; - $lines_data[$lines][2]=$ppos_x+15; - $lines_data[$lines][3]=$ppos_y+15; - $lines_data[$lines][4]=$status_parent; - $lines++; - } +if ($refr) { + echo '
    '; + echo '
    '; } -// Javascript code generated on realtime to draw lines -// http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm#docu -echo '"; - -// End main div -echo "
    "; +print_pandora_visual_map ($id_layout); echo "
    "; echo "
    "; -echo "
    "; -echo ""; -echo "
    "; -echo $lang_label["auto_refresh_time"]; -echo ""; -echo ""; -echo ""; -echo ""; -echo "
    "; +$table->width = '300px'; +$table->data = array (); +$table->data[0][0] = lang_string ('auto_refresh_time'); +$table->data[0][1] = print_select ($refresh_values, 'refr', $refr, '', 'N/A', 0, true); +$table->data[0][2] = print_submit_button (lang_string ('refresh'), '', false, 'class="sub next"', true); +echo ''; +print_input_hidden ('pure', $config["pure"]); +print_input_hidden ('id', $id_layout); +print_table ($table); echo "
    "; +?> + + + + + + + diff --git a/pandora_console/reporting/fgraph.php b/pandora_console/reporting/fgraph.php index 498b82b76f..192851444b 100644 --- a/pandora_console/reporting/fgraph.php +++ b/pandora_console/reporting/fgraph.php @@ -373,7 +373,7 @@ function graphic_combined_module ($module_list, $weight_list, $periodo, $width, } function grafico_modulo_sparse ($id_agente_modulo, $periodo, $show_event, - $width, $height , $title, $unit_name, $show_alert, $avg_only = 0, $pure = 0, $date = 0 ) { + $width, $height , $title, $unit_name, $show_alert, $avg_only = 0, $pure = 0, $date = 0) { include ("../include/config.php"); require ("../include/languages/language_".$config['language'].".php"); require_once 'Image/Graph.php'; @@ -459,6 +459,10 @@ function grafico_modulo_sparse ($id_agente_modulo, $periodo, $show_event, WHERE id_agente = %d AND id_agente_modulo = %d AND utimestamp > %d', $id_agente, $id_agente_modulo, $fechatope); $result = mysql_query ($sql); + if (mysql_num_rows ($result) == 0) { + graphic_error (); + return; + } while ($row = mysql_fetch_array ($result)) { $datos = $row[0]; $utimestamp = $row[1];