<%-- 
    Document   : ResetLogin
    Created on : Jun 19, 2018, 5:18:08 PM
    Author     : 1004242
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<html>
    <head>
        <title>Reset Login Status</title>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="${pageContext.request.contextPath}/js/Calendar.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/TableCSSCode.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <link rel="shortcut icon" href="${pageContext.request.contextPath}/img/favicon.ico?pacs=<%=((new java.util.Date()).getTime())%>" type="image/x-icon" />
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/styles.css?pacs=<%=((new java.util.Date()).getTime())%>"/>
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/InputBoxStyle.css?pacs=<%=((new java.util.Date()).getTime())%>"/>
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/ButtonAndText.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/info.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-ui-1.10.4.custom/development-bundle/jquery-1.10.2.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <script type="text/javascript" src="/PacsApplication/chromejs/chrome.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <script type="text/javascript" src="/PacsApplication/js/iFrame_killer.js"></script>
         <%
             String error_msg = "";
             Object error = request.getAttribute("error");
             if (error != null) {
                 error_msg = error.toString();%>

            <% }

        %>

         <script type="text/javascript">
            function noBack()
            {
                window.history.forward();
            }
            function resetLoginFromDb(resetLogin)
            {
                if(document.getElementById("userId").value!=undefined && document.getElementById("userId").value!="")
                {
                    document.forms[0].action='/PacsApplication/resetLoginServlet';
                    resetLogin.submit();
                }
                else
                {
                    alert('User id field cant be blank');
                    document.getElementById("userId").focus();
                    return false;
                }
            }
            
            // to restrict back button
            history.pushState(null, null, location.href);
            window.addEventListener('popstate', function(event) {
                history.pushState(null, null, location.href);
            });

        </script>


    </head>
    <body >
        <%
                    String ModuleName = new String();

                    ModuleName = (String) session.getAttribute("moduleName");
                    String role = (String) session.getAttribute("userRole");
                    String pacsId = (String) session.getAttribute("pacsId");
                    
        %>
        <% if (ModuleName.equalsIgnoreCase("KCC")) {%>
        <jsp:include page="/MenuHead.jsp" flush="true" />
        <%} else if (ModuleName.equalsIgnoreCase("pds")) {%>
        <jsp:include page="/Pds_JSP/MenuHead_PDS.jsp" flush="true" />
        <%} else if (ModuleName.equalsIgnoreCase("trading")) {%>
        <jsp:include page="/Trading_JSP/MenuHead_TRADING.jsp" flush="true" />
        <%} else if (ModuleName.equalsIgnoreCase("asset")) {%>
        <jsp:include page="/Asset_JSP/MenuHead_ASSET.jsp" flush="true" />
        <%} else if (ModuleName.equalsIgnoreCase("governance")) {%>
        <jsp:include page="/GPS_JSP/MenuHead_GPS.jsp" flush="true" />
        <%} else if (ModuleName.equalsIgnoreCase("dashboard")) {%>
        <jsp:include page="MenuHead_DASHBOARD.jsp" flush="true" />
        <%} else if (ModuleName.equalsIgnoreCase("shg")) {%>
        <jsp:include page="/Shg_JSP/MenuHead_SHG.jsp" flush="true" />
        <%} else if (ModuleName.equalsIgnoreCase("Deposit")) {%>
        <jsp:include page="/Deposit/MenuHead_Deposit.jsp" flush="true" />
        <%} else if (ModuleName.equalsIgnoreCase("Loan")) {%>
        <jsp:include page="/Loan/MenuHead_Loan.jsp" flush="true" />
        <%} else if (ModuleName.equalsIgnoreCase("eod")) {%>
        <jsp:include page="MenuHead_EOD.jsp" flush="true" />
        <%} else if (ModuleName.equalsIgnoreCase("dds")) {%>
        <jsp:include page="/DDS/MenuHead_DDS.jsp" flush="true" />
        <%} else if (ModuleName.equalsIgnoreCase("share")) {%>
        <jsp:include page="/Share_Module/MenuHead_Share.jsp" flush="true" />
        <%}else if (ModuleName.equalsIgnoreCase("Special")) {%>
        <jsp:include page="/Deposit/MenuHead_Deposit.jsp" flush="true" />
        <%}else if (ModuleName.equalsIgnoreCase("SpecialKcc")) {%>
        <jsp:include page="/MenuHead.jsp" flush="true" />
        <%}else if (ModuleName.equalsIgnoreCase("SpecialBoth")) {%>
        <jsp:include page="/Deposit/MenuHead_Deposit.jsp" flush="true" />
        <%}else if (ModuleName.equalsIgnoreCase("SpecialBothKcc")) {%>
        <jsp:include page="/MenuHead.jsp" flush="true" />
        <%}else if (ModuleName.equalsIgnoreCase("SpecialBothDep")) {%>
        <jsp:include page="/Deposit/MenuHead_Deposit.jsp" flush="true" />
        <%}%>
        <br>

        <center>
            <div id="resetLoginId" style="display:block;">
<!--            <fieldset style="border-color: black; background-image: url('/PacsApplication/img/download.jpg'); border-width: 3px">-->
            <fieldset style="border-radius: 20px; border-color: rgb(177, 224, 178); border-width: 2px; margin-left: 75px;margin-right: 75px;">
            <div><p><font face="Trebuchet MS" color="#0000FF" size="5">Use this feature in case of account gets locked due to inappropriate logout procedure.</font></p></div>
            <br>
            <form name="resetLogin" method="post" action="resetLoginSevlet">
                <table border="0" cellspacing="1" cellpadding="2">
                    <tbody>

                        <tr>
                            <td align="left">Enter User Id:</td>
                            <td align="left"><input type="text" name="userName" id="userId" /></td>
                        </tr>
                       
                        <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td colspan="2" align="right">
                                <input type="button" value="Force Logout" onclick="javascript:resetLoginFromDb(resetLogin)"/>
                               
                            </td>
                        </tr>
                    </tbody>
                </table>
                <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="red" ><b><%= error_msg%> </b></font><br>
            </form>
            </fieldset>
           </div>
        </center>
    </body>
</html>

