📄 entercode.jsp
字号:
<%--
Created by IntelliJ IDEA.
User: jtgao
Date: 2006-5-26
Time: 23:30:16
To change this template use File | Settings | File Templates.//
--%>
<%@page contentType="text/html;charset=GBK"%>
<%@ include file="/IncludeBeginMD.jsp"%>
<%@ page import="com.hexiesoft.utils.StringUtils" %>
<script language=javascript src="<%=sResourcesPath%>/keyevent.js"> </script>
<%
String dstart = "2001-11-26";
String dend = "2001-12-30";
String SQL = "select top 1 dstart,dend from fiscal order by dstart DESC";
ASResultSet rs = Sqlca.getASResultSet (SQL);
if (rs.next()) {
dstart = StringUtils.to_Date(rs.getString("dstart"));
dend = StringUtils.to_Date(rs.getString("dend"));
}
%>
<%
String Title_01 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Title_01");//"View Packed Orders";
String Alert_01 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Alert_01");//"Enter location ";
String Alert_02 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Alert_02");//"Enter start date";
String Alert_03 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Alert_03");//"Enter end date";
String Alert_04 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Alert_04");//"Enter account";
String Alert_05 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Alert_05");//"Enter subacct";
String Alert_06 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Alert_06");//"Incorrect location: FERG HILL";
String Alert_07 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Alert_07");//"开始时间输入格式错误。";
String Alert_08 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Alert_08");//"结束时间输入格式错误。";
String Alert_09 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Alert_09");//"End date must be greater than or equal to start date";
String Alert_10 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Alert_10");//"No records fullfil your request, report canceled.";
String Label_00 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Label_00");//"Enter packing start date";
String Label_01 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Label_01");//"Enter packing start date";
String Label_02 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Label_02");//"Enter packing end date";
String Label_03 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Label_03");//"Account.................";
String Label_04 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Label_04");//"Subacct.................";
String Butxt_01 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Butxt_01");//"取消";
String Butxt_02 = (String)Configure.getConfigure(sIe_Language,"Shipping_ViewPO").get("Butxt_02");//"确定";
String sTitle = DataConvert.toRealString(iPostChange,request.getParameter("Title"));
%>
<script language=javascript>
function IsDate(DateString, Dilimeter)
{
// alert("2");
if (DateString == null) return false;
if (Dilimeter == '' || Dilimeter == null) Dilimeter = '-';
var tempy = '';
var tempm = '';
var tempd = '';
var tempArray;
if (DateString.length < 8 || DateString.length > 10) return false;
tempArray = DateString.split(Dilimeter);
if (tempArray.length != 3) return false;
tempy = tempArray[0];
tempd = tempArray[2];
tempm = tempArray[1];
var tDateString = tempy + '/' + tempm + '/' + tempd;
var tempDate = new Date(tDateString);
if (isNaN(tempDate)) return false;
if (tempDate.getFullYear() > 2050 || tempDate.getFullYear() < 1950)
{
alert('年份必须大于1950年,小于2050年');
return false;
}
if (((tempDate.getFullYear()).toString() == tempy) && (tempDate.getMonth() == myparseInt(tempm) - 1) && (tempDate.getDate() == myparseInt(tempd)))
{
return true;
}
else
{
return false;
}
}
//去掉月份或日期前的0,比如2003-02-04 ->2003-2-4
function myparseInt(num)
{
var tempnum = num + "";
while (tempnum.substr(0, 1) == "0") {
tempnum = tempnum.substr(1);
}
return(parseInt(tempnum));
}
//function IsDate() End
//Function DateDiff
function DateDiff(sDate2, sDate1) { //sDate1和sDate2是2002-12-18格式
var aDate, oDate1, oDate2, iDays
aDate = sDate1.split("-")
oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]) //转换为12-18-2002格式
aDate = sDate2.split("-")
oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
iDays = parseInt(oDate2 - oDate1) //把相差的毫秒数转换为天数
return iDays
}
//Function DateDiff end
function Che_acc()
{
//取得输入的各个数值
sLocation = document.all.Location.value.trim();
sStratDate = document.all.StratDate.value.trim();
sEnddate = document.all.Enddate.value.trim();
sAccount = document.all.Account.value.trim();
sSubacct = document.all.Subacct.value.trim();
//alert(sLocation+sStratDate+sEnddate+sAccount+sSubacct);
//是否输入了 location
if(sLocation.length<1){
alert('<%=Alert_01%>');
document.all.Location.focus();
return;
}
// 输入的 location 是否 为 "HILL" 或者 为 "FERG"
if( sLocation == "HILL" || sLocation == "FERG"){
} else {
alert('<%=Alert_06%>');
document.all.Location.focus();
return;
}
//是否输入了开始时间
if(sStratDate.length<1){
alert('<%=Alert_02%>');
document.all.StratDate.focus();
return;
}
//输入的开始时间格式是否正确
if (IsDate(sStratDate,"-")) {
}else{
alert('<%=Alert_07%>');
document.all.StratDate.focus();
return;
}
//是否输入了结束时间
if(sEnddate.length<1){
alert('<%=Alert_03%>');
document.all.Enddate.focus();
return;
}
//结束日期的格式是否正确
if (IsDate(sEnddate,"-")) {
} else {
alert('<%=Alert_08%>');
document.all.Enddate.focus();
return;
}
//开始时间是否小于或者等于结束时间
if (DateDiff(sEnddate,sStratDate) < 0) {
alert('<%=Alert_09%>');
document.all.Enddate.focus();
return;
}
//是否输入了Account
// if(sAccount.length<1){
<%--alert('<%=Alert_04%>');--%>
// document.all.Account.focus();
// return;
// }
// //是否输入了Subacct
// if(sSubacct.length<1){
<%--alert('<%=Alert_05%>');--%>
// document.all.Subacct.focus();
// return;
// }
//Check Enter Codes
/*
OpenComp("<%=sTitle%>","/ShippingManager/PackingNote/viewPackedOrders/CheckCode.jsp"
,"Location="+sLocation
+"&StratDate="+sStratDate
+"&Enddate="+sEnddate
+"&Account="+sAccount
+"&Subacct="+sSubacct
+"&rand="+randomNumber(),"right","")
*/
// /*
sReturn_isEmpty = PopPage("/ShippingManager/PackingNote/viewPackedOrders/CheckCode.jsp?Location="+sLocation
+"&StratDate="+sStratDate
+"&Enddate="+sEnddate
+"&Account="+sAccount
+"&Subacct="+sSubacct
+"&rand="+randomNumber(),"","");
//alert(sReturn_isEmpty);
if(sReturn_isEmpty == "1")
{
OpenComp("<%=sTitle%>","/ShippingManager/PackingNote/viewPackedOrders/ViewPackOrders.jsp"
,"Location="+sLocation
+"&StratDate="+sStratDate
+"&Enddate="+sEnddate
+"&Account="+sAccount
+"&Subacct="+sSubacct
+"&rand="+randomNumber(),"right","");//*/
/* //
sReturn_isEmpty = PopPage("/ShippingManager/monthlyshipments/MonthlyShipmentsMade.jsp?location="
+slocation
+"&StratDate="+sStratDate
+"&EndDate="+sEnddate
+"&Account="+sAccount
+"&Subacct="+sSubacct
+"&rand="+randomNumber(),"",""); */
self.returnValue="OK";
self.close();
return;
}else{
alert('<%=Alert_10%>');
return;
}
}
</script>
<html>
<head><title><%=Title_01%></title>
</head>
<body bgcolor="#DCDCDC">
<br>
<table border="1" width=100% align="center" bordercolor='#999999' bordercolordark='#FFFFFF'>
<tr>
<td nowrap align="right" class="black9pt" bgcolor="#D8D8AF" > <%=Label_00%> </td>
<td nowrap bgcolor="#F0F1DE" >
<input type="text" name="Location" size="4" value="HILL" maxlength="4" onKeyDown="">
</td>
</tr>
<tr>
<td nowrap align="right" class="black9pt" bgcolor="#D8D8AF" height="25" > <%=Label_01%> </td>
<td nowrap bgcolor="#F0F1DE" height="25">
<input type="text" name="StratDate" size="10" value="<%=dstart%>" maxlength="10" onKeyDown="DateInput()" >
</td>
</tr>
<tr>
<td nowrap align="right" class="black9pt" bgcolor="#D8D8AF" height="25" > <%=Label_02%> </td>
<td nowrap bgcolor="#F0F1DE" height="25">
<input type="text" name="Enddate" size="10" value="<%=dend%>" maxlength="10" onKeyDown="DateInput()">
</td>
</tr>
<tr>
<td nowrap align="right" class="black9pt" bgcolor="#D8D8AF" height="25" > <%=Label_03%> </td>
<td nowrap bgcolor="#F0F1DE" height="25">
<input type="text" name="Account" size="6" maxlength="6">
</td>
</tr>
<tr>
<td nowrap align="right" class="black9pt" bgcolor="#D8D8AF" height="25" > <%=Label_04%> </td>
<td nowrap bgcolor="#F0F1DE" height="25">
<input type="text" name="Subacct" size="4" maxlength="4" >
</td>
</tr>
<tr align="center">
<td nowrap align="right" class="black9pt" bgcolor="#D8D8AF" height="25" > </td>
<td nowrap bgcolor="#F0F1DE" height="25">
<input type="submit" name="next2" value="<%=Butxt_02%>" onClick="javascript:Che_acc()" style="font-size:9pt;padding-top:3;padding-left:5;padding-right:5;background-image:url(../../../Resources/functionbg.gif); border: #DCDCDC; border-style: outset; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px" border='1'>
<input type="button" name="Cancel2" value="<%=Butxt_01%>" onClick="javascript:self.returnValue='_none_';self.close()" style="font-size:9pt;padding-top:3;padding-left:5;padding-right:5;background-image:url(../../../Resources/functionbg.gif); border: #DCDCDC; border-style: outset; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px" border='1'>
</td>
</tr>
</table>
</body>
</html>
<%@ include file="/IncludeEnd.jsp" %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -