Sunteți pe pagina 1din 4

Utilisation de la Table ASP/HTML :

<%@LANGUAGE="VBSCRIPT"%> <html> <head> <title>F2</title> </head> <body background="images/bg1.jpg"> <center><IMG SRC="images/Ltomb.gif" BORDER="0"></center> <!--#include file="Outiles\Connexion.asp" --> <!--#include file="Outiles\MonModule.asp" --> <% SQL="SELECT*FROM TOMBOLA"

col = array("0" , "Evnement" , ClesEtr=Array()

"1" , "Date Lancement" , "2" ,"Date Tirage" )

call afficheTable (CNN , "TOMBOLA", "Code_Tombola" ,SQL, col ,ClesEtr, true) %> </center> <!--#include file="Outiles\FinConnexion.asp" --> </body> </html>

<%@LANGUAGE="VBSCRIPT"%> <html> <head> <title>F4</title> </head> <body background="images/bg1.jpg"> <center><img src="images/LPrix.gif" BORDER="0"></center> <!--#include file="Outiles\Connexion.asp" --> <!--#include file="Outiles\MonModule.asp" --> <%

CodeTomb=Request.QueryString("Tombola") NCat=Request.QueryString("Catgorie") SQL="SELECT Ref_Prix,Libell_Prix,Valeur_Prix,N_Facture,Nom_Gagnant" _ +" FROM PRIX WHERE Code_Tombola="+CodeTomb _ +" AND N_Catgorie="+NCat col = array("0" , "Libell_Prix" , "1" , "Valeur_Prix" ,"2","N_Facture","3","Nom_Gagnant" ) Etr=array("Code_Tombola",CodeTomb,"N_Catgorie",NCat) call afficheTable (CNN , "PRIX" , "Ref_Prix" ,SQL, col ,Etr, true) %> </body> </html>

Remplir des ComboBox :


<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <html> <head> <title>F3</title> </head> <body background="images/bg1.jpg" onload='javaScript:document.getElementById("Form1").submit();'> <center><b> <!--#include file="Outiles\Connexion.asp" --> <% Dim RS1,RS2 Set RS1 = Server.CreateObject("ADODB.RecordSet") Set RS2 = Server.CreateObject("ADODB.RecordSet") RS1.Open "SELECT*FROM TOMBOLA",CNN RS2.Open "SELECT*FROM CATEGORIE",CNN %> <form name="form1" action="F4.asp" method="get" target="F4"> Tombola : <select name="Tombola" onChange='javaScript:document.getElementById("Form1").submit();'> <% Do Until RS1.Eof %> <option value="<%=RS1.Fields("Code_Tombola")%>"> <%=RS1.Fields("Code_Tombola")%>&nbsp;&nbsp;&nbsp;<%=RS1.Fields("Evnement") %> <%RS1.MoveNext Loop %> </select> Catgorie: <select name="Catgorie" onChange='javaScript:document.getElementById("Form1").submit();'>

<% Do Until RS2.Eof %> <option value="<%=RS2.Fields("N_Catgorie")%>"> <%=RS2.Fields("Libell_Catgorie")%> <% RS2.MoveNext Loop %> </select> </form> <% RS1.Close RS2.Close Set RS1 = Nothing Set RS2 = Nothing %> <!--#include file="Outiles\FinConnexion.asp" --> </body> </html>

Authentification :
<HTML> <HEAD> <TITLE></title> </head> <BODY background="image/bg.jpg" onLoad="javascript:document.forms[0].submit();"> <CENTER> <!--#include file="Connexion.asp"--> <% Dim pseudo, mdp ,rsd, RS , Existe, MdpVrai , matricule , nom , prenom, admin pseudo=Request.Form("pseudo") mdp=Request.Form("mdp") if pseudo <> "" then set rsd=server.CreateObject("ADODB.RecordSet") rsd.Open "select * from Utilisateur " , Conn WHILE Not rsd.EOF if pseudo=rsd.Fields("pseudo").Value then Existe = true if mdp=rsd.Fields("mdp").Value then mdpVrai = true matricule = rsd.Fields("matricule") admin = rsd.Fields("admin") nom = rsd.Fields("nom") prenom = rsd.Fields("prenom") end if end if rsd.MoveNext Wend rsd.Close

if not Existe then response.Write("<FONT color=red size=10>L'utilisateur: <B>" & pseudo & "</b> n'existe pas!</font>") elseif mdpVrai then if admin then Response.Write("Bienvenue <B>" & prenom & " " & nom & "</b> (Administrateur)<BR>") else Response.Write("Bienvenue <B>" & prenom & " " & nom & "</b><BR>") end if ----------------------------------------------------------------------Response.Write("<FORM name=form1 action=Resultat.asp method=get target=Bas >") Response.Write("Type Opration:") Response.Write("<INPUT TYPE=HIDDEN NAME=matricule VALUE=" & matricule & " >") Response.Write("<INPUT TYPE=HIDDEN NAME=admin VALUE=" & admin & " >") Response.Write("<SELECT name=Operation ") Response.Write("onChange='javaScript:document.forms[0].submit();'>") SET RS = Server.CreateObject("ADODB.RecordSet") RS.Open "SELECT * FROM Operation ",Conn WHILE NOT RS.EOF if (NOT RS.Fields("Protege")) OR (RS.Fields("Protege") AND admin) then Response.Write("<OPTION VALUE=" & RS.Fields("N_Operation") & " >" & RS.Fields("Operation") & "</option>") end if RS.MoveNext WEND RS.Close Response.Write("</select> ") 'Response.Write("<INPUT type=submit name=Valider value=Valider >") Response.Write("</form>") else Response.Write("<FONT color=red size=10>mot de passe incorrecte!</font>") end if End if %> <!--#include file="FinConnexion.asp"--> </body> </html>

S-ar putea să vă placă și