读书人

JSP页面设计有关问题

发布时间: 2012-01-13 22:43:29 作者: rapoo

JSP页面设计问题
周一 二 三 。。。 日
张XX N Y N Y
王XX Y Y N N

。。。。。。。
。。。。。。。

孙XX N N Y Y



公司要求做一个功能页面,显示所有员工一周的日程安排情况(周一至周天)。如果有日程安排,就要是一个超连接(Y),否则就不用是超连接(N)。我的数据库表大体上是 日程id(主键),员工id,日程内容,日程日期时间 等构成的。我有几点不知道怎么下手:1. 怎么从数据库中查询相应的数据 2. 怎么实现JSP页面,是它能象上图一样显示出来(最好超连接能显示一点日程的关键字)。 请高手给我一个大体的思路,谢谢了!!!


[解决办法]
应该是select * from 员工表,日程表 where 员工表.员工id=日程表.员工id and 日程表.日期> =本周start日期 and 日程表.日期 <=本周End日期 order by 员工表.员工id,日程表.日期
[解决办法]
2.做个表格,每条纪录循环一次!
[解决办法]
table
[解决办法]
用表格,这例子网上大把的有
[解决办法]
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<title> 甘特图 </title>
<link href= "css/css.css " rel= "stylesheet " type= "text/css ">
<script language= "JavaScript ">
// JavaScript Document
function gtt(id)
{
this.id=id;
this.showobj=document.all[ " "+id];
this.rowcolor= "#EBEBEB ";
this.addnew=graphgt_addnew;

}
function graphgt_addnew(urls,colors,syear,smonth,sday,shour,eyear,emonth,eday,ehour)
{
var startdate=new Date(syear*1,smonth*1-1,sday);
var enddate=new Date(eyear*1,emonth*1-1,eday);
if(startdate-enddate==0)
{
var yyyy=syear;
var mm=(smonth*1 <10)? "0 "+smonth*1:smonth;
var dd=(sday*1 <10)? "0 "+sday*1:sday;
var insertdate=yyyy+ "- "+mm+ "- "+dd;
var rows=this.showobj.rows;
var rowid=-1;
for(var i=0;i <rows.length;i++)
{

var rowdate=rows[i].cells[0].innerText;
if(rowdate==insertdate)
{
rowid=i;
break;
}
}

var snewgt= ' <table border= "0 " cellspacing= "0 " cellpadding= "0 "> <tr> ';
var cella= ' <td width= "40 " >   </td> ';//#6666FF
var cellb= ' <td width= "40 " bgcolor= " '+colors+ ' " onmouseover= "this.style.cursor=\ 'hand\ '; " onmouseout= "this.style.cursor=\ '\ '; " onClick= "window.open(\ ' '+urls+ '\ '); ">   </td> '


for(var i=0;i <24;i++)
{
if(i> =shour*1&&i <=ehour*1)
{
snewgt+=cellb;
}
else
{
snewgt+=cella;
}
}
snewgt+= ' </tr> </table> ';
//alert(snewgt);
if(rowid!=-1)
{//存在行
var cell=rows[rowid].cells(1);
cell.insertAdjacentHTML( "BeforeEnd ",snewgt);
}
else
{//不存在
var newrow=this.showobj.insertRow(rows.length-1);
newrow.style.height= "1px ";
newcell=newrow.insertCell(0);
newcell.colSpan=25;
newcell.innerHTML= ' <img src= "img/hr.gif " height= "1px " width= "100% "> ';
newrow=this.showobj.insertRow(rows.length-1);
newrow.style.backgroundColor=this.rowcolor;
if(this.rowcolor== "#EBEBEB ")
{
this.rowcolor= "#FFFFFF ";
}
else
{
this.rowcolor= "#EBEBEB ";
}
newcell=newrow.insertCell(0);
newcell.innerText=insertdate;
newcell.noWrap=true;
newcell=newrow.insertCell(1);
newcell.colSpan=24;
newcell.insertAdjacentHTML( "BeforeEnd ",snewgt);
}
}
}
function Init()
{
og=new gtt( "graphgt ");
og.addnew( 'a.htm ', '#6666FF ', '2007 ', '01 ', '02 ', '03 ', '2007 ', '01 ', '02 ', '04 ');
og.addnew( 'a.htm ', '#6666FF ', '2007 ', '02 ', '03 ', '04 ', '2007 ', '02 ', '03 ', '05 ');
og.addnew( 'a.htm ', '#6666FF ', '2007 ', '03 ', '04 ', '05 ', '2007 ', '03 ', '04 ', '06 ');
og.addnew( 'a.htm ', '#6666FF ', '2007 ', '04 ', '05 ', '06 ', '2007 ', '04 ', '05 ', '07 ');
og.addnew( 'a.htm ', '#6666FF ', '2007 ', '05 ', '06 ', '07 ', '2007 ', '05 ', '06 ', '08 ');
og.addnew( 'a.htm ', '#6666FF ', '2007 ', '06 ', '07 ', '08 ', '2007 ', '06 ', '07 ', '09 ');
og.addnew( 'a.htm ', '#6666FF ', '2007 ', '07 ', '08 ', '09 ', '2007 ', '07 ', '08 ', '11 ');

}
</script>
</head>

<body style= "FONT-SIZE: 12px " text=#000000 leftMargin=0 topMargin=0 rightMargin=0 onLoad= "Init(); ">
<table width= "100% ">
<tr> <td align= "right "> <a href= "addplane.do?id= <%=id%> "> 新增 </a> | <a href= "showplan.do?id= <%=id%> "> 以列表方式查看 </a> | <a href= "eqinfor.do?id= <%=id%> "> 返回 </a> </td> </tr>
</table>
<table width= "1010 " border= "0 " cellspacing= "0 " cellpadding= "0 " bgcolor= "#999999 " align= "center " id= "graphgt ">
<tr>
<td class= "font2 " height= "20 " background= "img/20.gif " align= "center " colspan= "25 "> 计划 </td>
</tr>
<tr align= "center " bgcolor= "#FFFFFF ">
<td width= "90 "> 日期 </td>
<td width= "40 " nowrap> 00:00 </td>
<td width= "40 " nowrap> 01:00 </td>
<td width= "40 " nowrap> 02:00 </td>


<td width= "40 " nowrap> 03:00 </td>
<td width= "40 " nowrap> 04:00 </td>
<td width= "40 " nowrap> 05:00 </td>
<td width= "40 " nowrap> 06:00 </td>
<td width= "40 " nowrap> 07:00 </td>
<td width= "40 " nowrap> 08:00 </td>
<td width= "40 " nowrap> 09:00 </td>
<td width= "40 " nowrap> 10:00 </td>
<td width= "40 " nowrap> 11:00 </td>
<td width= "40 " nowrap> 12:00 </td>
<td width= "40 " nowrap> 13:00 </td>
<td width= "40 " nowrap> 14:00 </td>
<td width= "40 " nowrap> 15:00 </td>
<td width= "40 " nowrap> 16:00 </td>
<td width= "40 " nowrap> 17:00 </td>
<td width= "40 " nowrap> 18:00 </td>
<td width= "40 " nowrap> 19:00 </td>
<td width= "40 " nowrap> 20:00 </td>
<td width= "40 " nowrap> 21:00 </td>
<td width= "40 " nowrap> 22:00 </td>
<td width= "40 " nowrap> 23:00 </td>
</tr>
</tr>
<tr>
<td colspan= "25 " height= "1px "> <img src= "img/hr.gif " height= "1px " width= "100% "> </td>
</tr>
</table>

</body>
</html>

读书人网 >Java Web开发

热点推荐