<%
ostr=year(now)&month(now)&day(now)
%>
<%
dim iid

dbpath = server.mappath("data.mdb")
connstr = "driver={microsoft access driver (*.mdb)};dbq="& dbpath
set conn = server.createobject("adodb.connection")
conn.open connstr



if request("id") > 0 and request("id") < 13 then
	iid = request("id")
else
	iid = 1
end if

sql = "select * from luck where id = " & iid
set rs = server.createobject("adodb.recordset")
rs.open sql,conn,3,2

if rs("date") = date then	
	istar = rs("star")
	iall = rs("all")
	ilove = rs("love")
	iwork = rs("work")
	ibusiness = rs("business")
	ihealth = rs("health")
	italk = rs("talk")
	icolor = rs("color")
	inumber = rs("number")
	isoon = rs("soon")
	imain = rs("main")
else
	iurl = "http://astro.sina.com.cn/aries.html"
	istar = "白羊座"
	
	select case iid
	case 1
	iurl = "http://astro.sina.com.cn/pc/west/frame0_0.html"
	istar = "白羊座"
	case 2
	iurl = "http://astro.sina.com.cn/pc/west/frame0_1.html"
	istar = "金牛座"
	case 3
	iurl = "http://astro.sina.com.cn/pc/west/frame0_2.html"
	istar = "双子座"
	case 4
	iurl = "http://astro.sina.com.cn/pc/west/frame0_3.html"
	istar = "巨蟹座"
	case 5
	iurl = "http://astro.sina.com.cn/pc/west/frame0_4.html"
	istar = "狮子座"
	case 6
	iurl = "http://astro.sina.com.cn/pc/west/frame0_5.html"
	istar = "处女座"
	case 7
	iurl = "http://astro.sina.com.cn/pc/west/frame0_6.html"
	istar = "天秤座"
	case 8
	iurl = "http://astro.sina.com.cn/pc/west/frame0_7.html"
	istar = "天蝎座"
	case 9
	iurl = "http://astro.sina.com.cn/pc/west/frame0_8.html"
	istar = "射手座"
	case 10
	iurl = "http://astro.sina.com.cn/pc/west/frame0_9.html"
	istar = "摩羯座"
	case 11
	iurl = "http://astro.sina.com.cn/pc/west/frame0_10.html"
	istar = "水瓶座"
	case 12
	iurl = "http://astro.sina.com.cn/pc/west/frame0_11.html"
	istar = "双鱼座"
	end select

	function ichange(str)
		finalstr = ""
		for i = 1 to lenb(str)
			icharcode = ascb(midb(str,i,1))
			if icharcode < &H80 then
			finalstr = finalstr & chr(icharcode)
			else
			inextcode = ascb(midb(str,i+1,1))
			finalstr = finalstr & chr(clng(icharcode) * &H100 + cint(inextcode))
			i = i + 1
			end if
		next
		ichange = finalstr
	end function

	set iconnect = createobject("Microsoft.XMLHTTP")
	icode = iconnect.open ("GET",iurl,false) 
	iconnect.send()

	icode = ichange(iconnect.responsebody)

	if icode <> "" then
		inum = len(icode) - instr(icode,"<div class=""lotconts"">") - 22
		if inum < len(icode) - 22 then
		imain = right(icode,inum)
		inum = instr(imain,"</div>") - 1
		imain = left(imain,inum)
		end if

		inum = len(icode) - instr(icode,"综合运势</h4><p>") - 11
		if inum < len(icode) - 11 then
		iall = right(icode,inum)
		inum = instr(iall,"</div>") - 1
		iall = left(iall,inum)
		iall = Ubound(split(iall,"star.gif"))
		end if
		
	
		inum = len(icode) - instr(icode,"爱情运势</h4><p>") - 11
		if inum < len(icode) - 11 then
		ilove = right(icode,inum)
		inum = instr(ilove,"</div>") - 1
		ilove = Ubound(split(left(ilove,inum),"star.gif"))
		end if
	
		inum = len(icode) - instr(icode,"工作状况</h4><p>") - 11
		if inum < len(icode) - 11 then
		iwork = right(icode,inum)
		inum = instr(iwork,"</div>") - 1
		iwork = Ubound(split(left(iwork,inum),"star.gif"))
		end if
		
		inum = len(icode) - instr(icode,"理财投资</h4><p>") - 11
		if inum < len(icode) - 11 then
		ibusiness = right(icode,inum)
		inum = instr(ibusiness,"</div>") - 1
		ibusiness = Ubound(split(left(ibusiness,inum),"star.gif"))
		end if
		
		inum = len(icode) - instr(icode,"健康指数</h4><p>") - 11
		if inum < len(icode) - 11 then
		ihealth = right(icode,inum)
		inum = instr(ihealth,"</p></div>") - 1
		ihealth = left(ihealth,inum)
		end if
		
		inum = len(icode) - instr(icode,"商谈指数</h4><p>") - 11
		if inum < len(icode) - 11 then
		italk = right(icode,inum)
		inum = instr(italk,"</p></div>") - 1
		italk = left(italk,inum)
		end if
		
		inum = len(icode) - instr(icode,"幸运颜色</h4><p>") - 11
		if inum < len(icode) - 11 then
		icolor = right(icode,inum)
		inum = instr(icolor,"</p></div>") - 1
		icolor = left(icolor,inum)
		end if
		
		inum = len(icode) - instr(icode,"幸运数字</h4><p>") - 11
		if inum < len(icode) - 11 then
		inumber = right(icode,inum)
		inum = instr(inumber,"</p></div>") - 1
		inumber = left(inumber,inum)
		end if
		
		inum = len(icode) - instr(icode,"速配星座</h4><p>") - 11
		if inum < len(icode) - 11 then
		isoon = right(icode,inum)
		inum = instr(isoon,"</p></div>") - 1
		isoon = left(isoon,inum)
		end if

		rs("all") = iall
		rs("love") = ilove
		rs("work") = iwork
		rs("business") = ibusiness
		rs("health") = ihealth
		rs("talk") = italk
		rs("color") = icolor
		rs("number") = inumber
		rs("soon") = isoon
		rs("main") = imain
		rs("date") = date
		rs.update
	
	end if

