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

    <table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="top" width="33%">
          [% PROCESS _infobox.tt %]
        </td>
        <td align="center" valign="top" width="33%">
          <div align="center" class='dataTitle'>
          [% IF servicegroup == 'all' %]
            All Servicegroups
          [% ELSE %]
            Servicegroup '[% servicegroup %]'
          [% END %]
          </div>
          <br>
          <img src='[% url_prefix %]thruk/themes/[% theme %]/images/trends.gif' border="0" alt='Availability Report' title='Availability Report' width="20" height="20"><br clear="all">
          <div align="center" class='reportRange'>
            [% format_date(start, datetime_format) %] to [% format_date(end, datetime_format) %]
          </div>
          <div align="center" class='reportDuration'>
            Duration: [% SET dur = end - start %][% duration(dur) %]
          </div>
        </td>
        <td align="right" valign="bottom" width="33%">
          [% PROCESS avail_report_form_box.tt %]
          [% PROCESS _help.tt topic = "avail" %]
        </td>
      </tr>
    </table>

    <div align="center" class='reportTime'>[ Availability report completed in [% duration(time_token, 2) %] ]</div><br>
    <br>
    <br>
    <br>

    [% FOR groupname IN groups.keys.sort %]
    [% SET g = groups.$groupname        %]
    [% SET servicegroupname = groupname %]
    [%# set hosts to the keys of services #%]
    [% SET hosts    = g.services %]
    [% SET services = g.services %]
    [% PROCESS avail_report_hosts_part.tt %]
    [% PROCESS avail_report_services_part.tt %]
    [% END %]

[% PROCESS _footer.tt %]
