if ($index >= $top) { break; } $index++; $resp = json_decode($hostExecutedLogs_item['resp'], TRUE); $resp_data = ""; if (count($resp) > 0) { foreach ($resp as $resp_index => $resp_item) { $resp_data = $resp_data . "<p><span class=\"name\">" . esc_html($resp_index) . " : </span>" . esc_html($resp_item) . "</p>"; } } $html = $html . "\n\t\t<div class=\"item\">\n\t \t\t<a><span class=\"time\">" . $hostExecutedLogs_item['id'] . " : " . $hostExecutedLogs_item['time'] . " > </span>" . esc_html($hostExecutedLogs_item['cname']) . "</a>\n\t \t\t" . $resp_data . "\n\t \t\t<p><span class=\"name\">Response Time : </span>" . $hostExecutedLogs_item['respTime'] . "</p>\n\t \t</div>\n\t\t"; } json_out(1, "", $html); } else { $hostWaitingLogs = $pmxHost->getLogs($sid); if (!count($hostWaitingLogs) > 0) { json_out(1, "", "<center>Empty</center>"); } $html = ""; $index = 0; foreach ($hostWaitingLogs as $hostWaitingLogs_item) { if ($index >= $top) { break; } $index++; $html = $html . "<div class=\"item\"><a>Waiting : " . $hostWaitingLogs_item['id'] . " : " . $hostWaitingLogs_item["time"] . " > " . esc_html($hostWaitingLogs_item["cname"]) . "</a></div>"; } json_out(1, "", $html); } function json_out($status = 0, $msg = "", $data = "")