function get_trigger_definition($title)
{
    global $s_triggerdefs, $acc_strings, $s_cust;
    $trigger_source = htmlspecialchars($s_triggerdefs['source']);
    $html = "<table border cellpadding=\"3\" cellspacing=\"0\">\n" . "  <tr>\n" . '    <th colspan="6" align="left">' . $title . "</th>\n" . "  </tr>\n" . "  <tr>\n" . '    <td valign="top"><b>' . $acc_strings['Name'] . "</b><br>\n" . '      <input type="text" size="20" maxlength="31" name="def_trigger_name" value="' . ifsetor($s_triggerdefs['name']) . "\">\n" . "    </td>\n" . "    <td valign=\"top\">\n" . '      <b>' . $acc_strings['Table'] . "</b><br>\n" . '      ' . get_table_selectlist('def_trigger_table', array('owner'), $s_triggerdefs['table'], TRUE) . "    </td>\n" . "    <td valign=\"top\">\n" . '      <b>' . $acc_strings['Phase'] . "</b><br>\n" . '      ' . get_selectlist('def_trigger_phase', array('before', 'after'), $s_triggerdefs['phase'], TRUE) . "    </td>\n" . "    <td>\n" . '      <b>' . $acc_strings['Type'] . "</b><br>\n" . '      ' . get_triggertype_selectlist('def_trigger_type', $s_triggerdefs['type'], TRUE) . "    </td>\n" . "    <td valign=\"top\">\n" . '      <b>' . $acc_strings['Position'] . "</b><br>\n" . '      <input type="text" size="2" maxlength="2" name="def_trigger_pos" value="' . ifsetor($s_triggerdefs['pos']) . "\">\n" . "    </td>\n" . "    <td valign=\"top\">\n" . '      <b>' . $acc_strings['Status'] . "</b><br>\n" . '      ' . get_selectlist('def_trigger_status', array('Active', 'Inactive'), $s_triggerdefs['status'], FALSE) . "    </td>\n" . "  </tr>\n" . "  <tr>\n" . "    <td colspan=\"6\">\n" . '      <b>' . $acc_strings['Source'] . "</b><br>\n" . '      <textarea name="def_trigger_source" rows="' . $s_cust['textarea']['rows'] . '" cols="' . $s_cust['textarea']['cols'] . '" wrap="virtual">' . $trigger_source . "</textarea>\n" . "    </td>\n" . "  </tr>\n" . "</table>\n";
    return $html;
}
function get_column_constraint_definition($coldefs, $idx)
{
    global $fk_actions, $tb_strings;
    $fk_name = isset($coldefs['fk_name']) ? $coldefs['fk_name'] : '';
    $fk_table = isset($coldefs['fk_table']) ? $coldefs['fk_table'] : '';
    $fk_column = isset($coldefs['fk_column']) ? $coldefs['fk_column'] : '';
    $on_update = isset($coldefs['on_update']) ? $coldefs['on_update'] : '';
    $on_delete = isset($coldefs['on_delete']) ? $coldefs['on_delete'] : '';
    $table_element = get_table_selectlist('cd_def_fk_table_' . $idx, array('no_views', 'references'), $fk_table, TRUE, array('onChange' => "requestTableColumns(selectedElement(this), 'cd_def_fk_col_" . $idx . "', 'fk');"));
    $drop_element = '';
    if ($idx == 'mod' && (isset($coldefs['primary']) && $coldefs['primary_cols'] == 1 || isset($coldefs['unique']) && $coldefs['unique_cols'] == 1 || isset($coldefs['foreign']) && $coldefs['foreign_cols'] == 1)) {
        $checked_str = $coldefs['fk_del'] == TRUE ? ' checked' : '';
        $drop_element = "        <tr>\n" . "          <td colspan=\"7\">\n" . "            <table style=\"border-bottom: 1px solid black;\" width=\"100%\">\n" . "              <tr>\n";
        if (isset($coldefs['primary']) && $coldefs['primary_cols'] == 1) {
            $checked_str = $coldefs['pk_del'] == TRUE ? ' checked' : '';
            $drop_element .= "                <td>\n" . '                  <input type="checkbox" name="cd_def_pk_del_' . $idx . '"' . $checked_str . '> <b>' . $tb_strings['DropPK'] . "</b>\n" . "                </td>\n";
        }
        if (isset($coldefs['unique']) && $coldefs['unique_cols'] == 1) {
            $checked_str = $coldefs['uq_del'] == TRUE ? ' checked' : '';
            $drop_element .= "                <td>\n" . '                  <input type="checkbox" name="cd_def_uq_del_' . $idx . '"' . $checked_str . '> <b>' . $tb_strings['DropUq'] . "</b>\n" . "                </td>\n";
        }
        if (isset($coldefs['foreign']) && $coldefs['foreign_cols'] == 1) {
            $checked_str = $coldefs['fk_del'] == TRUE ? ' checked' : '';
            $drop_element .= "                <td>\n" . '                  <input type="checkbox" name="cd_def_fk_del_' . $idx . '"' . $checked_str . '> <b>' . $tb_strings['DropFK'] . "</b>\n" . "                </td>\n";
        }
        $drop_element .= "              </tr>\n" . "            </table>\n" . "          <td>\n" . "        </tr>\n";
    }
    $html = "  <tr>\n" . "    <td colspan=\"8\">\n" . "      <table class=\"table table-bordered\">\n" . $drop_element . "        <tr>\n" . "          <td colspan=\"7\">\n" . '            <b>' . $tb_strings['FKName'] . "</b><br>\n" . '            <input type="text" size="27" maxlength="31" name="cd_def_fk_name_' . $idx . '" value="' . $fk_name . "\">\n" . "          </td>\n" . "        </tr>\n" . "        <tr>\n" . "          <td>\n" . '            <b>' . $tb_strings['Table1'] . "</b><br>\n" . '            ' . $table_element . "\n" . "          </td>\n" . "          <td>&nbsp;&nbsp;</td>\n" . "          <td>\n" . '            <b>' . $tb_strings['Column1'] . "</b><br>\n" . '            <span id="cd_def_fk_col_' . $idx . "\">\n" . '              <input type="text" size="20" maxlength="31" name="cd_def_fk_col_' . $idx . '" value="' . $fk_column . "\">\n" . "            </span>\n" . "          </td>\n" . "          <td>&nbsp;&nbsp;</td>\n" . "          <td>\n" . '            <b>' . $tb_strings['OnUpdate'] . "</b><br>\n" . "            " . get_selectlist('cd_def_ou_' . $idx, $fk_actions, $on_update, TRUE) . "\n" . "          </td>\n" . "          <td>&nbsp;&nbsp;</td>\n" . "          <td>\n" . '            <b>' . $tb_strings['OnDelete'] . "</b><br>\n" . "            " . get_selectlist('cd_def_od_' . $idx, $fk_actions, $on_delete, TRUE) . "\n" . "          </td>\n" . "        </tr>\n" . "      </table>\n" . "    </td>\n" . "  </tr>\n";
    return $html;
}
  </td>
  <td align="left">
    <input type="submit" name="acc_view_mod" value="<?php 
    echo $button_strings['Modify'];
    ?>