end if

rs.close
set rs = nothing
conn.close
set conn = nothing
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>星座</title>
<meta name="description" content="绿色网址导航站，大家都喜欢">
<link href="/css/2008.css" type="text/css" rel="stylesheet" />
<link id=skincolor   type="text/css" rel="stylesheet" />
<link id="skin" type="text/css" rel="stylesheet" />
<style type="text/css">
.sycx td{line-height:24px;font-size:14px;height:27px;border-bottom:1px dashed #E6E6E6;}
.sycx_zh{color:#990000;}
</style>
<script language="javascript" src="/js/cookies.js"></script>
<script language="javascript" src="/js/pubfun.js"></script>
</head>

<body style="BACKGROUND-COLOR: transparent">
<script language="JavaScript" type="text/javascript">
var vcolor=GetCookie('skinc');
var vpagesize=GetCookie('skinp');
function $(a){return document.getElementById(a)}
var vcolor = GetCookie('skinc'),skinp = GetCookie('skinp')
var s = skinp ==2 ? 'big_':'';
if( s && vcolor==null ) vcolor=1
$("skin").href = (vcolor) ? '/css/'+s+'css'+vcolor+'.css?0903':'/css/css1.css?0903';
</script>
<div style="height:254px;">
<table width="100%" height=251 border="0" align="center" cellpadding="0" cellspacing="0" class="sycx">
  <tr>
    <td width="100">
	 <div align="center">
<img id="aicon" src="images/<%=iid%>.gif" width="80" height="80" alt="<%=istar%><%=year(now)%>年<%=month(now)%>月<%=day(now)%>日运程" />
	</div>
    	<div align="center" style=" text-decoration:underline;color:Red"><%=istar%></div>
    </td>
    <td width="60%">
	<div class="tcontent">
	<%=year(now)%>年<%=month(now)%>月<%=day(now)%>日<br /><strong style=" text-decoration:underline;color:#800000;"><%=istar%>:</strong><span id="luck">
<div>速配星座:<%=isoon%></div><div>今日忠告:<%=imain%></div></span></div>
    </td>
    <td width="20">　 </td>
    <td width="160">
	<div id="astrosel"><a href="?id=1&day=<%=ostr%>" >白羊</a>   <a href="?id=2&day=<%=ostr%>" >金牛</a>   <a href="?id=3&day=<%=ostr%>" >双子</a>
   <a href="?id=4&day=<%=ostr%>" >巨蟹</a><br /><a href="?id=5&day=<%=ostr%>" >狮子</a>
   <a href="?id=6&day=<%=ostr%>" >处女</a>   <a href="?id=7&day=<%=ostr%>" >天秤</a>
   <a href="?id=8&day=<%=ostr%>" >天蝎</a><br /><a href="?id=9&day=<%=ostr%>" >射手</a>
   <a href="?id=10&day=<%=ostr%>" >摩羯</a>   <a href="?id=11&day=<%=ostr%>" >水瓶</a>
   <a href="?id=12&day=<%=ostr%>" >双鱼</a>
            <div style="text-align:right; margin-right:20px; margin-top:15px">
                <a href=/star/ target=_blank>查看更多 &raquo;</a>
            </div>
</div>
</td>
  </tr>
</table>
</div>
</body>
</html>
