<%--
    Document   : dividendpayout
    Created on : Aug 3, 2015, 2:23:35 PM
    Author     : Administrator
--%>
<%@page import="DataEntryBean.ShareAccountCreationBean"%>
<% try {
%>
<html>
    <head>
        <title>Dividend Payout</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())%>" />
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/InputBoxStyle.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(shareform)
            {
                if (checkCreateDiv(shareform))
                {
                    document.forms[0].handle_id.value = "Update";
                    document.forms[0].action = "/PacsApplication/ShareDividentpayoutServlet";
                    document.forms[0].submit();
                }
            }

            function checkCreateDiv(shareform)
            {
                if (shareform.shareNo.value == "")
                {
                    alert("Share Account number must be filled.");
                    shareform.shareNo.focus();
                    return false;
                }
                if (shareform.accNo.value == "")
                {
                    alert("Savings Account number field must be filled.");
                    shareform.accNo.focus();
                    return false;
                }
                if (shareform.shareamt.value == "")
                {
                    alert("Please search the Share A/C to get the available balance and divident amount.");
                    shareform.shareamt.focus();
                    return false;
                }
                if (shareform.divamt.value == "")
                {
                    alert("Please search the Share A/C to get the available balance and divident amount.");
                    shareform.divamt.focus();
                    return false;
                }
                if (shareform.narration.value == "")
                {
                    alert("Please enter the narration for the transaction.");
                    shareform.narration.focus();
                    return false;
                }
                
                return true;
            }

            function ShowParent()
            {
                document.forms[0].action="${pageContext.request.contextPath}/Share_Module/dividendpayout.jsp";
                document.forms[0].submit();
            }

            function Total(){

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

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

            }

            function search_product(width, height, shareAcc) {

                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 = "dividendpayout.jsp";
                var lovKey = "shareAccount"
                popWin = open('/PacsApplication/CommonSearchInformationDepositLOV.jsp?shareAcc=' + shareAcc + '&screenName=' + screenName + '&lovKey=' + lovKey, 'shareAccount', attr);
                popWin.focus();

            }
            function search_dep(width, height,shareNo) {

                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 = "shareOperations.jsp";
                var lovKey = "depositAccount"
                popWin = open('/PacsApplication/CommonSearchInformationDepositLOV.jsp?shareNo=' + shareNo + '&screenName=' + screenName + '&lovKey=' + lovKey, 'depositAccount', 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");

                    }
        %>


        <%--changed on 26/4/24<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">Dividend Payout</legend>--%>
        <fieldset style="border-radius: 20px; border-color: rgb(177, 224, 178); border-width: 2px; margin-left: 75px;margin-right: 75px;">
            <legend style="margin-left: 40px; width:130px; padding: 8px; border-radius: 18px; background-color: rgb(177, 224, 178); color: rgb(0, 140, 69)"><b>Dividend Payout</b></legend>
            <form name="shareform" method="post" action="">

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

                <div id="create" >
                    <center>
                    <table class="NumbersOnly">
                        <tbody>
                            <tr>
<!--                                added border-radius on 29/4/24-->
                                <td>Share Account Number<font color="red" >*</font>: </td>
                                <td> <input type="text"  name="shareNo" id="shareNo" style="text-align:right;" onkeypress='return event.charCode >= 48 && event.charCode <= 57' /></td>
                                <td> <input type="button" value="Search" onclick="javascript:search_product(820, 180,document.shareform.shareNo.value)"/></td>
                            </tr>
                            <tr>
                                <td>Saving Account No<font color="red" >*</font>: </td>
                                <td> <input type="text"  name="accNo" id="accNo" style="text-align:right;" onkeypress='return event.charCode >= 48 && event.charCode <= 57' /></td>
                                <td> <input type="button" value="Search" onclick="javascript:search_dep(820, 180,document.shareform.shareNo.value)"/></td>
                            </tr>                        
                            <tr>
                                <td>Available Share Balance<font color="red" >*</font>: </td>
                                <td><input  name="shareamt"  id="shareamt"  readonly value="" style="text-align:right;" /></td>
                            </tr>
                            <tr>
                                <td>Divident Amount<font color="red" >*</font>: </td>
                                <td><input  name="divamt"  id="divamt"  readonly value="" style="text-align:right;" /></td>
                            </tr>
                            <tr>
                            <td>Narration<font color="red" >*</font>: </td>
<!--                            style added on 29/4/24-->
                            <td><textarea size="12" name="narration" id="narration" style="border-radius: 15px; width: 181px; height: 72px;"></textarea> </td>
                        </tr>
                      </tbody>
                    </table>
                    </center>
                    <tr><td><br></td></tr>
                    <tr><td><br></td></tr>
                    <tr><td>
                            <br>
                            <label style="font-weight:  normal;padding-left: 300px"><font color="red" >*</font>All fields are mandatory.</label></td></tr>
                   
                    <center>
                        <input type="button" value="Submit" onclick="javascript:submitform(shareform)">
                        <input type="reset" value="Reset" name="reset"  onclick="ShowParent();"/>
                    </center>
                </div>

                <input type="hidden" name="handle_id" value="" />
            </form>
        </fieldset>
    </body>
    <script>

                $('table.NumbersOnly').on('keydown','#unit,#unit_price', 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) {
               
            }
%>