">
  </td>
</tr>
<tr>
  <td>
    <b><?php 
    echo $acc_strings['SelViewDel'];
    ?>
</b>
  </td>
  <td>
    <?php 
    echo get_table_selectlist('acc_delview_name', array('owner', 'views'), NULL, TRUE);
    ?>
  </td>
  <td align="left">
    <input type="submit" name="acc_view_del" value="<?php 
    echo $button_strings['Delete'];
    ?>
">
  </td>
</tr>
</table>
</form>
<?php 
}
// Author         Lutz Brueckner <*****@*****.**>
// Copyright      (c) 2000, 2001, 2002, 2003, 2004 by Lutz Brueckner,
//                published under the terms of the GNU General Public Licence v.2,
//                see file LICENCE for details
if (isset($s_confirmations['table'])) {
    $subject = 'table';
    include './panels/confirm.php';
} elseif ($s_connected) {
    ?>
    <form method="post" action="<?php 
    url_session($_SERVER['PHP_SELF']);
    ?>
" name="tb_delete_form">
        <table class="table table-bordered">
            <tr>
                <td colspan="2">
                    <?php 
    echo '<b>' . $tb_strings['SelTbDel'] . "</b><br>\n" . get_table_selectlist('tb_delete_name', array('owner', 'noviews'), NULL, TRUE);
    ?>
                </td>
                <td valign="bottom">
                    <input type="submit" class="btn btn-danger" name="tb_delete_doit" value="<?php 
    echo $button_strings['Delete'];
    ?>
">
                </td>
            </tr>
        </table>
    </form>
<?php 
}
        <table class="table table-bordered">
            <tr>
                <th><?php 
    echo $dt_strings['SelTable'];
    ?>
