</tr> <tr> <td width="20%" class="listhdr"> <?php echo gettext("Logs:"); ?> </td> <td width="80%" class="listhdr"> <select name="logfile" class="formselect" style="z-index: -10;"> <?php foreach ($logfiles as $logfile) { echo "<option value=\"{$logfile}\""; if ($pconfig['logfile'] == $logfile) { echo " selected"; } echo ">" . htmlspecialchars(get_friendly_log_name($logfile)) . "</option>\n"; } ?> </select> </td> </tr> <tr> <td width="20%" class="listhdr"> <?php echo gettext("# Rows:"); ?> </td> <td width="80%" class="listhdr"> <input name="lines" type="text" class="formfld unknown" id="lines" size="10" value="<?php echo htmlspecialchars($pconfig['lines']); ?>
} // Print report header // Print command output $cmdtext = ""; foreach ($cmds as $cmd) { $output = ""; $cmdtext .= "Command output: {$cmd['descr']} (" . htmlspecialchars($cmd['detail']) . ")<br />\n"; exec($cmd['detail'], $output); $cmdtext .= "<pre>\n"; $cmdtext .= implode("\n", $output); $cmdtext .= "\n</pre>"; } // Print log output $logtext = ""; foreach ($logs as $log) { $lines = empty($log['lines']) ? 50 : $log['lines']; $filter = empty($log['detail']) ? null : array($log['detail']); $logtext .= "Log output: " . get_friendly_log_name($log['logfile']) . " ({$log['logfile']})<br />\n"; $logtext .= "<pre>\n"; $logtext .= implode("\n", mail_report_get_log($log['logfile'], $lines, $filter)); $logtext .= "\n</pre>"; } // For each graph, print a header and the graph $attach = array(); foreach ($graphs as $thisgraph) { $dates = get_dates($thisgraph['period'], $thisgraph['timespan']); $start = $dates['start']; $end = $dates['end']; $attach[] = mail_report_generate_graph($thisgraph['graph'], $thisgraph['style'], $thisgraph['timespan'], $start, $end); } mail_report_send($thisreport['descr'], $cmdtext, $logtext, $attach);
} ?> </tr> <?php $i = 0; foreach ($a_logs as $log) { ?> <tr ondblclick="document.location='status_mail_report_add_log.php?reportid=<?php echo $id; ?> &id=<?php echo $i; ?> '"> <td class="listlr"><?php echo get_friendly_log_name($log['logfile']); ?> </td> <td class="listlr"><?php echo $log['lines']; ?> </td> <td colspan="2" class="listlr"><?php echo $log['detail']; ?> </td> <td valign="middle" nowrap class="list"> <a href="status_mail_report_add_log.php?reportid=<?php echo $id; ?> &id=<?php