📄 entercode.jsp
字号:
<%--
Created by IntelliJ IDEA.
User: jtgao
Date: 2006-5-20
Time: 14:02:16
To change this template use File | Settings | File Templates. //
--%>
<%@ 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 sTITLE = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("TITLE");//"Shipments Made";
String sLABLE_1 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABLE_1");//"Location";
String sLABLE_2 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABLE_2");//"From date";
String sLABLE_3 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABLE_3");//"To date";
String sLABLE_4 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABLE_4");//"To date";
String sLABLE_T1 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABLE_T1");//"Shipments in GROSS Pounds";
String sLABLE_T2 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABLE_T2");//"Shipments in NET Pounds";
String sLABLE_T3 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABLE_T3");//"Shipments in Canadian Dollars";
String sLABLE_R1 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABLE_R1");//"Canada";
String sLABLE_R2 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABLE_R2");//"USA";
String sLABLE_R3 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABLE_R3");//"Overseas";
String sLABLE_R4 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABLE_R4");//"Total";
String sLABLE_C1 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABLE_C1");//"Brass";
String sLABLE_C2 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABLE_C2");//"Copper";
String sLABLE_C3 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABLE_C3");//"Total";
String sAREAT_1 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("ALERT_1");//"Inventory location must be entered: FERG HILL";
String sAREAT_2 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("ALERT_2");//"Inventory location not found. Try again.";
String sAREAT_3 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("ALERT_3");//"Start date Error. Try again.";
String sAREAT_4 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("ALERT_4");//"End date Error. Try again.";
String sAREAT_5 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("ALERT_5");//"End date must be greater than or equal to start date";
String sAREAT_6 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("ALERT_6");//"Location Code is Empty";
String sAREAT_7 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("ALERT_7");//"Start date is Empty";
String sAREAT_8 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("ALERT_8");//"End date is Empty";
String sLABEL_B1 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABEL_B1");//"取消";
String sLABEL_B2 = (String) Configure.getConfigure(sIe_Language, "Shipping_MonthShipMent").get("LABEL_B2");//"确认";
%>
<script language=javascript>
function Input1()
{
if (!( event.keyCode == 78 || event.keyCode == 89 || event.keyCode == 110 || event.keyCode == 121 ))
event.returnValue = false;
else
event.returnValue = true;
}
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()
{
//alert("1");
//是否输入了 location
if (document.all.location.value.length < 1) {
alert('<%=sAREAT_6%>');
document.all.location.focus();
return;
}
slocation = document.all.location.value;
//alert("2");
// 输入的 location 是否 为 "HILL" 或者 为 "FERG"
if (slocation == "HILL" || slocation == "FERG") {
} else {
alert('<%=sAREAT_1%>');
document.all.location.focus();
return;
}
//alert("3");
//是否输入了开始时间
if (document.all.StratDate.value.length < 1) {
alert('<%=sAREAT_7%>');
document.all.StratDate.focus();
return;
}
sStratDate = document.all.StratDate.value;
//alert("4");
//输入的开始时间格式是否正确
if (!IsDate(sStratDate, "-")) {
alert('<%=sAREAT_3%>');
document.all.StratDate.focus();
return;
}
//alert("5");
//是否输入了结束时间
if (document.all.Enddate.value.length < 1) {
alert('<%=sAREAT_8%>');
document.all.Enddate.focus();
return;
}
//alert("6");
sEnddate = document.all.Enddate.value;
//结束日期的格式是否正确
if (!IsDate(sEnddate, "-")) {
alert('<%=sAREAT_4%>');
document.all.Enddate.focus();
return;
}
//alert("7");
//日期格式转换
//sEnddate = Date.parse(sEnddate);
//sStratDate = Date.parse(sStratDate);
//alert(sEnddate);
//alert(sStratDate);
//开始时间是否小于或者等于结束时间
if (DateDiff(sEnddate, sStratDate) < 0) {
alert('<%=sAREAT_5%>');
document.all.Enddate.focus();
return;
}
//alert("ok");
sReturn_isEmpty = PopPage("/ShippingManager/monthlyshipments/CheckCode.jsp?location=" + slocation + "&rand=" + randomNumber(), "", "");
if (sReturn_isEmpty == "false")
{
if (!confirm("Not Change fiscal date?")) {
document.all.Enddate.focus();
return;
}
OpenComp("", "/ShippingManager/monthlyshipments/MonthlyShipmentsMade.jsp"
, "location=" + slocation
+ "&StratDate=" + sStratDate
+ "&Enddate=" + sEnddate
+ "&rand=" + randomNumber(), "right", "");
/*
sReturn_isEmpty = PopPage("/ShippingManager/monthlyshipments/MonthlyShipmentsMade.jsp?location="
+slocation
+"&StratDate="+sStratDate
+"&Enddate="+sEnddate
+"&rand="+randomNumber(),"",""); */
self.close();
self.returnValue = "OK";
return;
} else {
alert('<%=sAREAT_2%>');
document.all.location.focus();
return;
}
}
function pressEnter(arg) {
if (window.event.keyCode == 13) {
Che_acc();
}
}
</script>
<html>
<head><title><%=sTITLE%>
</title>
</head>
<body bgcolor="#DCDCDC">
<table border="1" width=100% align="center" bordercolor='#999999' bordercolordark='#FFFFFF'>
<tr>
<td nowrap align="right" class="black9pt" bgcolor="#D8D8AF"> <%=sLABLE_1%> </td>
<td nowrap bgcolor="#F0F1DE">
<input type="text" name="location" size="4" value="HILL" maxlength="4">
</td>
</tr>
<tr>
<td nowrap align="right" class="black9pt" bgcolor="#D8D8AF" height="25"> <%=sLABLE_2%> </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"> <%=sLABLE_3%> </td>
<td nowrap bgcolor="#F0F1DE" height="25">
<input type="text" name="Enddate" size="10" value="<%=dend%>" maxlength="10" onKeyDown="DateInput()">
</td>
</tr>
<tr align="center">
<td nowrap align="right" class="black9pt" bgcolor="#D8D8AF" height="25"> </td>
<td nowrap bgcolor="#F0F1DE" height="25">
<input type="button" name="next2" value="<%=sLABEL_B2%>" 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="<%=sLABEL_B1%>"
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 + -