<%-- 
    Document   : tellerQueueDetails
    Created on : Sep 18, 2018, 5:00:40 PM
    Author     : 1004242
--%>


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.SQLException"%>
<%@page import="LoginDb.DbHandler"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.util.Date"%>
<%@page import="DataEntryBean.ChequeDetailsBean"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.UUID" %>
<%String uuid = UUID.randomUUID().toString();%>
<% try {
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>

        <title>Transaction 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/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>
            <style>
            /* The snackbar - position it at the bottom and in the middle of the screen */
#snackbar {
    visibility: show; /* Hidden by default. Visible on click */
    min-width: 200px; /* Set a default minimum width */
    margin-left: -125px; /* Divide value of min-width by 2 */
    background-color: #333; /* Black background color */
    color: #fff; /* White text color */
    text-align: center; /* Centered text */
    border-radius: 2px; /* Rounded borders */
    padding: 16px; /* Padding */
    position: fixed; /* Sit on top of the screen */
    z-index: 1; /* Add a z-index if needed */
    left: 89%; /* Center the snackbar */
    bottom: 50px; /* 100px from the bottom */
}
#notiButton {

    min-width: 100px; /* Set a default minimum width */
    margin-left: -125px; /* Divide value of min-width by 2 */
    background-color: #333; /* Black background color */
    color: #fff; /* White text color */
    text-align: center; /* Centered text */
    border-radius: 2px; /* Rounded borders */
    padding: 16px; /* Padding */
    position: fixed; /* Sit on top of the screen */
    z-index: 1; /* Add a z-index if needed */
    left: 95%; /* Center the snackbar */
    bottom: 30px; /* 30px from the bottom */
}
/* Show the snackbar when clicking on a button (class added with JavaScript) */
#snackbar.show {
    visibility: visible; /* Show the snackbar */
    /* Add animation: Take 0.5 seconds to fade in and out the snackbar.
   However, delay the fade out process for 2.5 seconds */
   -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
   animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

/* Animations to fade the snackbar in and out */
@-webkit-keyframes fadein {
    from {bottom: 60; opacity: 0;}
    to {bottom: 100px; opacity: 1;}
}

@keyframes fadein {
    from {bottom: 60; opacity: 0;}
    to {bottom: 100px; opacity: 1;}
}

@-webkit-keyframes fadeout {
    from {bottom: 100px; opacity: 1;}
    to {bottom: 60; opacity: 0;}
}

@keyframes fadeout {
    from {bottom: 100px; opacity: 1;}
    to {bottom: 60; opacity: 0;}
}

#recordsTable {
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    border-collapse: collapse;
    width: 100%;
}

#recordsTable td, #recordsTable th {
    border: 2px solid #000000;
    padding: 8px;
}

#recordsTable tr:<%--nth-child(even)--%>{background-color: #f2f2f2;}

#recordsTable tr:hover {background-color: #a8ecab;}

#recordsTable th {
    padding-top: 12px;
    padding-bottom: 12px;
    text-align: left;
    background-color: #4CAF50;
    color: white;
}
</style>
       

    <script>
