<%--
    Document   : gl
    Created on : Aug 3, 2015, 2:23:35 PM
    Author     : Administrator
--%>
<%@page import="DataEntryBean.ShareAccountCreationBean"%>
<% try {
%>
<html>
    <head>
        <title>Share value</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/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>
    </head>
    <body  onload="noBack()">
        <script type="text/javascript">
            function noBack()
            {
                window.history.forward();
            }

            function submitform(sharevalForm)
            {
                if (checkCreateDiv(sharevalForm))
                {
                    document.forms[0].handle_id.value = "Update";
                    document.forms[0].action = "/PacsApplication/ShareValueCreationServlet";
                    document.forms[0].submit();
                }

            }

            function checkCreateDiv(sharevalForm)
            {
                //alert("entering");
                if (sharevalForm.productCodeDetails.value == "")
                {
                    alert("!! Share A/C no field must be filled !!");
                    sharevalForm.productCodeDetails.focus();
                    return false;
                }
    

                if (sharevalForm.shareval.value == "")
                {
                    alert("!! Share Value must be filled !!");
                    sharevalForm.shareval.focus();
                    return false;
               
        
                }
                return true;
            }




            function Total(){

                var sharevalue = document.getElementById("shareval").value;
                var shareamount = document.getElementById("shareamt").value;

                document.getElementById("shareno").value=shareamount/sharevalue;

            }

            function popup_productCode(width, height, productCodeDetails) {
                if (window.innerWidth) {
                    LeftPosition = (window.innerWidth - width) / 2;
                    TopPosition = ((window.innerHeight - height) / 2) - 20;
                }
                else {
                    LeftPosition = (parseInt(window.screen.width) - width) / 2;
                    TopPosition = ((parseInt(window.screen.height) - height) / 2) - 20;
                }
                attr = 'resizable=yes,scrollbars=yes,width=' + width + ',height=' +
                    height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
                    TopPosition + '';
                var screenName = "DepositAccountCreation.jsp";
                var  lovKey="productCodeShare"
                popWin = open('/PacsApplication/CommonSearchInformationDepositLOV.jsp?productCodeDetails=' + productCodeDetails + '&screenName=' + screenName+'&lovKey='+lovKey, 'productCodeShare', attr);
                popWin.focus();

            }

            // to restrict back button
            history.pushState(null, null, location.href);
            window.addEventListener('popstate', function(event) {
                history.pushState(null, null, location.href);
            });

        </script>
        <%          int count = 1;
                    String error_msg = "";
                    Object error = request.getAttribute("message");
                    if (error != null) {
                        error_msg = error.toString();
                    }
        %>


        <jsp:include page="MenuHead_Share.jsp" flush="true" />
        <br>
        <%!
            String blankNull(String s) {
                return (s == null) ? "" : s;
            }
        %>

        <%
                    Object ShareAccountCreationBeanObj = request.getAttribute("ShareAccountCreationBeanObj");
                    ShareAccountCreationBean oShareAccountCreationBean = new ShareAccountCreationBean();
                    if (ShareAccountCreationBeanObj != null) {
                        oShareAccountCreationBean = (ShareAccountCreationBean) request.getAttribute("ShareAccountCreationBeanObj");

                    }
        %>


        <fieldset style="border-color: black; background-image: url('/PacsApplication/img/download.jpg'); border-width: 3px">
            <legend style="padding: 8px; border-radius: 20px; background-color: #006600; color: white">SHARE VALUE CREATION</legend>

            <form name="sharevalForm" method="post" action="">

                <%if (!error_msg.equalsIgnoreCase("")) {%>
                <center><div class="info" id="errorMessage"><center><%= error_msg%></center></div></center>
                <% }%>
                <br>
                <br>


                <br>

                <div id="create" >
                    <table class="NumbersOnly">
                        <tbody>

                            <tr>
                                <td>Account Type: </td>
                                <td> <input type="text" name="productCodeDetails" id="productCodeDetails" onkeypress="return isNumber();"/></td>
                                <td><input type="button" name="productCodeSearch" id="productCodeSearch" value="Search" onclick="javascript:popup_productCode(420, 280, document.sharevalForm.productCodeDetails.value);"/></td>
                            </tr>
                            
                            <tr>
                                <td>Share Value:</td>
                                <td><input  name="shareval"  id="shareval"  value=""/></td>
                            </tr>
                            <tr>
                                <td>Percentage to be deducted:</td>
                                <td><input  name="sharepercent"  id="sharepercent"  value=""/>%</td>
                            </tr>
                            <tr>
                                <td>Percentage of Dividend:</td>
                                <td><input  name="divpercent"  id="divpercent"  value=""/>%</td>
                            </tr>

                      </tbody>
                    </table>

                    <tr><td><br></td></tr>
                    <tr><td><br></td></tr>
                    <tr><td><label style="font-weight:  normal;">All fields are mandatory</label></td></tr>

                    <center>
                        <input type="button" value="Submit" onclick="javascript:submitform(sharevalForm)">
                        <input type="reset" value="Reset" name="reset" />
                    </center>
                </div>

                <input type="hidden" name="handle_id" value="" />


            </form>
        </fieldset>
    </body>
    <script>

                $('table.NumbersOnly').on('keydown','#sharepercent','#shareval', function(event) {
        if (event.shiftKey == true) {
            event.preventDefault();
        }

        if ((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 96 && event.keyCode <= 105) || event.keyCode == 8  || event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 46 || event.keyCode == 190 || event.keyCode == 110) {

        } else {
            event.preventDefault();
        }
        if($(this).val().indexOf('.') !== -1 && (event.keyCode == 190 || event.keyCode == 110))
        { event.preventDefault();}
    });
            </script>
</html>
<% 	} catch (Exception e) {
                
            }
%>





