<%-- 
    Document   : MenuHead_DDS
    Created on : Jul 11, 2018, 4:34:49 PM
    Author     : 1004242
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@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.*"%>


<% try {
%>
<html>
<%
     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: 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>


    <!--div id='cssmenu'-->
   <!--added on 16/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>
    
        <%if (userRole.equalsIgnoreCase(
                     "201603000004020")) {%>
        <li><a href="#" ><span>DDS Operations</span></a>
            <ul>
                <li><a href="/PacsApplication/DDS/CashWidrawlDeposit.jsp"><span>Cash Withdrawl/Deposit</span></a></li>
                <li><a href="/PacsApplication/DDS/TransactionReport.jsp"><span>Transaction Report</span></a></li>   
            </ul>
        </li>
      <% }%>

        <li><a href="/PacsApplication/LogoutServlet" onclick="return confirm('Do you want to logout?')" >LogOut</a></li>
    </ul> 
    <!--/div-->

   
</div>
</html>
<% 	} catch (Exception e) {
                System.out.println("EX in " + e);
            }
%>