//         $(document).ready(function() {
//
//            $.ajax({
//                url:'WelcomeServlet',
//                data:{"temp":"seacrh"},
//                type:'post',
//                cache:false,
//                success:function(data){
//
//                    $("#pQ").text(data.pQue);
//                    $("#aQ").text(data.aQue);
//                    $("#rQ").text(data.rQue);
//                    $("#cIn").text(data.cIn);
//                    $("#cOt").text(data.cOut);
//                    $("#cDf").text(data.cDf);
//                    $("#cinH").text(data.cinH);
//
//                },
//                error:function(){
//                    $("#pQ").text(0);
//                    $("#aQ").text(0);
//                    $("#rQ").text(0);
//                    $("#cIn").text(0);
//                    $("#cOt").text(0);
//                    $("#cDf").text(0);
//                    $("#cinH").text(0);
//                }
//            }
//             );
//        });

        $(document).ready(function() {

            $.ajax({
                url:'WelcomeServlet',
                data:{"temp":"allTran"},
                type:'post',
                cache:false,
                //success:function(data){
                    if(data!=null){
                    //response = $.parseJSON(data);
                $(function() {
                    $.each(data, function(i, item) {
                    var $tr = $('<tr>').append(
                    $('<td>').text(item.tellerId),
                    $('<td>').text(item.pendingQ),
                    $('<td>').text(item.authorisedQ),
                    $('<td>').text(item.rejectedQ),
                    $('<td>').text(item.cashIn),
                    $('<td>').text(item.cashOut),
                    $('<td>').text(item.cashDiff)
                    ).appendTo('#recordsTable');
                //console.log($tr.wrap('<p>').html());
            });
        });
                }
                else
                {
                    alert("no records");
                }},
                error:function(){
                   
                }
            }
             );
        });

        function submitform(transferForm)
        {
            if(checkDiv(transferForm)){
                document.transferForm.selectedTab.value=selectedTab;
                document.transferForm.action = '/PacsApplication/ChequePostingServlet';
                document.transferForm.submit();
            }
        }

         function submitformEnq()
        {
                    document.chequeViewForm.selectedTab.value=selectedTab;
                    document.chequeViewForm.action = '/PacsApplication/ChequePostingServlet';
                    document.chequeViewForm.submit();
                    return true;
        }

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

                      var repeater;
   <%-- function myFunction() {
    // Get the snackbar DIV
    var x = document.getElementById("snackbar");

    // Add the "show" class to DIV
    x.className = "show";

    // After 3 seconds, remove the show class from DIV
    setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
}--%>

    </script>
            <%
                 int count = 1;
                 String error_msg1 = "";
                 
                 Object accNoServer = request.getAttribute("accNo");
                 String accNo ="";
                 if(accNoServer !=null)accNo=(String)accNoServer;

                 ArrayList<ChequeDetailsBean> chqDetBeanList=null;
                 Object allChq = request.getAttribute("allcheque");
                 Object error1 = request.getAttribute("message1");

                 ChequeDetailsBean chqBean = null;
                 if (error1 != null) {
                     error_msg1 = error1.toString();

                 }
                 else {

                    chqDetBeanList = null;//new ArrayList<ChequeDetailsBean>();

                     if (allChq != null) {
                         chqDetBeanList = (ArrayList<ChequeDetailsBean>) request.getAttribute("allcheque");

                     }
                 }
            %>

            <%!
            String blankNull(String s) {
                return (s == null) ? "" : s;
            }

        %>

    <body onload="noBack();">
        <jsp:include page="Deposit/MenuHead_Deposit.jsp" flush="true" />

        <div id="ChequeEnquiry">
            <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"></legend>--%>
                <form name="chequeViewForm" method="post" action="" id="chequeViewForm">
                    <%if (!error_msg1.equalsIgnoreCase("")) {%>
                    <center><div class="info" id="errorMessage"><center><%= error_msg1%></center></div></center>
                    <% }%>
                    <br>
<!--                    <div id="snackbar">
                      Total Transaction Details
                      <br><br>
                     <table >
                            <tr>
                                <td style="text-align: left">Pending Queues: </td>
                                <td><span id="pQ"> </span></td>
                            </tr>
                            <tr>
                                <td style="text-align: left">Authorised Queues. </td>
                                <td><span id="aQ"> </span></td>
                            </tr>
                             <tr>
                                <td style="text-align: left">Rejected Queues. </td>
                                <td><span id="rQ"> </span></td>
                            </tr>
                             <tr>
                                <td style="text-align: left">Cash In </td>
                                <td><span id="cIn"> </span></td>
                            </tr>
                             <tr>
                                <td style="text-align: left">Cash Out </td>
                                <td><span id="cOt"> </span></td>
                            </tr>
                             <tr>
                                <td style="text-align: left">Cash In/Out Diff </td>
                                <td><span id="cDf">  </span></td>
                            </tr>
                            <tr>
                                <td style="text-align: left">Cash In Hand</td>
                                <td><span id="cinH">  </span></td>
                            </tr>

                         </table>
                        </div>-->
                   
                    <div align="center" style="display:block" id="chequDetTab">
                        <%--<p>Tellerwise Transaction details</p>--%>
                        <div><p><font face="Trebuchet MS" color="#000000" size="4"><u>Tellerwise Transaction details</u></font></p></div>
                        <table border="2" width="auto" cellspacing="1" cellpadding="1" id ="recordsTable" style="text-align: center ;overflow-y: scroll; font-size: 15px">
                            <thead class="CSSTableGenerator">
                                <tr>
                                    <td>Teller Id</td>
                                    <td>Pending Queues</td>
                                    <td>Authorised Queues</td>
                                    <td>Rejected Queues</td>
                                    <td>Cash In</td>
                                    <td>Cash Out</td>
                                    <td>Cash In/Out Diff</td>
                                </tr>
                            </thead>
                        </table>

                    </div>
                </form>
               <%-- <button id="notiButton" onmouseover="repeater=setInterval(myFunction(), 100);" onmouseout="clearInterval(repeater);">Show Notification</button>--%>
            </fieldset>
        </div>
    </body>

</html>
<% 	} catch (Exception e) {
                
            }
%>