RCR023_EXP.jsp 10.9 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="com.csc.library.entry.*,com.csc.library.system.*,com.csc.library.session.*,com.csc.library.utilities.*,java.text.DecimalFormat"%>
<%@ page import="java.util.*,java.io.*,java.sql.*"%>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Locale" %>
<%@ page import="java.util.Date" %>
<%@ page import="com.csc.library.components.*" %>
<%@ page import="com.csc.library.report.ReportUDF" %>
<%@ page import="com.csc.api.recruit.*" %>
<%@ page import="com.csc.library.databean.Simmcandidatewithgson" %>
<%@ page import="com.csc.library.databean.Simmappointmentwithgson" %>
<%@ page import="com.csc.library.databean.Simmapplicanthisotherwithgson" %>
<%@ page import="com.csc.library.utilities.gsonmapping.*" %>
<%
	response.setHeader("Cache-Control","must-revalidate");
	response.setContentType("application/vnd.ms-excel; UTF-8");
	response.setHeader("Content-Disposition", "inline; filename=" + "export.xls");

	CheckNull chk = new CheckNull();
	CscCalendar c = new CscCalendar();
	ReportUDF udf = new ReportUDF();
	UProfile up = null;

	if (session !=null){
		up = (UProfile)session.getAttribute("userprofile");
	}

	String lang = up.get("lang");
	String filter = chk.chkNullString(request.getParameter("__filter"));
	String cmd = chk.chkNullString(request.getParameter("__cmd"));

	DbRecord dbrec = new InitialRecord(up).getDbRecord("memployee");
	dbrec.setColumn("*");
%>

