Merge "Make it possible to sort on simple custom columns"
[ninja.git] / modules / reports / views / summary / latest.php
blob6cdafb8752b3c06fd8293d769dbdfd06252df639
1 <?php defined('SYSPATH') OR die("No direct access allowed"); ?>
2 <div class="report-block">
3 <h2><?php echo _('Summary report') ?></h2>
4 <?php if (empty($result)) { ?>
5 <p><?php echo _('No log data recorded during this time') ?></p>
6 <?php } else { ?>
7 <?php echo isset($pagination)?$pagination:'' ?>
8 <div class="clear"></div>
9 <table>
10 <tr>
11 <th><?php //echo _('State'); ?></th>
12 <th><?php echo _('Time'); ?></th>
13 <th><?php echo _('Alert Types'); ?></th>
14 <th><?php echo _('Host'); ?></th>
15 <th><?php echo _('Service'); ?></th>
16 <th><?php echo _('State Types'); ?></th>
17 <th><?php echo _('Information'); ?></th>
18 </tr>
19 <?php
20 $i = 0;
21 $date_format = nagstat::date_format();
22 foreach ($result as $ary) {
23 $row = alert_history::get_user_friendly_representation($ary);
24 $i++;
25 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'].'">';
27 <td class="icon status">
28 <?php echo $row['image'] ?>
29 </td>
30 <td><?php echo date($date_format, $ary['timestamp']); ?></td>
31 <td><?php echo $row['type']; ?></td>
32 <td><?php echo $ary['host_name']?html::anchor(base_url::get().'extinfo/details/?type=host&host='.urlencode($ary['host_name']), $ary['host_name']):'' ?></td>
33 <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>
34 <td><?php echo $row['softorhard']; ?></td>
35 <td>
36 <table class="output">
37 <tr><td><?php echo security::xss_clean($ary['output']);
38 if ($options['include_long_output'])
39 echo '<br />'.nl2br(security::xss_clean($ary['long_output']));
41 </td><td style="border:0" class="comments">
42 <?php
43 if (isset($ary['user_comment']))
44 echo security::xss_clean($ary['user_comment']).'<br /><span class="author">/'.html::specialchars($ary['username']).'</span>';
45 else
46 echo '<img class="right" src="'.ninja::add_path('icons/16x16/add-comment.png').'"/>';
48 </td></tr></table>
49 </td>
50 </tr>
51 <?php } ?>
52 </table>
53 <?php echo isset($pagination)?$pagination:'' ?>
54 <?php } ?>
55 </div>