Merge branch 'maint/7.0'
[ninja.git] / modules / reports / views / summary / latest.php
blobb83179b74d0e1a2141863aa33fb512bb6100e50c
1 <?php defined('SYSPATH') OR die("No direct access allowed"); ?>
2 <div class="report-block">
3 <?php if (empty($result)) { ?>
4 <p><?php echo _('No log data recorded during this time') ?></p>
5 <?php } else { ?>
6 <?php echo isset($pagination)?$pagination:'' ?>
7 <div class="clear"></div>
8 <table>
9 <tr>
10 <th><?php //echo _('State'); ?></th>
11 <th><?php echo _('Time'); ?></th>
12 <th><?php echo _('Alert Types'); ?></th>
13 <th><?php echo _('Host'); ?></th>
14 <th><?php echo _('Service'); ?></th>
15 <th><?php echo _('State Types'); ?></th>
16 <th><?php echo _('Information'); ?></th>
17 </tr>
18 <?php
19 $i = 0;
20 $date_format = nagstat::date_format();
21 foreach ($result as $ary) {
22 $row = alert_history::get_user_friendly_representation($ary);
23 $i++;
24 echo '<tr class="'.($i%2 == 0 ? 'odd' : 'even').' eventrow" data-statecode="'.$ary['event_type'].'" data-timestamp="'.$ary['timestamp'].'" data-hostname="'.$ary['host_name'].'" data-servicename="'.$ary['service_description'].'">';
26 <td class="icon status">
27 <?php echo $row['image'] ?>
28 </td>
29 <td><?php echo date($date_format, $ary['timestamp']); ?></td>
30 <td><?php echo $row['type']; ?></td>
31 <td><?php echo $ary['host_name']?html::anchor(base_url::get().'extinfo/details/?type=host&host='.urlencode($ary['host_name']), $ary['host_name']):'' ?></td>
32 <td><?php echo $ary['service_description']?html::anchor(base_url::get().'extinfo/details/?type=service&host='.urlencode($ary['host_name']).'&service='.$ary['service_description'], $ary['service_description']):'' ?></td>
33 <td><?php echo $row['softorhard']; ?></td>
34 <td>
35 <table class="output">
36 <tr><td><?php echo security::xss_clean($ary['output']);
37 if ($ary['long_output'] !== NULL) {
38 $long_output = trim($ary['long_output']);
39 if (strlen($long_output) > 0) {
40 echo "<span class='right'><button class='toggle-long-output'>";
41 echo $options['include_long_output'] ? "-" : "+";
42 echo "</button></span>";
43 $hidden = $options['include_long_output'] ? "" : "style='display: none;'";
44 echo "<span class='alert-history-long-output' " . $hidden . ">";
45 echo '<br />'.nl2br(security::xss_clean($long_output));
46 echo "</span>";
50 </td><td style="border:0" class="comments">
51 <?php
52 if (isset($ary['user_comment']))
53 echo security::xss_clean($ary['user_comment']).'<br /><span class="author">/'.html::specialchars($ary['username']).'</span>';
54 else
55 echo '<img class="right" src="'.ninja::add_path('icons/16x16/add-comment.png').'"/>';
57 </td></tr></table>
58 </td>
59 </tr>
60 <?php } ?>
61 </table>
62 <?php echo isset($pagination)?$pagination:'' ?>
63 <?php } ?>
64 </div>