[% 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%"></td>

        <td align="right" valign="bottom" width="33%">
          [% PROCESS _help.tt topic = "avail" %]
        </td>
      </tr>
    </table>

    <div align="center" class='dateSelectTitle'>Step 3: Select Report Options</div>
    <div align="center">
      <form method="get" action="avail.cgi">
        <input type='hidden' name='show_log_entries' value=''>
        [% IF host %]<input type='hidden' name='host' value='[% host %]'>[% END %]
        [% IF hostgroup %]<input type='hidden' name='hostgroup' value='[% hostgroup %]'>[% END %]
        [% IF service %]<input type='hidden' name='service' value='[% service %]'>[% END %]
        [% IF servicegroup %]<input type='hidden' name='servicegroup' value='[% servicegroup %]'>[% END %]
        <table border="0" cellpadding="5">
          <tr>
            <td valign="top" class='reportSelectSubTitle'>Report Period:</td>
            <td valign="top" align="left" class='optBoxItem'>
              <select name='timeperiod'>
                <option value="today">Today</option>
                <option value="last24hours">Last 24 Hours</option>
                <option value="yesterday">Yesterday</option>
                <option value="thisweek">This Week</option>
                <option value="last7days" selected>Last 7 Days</option>
                <option value="lastweek">Last Week</option>
                <option value="thismonth">This Month</option>
                <option value="last31days">Last 31 Days</option>
                <option value="lastmonth">Last Month</option>
                <option value="last12months">Last 12 Months</option>
                <option value="thisyear">This Year</option>
                <option value="lastyear">Last Year</option>
                <option value="custom">* CUSTOM REPORT PERIOD *</option>
              </select>
            </td>
          </tr>
          <tr>
            <td valign="top" class='reportSelectSubTitle'>If Custom Report Period...</td>
          </tr>
          <tr>
            <td valign="top" class='reportSelectSubTitle'>Start Date (Inclusive):</td>
            <td align="left" valign="top" class='reportSelectItem'>
              [% SET yesterday = date.now - 86400 %]
              <select name='smon'>
                <option value='1'[%  IF format_date(yesterday, '%m') == "01" %] selected[% END %]>January</option>
                <option value='2'[%  IF format_date(yesterday, '%m') == "02" %] selected[% END %]>February</option>
                <option value='3'[%  IF format_date(yesterday, '%m') == "03" %] selected[% END %]>March</option>
                <option value='4'[%  IF format_date(yesterday, '%m') == "04" %] selected[% END %]>April</option>
                <option value='5'[%  IF format_date(yesterday, '%m') == "05" %] selected[% END %]>May</option>
                <option value='6'[%  IF format_date(yesterday, '%m') == "06" %] selected[% END %]>June</option>
                <option value='7'[%  IF format_date(yesterday, '%m') == "07" %] selected[% END %]>July</option>
                <option value='8'[%  IF format_date(yesterday, '%m') == "08" %] selected[% END %]>August</option>
                <option value='9'[%  IF format_date(yesterday, '%m') == "09" %] selected[% END %]>September</option>
                <option value='10'[% IF format_date(yesterday, '%m') == "10" %] selected[% END %]>October</option>
                <option value='11'[% IF format_date(yesterday, '%m') == "11" %] selected[% END %]>November</option>
                <option value='12'[% IF format_date(yesterday, '%m') == "12" %] selected[% END %]>December</option>
              </select>
              <input type='text' size='2' maxlength='2' name='sday' value='[% format_date(yesterday, '%d') %]'>
              <input type='text' size='4' maxlength='4' name='syear' value='[% format_date(yesterday, '%Y') %]'>
              <input type='hidden' name='shour' value='0'>
              <input type='hidden' name='smin' value='0'>
              <input type='hidden' name='ssec' value='0'>
            </td>
          </tr>
          <tr>
            <td valign="top" class='reportSelectSubTitle'>End Date (Inclusive):</td>
            <td align="left" valign="top" class='reportSelectItem'>
              <select name='emon'>
                <option value='1'[%  IF format_date(date.now, '%m') == "01" %] selected[% END %]>January</option>
                <option value='2'[%  IF format_date(date.now, '%m') == "02" %] selected[% END %]>February</option>
                <option value='3'[%  IF format_date(date.now, '%m') == "03" %] selected[% END %]>March</option>
                <option value='4'[%  IF format_date(date.now, '%m') == "04" %] selected[% END %]>April</option>
                <option value='5'[%  IF format_date(date.now, '%m') == "05" %] selected[% END %]>May</option>
                <option value='6'[%  IF format_date(date.now, '%m') == "06" %] selected[% END %]>June</option>
                <option value='7'[%  IF format_date(date.now, '%m') == "07" %] selected[% END %]>July</option>
                <option value='8'[%  IF format_date(date.now, '%m') == "08" %] selected[% END %]>August</option>
                <option value='9'[%  IF format_date(date.now, '%m') == "09" %] selected[% END %]>September</option>
                <option value='10'[% IF format_date(date.now, '%m') == "10" %] selected[% END %]>October</option>
                <option value='11'[% IF format_date(date.now, '%m') == "11" %] selected[% END %]>November</option>
                <option value='12'[% IF format_date(date.now, '%m') == "12" %] selected[% END %]>December</option>
              </select>
              <input type='text' size='2' maxlength='2' name='eday' value='[% format_date(date.now, '%d') %]'>
              <input type='text' size='4' maxlength='4' name='eyear' value='[% format_date(date.now, '%Y') %]'>
              <input type='hidden' name='ehour' value='24'>
              <input type='hidden' name='emin' value='0'>
              <input type='hidden' name='esec' value='0'>
            </td>
          </tr>
          <tr>
            <td colspan="2"><br></td>
          </tr>
          <tr>
            <td valign="top" class='reportSelectSubTitle'>Report time Period:</td>
            <td valign="top" align="left" class='optBoxItem'>
              <select name='rpttimeperiod'>
                <option value="">None</option>
                [% FOREACH t = timeperiods %]
                <option value="[% t.name %]">[% t.name %]</option>
                [% END %]
              </select>
            </td>
          </tr>
          <tr>
            <td colspan="2"><br></td>
          </tr>
          <tr>
            <td class='reportSelectSubTitle' align="right">Assume Initial States:</td>
            <td class='reportSelectItem'>
              <select name='assumeinitialstates'>
                <option value="yes">Yes</option>
                <option value="no">No</option>
              </select>
            </td>
          </tr>
          <tr>
            <td class='reportSelectSubTitle' align="right">Assume State Retention:</td>
            <td class='reportSelectItem'>
              <select name='assumestateretention'>
                <option value="yes">Yes</option>
                <option value="no">No</option>
              </select>
            </td>
          </tr>
          <tr>
            <td class='reportSelectSubTitle' align="right">Assume States During Program Downtime:</td>
            <td class='reportSelectItem'>
              <select name='assumestatesduringnotrunning'>
                <option value="yes">Yes</option>
                <option value="no">No</option>
              </select>
            </td>
          </tr>
          <tr>
            <td class='reportSelectSubTitle' align="right">Include Soft States:</td>
            <td class='reportSelectItem'>
              <select name='includesoftstates'>
                <option value="yes">Yes</option>
                <option value="no" selected>No</option>
              </select>
            </td>
          </tr>
          [% UNLESS service %]
          <tr>
            <td class='reportSelectSubTitle' align="right">First Assumed Host State:</td>
            <td class='reportSelectItem'>
              <select name='initialassumedhoststate'>
                <option value=0>Unspecified</option>
                <option value=-1>Current State</option>
                <option value=3>Host Up</option>
                <option value=4>Host Down</option>
                <option value=5>Host Unreachable</option>
              </select>
            </td>
          </tr>
          [% END %]
          <tr>
            <td class='reportSelectSubTitle' align="right">First Assumed Service State:</td>
            <td class='reportSelectItem'>
              <select name='initialassumedservicestate'>
                <option value="0">Unspecified</option>
                <option value="-1">Current State</option>
                <option value="6">Service Ok</option>
                <option value="8">Service Warning</option>
                <option value="7">Service Unknown</option>
                <option value="9">Service Critical</option>
              </select>
            </td>
          </tr>
          <tr>
            <td class='reportSelectSubTitle' align="right">Backtracked Archives (To Scan For Initial States):</td>
            <td class='reportSelectItem'><input type='text' name='backtrack' size='2' maxlength='2' value='4'></td>
          </tr>
          [% IF host == 'all' or service == 'all' %]
          <tr>
            <td valign="top" class='reportSelectSubTitle'>Output in CSV Format:</td>
            <td valign="top" class='reportSelectItem'><input type='checkbox' name='csvoutput' value=''></td>
          </tr>
          [% END %]
          <tr>
            <td></td>
            <td align="left" class='dateSelectItem'><input type='submit' value='Create Availability Report!'></td>
          </tr>
        </table>
      </form>
    </div>

[% PROCESS _footer.tt %]
