<%--
    Document   : MenuHead_TRADING
    Created on : Apr 20, 2016, 3:19:56 PM
    Author     : 590685
--%>


<%@page import="LoginDb.DbHandler"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.io.*"%>
<%@page import="java.util.*"%>
<%@page import="java.sql.*"%>



<%
            String userName = new String();
            String pacsName = new String();
            String userRole = new String();
            String RoleName = new String();
            String sysDt = new String();

            Connection connection = null;
            ResultSet rs = null;
            Statement statement = null;
            connection = DbHandler.getDBConnection();
            try {
                statement = connection.createStatement();
                rs = statement.executeQuery("select to_char(SYSTEM_DATE,'Month DD, YYYY') from system_date");
                while (rs.next()) {
                    sysDt = rs.getString(1);
                }
               // statement.close();
               // connection.close();
            } catch (Exception e) {
                System.out.println("Error occurred during processing.");
            } finally {
                try {
                    if(statement !=null)
                        statement.close();
                    if (connection != null)
                    connection.close();

            } catch (Exception e) {               
               System.out.println("Error Occurred during connection close.");
            }

            }


            userName = (String) session.getAttribute("UserName");
            userName = userName.toUpperCase();
            pacsName = (String) session.getAttribute("pacsName");
            userRole = (String) session.getAttribute("userRole");
            RoleName = (String) session.getAttribute("RoleName");


String moduleName = new String();
            moduleName = (String) session.getAttribute("moduleName");


%>

<div style="width: 100%; height: auto; top: 0; left: 0; margin-bottom: 0 auto;">

    <div id="IPKSimage" style=" top: 0; left: 0; border-bottom:0px;">
        <img src="/PacsApplication/img/PACS.jpg"  width="100%" height="65px" alt="Image - PACS"/>
    </div>
    <!--changed on 15/5/24-->

    <div id="cssmenu" style="padding-bottom:10px;border-bottom:0px; border-color: black; color: rgb(0,140,69); background-color: rgb(177,224,178); ">
        <div style="width: 20%;float: left;text-align: left;padding: 5px 1px 1px 28px; border-radius: 5px;"><b>User Name:</b><br><font face="Trebuchet MS" size="2.5"> <%=userName%></font></div>
        <div style="width: 15%;float: right; text-align: left;padding: 5px 5px 1px 1px; border-radius: 5px;"><b>Date:</b><br><font face="Trebuchet MS" size="2.5"> <%=sysDt%></font></div>
        <div style="width: 15%;float: left; text-align: left;padding: 5px; border-radius: 5px;"><b>PACS Name:</b><br><font face="Trebuchet MS" size="2.5"> <%=pacsName%></font></div>

        <div style="width: 20%;float: left; margin-right: 20px;text-align: center;padding: 5px; border-radius: 5px;"><b>User Type:</b><br><font face="Trebuchet MS" size="2.5"> <%=RoleName%></font></div>
        <div style="width: 20%;float: left; margin-right: 20px;text-align: center;padding: 5px; border-radius: 5px;"><b>Module Name:</b><br><font face="Trebuchet MS" size="2.5"> <%=moduleName.toUpperCase()%></font></div>

    </div>
