<HTML>
<HEAD>
<TITLE>MySQLMan: Export to File</TITLE>

<SCRIPT LANGUAGE="JavaScript">
<!--

function AddAll (From, To) {
	var FromObj = document.ExportForm[From];
	var ToObj   = document.ExportForm[To];
	
	var i     = 1;
	var track = 1;
	while (i < FromObj.options.length) {
		if (track == FromObj.options.length) {
			alert ("You can not add more than the number of fields in the select list.");
			return;
		}
		if (ToObj.options[track].value != "") { track++; continue }
		ToObj.options[track].value    = FromObj.options[i].value;
		ToObj.options[track].text     = FromObj.options[i].text;
		ToObj.options[track].selected = true;
		i++;
		track++;
	}
	return true;
}

function AddIt (From, To) {
	var FromObj = document.ExportForm[From];
	var ToObj   = document.ExportForm[To];
	
	var track = 1;
	var i     = 1;
	while (i < FromObj.options.length) {
		if (track == FromObj.options.length) {
			alert ("You can not add more than the number of fields in the select list.");
			return false;
		}
		if (ToObj.options[track].value != "") { track++; continue }
		if (FromObj.options[i].selected) {
			ToObj.options[track].value    = FromObj.options[i].value;
			ToObj.options[track].text     = FromObj.options[i].text;
			ToObj.options[track].selected = true;
			track++;
		}
		i++;
	}
	return true;
}

function Clear (What) {
	var Obj   = document.ExportForm[What];
	for (var i = 1; i < Obj.options.length; i++) {
		Obj.options[i].value    = "";
		Obj.options[i].text     = "";
		Obj.options[i].selected = false;
	}
	return true;
} 

//-->
</SCRIPT>

</HEAD>
<BODY BGCOLOR="#CCCCCC">
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width="100%" align=center valign=top>
			<tr><td bgcolor="navy">
					<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
                    <b>MySQLMan: Export to File</b>
			</td></tr>
			<tr><td>
<%include header.txt%>
<UL>

<table bgcolor="#FFFFCC" border=1 cellpadding=5 cellspacing=3>
<td>
<li><B> Export Data from Table <%table%>:</B><BR>
	<UL>
		<FORM METHOD="POST" ACTION="<%script_url%>" name="ExportForm">
		<INPUT TYPE="hidden" name="<%do_param%>" VALUE='export'>
		<INPUT TYPE="hidden" NAME=data_source VALUE="<%data_source%>">
		<INPUT TYPE="hidden" NAME=table VALUE="<%table%>">
		<INPUT TYPE="hidden" NAME=origin VALUE="property">
		
		<input type="radio" name="export_to_screen" value="1" CHECKED> <B>Export to screen.</B><BR>
		<input type="radio" name="export_to_screen" value="0"> <B>Export to file.&nbsp;&nbsp;
		Path: </B><INPUT TYPE="text" NAME="file" VALUE="" SIZE="45"><P>

		<B>Select fields:</B><BR>
		<INPUT TYPE="radio" NAME="export_all_cols" VALUE="1" checked> All fields<BR>
		<INPUT TYPE="radio" NAME="export_all_cols" VALUE="0"> Selected Fields
		<UL>
			<li>Please note that in the exported file, the order of the data fields will follow the order of<BR>
			fields selected here.
			<P>
			<%include fields_selection.txt%>
			<P>
		</UL>
		
		<B>Options:</B><BR>
		Fields:
		<UL>
		Delimiter: <INPUT TYPE="text" NAME="delimiter" VALUE="|" SIZE="2"><BR>
		Escape Character: <INPUT TYPE="text" NAME="escape_char" VALUE="\" SIZE="2"><BR>
		</UL>
		Records:
		<UL>
		Delimiter: <INPUT TYPE="text" NAME="rec_del" VALUE="\n" SIZE="3"><BR>
		</UL>
		<P>
		<INPUT TYPE="submit" value=" Export ">
		</FORM>
	</UL>
</td></table>

</UL>
</td></tr></table>
</BODY>
</HTML>
