AddCard.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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,"card");
  20. $enews=ehtmlspecialchars($_GET['enews']);
  21. $time=ehtmlspecialchars($_GET['time']);
  22. $r[money]=10;
  23. $r[cardfen]=0;
  24. $r[carddate]=0;
  25. $r[endtime]="0000-00-00";
  26. $r[card_no]=time();
  27. $r[password]=strtolower(no_make_password(6));
  28. $url="<a href=ListCard.php".$ecms_hashur['whehref'].">管理点卡</a> &gt; 增加点卡";
  29. if($enews=="EditCard")
  30. {
  31. $cardid=(int)$_GET['cardid'];
  32. $r=$empire->fetch1("select card_no,password,money,cardfen,endtime,carddate,cdgroupid,cdzgroupid from {$dbtbpre}enewscard where cardid='$cardid' limit 1");
  33. $url="<a href=ListCard.php".$ecms_hashur['whehref'].">管理点卡</a> &gt; 修改点卡:<b>".$r[card_no]."</b>";
  34. }
  35. //----------会员组
  36. $sql=$empire->query("select groupid,groupname from {$dbtbpre}enewsmembergroup order by level");
  37. while($level_r=$empire->fetch($sql))
  38. {
  39. if($r[cdgroupid]==$level_r[groupid])
  40. {$select=" selected";}
  41. else
  42. {$select="";}
  43. $group.="<option value=".$level_r[groupid].$select.">".$level_r[groupname]."</option>";
  44. if($r[cdzgroupid]==$level_r[groupid])
  45. {$zselect=" selected";}
  46. else
  47. {$zselect="";}
  48. $zgroup.="<option value=".$level_r[groupid].$zselect.">".$level_r[groupname]."</option>";
  49. }
  50. $href="AddCard.php?enews=$enews&cardid=$cardid".$ecms_hashur['ehref'];
  51. ?>
  52. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  53. <html>
  54. <head>
  55. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  56. <title>增加点卡</title>
  57. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  58. <script type="text/javascript" src="../ecmseditor/js/jstime/WdatePicker.js"></script>
  59. </head>
  60. <body>
  61. <table width="98%%" border="0" align="center" cellpadding="3" cellspacing="1">
  62. <tr>
  63. <td>位置:<?=$url?></td>
  64. </tr>
  65. </table>
  66. <form name="form1" method="post" action="ListCard.php" autocomplete="off">
  67. <table width="60%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  68. <?=$ecms_hashur['form']?>
  69. <tr class="header">
  70. <td height="25" colspan="2"><div align="center">增加点卡
  71. <input name="enews" type="hidden" id="enews" value="<?=$enews?>">
  72. <input name="add[cardid]" type="hidden" id="add[cardid]" value="<?=$cardid?>">
  73. <input name="time" type="hidden" id="time" value="<?=$time?>">
  74. </div></td>
  75. </tr>
  76. <tr bgcolor="#FFFFFF">
  77. <td width="36%" height="25">点卡帐号:</td>
  78. <td width="64%" height="25"><input name="add[card_no]" type="text" id="add[card_no]" value="<?=$r[card_no]?>">
  79. <font color="#666666">(&lt;30位,支持英文与数字组合)</font></td>
  80. </tr>
  81. <tr bgcolor="#FFFFFF">
  82. <td height="25">点卡密码:</td>
  83. <td height="25"><input name="add[password]" type="text" id="add[password]" value="<?=$r[password]?>">
  84. <font color="#666666">(&lt;20位,支持英文与数字组合)</font></td>
  85. </tr>
  86. <tr bgcolor="#FFFFFF">
  87. <td height="25">点卡金额:</td>
  88. <td height="25"><input name="add[money]" type="text" id="add[money]" value="<?=$r[money]?>" size="6">
  89. 元</td>
  90. </tr>
  91. <tr bgcolor="#FFFFFF">
  92. <td height="25">点数:</td>
  93. <td height="25"><input name="add[cardfen]" type="text" id="add[cardfen]" value="<?=$r[cardfen]?>" size="6">
  94. 点</td>
  95. </tr>
  96. <tr bgcolor="#FFFFFF">
  97. <td rowspan="3">充值有效期:</td>
  98. <td height="25"><input name="add[carddate]" type="text" id="add[carddate]" value="<?=$r[carddate]?>" size="6">
  99. 天</td>
  100. </tr>
  101. <tr bgcolor="#FFFFFF">
  102. <td height="25">充值设置转向会员组:
  103. <select name="add[cdgroupid]" id="add[cdgroupid]">
  104. <option value=0>不设置</option>
  105. <?=$group?>
  106. </select></td>
  107. </tr>
  108. <tr bgcolor="#FFFFFF">
  109. <td height="25">到期后转向的会员组:
  110. <select name="add[cdzgroupid]" id="add[cdzgroupid]">
  111. <option value=0>不设置</option>
  112. <?=$zgroup?>
  113. </select>
  114. </td>
  115. </tr>
  116. <tr bgcolor="#FFFFFF">
  117. <td height="25">到期时间:</td>
  118. <td height="25"><input name="add[endtime]" type="text" id="add[endtime]" value="<?=$r[endtime]?>" size="20" class="Wdate" onClick="WdatePicker({skin:'default',dateFmt:'yyyy-MM-dd'})">
  119. <font color="#666666">(0000-00-00为不限制)</font></td>
  120. </tr>
  121. <tr bgcolor="#FFFFFF">
  122. <td height="25" colspan="2"><div align="center">
  123. <input type="submit" name="Submit" value="提交">
  124. &nbsp;
  125. <input type="reset" name="Submit2" value="重置">
  126. &nbsp;
  127. <input type="button" name="Submit3" value="密码随机" onclick="javascript:self.location.href='<?=$href?>'">
  128. </div></td>
  129. </tr>
  130. </table>
  131. </form>
  132. </body>
  133. </html>
  134. <?
  135. db_close();
  136. $empire=null;
  137. ?>