INDEX-CPN.jsp 8.74 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@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.*,org.jdom.*,java.util.*"  %>
<%session.invalidate();%>
<%
      InitialEnvironment en = new InitialEnvironment("GLOBAL");
       Element root=en.getRootElement();
       List list = root.getChildren("DATABASE");
       List listchild=null;
       Iterator it = list.iterator();
       Iterator it2=null;
       Element em=null,emchild=null;
       String nodename="",companyid="",display="",dbname="",option="",selected="";
       if(it.hasNext()){
          em=(Element)it.next();
             listchild=em.getChildren();
             it2=listchild.iterator();
             while(it2.hasNext()){
                    emchild=(Element)it2.next();
                    nodename=emchild.getName();
                    if((String.valueOf(nodename.charAt(0))).equalsIgnoreCase("D")&&(String.valueOf(nodename.charAt(1))).equalsIgnoreCase("B")&&!nodename.equalsIgnoreCase("DBLIST")){
                        companyid=emchild.getAttributeValue("companyid");
                        display=emchild.getAttributeValue("display");
                        dbname=emchild.getAttributeValue("name");
                        selected=(emchild.getAttributeValue("default")!=null)?"selected":"";
                        //out.println(nodename+" "+dbname+"  "+display+" "+companyid+"<br>");
                        if(companyid!=null&& display!=null )
                            option+="<option value=\""+nodename+"-"+companyid+"\" "+selected+">"+display+"</option>";
                        else
                            option+="<option >"+dbname+"</option>";
                    }
             }
       }
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HR Information Center</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<style type="text/css">
<!--
	* { margin: 0; padding: 0; }
	img { border: 0; }
	html, body { height:100%; min-height: 100%; }
	body{ background: url(IMAGES/EMPVIEW/BG1.gif); }
	#wrapper { margin: 0 auto; height: 100%; }
	#content { width: 805px; margin: auto; }
	#table_login { margin: auto; }
	#table_login td { font-family: Tahoma; font-size: 13px; font-weight: bold; color: #fff; }
	span#th, span#en{ margin-right: 0 10px 0 0; }
	.column-label { padding: 5px 20px 5px 5px; text-align: right; }
	.column-input { padding: 5px10px 5px 0; }
	.username, .password { color: #333333;vertical-align: middle;width: 150px;border: 1px solid #666;  }
	.username { background: #FFFFFF url(IMAGES/EMPVIEW/ICONS/USER16.gif) no-repeat 3px center !important; padding: 2px 2px 2px 20px;}
	.password { background: #FFFFFF url(IMAGES/EMPVIEW/ICONS/LOCK16.gif) no-repeat 3px center !important; padding: 2px 2px 2px 20px;}
	.button-line { text-align: center; margin: 0 auto; }
	#dbcom { padding: 2px;color: #333; min-width: 174px; vertical-align: middle;border: 1px solid #666; }
.style1 {color: #0000FF}
.style2 {color: #229cc3}
-->
</style>
<script language="JavaScript" type="text/javascript" src="JS/AC_RunActiveContent.js"></script>
<script language="JavaScript" type="text/JavaScript"><!--
	function getCheckedValue(radioObj) {
		var radioLength = radioObj.length;
		if(radioLength == undefined) {
			if(radioObj.checked) {
				return radioObj.value;
			}
		} else {
			for(var i = 0; i < radioLength; i++) {
				if(radioObj[i].checked) {
					return radioObj[i].value;
				}
			}
		}
		return "";
	}
	function recruit(){
		with(document.cscform){
			action="RECLOGIN.jsp";
			__cmd.value="login";
			submit();
		}
	}
	function isagency(){
	  with(document.cscform){
		   action="LOGIN";
		  __cmd.value="login";
		  if( __user.value !="" && __password !=""){
			  if(__isagent.checked==true){
				   __agencyid.value=prompt("กรุณาใส่รหัสพนักงานของท่านเอง","");
				   __agencyname.value=prompt("กรุณาใส่ Username ของท่านเอง","");
			  }
			  return true;
		 }
	  }
	  return false;
	}
	function clear(){
		with(document.cscform){
			 reset();
		}
	}
//--></script>
</head>

<body onLoad="document.cscform.__user.focus()">
<table id="wrapper" width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td>
    <form name="cscform" method="post" action="LOGIN" onsubmit="return isagency();" autocomplete="off">
        <input type="hidden" name="__cmd" value="" />
        <input type="hidden" name="__agencyname" value="" />
        <input type="hidden" name="__agencyid" value="" />


    <div id="content">
        <div class="flash">
           
          
        </div>
        <div>
           <table id="Table_01" width="800" height="600" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td rowspan="3">
			<img src="IMAGES/login-cpn_01.jpg" width="55" height="600" alt=""></td>
		<td>
			<img src="IMAGES/login_02.jpg" width="405" height="217" alt=""></td>
		<td rowspan="3">
			<img src="IMAGES/login-cpn_03.jpg" width="120" height="600" alt=""></td>
		<td rowspan="3">
			<img src="IMAGES/login-cpn_04.jpg" width="124" height="600" alt=""></td>
		<td rowspan="3">
			<img src="IMAGES/login-cpn_05.jpg" width="96" height="600" alt=""></td>
	</tr>
	<tr>
		<td>
			
            <table id="table_login" width="100%" height="270" border="0" cellpadding="2" cellspacing="0" bgcolor="#FFFFFF">
                     <tr>
                        <td colspan="2">&nbsp;</td>
                      </tr>
                      
                      <tr>
                        <td width="150" class="column-label"><label for="dbcom"><span class="style2">Database :</span></label></td>
                        <td class="column-input"><select name="__dbcomp" id="dbcom">
                          <%=option%>
                        </select></td>
                      </tr>
                      <tr>
                        <td class="column-label"><label for="username"><span class="style2">Username :</span></label></td>
                        <td class="column-input"><input type="text" name="__user" id="username" class="username" size="20" maxlength="20" autocomplete="off" /></td>
                      </tr>
                      <tr>
                        <td class="column-label"><label for="password"><span class="style2">Password :</span></label></td>
                        <td class="column-input"><input type="password" name="__password" id="password" class="password" size="20" maxlength="20" autocomplete="off" /></td>
                      </tr>
                      <tr>
                        <td class="column-label"><label><span class="style2">Language :</span></label></td>
                        <td class="column-input">
                            <span id="th"><input name="__lang" id="lang_th" type="radio" value="THA" checked="checked" />&nbsp;<label for="lang_th"><span class="style2">Thai</span></label></span>&nbsp;&nbsp;
                            <span id="en"><input name="__lang" id="lang_en" type="radio" value="ENG" />&nbsp;<label for="lang_en"><span class="style2">English</span></label></span></td>
                      </tr>
                      <tr>
                        <td class="column-label">&nbsp;</td>
                        <td class="column-input"><input type="checkbox" name="__isagent" id="isagent" value="1" />&nbsp;<label for="isagent"><span class="style2">ทำงานแทน</span></label></td>
                      </tr>
                      <tr>
                        <td colspan="2">&nbsp;</td>
                      </tr>
                      <tr>
                        <td colspan="2"><div class="button-line">
                        <input name="login" type="image" src="IMAGES/EMPVIEW/BUTTON/OK.gif" />
                       <a href="javascript:clear();"><img src="IMAGES/EMPVIEW/BUTTON/CANCEL.gif" alt="Cancel" width="60" height="23" /></a>

                       <!-- ส่วนนี้ต้องเปลี่ยนวิธีการLoginใหม่ ใช้แบบนี้ชั่วคราวไปก่อน -->
                       <a href="javascript:recruit();"><img src="IMAGES/EMPVIEW/BUTTON/RECRUIT.gif" alt="Recruitment" width="100" height="23" /></a>
                        <!-- ///// -->

                     </div>                     </td>
                      </tr>
                    </table>
            
            </td>
	</tr>
	<tr>
		<td>
			<img src="IMAGES/login_07.jpg" width="405" height="113" alt=""></td>
	</tr>
</table>
          </div>
          
      </div>
    </form>
    </td>
  </tr>
</table>
</body>
</html>