CONFIG_GOHELP.jsp 13.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
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="com.csc.library.entry.HelpEntry,com.csc.library.system.*,com.csc.library.utilities.*"%>
<%@page import="com.csc.library.entry.*,com.csc.library.database.*,com.csc.library.session.*,com.csc.library.report.ReportUDF"%>
<jsp:useBean id="CONFIG_GOHELP" class="com.csc.library.system.Task" scope="page"/>
<%
	CONFIG_GOHELP.setChannel(request, response);
	UIManager screen = (UIManager) CONFIG_GOHELP.process("SingleEntry", "CONFIG_GOHELP");
	CheckNull chk = CheckNull.getInstance();
	String cmd = request.getParameter("__cmd");

	String mainid = "1";
	if(cmd == null){
		screen.getRecord("CONFIG_GOHELP").set("CONFIG_ID", mainid);
		screen.getRecord("CONFIG_GOHELP").search();
	}

	String dis_branch = chk.chkNullString(request.getParameter("__dis_branch"),screen.getDataLabel("dis_branch"));
	String dis_bu1 = chk.chkNullString(request.getParameter("__dis_bu1"),screen.getDataLabel("dis_bu1"));
	String dis_bu2 = chk.chkNullString(request.getParameter("__dis_bu2"),screen.getDataLabel("dis_bu2"));
	String dis_bu3 = chk.chkNullString(request.getParameter("__dis_bu3"),screen.getDataLabel("dis_bu3"));
	String dis_bu4 = chk.chkNullString(request.getParameter("__dis_bu4"),screen.getDataLabel("dis_bu4"));
	String dis_bu5 = chk.chkNullString(request.getParameter("__dis_bu5"),screen.getDataLabel("dis_bu5"));
	String dis_position = chk.chkNullString(request.getParameter("__dis_position"),screen.getDataLabel("dis_position"));

	String req_branch = chk.chkNullString(request.getParameter("__req_branch"),screen.getDataLabel("req_branch"));
	String req_bu1 = chk.chkNullString(request.getParameter("__req_bu1"),screen.getDataLabel("req_bu1"));
	String req_bu2 = chk.chkNullString(request.getParameter("__req_bu2"),screen.getDataLabel("req_bu2"));
	String req_bu3 = chk.chkNullString(request.getParameter("__req_bu3"),screen.getDataLabel("req_bu3"));
	String req_bu4 = chk.chkNullString(request.getParameter("__req_bu4"),screen.getDataLabel("req_bu4"));
	String req_bu5 = chk.chkNullString(request.getParameter("__req_bu5"),screen.getDataLabel("req_bu5"));
	String req_position = chk.chkNullString(request.getParameter("__req_position"),screen.getDataLabel("req_position"));

	String last_bu = chk.chkNullString(request.getParameter("__last_bu"),screen.getDataLabel("last_bu"));

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html ng-app="myHR">
<head>
<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" src="../JS/HOTKEY.js"></script>
<script language="JavaScript" src="../JS/ICONSMENU.js"></script>
<script language="JavaScript" src="../JS/VIEWCALENDAR.js"></script>
<script src="../JS/angular-1.3.15/angular.js" type="text/javascript"></script>
<script src="../JS/ANGULAR/SCREEN_ANGULAR.js" type="text/javascript"></script>
<script src="../JS/jquery-1.11.2.js" type="text/javascript"></script>
<script language="javascript">setLang('<%=screen.getUProfile().get("lang")%>');</script>
<script language="javascript">getTitleName();</script>
<script language="javascript">
    var lang = '<%=screen.getUProfile().get("lang")%>';
	function GoUpdate(){ update(); }
	function GoDelete(){ edelete(); }
	function GoSearch(){ search(); }
	function GoSave(){ setDataCheckbox(); confirmSave(); }

	$(document).ready(function(){
		var cmd = '<%=cmd%>';
		if (cmd !== null && cmd !== "save") {
			changelastbu();
		}
		setCheckbox();

		function setCheckbox(){
			$('input[name=__dis_branch]').val() === "1" ? $('#dis_branch').prop("checked",true) : $('#dis_branch').prop("checked",false) ;
			$('input[name=__dis_bu1]').val() === "1" ? $('#dis_bu1').prop("checked",true) : $('#dis_bu1').prop("checked",false) ;
			$('input[name=__dis_bu2]').val() === "1" ? $('#dis_bu2').prop("checked",true) : $('#dis_bu2').prop("checked",false) ;
			$('input[name=__dis_bu3]').val() === "1" ? $('#dis_bu3').prop("checked",true) : $('#dis_bu3').prop("checked",false) ;
			$('input[name=__dis_bu4]').val() === "1" ? $('#dis_bu4').prop("checked",true) : $('#dis_bu4').prop("checked",false) ;
			$('input[name=__dis_bu5]').val() === "1" ? $('#dis_bu5').prop("checked",true) : $('#dis_bu5').prop("checked",false) ;
			$('input[name=__dis_position]').val() === "1" ? $('#dis_position').prop("checked",true) : $('#dis_position').prop("checked",false) ;

			//$('input[name=__req_branch]').val() === "1" ? $('#req_branch').prop("checked",true) : $('#req_branch').prop("checked",false) ;
			$('input[name=__req_bu1]').val() === "1" ? $('#req_bu1').prop("checked",true) : $('#req_bu1').prop("checked",false) ;
			$('input[name=__req_bu2]').val() === "1" ? $('#req_bu2').prop("checked",true) : $('#req_bu2').prop("checked",false) ;
			$('input[name=__req_bu3]').val() === "1" ? $('#req_bu3').prop("checked",true) : $('#req_bu3').prop("checked",false) ;
			$('input[name=__req_bu4]').val() === "1" ? $('#req_bu4').prop("checked",true) : $('#req_bu4').prop("checked",false) ;
			$('input[name=__req_bu5]').val() === "1" ? $('#req_bu5').prop("checked",true) : $('#req_bu5').prop("checked",false) ;
			//$('input[name=__req_position]').val() === "1" ? $('#req_position').prop("checked",true) : $('#req_position').prop("checked",false) ;
		}
	});

	function setDataCheckbox(){
		$('#dis_branch').prop("checked") ? $('input[name=__dis_branch]').val("1") : $('input[name=__dis_branch]').val("") ;
		$('#dis_bu1').prop("checked") ? $('input[name=__dis_bu1]').val("1") : $('input[name=__dis_bu1]').val("") ;
		$('#dis_bu2').prop("checked") ? $('input[name=__dis_bu2]').val("1") : $('input[name=__dis_bu2]').val("") ;
		$('#dis_bu3').prop("checked") ? $('input[name=__dis_bu3]').val("1") : $('input[name=__dis_bu3]').val("") ;
		$('#dis_bu4').prop("checked") ? $('input[name=__dis_bu4]').val("1") : $('input[name=__dis_bu4]').val("") ;
		$('#dis_bu5').prop("checked") ? $('input[name=__dis_bu5]').val("1") : $('input[name=__dis_bu5]').val("") ;
		$('#dis_position').prop("checked") ? $('input[name=__dis_position]').val("1") : $('input[name=__dis_position]').val("") ;

		$('#req_branch').prop("checked") ? $('input[name=__req_branch]').val("1") : $('input[name=__req_branch]').val("") ;
		$('#req_bu1').prop("checked") ? $('input[name=__req_bu1]').val("1") : $('input[name=__req_bu1]').val("") ;
		$('#req_bu2').prop("checked") ? $('input[name=__req_bu2]').val("1") : $('input[name=__req_bu2]').val("") ;
		$('#req_bu3').prop("checked") ? $('input[name=__req_bu3]').val("1") : $('input[name=__req_bu3]').val("") ;
		$('#req_bu4').prop("checked") ? $('input[name=__req_bu4]').val("1") : $('input[name=__req_bu4]').val("") ;
		$('#req_bu5').prop("checked") ? $('input[name=__req_bu5]').val("1") : $('input[name=__req_bu5]').val("") ;
		$('#req_position').prop("checked") ? $('input[name=__req_position]').val("1") : $('input[name=__req_position]').val("") ;
	}

	function changelastbu(){
		var lastbu = $('#last_bu').val();
		var numbu = lastbu.replace("BU","");
		for(var i=1; i <= 5; i++){
			var name_radio = "input[name=__bu" + i + "]:radio";
			var idname_dis = "#dis_bu" + i;
			var idname_req = "#req_bu" + i;
			if(i > numbu){
				$(name_radio).prop("disabled",true).filter('[value="0"]').prop("checked",true);
				$(idname_dis).prop("disabled",true).prop("checked",true);
				$(idname_req).prop("disabled",true).prop("checked",false);
			} else {
				$(name_radio).prop("disabled",false).filter('[value="1"]').prop("checked",true);
				$(idname_dis).prop("disabled",false);
				$(idname_req).prop("disabled",false);
			}
		}
	}

