AddPlF.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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,"plf");
  20. $enews=ehtmlspecialchars($_GET['enews']);
  21. $url="<a href=ListAllPl.php".$ecms_hashur['whehref'].">管理评论</a>&nbsp;>&nbsp;<a href=ListPlF.php".$ecms_hashur['whehref'].">管理评论自定义字段</a>&nbsp;>&nbsp;增加字段";
  22. //修改字段
  23. if($enews=="EditPlF")
  24. {
  25. $fid=(int)$_GET['fid'];
  26. $url="<a href=ListAllPl.php".$ecms_hashur['whehref'].">管理评论</a>&nbsp;>&nbsp;<a href=ListPlF.php".$ecms_hashur['whehref'].">管理评论自定义字段</a>&nbsp;>&nbsp;修改字段";
  27. $r=$empire->fetch1("select * from {$dbtbpre}enewsplf where fid='$fid'");
  28. if(!$r[fid])
  29. {
  30. printerror("ErrorUrl","history.go(-1)");
  31. }
  32. $oftype="type".$r[ftype];
  33. $$oftype=" selected";
  34. }
  35. db_close();
  36. $empire=null;
  37. ?>
  38. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  39. <html>
  40. <head>
  41. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  42. <title>增加字段</title>
  43. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  44. </head>
  45. <body>
  46. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  47. <tr>
  48. <td>位置:<?=$url?></td>
  49. </tr>
  50. </table>
  51. <form name="form1" method="post" action="../ecmspl.php">
  52. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  53. <?=$ecms_hashur['form']?>
  54. <tr>
  55. <td height="25" colspan="2" class="header">增加/修改字段
  56. <input name="fid" type="hidden" id="fid" value="<?=$fid?>"> <input name="enews" type="hidden" id="enews" value="<?=$enews?>">
  57. <input name="oldf" type="hidden" id="oldf" value="<?=$r[f]?>"> </td>
  58. </tr>
  59. <tr bgcolor="#FFFFFF">
  60. <td width="25%" height="25">字段名</td>
  61. <td width="75%" height="25"><input name="f" type="text" id="f" value="<?=$r[f]?>">
  62. <font color="#666666">(比如:&quot;title&quot;)</font></td>
  63. </tr>
  64. <tr bgcolor="#FFFFFF">
  65. <td height="25">字段标识</td>
  66. <td height="25"><input name="fname" type="text" id="fname" value="<?=$r[fname]?>">
  67. <font color="#666666">(比如:&quot;标题&quot;)</font></td>
  68. </tr>
  69. <tr bgcolor="#FFFFFF">
  70. <td height="25">字段类型</td>
  71. <td height="25"><select name="ftype" id="select">
  72. <option value="VARCHAR"<?=$typeVARCHAR?>>字符型0-255字节(VARCHAR)</option>
  73. <option value="TEXT"<?=$typeTEXT?>>小型字符型(TEXT)</option>
  74. <option value="MEDIUMTEXT"<?=$typeMEDIUMTEXT?>>中型字符型(MEDIUMTEXT)</option>
  75. <option value="LONGTEXT"<?=$typeLONGTEXT?>>大型字符型(LONGTEXT)</option>
  76. <option value="TINYINT"<?=$typeTINYINT?>>小数值型(TINYINT)</option>
  77. <option value="SMALLINT"<?=$typeSMALLINT?>>中数值型(SMALLINT)</option>
  78. <option value="INT"<?=$typeINT?>>大数值型(INT)</option>
  79. <option value="BIGINT"<?=$typeBIGINT?>>超大数值型(BIGINT)</option>
  80. <option value="FLOAT"<?=$typeFLOAT?>>数值浮点型(FLOAT)</option>
  81. <option value="DOUBLE"<?=$typeDOUBLE?>>数值双精度型(DOUBLE)</option>
  82. </select>
  83. 字段长度
  84. <input name="flen" type="text" id="flen" value="<?=$r[flen]?>" size="6">
  85. </td>
  86. </tr>
  87. <tr bgcolor="#FFFFFF">
  88. <td height="25">必填项</td>
  89. <td height="25"><input type="radio" name="ismust" value="1"<?=$r[ismust]==1?' checked':''?>>
  90. <input type="radio" name="ismust" value="0"<?=$r[ismust]==0?' checked':''?>>
  91. 否</td>
  92. </tr>
  93. <tr bgcolor="#FFFFFF">
  94. <td height="25" valign="top">注释:</td>
  95. <td height="25"><textarea name="fzs" cols="65" rows="10" id="fzs"><?=stripSlashes($r[fzs])?></textarea></td>
  96. </tr>
  97. <tr bgcolor="#FFFFFF">
  98. <td height="25">&nbsp;</td>
  99. <td height="25"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>
  100. </tr>
  101. </table>
  102. </form>
  103. </body>
  104. </html>