Current File : //home/obabain/public_html/abc/master.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page language="java" import="java.sql.*" %>
      <%!
      ResultSet rsmaster=null;
      ResultSet ra=null;
    String logo=null;
    %>
    <%Class.forName("com.mysql.jdbc.Driver");
	Connection con=DriverManager.getConnection("jdbc:mysql://localhost/obabain_autoclutches","obabain_auto","GZ9EHe*cH");
	String loginid=(String)session.getAttribute("logid");
	String name=(String)session.getAttribute("uname");
	String firstname=(String)session.getAttribute("firstname");
	String type=(String)session.getAttribute("typ");
	String userid=(String)session.getAttribute("userid");
    
    
    Statement sl=con1.createStatement();
    ResultSet rl=sl.executeQuery("select *  from ip_logo where login_id="+loginid+"");
    while(rl.next())
    {
    	logo=rl.getString("name");
    }
    %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 <link rel="shortcut icon" type="image/x-icon" href="img/ico.ico" />
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/estilos.css" rel="stylesheet">
    
    <link href="css/Mystyle.css" rel="stylesheet">
    <script src="http://cdn.ckeditor.com/4.6.1/standard/ckeditor.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="js/jscolor.js"></script>
 
<style>
body {
    font-family: "Lato", sans-serif;
}

/* Fixed sidenav, full height */
.sidenav {
   
    /* position: fixed; */
    z-index: 1;
    
    left: 0;
    background-color: white;
    overflow-x: hidden;
    height:170%;
    /* padding-top: 10px; */
    
}

/* Style the sidenav links and the dropdown button */
.sidenav a, .dropdown-btn {
    padding: 6px 8px 6px 16px;
    text-decoration: none;
    font-size: 16px;
    color: #043722;
    display: block;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    outline: none;
    border-bottom:1px solid #bdc0c788;
    font-weight:bold;
}

/* On mouse-over */
.sidenav a:hover, .dropdown-btn:hover {
    color: #17724D;
}

/* Main content */
.main {
    margin-left: 200px; /* Same as the width of the sidenav */
    font-size: 20px; /* Increased text to enable scrolling */
    padding: 0px 10px;
}

/* Add an active class to the active dropdown button */
.active {
    
    color: #17724D;
}

/* Dropdown container (hidden by default). Optional: add a lighter background color and some left padding to change the design of the dropdown content */
.dropdown-container {
    display: none;
    background-color: #009191;
    padding-left: 8px;
}
/* Optional: Style the caret down icon */
.fa-caret-down {
    float: right;
    padding-right: 8px;
}

/* Some media queries for responsiveness */
@media screen and (max-height: 450px) {
    .sidenav {padding-top: 15px;}
    .sidenav a {font-size: 18px;}
}
</style>
<title>Insert title here</title>
</head>
<body>
<nav class="navbar navbar-default" >
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <!-- <a class="navbar-brand" href="#">Admin</a> -->
        </div>
        <div id="navbar" class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
            <li><a href="Dashboard.jsp">Dashboard</a></li>
                <li><a href="customerNew.jsp" >Customer</a></li>
                <li><a href="supplier.jsp" >Supplier</a></li>
                <li><a href="AddProduct.jsp" >Product</a></li>
            <li><a href="POmain.jsp" >Purchase Order</a></li>
                 <!-- <li><a href="SalesQuotationMain.jsp" >Sales Quotation</a></li> -->
                    <li><a href="SalesInvoiceMain.jsp"> Sales Invoice</a></li>
                   <!-- <li><a href="InventoryPurchase_Invoiceselection.jsp">Add Stock</a></li>   -->      
          </ul>
          <ul class="nav navbar-nav navbar-right">
            <li><a href="#">Welcome, <%=firstname %> </a></li>
            <li><a href="logout.jsp">LogOut</a></li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav><header id="header">
      <div class="container">
        <div class="row">
          <div class="col-md-10">
          <%
          Statement smaster=con1.createStatement();
          ResultSet rdetails=smaster.executeQuery("select * from ip_users where login_id='"+loginid+"'");
          while(rdetails.next())
          {
          %>
      <div class="col-md-2"> <img src="<%=logo%>"></div> <h1><marquee class="col-md-8" style="font-family:Book Antiqua; color:linear-gradient(55deg, #0fb8ad 0%, #1fc8db 51%, #2cb5e8 85%);" scrollamount="12"  scrolldelay="10"><b> <%=rdetails.getString("user_company")%></b></marquee> <small></small></h1> 
       
            <%} %>
          </div>
          <div class="col-md-2">
            <div class="dropdown crear">
              <button class="btn btn-info dropdown-toggle" style="background:#009191" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                Settings
                <span class="caret"></span>
              </button>
              <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
                
                <li><a href="SystemAdmin.jsp">System Admin</a></li>
                <li><a href="UserAdmin.jsp">User Admin</a></li>
                 
              </ul>
            </div>
          </div>
        </div>
      </div>
    </header>
 <div class="col-xs-2" >
