CHANGE_PWD.jsp 6.83 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
<jsp:useBean id="task" scope="page" class="com.csc.library.system.Task"/>
<%@ page import="com.csc.library.entry.*,com.csc.library.utilities.*,com.csc.library.session.*" contentType="text/html; charset=UTF-8"%>
<%
    CheckNull chk = new CheckNull();

    task.setChannel(request ,response);
    UiManager screen;
    screen=(UiManager)task.process("SingleEntry","change_pwd");


    String strUser_id = screen.getUProfile().get("pwemployee");
    String strPassword = screen.getUProfile().get("password");

	screen.getRecord("pwemployee").set("pwemployee",strUser_id);
    screen.getRecord("pwemployee").search();
 
	String ack="";
    if((request.getParameter("__ack")!=null)&&((request.getParameter("__ack").equals("ack")))){
	ack="ack";
    }
%>
<html>
<head>
<title>Budget Management</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../CSS/TEXT_FONT.css" type="text/css">
</head>
<script language="JavaScript" src="../JS/IMAGE.js"></script>
<script language="javascript" src="../JS/SCREEN.js"></script>
<script language="javascript" src="../JS/MISC.js"></script>
<script src="../JS/HOTKEY.js"></script>
<script language="javascript">setLang('<%=screen.getUProfile().get("lang")%>');</script>

<SCRIPT LANGUAGE="JavaScript">
<!--
function showHelp(){
  with(document.cscform){
   window.open("./help/change_pwd.htm","Doc","left=150,top=150,width=700,height=500,toolbar=no,status=no,scrollbars=yes,resizable=yes");
  }
}
function chkPasswd(){
    with(document.cscform){
        if(Trim(__pwpassword.value) != Trim(__confirm.value)){
	    alert("password and confirm password must be the same");
	    return false;
	}
	return true;
    }
}

function initDoc(){
    setDisabled();
	return;
}

function resetForm(){
    setEmpty();
//    setEnabled();
}

function setEmpty(){
    with(document.cscform){
        __pwpassword.value = "";
        __confirm.value = "";
    }
}

function setEnabled(){
    with(document.cscform){
        __pwusername.disabled = false;
    }
}

function setDisabled(){
    with(document.cscform){
        __pwusername.disabled = true;
    }
}

function setFocus(obj){
    obj.focus();
}

function setSelect(obj){
    obj.select();
}

function saveForm(){
	with(document.cscform){
	        if(Trim(__pwpassword.value)==""){
				alert("กรุณากรอกรหัสผ่าน");
			}else if(Trim(__confirm.value)==""){
				alert("กรุณายืนยันรหัสผ่าน");
			}else{
	        bCon=confirm("ต้องการบันทึกข้อมูลหรือไม่ ?");
    if(chkPasswd()){
            if (bCon==true)	{
        		setEnabled();
				document.cscform.__pwpassword.value = Trim(document.cscform.__pwpassword.value);
				__cmd.value="save";
				submit();
//		        save();
		}
    } else {
        setSelect(document.cscform.__confirm);
        setFocus(document.cscform.__confirm);
    }
	}
	}
}

//-->
</script>

<body leftMargin=0 topMargin=0 MarginHeight="0" marginWidth="0" onload="initDoc()">
<br>
<form name="cscform" method="post" action="">


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

<%=screen.InitialVariable()%>

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

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
	  <td valign="top" width="78%">
        <table width="70%" border="0" align="center"cellpadding="0" cellspacing="0">
          <tr>
            <td width="3%"><img SRC="../IMAGES/TABLE_TOP_LEFT.gif" width="31" height="30"></td>
            <td nowrap width="92%" bgcolor="#1D95E2" align="center"><b>เปลี่ยนรหัสผ่าน</b></td>
            <td width="5%"><img SRC="../IMAGES/TABLE_TOP_RIGHT.gif" width="31" height="30"></td>
          </tr>
          <tr bgcolor="#1D95E2">
            <td colspan="3">
              <table width="100%" border="0" bgcolor="#1D95E2">
                <tr>
                  <td bgcolor="#FFFFFF">
                    <table width="80%" border="0" align="center" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0">
                      <tr>
                        <td colspan="2" valign="baseline"><font  size="2"><b>login name</b></font></td>
                        <td colspan="2" width="58%" valign="middle"><%=screen.getInput("pwusername")%>
                        </td>
                      </tr>
                      <tr>
                        <td colspan="2" valign="baseline"><font  size="2"><b>รหัสผ่าน</b></font></td>
                        <td colspan="2" width="58%" valign="middle"><%=screen.getInput("pwpassword")%>
                        </td>
                      </tr>
                      <tr>
                        <td colspan="2" valign="baseline"><font  size="2"><b>ยืนยันรหัสผ่าน</b></font></td>
                        <td colspan="2" width="58%" valign="middle">
                          <input type="password" name="__confirm" size="10" maxlength="10">
                        </td>
                      </tr>
                    </table>
                    <br>
                    <table width="50%" border="0" align="center">
                      <tr>
                        <td>
                          <div align="center">
                            <a href="javascript:saveForm();"><img  alt="บันทึกข้อมูล" border=0 name="ImageSave" SRC="../IMAGES/POOM_SAVE.gif" width="32" height="32"></a><a href="javascript:resetForm();"><img  alt="เคลียร์ฟอร์ม" name="ImageCancel" border=0 SRC="../IMAGES/POOM_CANCEL.gif" width="32" height="32"></a>
                          </div>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td width="3%"><img SRC="../IMAGES/TABLE_BOTTOM_LEFT.gif" width="31" height="30"></td>
            <td width="92%" bgcolor="#E1E1E1">&nbsp;</td>
            <td width="5%"><img SRC="../IMAGES/TABLE_BOTTOM_RIGHT.gif" width="31" height="30"></td>
          </tr>
        </table>
        <input type="hidden" name="__cmd">
	<input type="hidden" name="__id" value="<%=request.getParameter("__id")%>">
	<input type="hidden" name="__screen" value="change_pwd">
	<input type="hidden" name="__user_id" value="<%=screen.getRecord("pwemployee").getString("pwemployee")%>">
	<input type="hidden" name="__fname" value="<%=screen.getRecord("pwemployee").getString("pwfname")%>">
	<input type="hidden" name="__lname" value="<%=screen.getRecord("pwemployee").getString("pwlname")%>">
	<input type="hidden" name="__pwgroupid" value="<%=screen.getRecord("pwemployee").getString("pwgroup")%>">
	 <input type="hidden" name="__language" value ="<%=screen.getUProfile().get("lang")%>"> 
	<input type="hidden" name="__jspname" value="change_pwd">
	</td>
    </tr>
</table>
</form>
</body>
</html>