<h3>Vyhľadávanie</h3>
<div class="indent">
  <form action="index.php" method="get">
    <input name="site" type="hidden" value="search" />
    <input name="action" type="hidden" value="search" />
    <input name="courseID" type="hidden" value="{$courseID}" />
    Hľadaj 
    <input name="searchText" type="text" value="{$searchText}" />
    v 
    <select name="searchWhere">
      <option value="answerSets"{if $searchWhere==="answerSets"} selected="selected"{/if}>sadách odpovedí</option>
      <option value="questions"{if $searchWhere==="questions"} selected="selected"{/if}>otázkach</option>
      <option value="domains"{if $searchWhere==="domains"} selected="selected"{/if}>okruhoch tém</option>
      <option value="students"{if $searchWhere==="students"} selected="selected"{/if}>študentoch</option>
    </select>
    trieď
    <select name="sortType">
      <option value="ascending"{if $sortType==="ascending"} selected="selected"{/if}>vzostupne</option>
      <option value="descending"{if $sortType==="descending"} selected="selected"{/if}>zostupne</option>
    </select>
    <input name="submit" type="submit" value="OK" />
  </form>
  <br />
  {if $action==="search"}
    {if $searchWhere==="answerSets"}
      <table>
        <tr>
          <td>&nbsp;</td>
        </tr>
        {foreach from=$answerSetList item=menuItem}
          <tr>
            <td>{if $menuItem.obsolete}<img src="images/deleted.jpg" />{/if}</td>
            <td>{$menuItem.text}</td>
            <td>{if !$menuItem.obsolete}<a href="index.php?site=questionDB&amp;action=editAnswerSet&amp;courseID={$courseID}&amp;domainID={$menuItem.id_domain}&amp;questionID={$menuItem.id_question}&amp;answerSetID={$menuItem.id}">[editovať]</a>{/if}</td>
            <td>{if !$menuItem.obsolete}<a href="javascript: Ask('Naozaj chcete sadu odpovedí vymazať?', 'index.php?site=questionDB&amp;action=deleteAnswerSet&amp;courseID={$courseID}&amp;domainID={$menuItem.id_domain}&amp;questionID={$menuItem.id_question}&amp;answerSetID={$menuItem.id}&amp;redirect=1&amp;redsite=search&amp;redaction=search&amp;redcourseID={$courseID}&amp;redsearchText={$searchText}&amp;redsearchWhere={$searchWhere}&amp;redsortType={$sortType}');">[odstrániť]</a>{/if}</td>
          </tr>
        {/foreach}
      </table>
    {elseif $searchWhere==="questions"}
      <table>
        <tr>
          <td>&nbsp;</td>
        </tr>
        {foreach from=$questionList item=menuItem}
          <tr>
            <td>{if $menuItem.obsolete}<img src="images/deleted.jpg" />{/if}</td>
            <td><a href="index.php?site=questionDB&amp;action=browseAnswerSets&amp;courseID={$courseID}&amp;domainID={$menuItem.id_domain}&amp;questionID={$menuItem.id}">{$menuItem.question}</a></td>
            <td>{if !$menuItem.obsolete}<a href="index.php?site=questionDB&amp;action=editQuestion&amp;courseID={$courseID}&amp;domainID={$menuItem.id_domain}&amp;questionID={$menuItem.id}">[editovať]</a>{/if}</td>
            <td>{if !$menuItem.obsolete}<a href="javascript: Ask('Naozaj chcete otázku vymazať?', 'index.php?site=questionDB&amp;action=deleteQuestion&amp;courseID={$courseID}&amp;domainID={$menuItem.id_domain}&amp;questionID={$menuItem.id}&amp;redirect=1&amp;redsite=search&amp;redaction=search&amp;redcourseID={$courseID}&amp;redsearchText={$searchText}&amp;redsearchWhere={$searchWhere}&amp;redsortType={$sortType}');">[odstrániť]</a>{/if}</td>
          </tr>
        {/foreach}
      </table>
    {elseif $searchWhere==="domains"}
      <table>
        <tr>
          <td>&nbsp;</td>
        </tr>
        {foreach from=$domainList item=menuItem}
          <tr>
            <td>{if $menuItem.obsolete}<img src="images/deleted.jpg" />{/if}</td>
            <td><a href="index.php?site=questionDB&amp;action=browseDomain&amp;courseID={$courseID}&amp;domainID={$menuItem.id}">{$menuItem.subject}</a></td>
            <td>{if !$menuItem.obsolete}<a href="index.php?site=questionDB&amp;action=editDomain&amp;courseID={$courseID}&amp;domainID={$menuItem.id}">[editovať]</a>{/if}</td>
            <td>{if !$menuItem.obsolete}<a href="javascript: Ask('Naozaj chcete okruh tém vymazať?', 'index.php?site=questionDB&amp;action=deleteDomain&amp;courseID={$courseID}&amp;domainID={$menuItem.id}&amp;redirect=1&amp;redsite=search&amp;redaction=search&amp;redcourseID={$courseID}&amp;redsearchText={$searchText}&amp;redsearchWhere={$searchWhere}&amp;redsortType={$sortType}');">[odstrániť]</a>{/if}</td>
          </tr>
        {/foreach}
      </table>
    {elseif $searchWhere==="students"}
      <table>
        <tr>
          <td>&nbsp;</td>
        </tr>
        {foreach from=$studentList 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=6">[detaily]</a></td>
          </tr>
        {/foreach}
      </table>
    {/if}
  {/if}
</div>
