Voici une partie de mon code où il y a notamment l'image clicable delete.gif. Mon problème est de savoir où insérer le bout de code. Je ne suis pas bien douée !!!
<!--#include file="adovbs.inc"-->
<!--#include file="dsn.asp"-->
<%
Response.Expires =0
If IsEmpty(Request.QueryString("Date" )) OR NOT IsDate(Request.QueryString("Date" )) Then
dDate = Date
Else
dDate = CDate(Request.QueryString("Date" ))
End If
%>
<html>
<head>
<title>Events for <%= FormatDateTime(dDate, 1) %></title>
</head>
<body BACKGROUND="images/image3.gif" LEFTMARGIN="5">
<p> </p>
<p ALIGN="RIGHT"><img SRC="images/events.gif" WIDTH="400" HEIGHT="50" BORDER="0" ALT></p>
<p><br CLEAR="ALL">
<%
' Open a record set of schedules
Response.Write "<FONT COLOR='Gray' FACE='Tahoma, Verdana' SIZE=2>" & FormatDateTime(dDate, 1) & "</FONT><BR><BR>" & vbCrLf
Set Rs = Server.CreateObject("ADODB.RecordSet" )
' ancienne instruction qui ne tourne pas sSQL = "SELECT * FROM tEvents " & "WHERE Start_Date <= #" & dDate & "# AND End_Date >= #" & dDate & "# ORDER BY Event_ID "
sSQL = "SELECT * FROM tEvents"
sSQL = sSQL & " WHERE (((year(Start_Date) < " & year(dDate) & " )" & "OR"
sSQL = sSQL & "((month(Start_Date) < " & month(dDate) & " )" & "AND"
sSQL = sSQL & "(year(Start_Date) = " & year(dDate) & " ))" & "OR"
sSQL = sSQL & "((day(Start_Date) <= " & day(dDate) & " )" & "AND"
sSQL = sSQL & "(month(Start_Date) = " & month(dDate) & " )" & "AND"
sSQL = sSQL & "(year(Start_Date) = " & year(dDate) & " )))" & "AND"
sSQL = sSQL & "((year(End_Date) > " & year(dDate) & " )" & "OR"
sSQL = sSQL & "((month(End_Date) > " & month(dDate) & " )" & "AND"
sSQL = sSQL & "(year(End_Date) = " & year(dDate) & " ))" & "OR"
sSQL = sSQL & "((day(End_Date) >= " & day(dDate) & " )" & "AND"
sSQL = sSQL & "(month(End_Date) = " & month(dDate) & " )" & "AND"
sSQL = sSQL & "(year(End_Date) = " & year(dDate) & " ))))"
sSQL = sSQL & " ORDER BY Start_Date, Event_Title DESC "
Rs.Open sSQL, sDSN, adOpenStatic, adLockReadOnly, adCmdText
If NOT Rs.EOF Then
arrColor =Array("#000000", "#CC9900", "#336600", "#FFCC66", "#0000FF", "#FF0000", "#33cc66","#cccc66","#FF3399","#FF0000","#CC3366
" )
iIndex = 0
Do While NOT Rs.EOF
' Create the outer table
Response.Write "<TABLE WIDTH='100%' BORDER='0' CELLSPACING='0' CELLPADDING='1' BGCOLOR='" & arrColor(iIndex) & "'><TR><TD>" & vbCrLf
' Create the inner table
Response.Write "<TABLE WIDTH='100%' CELLSPACING=0 BORDER=0 CELLPADDING=2 BGCOLOR='White'>" & vbCrLf
Select Case month(dDate)
Case 1 Couleur="#FFFF99"
Case 2 Couleur="#FFFF99"
Case 3 Couleur="#FFFF99"
Case 4 Couleur="#FFFF99"
Case 5 Couleur="#FFFF99"
Case 6 Couleur="#FFFF99"
Case 7 Couleur="#FFFF99"
Case 8 Couleur="#FFFF99"
Case 9 Couleur="#FFFF99"
Case 10 Couleur="#FFFF99"
Case 11 Couleur="#FFFF99"
Case 12 Couleur="#FFFF99"
End select
Response.Write "<TR BGCOLOR='" & Couleur & "'><TD HEIGHT=20 VALIGN='top'><B><FONT FACE='Verdana, Tahoma' SIZE='1' COLOR='gray'>" & vbCrLf
Response.Write "<FONT FACE='Verdana' SIZE=1 COLOR='#0080c0'></font face='Verdana, Tahoma' SIZE='1' COLOR='Black'>" & Rs("Intitule" ) & VbCrLf
Response.Write "</FONT></B> </TD>" & vbCrLf
If (Session("Admin" ) = 1 and Session("Passe" ) = Rs("Mot" )) or (Session("Admin" ) = 1 and Session("Passe" ) = "admin" ) Then
Response.Write "<TD align='right' HEIGHT=20 WIDTH=92 VALIGN='MIDDLE'><A HREF='addedit.asp?Event_ID=" & Rs("Event_ID" ) & "'><IMG SRC='images/edit.gif' BORDER=0 HEIGHT=20 WIDTH=90></A></TD>" & vbCrLf
Response.Write "<TD HEIGHT=20 WIDTH=92 ALIGN='right' VALIGN='MIDDLE'><A HREF='delete.asp?date=" & Server.URLEncode(dDate) & "&Event_ID=" & Rs("Event_ID" ) & "'><IMG SRC='images/delete.gif' BORDER=0 HEIGHT=20 WIDTH=90></A></TD>" & vbCrLf
End If
Response.Write "</TR>" & vbCrLf