</script>
</head>
<body leftmargin="0" topmargin="0"  >
<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
<div class="centered">
<script language="javascript">initToolTips();</script>
<form name="cscform" method="post" action="?">
	<!----------BEGIN CSC INITIAL ZONE ------------------------>
	<%=screen.InitialVariable()%>
	<!----------END CSC INITIAL ZONE -------------------------->
	<input type="hidden"name="__screen"  value="CONFIG_GOHELP">
	<input type="hidden" name="__help" value="">
	<input type="hidden" name="__fixCon" value="">
	<input type="hidden" name="__cmd"  value="">
	<input type="hidden" name="__notNull" value="<%=screen.getRequire()%>">
	<input type="hidden" name="__language" value='<%=screen.getUProfile().get("lang")%>'>
	<input type="hidden" name="__companyid" value="<%=screen.getUProfile().get("companyid")%>">
	<input type="hidden" name="__referPage" value="">
	<input type="hidden" name="__config_id" value='<%=mainid%>'>

	<input type="hidden" name="__dis_branch" value='<%=dis_branch%>'>
	<input type="hidden" name="__dis_bu1" value='<%=dis_bu1%>'>
	<input type="hidden" name="__dis_bu2" value='<%=dis_bu2%>'>
	<input type="hidden" name="__dis_bu3" value='<%=dis_bu3%>'>
	<input type="hidden" name="__dis_bu4" value='<%=dis_bu4%>'>
	<input type="hidden" name="__dis_bu5" value='<%=dis_bu5%>'>
	<input type="hidden" name="__dis_position" value='<%=dis_position%>'>

	<input type="hidden" name="__req_branch" value='<%=req_branch%>'>
	<input type="hidden" name="__req_bu1" value='<%=req_bu1%>'>
	<input type="hidden" name="__req_bu2" value='<%=req_bu2%>'>
	<input type="hidden" name="__req_bu3" value='<%=req_bu3%>'>
	<input type="hidden" name="__req_bu4" value='<%=req_bu4%>'>
	<input type="hidden" name="__req_bu5" value='<%=req_bu5%>'>
	<input type="hidden" name="__req_position" value='<%=req_position%>'>
	<div align="center">
		<script language="JavaScript" src="../JS/HOTKEY.js"></script>
		<script language="javascript">
			var titlename = new swaplang().swap2String("SW012514");
			document.write(Icons("CONFIG_GOHELP, "+titlename));
		</script>
		<br>
		<table border="0" cellpadding="0" cellspacing="0">
	        <tr>
				<td class="header" colspan="2"> CONFIG_GOHELP, <span swlang code="SW012514">Gohelp Config</span>&nbsp; </td>
	        </tr>
	        <tr>
	          	<td class="blankspace" colspan="2"></td>
	        </tr>
	        <tr>
				<td class="columnlabel"><%=screen.getLabel("LAST_BU") %>&nbsp;:&nbsp;</td>
				<td>
					<select name="__last_bu" id="last_bu" onchange="changelastbu();">
						<option value="BU1" <%if(last_bu.equalsIgnoreCase("BU1")){%>selected<%}%>><%=screen.getLabel("BU1") %></option>
						<option value="BU2" <%if(last_bu.equalsIgnoreCase("BU2")){%>selected<%}%>><%=screen.getLabel("BU2") %></option>
						<option value="BU3" <%if(last_bu.equalsIgnoreCase("BU3")){%>selected<%}%>><%=screen.getLabel("BU3") %></option>
						<option value="BU4" <%if(last_bu.equalsIgnoreCase("BU4")){%>selected<%}%>><%=screen.getLabel("BU4") %></option>
						<option value="BU5" <%if(last_bu.equalsIgnoreCase("BU5") || last_bu.equalsIgnoreCase("")){%>selected<%}%>><%=screen.getLabel("BU5") %></option>
					</select>
				</td>
	        </tr>
	        <tr>
				<td class="columnlabel"><%=screen.getLabel("BRANCH") %>&nbsp;:&nbsp;</td>
				<td>
					[&nbsp;<span swlang code="SW011916">Relationship</span>&nbsp;<%=screen.getInput("BRANCH") %>]
					[&nbsp;<input type="checkbox" value="branch" id="dis_branch" class="chkdis">&nbsp;Disable&nbsp;]
					[&nbsp;<input type="checkbox" value="branch" id="req_branch" class="chkreq" checked disabled>&nbsp;Require Field&nbsp;]
				</td>
	        </tr>
	        <tr>
				<td class="columnlabel"><%=screen.getLabel("BU1") %>&nbsp;:&nbsp;</td>
				<td>
					[&nbsp;<span swlang code="SW011916">Relationship</span>&nbsp;<%=screen.getInput("BU1") %>]
					[&nbsp;<input type="checkbox" value="bu1" id="dis_bu1" class="chkdis">&nbsp;Disable&nbsp;]
					[&nbsp;<input type="checkbox" value="bu1" id="req_bu1" class="chkreq">&nbsp;Require Field&nbsp;]
				</td>
	        </tr>
	        <tr>
				<td class="columnlabel"><%=screen.getLabel("BU2") %>&nbsp;:&nbsp;</td>
				<td>
					[&nbsp;<span swlang code="SW011916">Relationship</span>&nbsp;<%=screen.getInput("BU2") %>]
					[&nbsp;<input type="checkbox" value="bu2" id="dis_bu2" class="chkdis">&nbsp;Disable&nbsp;]
					[&nbsp;<input type="checkbox" value="bu2" id="req_bu2" class="chkreq">&nbsp;Require Field&nbsp;]
				</td>
	        </tr>
	        <tr>
				<td class="columnlabel"><%=screen.getLabel("BU3") %>&nbsp;:&nbsp;</td>
				<td>
					[&nbsp;<span swlang code="SW011916">Relationship</span>&nbsp;<%=screen.getInput("BU3") %>]
					[&nbsp;<input type="checkbox" value="bu3" id="dis_bu3" class="chkdis">&nbsp;Disable&nbsp;]
					[&nbsp;<input type="checkbox" value="bu3" id="req_bu3" class="chkreq">&nbsp;Require Field&nbsp;]
				</td>
	        </tr>
	        <tr>
				<td class="columnlabel"><%=screen.getLabel("BU4") %>&nbsp;:&nbsp;</td>
				<td>
					[&nbsp;<span swlang code="SW011916">Relationship</span>&nbsp;<%=screen.getInput("BU4") %>]
					[&nbsp;<input type="checkbox" value="bu4" id="dis_bu4" class="chkdis">&nbsp;Disable&nbsp;]
					[&nbsp;<input type="checkbox" value="bu4" id="req_bu4" class="chkreq">&nbsp;Require Field&nbsp;]
				</td>
	        </tr>
	        <tr>
				<td class="columnlabel"><%=screen.getLabel("BU5") %>&nbsp;:&nbsp;</td>
				<td>
					[&nbsp;<span swlang code="SW011916">Relationship</span>&nbsp;<%=screen.getInput("BU5") %>]
					[&nbsp;<input type="checkbox" value="bu5" id="dis_bu5" class="chkdis">&nbsp;Disable&nbsp;]
					[&nbsp;<input type="checkbox" value="bu5" id="req_bu5" class="chkreq">&nbsp;Require Field&nbsp;]
				</td>
	        </tr>
	        <tr>
				<td class="columnlabel"><%=screen.getLabel("POSITION") %>&nbsp;:&nbsp;</td>
				<td>
					[&nbsp;<span swlang code="SW011916">Relationship</span>&nbsp;<%=screen.getInput("POSITION") %>]
					[&nbsp;<input type="checkbox" value="position" id="dis_position" class="chkdis">&nbsp;Disable&nbsp;]
					[&nbsp;<input type="checkbox" value="position" id="req_position" class="chkreq" checked disabled>&nbsp;Require Field&nbsp;]
				</td>
	        </tr>
	        <tr>
				<td class="blankspace" colspan="2"></td>
	        </tr>
	        <tr>
				<td class="bottom" colspan="2"></td>
	        </tr>
      	</table>
    </div>
    <!----------BEGIN CSC ENDING ZONE ------------------------>
    <%=screen.endJSP()%>
    <!----------END CSC ENDING ZONE -------------------------->
</FORM>
</div>
</body>
</html>