openshop2.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?
  2. include("../config/conn.php");
  3. include("../config/function.php");
  4. sesCheck();
  5. $sqluser="select * from yjcode_user where uid='".$_SESSION[SHOPUSER]."'";mysql_query("SET NAMES 'GBK'");$resuser=mysql_query($sqluser);
  6. $rowuser=mysql_fetch_array($resuser);
  7. if(1==$rowuser[shopzt] || 2==$rowuser[shopzt] || 3==$rowuser[shopzt]){php_toheader("openshop3.php");}
  8. $openbao=returnjgdw($rowcontrol[openbao],"",0);
  9. //入库操作开始
  10. if($_POST[jvs]=="openshop"){
  11. zwzr();
  12. $t1=sha1(sqlzhuru($_POST[t1]));
  13. if(panduan("uid,pwd","yjcode_user where uid='".$_SESSION[SHOPUSER]."' and pwd='".$t1."'")==0){Audit_alert("登录密码验证失败,返回重试!","openshop2.php");}
  14. $d=preg_split("/xcf/",$_POST[d1]);
  15. while1("*","yjcode_openyue where id=".$d[2]);if(!$row1=mysql_fetch_array($res1)){Audit_alert("操作失败,返回重试!","openshop2.php");}
  16. $m=$row1[money1]+$rowcontrol[openshop]+$openbao;
  17. if($m>$rowuser[money1]){Audit_alert("您的余额不够,请先充值!","openshop2.php");}
  18. $sj=date("Y-m-d H:i:s");
  19. $dqsj=date('Y-m-d H:i:s',strtotime ("+".$row1[yue]." month",strtotime($sj)));
  20. if($dqsj<$sj){Audit_alert("续费失败,续费到期年限最大为2038年!","openshop2.php");}
  21. PointUpdateM($rowuser[id],$m*(-1));
  22. PointIntoM($rowuser[id],"申请开店,缴纳费用(续费".$row1[yue]."月)",$m*(-1));
  23. updatetable("yjcode_user","openshop=".$m.",openshop1=".$openbao.",shopzt=1,dqsj='".$dqsj."' where uid='".$_SESSION[SHOPUSER]."'");
  24. php_toheader("openshop3.php");
  25. }
  26. //入库操作结束
  27. ?>
  28. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  29. <html xmlns="http://www.w3.org/1999/xhtml">
  30. <head>
  31. <meta http-equiv="x-ua-compatible" content="ie=7" />
  32. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  33. <title>用户管理面板 - <?=webname?></title>
  34. <? include("cssjs.html");?>
  35. <link href="css/sell.css" rel="stylesheet" type="text/css" />
  36. <script language="javascript">
  37. function tj(){
  38. if((document.f1.t1.value).replace(/\s/,"")==""){alert("请输入登录密码");document.f1.t1.focus();return false;}
  39. if(document.f1.d1.value==""){alert("请选择开店期限");return false;}
  40. if(confirm("确定提交吗?")){tjwait();f1.action="openshop2.php";}else{return false;}
  41. }
  42. function fycha(){
  43. d=(document.f1.d1.value).split("xcf");
  44. a=addNum(0,d[1]);
  45. b=addNum(a,<?=$rowcontrol[openshop]?>)
  46. c=addNum(b,<?=$openbao?>)
  47. document.getElementById("needmoney").innerHTML=c+"元";
  48. }
  49. </script>
  50. </head>
  51. <body>
  52. <? include("../tem/top.html");?>
  53. <? include("top.php");?>
  54. <div class="yjcode">
  55. <? include("left.php");?>
  56. <!--RB-->
  57. <div class="userright">
  58. <? include("kdcap.php");?>
  59. <script language="javascript">
  60. document.getElementById("step2").className="l1 l11";
  61. </script>
  62. <!--白B-->
  63. <div class="rkuang">
  64. <form name="f1" method="post" onsubmit="return tj()">
  65. <input type="hidden" value="openshop" name="jvs" />
  66. <ul class="uk">
  67. <li class="l1">开店审核费:</li>
  68. <li class="l21 red"><strong><?=$rowcontrol[openshop]?> 元</strong></li>
  69. <li class="l1">开店保证金:</li>
  70. <li class="l21 red"><strong><?=$openbao?> 元</strong></li>
  71. <li class="l1">开店期限:</li>
  72. <li class="l2">
  73. <select name="d1" class="inp" onchange="fycha()">
  74. <?
  75. while1("*","yjcode_openyue order by yue asc");while($row1=mysql_fetch_array($res1)){
  76. if($row1[yue] % 12==0){$nd=$row1[yue]/12;$nd=$nd."年";}else{$nd=$row1[yue]."个月";}
  77. ?>
  78. <option value="<?=$row1[yue]?>xcf<?=$row1[money1]?>xcf<?=$row1[id]?>"><?=$nd?> (费用:<?=$row1[money1]?>元)</option>
  79. <? }?>
  80. </select>
  81. </li>
  82. <li class="l1">总共费用:</li>
  83. <li class="l21 feng"><strong id="needmoney"></strong></li>
  84. <li class="l1">您的可用余额:</li>
  85. <li class="l21 green"><strong><?=$rowuser[money1]?> 元</strong> [<a href="pay.php">点击充值</a>]</li>
  86. <li class="l1">登录密码:</li>
  87. <li class="l2"><input type="password" class="inp" name="t1" /></li>
  88. <li class="l3"><?=tjbtnr("下一步")?></li>
  89. </ul>
  90. </form>
  91. </div>
  92. <!--白E-->
  93. </div>
  94. <!--RE-->
  95. </div>
  96. <script language="javascript">fycha();</script>
  97. <div class="clear clear15"></div>
  98. <? include("../tem/bottom.html");?>
  99. </body>
  100. </html>