object expected 错误 大家帮忙看看代码吧 我快倒下了 不知道怎么调试了

malarfno 2007-03-06 02:48:28
jsp新手做维护 数据库更新后这个页面出了bug 总是object expected错误 根据提示到行上缺发现毛都没有 也不知道哪个对象出错了 大家帮忙看看吧 100分送上了



<%@ page language="java" contentType="text/html;charset=big5"%>
<%@ include file="jsphead.inc"%>
<%@ page import="java.util.Calendar" %>
<%@ page import="com.ti.ffw.Libs.EMail.*" %>

<%!
private String getDefine() {
return "Style None;";
}
public int event(java.lang.String stylename, int step, ScriptLine line, PageCenter center) {
return 1 ;
}
%>
<%
String optionStr="";
boolean canddsame=false;
employee emp = (employee)session.getAttribute("Login_Employee");
int power = emp.getPower();
int level=0;
if(power<employee.CC_MANAGER||power==employee.POWER_USER1)
level=0;
else if(power==employee.CC_MANAGER)
level=1;
else if(power==employee.DEPT_MANAGER)
level= 2;
else if(power==employee.CNB_MANAGER)
level= 3;
else if(power==employee.HR_DIR)
level= 4;
else if(power==employee.SITE_MANAGER)
level= 5;
else if(power==employee.HR||power==employee.POWER_USER2)
level=9;
String saveResultStr = "",sql = "";
Connection con = getCon();
DataTable LEAVE_CODE_table = new DataTable();
LEAVE_CODE_table.load(con,"select CODE,DESP,UNIT from LEAVE_TYPE order by CODE");
DataTable Bonus_Item_table = new DataTable();
Bonus_Item_table.load(con,"select ITEM_ID,ITEM_VALUE,ITEM_DESC FROM NoCash_Item order by ITEM_ID");
String Q_PersonInfo = request.getParameter("Q_PersonInfo");
if(Q_PersonInfo==null) Q_PersonInfo = "";
//輸入員工工號完畢則查詢員工的資料
if(!Q_PersonInfo.equals("")){
Hashtable ht = new Hashtable();
String empno ="";
if(Q_PersonInfo.equals("1")){
empno = request.getParameter("EMP_NO");
ht.put("name_in_chinese","EMP_NAME");
ht.put("name_in_english","EMP_NAME_EN");
ht.put("dir_indir","DIR_INDIR");
ht.put("dept_code","DEPT_CODE");
ht.put("cost_center","COST_CENTER");
ht.put("cc","CC");
ht.put("country","COUNTRY");
ht.put("area_code","AREA_CODE");
}else if(Q_PersonInfo.equals("2")){
String index=request.getParameter("Q_PersonInfo_Index");
empno = request.getParameter("EMP_NO_"+index);
ht.put("name_in_chinese","NAME_"+index);
ht.put("name_in_english","EMP_NAME_EN_"+index);
ht.put("dept_code","DEPT_CODE_"+index);
ht.put("desp_chi","DEPT_NAME_"+index);
ht.put("cost_center","COST_CENTER_"+index);
ht.put("cc","CC_NAME_"+index);
ht.put("area_code","AREA_CODE_"+index);
}
Init_Ht.remove("RECORD_TABLE_INNERHTML");
Init_Ht.remove("Q_PERSONINFO");
QueryPersonInfo(con,empno,ht,Init_Ht);
}
//保存到資料庫
if(Q_PersonInfo.equals("")&&request.getParameter("REQ_DATE")!=null){
if(request.getParameter("CONFIRM_FLAG")!=null&&request.getParameter("CONFIRM_FLAG").equals("1")){
int MAX_Record_Count = Integer.parseInt(request.getParameter("MAX_Record_Count"));
String[] s=new String[2];
String empno="";
errorStr err = new errorStr();
for(int i=1;i<=MAX_Record_Count;i++){
empno = request.getParameter("EMP_NO_"+i);
if(empno!=null&&!empno.trim().equals("")){
saveResultStr += "<p align='center'>";
if(!isEmpExistNew(con,empno,emp,request.getParameter("REQ_DATE")))
saveResultStr += "Fail to save record EmpNO:"+empno+",Reason: emp no "+empno+" is not exist!<br>新增MERIT BONUS記錄 員工工號:"+empno+"失敗,失敗原因: 員工工號"+empno+"不存在!";
else {
String status="1";
String grade=""+level;
if(power==employee.HR_DIR&&request.getParameter("SITE_MGR_"+i)==null){
grade="Y";
status="2";
}
else if(power==employee.SITE_MANAGER) {
grade="Y";
status="2";
}
//else if(power==employee.HR||power==employee.POWER_USER1||power==employee.POWER_USER2){
// grade="Y";
// status="2";
//}
else if(power==employee.CC_MANAGER){
String ssql="select t.dept_mgr from dept t where code ="
+ "(select t.dept_code from personnel_basic t where t.no='"+empno+"')";
DataTable dt11=new DataTable();
dt11.load(con,ssql);
String deptMgrNo=dt11.outB(0,"dept_mgr");
if(deptMgrNo.equals(emp.getInfo("no"))) {
canddsame=true;
grade="2";
}
}
System.out.println("country="+request.getParameter("COUNTRY_"+i));
sql = "insert into MERIT_BONUS_APP(EMP_NO,COUNTRY,REQ_DATE,REQ_AMT,REQ_SUBJECT,APVA_STATUS,CURRENT_GRADE,REQUESTER,CASH_FLAG,REQ_REASON,DEPT_CODE,REMARK";
if(power==employee.HR_DIR&&request.getParameter("SITE_MGR_"+i)!=null) sql=sql+" ,APVA_MGR";
if(grade.equals("Y")) sql=sql+",APPR_DATE";
sql= sql+") values('"+request.getParameter("EMP_NO_"+i)+"','"+request.getParameter("COUNTRY_"+i)+"',to_date('"+request.getParameter("REQ_DATE")+"','MM-DD-YYYY'),"+
"'"+request.getParameter("REQ_AMOUNT_"+i)+"',"+"'"+request.getParameter("REQ_SUBJECT")+"',"+"'"+status+"','"+grade+"','"+
emp.getInfo("no")/*request.getParameter("EMP_NO")*/+"','"+request.getParameter("CASH_"+i)+"','"+request.getParameter("REQ_REASON")+"','"+
request.getParameter("DEPT_CODE_"+i)+"','"+request.getParameter("Bonus_Item_ID_"+i)+"'";
if(power==employee.HR_DIR&&request.getParameter("SITE_MGR_"+i)!=null) sql=sql+",'"+request.getParameter("SITE_MGR_"+i)+"'";
if(grade.equals("Y")) sql=sql+",to_date('"+request.getParameter("REQ_DATE")+"','MM-DD-YYYY')";
sql=sql+")";
if(UTIL.execUpdate(con,sql,err)<0){
if(err.m_errorStr.indexOf("ORA-00001")>-1)
saveResultStr += "新增MERIT BONUS記錄申請失敗 員工工號:"+empno+",申請日期:"+request.getParameter("REQ_DATE")+" 已有資料.";
else
saveResultStr += "Fail to save record EmpNO:"+empno+",Reason:"+err.m_errorStr+"<br>新增MERIT BONUS記錄申請 員工工號:"+empno+"失敗,失敗原因:"+err.m_errorStr+"!";
}
else
saveResultStr += "Success to save record EmpNO:"+empno+"!<br>新增MERIT BONUS記錄申請 員工工號:"+empno+"成功!";
/*
String emailSQL ="select t.email from personnel_basic t where t.no in "
+"("
+ "select distinct t.supr_mgr from line_shift t where cc_code ="
+ "("
+"select t.cost_center from personnel_basic t where t.no='"+empno+"'"
+ ")"
+")";
*/
String cc="select t.email from personnel_basic t where t.no in "
+"("
+ "select distinct t.cc_mgr from cost_center t where code ="
+ "("
+"select t.cost_center from personnel_basic t where t.no='"+empno+"'"
+ ")"
+")";
...全文
2425 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
malarfno 2007-03-06
  • 打赏
  • 举报
回复
要不然你加我qq吧 11084684 我直接传给你 分不够我再加 呵呵
malarfno 2007-03-06
  • 打赏
  • 举报
回复
onChange="return ChgItem();" >改成这样也不对啊
还是提示object expected
jjoohhnn13 2007-03-06
  • 打赏
  • 举报
回复
<select name="Bonus_Item" onChange="ChgItem()" >

结尾少了;

改成
<select name="Bonus_Item" onChange="return ChgItem();" >
jjoohhnn13 2007-03-06
  • 打赏
  • 举报
回复
根据你贴出来的代码
alert("111111"); 后面没关门嘛,少了</script>
当然打不出来了

还有
错误1 LINE994 CHAR 14 unterminated string constant
错误2 line28 char1 object expected

是哪个文件里的,把控制台的错误信息打出来,而不是提示的错误信息
malarfno 2007-03-06
  • 打赏
  • 举报
回复
错误1 LINE994 CHAR 14 unterminated string constant
错误2 line28 char1 object expected
<select name="Bonus_Item" onChange="ChgItem()" >
<option value=" " > </option>
<% for(int i=0;i<Bonus_Item_table.rowSize();i++){ %>
<option value="<%=Bonus_Item_table.out(i,"ITEM_ID")+"|"+Bonus_Item_table.out(i,"ITEM_VALUE")%>"><%=Bonus_Item_table.out(i,"ITEM_DESC")%></option>
<% } %>
</select>
这段也出错 我把chgItem()函数换成 alert就没错了
malarfno 2007-03-06
  • 打赏
  • 举报
回复
md确实代码太长了 中间有一部分我不贴了 现在贴后面的 我调试alert"2222222222222"这句能出来 但是alert(11111)出不来见下面的代码

<%@ include file="setInitValue.inc"%>
<script language="javascript">Initdata(this.form1);</script>

<script language="javascript" src="starsys.js"></script>
<script language="javascript">alert("22222222222222");</script>
<script language="javascript">
//var Del_Count=0;
alert("111111");
var CHECKALL_FLAG = true;
var optStr="<option value='0'></option>";
function afterLoad(){
//alert("afterLoad!");
<% if(saveResultStr.equals("")){
if(request.getParameter("MAX_Record_Count")!=null){%>
form1.MAX_Record_Count.value = <%=Integer.parseInt(request.getParameter("MAX_Record_Count"))%>;
<%}else{%> form1.MAX_Record_Count.value =0;<%}%>
<% }else{%>
if(confirm('<%=saveResultStr%>')){
form1.CONFIRM_FLAG.value="1";
form1.submit();
}
<%}%>
if(form1.IsSel[1].checked){
//alert("ok");
form1.Bonus_Item.disabled=false;
form1.REQ_AMOUNT.disabled=true;
}
else{
form1.Bonus_Item.selectedIndex=0;
form1.Bonus_Item.disabled=true;
form1.REQ_AMOUNT.disabled=false;
}
}
/**
出勤代碼 開始
*/
var LEAVE_DESP = new Array();
var LEAVE_UNIT = new Array();
<%for(int i=0;i<LEAVE_CODE_table.rowSize();i++){%>
LEAVE_DESP[<%=i%>]="<%=LEAVE_CODE_table.out(i,"DESP")%>";
LEAVE_UNIT[<%=i%>]="<%=LEAVE_CODE_table.out(i,"UNIT")%>";
<%}%>
function ChangeLEAVE_CODE(LEAVE_CODEObj,LEAVE_DESPObj,LEAVE_UNITObj){
LEAVE_DESPObj.value = LEAVE_DESP[LEAVE_CODEObj.selectedIndex];
LEAVE_UNITObj.value = LEAVE_UNIT[LEAVE_CODEObj.selectedIndex];
}
function getLEAVE_CODE(RecordIndex){
var LEAVE_CODE_SelObj = "<select name='LEAVE_CODE_"+RecordIndex+"' onChange=ChangeLEAVE_CODE(this,document.all(\"LEAVE_DESP_"+RecordIndex+"\"),document.all(\"LEAVE_UNIT_"+RecordIndex+"\"))>";
<%for(int i=0;i<LEAVE_CODE_table.rowSize();i++){%>
LEAVE_CODE_SelObj +="<option value='<%=LEAVE_CODE_table.out(i,"code")%>' <%=LEAVE_CODE_table.out(i,"code").equals("10")?"selected":""%>><%=LEAVE_CODE_table.out(i,"code")%></option>";
<%}%>
LEAVE_CODE_SelObj += "</select>";
return LEAVE_CODE_SelObj;
}
/**
出勤代碼 結束
*/

/**
增加一筆記錄 開始
*/
function addCell(row,innerHTML){
var cell = row.insertCell();
cell.innerHTML = innerHTML;
cell.align = "center";
cell.nowrap = true;
}
function addOneRecord(RecordIndex){
var tbl = document.all("RECORD_TABLE");
//alert(RecordIndex-Del_Count);
var row = tbl.insertRow();
//alert(row)
var Cash="";
var NoCash="";
var HideCash="";
var dis="";
if (form1.IsSel[0].checked){
Cash="checked";
NoCash="";
HideCash="Y";
dis='disabled';
}
else {
Cash="";
NoCash="checked";
HideCash="N";
dis='';
}
row.className = "text";
addCell(row,"<input type='checkbox' id='OT_ID_"+RecordIndex+"'>"+"<input type='hidden' name='COUNTRY_"+RecordIndex+"' value='"+form1.COUNTRY.value+"'>");
addCell(row,"<input type='text' name='EMP_NO_"+RecordIndex+"' value='"+form1.EMP_NO.value+"' size='15' class='input' onBlur=\"form1.Q_PersonInfo.value='2';form1.Q_PersonInfo_Index.value='"+RecordIndex+"';form1.RECORD_TABLE_INNERHTML.value = document.all('RECORD_TABLE').innerHTML;form1.submit();\">");

addCell(row,"<input type='text' name='EMP_NAME_EN_"+RecordIndex+"' value='"+form1.EMP_NAME_EN.value+"' size='7' class='input'>");

addCell(row,"<input type='text' name='NAME_"+RecordIndex+"' value='"+form1.EMP_NAME.value+"' size='7' class='input'><input type='button' name='Search43' value=' ... ' class='btton' onclick=\"SelEmployee11("+RecordIndex+",document.all('EMP_NO_"+RecordIndex+"'),document.all('NAME_"+RecordIndex+"'),document.all('EMP_NAME_EN_"+RecordIndex+"'),document.all('DEPT_CODE_"+RecordIndex+"'),document.all('DEPT_NAME_"+RecordIndex+"'),document.all('COUNTRY_"+RecordIndex+"'),'','','','',document.all('AREA_CODE_"+RecordIndex+"'),'','','','',document.all('COST_CENTER_"+RecordIndex+"'));\" >");

addCell(row,"<input type='text' name='REQ_AMOUNT_"+RecordIndex+"' value='"+form1.REQ_AMOUNT.value+"' size='7' class='input' <%if(power==employee.HR_DIR){%>onChange=\"changeMgr(document.all('REQ_AMOUNT_"+RecordIndex+"'),document.all('DEPT_CODE_"+RecordIndex+"'),document.all('SITE_MGR_"+RecordIndex+"'))\"<%}%>>"
+"<input type='hidden' name='DEPT_CODE_"+RecordIndex+"' value='"+form1.DEPT_CODE.value+"' size='7' class='input'>"
+"<input type='hidden' name='DEPT_NAME_"+RecordIndex+"' value='"+form1.DEPT_DESC.value+"' size='12' class='input'>"
+"<input type='hidden' name='AREA_CODE_"+RecordIndex+"' value='"+form1.AREA_CODE.value+"' size='12' class='input'>");

var itemStr=form1.Bonus_Item.value;
var pos=itemStr.indexOf("|");
var itemId=itemStr.substring(0,pos);
//alert("pos="+pos);
//alert("itemId="+itemId);
addCell(row,"<select name='Bonus_Item_"+RecordIndex+"' onChange='ChgItemD(form1.Bonus_Item_"+RecordIndex+",form1.REQ_AMOUNT_"+RecordIndex+",form1.Bonus_Item_ID_"+RecordIndex+")' "+dis+" >" +GetItemOption(form1.Bonus_Item.selectedIndex)+"</select>"
+"<input type='hidden' name='Bonus_Item_ID_"+RecordIndex+"' value='"+itemId+"' size='12' class='input'>");

addCell(row,"<input type='radio' name='IF_CASH_"+RecordIndex+"' value='"+1+"' "+Cash+" onClick='HideCashChg("+RecordIndex+",1)'>"+"YES/是"+"<input type='radio' name='IF_CASH_"+RecordIndex+"' value='"+0+"' "+NoCash+" onClick='HideCashChg("+RecordIndex+",0)'>"+"NO/否" +"<input type='hidden' name='CASH_"+RecordIndex+"' value='"+HideCash+"'>");
addCell(row,"<input type='text' name='COST_CENTER_"+RecordIndex+"' value='"+form1.COST_CENTER.value+"' size='10' class='input'>");//getLEAVE_CODE(RecordIndex) //ChangeLEAVE_CODE(document.all("LEAVE_CODE_"+RecordIndex),document.all("LEAVE_DESP_"+RecordIndex),document.all("LEAVE_UNIT_"+RecordIndex));
<%if(power==employee.HR_DIR) {%>
addCell(row,"<select name='SITE_MGR_"+RecordIndex+"' disabled>"+optStr+"</select>");
setMgrOptions(document.all("AREA_CODE_"+RecordIndex),document.all("SITE_MGR_"+RecordIndex));
changeMgr(document.all("REQ_AMOUNT_"+RecordIndex),document.all("DEPT_CODE_"+RecordIndex),document.all("SITE_MGR_"+RecordIndex));
<%}%>
}
/**
增加一筆記錄 結束
*/
Augustans 2007-03-06
  • 打赏
  • 举报
回复
把完整的错误提示贴上来
jjoohhnn13 2007-03-06
  • 打赏
  • 举报
回复
代码太长了。。。把错误信息打出来看看
malarfno 2007-03-06
  • 打赏
  • 举报
回复
<tr>
<td height="19" nowrap><div align="right"><span class="lan">Request
Reason/</span><br>申請理由(<font color="#FF3300">*</font>)</div></td>
<td height="19" colspan="3" nowrap><div align="left">
<input type="text" name="REQ_REASON" size="50" class="input" maxlength="60">
</div></td>
</tr>
<tr>
<td height="19" nowrap><div align="right"><span class="lan">Request
Amount/</span><br>申請金額(<font color="#FF3300">*</font>)</div></td>
<td height="19" nowrap><div align="left">
<input type="text" name="REQ_AMOUNT" size="10" class="input">
</div></td>
<td>
</td>
<td>
</td>

</tr>
<tr>
<td height="19" nowrap><div align="right"><span class="lan">Cash
Or None Cash/</span><br>
是否現金發放(<font color="#FF3300">*</font>)</div></td>
<td height="19" nowrap><input type="radio" name="IsSel" value="1" checked onclick="ChgDis()">
Yes/是
<input type="radio" name="IsSel" value="0" onclick="ChgDis()">
No/否</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td height="19" nowrap><div align="right"><span class="lan">
Non Cash Item/</span><br>
非現金項目</div></td>
<td height="19" colspan="3" nowrap><div align="left">
<select name="Bonus_Item" onChange="ChgItem()" >
<option value=" " > </option>
<% for(int i=0;i<Bonus_Item_table.rowSize();i++){ %>
<option value="<%=Bonus_Item_table.out(i,"ITEM_ID")+"|"+Bonus_Item_table.out(i,"ITEM_VALUE")%>"><%=Bonus_Item_table.out(i,"ITEM_DESC")%></option>
<% } %>
</select>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center">
<tr>
<td>
<select name="RecordCount" size="1" class="input">
<option value="1">ONE/一筆</option>
<option value="5">FIVE/五筆</option>
<option value="10">TEN/十筆</option>
</select>
<input type="button" name="ADD" value="Add/新增" class="text" onClick="addMulRecord()">
<span class="text">
<input name="SELECT_ALL" type="button" class="text" value="Select all/全選" onclick = "SelAll_1('OT_ID_',form1.MAX_Record_Count.value,CHECKALL_FLAG);CHECKALL_FLAG=!CHECKALL_FLAG;" >
</span>

<input type="button" name="DEL" value="Delete/刪除" class="text" onClick="DelSelRecord()" >
<input type="button" name="Submit3" value="產生Merit Bonus 記錄" class="text" onClick="Save()" >
<input type="hidden" name="RECORD_TABLE_INNERHTML">
<input type="hidden" name="CASH" value="Y">
<!--
<input type="hidden" name="CC">
-->
<input type='hidden' name = 'CONFIRM_FLAG'>
<input type='hidden' name ="MAX_Record_Count" value="0">
<input type='hidden' name="EMP_NAME_EN">
<input type="hidden" name="Q_PersonInfo"> <input type="hidden" name="Q_PersonInfo_Index">
<td class="text11" align="left">
<a href="menu.jsp" target="mainFrame">回到主畫面</a>  
</td>

</td>
</tr>
</table>
<table id="RECORD_TABLE" bordercolor=#AFA089 style="BORDER-COLLAPSE: collapse" width="100%" border="1" cellspacing="1" cellpadding="0" align="CENTER">
<%if(request.getParameter("RECORD_TABLE_INNERHTML")!=null&&!request.getParameter("RECORD_TABLE_INNERHTML").trim().equals("")){
//System.out.println(request.getParameter("RECORD_TABLE_INNERHTML"));
out.println(request.getParameter("RECORD_TABLE_INNERHTML"));
}else{
%>
<tr class="t1">
<td nowrap> <div align="CENTER" class="text"><span class="lan">Delete</span><br>
刪除</div></td>
<td nowrap> <div align="center" class="text"><span class="lan">Passive
Emp No/</span><BR>
被申請者員工工號
<input type="button" name="Search33" value=" ... " class="btton" onclick="SelMulEmployeeNew(form1.MAX_Record_Count.value,'EMP_NO_','NAME_','EMP_NAME_EN_','COUNTRY_','DEPT_CODE_','DEPT_NAME_','COST_CENTER_','','','','','AREA_CODE_')" >

</div>
</td>
<td nowrap> <div align="CENTER" class="text"><span class="lan">Name
</span><br>
英文姓名</div></td>
<td nowrap> <div align="CENTER" class="text"><span class="lan">Name
</span><br>
中文姓名</div></td>
<td nowrap> <div align="CENTER" class="text"><span class="lan">Amount/
</span><br>
金額</div></td>
<td nowrap> <div align="CENTER" class="text"><span class="lan">Non Cash Item/
</span><br>
非現金項目</div></td>
<!--
<td colspan="2" nowrap> <div align="CENTER" class="text"><span class="lan">Department
code/desc </span><br>
部門代碼/名稱</div></td>
-->
<td nowrap> <div align="center" class="text"><span class="lan">Cash
Or None Cash</span><br>
是否發放現金</div></td>
<td nowrap> <div align="CENTER" class="text"><span class="lan">Cost
Center </span> <br>
成本中心代碼<br>
</div></td>
<%if(power==employee.HR_DIR) {%>
<td nowrap> <div align="CENTER" class="text"><span class="lan">Site Mgr </span></div></td>
<%}%>

</tr>
<%}%>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
malarfno 2007-03-06
  • 打赏
  • 举报
回复
<SCRIPT language="JavaScript" src="cdate-picker.js"></SCRIPT>
<html>
<head>
<title>Merit Bonus Request MERIT BONUS 批次申請作業</title> <meta http-equiv="Content-Type" content="text/html; charset=big5">
<link rel="stylesheet" href="cs.css" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000" vlink="0" alink="0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="afterLoad()">
<form name="form1" method="post" action="">
<table bordercolordark=#ffffff bordercolorlight=#a4947a width="99%" cellspacing="1" cellpadding="1" height="100%" border="1" bordercolor="#a4947a" align="center" bgcolor="#FFFFFF">
<tr>
<td valign="top">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" height="37">
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#c6bcb1" align="center" class="bluetitle">
<tr>
<td class="chTitle" height="25"><strong><span class="enTitle">Merit
Bonus Request</span></strong><b><br>
<span class="enTitle">Merit Bonus</span>
申請作業</b></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<table bordercolor=#AFA089 style="BORDER-COLLAPSE: collapse" width="100%" border="1" cellspacing="1" cellpadding="2" align="center" height="114">

<tr>
<td class="t2">
<table nowrap width="100%" border="0" cellspacing="0" cellpadding="2" class="text" align="center">
<tr>
<td>
<div align="right"><span class="lan">Direct Employee/Indirect Employee</span><br>
直接員工/閒接員工</div>
</td>
<td>
<select name="DIR_INDIR" class="input">
<option value="0"> </option>
<option value="2">Direct Employee/直接員工
</option>
<option value="1">
Indirect Employee/閒接員工
</option>
</select>
</td>

</tr>
<tr>
<td nowrap> <div align="right"><span class="lan">Emp
No/Name</span><br>
員工工號/姓名(<font color="#FF3300">*</font>)</div>
</td>
<td nowrap>
<input type="text" name="EMP_NO" size="8" class="input" <%=emp.getPower()>1?"":"readonly"%> onBlur="form1.Q_PersonInfo.value='1';form1.RECORD_TABLE_INNERHTML.value = document.all('RECORD_TABLE').innerHTML;form1.submit();">
<input type="text" name="EMP_NAME" size="16" class="input" <%=emp.getPower()>1?"":"readonly"%>>
<input type="button" name="Search322" value=" ... " class="btton" onclick="SelUnitmb1(form1.EMP_NO,form1.EMP_NAME);" <%=emp.getPower()>1?"":"disabled='true'"%>>
</td>
<td nowrap>  
<!--<div align="right"><span class="lan">Cost
Center/Desc</span><br>
成本中心代碼(<font color="#FF3300">*</font>)</div>
-->
</td>
<td nowrap> 

<input type="hidden" name="COST_CENTER" >
<!--<input type="text" name="CC" size="16" class="input" > -->

</td>

</tr>
<tr>
<td nowrap> <div align="right"><span class="lan">Request
Date</span><br>
申請日期<span class="lan"></span>(<font color="#FF3300">*</font>)</div></td>
<td nowrap> <div align="left">
<input type="text" name="REQ_DATE" size="12" class="input">
<input type="button" name="Search2" value=" ... " class="btton" onClick="setday(this,'form1.REQ_DATE');" >
</div></td>
<td height="19" nowrap> </td>
<td height="19" nowrap> </td>
</tr>
<!--
<tr>
<td nowrap> <div align="right"><span class="lan">Dept
code/desc</span><br>
部門代碼/部門名稱</div></td>
<td nowrap> <div align="left">
-->
<input type="hidden" name="DEPT_CODE" size="11" class="input" <%=emp.getPower()>1?"":"readonly"%>>
<input type="hidden" name="DEPT_DESC" size="30" class="input" <%=emp.getPower()>1?"":"readonly"%>>
<input type="hidden" name="AREA_CODE" size="30" class="input" <%=emp.getPower()>1?"":"readonly"%>>
<!-- </div></td>
<td nowrap><div align="right"><span class="lan">Country</span><br>
國家</div></td>
<td nowrap>
-->
<input type="hidden" name="COUNTRY" size="11" class="input" ></td>
<!--
</tr>
-->
<tr>
<td height="19" nowrap><div align="right"><span class="lan">Request
Subject/</span><br>申請主題(<font color="#FF3300">*</font>)</div></td>
<td height="19" colspan="3" nowrap><div align="left">
<input name="REQ_SUBJECT" type="text" class="input" size="50" maxlength="60">
</div></td>
</tr>
malarfno 2007-03-06
  • 打赏
  • 举报
回复
String dept="select t.email from personnel_basic t where t.no in "
+"("
+ "select distinct t.dept_mgr from dept t where code ="
+ "("
+"select t.dept_code from personnel_basic t where t.no='"+empno+"'"
+ ")"
+")";
String candb="select t.email from personnel_basic t where t.no in "
+"("
+ "select distinct t.apva_emp from approval_kind t where t.code like '%HR%C&B%' and area_code ="
+ "("
+"select t.area_code from personnel_basic t where t.no='"+empno+"'"
+ ")"
+")";
String hr_dir="select t.email from personnel_basic t where t.no in "
+"(select distinct t.apva_emp from approval_kind t where t.code like '%HR%DIR%' and area_code ="
+ "("
+"select t.area_code from personnel_basic t where t.no='"+empno+"'"
+ ")"
+")";

String emailSQL="";
//System.out.println("level=="+level);
if(level==0) emailSQL=cc;
else if(level==1) {
if(canddsame==true) emailSQL=candb;
else emailSQL=dept;
}
else if(level==2) emailSQL=candb;
else if(level==3) emailSQL=hr_dir;
else if(level==4&&request.getParameter("SITE_MGR_"+i)!=null) emailSQL="select t.email from personnel_basic t where t.no='"+request.getParameter("SITE_MGR_"+i)+"' ";

if(emailSQL.length()!=0){
DataTable mailTable=new DataTable();
mailTable.load(con,emailSQL);
EMail mailer=new EMail();
mailer.setHtmlFormat(true);
mailer.setFromAddr("apps");
mailer.setSubject("Merit Bonus申請案");
mailer.setMsg("<html><body>您有員工:"+empno+" Merit Bonus申請案待核准! 請上webapps核准!</body></html>");
for(int ii=0;ii<mailTable.rowSize();ii++)
{
String addr=mailTable.outB(ii,"email");
if(!addr.trim().equals("")){
mailer.addToAddr(addr);
System.out.println("toaddr="+addr);
}
mailer.sendMailMessage();
}
}
saveResultStr += "</p>";
}
}
}//for(int i=1;i<=MAX_Record_Count;i++){
releaseCon(con);
session.setAttribute("MSG",saveResultStr);
response.sendRedirect("OptFinish.jsp?MSG="+saveResultStr);
return;
}
Init_Ht.remove("CONFIRM_FLAG");
Init_Ht.remove("RECORD_TABLE_INNERHTML");
}else if(Q_PersonInfo.equals("")){
//設置初始化的值
String Country=null;
Country=emp.getInfo("COUNTRY").equals("")?"TI TAIWAN":emp.getInfo("COUNTRY");
Init_Ht.put("EMP_NO",emp.getPower()>1?"":emp.getInfo("no"));
Init_Ht.put("EMP_NAME",emp.getPower()>1?"":emp.getInfo("NAME_IN_CHINESE"));
Init_Ht.put("DEPT_CODE",emp.getPower()>1?"":emp.getInfo("DEPT_CODE"));
Init_Ht.put("DEPT_DESC",emp.getPower()>1?"":emp.getInfo("DEPT_NAME"));
Init_Ht.put("CC",emp.getPower()>1?"":emp.getInfo("COST_CENTER_NAME"));
Init_Ht.put("COST_CENTER",emp.getPower()>1?"":emp.getInfo("COST_CENTER"));
Init_Ht.put("REQ_DATE",getToday());
Init_Ht.put("COUNTRY",Country);
}