<html>
	<head>
		<title></title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<!-- <link href="../CSS/TISCO.css" rel="stylesheet" type="text/css"> -->
		<script language="JavaScript" src="../JS/SCREEN.js"></script>
		<script language="javascript">setLang('<%=up.get("lang")%>');</script>

		<style>
			img[height="20"] {
				padding: 0px;
			}
			.center{
				text-align: center;
			}
			.wd-40{
				width:40%;
			}
		</style>
	</head>
	<%
		String helpReturn="";
		if(request.getParameter("__helpReturn")!=null){
		  helpReturn=request.getParameter("__helpReturn");
		}
		String fieldSearch="";
		if(request.getParameter("__fieldSearch")!=null){
		  fieldSearch=request.getParameter("__fieldSearch");
		}
	%>
	<body leftmargin="0" topmargin="0">
		<form name="cscform" method="post" action="RCR023.jsp">
			<!----------BEGIN CSC INITIAL ZONE ------------------------>
			<%//=screen.InitialVariable()%>
			<!----------END CSC INITIAL ZONE -------------------------->
			<input type="hidden" name="__cmd" value="">
			<input type="hidden" name="__screen" value="RCR023">
			<input type="hidden" name="__help" value="">
			<input type="hidden" name="__goPage" value="">
			<input type="hidden" name="__language" value="<%=up.get("lang")%>">
			<input type="hidden" name="__orderBy" value="<%=request.getParameter("__orderBy")%>">
			<input type="hidden" name="__helpReturn" value="<%=helpReturn%>">
			<input type="hidden" name="__fieldSearch" value="<%=fieldSearch%>">
			<input type="hidden" name="__helpName" value="<%=request.getParameter("__helpName")%>">
			<input type="hidden" name="__pageCall" value="<%=request.getParameter("__screen")%>">
			<input type="hidden" name="__fixCon" value="<%=request.getParameter("__fixCon")%>">
			<input type="hidden" name="__export" value="">
			<input type="hidden" name="__filter" value="<%=filter%>">

			<input type="hidden" name="__calendar" value="">
			<script language="javascript">getInputFormatDate()</script>
			<br>
			<table class="maxsize table table-bordered " border="1" cellpadding="0" cellspacing="1" cols=10 >
				</tr>
					<td class="row1 center" colspan='11'>รายงานสรุปผลการสมัครงาน</td>
				</tr>
				<tr>
					<td class="row1 center">ตำแหน่งที่ประกาศ</td>
					<td class="row1 center">ประวัติผู้สมัคร</td>
					<td class="row1 center">แหล่งที่มา</td>
					<td class="row1 center">วันที่ส่งใบสมัคร</td>
					<td class="row1 center">สถานะ</td>
					<td class="row1 center">วันที่นัดสัมภาษณ์</td>
					<td class="row1 center">คะแนนสอบ</td>
					<td class="row1 center">ผู้สัมภาษณ์</td>
					<td class="row1 center">ผลการสัมภาษณ์</td>
					<td class="row1 center">ผลการนัดเริ่มงาน</td>
					<td class="row1 center">วันที่เริ่มงาน</td>
				</tr>
				<%
					// >>>>>>>>>>>>  Current Zone  <<<<<<<<<<<<

					String committees = "";
					String isappointmentTH = "";
					String isappointmentEN = "";
					String dateinterview = "";
					String dateavailable = "";
					DbInquiry inqpre = new InitialInquiry(up).getDbInquiry("mprefix");
					DbInquiry inqcan = new InitialInquiry(up).getDbInquiry("Simmcandidatewithgson");
					DbInquiry inqpoint = new InitialInquiry(up).getDbInquiry("Simmappointmentwithgson");
					DbInquiry inqjob = new InitialInquiry(up).getDbInquiry("mjobcode");
					DbInquiry inqsourcejob = new InitialInquiry(up).getDbInquiry("msourcejob");
					DbInquiry inqcom = new InitialInquiry(up).getDbInquiry("mcommittee");
					DbInquiry inqemp = new InitialInquiry(up).getDbInquiry("memployee");
					DbInquiry inqstat = new InitialInquiry(up).getDbInquiry("mstatus");

					inqcan.setColumn("*");

					inqcom.putChild(inqemp);

					inqcan.putChild(inqjob);
					inqcan.putChild(inqpoint);
					inqcan.putChild(inqstat);

					inqcan.setFilter(filter);
					inqcan.refresh();

					while(inqcan.next()){
						committees = "";
						Simmcandidatewithgson simmcandidatewithgson = (Simmcandidatewithgson) inqcan.getCurrentDbRecord();
						Simmappointmentwithgson simmappointmentwithgson = (Simmappointmentwithgson) inqpoint.getCurrentDbRecord();

						inqpre.setFilter("prefixid = '"+simmcandidatewithgson.mcandidatePersonal.prefixid+"'");
						inqpre.refresh();
						inqpre.next();

						inqsourcejob.setFilter("sourcejobid = '"+simmcandidatewithgson.mcandidateOther.sourcejob+"'");
						inqsourcejob.refresh();
						inqsourcejob.next();

						if(simmappointmentwithgson.mappointmentdetail != null){
							dateinterview =  c.setCscCalendar(simmappointmentwithgson.mappointmentdetail.date).getDDMMYYYY();
							isappointmentTH = "มีการนัดหมายแล้ว";
							isappointmentEN = "Have an appointment";
						}else{
							dateinterview = "";
							isappointmentTH = "ยังไม่มีการนัดหมาย";
							isappointmentEN = "No appointments";
						}
						if(simmcandidatewithgson.mcandidatePersonal != null){
							dateavailable =  c.setCscCalendar((simmcandidatewithgson.mcandidatePersonal.dateavailable).substring(0,10)).getDDMMYYYY();
						}else{
							dateavailable = "";
						}

						inqcom.setFilter("requestid = '"+inqpoint.getString("requestid")+"'");
						inqcom.refresh();
						while(inqcom.next()){
							if(committees.equals("")){
								committees = inqcom.getString("MEMPLOYEE","fullname");
							}else{
								committees += ", "+inqcom.getString("MEMPLOYEE","fullname");
							}
						}
				%>
				<tr>
					<td class='center'><%=inqcan.getString("mjobcode","tdesc")%></td>
					<td class='center'><%=inqpre.getString("tdesc")+simmcandidatewithgson.mcandidatePersonal.fname.tha+" "+simmcandidatewithgson.mcandidatePersonal.lname.tha%></td>
					<td class='center'><%=inqsourcejob.getString("tdesc")%></td>
					<td class='center'><%=c.setCscCalendar(inqcan.getString("APPLICANTDATE")).getDDMMYYYY()%></td> 
					<td class='center'><%=lang.equalsIgnoreCase("tha")?isappointmentTH:isappointmentEN%></td> 
					<td class='center'><%=dateinterview%></td>
					<td class='center'></td> 		<!--รอ Ma Jung-->
					<td class='center'><%=committees%></td>
					<td class='center'><%=inqcan.getString("mstatus","tdesc")%></td> 	
					<td class='center'></td>
					<td class='center'></td> 	
				</tr>
				<%
					}
					
					// >>>>>>>>>>>>  History Zone  <<<<<<<<<<<<

					DbInquiry inqapphis = new InitialInquiry(up).getDbInquiry("Simmapplicanthisotherwithgson");
					DbInquiry inqemp2 = new InitialInquiry(up).getDbInquiry("memployee");

					inqemp2.setColumn("*");

					inqapphis.putChild(inqjob);
					inqapphis.putChild(inqpoint);
					inqapphis.putChild(inqemp2);
					inqapphis.putChild(inqstat);
					inqcom.putChild(inqemp);
					
					inqapphis.setColumn("*");
					inqapphis.setFilter(filter);
					inqapphis.refresh();
					while(inqapphis.next()){
						Simmapplicanthisotherwithgson simmapplicanthisotherwithgson = (Simmapplicanthisotherwithgson) inqapphis.getCurrentDbRecord();
						Simmappointmentwithgson simmappointmentwithgson = (Simmappointmentwithgson) inqpoint.getCurrentDbRecord();

						inqpre.setFilter("prefixid = '"+simmapplicanthisotherwithgson.mapplicanthisPersonal.prefixid+"'");
						inqpre.refresh();
						inqpre.next();

						inqsourcejob.setFilter("sourcejobid = '"+simmapplicanthisotherwithgson.mapplicanthisother.sourcejob+"'");
						inqsourcejob.refresh();
						inqsourcejob.next();

						if(simmappointmentwithgson.mappointmentdetail != null){
							dateinterview = c.setCscCalendar(simmappointmentwithgson.mappointmentdetail.date).getDDMMYYYY();
							isappointmentTH = "มีการนัดหมายแล้ว";
							isappointmentEN = "Have an appointment";
						}else{
							dateinterview = "";
							isappointmentTH = "ยังไม่มีการนัดหมาย";
							isappointmentEN = "No appointments";
						}

						inqcom.setFilter("requestid = '"+inqpoint.getString("requestid")+"'");
						inqcom.refresh();
						while(inqcom.next()){
							if(committees.equals("")){
								committees = inqcom.getString("MEMPLOYEE","fullname");
							}else{
								committees += ", "+inqcom.getString("MEMPLOYEE","fullname");
							}
						}
						if(inqapphis.isFirst()){
				%>
				<tr>
					<td colspan='11'>ประวัติ</td>
				</tr>
				<%
						}
				%>
				<tr>
					<td class='center'><%=inqapphis.getString("mjobcode","tdesc")%></td>
					<td class='center'><%=inqpre.getString("tdesc")+simmapplicanthisotherwithgson.mapplicanthisPersonal.fname.tha+" "+simmapplicanthisotherwithgson.mapplicanthisPersonal.lname.tha%></td>
					<td class='center'><%=inqsourcejob.getString("tdesc")%></td>
					<td class='center'><%=c.setCscCalendar(inqapphis.getString("APPLICANTDATE")).getDDMMYYYY()%></td>
					<td class='center'><%=lang.equalsIgnoreCase("tha")?isappointmentTH:isappointmentEN%></td> 
					<td class='center'><%=dateinterview%></td>
					<td class='center'></td> 		<!--รอ Ma Jung-->
					<td class='center'><%=committees%></td>
					<td class='center'><%=inqapphis.getString("mstatus","tdesc")%></td> 
					<td class='center'><%=inqapphis.getString("employeeid").equals("0")?inqapphis.getString("remark"):"ยืนยัน"%></td> 	
					<td class='center'><%=inqapphis.getString("employeeid").equals("0")?"":c.setCscCalendar(inqemp2.getString("startdate")).getDDMMYYYY()%></td>
				</tr>
				<%
					}
				%>
			</table>
		</form>
	</body>
</html>