qiandao.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?
  2. include("../../config/conn.php");
  3. include("../../config/function.php");
  4. sesCheck_m();
  5. $userid=returnuserid($_SESSION[SHOPUSER]);
  6. $sj=date("Y-m-d H:i:s");
  7. while1("*","yjcode_qiandao where userid=".$userid." order by sj desc limit 1");
  8. if($row1=mysql_fetch_array($res1)){
  9. $a_ux = strtotime($sj);
  10. $a_date = date('Y-m-d',$a_ux);
  11. $b_date = date('Y-m-d',strtotime($row1[sj]));
  12. if($a_date==$b_date){$ifq=1;}else{$ifq=0;}
  13. }else{$ifq=0;}
  14. //入库操作开始
  15. if($_POST[jvs]=="qd"){
  16. zwzr();
  17. if(1==$ifq){Audit_alert("今日已签到,无须重复签到","qiandao.php");}
  18. $uip=$_SERVER["REMOTE_ADDR"];
  19. $qdjf=$rowcontrol[qdjf];
  20. $lxd=0;
  21. while1("*","yjcode_qiandaojf order by daynum desc limit 1");if($row1=mysql_fetch_array($res1)){
  22. for($i=2;$i<=$row1[daynum];$i++){
  23. $iv=$i-1;
  24. $sjv=date("Y-m-d",strtotime("-".$iv." day"));
  25. $sj1=$sjv." 00:00:00";
  26. $sj2=$sjv." 23:59:59";
  27. while2("*","yjcode_qiandao where userid=".$userid." and sj>='".$sj1."' and sj<='".$sj2."'");if(!$row2=mysql_fetch_array($res2)){break;}else{$lxd++;}
  28. }
  29. if($lxd>0){
  30. $dnum=$lxd+1;
  31. while3("*","yjcode_qiandaojf where daynum<=".$dnum." order by daynum desc limit 1");if($row3=mysql_fetch_array($res3)){$qdjf=$row3[jf];$lx="(连续签到".$dnum."天)";}
  32. }
  33. }
  34. intotable("yjcode_qiandao","userid,sj,uip,tit,jf","".$userid.",'".$sj."','".$uip."','".sqlzhuru($_POST[t1]).$lx."',".$qdjf."");
  35. PointInto($userid,"每日签到",$qdjf);
  36. PointUpdate($userid,$qdjf);
  37. php_toheader("qiandao.php");
  38. }
  39. //入库操作结束
  40. ?>
  41. <html>
  42. <head>
  43. <meta http-equiv="x-ua-compatible" content="ie=7" />
  44. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  45. <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
  46. <title>会员中心 <?=webname?></title>
  47. <? include("../tem/cssjs.html");?>
  48. <link href="css/buy.css" rel="stylesheet" type="text/css" />
  49. <script language="javascript">
  50. function tj(){
  51. if((document.f1.t1.value).replace(/\s/,"")==""){alert("请填写今日心情");document.f1.t1.focus();return false;}
  52. layer.open({type: 2,content: '正在提交',shadeClose:false});
  53. f1.action="qiandao.php?control=add";
  54. }
  55. </script>
  56. </head>
  57. <body>
  58. <? include("topuser.php");?>
  59. <div class="bfbtop1 box">
  60. <div class="d1" onClick="gourl('./')"><img src="img/topleft.png" height="21" /></div>
  61. <div class="d2">每日签到</div>
  62. <div class="d3"></div>
  63. </div>
  64. <? while1("*","yjcode_qiandaojf order by daynum desc limit 1");if($row1=mysql_fetch_array($res1)){?>
  65. <div class="rts box"><div class="d1">连续签到最高可获得<strong class="feng"><?=$row1[jf]?></strong>分,明天记得也来签到哦^_^</div></div>
  66. <? }?>
  67. <? if(0==$ifq){?>
  68. <form name="f1" method="post" onSubmit="return tj()">
  69. <input type="hidden" value="qd" name="jvs" />
  70. <div class="uk box">
  71. <div class="d1">今日心情<span class="s1"></span></div>
  72. <div class="d2"><input type="text" name="t1" class="inp" value="按时签到是个好习惯^_^ 签到拿分走人" /></div>
  73. </div>
  74. <div class="fbbtn box">
  75. <div class="d1"><? tjbtnr_m("签到赚积分")?></div>
  76. </div>
  77. </form>
  78. <? }?>
  79. <?
  80. $ses=" where userid=".$rowuser[id];
  81. pagef($ses,30,"yjcode_qiandao","order by sj desc");while($row=mysql_fetch_array($res)){
  82. ?>
  83. <div class="jflog box">
  84. <div class="d1"><?=$row[tit]?><br><span class="hui"><?=$row[sj]?></span></div>
  85. <div class="d2">+<?=abs($row[jf])?></div>
  86. </div>
  87. <? }?>
  88. <div class="npa">
  89. <?
  90. $nowurl="qiandao.php";
  91. $nowwd="";
  92. require("page.html");
  93. ?>
  94. </div>
  95. <? include("bottom.php");?>
  96. </body>
  97. </html>