function writeTable($fd, $resultSet) { debug_print("writeTable<br>"); $parser = new ResultSetParser(); return $parser->parseResultSetIntoFile($fd, $resultSet); }
echo "colCount: {$colCount}<br>"; for ($i = 0; $i < $colCount; ++$i) { if (isset($_POST['dupCol' . $i])) { $rs->duplicateColumn($i); echo "Column {$i} duplicated!<br>"; } } for ($i = 0; $i < $colCount; ++$i) { if (isset($_POST['delCol' . $i])) { $rs->removeColumn($i); echo "Column {$i} deleted!<br>"; } } $fd = fopen($table_file, "wb"); $rp = new ResultSetParser(); $rp->parseResultSetIntoFile($fd, $rs); fclose($fd); if (isset($_POST['close_table'])) { echo "<br>"; echo "Table saved and closed, klick <a href='" . $_SERVER['PHP_SELF'] . "'> here </a> to continue"; $_SESSION['mode'] = 'choose_table'; unset($_SESSION['table_file']); echo "<meta http-equiv='refresh' content='1;URL=" . $_SERVER['PHP_SELF'] . "'>"; } else { $_SESSION['mode'] = 'edit_table'; echo "<br>"; echo "Table saved, klick <a href='" . $_SERVER['PHP_SELF'] . "'> here </a> to continue"; echo "<meta http-equiv='refresh' content='1;URL=" . $_SERVER['PHP_SELF'] . "'>"; } } }