ListF.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. $tid=(int)$_GET['tid'];
  21. $tbname=RepPostVar($_GET['tbname']);
  22. if(!$tid||!$tbname)
  23. {
  24. printerror("ErrorUrl","history.go(-1)");
  25. }
  26. $url="数据表:[".$dbtbpre."ecms_".$tbname."]&nbsp;>&nbsp;<a href=ListF.php?tid=$tid&tbname=$tbname".$ecms_hashur['ehref'].">字段管理</a>";
  27. $sql=$empire->query("select * from {$dbtbpre}enewsf where tid='$tid' order by myorder,fid");
  28. ?>
  29. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  30. <html>
  31. <head>
  32. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  33. <title>管理字段</title>
  34. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  35. </head>
  36. <body>
  37. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  38. <tr>
  39. <td>位置:<?=$url?></td>
  40. </tr>
  41. </table>
  42. <form name="form1" method="post" action="../ecmsmod.php">
  43. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  44. <?=$ecms_hashur['form']?>
  45. <tr>
  46. <td class="emenubutton"><input type="button" name="Submit2" value="增加字段" onclick="self.location.href='AddF.php?enews=AddF&tid=<?=$tid?>&tbname=<?=$tbname?><?=$ecms_hashur['ehref']?>';"></td>
  47. </tr>
  48. </table>
  49. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  50. <tr class="header">
  51. <td width="6%" height="25"><div align="center">顺序</div></td>
  52. <td width="8%"><div align="center">表</div></td>
  53. <td width="29%" height="25"><div align="center">字段名</div></td>
  54. <td width="20%"><div align="center">字段标识</div></td>
  55. <td width="15%"> <div align="center">字段类型</div></td>
  56. <td width="8%"><div align="center">采集项</div></td>
  57. <td width="14%" height="25"><div align="center">操作</div></td>
  58. </tr>
  59. <?php
  60. while($r=$empire->fetch($sql))
  61. {
  62. $ftype=$r[ftype];
  63. if($r[flen])
  64. {
  65. if($r[ftype]!="TEXT"&&$r[ftype]!="MEDIUMTEXT"&&$r[ftype]!="LONGTEXT"&&$r[ftype]!="DATE"&&$r[ftype]!="DATETIME")
  66. {
  67. $ftype.="(".$r[flen].")";
  68. }
  69. }
  70. if($r[iscj])
  71. {$iscj="是";}
  72. else
  73. {$iscj="否";}
  74. if($r[isadd])
  75. {
  76. $do="[<a href='AddF.php?tid=$tid&tbname=$tbname&enews=EditF&fid=".$r[fid].$ecms_hashur['ehref']."'>修改</a>]&nbsp;&nbsp;[<a href='../ecmsmod.php?tid=$tid&tbname=$tbname&enews=DelF&fid=".$r[fid].$ecms_hashur['href']."' onclick=\"return confirm('确认要删除?');\">删除</a>]";
  77. }
  78. else
  79. {
  80. $ftype="系统字段";
  81. $r[f]="<a title='系统字段'><font color=red>".$r[f]."</font></a>";
  82. $do="<a href='EditSysF.php?tid=$tid&tbname=$tbname&fid=".$r[fid].$ecms_hashur['ehref']."'><font color=red>[修改系统字段]</font></a>";
  83. }
  84. if($r[tbdataf]==1)
  85. {
  86. $tbdataf=$r[isadd]?"<a href='ChangeDataTableF.php?tid=$tid&tbname=$tbname&fid=".$r[fid].$ecms_hashur['ehref']."' title='点击将字段转移到主表'>副表</a>":"副表";
  87. }
  88. else
  89. {
  90. $tbdataf=$r[isadd]?"<a href='ChangeDataTableF.php?tid=$tid&tbname=$tbname&fid=".$r[fid].$ecms_hashur['ehref']."' title='点击将字段转移到副表'>主表</a>":"主表";
  91. }
  92. ?>
  93. <tr bgcolor="#ffffff" onmouseout="this.style.backgroundColor='#ffffff'" onmouseover="this.style.backgroundColor='#C3EFFF'">
  94. <td height="25"><div align="center">
  95. <input name="myorder[]" type="text" id="myorder[]" value="<?=$r[myorder]?>" size="3">
  96. <input type=hidden name=fid[] value=<?=$r[fid]?>>
  97. </div></td>
  98. <td><div align="center">
  99. <?=$tbdataf?>
  100. </div></td>
  101. <td height="25"><div align="center">
  102. <?=$r[f]?>
  103. </div></td>
  104. <td><div align="center">
  105. <?=$r[fname]?>
  106. </div></td>
  107. <td><div align="center">
  108. <?=$ftype?>
  109. </div></td>
  110. <td><div align="center">
  111. <?=$iscj?>
  112. </div></td>
  113. <td height="25"><div align="center">
  114. <?=$do?>
  115. </div></td>
  116. </tr>
  117. <?
  118. }
  119. ?>
  120. <tr bgcolor="ffffff">
  121. <td height="25">&nbsp;</td>
  122. <td height="25" colspan="6"><input type="submit" name="Submit" value="修改字段顺序">
  123. <input name="enews" type="hidden" id="enews" value="EditFOrder"> <input name="tid" type="hidden" id="tid" value="<?=$tid?>">
  124. <input name="tbname" type="hidden" id="tbname" value="<?=$tbname?>"></td>
  125. </tr>
  126. <tr bgcolor="ffffff">
  127. <td height="25">&nbsp;</td>
  128. <td height="25" colspan="6"><font color="#666666">说明:顺序值越小越显示前面,红色字段名为系统字段,点击“主表”/“副表”可以进行字段转移.</font></td>
  129. </tr>
  130. </table>
  131. </form>
  132. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  133. <tr>
  134. <td><div align="center"> [<a href="javascript:window.close();">关闭</a>] </div></td>
  135. </tr>
  136. </table>
  137. </body>
  138. </html>
  139. <?
  140. db_close();
  141. $empire=null;
  142. ?>