width = '100%'; $table->class = 'info_table'; $table->cellpadding = '0'; $table->cellspacing = '0'; $table->head = []; $table->align = []; $table->head[0] = "".__('Source').''; $table->head[1] = "".__('Review').''; $table->head[2] = "".__('Last contact').''; $table->style = []; $table->style['source'] = 'width: 80%;'; $table->data = []; $row = []; // Get most recent sources for active agent. $sql = "select source, MAX(utimestamp) AS last_contact from tagent_module_log where id_agent=$agent_id GROUP BY source"; $logs = mysql_db_get_all_rows_sql($sql); foreach ($logs as $log) { $row['source'] = $log['source']; $row['review'] = ''.html_print_image('images/zoom.png', true, ['title' => __('Review in log viewer'), 'alt' => '', 'onclick' => "send_form('".$log['source'].'-'.$agent_id."')"]).''; $row['last_contact'] = human_time_comparation($log['last_contact']); $table->data[] = $row; } ob_start(); if (!empty($table->data)) { echo '