AddClassF.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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,"classf");
  20. $enews=RepPostStr($_GET['enews'],1);
  21. $url="<a href='../ListClass.php".$ecms_hashur['whehref']."'>管理栏目</a>&nbsp;>&nbsp;<a href='ListClassF.php".$ecms_hashur['whehref']."'>管理栏目字段</a>&nbsp;>&nbsp;增加栏目字段";
  22. $postword='增加字段';
  23. $r[myorder]=0;
  24. //修改字段
  25. if($enews=="EditClassF")
  26. {
  27. $fid=(int)$_GET['fid'];
  28. $url="<a href='../ListClass.php".$ecms_hashur['whehref']."'>管理栏目</a>&nbsp;>&nbsp;<a href='ListClassF.php".$ecms_hashur['whehref']."'>管理栏目字段</a>&nbsp;>&nbsp;修改栏目字段";
  29. $postword='修改字段';
  30. $r=$empire->fetch1("select * from {$dbtbpre}enewsclassf where fid='$fid'");
  31. if(!$r[fid])
  32. {
  33. printerror("ErrorUrl","history.go(-1)");
  34. }
  35. $oftype="type".$r[ftype];
  36. $$oftype=" selected";
  37. $ofform="form".$r[fform];
  38. $$ofform=" selected";
  39. }
  40. db_close();
  41. $empire=null;
  42. ?>
  43. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  44. <html>
  45. <head>
  46. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  47. <title>增加字段</title>
  48. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  49. </head>
  50. <body>
  51. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1">
  52. <tr>
  53. <td>位置:<?=$url?></td>
  54. </tr>
  55. </table>
  56. <form name="form1" method="post" action="../ecmsclass.php">
  57. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  58. <?=$ecms_hashur['form']?>
  59. <tr>
  60. <td height="25" colspan="2" class="header">
  61. <?=$postword?>
  62. <input name="fid" type="hidden" id="fid" value="<?=$fid?>"> <input name="enews" type="hidden" id="enews" value="<?=$enews?>">
  63. <input name="oldfform" type="hidden" id="oldfform" value="<?=$r[fform]?>">
  64. <input name="oldf" type="hidden" id="oldf" value="<?=$r[f]?>"> <input name="oldfvalue" type="hidden" id="oldfvalue" value="<?=$r[fvalue]?>">
  65. <input name="oldfformsize" type="hidden" id="oldfformsize" value="<?=$r[fformsize]?>"></td>
  66. </tr>
  67. <tr bgcolor="#FFFFFF">
  68. <td width="25%" height="25">字段名</td>
  69. <td width="75%" height="25"><input name="f" type="text" id="f" value="<?=$r[f]?>">
  70. <font color="#666666">(比如:&quot;title&quot;)</font></td>
  71. </tr>
  72. <tr bgcolor="#FFFFFF">
  73. <td height="25">字段标识</td>
  74. <td height="25"><input name="fname" type="text" id="fname" value="<?=$r[fname]?>">
  75. <font color="#666666">(比如:&quot;标题&quot;)</font></td>
  76. </tr>
  77. <tr bgcolor="#FFFFFF">
  78. <td height="25">字段类型</td>
  79. <td height="25"><select name="ftype" id="select">
  80. <option value="VARCHAR"<?=$typeVARCHAR?>>字符型0-255字节(VARCHAR)</option>
  81. <option value="TEXT"<?=$typeTEXT?>>小型字符型(TEXT)</option>
  82. <option value="MEDIUMTEXT"<?=$typeMEDIUMTEXT?>>中型字符型(MEDIUMTEXT)</option>
  83. <option value="LONGTEXT"<?=$typeLONGTEXT?>>大型字符型(LONGTEXT)</option>
  84. <option value="TINYINT"<?=$typeTINYINT?>>小数值型(TINYINT)</option>
  85. <option value="SMALLINT"<?=$typeSMALLINT?>>中数值型(SMALLINT)</option>
  86. <option value="INT"<?=$typeINT?>>大数值型(INT)</option>
  87. <option value="BIGINT"<?=$typeBIGINT?>>超大数值型(BIGINT)</option>
  88. <option value="FLOAT"<?=$typeFLOAT?>>数值浮点型(FLOAT)</option>
  89. <option value="DOUBLE"<?=$typeDOUBLE?>>数值双精度型(DOUBLE)</option>
  90. </select>
  91. 字段长度
  92. <input name="flen" type="text" id="flen" value="<?=$r[flen]?>" size="6">
  93. </td>
  94. </tr>
  95. <tr bgcolor="#FFFFFF">
  96. <td rowspan="2">输入表单显示元素</td>
  97. <td height="25"><select name="fform" id="fform">
  98. <option value="text"<?=$formtext?>>单行文本框(text)</option>
  99. <option value="password"<?=$formpassword?>>密码框(password)</option>
  100. <option value="select"<?=$formselect?>>下拉框(select)</option>
  101. <option value="radio"<?=$formradio?>>单选框(radio)</option>
  102. <option value="textarea"<?=$formtextarea?>>多行文本框(textarea)</option>
  103. <option value="editor"<?=$formeditor?>>编辑器(editor)</option>
  104. <option value="img"<?=$formimg?>>图片(img)</option>
  105. <option value="flash"<?=$formflash?>>FLASH文件(flash)</option>
  106. <option value="file"<?=$formfile?>>文件(file)</option>
  107. </select>
  108. 元素长度
  109. <input name="fformsize" type="text" id="fformsize" value="<?=$r[fformsize]?>" size="12">
  110. <font color="#666666">(空为按默认)</font></td>
  111. </tr>
  112. <tr bgcolor="#FFFFFF">
  113. <td height="25"><font color="#666666">说明:长度如果是“多行文本框”,长度与行数用逗号格开,如“60,6”.</font></td>
  114. </tr>
  115. <tr bgcolor="#FFFFFF">
  116. <td height="25" valign="top">初始值<br>
  117. <font color="#666666"><span id="defvaldiv">(多个值用&quot;回车&quot;格开;<br>
  118. 默认选项后面加::default)</span></font></td>
  119. <td height="25"><textarea name="fvalue" cols="65" rows="8" id="fvalue" style="WIDTH: 100%"><?=str_replace("|","\r\n",$r[fvalue])?></textarea></td>
  120. </tr>
  121. <tr bgcolor="#FFFFFF">
  122. <td height="25">显示顺序</td>
  123. <td height="25"><input name="myorder" type="text" id="myorder" value="<?=$r[myorder]?>" size="6">
  124. <font color="#666666">(数字越小越前面)</font></td>
  125. </tr>
  126. <tr bgcolor="#FFFFFF">
  127. <td height="25" valign="top">输入表单替换html代码<br> <font color="#666666">(增加字段时请留空)</font></td>
  128. <td height="25"><textarea name="fhtml" cols="65" rows="10" id="fhtml" style="WIDTH: 100%"><?=ehtmlspecialchars(stripSlashes($r[fhtml]))?></textarea></td>
  129. </tr>
  130. <tr bgcolor="#FFFFFF">
  131. <td height="25" valign="top">注释</td>
  132. <td height="25"><textarea name="fzs" cols="65" rows="10" id="fzs" style="WIDTH: 100%"><?=stripSlashes($r[fzs])?></textarea></td>
  133. </tr>
  134. <tr bgcolor="#FFFFFF">
  135. <td height="25">&nbsp;</td>
  136. <td height="25"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>
  137. </tr>
  138. </table>
  139. </form>
  140. </body>
  141. </html>