if(power==employee.HR_DIR) {
out.println("<script language=\"JavaScript\">");
int year=Calendar.getInstance().get(Calendar.YEAR);
String barSql="select dept_code,barge_amount from merit_bonus where year='"+year+"' ";
DataTable mTable=new DataTable();
mTable.load(con,barSql);
out.println("var deptArr=new Array();");
out.println("var barArr=new Array();");
for(int i=0;i<mTable.rowSize();i++){
out.println("deptArr["+i+"]="+mTable.outB(i,"dept_code")+";");
out.println("barArr["+i+"]="+mTable.outB(i,"barge_amount")+";");
}

//can not be sure about the requestee's area_code ,so have all the site_mgr
out.println("var areaArr=new Array();");
out.println("var nameArr=new Array();");
out.println("var noArr=new Array();");
String aSql="select a.no,nvl(a.name_in_chinese,a.name_in_english) name,b.area_code "
+" from personnel_basic a,approval_kind b where a.no=b.apva_emp and b.code like '%SITE%MGR%' order by a.no";
DataTable areaTable=new DataTable();
areaTable.load(con,aSql);
for(int i=0;i<areaTable.rowSize();i++)
{
String aCode=areaTable.outB(i,"area_code");
out.println("areaArr[areaArr.length]='"+aCode+"';");
String name=areaTable.outB(i,"name");
out.println("nameArr[nameArr.length]='"+name+"';");
String no=areaTable.outB(i,"no");
out.println("noArr[noArr.length]='"+no+"';");
/*
if(!aCode.trim().equals("")){
out.println("var opArr"+i+"=new Array();");
String cSql="select distinct a.no,nvl(a.name_in_chinese,a.name_in_english) name,b.area_code "
+" from personnel_basic a,approval_kind b where a.no=b.apva_emp and b.code like '%SITE%MGR%' order by a.no";
DataTable nameNoTable=new DataTable();
nameNoTable.load(con,cSql);
out.println("opArr"+i+"[0]=new Array('',0);");
for(int j=0;j<nameNoTable.rowSize();j++)
{
out.println("opArr"+i+"[opArr"+i+".length]=new Option('"+nameNoTable.outB(j,"name")+"','"+nameNoTable.outB(j,"no")+"') ;");
}
out.println("optionArr[optionArr.length]=opArr"+i+";");
}
*/
}
out.println("</script>");
}
releaseCon(con);
%>

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