Ejemplo n.º 1
0
function renderMain()
{
    $selectOptions = getSelOpts();
    $content = <<<endForm
          <div id="downloadForm" class="fullWidth noBorder">
          Please select the AIML file you wish to download from the list below.<br />
          <form name="getFileForm" action="./?page=download" method="POST">
          <table class="formTable">
            <tr>
              <td>
                <select name="getFile" id="getFile" size="1" style="margin: 14px;">
                  <option value="null" selected="selected">Choose a file</option>
{$selectOptions}
                </select>
              </td>
              <td>
                <input type="submit" name="" value="Submit">
              </td>
            </tr>
            <tr>
              <td>
                <input type="radio" name="action" id="actionGetFileAIML" checked="checked" value="AIML">
                <label for="actionGetFileAIML" style="width: 250px">Download file as AIML</label>
              </td>
              <td>
                <input type="radio" name="action" id="actionGetFileSQL" value="SQL">
                <label for="actionGetFileSQL" style="width: 250px">Download file as SQL</label>
              </td>
            </tr>
          </table>
          </form>
          </div>
[showHelp]
endForm;
    return $content;
}
Ejemplo n.º 2
0
function renderMain()
{
    $selectOptions = getSelOpts();
    $content = <<<endForm
          Deleting AIML categories from the database is <strong>permanent</strong>!
          This action <strong>CANNOT</strong> be undone!<br />
          <div id="clearForm">
          <form name="clearForm" action="./?page=clear" method="POST" onsubmit="return verify()">
          <table class="formTable">
            <tr>
              <td>
                <input type="radio" name="action" id="actionClearAll" value="clear">
                <label for="actionClearAll" style="width: 250px">Clear <strong>ALL</strong> AIML categories (Purge database)</label>
              </td>
              <td>
                <input type="radio" name="action" value="void" id="actionClearFile" checked="checked">
                <label for="actionClearFile" style="width: 210px; text-align: left">Clear categories from this AIML file: </label><br />
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <select name="clearFile" id="clearFile" size="1" style="margin: 14px;" onclick="document.getElementById('actionClearFile').checked = true" onchange="document.getElementById('actionClearFile').checked = true">
                  <option value="null" selected="selected">Choose a file</option>
{$selectOptions}
                </select>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <input type="submit" name="" value="Submit">
              </td>
            </tr>
          </table>
          </form>
          </div>
[showHelp]
          <script type="text/javascript">
            function verify() {
              var fn = document.getElementById('clearFile').value;
              var clearAll = document.getElementById('actionClearAll').checked;
              if (fn == 'null' && clearAll === false) return false;
              if (clearAll) fn = 'repository for all files';
              return confirm('This will delete all categories from the AIML file ' + fn + '! This cannot be undone! Are you sure you want to do this?');
            }
          </script>
endForm;
    return $content;
}