<td><input type="radio" name="auto_increment_col" value="" /><?php echo lang('Auto Increment'); ?></td>
<td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><?php echo lang('Comment'); ?></td>
<?php } ?>
-<td><input type="image" name="add[0]" src="plus.gif" title="<?php echo lang('Add next'); ?>" />
-<script type="text/javascript">
-var added = '.';
-var row_count = <?php echo count($fields); ?>;
-</script>
-</td>
+<td><input type="image" name="add[0]" src="plus.gif" title="<?php echo lang('Add next'); ?>" /><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script></td>
</tr></thead>
<?php
foreach ($fields as $i => $field) {
+document.body.className = 'js';
+
function toggle(id) {
var el = document.getElementById(id);
el.className = (el.className == 'hidden' ? '' : 'hidden');
}
}
+
+
function where_change(op) {
for (var i=0; i < op.form.elements.length; i++) {
var el = op.form.elements[i];
field.onchange = function () { };
}
+
+
+var added = '.', row_count;
+
function editing_add_row(button, allowed) {
if (allowed && row_count >= allowed) {
return false;
}
- var match = /([0-9]+)(\.[0-9]+)?/.exec(button.name)
+ var match = /([0-9]+)(\.[0-9]+)?/.exec(button.name);
var x = match[0] + (match[2] ? added.substr(match[2].length) : added) + '1';
var row = button.parentNode.parentNode;
var row2 = row.cloneNode(true);
el.onchange = function () {};
}
+
+
function foreign_add_row(field) {
var row = field.parentNode.parentNode.cloneNode(true);
var selects = row.getElementsByTagName('select');
field.onchange = function () { };
}
+
+
function indexes_add_row(field) {
var row = field.parentNode.parentNode.cloneNode(true);
var spans = row.getElementsByTagName('span');
field.onchange = function () { };
}
-function schema_mousedown(el, event, top) {
+
+
+var that, x, y, em, table_pos;
+
+function schema_mousedown(el, event) {
that = el;
- em = document.getElementById('schema').offsetHeight / top;
x = event.clientX - el.offsetLeft;
y = event.clientY - el.offsetTop;
}
}
}
+
+
function dump_check(a, name, value) {
var inputs = a.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('input');
for (var i=0; i < inputs.length; i++) {
}
return true;
}
-
-document.body.className = 'js';
$result->free();
?>
+<div id="schema" style="height: <?php echo $top; ?>em;">
<script type="text/javascript">
-var that, x, y, em;
-var table_pos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
+table_pos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
+em = document.getElementById('schema').offsetHeight / <?php echo $top; ?>;
document.onmousemove = schema_mousemove;
document.onmouseup = schema_mouseup;
</script>
-
-<div id="schema" style="height: <?php echo $top; ?>em;">
<?php
foreach ($schema as $name => $table) {
- echo "<div class='table' style='top: " . $table["pos"][0] . "em; left: " . $table["pos"][1] . "em;' onmousedown='schema_mousedown(this, event, $top);'>";
+ echo "<div class='table' style='top: " . $table["pos"][0] . "em; left: " . $table["pos"][1] . "em;' onmousedown='schema_mousedown(this, event);'>";
echo '<a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($name) . '"><strong>' . htmlspecialchars($name) . "</strong></a><br />\n";
foreach ($table["fields"] as $field) {
$val = htmlspecialchars($field["field"]);