<%-- 
    Document   : CashWithdrawlDeposit
    Created on : Jul 11, 2018, 5:40:14 PM
    Author     : 1004242
--%>

<%@page import="LoginDb.DbHandler"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.util.ArrayList"%>
<%@page import="DataEntryBean.EnquiryBean"%>
<%@page import="java.util.Date"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>




<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/TableCSSCode.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <title>DDS OPERATIONS</title>
       <%-- <link rel="shortcut icon" href="img/favicon.ico?pacs=<%=((new java.util.Date()).getTime())%>" type="image/x-icon" />--%>
        <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="/PacsApplication/chromejs/chrome.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <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/js/iFrame_killer.js"></script>
        <script type="text/javascript" src="/PacsApplication/bootstrap/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="/PacsApplication/bootstrap/js/bootstrap.js"></script>
        <link rel="stylesheet" type="text/css" href="/PacsApplication/bootstrap/css/bootstrap.min.css" />
        <link rel="stylesheet" type="text/css" href="/PacsApplication/bootstrap/css/bootstrap.css" />
</head>

<script>

            function noBack()
            {
               
                window.history.forward();
            }

        function popup_depAccount(width, height, accNo,trnType) {
            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 = "CashWidrawlDeposit.jsp";
            var lovKey = "ddsCash";
            var searchFlag = "false";
            if (!accNo=="")
            searchFlag=/^[a-z]+$/i.test(accNo);
            popWin = open('${pageContext.request.contextPath}/CommonSearchInfoLOVNew.jsp?accountNo=' + accNo + '&screenName=' + screenName + '&lovKey=' + lovKey+ '&trnType=' + trnType + '&sflag=' + searchFlag, 'ddsCash', attr);
            popWin.focus();

        }

        
            function checkDiv(cashForm)
            {

                if (cashForm.amnt.value == "" || cashForm.amnt.value == 0 )
                {
                    alert("Amount must be greater than zero!!");
                    cashForm.amnt.focus();
                    return false;
                }
                else if (cashForm.accNo.value == "" )
                {
                    alert("Account must be selected!!");
                    cashForm.accNo.focus();
                    return false;
                }

                return true;
            }
        function submitform(cashForm)
        {

                if(checkDiv(cashForm)){
                $('#tranType').val($('#tranTypeOrg').val());
                $('#accNoServer').val($('#accNo').val());
                $('#balanceServerId').val($('#avlBal').val());
                document.cashForm.action = '/PacsApplication/CashWidrawlDDSServlet';
                document.cashForm.submit();
                document.cashForm.reset();
                }
            

        }

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

legend.scheduler-border {
  
    text-align: left !important;
    width:inherit; /* Or auto */
   
    border-bottom:none;
    padding: 8px;
    border-radius: 20px;
    background-color: #006600;
    color: white
}
fieldset.scheduler-border {
    border: 5px groove #ddd !important;
    padding: 0 1.4em 1.4em 1.4em !important;
    margin: 0 0 1.5em 0 !important;
    -webkit-box-shadow:  0px 0px 0px 0px #000;
            box-shadow:  0px 0px 0px 0px #000;
    border-color: black;
    background-image: url('/PacsApplication/img/download.jpg');
    border-width: 3px
}

</style>

    <body onload="noBack()">
    <jsp:include page="MenuHead_DDS.jsp" flush="true" />
    <fieldset class="scheduler-border">
    <legend class="scheduler-border">DDS Operations</legend>
    <div class="container-fluid">
            <form name="cashForm" method="post" action="">

               <%if (!error_msg.equalsIgnoreCase("")) {%>
                <div class="info" id="errorMessage"><center><%= error_msg%></center></div>
                <% }%>
               <%--<div  class="info" id="errorMessageTag"><center>${errorMessage}</center></div>--%>
            <div class="row">
                <div class="col-xs-4 col-md-4"></div>
                <div class="col-xs-4 col-md-4">
                    <div class="form-group">
                    <label>Select type of Operation:</label>
                        <select class="selectpicker" id="tranTypeOrg">
                            <option value="CR" >Cash Deposit</option>
                            <option value="DR" >Cash Withdrawl</option>
                        </select>
                    </div>
                     <div class="form-group">
                        <label for="accName">Account No/ Account Holder Name</label>
                        <input type="text" class="form-control" id="accNo" name="accntNo" placeholder="account No/Name" >
                        <input type="button"  value="Search" onclick="javascript:popup_depAccount(750, 250,document.cashForm.accNo.value,document.cashForm.tranTypeOrg.value)"/>
                    </div>
                    <div class="form-group">
                        <label for="accName">Customer Name</label>
                        <input type="text" class="form-control" id="accName" name="accntName" placeholder="customer name"> 
                        <%--<input class="btn btn-primary" type="submit" value="search" onclick="javascript:popup_depAccount(750, 250,document.cashForm.accName.value)">--%>
                    </div>
                   
                   <div class="form-group">
                        <label for="accName">Avail Bal.</label>
                        <input type="number" class="form-control" id="avlBal" name="avlBal" placeholder="Avail Balance" disabled>

                    </div>
                    <div class="form-group">
                        <label for="amntName">Amount:</label>
                        <input type="number" class="form-control" id="amntName" name="amnt" placeholder="enter amount">
                    </div>
                   
                 <%--   <div class="form-group">
                        <label for="narration">Narration:</label>
                        <textarea class="form-control" id="narration" name="narration" rows="3"></textarea>
                    </div>--%>
                    <input type="button"  value="Submit"  onclick="javascript:submitform(cashForm)">
                    <input class="btn btn-primary" type="reset" value="Reset">
                    <input type="hidden" name="tranType" id="tranType" value=""/>
                    <input type="hidden" name="accNoServer" id="accNoServer" value=""/>
                    <input type="hidden" name="balanceServer" id="balanceServerId" value=""/>
                     <input type="hidden" name="accntType" id="accntTypeId" value=""/>
                </div>
                <div class="col-xs-4 col-md-4"></div>
              </div>
        </form>
    </div>
    </fieldset>

</body>
<html>







