<?php
$tablename = (isset($_REQUEST['tablename']) && !empty($_REQUEST['tablename']))? $_REQUEST['tablename'] : false;
?>
<script>
function hide_them_all(){
document.getElementById('sqlshow').style.display = "none";
document.getElementById('csvshow').style.display = "none";
document.getElementById('xmlshow').style.display = "none";
}
function init_options() {
hide_them_all();
if (document.getElementById("sqltab").checked) {
document.getElementById("sqlshow").style.display = "block";
} else if (document.getElementById("csvtab").checked) {
document.getElementById("csvshow").style.display = "block";
}if (document.getElementById("xmltab").checked) {
document.getElementById("xmlshow").style.display = "block";
}
}
</script>
<form name="export_option" method="post">
<input name="tablename" type="hidden" value="<?php echo $tablename;?>" />
<input name="function" type="hidden" value="textarea" />
<table width="100%" cellpadding="2" cellspacing="0" border="0" class="default">
<tr>
<td id="borders" width="50" valign="top">
<b>Export: <?php echo $tablename;?></b><br />
<br /><br />
<table cellpadding="2" cellspacing="0" border="0" class="default" align="center">
<tr>
<td colspan="2">Export type:</td>
</tr>
<tr>
<td id="borders"><input name="extype" id="sqltab" type="radio" value="SQL" checked="checked" onclick="javascript:if(this.checked) { hide_them_all(); document.getElementById('sqlshow').style.display = 'block'; }; return true" /> </td>
<td id="borders" width="400">SQL</td>
</tr>
<tr>
<td id="borders"><input name="extype" id="csvtab" type="radio" value="CSV" onclick="javascript:if(this.checked) { hide_them_all(); document.getElementById('csvshow').style.display = 'block'; }; return true"/> </td>
<td id="borders" >CSV</td>
</tr>
<tr>
<td id="borders"><input name="extype" id="xmltab" type="radio" value="XML" onclick="javascript:if(this.checked) { hide_them_all(); document.getElementById('xmlshow').style.display = 'block'; }; return true" /> </td>
<td id="borders" >XML</td>
</tr>
<tr>
<td id="borders" colspan="2">Structure:</td>
</tr>
<tr>
<td id="borders" colspan="2">
<!-- SQL /////////////////////-->
<table width="100%" id="sqlshow" style="display:block;" cellpadding="2" cellspacing="0" border="0" class="default">
<tr>
<td id="borders"><input name="dt" type="checkbox" value="1" /> </td>
<td id="borders" >Add DROP TABLE</td>
</tr>
<tr>
<td id="borders"><input name="ine" type="checkbox" value="1" checked="checked"/> </td>
<td id="borders" >Add IF NOT EXISTS</td>
</tr>
<tr>
<td id="borders"><input name="autoincrement" type="checkbox" value="1" checked="checked"/> </td>
<td id="borders" >Add AUTO_INCREMENT value</td>
</tr>
</table>
<!-- CSV /////////////////////-->
<table width="100%" id="csvshow" style="display:none;" cellpadding="2" cellspacing="0" border="0" class="default">
<tr>
<td id="borders">Fields terminated by: </td>
<td id="borders" ><input name="fields_teriminated" type="text" value=";"/></td>
</tr>
<tr>
<td id="borders">Fields enclosed by: </td>
<td id="borders" ><input name="fields_enclosed" type="text" value=""" /></td>
</tr>
<tr>
<td id="borders">Fields escaped by: </td>
<td id="borders" ><input name="fields_escaped" type="text" value="\"/></td>
</tr>
<tr>
<td id="borders">Lines terminated by: </td>
<td id="borders" ><input name="lines_teriminated" type="text" value="AUTO"/></td>
</tr>
<tr>
<td id="borders">Replace NULL by: </td>
<td id="borders" ><input name="replace_null" type="text" value="NULL"/></td>
</tr>
<tr>
<td id="borders" ><input name="fields_first_row" type="checkbox" value="1"/></td>
<td id="borders">Put fields names in the first row.</td>
</tr>
</table>
<!-- XML /////////////////////-->
<table width="100%" id="xmlshow" style="display:none;" cellpadding="2" cellspacing="0" border="0" class="default">
<tr>
<td id="borders">This format has no options</td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="borders" colspan="2" align="center"><input type="submit" value="Export" class="button" /></td>
</tr>
</table>
<br />
</td>
</tr>
</table>
</form>