REC318_PHATRA.jsp 12.8 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
<%@ page import="com.csc.library.entry.*,com.csc.library.session.*,com.csc.library.system.*,com.csc.library.utilities.CheckNull,java.util.*,java.util.HashMap,com.csc.library.service.GenProcessQuque,com.csc.library.utilities.*"  contentType="text/html;charset=UTF-8"%>
<jsp:useBean id="REC701" scope="page" class="com.csc.library.system.Task"/>
<jsp:useBean id="REC701HELP" scope="page" class="com.csc.library.system.Task"/>
<jsp:setProperty name="REC701" property="appname" value="recruit" />
<jsp:setProperty name="REC701HELP" property="appname" value="recruit" />
<%
		REC701HELP.setChannel(request ,response);
		REC701.setChannel(request ,response);		
		HelpEntry screen=(HelpEntry) REC701HELP.process("HelpEntry","REC701HELP");		
		UIManager screen1=(UIManager) REC701.process("SingleEntry","REC701");		
		CheckNull chkNull = new CheckNull();		
		 if( chkNull.chkNullString(request.getParameter("__cmd")).equals("save")&&chkNull.chkNullString(request.getParameter("printrp")).equals("702")){
			 response.sendRedirect("REC702_PHATRA.jsp?__help=__applicantid$"+request.getParameter("__applicantid")+";__date_interview$"+request.getParameter("__date_interview")+";__interviewer$"+request.getParameter("__interviewer")+";__requestid$"+request.getParameter("__requestid"));
		}
		else if( chkNull.chkNullString(request.getParameter("__cmd")).equals("save") &&chkNull.chkNullString(request.getParameter("printrp")).equals("703")){
			response.sendRedirect("REC703_PHATRA.jsp?__help=asid"+request.getParameter("__applicantid")+";__date_interview$"+request.getParameter("__date_interview")+";__interviewer$"+request.getParameter("__interviewer")+";__requestid$"+request.getParameter("__requestid"));
		}
		screen.getInquiry().setFilter("requestid='"+chkNull.chkNullString(request.getParameter("__requestid"),request.getParameter("__requestid"))+"'");
		screen.getInquiry().setRequireFoundTable("MCANDIDATERE");
		screen.setMaxLine(-1);
		screen.process();
	
		
	DbInquiry inq = new InitialInquiry(screen.getUProfile()).getDbInquiry("mcommittee");
	DbInquiry emp = new InitialInquiry(screen.getUProfile()).getDbInquiry("memployee");
	inq.setColumn("employeeid,companyid,requestid");
	inq.setFilter("requestid='"+chkNull.chkNullString(request.getParameter("__requestid"))+"'");
	inq.putChild(emp);
	
	inq.refresh();	
	ArrayList reqList = new ArrayList();
	ArrayList nameList = new ArrayList();
	//String reqList="";
	while(inq.next()){
		//reqList = reqList+inq.getString("requestid")+",";
		reqList.add(inq.getString("employeeid"));
		nameList.add(inq.getString("memployee","fname"));
	}	
	
	//out.println("<br>filter :: " + screen.getInquiry().getFilter());
		
%>

<% //for CPN checkbox skip insert interview form
	if(request.getParameter("skipForm") != null && request.getParameter("skipForm").equals("1")){
		DbTable app = new InitialTable(screen.getUProfile()).getDbTable("MAPPOINTMENT");
		app.setColumn("REQUESTID,APPLICANTID,COMPANYID,INTERVIEWDATE,INTERVIEWSTATUS");
		DbTable can = new InitialTable(screen.getUProfile()).getDbTable("MCANDIDATERE");
		can.setColumn("APPLICANTID,REQUESTID,COMPANYID,CANDIDATESTATUS");
		try{
			 String[] tmp = chkNull.chkNullString(request.getParameter("__candList")).split("#");
			 for(int i=0; i<tmp.length ;i++){
				 if(!("").equals(tmp[i])){
					app.setFilter("requestid='"+ request.getParameter("__requestid")+"' and applicantid ='"+tmp[i]+"' and companyid='"+ screen.getUProfile().get("companyid")+"'");
					app.search();
					if(app.recCount()==1){
						DbRecord dbr_app = app.getCurrentRecordManager();
						dbr_app.set("INTERVIEWSTATUS", "1");
						dbr_app.save();
					}
					can.setFilter("requestid='"+ request.getParameter("__requestid")+"' and applicantid ='"+tmp[i]+"' and companyid='"+ screen.getUProfile().get("companyid")+"'");
					can.search();
					if(can.recCount()==1){
						DbRecord dbr_can =can.getRecordForSave();
						dbr_can.set("CANDIDATESTATUS", "3");
						dbr_can.save();
					}
				 }
			 }
			}catch(Exception e){ }
		}
			  %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../CSS/TISCO.css" rel="stylesheet" type="text/css">
