             
  <%@page import="java.io.InputStreamReader"%>
<%@page import="java.io.BufferedReader"%>
<%@page import="java.io.InputStream"%>
<%@page import="java.sql.*"%>
<%@page import="Dna.Sources.Dbconnection"%>
<%@ page session="true" %>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>SECURING AGGREGATE</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">
       
        <link rel="stylesheet" href="css/bootstrap.css">
        <link rel="stylesheet" href="css/bootstrap-responsive.css">
        <link rel="stylesheet" href="css/custom-styles.css">
        <link rel="stylesheet" href="css/font-awesome.css">
        <link rel="stylesheet" href="css/component.css">
        <link rel="stylesheet" href="css/font-awesome-ie7.css">
         <link rel="icon" href="images/13.jpg">
        
        <script src="js/modernizr-2.6.2-respond-1.1.0.min.js"></script>
    </head>
    
      <%
if(request.getParameter("msg")!=null){%>
    
    <script>alert('Login Sucessfully..!')</script>
}  


<%}
if(request.getParameter("m1")!=null){%>

 <script>alert('Login Failed..!')</script>
 <%
}
%>

    <body>
        <!--[if lt IE 7]>
            <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
        <![endif]-->

        <!-- This code is taken from http://twitter.github.com/bootstrap/examples/hero.html -->

        <!-- Site header starts here -->

            


             <!-- main content starts here -->

            <div class="container b-radius-top">
                <div class="top-bar b-radius">
                   
                    <div class="social">
                        <ul>
                           
                        </ul>
                    </div>
                </div>
                <div class="site-header">


                     <!-- Site Name starts here -->

                    <div class="site-name">
                        <h1>SECURING AGGREGATE QUERIES FOR DNA DATABASES</h1>
                    
                    </div>

                    <!-- Site Name ends -->

                     <!-- Menu starts here -->
                    <div class="menu">
                        <div class="navbar">
                            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                               <i class="fw-icon-th-list"></i>
                            </a>
                            <div class="nav-collapse collapse">
                                <ul class="nav">
                                   <li class="active"><a href="hospital1home.jsp">Home</a></li>
                                    <li><a href="user_details.jsp">View Users</a></li>
                           
                                    <li><a href="viewuserfiles.jsp">View files</a></li> 
                                    
                                    <li><a href="hospital1.jsp">logout</a></li>
                                </ul>
                             
                            </div>
                        </div>
                    </div>

                    <!-- Menu ends -->
                </div>
<center><p></p></center>
                    <center> 
                        <%

                            String[] filedetails = request.getQueryString().split(",");
                            String pid = null;
                            String dna1 = null;
                            String dna2 = null;
                            String dna3 = null;
                            String dna4 = null;
                               String date = null;
                            InputStream is = null;

                            Connection con = Dbconnection.getConnection();
                            Statement st = con.createStatement();
                            ResultSet rt = st.executeQuery("select * from hfiles where pid='" + filedetails[0] + "'");
                            if (rt.next()) {
                                pid = rt.getString("pid");
                                dna1 = rt.getString("dna1");
                                 dna2 = rt.getString("dna2");
                                  dna3 = rt.getString("dna3");
                                   dna4 = rt.getString("dna4");
                                   date = rt.getString("date");
                                
                                //keyword =rt.getString("keyword");
                                is = (InputStream) rt.getAsciiStream("dna1");
                            } else {
                                out.println("error while retreiving data");
                            }
                            BufferedReader br = new BufferedReader(new InputStreamReader(is));
                            String temp = null;
                            StringBuffer sb = new StringBuffer();
                            while ((temp = br.readLine()) != null) {
                                sb.append(temp + "\n");
                            }
                            //String content = new decryption().decrypt(sb.toString(), fkey);
                        %>
                        
                        <form name="f2" action="keygeneration.jsp" method="post" style="margin-right:  50px">
                            <label style="font-size: 23px">Patient Id</label><input class="textbox" type="text" value="<%=pid%>" readonly="" name="pid" style="margin-left: 58px;width: 250px" /><br /><br />
                            <label style="font-size: 23px">Dna1</label><input class="textbox" type="text" value="<%=dna1%>" readonly="" name="dna1" style="margin-left: 58px;width: 250px" /><br /><br />
                          <label style="font-size: 23px">Dna2</label><input class="textbox" type="text" value="<%=dna2%>" readonly="" name="dna2" style="margin-left: 58px;width: 250px" /><br /><br />
                          <label style="font-size: 23px">Dna3</label><input class="textbox" type="text" value="<%=dna3%>" readonly="" name="dna3" style="margin-left: 58px;width: 250px" /><br /><br />
                          <label style="font-size: 23px">Dna4</label><input class="textbox" type="text" value="<%=dna4%>" readonly="" name="dna4" style="margin-left: 58px;width: 250px" /><br /><br />
                          <label style="font-size: 23px">Date</label><input class="textbox" type="text" value="<%=date%>" readonly="" name="date" style="margin-left: 58px;width: 250px" /><br /><br />
                          
                              <input type="submit" value="submit" class="button" style="margin-left: 110px;margin-top: -10px;width: 100px;" />
                        </form> 
                    </center>
                </div>
            </div>
            <div id="footer"><br /><br />
                <center></center>
            </div>
        </div>
    </body>
</html>

