histogram: Make histograms crash less
[ninja.git] / application / views / config / index.php
blob9290132e34c3a2f4d8c67d557f5fdbcd7903dfec
1 <?php defined('SYSPATH') OR die('No direct access allowed.'); ?>
2 <div>
3 <?php echo (isset($pagination)) ? $pagination : ''; ?>
4 <form method="get" action="">
5 <?php echo _('Object type'); ?>:
6 <select class="auto" name="type" onchange="submit()">
7 <option value="hosts"<?php echo $type == 'hosts' ? ' selected="selected"' : '';?>><?php echo _('Hosts');?>
8 <option value="hostgroups"<?php echo $type == 'hostgroups' ? ' selected="selected"' : '';?>><?php echo _('Host Groups');?>
9 <option value="services"<?php echo $type == 'services' ? ' selected="selected"' : '';?>><?php echo _('Services');?>
10 <option value="servicegroups"<?php echo $type == 'servicegroups' ? ' selected="selected"' : '';?>><?php echo _('Service Groups');?>
11 <option value="contacts"<?php echo $type == 'contacts' ? ' selected="selected"' : '';?>><?php echo _('Contacts');?>
12 <option value="contactgroups"<?php echo $type == 'contactgroups' ? ' selected="selected"' : '';?>><?php echo _('Contact Groups');?>
13 <option value="timeperiods"<?php echo $type == 'timeperiods' ? ' selected="selected"' : '';?>><?php echo _('Timeperiods');?>
14 <option value="commands"<?php echo $type == 'commands' ? ' selected="selected"' : '';?>><?php echo _('Commands');?>
15 </select>
16 <input type="text" id="filterbox" name="filterbox" value="<?php echo $filter_string ?>" />
17 <input type="submit" value="<?php echo _("Filter") ?>" />
18 </form>
19 </div>
20 <div style="margin-top: 20px">
21 <?php if($header === false) { ?>
22 <p><?php echo _(sprintf('Unknown data type %s',$type)); ?></p>
23 <?php } else { ?>
24 <table id="config_table">
25 <thead>
26 <tr>
27 <?php $i = 0; foreach ($header as $item) {
28 if ($i == 0)
29 echo '<th>'.$item.'</th>'."\n";
30 else
31 echo '<th>'.$item.'</th>'."\n";
32 $i++;
33 } ?>
34 </tr>
35 </thead>
36 <tbody>
37 <?php
38 $i = 0;
39 if ($data!==false) {
40 foreach ($data as $row) {
41 $i++;
42 echo '<tr class="'.($i%2 == 0 ? 'odd' : 'even').'">'."\n";
43 foreach($row as $column) {
44 echo '<td style="white-space: normal">'.$column.'</td>'."\n";
46 echo '</tr>'."\n";
48 } else { ?>
49 <tr class="even">
50 <td colspan="<?php echo count($header);?>"><?php echo _('No').' '.str_replace('_',' ',$type).' '._('configured'); ?></td>
51 </tr>
52 <?php } ?>
53 </tbody>
54 </table>
55 <?php } ?>
56 </div>