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

Web服务器

开发平台:

PHP

  1. <?php 
  2. session_start();
  3. set_time_limit(1800);
  4. include("../inc/conn.php");
  5. function ball($arr)
  6. {
  7.  $red="01,02,07,08,12,13,18,19,23,24,29,30,34,35,40,45,46";
  8.  $green="05,06,11,16,17,21,22,27,28,32,33,38,39,43,44,49";
  9.  $blue="03,04,09,10,14,15,20,25,26,31,36,37,41,42,47,48";
  10.  if(strstr($red,$arr))
  11.  { 
  12.   return "red";
  13.  }elseif(strstr($green,$arr))
  14.  {
  15.   return  "green";
  16.  }elseif(strstr($blue,$arr))
  17.   {
  18.   return  "blue";
  19.   }
  20. }
  21. function animal($num)
  22. {
  23. $a=array("鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪");
  24. $b=array("11.23.35.47","10.22.34.46","09.21.33.45","08.20.32.44","07.19.31.43","06.18.30.42","05.17.29.41","04.16.28.40","03.15.27.39","02.14.26.38","01.13.25.37.49","12.24.36.48");
  25. for($i=0;$i<=11;$i++)
  26.  {
  27.   if(strstr($b[$i],$num))
  28.   {
  29.    return $a[$i];
  30.    exit;
  31.   }
  32.  }
  33. }
  34. function week($d)
  35. {
  36. $ds=strftime("%w",strtotime($d));
  37.  switch($ds)
  38.  {
  39.   case "0":
  40.   return "日";
  41.   break;
  42.   case "1":
  43.   return "一";
  44.   break;
  45.   case "2":
  46.   return "二";
  47.   break;
  48.   case "3":
  49.   return "三";
  50.   break;
  51.   case "4":
  52.   return "四";
  53.   break;
  54.   case "5":
  55.   return "五";
  56.   break;
  57.   case "6":
  58.   return "六";
  59.   break;
  60.  }
  61. }
  62. $sqlc=mysql_query("select * from now_open where ID='1'",$conn);
  63.  $nrow=mysql_fetch_array($sqlc);
  64.  $dates=$nrow["dates"];
  65.  if(strlen($dates)==1) $dates="00".$dates;
  66.  if(strlen($dates)==2) $dates="0".$dates;
  67.  $num1=$nrow["num1"];
  68.  if($num1=="") $num1=0;
  69.      $num2=$nrow["num2"];
  70.  if($num2=="") $num2=0;
  71.  $num3=$nrow["num3"];
  72.  if($num3=="") $num3=0;
  73.  $num4=$nrow["num4"];
  74.  if($num4=="") $num4=0;
  75.      $num5=$nrow["num5"];
  76.  if($num5=="") $num5=0;
  77.  $num6=$nrow["num6"];
  78.  if($num6=="") $num6=0;
  79.  $num7=$nrow["num7"];
  80.  if($num7=="") $num7=0;
  81. ?>
  82. <script language="javascript">
  83.   parent.dates.innerText="<?=$dates?>";
  84.   parent.ball01.background="../img/<?=ball($num1)?>.gif";
  85.   parent.num01.innerText="<?=$num1?>";
  86.   parent.ball02.background="../img/<?=ball($num2)?>.gif";
  87.   parent.num02.innerText="<?=$num2?>";
  88.   parent.ball03.background="../img/<?=ball($num3)?>.gif";
  89.   parent.num03.innerText="<?=$num3?>";
  90.   parent.ball04.background="../img/<?=ball($num4)?>.gif";
  91.   parent.num04.innerText="<?=$num4?>";
  92.   parent.ball05.background="../img/<?=ball($num5)?>.gif";
  93.   parent.num05.innerText="<?=$num5?>";
  94.   parent.ball06.background="../img/<?=ball($num6)?>.gif";
  95.   parent.num06.innerText="<?=$num6?>";
  96.   parent.ball07.background="../img/<?=ball($num7)?>.gif";
  97.   parent.num07.innerText="<?=$num7?>";
  98. </script>
  99. <meta http-equiv="refresh" content="20">