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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
|
<%
session.LCID=&H040c
Response.Buffer=True
'on error resume next
if session("pseudo") = "" and session("pass") = "" then response.redirect("index.asp")
Set Connection = Server.createObject ("ADODB.Connection")
Connection.Open "dsn=sqlads;uid=yyyyyy;password=xxxxxxx"
......
tous les request
......
SQL_categ = "SELECT * FROM categorie order by nomcateg asc"
SET catego = Connection.execute(SQL_categ)
SQL_taille_geslain = "SELECT * FROM couleurtaillegeslain where type0 = 'taille'"
SET tailledeb = Connection.execute(SQL_taille_geslain)
SQL_couleur_geslain = "SELECT * FROM couleurtaillegeslain where type0 = 'couleur'"
SET couleurdeb = Connection.execute(SQL_couleur_geslain)
select case action
case ""
SQL_liste = "SELECT * FROM produit order by "&tri&" "&ord&""
SET liste = Connection.execute(SQL_liste)
case "del"
if ok = 1 then
req_del = "DELETE from produit where id="&ID
Set RS1 = connection.execute(req_del)
Set RS1=Nothing
dim fso
set fso = Server.CreateObject("Scripting.FileSystemObject")
dir = Server.MapPath("/geslain/images/product/")
if fso.folderexists (dir &"\"& ID) then
fso.deletefolder (dir &"\"& ID)
end if
response.redirect("produit.asp")
end if
case "modif"
SQM = "SELECT * FROM produit where id="&ID
SET affiche = Connection.execute(SQM)
ant_coul = affiche("couleur")
ant_taille = affiche("taille")
ant_couleur = replace(ant_couleur,",",";")
ant_taille = replace(ant_taille,",",";")
Dim tabcoul,tabtaille
tabcoul=Split(ant_couleur,";")
tabtaille=Split(ant_taille,";")
nbcoul = ubound(tabcoul)
nbtaille = ubound(tabtaille)
if bouton = "modif" then
if nomprod <> "" and nomprodgb <> "" and prix <> "" and categorie <> "" then
REQUPD = "UPDATE produit SET refprod='"&replace(trim(refprod),"'","''")&"',nomprod='"&replace(trim(nomprod),"'","''")&"' ,nomprodgb='"&replace(trim(nomprodgb),"'","''")&"', descriptif='"&replace(trim(descriptif),"'","''")&"',descriptifgb='"&replace(trim(descriptifgb),"'","''")&"' ,categorie='"&replace(trim(categorie),"'","''")&"',prix='"&replace(trim(prix),"'","''")&"', prixclub='"&replace(trim(prixclub),"'","''")&"', promo='"&replace(trim(promo),"'","''")&"' WHERE id="&ID
SET RS = connection.execute(REQUPD)
SET RS = Nothing
response.redirect("produit.asp")
else
message="<font color=red>Des champs n'ont pas t remplis !!! Vrifiez votre saisie !</font><br>Vrifiez les champs <b>Nom produit (Fr et Gb)</b> et <b>prix</b> et <b>catgorie</b>."
end if
end if
end select
%>
<html>
<head>
</head>
<body bgcolor=#333333>
<center><img src="../images/logo.png"><br>
<%=message%>
<% select case action %>
<% case "modif" %>
<table>
<tr>
<td align="center"><h2>Modification d'un produit 6-0</h2></td>
</tr>
<form action="#" method="post">
<tr>
<td align="right" valign="middle">
<% if affiche("photo") <> "" then %><a href="image_prod.asp?ID=<%=affiche("id")%>&img=<%=affiche("photo")%>">Modifier cette image</a><br><a href="?ID=<%=affiche("id")%>&action=modif&actimg=delimg&img=<%=affiche("photo")%>">Supprimer cette image</a></td>
<td><img src="../images/product/<%=affiche("id")%>/petit_<%=affiche("photo")%>" border="1" width="50" height="50">
<% else %>
<a href="image_prod.asp?dest=liens&ID=<%=affiche("id")%>">Ajouter une image pour illustrer ce produit</a>
<% end if %>
</td>
</tr>
<tr>
<td valign="top" align="left" colspan="2">
<table border=0>
<tr><td>
<% rem affichage des couleurs/ %>
<% do while not couleurdeb.EOF
var = "<input type=checkbox name='couleur' value="& couleurdeb("nom")
For i = 0 to nbcoul
if couleurdeb("nom") = tabcoul(i) then var = var & " Checked"
next
var = var & ">"&couleurdeb("nom")
response.write var&"<br>"
couleurdeb.movenext
loop
couleurdeb.close
Set couleurdeb = nothing %><br><br>
</td>
<td>
<% rem affichage des tailles %>
<% do while not tailledeb.EOF
response.write "<input type=checkbox name='taille' value="& tailledeb("nom") &">"&tailledeb("nom")&"<br>"
tailledeb.movenext
loop
tailledeb.close
Set tailledeb = nothing %><br><br>
</td>
</tr>
</form>
</table>
<% end select %> |
Partager