".__('Display of last data modules received by agent'); echo " "; echo ""; $sortField = get_parameter('sort_field'); $sort = get_parameter('sort', 'none'); $selected = 'border: 1px solid black;'; $url = 'index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=data&id_agente=' . $id_agente; $selectNameUp = ''; $selectNameDown = ''; $selectTypeUp = ''; $selectTypeDown = ''; $selectIntervalUp = ''; $selectIntervalDown = ''; $selectTimestampUp = ''; $selectTimestampDown = ''; $selectDataUp = ''; $selectDataDown = ''; $order[] = array('field' => 'id_module_group', 'order' => 'ASC'); switch ($sortField) { case 'name': switch ($sort) { case 'up': $selectNameUp = $selected; $order[] = array('field' => 'tagente_modulo.nombre', 'order' => 'ASC'); break; case 'down': $selectNameDown = $selected; $order[] = array('field' => 'tagente_modulo.nombre', 'order' => 'DESC'); break; } break; case 'type': switch ($sort) { case 'up': $selectTypeUp = $selected; $order[] = array('field' => 'tagente_modulo.id_tipo_modulo', 'order' => 'ASC'); break; case 'down': $selectTypeDown = $selected; $order[] = array('field' => 'tagente_modulo.id_tipo_modulo', 'order' => 'DESC'); break; } break; case 'interval': switch ($sort) { case 'up': $selectIntervalUp = $selected; $order[] = array('field' => 'tagente_modulo.module_interval', 'order' => 'ASC'); break; case 'down': $selectIntervalDown = $selected; $order[] = array('field' => 'tagente_modulo.module_interval', 'order' => 'DESC'); break; } break; case 'timestamp': switch ($sort) { case 'up': $selectTimestampUp = $selected; $order[] = array('field' => 'tagente_estado.utimestamp', 'order' => 'ASC'); break; case 'down': $selectTimestampDown = $selected; $order[] = array('field' => 'tagente_estado.utimestamp', 'order' => 'DESC'); break; } break; case 'data': switch ($sort) { case 'up': $selectDataUp = $selected; $order[] = array('field' => 'tagente_estado.datos', 'order' => 'ASC'); break; case 'down': $selectDataDown = $selected; $order[] = array('field' => 'tagente_estado.datos', 'order' => 'DESC'); break; } break; break; default: $selectNameUp = $selected; $selectNameDown = ''; $selectTypeUp = ''; $selectTypeDown = ''; $selectIntervalUp = ''; $selectIntervalDown = ''; $selectTimestampUp = ''; $selectTimestampDown = ''; $order[] = array('field' => 'tagente_modulo.nombre', 'order' => 'ASC'); break; } $modules = get_db_all_rows_filter ('tagente_modulo, tagente_estado', array ('tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo', 'disabled' => 0, 'tagente_estado.utimestamp != 0', 'tagente_modulo.id_agente = '.$id_agente, 'order' => $order)); if ($modules === false) { echo "