标题:都是我的错~高手指教
取消只看楼主
hlc9279
Rank: 1
等 级:新手上路
帖 子:39
专家分:0
注 册:2004-9-21
 问题点数:0 回复次数:3 
都是我的错~高手指教

我这样写无法进行调试~我不知道错在哪 我最大的失误就不该将<%%>这里面的东西写的太多自己都不知道错在哪里了~

<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <!--#include file="conn.asp"--> <script language="javascript"> <!--

function openwin(url) { window.open(url,"_blank","height=200,width=400,resizable=no,scrollbars=yes,statue=no,toolbar=no,menubar=no,location=no,left=150,top=80"); } //--> </script>

<% function mmonth(monid) select case monid case "1" m="一月" case "2" m="二月" case "3" m="三月" case "4" m="四月" case "5" m="五月" case "6" m="六月" case "7" m="七月" case "8" m="八月" case "9" m="九月" case "10" m="十月" case "11" m="十一月" case "12" m="十二月" end select mmonth=m end function %> <% 'user=session("login_user") thismonth=trim(request("month")) if thismonth="" then thismonth=month(now()) end if thisyear=trim(request("year")) if thisyear="" then thisyear=year(now()) end if thismonth_cn=mmonth(thismonth) premonth_cn=mmonth(thismonth-1) nextmonth_cn=mmonth(thismonth+1) %> <% function isjihua(jh_date) set ks=server.createobject("adodb.recordset") sql="select * from forum_dia_per" end if ks.open sql,conn,1,1 do while not ks.eof pdate=trim(ks("pdate")) if cdate(jh_date)=cdate(pdate) then isjihua="1" exit do end if ks.movenext loop ks.close set ks=nothing end function %> <html> <head> <title>个人办公系统</title>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache, must-revalidate"> <meta http-equiv="expires" content="wed, 26 Feb 1997 08:21:57 GMT"><link rel="stylesheet" href="../../inc/test.css" type="text/css"> <SCRIPT Language="JavaScript"> var Doc_a = null; function div_onclick(linkday){ gotourl="date.asp?linkday="+linkday ; parent.qq.location=gotourl; } </SCRIPT> </head> <body bgcolor="#FFFFFF" oncontextmenu="return false" scroll="no">

<table id=t1 border="0" cellpadding="2" cellspacing="0" width="100%" align="center" class="borderon"> <tr> <td align="left" valign="bottom" width="24%"><a href="asset_display.asp?user=&month=&year=&view=no" class="button"> </a><%response.write "<a href='calendar.asp?month="&thismonth-1&"&bel="&bel&"'>&lt;&lt;"&premonth_cn&"</a>"%></td> <td align="center" valign="bottom" width="51%" disabled><%=thisyear%>年<%=thismonth_cn%> </td> <td align="right" valign="bottom" width="25%"><a href="calendar.asp?user=&month=&year=&view=no" class="button"> <%response.write "<a href='calendar.asp?month="&thismonth+1&"&bel="&bel&"'>"&nextmonth_cn&"&gt;&gt;</a>"%> </a></td> </tr> </table> <table style="width:100%; height:expression(body.offsetHeight-t1.offsetHeight-2);" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td height="20"> <table border="0" cellpadding="0" cellspacing="0" width="100%" align="center"> <tr bgcolor="#999999"> <td width="101" align="center" height="18"> <font color="#F3F3F3">日</font></td> <td width="99" align="center" ><font color="#F3F3F3"> 一</font></td> <td width="105" align="center"><font color="#F3F3F3"> 二</font></td> <td width="119" align="center"><font color="#F3F3F3"> 三</font></td> <td width="112" align="center"><font color="#F3F3F3"> 四</font></td> <td width="100" align="center"><font color="#F3F3F3"> 五</font></td> <td width="114" align="center"> <font color="#F3F3F3">六</font></td> </tr> <tr> <td height="" width="101" bgcolor="#FFFFFF"><img src="im/clear.gif" height="1" width="1"></td> <td valign="top" onclick="div_onclick('','')" width="99" align="center" style='CURSOR: default;'> </td> </tr> <tr> <td width="101" bgcolor="#FFFFFF"><img src="im/clear.gif" height="1" width="1"></td> <td style='CURSOR: default;' valign="top" onclick="div_onclick('','')" width="99" align="center"> </td> </tr> </table> <table border=1 width=100% bordercolorlight="#000000" bordercolordark="#FFFFFF"> <% myyear=thisyear mymonth=thismonth thismonthfirday=thisyear & "-" & thismonth & "-1" nextmonthfirday=dateadd("m",1,thismonthfirday) totaldays=DateDiff("d",thismonthfirday,nextmonthfirday) firdayweek=weekday(thismonthfirday) for i=1 to 7 if firdayweek=i then string1="<tr>" j=1 do while j<i string1=string1 & "<td>&nbsp;</td>" j=j+1 loop if isjihua(thisyear&"-"&thismonth&"-"&"1")="1" then newcolor="#ff0000" else newcolor="#000000" end if linkday=thisyear & "-" & thismonth & "-" & "1" if i="7" then string1=string1 & "<td valign=top align=center>" & "<a href=javascript:div_onclick('"&linkday&"');><font color='"&newcolor&"'><b>1</b></font></a>" & "</td></tr>" else string1=string1 & "<td valign=top align=center>" & "<a href=javascript:div_onclick('"&linkday&"');><font color='"&newcolor&"'><b>1</b></font></a>" & "</td>" end if end if next response.write string1

