/*************************************************************************************/
在JSP頁面裏時間範圍的寫法
/*************************************************************************************/
<%@page contentType="text/html;charset=Big5"%> <%@page import="java.util.*" %> <%@page import="java.text.*" %> <%@page import="java.sql.*" %> <%@page import="java.lang.String.*" %>
<script src="./JS/step.js"></script> <LINK href="style.css" type=text/css rel=stylesheet></LINK> <% DateFormat myformat = new SimpleDateFormat("yyyy/MM/dd"); DateFormat myformat1 =new SimpleDateFormat("yyyyMMdd"); Calendar cal = Calendar.getInstance(); java.util.Date today = new java.util.Date();
%> <Script language="javaScript"> function addLabelProperties(f){ if(typeof f.getElementsByTagName == 'undefined') return; var labels = f.getElementsByTagName("label"), label, elem, i = j = 0; while (label = labels[i++]){ if(typeof label.htmlFor == 'undefined') return; elem = document.getElementById(label.htmlFor); if(typeof elem == 'undefined'){ //no label defined, find first sub-input var inputs = label.getElementsByTagName("input"); if(inputs.length==0){ continue; } else { elem=inputs[0]; } } else if(typeof elem.label != 'undefined') { // label property already added continue; } else if(typeof elem.length != 'undefined' && elem.length > 1 && elem.nodeName != 'SELECT'){ for(j=0; j<elem.length; j++){ elem.item(j).label = label; } } elem.label = label; } }
function check(p,p1,p21,p22,p3,p4) { addLabelProperties(form1); var inputs = form1.getElementsByTagName('input'); for (var i=0; i < inputs.length; i++) { if(inputs[i].value==p.value && p.name == "order") { inputs[i].label.className="radioOn"; select1(p1,p21,p22,p3,p4); } else if(inputs[i].name =="order") { inputs[i].label.className="radioOff"; } } }
function check2(p1,p21,p22,p3,p4) { var sort="";
if(p3.checked ==true) { sort=p3.value; } else if(p4.checked ==true) { sort=p4.value; }
window.open("excel.jsp?module="+p1+"&da1="+p21+"&da2="+p22+"&sort="+sort);
}
</Script> <html> <body> <form name="form1"> <table border=0 cellSpacing=0 cellPadding=0 align="center"> <tr> <td width="100" height="20"><strong>INC. DC</strong></td> <td width="900" height="700" rowspan="2"> <div id="a" style="display:block">
<table align="center"> <tr><td> <font color="#FF8080"><strong>Incomplete non-lot data collection</strong></font> </td></tr> </table> </div>
<div id="b" style="display:none"> <table> <tr valign="top"> <td valign="top" height="20"> <button type="button" style="border-width:0;width:20;height:20;CURSOR: pointer;" οnclick=check2(form1.module.value,form1.da1.value,form1.da2.value,form1.c,form1.d)> <img border="0" src="./img/excel1.gif" width="20" height="20"> </button> EXCEL FILE </td> </tr> <tr valign="top"> <td height="700"> <div id="tabledis" style="overflow:auto;height:670"> <table id="large" cellspacing="1"> </table> </div> </td> </tr> </table> </div>
</td> </tr> <tr valign="top"> <td width="100" height="670"> <font style="FONT:0.8em/16px Verdana,Arial,Helvetica;color:#006cb4">Module:</font> <div class="box"> <div class="box2"> <select name="module" style="width:100px;color:#006cb4" οnchange=select1(form1.module.value,form1.da1.value,form1.da2.value,form1.c,form1.d)> <option>-SELECT-</option> <option value="DIFF"> DIFF </option> <option value="ETCH"> ETCH </option> <option value="PHOTO"> PHOTO </option> <option value="CC"> CC </option> <option value="TF"> TF </option> <option value="DCM"> DCM </option> </select> </div> </div> <br> <font style="FONT:0.8em/16px Verdana,Arial,Helvetica;color:#006cb4">StartDate:</font> <div class="box"> <div class="box2"> <select name="da1" style="width:100px;color:#006cb4" οnchange=select1(form1.module.value,form1.da1.value,form1.da2.value,form1.c,form1.d) > <% for(int i=0;i<=90;i++) { java.util.Date mydate = cal.getTime(); out.println("<option value="+myformat1.format(mydate)+">"+myformat.format(mydate)+"</option>"); cal.add(Calendar.DATE,-1); out.println("</option>"); } %> </select> </div> </div> <!--add "startdate" "enddate" for pc user to show undo message between startdate and enddate--> <!--modified by rong chen on 20080703--> <br> <font style="FONT:0.8em/16px Verdana,Arial,Helvetica;color:#006cb4">EndDate:</font> <div class="box"> <div class="box2"> <select name="da2" style="width:100px;color:#006cb4" οnchange=select1(form1.module.value,form1.da1.value,form1.da2.value,form1.c,form1.d) > <% cal.add(Calendar.DATE,+91); for(int i=0;i<=90;i++) { java.util.Date mydate = cal.getTime(); out.println("<option value="+myformat1.format(mydate)+">"+myformat.format(mydate)+"</option>"); cal.add(Calendar.DATE,-1); out.println("</option>"); } %> </select> </div> </div> <br> <font style="FONT:0.8em/16px Verdana,Arial,Helvetica;color:#006cb4">Sort by:</font> <INPUT id=c type="radio" CHECKED value="eqpid" name="order" style="position:absolute;left:-1000px"> <Label for=c οnclick="check(form1.c,form1.module.value,form1.da1.value,form1.da2.value,form1.c,form1.d)" class="radioOn" >EQPId</LABEL><br> <INPUT id=d type="radio" value="dcspecid" name="order" style="position:absolute;left:-1000px"> <LABEL for=d οnclick="check(form1.d,form1.module.value,form1.da1.value,form1.da2.value,form1.c,form1.d)" class="radioOff">Process</LABEL><br><br> </td> </tr> </table> </form> </body> </html>