⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dailyarragement11.jsp

📁 “JSP数据库项目案例导航”一书从第一章到第十一章各章实例的源程序文件以及数据库文件。 注意: 1. 本书中的案例提供的数据库环境不同
💻 JSP
字号:
<%@page language="java" contentType="text/html;charset=GBK"%>
<%@page import="java.util.*,java.util.Date,java.text.*,java.lang.*,oa.main.DealString"%>

<%
oa.bean.dailyArragement myBean = null;
try{
	myBean = new oa.bean.dailyArragement(); 

	if(myBean.getConn()==null)
	{
		%>		
		数据库无法响应,请<a href="javascript:window.history.back(-1);">返回</a>重试
		<%out.close();
	}

	DealString ds=new DealString();
	//取得菜单类别
	String strType = ds.toString((String)request.getParameter("txt_type"));
	//职工编号
	String strPersonNo = ds.toString((String)request.getParameter("txt_personno"));
	//增删改类型
	String strEdit = ds.toString((String)request.getParameter("txt_edit"));

	String title = "查看详细信息";

%>
<%
	int iDIM;      //' Days In Month
	int iDOW;       //' Day Of Week that month starts on
	int iCurrent;   //' Variable we use to hold current day of month as we write table
	int iPosition;  //' Variable we use to hold current position in table
	int y=0,m=0,d=0;
	String date = ds.toString((String)request.getParameter("txt_lxrxh"));
	date = date.trim();
	if(myBean.IsDate(date))
	{	
		String stry = date.substring(0,4);

		String strm = date.substring(5,7);
		if(strm.charAt(0)=='0') strm = strm.substring(1);
						//防止strm==08/09时超出parseInt()的ASCII范围	
						//java中以0开头的数表示是八进制,8\9都超过了范围

		String strd = date.substring(8);
		if(strd.charAt(0)=='0') strd = strd.substring(1);

		y = Integer.parseInt(stry);
		m = Integer.parseInt(strm);
		d = Integer.parseInt(strd);
	}
	else
	{	
		Date DDate = new Date(); 
		y = DDate.getYear()+1900;
		m = DDate.getMonth()+1;
		d = DDate.getDate();
	}

	iDIM = myBean.getDaysInMonth(m,y);//某月的天数
	iDOW = myBean.getWeekdayMonthStartsOn(m, y);//某月第一天的所在星期
		//0 = Sunday, 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday
%>
<center>
<br><br>
<TABLE class="tab" border="0" width="95%" cellspacing="0" cellpadding="0" height="22" bgcolor=#ffffff>
  <TR align=left>			<%//tab 用来指定背景类别%>
    <TD>
	  &nbsp;&nbsp;<FONT color="#ffcc00">日历查看</FONT> &gt;&gt;
	  <a onclick="changepage11('4')" style="cursor:hand;">
	  <FONT color="#99cc00">列表查看</FONT></a> &gt;&gt; 
	</TD>
  </TR>
 </TABLE>
<TABLE class="tab" width="95%" cellSpacing=1>
  <tr>
    <td align='center'>
     <table width="95%" border="0" cellspacing="0" cellpadding="0">
	  <!---hr color=yellow--->
	<tr>
	 <td align='center'><b><A title="上个月" HREF="person.jsp?txt_type=2&txt_edit=5&txt_personno=<%=strPersonNo%>&txt_lxrxh=<%= myBean.subtractOneMonth(y,m,d)%>" style="color: ##ffcc00" alt="上个月">&lt;&lt;</A></b></TD>
	 <td width='95%' bgcolor=D0E7FF align='center'><font face='verdana,arial,helvetica' size="3" color="#c0c0c0"><font color='#006699'><b><%= myBean.MonthName(m)+"  "+ y %></B></font></TD>
	 <td align='center'><b><A title="下个月" HREF="person.jsp?txt_type=2&txt_edit=5&txt_personno=<%=strPersonNo%>&txt_lxrxh=<%= myBean.addOneMonth(y,m,d)     %>" style="color: ##ffcc00" alt="下个月">&gt;&gt;</A></b></TD>
	</tr>
     </table>
    </td>
  </tr>
  <tr>
    <td align=center>
      <table class="tab" width="95%" cellSpacing=0>
	    <tr>
  		  <td width="14%" bgcolor= "#eeeeee" align=center valign='middle'><font face="verdana,arial,helvetica"' size="2" color="#ff0000">星期日</font></TD>
		  <td width="14%" bgcolor= "#eeeeee" align=center valign='middle'><font face="verdana,arial,helvetica"' size="2" color="#ff0000">星期一</font></TD>
		  <td width="14%" bgcolor= "#eeeeee" align=center valign='middle'><font face="verdana,arial,helvetica"' size="2" color="#ff0000">星期二</font></TD>
		  <td width="14%" bgcolor= "#eeeeee" align=center valign='middle'><font face="verdana,arial,helvetica"' size="2" color="#ff0000">星期三</font></TD>
		  <td width="14%" bgcolor= "#eeeeee" align=center valign='middle'><font face="verdana,arial,helvetica"' size="2" color="#ff0000">星期四</font></TD>
		  <td width="14%" bgcolor= "#eeeeee" align=center valign='middle'><font face="verdana,arial,helvetica"' size="2" color="#ff0000">星期五</font></TD>
		  <td width="14%" bgcolor= "#eeeeee" align=center valign='middle'><font face="verdana,arial,helvetica"' size="2" color="#ff0000">星期六</font></TD>
	    </tr>
      </table>
    </td>
  </tr>
<tr><td align=center>
      <table class="tab" width="95%" cellSpacing=1>

<%
if(iDOW != 0)
{
	out.print("<tr>");
	iPosition = 0;
	while(iPosition < iDOW) 
	{
		out.print("<td width='14%'  height='85'>&nbsp;</td>");
		iPosition = iPosition + 1;
	}
}

	//-- Write days of month in proper day slots --

iCurrent = 1; //记录某月的每一天,从1到iDIM
iPosition = iDOW;

while(iCurrent <= iDIM)
{
	//-- open the table row --

	if(iPosition == 0)
		out.print("<tr>");

	//-- Write the date and subject --
	Date now = new Date();
	if(y==(now.getYear()+1900) && m==(now.getMonth()+1) && d==iCurrent )
	{
		out.print("<td width='14%'  height='85'  bgcolor='#eeeeee' align='right' valign='top'><font face='verdana,arial,helvetica' ><font color='red'>今天<b> "+iCurrent+ "</b></font>");
	}
	else
	{
		out.print("<td width='14%'  height='85'  bgcolor='#eeeeee' align='right' valign='top'><font face='verdana,arial,helvetica' size='1'><font color='#000000'><b>"+iCurrent+ "</b></font>");
	}
	Vector vect = (Vector)myBean.getData(strPersonNo);
	int shownumber = 0;
	for(int i=0;i<=vect.size()-1;i++)
	{
		Hashtable hash = (Hashtable)vect.get(i);
		String strZGBH = (String)hash.get("ZGBH");	
		String strRCXH = (String)hash.get("RCXH");	
	    String strBT = (String)hash.get("BT");
		String strSJ = (String)hash.get("SJ");

		if((!strSJ.equals("")) && strSJ.length()==19)
		{
			String stryy = strSJ.substring(0,4);

			String strmm = strSJ.substring(5,7);
			if(strmm.charAt(0)=='0') strmm = strmm.substring(1);
						//防止strm==08/09时超出parseInt()的ASCII范围	

			String strdd = strSJ.substring(8,10);
			if(strdd.charAt(0)=='0') strdd = strdd.substring(1);

			int iyy = Integer.parseInt(stryy);
			int	imm = Integer.parseInt(strmm);
			int	idd = Integer.parseInt(strdd);

			if(y==iyy && m==imm && iCurrent==idd)
			{				
				int len = strBT.length();
				if(len>6) strBT = strBT.substring(0,6)+"...";

				shownumber++;
				if(shownumber>5)
				{
					%>
					<br><a onmouseover="this.style.textDecoration='underline';" onmouseout="this.style.textDecoration='none';" onclick="changepage11('4')" style="color:#000000;cursor:hand;"><i>more...</i></a>

					<%
					break;
				}
%>
			<br><a title=<%=title%> onmouseover="this.style.color='#6600FF';this.style.textDecoration='underline';" onmouseout="this.style.color='#660099';this.style.textDecoration='none';" href="showDailyArray.jsp?txt_personno=<%=strZGBH%>&txt_rcxh=<%=strRCXH%>" style="color:#660099;cursor:hand;"><%=strBT%></a>
<%				
			}
		}
	}
	out.print("</td>");

	//-- Close the table row --

	if(iPosition == 6)
	{
		out.print("</tr>");
		iPosition = -1;
	}
	
	//-- Increment variables --

	iCurrent = iCurrent + 1;
	iPosition = iPosition + 1;
}

if(iPosition != 0)
{
	while(iPosition <= 6)
	{
		out.print("<td>&nbsp;</td>");
		iPosition = iPosition + 1;
	}
	out.print("</TR>");
}  
%>
</td></tr>
</table>
</center>
</TABLE>
<br><br>
<script>
	function changepage11(type)
	{
		document.all.txt_type.value = "2";
		document.all.txt_edit.value = type;// 1:添加 2:修改 3:删除 4:列表查看 5:日历查看
		document.all.form1.action = "person.jsp";
		document.all.form1.submit();
	}
	function changecolorIN()
	{
		this.style.color="#6600FF";
		this.style.textDecoration="underline";
	}
	function changecolorOUT()
	{
		this.style.color="#660099";
		this.style.textDecoration="none";
	}
</script>

<%}catch(Exception e){oa.main.Logger.log("ERROR:oa.person.dailyArragement11.jsp=>");e.printStackTrace(oa.main.Logger.log);}
finally{
	if(myBean!=null)myBean.closeConn();
}%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -