index.php
上传用户:jiangbw
上传日期:2022-03-16
资源大小:49k
文件大小:6k
- <?
- /*======================================================================*
- || #################################################################### ||
- || # BUILD UNDER PHP SCRIPTNET 3.2.1 FRAMEWORK ||
- || # ---------------------------------------------------------------- # ||
- || # Code2Art Open Source Software. All Rights Reserved. ||
- || # This file should be redistributed in whole or significant part. # ||
- || # ------------------ SCRIPTNET IS FREE SOFTWARE ------------------ # ||
- || # http://www.code2art.com | http://www.code2art.com/scriptnet # ||
- || # Copyleft by Benediktus Ardian Hersanto, SE # ||
- || # Sorry if this framework is still unavailable for public # ||
- || # because I still searching on my own head. # ||
- || #################################################################### ||
- *======================================================================*/
- /*======================================================================*
- || #################################################################### ||
- || DBF to MySQL Bulk Converter 2.0 ||
- ||______________________________________________________________________||
- || This utility was developed on 2006, since this were used to be on ||
- || my own library. But I think I should share it to you, because I ||
- || need to save my work on Internet (I don't believe on my own HD drive)||
- || it always crash and had a terrible bad sectors. ||
- || Thanks to all person who download this utility, I hope you enjoy it. ||
- || ||
- || Regards, ||
- || Benediktus Ardian Hersanto,SE (ardie_b@yahoo.com) ||
- /*======================================================================*/
- // ---------------------------------------------------------------------//
- // Free to use for everyone who understand PHP
- // ---------------------------------------------------------------------//
- include('init.php');
- LoadClass('session');
- $session = new session;
- if(isset($_SESSION))$session->destroy();
- ?>
- <html>
- <head>
- <meta http-equiv="Content-Language" content="en-us">
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <title>DBF FoxPro to MySQL Converter</title>
- <style>
- BODY{
- font-family:"Verdana";
- font-size : 2;
- }
- </style>
- <script language="javascript">
- function CheckAll(obj,state) {
- obj.disabled = true;
- setTimeout("Check("+state+",'"+obj.id+"')", 1);
- }
- function Check(state,sender) {
- for(i=0;i<frames[0].document.forms[0].elements.length;i++) {
- if(typeof frames[0].document.forms[0].elements[i].checked!='undefined')frames[0].document.forms[0].elements[i].checked=state;
- }
- document.getElementById(sender).disabled = false;
- }
- // fixed latest mozilla firefox javascript bug
- function Import() {
- frames[0].document.forms[0].dbname.value=document.forms[0].db.value;
- if(document.forms[0].elements.length>0) {
- for(i=0;i<document.forms[0].elements.length;i++) {
- if(document.forms[0].elements[i].name=='update_type'&&document.forms[0].elements[i].checked==true)
- frames[0].document.forms[0].type.value=document.forms[0].elements[i].value;
- }
- frames[0].document.forms[0].submit();
- }
- }
- </script>
- </head>
- <body>
- <form method="POST" name="main">
- <table border="1" width="100%" cellspacing="0" cellpadding="0" style="border: 1px solid #000000">
- <tr>
- <td colspan="2" bgcolor="#808080">
- <p align="center"><font face="Verdana" size="2" color="#FFFFFF"><b>
- FoxPro to MySQL Converter</b></font></td>
- </tr>
- <tr>
- <td width="15%" valign="top">
- <table border="0" width="100%">
- <tr>
- <td><b><font size="2">Location</font></b></td>
- </tr>
- <tr>
- <td>
- <iframe name="I1" src="files.php" width="213" height="281" border="0" frameborder="0" style="border: 1px solid #808080">
- Your browser does not support inline frames or is currently configured not to display inline frames.
- </iframe></td>
- </tr>
- <tr>
- <td>
- <table border="0" width="100%">
-
- <tr>
- <td><input type="button" name="B2" id="btnCheck" onClick="javascript:CheckAll(this,true)" value="Check All"></td>
- <td><input type="button" name="B3" id="btnUnCheck" onClick="javascript:CheckAll(this,false)" value="UnCheck All"></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- <td width="83%" valign="top">
- <table border="0" width="100%">
- <tr>
- <td><b><font size="2">Destination Database</font></b></td>
- </tr>
- <tr>
- <td><select size="1" name="db">
- <?
- $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);
- $db_list = mysql_list_dbs($link);
- while ($row = mysql_fetch_object($db_list)) {
- if(!ereg("mysql",$row->Database))
- echo "<option value='{$row->Database}'>{$row->Database}</option>";
- }
- ?>
- </select></td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- <tr>
- <td><b><font size="2">Update Option:</font></b></td>
- </tr>
- <tr>
- <td>
- <table border="0" width="100%" cellspacing="1">
- <tr>
- <td width="33" align="center">
- <input type="radio" value="new" name="update_type"></td>
- <td><font size="2">Create new table and add record</font></td>
- </tr>
- <tr>
- <td width="33" align="center">
- <input type="radio" value="clear" name="update_type"></td>
- <td><font size="2">Clear existing table and add record</font></td>
- </tr>
- <tr>
- <td width="33" align="center">
- <input type="radio" value="add" checked name="update_type"></td>
- <td><font size="2">Append record only</font></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <p><input type="button" value="Start Convert" name="B1" onClick="javascript:Import()">
- </p>
- </form>
- </body>
- </html>