<!--added on 15/5/24-->
  <div style="display: flex; justify-content: center;background-color: rgb(177,224,178)"><div style="background: #fff; height: 2px; width: 90%"></div></div>
    <ul id="menu">
        <li><a href='/PacsApplication/welcome.jsp'><span>Home</span></a></li>
       <li><a href="#" id="modules"><span>Module List</span></a>
            <ul>
                <%if ((userRole.equalsIgnoreCase(
                     "201603000005020"))) {%>
                     <li class="est_btn"><a href="/PacsApplication/DepositServlet"><span id="dep">Deposit</span></a></li>
                      <%}else{%>
                <li class="est_btn"><a href="/PacsApplication/KCCSevlet"><span id="kcc">KCC</span></a></li>
                <li class="est_btn"><a href="/PacsApplication/TradingSevlet"><span id="trading">Trading</span></a></li>
                <li class="est_btn"><a href="/PacsApplication/AssetServlet"><span id="asset">Asset</span></a></li>
                <%--<li class="est_btn"><a href="/PacsApplication/PDSServlet"><span id="pds">Public Distribution System</span></a></li>--%>
                <li class="est_btn"><a href="/PacsApplication/SHGServlet"><span id="shg">Self Help Group</span></a></li>
                <%--<li class="est_btn"><a href="/PacsApplication/GPSServlet"><span id="gps">Government Procurement</span></a></li>--%>
                <%--<li class="est_btn"><a href="/PacsApplication/MISDashboardSevlet"><span id="dashboard">MIS & Dashboard</span></a></li>--%>
                <li class="est_btn"><a href="/PacsApplication/DepositServlet"><span id="dep">Deposit</span></a></li>
                <li class="est_btn"><a href="/PacsApplication/LoanServlet"><span id="ln">Loan</span></a></li>
                <li class="est_btn"><a href="/PacsApplication/ShareServlet"><span id="share">Share</span></a></li>
                <%--<li class="est_btn"><a href="/PacsApplication/SODEODServlet"><span id="eod">SOD/EOD</span></a></li>--%>
                <%}%>
            </ul>
        </li>
        <%if (userRole.equalsIgnoreCase("201606000004041") ) {%>
        <li class='active has-sub'><a href="#" ><span>Parameter</span></a>
            <ul>
                <li><a href="/PacsApplication/Trading_JSP/tradingProductCreation.jsp"><span>Trading Product Creation</span></a></li>
                
            </ul>
        </li>
        <%}%>

        <%if (userRole.equalsIgnoreCase("201603000004022")) {%>
        <li class='active has-sub'><a href="#" ><span>Operation</span></a>

            <ul>
                <li><a href="/PacsApplication/Trading_JSP/Godown.jsp"><span>Godown Master</span></a></li>
                <li><a href="/PacsApplication/Trading_JSP/VendorEnrollmentEnquiry.jsp"><span>Vendor Enrollment/Enquiry</span></a></li>
                <li><a href="/PacsApplication/Trading_JSP/RaisePurchaseOrder.jsp"><span>Raise Purchase Order</span></a></li>
                <li><a href="/PacsApplication/Trading_JSP/leaseRentCommodity.jsp"><span>Lease/Rent Commodity</span></a></li>
                <li><a href="/PacsApplication/Trading_JSP/TradingStockRegister.jsp"><span>Trading Stock Register</span></a></li>
                <li><a href="/PacsApplication/Trading_JSP/SellItem.jsp"><span>Trading Sell Item</span></a></li>
                <%--<li><a href="/PacsApplication/Trading_JSP/PrintStockBarCode.jsp"><span>Print Inventory Barcode</span></a></li>--%>
                <li><a href="/PacsApplication/Trading_JSP/SalesRegister.jsp"><span>Trading Sales Register</span></a></li>
                <li><a href="/PacsApplication/Trading_JSP/CustomerEnrollment.jsp"><span>Customer Enrollment</span></a></li>
                <li><a href="/PacsApplication/Trading_JSP/PaymentAcknowldgement.jsp"><span>Payment Acknowledgement</span></a></li>
                <li><a href="/PacsApplication/Trading_JSP/SellPurchaseAdjustment.jsp"><span>Sell Purchase Adjustment</span></a></li>
                <li><a href="/PacsApplication/Trading_JSP/tradingFinancialYearAdjustment.jsp"><span>Trading Financial Year Adjustment</span></a></li>
            </ul>

        </li>
        <%}%>

<%if (userRole.equalsIgnoreCase("201606000004041")) {%>
        <li class='active has-sub'><a href="#" ><span>Operation</span></a>
            <ul>
                <li><a href="/PacsApplication/Trading_JSP/tradingFinancialYearAdjustment.jsp"><span>Trading Financial Year Adjustment</span></a></li>
                <li><a href="/PacsApplication/Trading_JSP/TradingStockRegisterEdit.jsp"><span>Trading Stock Register</span></a></li>
            </ul>
        </li>
        <%}%>

        <%if (userRole.equalsIgnoreCase("201603000004022") || (userRole.equalsIgnoreCase("201606000004041"))) {%>
        <li class='active has-sub'><a href="#" ><span>Reports</span></a>
            <ul>

                <li><a href="/PacsApplication/Trading_JSP/Trading_Report.jsp"><span>Trading Reports</span></a></li>                
            </ul>


        </li>
        <%}%>
        <%if (userRole.equalsIgnoreCase("201606000004041")) {%>
        <li class='active has-sub'><a href="#" ><span>Worklist</span></a>
            <ul>
                <li><a href="/PacsApplication/Trading_JSP/TransactionAuthorization_Trading.jsp"><span>My Queue</span></a></li>
                <li><a href="/PacsApplication/Trading_JSP/MyIntimation_Trading.jsp"><span>My Intimation</span></a></li>                
            </ul>


        </li>
        <%}%>
        <%if (!userRole.equalsIgnoreCase(
                     "201603000004020")) {%>
        <li class='active has-sub'><a href="#" ><span>User Management</span></a>
            <ul>
                <li><a href="/PacsApplication/ResetLogin.jsp"><span>Reset Logged In status </span></a><li>
                    <li><a href="/PacsApplication/changePassword.jsp"><span>Change Password </span></a><li>
            </ul>
        </li>
         <%}%>
        <li><a href="/PacsApplication/LogoutServlet" onclick="return confirm('Do you want to logout?')" >LogOut</a></li>
    </ul>
</div>




