ttimes.php
上传用户:m68239277
上传日期:2014-10-12
资源大小:824k
文件大小:2k
源码类别:

Web服务器

开发平台:

PHP

  1. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  2. <?php
  3. $sql_report=mysql_query("select * from report where sign='2' order by time desc",$conn);
  4. $report_content=mysql_result($sql_report,0,"report_content");
  5. $sqlop=mysql_query("select * from ptime where now_sign='1'",$conn);
  6. $ntime=mysql_result($sqlop,0,"tnum_close_time");   //tnum
  7. $tms=substr($ntime,8,2);
  8. $times=substr($ntime,11);
  9. $ts=split(":",$times);
  10. $nowdate = date("Y")."/".date("m")."/".date("d")." ".date("H:i:s");
  11. $sqlps=mysql_query("select * from online where user_account='$user' and vmsg='1'",$conn);
  12. if(mysql_num_rows($sqlps)<>0)
  13. {
  14.   mysql_query("update online set vmsg='0' where user_account='$user'",$conn);
  15.   echo "<script language='javascript'>alert('".mysql_result($sqlps,0,"content")."')</script>";
  16.  }
  17. ?>
  18. <table width="274" height="23" border="0" cellpadding="0" cellspacing="0">
  19.   <tr>
  20.     <td width="274"><div id="jtime"></div></td>
  21.   </tr>
  22. </table>
  23. <script language=javascript>
  24. function tnum_time(liveclock){
  25. var jDate=<?=$tms?>;
  26. var jHour=<?=$ts[0]?>;
  27. var jMinute=<?=$ts[1]?>;
  28. var jSecond=<?=$ts[2]?>;
  29. var s='';
  30. var d=liveclock!=null?new Date(liveclock):new Date();
  31. with(d){
  32. NowDate=showtm(getDate());
  33. NowHour=showtm(getHours());
  34. NowMinute=showtm(getMinutes());
  35. NowSecond=showtm(getSeconds());
  36. tmtNowDate=jDate-NowDate;
  37. tmtHourleft = jHour - NowHour;
  38. tmtMinuteleft = jMinute - NowMinute;
  39. tmtSecondleft = jSecond - NowSecond;
  40. if (tmtSecondleft<0)
  41. {
  42. tmtSecondleft=60+tmtSecondleft;
  43. tmtMinuteleft=tmtMinuteleft-1;
  44. }
  45. if (tmtMinuteleft<0)
  46. {
  47. tmtMinuteleft=60+tmtMinuteleft;
  48. tmtHourleft=tmtHourleft-1;
  49. }if(tmtNowDate>0) tmtHourleft=(tmtNowDate*24)+tmtHourleft;
  50. if(tmtHourleft<0)  window.location.href='close_plate.php';
  51. if(tmtMinuteleft<0)  window.location.href='close_plate.php';
  52. if(tmtHourleft==0)
  53. {
  54.   if(tmtMinuteleft==0)
  55.  {
  56.   if(tmtSecondleft==0)
  57.   { 
  58.    window.location.href='close_plate.php';
  59.   }
  60.  }
  61. }
  62. stp='&nbsp;<font color=#ffffff>距离截止下注时间还有 <b> '+tmtHourleft+' </b>时<b> '+tmtMinuteleft+' </b>分<b> '+tmtSecondleft+' </b>秒</font>';
  63. }
  64. return(stp);
  65. }
  66. function showtm(num){
  67. return num<10?'0'+num:num;
  68. }
  69. var tnumsgdd=new Date("<?=$nowdate?>");
  70. var ss=setInterval("tnumsgdd.setSeconds(tnumsgdd.getSeconds()+1);jtime.innerHTML=tnum_time(tnumsgdd)",1000)
  71. </script>