<div class="sidenav " >
<button class="dropdown-btn " style="background-color:#009191;color:white; "><span class="glyphicon glyphicon-cog"></span>Dashboard</button>
<%
try{
if(name==null || name==""){
    	
        response.sendRedirect("index.html");
    }
    else
    {
    Statement stmaster=con1.createStatement();

     //rsmaster=stmaster.executeQuery("select * from ip_menu_creation where menu_parent_id=0 and status=0 order by sortorder asc");

//	rsmaster=stmaster.executeQuery("select * from ip_menu_creation where menu_parent_id=0 and status=0 and id in(select menu_id from ip_menu_permission where userid="+loginid+") order by sortorder asc");
   if(type.equals("B"))
{
	rsmaster=stmaster.executeQuery("select * from ip_menu_creation where menu_parent_id=0 and status=0 and id in(select menu_id from ip_menu_permission where userid="+loginid+") order by sortorder asc");
}
else
{
	rsmaster=stmaster.executeQuery("select * from ip_menu_creation where menu_parent_id=0 and status=0 and id in(select menu_id from ip_menu_permission_user where userid="+userid+") order by sortorder asc");
	
}
    while(rsmaster.next())
    {
    %>
 <button class="dropdown-btn" style="background-color:#3CB371;color:white;"> <span class="glyphicon glyphicon-forward" ></span> <%=rsmaster.getString("menu_name") %>
   
  </button>
  
 
 
<div class="dropdown-container" style="background-color:white;">
 <%
    Statement stmt=con1.createStatement();
 
     //ra=stmt.executeQuery("select * from ip_menu_creation where menu_parent_id="+rsmaster.getString("id")+" and status=0 order by sortorder asc");
 
	 //ra=stmt.executeQuery("select * from ip_menu_creation where menu_parent_id="+rsmaster.getString("id")+" and status=0 and id in(select menu_id from ip_menu_permission where userid="+loginid+") order by sortorder asc");
 if(type.equals("B"))
 {
	 ra=stmt.executeQuery("select * from ip_menu_creation where menu_parent_id="+rsmaster.getString("id")+" and status=0 and id in(select menu_id from ip_menu_permission where userid="+loginid+") order by sortorder asc");
 }
 else
 {
	 
	 ra=stmt.executeQuery("select * from ip_menu_creation where menu_parent_id="+rsmaster.getString("id")+" and status=0 and id in(select menu_id from ip_menu_permission_user where userid="+userid+") order by sortorder asc");
	 
 }
     while(ra.next())
    {
    %>
  <a href="<%=ra.getString("redirection_page") %>"><%=ra.getString("menu_name") %></a>
  <%} %>
</div>
<%}}

}
catch(Exception el){out.print(el);}

%>

</div>
</div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>	
<script>
/* Loop through all dropdown buttons to toggle between hiding and showing its dropdown content - This allows the user to have multiple dropdowns without any conflict */
var dropdown = document.getElementsByClassName("dropdown-btn");
var i;

for (i = 0; i < dropdown.length; i++) {
  dropdown[i].addEventListener("click", function() {
    this.classList.toggle("active");
    
    var dropdownContent = this.nextElementSibling;
    if (dropdownContent.style.display === "block") {
      dropdownContent.style.display = "none";
    } else {
      dropdownContent.style.display = "block";
    }
    return false;
  });
}
</script>
</html>