<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*,java.io.*" errorPage="" %> <%@ page import="java.lang.*"%> <%! String names =null,username=null,desi=null,class1=null,add1=null, telo=null,telh=null,mail1=null,mail2=null; String researchint=null,publication=null,profile=null,sponspro=null,research=null,courses=null,other=null,education=null; public String htmlFormat(String str) { String fout = str; fout = fout.replaceAll(" ", " "); fout = fout.replaceAll("\r\n","
"); return fout; } %> Department of Biotechnology, IIT Madras <% String name1; String name="", pass="",rsi1="",rsi2="",pub1="",pub2=""; File f=null; if((String)session.getAttribute("name1") ==null) { name=request.getParameter("username"); pass=request.getParameter("password"); session.putValue("name1",name); session.putValue("password",pass); session.putValue("sid",session.getId()); } else { name = (String)session.getAttribute("name1"); pass=(String)session.getAttribute("password"); } Connection con; ResultSet rs,rs1,rs2,rs3,rs4,rs5,rs6,rs7; Statement st,st1,st2,st3,st4,st5,st6,st7; %>


<% try { Class.forName("com.mysql.jdbc.Driver").newInstance(); // con = DriverManager.getConnection("jdbc:mysql://localhost/lexnet2_lexadmin","lexnet2_lexnet2","test"); con = DriverManager.getConnection("jdbc:mysql://localhost/iitDB","root","91don699629"); st=con.createStatement(); String image=""; //out.println("name :" + name + " Pass : " + pass); rs=st.executeQuery("select name,username,desi,class1,add1,telo,telh,mail1,mail2,education,researchint,publications, profile, sponspro,research,courses,others from adminfac where username='"+name+"' and password ='"+pass+"'"); if(rs.next()) { names = rs.getString("name"); desi = rs.getString("desi"); class1 = rs.getString("class1"); add1 = rs.getString("add1"); telo = rs.getString("telo"); telh = rs.getString("telh"); mail1 = rs.getString("mail1"); mail2 = rs.getString("mail2"); f= new File(application.getRealPath(".")+ "/iit/Photo/"+ name+"/personal"); f.mkdirs(); //out.println(f.toString()); String fr[] = f.list(); if(fr.length>0) image = "Photo/"+name+"/personal/"+fr[0]; else image = "images/default.bmp"; %>

Personal Info                                                                                                                                                       

Name                          : <%=names %>
Designation                 : <% if (desi!=null ){ out.println(desi); } else {out.println("");} %>
  <% if (class1!=null ){ out.println(class1); } else {out.println("");} %>
Address                      : <% if (add1!=null ){ out.println(add1); } else {out.println("");} %>
Tel                              : <% if (telo!=null ){ out.println(telo + "(Off). " ); } else {out.println(""); } if (telh!=null ){ out.println(telh + "(Res). " ); } else {out.println(""); } %>
Email Id (s)                 : <% if (mail1!=null ){ out.println(mail1 + "" ); } else {out.println(""); } if (mail2!=null ){ out.println(", " +mail2 + "" ); } else {out.println("");} %>

Research Interests                                                                                                                                            

<% researchint = rs.getString("researchint"); String fstr=""; if( !rs.wasNull() ) { fstr= researchint; } else{ fstr= "Not Available"; } f= new File(application.getRealPath(".")+ "/iit/Photo/"+ name+"/research/rs1"); f.mkdirs(); //out.println(f.toString()); String fr1[] = f.list(); if(fr1.length>0) rsi1 = "Photo/"+name+"/research/rs1/"+fr1[0]; else rsi1 = "images/default.bmp"; %>

<% f= new File(application.getRealPath(".")+ "/iit/Photo/"+ name+"/research/rs2"); f.mkdirs(); //out.println(f.toString()); String fr2[] = f.list(); if(fr2.length>0) rsi2 = "Photo/"+name+"/research/rs2/"+fr2[0]; else rsi2 = "images/default.bmp"; %>

Educational Background                                                                                                                                   

<% education = rs.getString("education"); String estr=""; if( !rs.wasNull() ) { estr = education; } else{ estr="Not Available"; } %>

Career Profile                                                                                                                                                      

<% profile = rs.getString("profile"); String pstr=""; if( !rs.wasNull() ) { pstr = profile; } else{ pstr="Not Available"; } %>

Sponsored Projects / Collaborations                                                                                                             

<% sponspro = rs.getString("sponspro"); String sstr=""; if( !rs.wasNull() ) { sstr = sponspro; } else{ sstr="Not Available"; } %>

Publications / Patents / Conferences / Invited Lectures                                                                          

<% publication = rs.getString("publicationS"); String pubstr=""; if( !rs.wasNull() ) { pubstr = publication; } else{ pubstr="Not Available"; } f= new File(application.getRealPath(".")+ "/iit/Photo/"+ name+"/publication/pub1"); f.mkdirs(); //out.println(f.toString()); String fr3[] = f.list(); if(fr3.length>0) pub1 = "Photo/"+name+"/publication/pub1/"+fr3[0]; else pub1 = "images/default.bmp"; %>

<% f= new File(application.getRealPath(".")+ "/iit/Photo/"+ name+"/publication/pub2"); f.mkdirs(); //out.println(f.toString()); String fr4[] = f.list(); if(fr4.length>0) pub2 = "Photo/"+name+"/publication/pub2/"+fr4[0]; else pub2 = "images/default.bmp"; %>

Research Group                                                                                                                                                  

<% research = rs.getString("research"); String resstr=""; if( !rs.wasNull() ) { resstr = research ; } else{ resstr="Not Available"; } %>

Courses                                                                                                                                         

<% courses = rs.getString("courses"); String cstr=""; if( !rs.wasNull() ) { cstr = courses ; } else{ cstr="Not Available"; } f= new File(application.getRealPath(".")+ "/iit/files/"+ name+"/courses"); f.mkdirs(); //out.println(f.toString()); String fr5[] = f.list(); %>


Courses Files :

<% for(int i=0;i <% } %>
 <%= (i+1) +"." %>  " target="_blank" ><%= fr5[i] %>

Others                                                                                                                                                                   

<% other = rs.getString("otherS"); String ostr=""; if( !rs.wasNull() ) { ostr = other ; } else{ ostr="Not Available"; } %>
<% } else{ response.sendRedirect("invalid.jsp"); } con.close(); } catch(SQLException sqle){ System.err.println(sqle.getMessage()); out.println(sqle.getMessage()); } catch (ClassNotFoundException cnfe){ System.err.println(cnfe.getMessage()); } catch (Exception e){ e.printStackTrace(); out.println(e.getMessage()); out.println("sql Exexption"); } %>