index.php
上传用户:jiangbw
上传日期:2022-03-16
资源大小:49k
文件大小:6k
源码类别:

MySQL数据库

开发平台:

Unix_Linux

  1. <?
  2. /*======================================================================*
  3. || #################################################################### ||
  4. || # BUILD UNDER PHP SCRIPTNET 3.2.1 FRAMEWORK ||
  5. || # ---------------------------------------------------------------- # ||
  6. || # Code2Art Open Source Software. All Rights Reserved.  ||
  7. || # This file should be redistributed in whole or significant part.  # ||
  8. || # ------------------ SCRIPTNET IS FREE SOFTWARE ------------------ # ||
  9. || # http://www.code2art.com | http://www.code2art.com/scriptnet      # ||
  10. || # Copyleft by Benediktus Ardian Hersanto, SE       # ||
  11. || # Sorry if this framework is still unavailable for public       # ||
  12. || # because I still searching on my own head.       # ||
  13. || #################################################################### ||
  14. *======================================================================*/
  15. /*======================================================================*
  16. || #################################################################### ||
  17. || DBF to MySQL Bulk Converter 2.0 ||
  18. ||______________________________________________________________________||
  19. || This utility was developed on 2006, since this were used to be on    ||
  20. || my own library. But I think I should share it to you, because I      ||
  21. || need to save my work on Internet (I don't believe on my own HD drive)||
  22. || it always crash and had a terrible bad sectors.  ||
  23. || Thanks to all person who download this utility, I hope you enjoy it. ||
  24. || ||
  25. || Regards, ||
  26. || Benediktus Ardian Hersanto,SE (ardie_b@yahoo.com) ||
  27. /*======================================================================*/
  28. // ---------------------------------------------------------------------//
  29. // Free to use for everyone who understand PHP
  30. // ---------------------------------------------------------------------//
  31. include('init.php');
  32. LoadClass('session');
  33. $session = new session;
  34. if(isset($_SESSION))$session->destroy();
  35. ?>
  36. <html>
  37. <head>
  38. <meta http-equiv="Content-Language" content="en-us">
  39. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  40. <title>DBF FoxPro to MySQL Converter</title>
  41. <style>
  42. BODY{
  43. font-family:"Verdana";
  44. font-size : 2;
  45. }
  46. </style>
  47. <script language="javascript">
  48. function CheckAll(obj,state) {
  49. obj.disabled = true;
  50. setTimeout("Check("+state+",'"+obj.id+"')", 1);
  51. }
  52. function Check(state,sender) {
  53. for(i=0;i<frames[0].document.forms[0].elements.length;i++) {
  54. if(typeof frames[0].document.forms[0].elements[i].checked!='undefined')frames[0].document.forms[0].elements[i].checked=state;
  55. }
  56. document.getElementById(sender).disabled = false;
  57. }
  58. // fixed latest mozilla firefox javascript bug
  59. function Import() {
  60. frames[0].document.forms[0].dbname.value=document.forms[0].db.value;
  61. if(document.forms[0].elements.length>0) {
  62. for(i=0;i<document.forms[0].elements.length;i++) {
  63. if(document.forms[0].elements[i].name=='update_type'&&document.forms[0].elements[i].checked==true) 
  64. frames[0].document.forms[0].type.value=document.forms[0].elements[i].value;
  65. }
  66. frames[0].document.forms[0].submit();
  67. }
  68. }
  69. </script>
  70. </head>
  71. <body>
  72. <form method="POST" name="main">
  73. <table border="1" width="100%" cellspacing="0" cellpadding="0" style="border: 1px solid #000000">
  74. <tr>
  75. <td colspan="2" bgcolor="#808080">
  76. <p align="center"><font face="Verdana" size="2" color="#FFFFFF"><b>
  77. FoxPro to MySQL Converter</b></font></td>
  78. </tr>
  79. <tr>
  80. <td width="15%" valign="top">
  81. <table border="0" width="100%">
  82. <tr>
  83. <td><b><font size="2">Location</font></b></td>
  84. </tr>
  85. <tr>
  86. <td>
  87. <iframe name="I1" src="files.php" width="213" height="281" border="0" frameborder="0" style="border: 1px solid #808080">
  88. Your browser does not support inline frames or is currently configured not to display inline frames.
  89. </iframe></td>
  90. </tr>
  91. <tr>
  92. <td>
  93. <table border="0" width="100%">
  94. <tr>
  95. <td><input type="button" name="B2" id="btnCheck" onClick="javascript:CheckAll(this,true)" value="Check All"></td>
  96. <td><input type="button" name="B3" id="btnUnCheck" onClick="javascript:CheckAll(this,false)" value="UnCheck All"></td>
  97. </tr>
  98. </table>
  99. </td>
  100. </tr>
  101. </table>
  102. </td>
  103. <td width="83%" valign="top">
  104. <table border="0" width="100%">
  105. <tr>
  106. <td><b><font size="2">Destination Database</font></b></td>
  107. </tr>
  108. <tr>
  109. <td><select size="1" name="db">
  110. <?
  111. $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);
  112. $db_list = mysql_list_dbs($link);
  113. while ($row = mysql_fetch_object($db_list)) {
  114. if(!ereg("mysql",$row->Database))
  115.      echo "<option value='{$row->Database}'>{$row->Database}</option>";
  116. }
  117. ?>
  118. </select></td>
  119. </tr>
  120. <tr>
  121. <td>&nbsp;</td>
  122. </tr>
  123. <tr>
  124. <td><b><font size="2">Update Option:</font></b></td>
  125. </tr>
  126. <tr>
  127. <td>
  128. <table border="0" width="100%" cellspacing="1">
  129. <tr>
  130. <td width="33" align="center">
  131. <input type="radio" value="new" name="update_type"></td>
  132. <td><font size="2">Create new table and add record</font></td>
  133. </tr>
  134. <tr>
  135. <td width="33" align="center">
  136. <input type="radio" value="clear" name="update_type"></td>
  137. <td><font size="2">Clear existing table and add record</font></td>
  138. </tr>
  139. <tr>
  140. <td width="33" align="center">
  141. <input type="radio" value="add" checked name="update_type"></td>
  142. <td><font size="2">Append record only</font></td>
  143. </tr>
  144. </table>
  145. </td>
  146. </tr>
  147. <tr>
  148. <td>&nbsp;</td>
  149. </tr>
  150. </table>
  151. </td>
  152. </tr>
  153. </table>
  154. <p><input type="button" value="Start Convert" name="B1" onClick="javascript:Import()">
  155. </p>
  156. </form>
  157. </body>
  158. </html>