<%--
    Document   : MenuHead_GPS
    Created on : Jul 13, 2016, 12:14:39 PM
    Author     : Tcs Help desk122
--%>

<%@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>

    <div id="cssmenu" style="border-bottom:0px; border-color: black; color: white; background-color: rgb(0, 120, 0); ">
        <div style="width: 20%;float: left;padding: 5px; border-radius: 5px;"><b>User Name:</b><font face="Trebuchet MS" size="2.5"> <%=userName%></font></div>
        <div style="width: 15%;float: right; text-align: right;padding: 5px; border-radius: 5px;"><b>Date:</b><font face="Trebuchet MS" size="2.5"> <%=sysDt%></font></div>
        <div style="width: 15%;float: left; text-align: right;padding: 5px; border-radius: 5px;"><b>PACS Name:</b><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><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><font face="Trebuchet MS" size="2.5"> <%=moduleName.toUpperCase()%></font></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("201603000004021")) {%>
        <li class='active has-sub'><a href="#" ><span>Parameter</span></a>
            <ul>
                <li><a href="/PacsApplication/GPS_JSP/CommodityMaster.jsp"><span>Commodity Master</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/GPS_JSP/MasterRollEnrollment.jsp"><span>Master Roll Enrollment</span></a></li>
                <li><a href="/PacsApplication/GPS_JSP/GovtOrderCreation.jsp"><span>Government Order Creation</span></a></li>
                <li><a href="/PacsApplication/GPS_JSP/ItemProcurement.jsp"><span>Item Procurement</span></a></li>
                <li><a href="/PacsApplication/GPS_JSP/SellProcureItem.jsp"><span>Sell Procure Item</span></a></li>
                <li><a href="/PacsApplication/GPS_JSP/sellregister.jsp"><span>Sell Register</span></a></li>
                <li><a href="/PacsApplication/GPS_JSP/ProcurementRegister.jsp"><span>Procurement Register</span></a></li>

            </ul>

        </li>
        <%}%>



        <%if (userRole.equalsIgnoreCase("201603000004022")) {%>
        <li class='active has-sub'><a href="#" ><span>Reports</span></a>
            <ul>
                <li><a href="/PacsApplication/GPS_JSP/gps_report.jsp"><span>Procurement Reports</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>