</th>
                <th><?php 
    echo $dt_strings['FileName'];
    ?>
</th>
                <th>&nbsp;</th>
            <tr>
            <tr>
                <td>
                    <?php 
    echo get_table_selectlist('dt_import_table', array('insert'), NULL, TRUE);
    ?>
                </td>
                <td>
                    <input type="file" size="30" name="dt_import_file">
                </td>
                <td>
                    <input type="submit" class="btn btn-default" name="dt_import_doit" value="<?php 
    echo $button_strings['Import'];
    ?>
">
                </td>
            </tr>
        </table>
        <input type="checkbox" name="dt_import_null" value="yes"<?php 
    if ($s_csv['import_null']) {
//                published under the terms of the GNU General Public Licence v.2,
//                see file LICENCE for details
if ($s_connected == TRUE && $s_enter_name == '') {
    ?>
    <form method="post" action="<?php 
    echo url_session($_SERVER['PHP_SELF']);
    ?>
" name="dt_enter_form">
        <table class="table table-bordered">
            <tr>
                <td colspan="2"><b><?php 
    echo $dt_strings['SelTable'];
    ?>
</b><br>
                    <?php 
    echo get_table_selectlist('dt_enter_name', array('noviews', 'insert'), NULL, TRUE);
    ?>
                </td>
                <td valign="bottom">
                    <input type="submit" class="btn btn-default" name="dt_enter_select" value="<?php 
    echo $button_strings['Select'];
    ?>
">
                </td>
            </tr>
        </table>
    </form>
<?php 
} elseif ($s_connected == TRUE) {
    $js_stack .= js_giveFocus('dt_enter_form', 'dt_enter_field_0');
    $df = new DataFormEnter($s_enter_name, $s_fields[$s_enter_name], $s_enter_values);
                            </td>
                            <td>
            <span id="dt_export_source_table_span" style="display:<?php 
    $s_export['source']['option'] == 'table' ? print 'block' : (print 'none');
    ?>
;">
              <?php 
    echo get_table_selectlist('dt_export_source_table', array('select'), $s_export['source']['table'], TRUE);
    ?>
            </span>
            <span id="dt_export_source_dbtables_span" style="display:<?php 
    $s_export['source']['option'] == 'db' ? print 'block' : (print 'none');
    ?>
;">
              <?php 
    echo get_table_selectlist('dt_export_source_dbtables[]', array('select'), $s_export['source']['dbtables'], FALSE, array('multiple' => 'multiple'), 4);
    ?>
            </span>
                            </td>
                        </tr>
                    </table>
                </td>
                <td valign="top">
                    <table class="table table-bordered">
                        <tr>
                            <th align="left" colspan="2">Target</th>
                        </tr>
                        <tr>
                            <td>
                                <?php 
    echo get_indexed_selectlist('dt_export_target', get_export_targets(), $s_export['target']['option'], FALSE, array('onChange' => "if (this.value=='screen') hide('dt_export_filename_span'); else display('dt_export_filename_span'); setExportTarget(this.value);"));
// Purpose        html sequence for the table-watch-panel in sql.php and data.php
// Author         Lutz Brueckner <*****@*****.**>
// Copyright      (c) 2000, 2001, 2002, 2003, 2004, 2005 by Lutz Brueckner,
//                published under the terms of the GNU General Public Licence v.2,
//                see file LICENCE for details
if (!isset($tb_watch_cfg_flag) && $s_connected) {
    ?>
    <form method="post" action="<?php 
    echo url_session($_SERVER['PHP_SELF']);
    ?>
" name="tb_watch_form">
        <table class="table table-bordered">
            <tr>
                <td colspan="1">
                    <?php 
    echo '<b>' . $sql_strings['SelTable'] . "</b><br>\n" . get_table_selectlist('tb_watch_table', array('select'), $s_wt['table'], TRUE);
    ?>
                    <input type="submit" class="btn btn-default" name="tb_watch_select" value="<?php 
    echo $button_strings['Select'];
    ?>
">
                </td>
                <?php 
    if (isset($s_wt['table']) && $s_wt['table'] != '') {
        echo "<td width=\"100\">&nbsp;</td>\n";
        $url = url_session($_SERVER['PHP_SELF'] . '?wcfg=true');
        echo '<td><a href="' . $url . '" class="act">[' . $sql_strings['Config'] . "]</a></td>\n";
    }
    ?>
            </tr>
        </table>
    $subject = 'column';
    include './panels/confirm.php';
} elseif ($s_connected && $s_modify_name == '') {
    ?>
    <form method="post" action="<?php 
    echo url_session($_SERVER['PHP_SELF']);
    ?>
" name="tb_modify_form">
        <table class="table table-bordered">
            <tr>
                <td colspan="2"><b><?php 
    echo $tb_strings['SelTbMod'];
    ?>
</b><br>
                    <?php 
    echo get_table_selectlist('tb_modify_name', array('owner', 'noviews'), NULL, TRUE);
    ?>
                </td>
                <td valign="bottom">
                    <input type="submit" class="btn btn-default" name="tb_modify_doit" value="<?php 
    echo $button_strings['Modify'];
    ?>
">
                </td>
            </tr>
        </table>
    </form>
<?php 
} elseif (isset($col_add_flag)) {
    js_checkColConstraint();
    ?>
function index_definition($indexname, $title)
{
    global $indices, $acc_strings;
    if ($indexname != NULL && !isset($_POST['acc_modind_doit'])) {
        $name = $indexname;
        $table = $indices[$indexname]['table'];
        $dir = $indices[$indexname]['dir'];
        $uniq = $indices[$indexname]['uniq'];
        $active = $indices[$indexname]['active'];
        $segs = implode(',', $indices[$indexname]['seg']);
    } else {
        $name = isset($_POST['def_index_name']) ? $_POST['def_index_name'] : '';
        $table = isset($_POST['def_index_table']) ? $_POST['def_index_table'] : '';
        $dir = isset($_POST['def_index_dir']) ? $_POST['def_index_dir'] : 'ASC';
        $uniq = isset($_POST['def_index_uniq']) ? TRUE : FALSE;
        $active = isset($_POST['def_index_activ']) ? TRUE : FALSE;
        $segs = isset($_POST['def_index_segs']) ? $_POST['def_index_segs'] : '';
    }
    ?>
<table>
  <tr>
    <th colspan="6" align="left"><?php 
    echo $title;
    ?>
</th>
  </tr>
  <tr>
    <td valign="top"><b><?php 
    echo $acc_strings['Name'];
    ?>
</b><br>
        <input type="text" size="20" maxlength="31" name="def_index_name" value="<?php 
    echo $name;
    ?>
">
    </td>
    <td valign="top"><b><?php 
    echo $acc_strings['Table'];
    ?>
</b><br>
      <?php 
    echo get_table_selectlist('def_index_table', array('noviews', 'owner'), $table, TRUE);
    ?>
    </td>
    <td align="center" valign="top"><b><?php 
    echo $acc_strings['Active'];
    ?>
</b><br>
      <input type="checkbox" name="def_index_activ" <?php 
    if ($active) {
        echo 'checked';
    }
    ?>
> 
    </td>
    <td align="center" valign="top"><b><?php 
    echo $acc_strings['Unique'];
    ?>
</b><br>
      <input type="checkbox" name="def_index_uniq" <?php 
    if ($uniq) {
        echo 'checked';
    }
    ?>
> 
    </td>
    <td align="center" valign="top"><b><?php 
    echo $acc_strings['Sort'];
    ?>
</b><br>
      <select name="def_index_dir">
        <option<?php 
    if ($dir == 'ASC') {
        echo ' selected';
    }
    ?>
> ASC
        <option<?php 
    if ($dir == 'DESC') {
        echo ' selected';
    }
    ?>
> DESC
      </select>
    </td>
    <td valign="top"><b><?php 
    echo $acc_strings['ColExpl'];
    ?>
</b><br>
        <input type="text" size="30" maxlength="128" name="def_index_segs" value="<?php 
    echo $segs;
    ?>
">
    </td> 
  </tr>
</table>
<?php 
}