protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException, SQLException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        Connection con=(Connection)Konekcija.konekcija();
        int zahtev=0;
        
         String []g = request.getParameterValues("check");
        String dugme=request.getParameter("dugme");
        
        if(dugme.equalsIgnoreCase("dodaj")){
        
              if (g != null) {
                for (int i = 0; i < g.length; i++) {
                     
              String ime=g[i];
                Statement st1=null;
              Statement st=null;
              ResultSet rs=null;
              Statement st2=null;
              try{
              
              st=con.createStatement();
              rs=st.executeQuery("select * from zahtev where ime='"+ime+"'");
              
              if(rs.next()){
              
                    String upit1 = "INSERT INTO korisnik (korisnickoIme,ime,prezime,lozinka,adresa,telefon,email,vrstaKorisnika,zahtev) "
                        + "VALUES ('"+rs.getString(1)+"','"+rs.getString(2)+"','"+rs.getString(3)+"','"+rs.getString(4)+"','"+rs.getString(5)+"','"+rs.getString(6)+"','"+rs.getString(7)+"','"+rs.getString(8)+"','"+zahtev+"')";
                 
              st1=con.createStatement();
             st1.executeUpdate(upit1);
              st2=con.createStatement();
              int zahtev1=1;
              st2.executeUpdate("UPDATE zahtev set zahtev='"+zahtev1+"' where ime='"+ime+"'");
              out.println("<a href='logovanjeAdministratora.jsp'>Uspesno ste odobrili zahteve</a>");
              }
              
              }catch(SQLException e){}
              
              
                }
              }
        }else if(dugme.equalsIgnoreCase("odbij")){
         if (g != null) {
                for (int i = 0; i < g.length; i++) {
                     
              String ime=g[i];
                
            Statement st2=null;
            
            try{
             int zahtev1=1;
                st2=con.createStatement();
                st2.executeUpdate("UPDATE zahtev set zahtev='"+zahtev1+"' where ime='"+ime+"'");
                out.println("Odbili ste zahtev za registraciju");
                RequestDispatcher dis=request.getRequestDispatcher("logovanjeAdministratora.jsp");
                dis.forward(request, response);
            }catch(SQLException e){}
        }
              }
        
        
        }
         
    }