[% USE date %]
[% PROCESS _header.tt %]

[% link = '' %]
[% IF service    != '' %][% link = link _ '&amp;' _ 'service='    _ service    %][% END %]
[% IF host       != '' %][% link = link _ '&amp;' _ 'host='       _ host       %][% END %]
[% IF noflapping != '' %][% link = link _ '&amp;' _ 'noflapping=' _ noflapping %][% END %]
[% IF nodowntime != '' %][% link = link _ '&amp;' _ 'nodowntime=' _ nodowntime %][% END %]
[% IF nosystem   != '' %][% link = link _ '&amp;' _ 'nosystem='   _ nosystem   %][% END %]
[% IF type       != '' %][% link = link _ '&amp;' _ 'type='       _ type       %][% END %]
[% IF statetype  != '' %][% link = link _ '&amp;' _ 'statetype='  _ statetype  %][% END %]

    <form method="get" action="history.cgi" id="date_form">
    <input type="hidden" name="entries" value="[% entries_per_page %]">
    <table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="top" width="33%">
          [% PROCESS _infobox.tt %]
          <table border="1" cellpadding="0" cellspacing="0" class='linkBox'>
            <tr>
              <td class='linkBox'>
                [% IF service != '' and host != 'all' %]
                <a href='notifications.cgi?host=[% host | uri %]&amp;service=[% service | uri %]'>View Notifications For This Service</a><br>
                [% IF use_feature_trends %]<a href='trends.cgi?host=[% host | uri %]&amp;service=[% service | uri %]'>View Trends For This Service</a><br>[% END %]
                <a href='history.cgi?host=[% host | uri %]'>View History For This Host</a>
                [% ELSIF host != 'all' %]
                <a href='status.cgi?host=[% host | uri %]'>View Status Detail For This Host</a><br>
                <a href='notifications.cgi?host=[% host | uri %]'>View Notifications For This Host</a><br>
                [% IF use_feature_trends %]<a href='trends.cgi?host=[% host | uri %]'>View Trends For This Host</a>[% END %]
                [% ELSE %]
                <a href='status.cgi?host=all'>View Status Detail For All Hosts</a><br>
                <a href='notifications.cgi?host=all'>View Notifications For All Hosts</a><br>
                [% END %]
              </td>
            </tr>
          </table>
        </td>
        <td align="center" valign="top" width="33%">
          <div align="center" class='dataTitle'>
            [% IF service != '' and host != 'all' %]
            Service '[% service %]' On Host '[% host %]'
            [% ELSIF host != 'all' %]
            Host '[% host %]'
            [% ELSE %]
            All Hosts and Services
            [% END %]
          </div><br>
          <table border="0" cellspacing="0" cellpadding="0" class='navBox'>
            <tr>
              <td align="center" valign="middle" class='navBoxItem' width="75">
                Previous Day<br>
                <img style="cursor: pointer;" src='[% url_prefix %]thruk/themes/[% theme %]/images/left.gif' alt='Previous Day' title='Previous Day' onclick="document.getElementById('archive').value='-1'; document.getElementById('date_form').submit();">
              </td>
              <td width="15"></td>
              <td align="center" class='navBoxDate' nowrap>
                [% PROCESS _log_date_select.tt %]
              </td>
              <td valign="middle">
                &nbsp;&nbsp;<input type='submit' value='Update'>
                <input type="hidden" name="archive" value="" id="archive">
              </td>
              <td align="center" valign="middle" class='navBoxItem' width="75">
                [% IF end < date.now %]
                Next Day<br>
                <img style="cursor: pointer;" src='[% url_prefix %]thruk/themes/[% theme %]/images/right.gif' alt='Next Day' title='Next Day' onclick="document.getElementById('archive').value='+1'; document.getElementById('date_form').submit();">
                [% END %]
              </td>
            </tr>
          </table>
        </td>

        <td align="right" valign="top" width="33%">
              [% IF host    %]<input type='hidden' name='host'    value='[% host    %]'>[% END %]
              [% IF service %]<input type='hidden' name='service' value='[% service %]'>[% END %]
            <table border="0" class='optBox'>
              <tr>
                <td align="left" class='optBoxItem'>State type options:</td>
              </tr>
              <tr>
                <td align="left" class='optBoxItem'>
                  <select name='statetype'>
                    <option value="0"[% IF statetype == 0 %] selected[% END %]>All state types</option>
                    <option value="1"[% IF statetype == 1 %] selected[% END %]>Soft states</option>
                    <option value="2"[% IF statetype == 2 %] selected[% END %]>Hard states</option>
                  </select>
                </td>
              </tr>
              <tr>
                <td align="left" class='optBoxItem'>History detail level for all hosts:</td>
              </tr>
              <tr>
                <td align="left" class='optBoxItem'>
                  <select name='type'>
                    <option value="0"[% IF   type ==   0 %] selected[% END %]>All alerts</option>
                    <option value="1"[% IF   type ==   1 %] selected[% END %]>All service alerts</option>
                    <option value="2"[% IF   type ==   2 %] selected[% END %]>All host alerts</option>
                    <option value="4"[% IF   type ==   4 %] selected[% END %]>Service warning</option>
                    <option value="8"[% IF   type ==   8 %] selected[% END %]>Service unknown</option>
                    <option value="16"[% IF  type ==  16 %] selected[% END %]>Service critical</option>
                    <option value="32"[% IF  type ==  32 %] selected[% END %]>Service recovery</option>
                    <option value="64"[% IF  type ==  64 %] selected[% END %]>Host down</option>
                    <option value="128"[% IF type == 128 %] selected[% END %]>Host unreachable</option>
                    <option value="256"[% IF type == 256 %] selected[% END %]>Host recovery</option>
                  </select>
                </td>
              </tr>
              <tr>
                <td align="left" valign="bottom" class='optBoxItem'><input type='checkbox' name='noflapping'[% IF noflapping %] checked[% END %]> Hide Flapping Alerts</td>
              </tr>
              <tr>
                <td align="left" valign="bottom" class='optBoxItem'><input type='checkbox' name='nodowntime'[% IF nodowntime %] checked[% END %]> Hide Downtime Alerts</td>
              </tr>
              <tr>
                <td align="left" valign="bottom" class='optBoxItem'><input type='checkbox' name='nosystem'[% IF nosystem %] checked[% END %]> Hide Process Messages</td>
              </tr>
              <tr>
                <td align="left" valign="bottom" class='optBoxItem'><input type='checkbox' name='oldestfirst'[% IF oldestfirst %] checked[% END %]> Older Entries First</td>
              </tr>
              <tr>
                <td align="left" class='optBoxItem'><input type='submit' value='Update'></td>
              </tr>
              <tr>
                <td align="right"></td>
              </tr>
            </table>
          [% PROCESS _help.tt topic = "history" %]
        </td>
      </tr>
    </table>
    </form>

[% PROCESS _logs.tt %]

[% PROCESS _footer.tt %]
