ChangeDataTableF.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require("../../class/connect.php");
  4. require("../../class/db_sql.php");
  5. require("../../class/functions.php");
  6. $link=db_connect();
  7. $empire=new mysqlquery();
  8. $editor=1;
  9. //验证用户
  10. $lur=is_login();
  11. $logininid=$lur['userid'];
  12. $loginin=$lur['username'];
  13. $loginrnd=$lur['rnd'];
  14. $loginlevel=$lur['groupid'];
  15. $loginadminstyleid=$lur['adminstyleid'];
  16. //ehash
  17. $ecms_hashur=hReturnEcmsHashStrAll();
  18. //验证权限
  19. CheckLevel($logininid,$loginin,$classid,"f");
  20. $fid=(int)$_GET['fid'];
  21. $tid=(int)$_GET['tid'];
  22. $tbname=RepPostVar($_GET['tbname']);
  23. if(!$fid||!$tid||!$tbname)
  24. {
  25. printerror("ErrorUrl","history.go(-1)");
  26. }
  27. $fr=$empire->fetch1("select fid,f,fname,isadd,tid,tbname,tbdataf from {$dbtbpre}enewsf where fid='$fid'");
  28. if(!$fr[fid])
  29. {
  30. printerror("ErrorUrl","history.go(-1)");
  31. }
  32. if(empty($fr[isadd]))
  33. {
  34. printerror("NotIsAdd","history.go(-1)");
  35. }
  36. $tid=$fr[tid];
  37. $tbname=$fr[tbname];
  38. if($fr[tbdataf])
  39. {
  40. $doing='字段转移到主表';
  41. }
  42. else
  43. {
  44. $doing='字段转移到副表';
  45. }
  46. $url="数据表:[".$dbtbpre."ecms_".$tbname."]&nbsp;>&nbsp;<a href=ListF.php?tid=$tid&tbname=$tbname".$ecms_hashur['ehref'].">字段管理</a>&nbsp;>&nbsp;".$doing;
  47. db_close();
  48. $empire=null;
  49. ?>
  50. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  51. <html>
  52. <head>
  53. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  54. <title>转移字段</title>
  55. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  56. </head>
  57. <body>
  58. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  59. <tr>
  60. <td>位置:
  61. <?=$url?>
  62. </td>
  63. </tr>
  64. </table>
  65. <form action="../ecmsmod.php" method="GET" enctype="multipart/form-data" name="form1" onsubmit="return confirm('确认要转移?');">
  66. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  67. <?=$ecms_hashur['form']?>
  68. <tr>
  69. <td height="25" colspan="2" class="header">
  70. <?=$doing?>
  71. </td>
  72. </tr>
  73. <tr>
  74. <td width="28%" height="25" bgcolor="#FFFFFF">数据表:</td>
  75. <td width="72%" height="25" bgcolor="#FFFFFF"> <strong>
  76. <?=$dbtbpre?>
  77. ecms_
  78. <?=$tbname?>
  79. </strong></td>
  80. </tr>
  81. <tr>
  82. <td height="25" bgcolor="#FFFFFF">字段名:</td>
  83. <td height="25" bgcolor="#FFFFFF"><strong>
  84. <?=$fr[f]?>
  85. </strong>&nbsp;(
  86. <?=$fr[fname]?>
  87. )</td>
  88. </tr>
  89. <tr>
  90. <td height="25" bgcolor="#FFFFFF">每组转换数量:</td>
  91. <td height="25" bgcolor="#FFFFFF"><input name="line" type="text" id="line" value="200"></td>
  92. </tr>
  93. <tr>
  94. <td height="25" bgcolor="#FFFFFF">&nbsp;</td>
  95. <td height="25" bgcolor="#FFFFFF"> <input type="submit" name="Submit" value="开始转移">
  96. <input name="enews" type="hidden" id="enews" value="ChangeDataTableF">
  97. <input name="tid" type="hidden" id="tid" value="<?=$tid?>"> <input name="tbname" type="hidden" id="tbname" value="<?=$tbname?>">
  98. <input name="fid" type="hidden" id="fid" value="<?=$fid?>"></td>
  99. </tr>
  100. <tr>
  101. <td height="25" colspan="2" bgcolor="#FFFFFF"><font color="#666666">说明:转换前建议先备份数据。</font></td>
  102. </tr>
  103. </table>
  104. </form>
  105. </body>
  106. </html>