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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
|
<% Response.Expires = -1
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "cache-control", "no-store"
' connexion base et requetes
set MaConn=Server.CreateObject("ADODB.Connection")
set rstAff2=Server.CreateObject("ADODB.Recordset")
MaConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath ("gestion.mdb") & ";Persist Security Info=False"
affichageClient="SELECT civilite.civilAbreg, client.* FROM client, civilite WHERE client.idCivil=civilite.idCivil AND client.idClient=" & Request("idClient")
set rstAff=MaConn.Execute (affichageClient)
'partie recherche
if not trim(Request("rechercheRef")) = "" then
reqRef = " AND produit.prodLib like '" & trim(Request("rechercheRef")) & "%' "
else
reqRef = ""
end if
if not trim(Request("rechercheCateg")) = "" then
reqCateg = " AND produit.idCateg=" & trim(Request("rechercheCateg"))
else
reqCateg = ""
end if
affichageProduit="SELECT produit.idProd, produit.prodRef, produit.prodLib, produit.prodDescr, produit.prodPu, categorie.catLib From categorie, produit Where categorie.idCateg = produit.idCateg " & reqRef & reqCateg & order
rstAff2.Open affichageProduit,MaConn,1,1
if not rstAff2.EOF then
rstAff2.PageSize=6
rstAff2.AbsolutePage=Request("Page")
end if
if Request("idCommande")="" then
reqNbCommande="SELECT MAX(commandeTemp.idComm)AS NumCommande from commandeTemp"
set rstNbComm=MaConn.Execute(reqNbCommande)
if IsNull(rstNbComm("NumCommande")) then
numCommande=1
else
numCommande=rstNbComm("NumCommande")+0
end if
else
numCommande = Request("idCommande")
end if
affichageProduitCommande="SELECT produit.idProd, produit.prodRef, produit.prodLib, produit.prodPu, commanderTemp.comQt, commanderTemp.Nomabo, [produit.prodPu]*[commanderTemp.comQt] AS Total FROM produit, commanderTemp WHERE commanderTemp.idProd = produit.idProd AND commanderTemp.idComm = " & numCommande
set rstAff3=MaConn.Execute(affichageProduitCommande)
TotalCommande="SELECT Sum([comQt]*[prodPu]) AS TotalComm from commanderTemp, produit Where commanderTemp.idProd = produit.idProd AND commanderTemp.idcomm = " & numCommande & " GROUP BY commanderTemp.idComm;"
set rstTot=MaConn.Execute(TotalCommande)
affichageCateg="SELECT categorie.catLib, categorie.idCateg FROM categorie"
set rstAffCateg=MaConn.Execute(affichageCateg)%>
<html>
<head>
<title>commande</title>
<LINK REL="stylesheet" TYPE="text/css" HREF="style.css">
<link rel="stylesheet" media="print" href="impression.css">
<script language="JavaScript">
var quantit = new Number(0);
var nomabon = new String("");
function Ajout(IdProd,prodLib) {
quantit = eval('document.ListeProduit.comQt'+IdProd+'.value');
nomabon = eval('document.ListeProduit.Nomabo'+IdProd+'.value');
if (isNaN(quantit)) {
alert("Quantité incorrecte");
}
else {
if (quantit >= 1) {
window.open('ajoutProdComm.asp?idProd='+IdProd+'&comQt='+parseInt(quantit)+'&Nomabo='+nomabon+'&idComm=<%=numCommande%>&idClient=<%=Request("idClient")%>&Page=<%=Request("Page")%>&rechercheRef=<%=Request("rechercheRef")%>&rechercheCateg=<%=Request("rechercheCateg")%>&Tri=<%=Request("Tri")%>','_self','');
}
else{
alert("Quantité incorecte");
}
}
}
function quote(s) {
sss=new String();
for(i=0;i<s.length;i++) {
if(s.substring(i,i+1)!="'")
{sss=sss+s.substring(i,i+1); }
else
{sss=sss+"'"+s.substring(i,i+1);}
}
return(sss);
}
<body background="images/menubackgroundcont.gif" onload="DivLoad.style.visibility='hidden';MettreFocus();">
'partie catalogue
<tr class="seeme">
<th bgcolor="#B0F5FF" width="7%" class="seeme" style="border-top-style: solid; border-top-width: 1px">
<% If AscRef = true then %>
<a href="passerCommande.asp?Tri=2&Page=<%=Request("Page")%>&idClient=<%=Request("idClient")%>&idCommande=<%=Request("idCommande")%>&rechercheRef=<%=Request("rechercheRef")%>&rechercheCateg=<%=Request("rechercheCateg")%>">Ref</a>
<% Else %>
<a href="passerCommande.asp?Tri=1&Page=<%=Request("Page")%>&idClient=<%=Request("idClient")%>&idCommande=<%=Request("idCommande")%>&rechercheRef=<%=Request("rechercheRef")%>&rechercheCateg=<%=Request("rechercheCateg")%>">Ref</a>
<% End If %>
</th>
<th bgcolor="#B0F5FF" width="48%" class="seeme" style="border-top-style: solid; border-top-width: 1px">
<% If AscLib = true then %>
<a href="passerCommande.asp?Tri=4&Page=<%=Request("Page")%>&idClient=<%=Request("idClient")%>&idCommande=<%=Request("idCommande")%>&rechercheRef=<%=Request("rechercheRef")%>&rechercheCateg=<%=Request("rechercheCateg")%>">Libellé</a>
<% Else %>
<a href="passerCommande.asp?Tri=3&Page=<%=Request("Page")%>&idClient=<%=Request("idClient")%>&idCommande=<%=Request("idCommande")%>&rechercheRef=<%=Request("rechercheRef")%>&rechercheCateg=<%=Request("rechercheCateg")%>">Libellé</a>
<% End If %>
</th>
<th bgcolor="#B0F5FF" width="7%" class="seeme" style="border-top-style: solid; border-top-width: 1px">
<% If AscPri = true then %>
<a href="passerCommande.asp?Tri=6&Page=<%=Request("Page")%>&idClient=<%=Request("idClient")%>&idCommande=<%=Request("idCommande")%>&rechercheRef=<%=Request("rechercheRef")%>&rechercheCateg=<%=Request("rechercheCateg")%>">Prix</a>
<% Else %>
<a href="passerCommande.asp?Tri=5&Page=<%=Request("Page")%>&idClient=<%=Request("idClient")%>&idCommande=<%=Request("idCommande")%>&rechercheRef=<%=Request("rechercheRef")%>&rechercheCateg=<%=Request("rechercheCateg")%>">Prix</a>
<% End If %>
</th>
<th bgcolor="#B0F5FF" width="5%"class="seeme" style="border-top-style: solid; border-top-width: 1px">
<font color="#008080">Quantité
</font>
</th>
<th bgcolor="#B0F5FF" width="11%"class="seeme" style="border-top-style: solid; border-top-width: 1px">
<font color="#008080">Nom Abonné
</font>
</tr>
<% dim i
i=0
DO WHILE NOT (rstAff2.EOF or i=6)%>
<tr class="seeme">
<td bgcolor="#E8FCFF" width="7%" class="seeme"><%=rstAff2("prodRef")%> </td>
<td bgcolor="#E8FCFF" width="48%" class="seeme"><%=rstAff2("prodLib")%> </td>
<td bgcolor="#E8FCFF" align="right" width="7%" class="seeme"><%=FormatNumber(rstAff2("prodPu"),2,-1,0,-1)%> </td>
<td bgcolor="#E8FCFF" align="right" width="5%" class="seeme">
<p align="center">
<input type="text" name="comQt<%=rstAff2("idProd")%>" size="5" value="1" align="center" style="font-size: 10;"></td>
<td bgcolor="#E8FCFF" align="right" width="11%" class="seeme">
<p align="center">
<input type="text" name="Nomabo<%=rstAff2("idProd")%>" size="18" value="" align="center" style="font-size: 10;"></td>
<td bgcolor="#FFFFFF" align="center" width="13%" class="seeme"><a href="javascript:centrerPopup('descriptifProduit.asp?idProd=<%=rstAff2("idProd")%>',310,280,'menubar=no,scrollbars=yes,statusbar=no')">
<font color="#FF0000">Descriptif</font></a></td>
<td bgcolor="#FFFFFF" align="center" width="6%" class="seeme">
<font color="#FF0000">
<% rstNbDansComm="SELECT COUNT(commanderTemp.idProd) AS Nombre From commanderTemp WHERE commanderTemp.idComm = " & numCommande & " AND commanderTemp.idProd = " & rstAff2("idProd")
set rstNbProd=MaConn.Execute(rstNbDansComm)
if rstNbProd("Nombre")=0 then%>
</font>
<a href="javascript:Ajout(<%=rstAff2("idProd")%>,'<%=replace(rstAff2("prodLib"),"'","\'")%>')">
<font color="#FF0000">Ajouter</font></a></td>
<%end if%>
</tr>
<% rstAff2.MoveNext
i=i+1
LOOP%>
'partie panier
<table cellspacing="2" cellpadding="2" border="2" bordercolor=#000000 width="100%" class="petit" class="noseeme" style="border-left-width: 0px; border-right-width: 0px; border-top-width: 0px">
<tr>
<td colspan="6" align="center" style="border-style: none; border-width: medium">
</tr>
<tr>
<th bgcolor="#FFFF84" style="border-style: solid; border-width: 1px" width="11%">Référence</th>
<th bgcolor="#FFFF84" style="border-style: solid; border-width: 1px" width="26%">Libellé</th>
<th bgcolor="#FFFF84" style="border-style: solid; border-width: 1px" width="11%">Prix</th>
<th bgcolor="#FFFF84" style="border-style: solid; border-width: 1px" width="8%">Quantité</th>
<th bgcolor="#FFFF84" style="border-style: solid; border-width: 1px" width="12%">Nom Abonné</th>
<th bgcolor="#FFFF84" style="border-left-style: solid; border-left-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" width="23%">Total</th>
</tr>
<% DO WHILE NOT rstAff3.EOF %>
<tr>
<td bgcolor="#FFFFBB" style="border-style: solid; border-width: 1px" width="11%"><%=rstAff3("prodRef")%> </td>
<td bgcolor="#FFFFBB" style="border-style: solid; border-width: 1px" width="26%"><%=rstAff3("prodLib")%> </td>
<td bgcolor="#FFFFBB" align="right" style="border-style: solid; border-width: 1px" width="11%"><%=FormatNumber(rstAff3("prodPu"),2,-1,0,-1)%> </td>
<td bgcolor="#FFFFBB" align="right" style="border-style: solid; border-width: 1px" width="8%"><%=rstAff3("comQt")%> </td>
<td bgcolor="#FFFFBB" align="right" style="border-style: solid; border-width: 1px" width="12%"><%=rstAff3("Nomabo")%> </td>
<td bgcolor="#FFFFBB" align="right" style="border-style: solid; border-width: 1px" width="23%"><%=FormatNumber(rstAff3("Total"),2,-1,0,-1)%> </td>
<td bgcolor="#FFFFFF" align="center" class="seeme" style="border-left-style: solid; border-left-width: 1px; border-right-style: solid; border-right-width: 1px" width="15%"><a href="SuppProdComm.asp?idProd=<%=rstAff3("idProd")%>&idComm=<%=numCommande%>&idClient=<%=Request("idClient")%>&Page=<%=Request("Page")%>&rechercheRef=<%=Request("rechercheRef")%>&rechercheCateg=<%=Request("rechercheCateg")%>&Tri=<%=Request("Tri")%>">
<font color="#FF0000">Retirer</font></a></td>
</tr>
<% rstAff3.MoveNext
LOOP%>
<tr>
<% MaConn.Close %> |
Partager