import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.math.*;
import java.io.*;
import java.util.*;
import Configure;

class Analyst{
    public  static void printAnalystLoginCode(HttpServletRequest request,HttpServletResponse response)
	throws ServletException, IOException{
	try{
	    PrintWriter  out;
	    String  title = "WELCOME ANALYST";
		    
	    response.setContentType("text/html"); 
	    out = response.getWriter();
	   
	    		
	    System.out.println("correctlogin");
	    out.println("<HTML><HEAD><TITLE>");
	    out.println(title);
	    out.println("</TITLE></HEAD><BODY>");
	    out.println("<B>WELCOME Analyst</BLINK><B>");
	    out.println("<h3>you logged in successfully </br><h3>");
	    
	    out.println("<FORM ACTION=\"" + Configure.SERVLET_SERVER + ":" + Configure.SERVLET_PORT + "/" + Configure.SERVLET_PATH + "/AnalystRequests\" method =\"GET\">");
	    out.println("<TABLE  CELLPADDING=4 BORDER=2>");
	    
	    out.println("<TR><TD>");
	    out.println("<textarea NAME=\"query\"  ROWS=\"10\" COLS=\"40\" wrap=\"virtual\">");
	    out.println("</textarea>");
	    out.println("</TD></TR>");
		    
	    EasyPrint.printButton("submit","ownquery","Make query",out);
	    EasyPrint.printButton("reset","clear","Clear the form and Start over",out);    
	    EasyPrint.printButton("submit","logout","Logout",out);
	    EasyPrint.printButton("hidden","fromanalystquerypage","fromanalystquerypage",out);    
	    EasyPrint.printButton("text","getlocation","type location here",out);
	    EasyPrint.printButton("submit","locationbutton","Query by location",out);
	    
	    EasyPrint.printButton("submit","workerloadbutton","Complaints per Worker",out);
	    EasyPrint.printButton("submit","totalbutton","Total complaints",out);
	   
	    
	     out.println("</TABLE></FORM></BODY></HTML>");
	    
	    System.out.println("done with correct login on analyst");
	    
	    out.close();
	}catch(Exception sqle){
	    System.out.println( "exception in GET " );
	    System.out.println(sqle);
	    
	}
    }
    

    
    public  static void  makeOneMoreQueryCode(HttpServletRequest request,HttpServletResponse response) 
	throws ServletException, IOException {
	try{
	    PrintWriter  out;
	    String  title = "WELCOME USER";
	    response.setContentType("text/html"); 
	    out = response.getWriter();
	    
	    System.out.println("ONEMOREQUERY. get page");
	   
	    out.println("<HTML><HEAD><TITLE>");
	    out.println(title);
	    out.println("</TITLE></HEAD><BODY>");
	    out.println("<B>WELCOME USER </BLINK><B>");
	    out.println("<h3>you logged in successfully </br><h3>");
	    out.println("<FORM ACTION=\"" + Configure.SERVLET_SERVER + ":" + Configure.SERVLET_PORT + "/" + Configure.SERVLET_PATH + "/AnalystRequests\" method =\"GET\">");
	    out.println("<TABLE  CELLPADDING=4 BORDER=2>");
		    
	    out.println("<TR><TD>");
	    out.println("<textarea NAME=\"query\" VALUE=\"back entry\" ROWS=\"10\" COLS=\"40\" wrap=\"virtual\">");
	    out.println("</textarea>");
	    out.println("</TD></TR>");
		    
	    EasyPrint.printButton("submit","ownquery","Make query",out);
	    EasyPrint.printButton("reset","clear","Clear the form and Start over",out);    
	    EasyPrint.printButton("submit","logout","Logout",out);
	    EasyPrint.printButton("hidden","fromanalystquerypage","fromanalystquerypage",out);    
	    EasyPrint.printButton("text","getlocation","type location here",out);
	    EasyPrint.printButton("submit","locationbutton","Make query ",out);
	    EasyPrint.printButton("submit","workerloadbutton","Complaints per Worker",out);
	    
	    out.println("</TABLE></FORM></BODY></HTML>");
	   
	    out.close();
	}catch(Exception sqle){
	    System.out.println( "exception in GET in getPage   " );
	    System.out.println(sqle);
	    
	}
    }
    
    	    

    public  static void errorCode(HttpServletRequest request,HttpServletResponse response)
	throws ServletException, IOException{
	try{
	    PrintWriter  out;
	    String  title = "WELCOME USER";
	    
	    response.setContentType("text/html"); 
	    out = response.getWriter();
	    
	   
	    out.println("<HTML><HEAD><TITLE>");
		title = "LOGIN FAILURE";
		out.println(title);
		out.println("</TITLE></HEAD><BODY>");
		out.print("<a href=\"http://www.cse.iitb.ac.in/~gavaskar/proj/log.html\"> Try Again");
		out.println("</BODY></HTML>");
		out.close();
	
	}catch(Exception sqle){
	    System.out.println( "exception in GET " );
	    System.out.println(sqle);
	}   
 }
    
}



