width = 750; $table->cellpadding = 4; $table->cellspacing = 4; $table->class = "databox"; $table->head = array (); $table->data = array (); $table->head[0] = "X"; $table->head[1] = __('Type'); $table->head[2] = __('Module name'); $table->head[3] = __('Description'); $table->head[4] = __('Status'); $table->head[5] = __('Interval'); $table->head[6] = __('Last contact'); //Since PHP's Zend optimizer references $var2 in case you do $var = $var2, objects get referenced too so we can't do $table = $table_data $table_data->head = $table->head; //Duplicate table for data modules $table_data->class = $table->class; $table_data->data = array (); $table_data->cellspacing = $table->cellspacing; $table_data->cellpadding = $table->cellpadding; $table_data->width = $table->width; foreach ($modules as $module) { $data = array (); if (($module["id_modulo"] != 1) && ($module["id_tipo_modulo"] != 100)) { if ($module["flag"] == 0) { $data[0] = ''; } else { $data[0] = ''; } } else { $data[0] = ''; } $data[1] = ''; $data[2] = substr ($module["nombre"], 0, 25); $data[3] = substr ($module["descripcion"], 0, 35); if ($module["estado"] == 1 && $module["cambio"] == 1) { $data[4] = ''; } elseif ($module["estado"] == 1) { $data[4] = ''; } else { $data[4] = ''; } if ($module["module_interval"] > 0) { $data[5] = $module["module_interval"]; } else { $data[5] = "--"; } $seconds = time () - $module["utimestamp"]; if ($module["current_interval"] > 0 && $module["utimestamp"] > 0 && $seconds >= ($module["current_interval"] * 2)) { $data[6] = ''; } else { $data[6] = ''; } $data[6] .= print_timestamp ($module["utimestamp"], true); $data[6] .= ''; if ($module["estado"] != 100) { array_push ($table->data, $data); //Monitor modules go on $table } else { array_push ($table_data->data, $data); //Data modules go on $table_data } } if (empty ($table->data)) { echo '
'.__('This agent doesn\'t have any active monitors').'
'; } else { echo "

".__('Full list of Monitors')."

"; print_table ($table); } if (empty ($table_data->data)) { echo '
'.__('This agent doesn\'t have any active data modules').'
'; } else { echo "

".__('Full list of Data Modules')."

"; print_table ($table_data); } unset ($table); unset ($table_data); ?>