function ComboCommandDump($when, $index) { global $SQL_ARRAY, $nl, $databases, $lang; if (count($SQL_ARRAY) == 0) { $r = '<a href="sql.php?context=1" class="uls">' . $lang['sql_befehle'] . '</a>'; if ($when == 0) { $r .= '<input type="hidden" name="command_before_' . $index . '" value="">'; } else { $r .= '<input type="hidden" name="command_after_' . $index . '" value="">'; } } else { if ($when == 0) { $r = '<select class="SQLCombo" name="command_before_' . $index . '">'; $csql = $databases['command_before_dump'][$index]; } else { $r = '<select class="SQLCombo" name="command_after_' . $index . '">'; $csql = $databases['command_after_dump'][$index]; } $r .= '<option value="" ' . ($csql == "" ? "selected" : "") . '> </option>'; if (count($SQL_ARRAY) > 0) { for ($i = 0; $i < count($SQL_ARRAY); $i++) { $s = str_replace('"', "'", SQL_String($i)); $r .= '<option value="' . $s . '" ' . ($csql == $s ? "selected" : "") . '>' . SQL_Name($i) . '</option>' . $nl; } } $r .= '</select>'; } return $r; }
function ComboCommandDump($when, $index) { global $SQL_ARRAY, $nl, $databases, $lang; if (count($SQL_ARRAY) == 0) { $r = '<a href="sql.php?context=1" class="uls">' . $lang['L_SQL_BEFEHLE'] . '</a>'; if ($when == 0) { $r .= '<input type="hidden" name="command_before_' . $index . '" value="">'; } else { $r .= '<input type="hidden" name="command_after_' . $index . '" value="">'; } } else { if ($when == 0) { $r = '<select class="SQLCombo" name="command_before_' . $index . '">'; $csql = $databases['command_before_dump'][$index]; } else { $r = '<select class="SQLCombo" name="command_after_' . $index . '">'; $csql = $databases['command_after_dump'][$index]; } $r .= '<option value="" ' . ($csql == '' ? ' selected="selected"' : '') . '> </option>' . "\n"; if (count($SQL_ARRAY) > 0) { for ($i = 0; $i < count($SQL_ARRAY); $i++) { $s = trim(SQL_String($i)); $r .= '<option value="' . htmlspecialchars($s) . '" ' . ($csql == $s ? ' selected="selected"' : '') . '>' . SQL_Name($i) . '</option>' . "\n"; } } $r .= '</select>'; } return $r; }
echo '<tr><td colspan="4"><p class="success">' . $lang['L_SQL_BEFEHLSAVED1'] . ' \'' . $_POST['sqlname' . $i] . '\' ' . $lang['L_SQL_BEFEHLSAVED4'] . '</p></td></tr>'; $a[] = $SQL_ARRAY[$i]; array_splice($SQL_ARRAY, $i, 1); $SQL_ARRAY = array_merge($a, $SQL_ARRAY); WriteSQL(); } if (isset($_POST['sqldelete' . $i])) { echo '<tr><td colspan="4"><p class="success">' . $lang['L_SQL_BEFEHLSAVED1'] . ' \'' . $_POST['sqlname' . $i] . '\' ' . $lang['L_SQL_BEFEHLSAVED5'] . '</p></td></tr>'; array_splice($SQL_ARRAY, $i, 1); WriteSQL(); } } for ($i = 0; $i < count($SQL_ARRAY); $i++) { $cl = $i % 2 ? "dbrow" : "dbrow1"; echo '<tr class="' . $cl . '"><td>' . ($i + 1) . '.</td><td>'; echo '<input type="text" class="text" name="sqlname' . $i . '" value="' . htmlspecialchars(SQL_Name($i), ENT_COMPAT, 'UTF-8') . '"></td>'; echo '<td><textarea rows="4" cols="80" style="width:100%;" name="sqlstring' . $i . '">' . stripslashes(SQL_String($i)) . '</textarea></td>'; echo '<td><input class="Formbutton" style="width:80px;" type="submit" name="sqlupdate' . $i . '" value="save"><br> <input class="Formbutton" style="width:80px;" type="submit" name="sqlmove' . $i . '" value="move up"><br> <input class="Formbutton" style="width:80px;" type="submit" name="sqldelete' . $i . '" value="delete"></td></tr>'; } } if (isset($_GET['new'])) { $cl = $i % 2 ? "dbrow" : "dbrow1"; echo '<tr class="' . $cl . '"><td>' . ($i + 1) . '</td><td>'; echo '<input type="text" class="text" name="sqlname' . $i . '" id="sqlname' . $i . '" value="SQL ' . ($i + 1) . '"><br><div class="small" align="center">' . $lang['L_SQL_LIBRARY'] . '<br>'; echo '<select id="sqllib" name="sqllib" onChange="InsertLib(' . $i . ');" class="small">'; echo '<option value=""></option>'; $og = false; for ($j = 0; $j < count($sqllib); $j++) { if ($sqllib[$j]['sql'] == "trenn") {
echo '<p class="success">' . $lang['sql_befehlsaved1'] . ' \'' . $_POST['sqlname' . $i] . '\' ' . $lang['sql_befehlsaved4'] . '</p>'; $a[] = $SQL_ARRAY[$i]; array_splice($SQL_ARRAY, $i, 1); $SQL_ARRAY = array_merge($a, $SQL_ARRAY); WriteSQL(); } if (isset($_POST['sqldelete' . $i])) { echo '<p class="success">' . $lang['sql_befehlsaved1'] . ' \'' . $_POST['sqlname' . $i] . '\' ' . $lang['sql_befehlsaved5'] . '</p>'; array_splice($SQL_ARRAY, $i, 1); WriteSQL(); } } for ($i = 0; $i < count($SQL_ARRAY); $i++) { $cl = $i % 2 ? "dbrow" : "dbrow1"; echo '<tr class="' . $cl . '"><td>' . ($i + 1) . '</td><td>'; echo '<input type="text" class="text" name="sqlname' . $i . '" value="' . SQL_Name($i) . '"></td>'; echo '<td><textarea rows="3" cols="40" name="sqlstring' . $i . '">' . stripslashes(SQL_String($i)) . '</textarea></td>'; echo '<td><input class="SQLbutton" style="width:80px;" type="submit" name="sqlupdate' . $i . '" value="save"><br> <input class="SQLbutton" style="width:80px;" type="submit" name="sqlmove' . $i . '" value="move up"><br> <input class="SQLbutton" style="width:80px;" type="submit" name="sqldelete' . $i . '" value="delete"></td></tr>'; } } if (isset($_GET['new'])) { $cl = $i % 2 ? "dbrow" : "dbrow1"; echo '<tr class="' . $cl . '"><td>' . ($i + 1) . '</td><td>'; echo '<input type="text" class="text" name="sqlname' . $i . '" id="sqlname' . $i . '" value="SQL ' . ($i + 1) . '"><br><div class="small" align="center">' . $lang['sql_library'] . '<br>'; echo '<select id="sqllib" name="sqllib" onChange="InsertLib(' . $i . ');" class="small">'; echo '<option value=""></option>'; $og = false; for ($j = 0; $j < count($sqllib); $j++) { if ($sqllib[$j]['sql'] == "trenn") {