1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
| <%@page import="uuu.user"%>
<%@page import="grp.group"%>
<%@page import="bdd.connexion"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!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">
<!-- refresh toutes les 60 secondes -->
<title>Acceuil</title>
<style>
<!--
.text
{
background-color:white;
color:#413C3C;
-moz-border-radius: 30px;
-webkit-border-radius: 0px;
border-radius:5px;
width:80%;
margin-top: 0%;
margin-bottom: 2%;
margin-left:0%;
margin-right:0%;
}
.text:hover
{
background-color: #FFD9DF;
}
-->
</style>
</head>
<body background="back.jpg">
<%@ include file="date.jsp" %>
<%! connexion cnx,cnx1; String res;%>
<form action="" method="post">
<div style="position: absolute; top: 200px; right:510px">
<table align="center" frame="above"style="color:#413C3C">
<tr><th colspan="2" align="center"><img src="inwi.jpg" ></img></th></tr>
<tr><th colspan="2" align="center">Connexion</th></tr>
<tr><th>Login : </th><td><input type="text" name="login" style="width:9.5em" class="text"/></td></tr>
<tr><th>Password : </th><td><input type="password" name="password" style="width:9.5em" class="text" /></td></tr>
<tr><th>Group : </th><td>
<select name="groupname" size="1" style="width:10em" class="text">
<% cnx1=new connexion("inwi");
cnx1.Lire("SELECT `GroupName` FROM `group`");
while(cnx1.Suiv()){
res = cnx1.getrs().getString(1);%>
<option value = "<%=res%>"><%=res%></option>
<%}%>
</select>
</td>
</tr><tr><tr>
<tr></tr><tr></tr><tr></tr><tr></tr>
<tr>
<td><input type="submit" value="Connect" style="width:7em; height:2em; margin-left:5em;"></td>
<td><input type="reset" value="Reset" style="width:7em; height:2em"></td>
</tr>
</table>
</div>
</form>
<%
if(request.getParameter("login")!=null && request.getParameter("password")!=null )
{
cnx=new connexion("inwi");
String lg=request.getParameter("login");
String pass=request.getParameter("password");
String gr_n=request.getParameter("groupname");
cnx.Lire("select * from `user` where Login='"+lg+"' and Password='"+pass+"' and GroupName='"+gr_n+"'");
cnx.Lire("select * from `group` where GroupName='"+gr_n+"'");
while(cnx.Suiv())
{
group gr=new group(cnx.getrs().getString(1),cnx.getrs().getString(2),cnx.getrs().getString(3),cnx.getrs().getString(4),cnx.getrs().getString(5),cnx.getrs().getString(6));
user uu = new user(cnx.getrs().getString(1),cnx.getrs().getString(2),cnx.getrs().getString(3),cnx.getrs().getString(4),cnx.getrs().getString(5),cnx.getrs().getString(6));
request.getSession().setAttribute("user",uu);
request.getSession().setAttribute("group",gr);
request.getRequestDispatcher("Home.jsp").forward(request, response);
}
}%>
</body>
</html> |
Partager