AddMemberForm.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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,"memberf");
  20. $enews=ehtmlspecialchars($_GET['enews']);
  21. $ftype=" checked";
  22. $record="<!--record-->";
  23. $field="<!--field--->";
  24. $url="<a href='ListMemberForm.php".$ecms_hashur['whehref']."'>管理会员表单</a>&nbsp;>&nbsp;增加会员表单";
  25. $postword='增加会员表单';
  26. if($enews=="AddMemberForm"&&$_GET['docopy'])
  27. {
  28. $fid=(int)$_GET['fid'];
  29. $ftype="";
  30. $r=$empire->fetch1("select * from {$dbtbpre}enewsmemberform where fid='$fid'");
  31. $url="<a href='ListMemberForm.php".$ecms_hashur['whehref']."'>管理会员表单</a>&nbsp;>&nbsp;复制会员表单: ".$r['fname'];
  32. $postword='复制会员表单';
  33. }
  34. //修改
  35. if($enews=="EditMemberForm")
  36. {
  37. $fid=(int)$_GET['fid'];
  38. $ftype="";
  39. $url="<a href='ListMemberForm.php".$ecms_hashur['whehref']."'>管理会员表单</a>&nbsp;>&nbsp;修改会员表单";
  40. $postword='修改会员表单';
  41. $r=$empire->fetch1("select * from {$dbtbpre}enewsmemberform where fid='$fid'");
  42. }
  43. //取得字段
  44. $no=0;
  45. $fsql=$empire->query("select f,fname from {$dbtbpre}enewsmemberf order by myorder,fid");
  46. while($fr=$empire->fetch($fsql))
  47. {
  48. $no++;
  49. $bgcolor="ffffff";
  50. if($no%2==0)
  51. {
  52. $bgcolor="#F8F8F8";
  53. }
  54. $like=$field.$fr[f].$record;
  55. $slike=",".$fr[f].",";
  56. //录入项
  57. $enterchecked="";
  58. if(strstr($r[enter],$like))
  59. {
  60. $enterchecked=" checked";
  61. //取得字段标识
  62. $dor=explode($like,$r[enter]);
  63. if(strstr($dor[0],$record))
  64. {
  65. $dor1=explode($record,$dor[0]);
  66. $last=count($dor1)-1;
  67. $fr[fname]=$dor1[$last];
  68. }
  69. else
  70. {
  71. $fr[fname]=$dor[0];
  72. }
  73. }
  74. $entercheckbox="<input name=center[] type=checkbox value='".$fr[f]."'".$enterchecked.">";
  75. //前台显示项
  76. if(strstr($r[viewenter],$like))
  77. {
  78. $viewenterchecked=" checked";
  79. }
  80. else
  81. {
  82. $viewenterchecked="";
  83. }
  84. $viewentercheckbox="<input name=venter[] type=checkbox value='".$fr[f]."'".$viewenterchecked.">";
  85. //必填项
  86. $mustfchecked="";
  87. if(strstr($r[mustenter],$slike))
  88. {$mustfchecked=" checked";}
  89. $mustfcheckbox="<input name=menter[] type=checkbox value='".$fr[f]."'".$mustfchecked.">";
  90. //搜索项
  91. $searchchecked="";
  92. if(strstr($r[searchvar],$slike))
  93. {
  94. $searchchecked=" checked";
  95. }
  96. $searchcheckbox="<input name=schange[] type=checkbox value='".$fr[f]."'".$searchchecked.">";
  97. //可增加
  98. $canaddfchecked="";
  99. if(strstr($r[canaddf],$slike))
  100. {
  101. $canaddfchecked=" checked";
  102. }
  103. if($enews=="AddMemberForm")
  104. {
  105. $canaddfchecked=" checked";
  106. }
  107. $canaddfcheckbox="<input name=canadd[] type=checkbox value='".$fr[f]."'".$canaddfchecked.">";
  108. //可修改
  109. $caneditfchecked="";
  110. if(strstr($r[caneditf],$slike))
  111. {
  112. $caneditfchecked=" checked";
  113. }
  114. if($enews=="AddMemberForm")
  115. {
  116. $caneditfchecked=" checked";
  117. }
  118. $caneditfcheckbox="<input name=canedit[] type=checkbox value='".$fr[f]."'".$caneditfchecked.">";
  119. $data.="<tr bgcolor='".$bgcolor."'>
  120. <td height=25> <div align=center>
  121. <input name=cname[".$fr[f]."] type=text value='".$fr[fname]."'>
  122. </div></td>
  123. <td> <div align=center>
  124. <input name=cfield type=text value='".$fr[f]."' readonly>
  125. </div></td>
  126. <td><div align=center>
  127. ".$entercheckbox."
  128. </div></td>
  129. <td><div align=center>
  130. ".$mustfcheckbox."
  131. </div></td>
  132. <td><div align=center>
  133. ".$canaddfcheckbox."
  134. </div></td>
  135. <td><div align=center>
  136. ".$caneditfcheckbox."
  137. </div></td>
  138. <td><div align=center>
  139. ".$searchcheckbox."
  140. </div></td>
  141. <td><div align=center>
  142. ".$viewentercheckbox."
  143. </div></td>
  144. </tr>";
  145. }
  146. db_close();
  147. $empire=null;
  148. ?>
  149. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  150. <html>
  151. <head>
  152. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  153. <title>增加会员表单</title>
  154. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  155. </head>
  156. <body>
  157. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  158. <tr>
  159. <td>位置:<?=$url?></td>
  160. </tr>
  161. </table>
  162. <form name="form1" method="post" action="../ecmsmember.php">
  163. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  164. <?=$ecms_hashur['form']?>
  165. <tr>
  166. <td height="25" colspan="2" class="header"><?=$postword?>
  167. <input name="fid" type="hidden" id="fid" value="<?=$fid?>"> <input name="enews" type="hidden" id="enews" value="<?=$enews?>">
  168. </td>
  169. </tr>
  170. <tr bgcolor="#FFFFFF">
  171. <td width="19%" height="25">表单名称</td>
  172. <td width="81%" height="25"><input name="fname" type="text" id="fname" value="<?=$r[fname]?>" size="43">
  173. <font color="#666666">(比如:个人注册) </font></td>
  174. </tr>
  175. <tr bgcolor="#FFFFFF">
  176. <td height="25" valign="top">选择本表单的字段项<br>
  177. <br> <br> <input type="button" name="Submit3" value="字段管理" onclick="window.open('ListMemberF.php<?=$ecms_hashur['whehref']?>');">
  178. </td>
  179. <td height="25" valign="top"><table width="100%" border="0" cellspacing="1" cellpadding="3">
  180. <tr bgcolor="#DBEAF5">
  181. <td width="26%" height="25"> <div align="center">字段标识</div></td>
  182. <td width="25%" height="25"> <div align="center">字段名</div></td>
  183. <td width="8%"> <div align="center">录入项</div></td>
  184. <td width="8%"> <div align="center">必填项</div></td>
  185. <td width="8%"><div align="center">可增加</div></td>
  186. <td width="8%"><div align="center">可修改</div></td>
  187. <td width="8%"><div align="center">搜索项</div></td>
  188. <td width="9%"><div align="center">前台显示</div></td>
  189. </tr>
  190. <?=$data?>
  191. </table></td>
  192. </tr>
  193. <tr bgcolor="#FFFFFF">
  194. <td height="25" valign="top"><p>录入表单模板<br>
  195. <br>
  196. (<font color="#FF0000">
  197. <input name="ftype" type="checkbox" id="ftype" value="1"<?=$ftype?>>
  198. 自动生成表单</font>)</p></td>
  199. <td height="25"><textarea name="ftemp" cols="75" rows="20" id="ftemp" style="WIDTH: 100%"><?=ehtmlspecialchars(stripSlashes($r[ftemp]))?></textarea></td>
  200. </tr>
  201. <tr bgcolor="#FFFFFF">
  202. <td height="25" valign="top">注释:</td>
  203. <td height="25"><textarea name="fzs" cols="75" rows="10" id="fzs" style="WIDTH: 100%"><?=stripSlashes($r[fzs])?></textarea></td>
  204. </tr>
  205. <tr bgcolor="#FFFFFF">
  206. <td height="25">&nbsp;</td>
  207. <td height="25"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>
  208. </tr>
  209. </table>
  210. </form>
  211. </body>
  212. </html>