for i=2 to totaldays-1 if isjihua(thisyear&"-"&thismonth&"-"& i)="1" then newcolor="#ff0000" else newcolor="#000000" end if linkday=thisyear & "-" & thismonth & "-" & i if weekday(myyear & "-" & mymonth & "-" & i)=7 then response.write "<td valign=top align=center> "& "<a href=javascript:div_onclick('"&linkday&"');><font color='"&newcolor&"'>" & i & "</font></a>" & "</td></tr>" else response.write "<td valign=top align=center>" & "<a href=javascript:div_onclick('"&linkday&"');><font color='"&newcolor&"'>" & i & "</font></a>" & "</td>" end if next

if weekday(myyear & "-" & mymonth & "-" & totaldays)="1" then response.write "<tr>" end if if isjihua(thisyear&"-"&thismonth&"-"& i)="1" then newcolor="#ff0000" else newcolor="#000000" end if linkday=thisyear & "-" & thismonth & "-" & totaldays response.write "<td valign=top align=center>" & "<a href=javascript:div_onclick('"&linkday&"');><font color='"&newcolor&"'>" & totaldays & "</font></a>" & "</td>" if weekday(myyear & "-" & mymonth & "-" & totaldays)="1"<>"7" then q=1 do while q<=7-weekday(myyear & "-" & mymonth & "-" & totaldays) response.write "<td valign=top align=center>&nbsp</td>" q=q+1 loop end if response.write "</tr>"

%> </table></td> </tr> </tbody> <tr> <form name="form1" method="get" action=""> <td height="40" class="borderon"> <select name="year"> <option value="<%=thisyear%>"><%=thisyear%>年</option> <option value="2000" >2000年</option> <option value="2001" >2001年</option> <option value="2002" >2002年</option> <option value="2003" >2003年</option> <option value="2004" >2004年</option> <option value="2005" >2005年</option> <option value="2006" >2006年</option> <option value="2007" >2007年</option> <option value="2008" >2008年</option> <option value="2009" >2009年</option> <option value="2010" >2010年</option> </select> <select name="month"> <option value="<%=thismonth%>"><%=mmonth(thismonth)%></option> <option value="1" >一月</option> <option value="2" >二月</option> <option value="3" >三月</option> <option value="4" >四月</option> <option value="5" >五月</option> <option value="6" >六月</option> <option value="7" >七月</option> <option value="8" >八月</option> <option value="9" >九月</option> <option value="10" >十月</option> <option value="11" >十一月</option> <option value="12" >十二月</option> </select> <input type="submit" name="Submit" value="GO"> </form> </tr> </table>

</body> </html>

[此贴子已经被作者于2004-10-04 22:02:12编辑过]

搜索更多相关主题的帖子: 指教 
2004-10-04 18:21
hlc9279
Rank: 1
等 级:新手上路
帖 子:39
专家分:0
注 册:2004-9-21
得分:0 

只要告诉我错在哪行就好~~

2004-10-04 18:22
hlc9279
Rank: 1
等 级:新手上路
帖 子:39
专家分:0
注 册:2004-9-21
得分:0 

晕~~这样你们检查不出 来~我也不知道这样写才清楚~~

其实很简单~具体思想这样的

点选左边的日期,可以在右边显示人员的日志情况

这部分就是左边框架的代码

应该错在这段代码,应该是这个函数isjihua(jh_date) 没用好~这样能找出错误来吗

for i=1 to 7 if firdayweek=i then string1="<tr>" j=1 do while j<i string1=string1 & "<td>&nbsp;</td>" j=j+1 loop if isjihua(thisyear&"-"&thismonth&"-"&"1")="1" then newcolor="#ff0000" else newcolor="#000000" end if linkday=thisyear & "-" & thismonth & "-" & "1" if i="7" then string1=string1 & "<td valign=top align=center>" & "<a href=javascript:div_onclick('"&linkday&"');><font color='"&newcolor&"'><b>1</b></font></a>" & "</td></tr>" else string1=string1 & "<td valign=top align=center>" & "<a href=javascript:div_onclick('"&linkday&"');><font color='"&newcolor&"'><b>1</b></font></a>" & "</td>" end if end if next response.write string1

for i=2 to totaldays-1 if isjihua(thisyear&"-"&thismonth&"-"& i)="1" then newcolor="#ff0000" else newcolor="#000000" end if linkday=thisyear & "-" & thismonth & "-" & i if weekday(myyear & "-" & mymonth & "-" & i)=7 then response.write "<td valign=top align=center> "& "<a href=javascript:div_onclick('"&linkday&"');><font color='"&newcolor&"'>" & i & "</font></a>" & "</td></tr>" else response.write "<td valign=top align=center>" & "<a href=javascript:div_onclick('"&linkday&"');><font color='"&newcolor&"'>" & i & "</font></a>" & "</td>" end if next

if weekday(myyear & "-" & mymonth & "-" & totaldays)="1" then response.write "<tr>" end if if isjihua(thisyear&"-"&thismonth&"-"& i)="1" then newcolor="#ff0000" else newcolor="#000000" end if linkday=thisyear & "-" & thismonth & "-" & totaldays response.write "<td valign=top align=center>" & "<a href=javascript:div_onclick('"&linkday&"');><font color='"&newcolor&"'>" & totaldays & "</font></a>" & "</td>" if weekday(myyear & "-" & mymonth & "-" & totaldays)="1"<>"7" then q=1 do while q<=7-weekday(myyear & "-" & mymonth & "-" & totaldays) response.write "<td valign=top align=center>&nbsp</td>" q=q+1 loop end if response.write "</tr>"

[此贴子已经被作者于2004-10-04 22:03:26编辑过]

2004-10-04 18:37
hlc9279
Rank: 1
等 级:新手上路
帖 子:39
专家分:0
注 册:2004-9-21
得分:0 
2004-10-04 18:42



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-6024-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.097395 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved