{if $action==="listOfStudents"}
  <h3>{$date} - zoznam študentov</h3>
  <div class="indent">
    {if $numRows==0}
      Zoznam študentov je prázdny. Na termín sa buď žiaden študent neprihlásil, 
      alebo importovanie zoznamu študentov ešte neprebehlo.
      <br /> 
    {else}
      <table>
        {foreach from=$listOfStudents item=menuItem}
          <tr>
            <td>{$menuItem.name}</td>
            <td><a href="index.php?site=userInformation&amp;action=showStudent&amp;courseID={$courseID}&amp;userID={$menuItem.id}&amp;menuSet=2&amp;menuIndex=4">[detaily]</a></td>
            {if $state==="scheduled"}
              <td><a href="index.php?site=examTerms&amp;action=deleteStudentFromList&amp;courseID={$courseID}&amp;examID={$examID}&amp;studentID={$menuItem.id}">[odstrániť]</a></td>
            {elseif $state==="finished"}
              <td>{if $menuItem.testID!=0}<a href="index.php?site=userInformation&amp;action=studentDetailTest&amp;courseID={$courseID}&amp;userID={$menuItem.id}&amp;testID={$menuItem.testID}&amp;menuSet=2&amp;menuIndex=4">[test]</a>{/if}</td>
            {/if}
          </tr>
        {/foreach}
      </table>
    {/if}
    <br />
    {if $state==="scheduled"}
      <a href="index.php?site=examTerms&amp;action=browseNewStudentsList&amp;courseID={$courseID}&amp;examID={$examID}">Pridať študenta</a>
      <br />
    {/if}
    <a href="index.php?site=examTerms&amp;courseID={$courseID}">Späť</a>
  </div>
{elseif $action==="browseNewStudentsList"}
  <h3>{$date} - pridať študenta</h3>
  <div class="indent">
    {if $numRows==0}
      Zoznam neprihlásených študentov je prázdny. <br />
    {else}
      <table>
        {foreach from=$listOfStudents item=menuItem}
          <tr>
            <td>{$menuItem.name}</td>
            <td><a href="index.php?site=userInformation&amp;action=showStudent&amp;courseID={$courseID}&amp;userID={$menuItem.id}&amp;menuSet=2&amp;menuIndex=4">[detaily]</a></td>
            {if $state==="scheduled"}
              <td><a href="index.php?site=examTerms&amp;action=addStudentToList&amp;courseID={$courseID}&amp;examID={$examID}&amp;studentID={$menuItem.id}">[pridať]</a></td>
            {/if}
          </tr>
        {/foreach}
      </table>
    {/if}
    <br />
    <a href="index.php?site=examTerms&amp;action=listOfStudents&amp;courseID={$courseID}&amp;examID={$examID}">Späť</a>
  </div>
{else}
  <h3>Termíny skúšok</h3>
  <div class="indent">
    <form action="index.php?site=examTerms&amp;action=setExamTermsDate&amp;courseID={$courseID}" method="post">
      Zobraz termíny skúšok od 
      <input name="examTermsDate" type="text" value="{$examTermsDate}" />
      <input name="submit" type="submit" value="Zobraz" />
    </form>
    <br />
    <table>
      <tr>
        <td>&nbsp;</td>
      </tr>
      {foreach from=$listOfExams item=menuItem}
        <tr>
          <td>{$menuItem.date}</td>
          <td>
            {if $menuItem.state=="scheduled"}
              - budúca
            {elseif $menuItem.state=="progress"}
              - prebiehajúca
            {elseif $menuItem.state=="finished"}
              - ukončená
            {/if}
          </td>
          <td><a href="index.php?site=examTerms&amp;action=listOfStudents&amp;courseID={$courseID}&amp;examID={$menuItem.id}">[zoznam študentov]</a></td>
          <td>{if $menuItem.state=="scheduled"}
                <a href="index.php?site=testing&amp;action=startTesting&amp;courseID={$courseID}&amp;examID={$menuItem.id}">[spustiť]</a>
              {elseif $menuItem.state=="progress"}
                <a href="index.php?site=testing&amp;action=startTesting&amp;courseID={$courseID}&amp;examID={$menuItem.id}">[pokračovať]</a>
              {/if}
          </td>
        </tr>
      {/foreach}
    </table>
  </div>
{/if}