<script type='text/javascript' src='../JS/SCREEN.js'></script>
<script type='text/javascript' src='../JS/RECSCREEN.js'></script>
<script language='javascript' src='../JS/HOTKEY.js'></script>
<script language='javascript' src='../JS/EMPLOYEE.js'></script>
<script language="javascript">setLang('<%=screen.getUProfile().get("lang")%>');</script>
<script language="javascript">getTitleName();</script>
<script type='text/javascript' src='../JS/ICONSMENU.js'></script>
<script src="../JS/VIEWCALENDAR.js"></script>
<script language="JavaScript">
function goView2(appid,date,intw,rid){
		with(document.cscform){
		__applicantid.value=appid;
			__date_interview.value=date;			
			__interviewer.value=intw;
		__confirm.value="s";
			__cmd.value = "save";
			target="_blank"
			printrp.value="703";
			//window.open("REC703.jsp?__help=__applicantid"+appid+"&__date_interview"+date+"&__interviewer"+intw+"&__requestid"+rid);
			submit(); 
		}
	}

function goView(appid,date,intw){
	 with(document.cscform){
		// alert(intw);
		bCon=confirm("ระบบจะบันทึกคะแนนแรกเริ่มทันที\n\n	ยืนยัน?");
		if (bCon==true)	{
			__applicantid.value=appid;
			__date_interview.value=date;			
			__interviewer.value=intw;
			__confirm.value="s";
			__cmd.value = "save";
			printrp.value="702";
			submit();
		}
	}	
}
function goView1(appid,date,intw){
	 with(document.cscform){
		// alert(intw);
		bCon=confirm("ต้องการแก้ไขคะแนน\n\n          ยืนยัน?");
		if (bCon==true)	{
			__applicantid.value=appid;
			__date_interview.value=date;			
			__interviewer.value=intw;
			__confirm.value="s";
			__cmd.value = "save";
			printrp.value="702";
			submit();
		}
	}	
}
	/*function goView(id){
			var pam="REC502.jsp?__help=__applicantid$"+id+"&__fixCon=applicantid='"+id+"'";	
		window.open(pam,"","left=150,top=150,width=600,height=400,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
}*/
function genForm(){
	with(document.cscform){
		genForm.value = '1';
		submit();
	}
}
   function goForm(apsassessy,apsassessor,apsid){
		var obj = document.getElementById("interviewers"+apsassessor).value;
		with(document.cscform){			
				window.open("../EMPVIEW/APS_EMV705_PHATRA.jsp?apsid="+apsid+"&apsassessor="+obj+
					"&apsassessy="+apsassessy+"&bpage="+__screen.value+"&ass_level=0&isread=0&appname=recruit&isadmin=1","form","left=150,top=150,width=800,height=800,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
		}
	}

	function goForm2(apsassessy,apsassessor,apsid){
		var obj = document.getElementById("interviewers"+apsassessor).value;
		with(document.cscform){			
				window.open("REC703_PHATRA.jsp?apsid="+apsid+"&apsassessor="+obj+
					"&apsassessy="+apsassessy+"&bpage="+__screen.value+"&ass_level=0&isread=0&appname=recruit&isadmin=1","form","left=150,top=150,width=1024%,height=768%,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
		}
	}


function saveSkipForm(){
	with(document.cscform){
		skipForm.value = '1';
		canlist = "";
		for(i=0;i<elements.length;i++){
			if(elements[i].type=="checkbox") {
				if(elements[i].checked==true){
					//alert(elements[i].name);
					var tmp = (elements[i].name).split("#");
					canlist += "#"+tmp[1];
				}
			}
		}
		__candList.value = canlist;
		//alert(__candList.value);
		submit();
	}
}
</script>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="">
 <form name="cscform" method="post" action="REC318_PHATRA.jsp">
	 

<!----------BEGIN CSC INITIAL ZONE ------------------------>

<%=screen.InitialVariable()%>

<!----------END CSC INITIAL ZONE -------------------------->

	  <input type="hidden"name="__screen"  value="REC701"> 
	  <input type="hidden" name="__help"  size="50" value="">
	  <input name="__fixCon" type="hidden" value="">
	  <input type="hidden" name="__cmd"  value="">
	  <input type="hidden" name="__companyid" value="<%=screen.getUProfile().get("companyid")%>"> 
   	  <input type="hidden" name="__interviewer" > 
	  <input type="hidden" name="__date_interview" value="">   
	  <input type="hidden" name="__applicantid" value="">      
	  <input type="hidden" name="__referPage" value="">
	  <input type="hidden" name="__notNull" value="">
      <input type="hidden" name="__requestid" value="<%=chkNull.chkNullString(request.getParameter("__requestid"),request.getParameter("__requestid"))%>">
	  <input type="hidden" name="printrp" value="">
	  <input type="hidden" name="skipForm" value="">
	  <input type="hidden" name="__candList" value="">

	 
	 <div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>

 <br>

		<table width="100%"  cellpadding="0" cellspacing="0" class="normal"  align="center">
		  <tr class="header"> 
			<td  class="header" align="right">REC318, 
			  <script language="javascript">swapLang('Edit Record Interview Score');</script></td>
		  </tr>
		
		  <tr > 
			<td colspan="2"> 

				  <table cellpadding="0"  cellspacing="0" class="maxsize" >
                                  <tr> 
                  <td><script language="javascript">swapLang('Requisition ID');</script>: <%=chkNull.chkNullString(request.getParameter("__requestid"),request.getParameter("__requestid"))%></td>
                </tr>
                <tr><td><script language="javascript">swapLang('Recorded-interview-score Applicant List');</script></td></tr>
                    <tr><td>
<table class="maxsize" border="0" align="center" cellpadding="0" cellspacing="2">
              <tr bgcolor="#3366CC">
                  <td width="50" align="center" nowrap class="row3">
                    <script language="JavaScript">swapLang('Sequence')</script>                  </td>
                <td align="center" nowrap class="row3">
                  <script language="JavaScript">swapLang('Applicant ID')</script>                </td>              
                  <td align="center" nowrap class="row3">
                    <script language="JavaScript">swapLang('Name')</script>
                    -
                    <script language="JavaScript">swapLang('Lastname')</script>                  </td>
                <td align="center" nowrap class="row3">
                  <script language="JavaScript">swapLang('Job')</script>                </td>
			  <td align="center" nowrap class="row3">
                  <script language="JavaScript">swapLang('Interview Date')</script>                </td>                  
			  <td align="center" nowrap class="row3">
                  <script language="JavaScript">swapLang('Interviewer')</script>                </td>                 
              </tr>
              <%
		int i=1;
    	while(screen.nextRec()){
			if(!screen.getDataLabel("INTERVIEWSTATUS").equals("")&&Integer.parseInt(screen.getDataLabel("INTERVIEWSTATUS"))==1&&Integer.parseInt(screen.getDataLabel("MCANDIDATERE","CANDIDATESTATUS"))!=8){ 
			%>
              <tr>
                <td align="center" nowrap><%=i%></td>                
                <td align="center" nowrap><a href="javascript:goForm('<%=screen.getDataLabel("APPLICANTID") %>','<%=i%>','<%=screen.getDataLabel("MREQUEST","INTERVIEWFORM") %>');"><%=screen.getDataLabel("APPLICANTID") %></a> : <a href="javascript:goForm2('<%=screen.getDataLabel("APPLICANTID") %>','<%=i%>','<%=screen.getDataLabel("MREQUEST","INTERVIEWFORM")%>');"><img src="../IMAGES/BUTTON/SWAP/PRINTER_SWAP20.gif" width="15" height="15"></a></td>
                <td align="center" nowrap><%=screen.getDataLabel("MAPPLICANT","FULLNAME") %></td>                
                <td align="center" nowrap><%=screen.getDataLabel("MAPPLICANT","JOBNAME").equals("")?screen.getDataLabel("MAPPLICANT","FREETEXTJOB") :screen.getDataLabel("MAPPLICANT","JOBNAME") %></td>
                <td align="center" nowrap><%=screen.getDataLabel("INTERVIEWDATE") %></td>   
                <td align="center" nowrap>
				<select id="interviewers<%=i++%>" name="interviewers<%=i++%>">
                           <%for(int x=0;x<reqList.size();x++){%>                
                                 <option value="<%=reqList.get(x)%>"><%=reqList.get(x)%>&nbsp;<%=nameList.get(x)%></option>
                           <%}%>                
                </select>                
                </td>                
              </tr>
              <%
			}
		}
			%>
              <tr>
                <td colspan="9"></td>
              </tr>
			  <tr>
                <td colspan="9"></td>
              </tr>
			  <tr>
                <td colspan="9"></td>
              </tr>
            </table>
</td>
</tr>              
                                  
                  </table>
			</td>
		  </tr>
		  <tr bordercolor="0069B3">
		  <td  class="bottom"></td>
		</tr>
		</table>
<!----------BEGIN CSC ENDING ZONE ------------------------>

<%=screen.endJSP()%>

<!----------END CSC ENDING ZONE -------------------------->
</FORM>
</body>
</html>