|
<%
idRelJVC = Request.QueryString("idRelJVC")
IDJ = Request.QueryString("IDJ")
IDV = request.QueryString("IDV")
Response.Write(idRelJVC)
Set rsDelJVC = Server.CreateObject("ADODB.Recordset")
sqlDelJVC = "DELETE FROM RelVenteJoueurCompte_club WHERE id=" & idRelJVC
Openrs rsDelJVC, sqlDelJVC
PrixVente = DLookUp("Ventes_club", "PrixVente", "id=" & IDV)
JVComptePaid = 0
JVCompteToPay = 0
Set rsRelJVCompte = Server.CreateObject("ADODB.Recordset")
sqlRelJVCompte = "SELECT * FROM RelVenteJoueurCompte_club WHERE idJ=" & IDJ & " AND idV=" & IDV
openrs rsRelJVCompte, sqlRelJVCompte
If not rsRelJVCompte.eof then
While not rsRelJVCompte.eof
JVComptePaid = JVComptePaid + rsRelJVCompte("montantPaye")
rsRelJVCompte.movenext
Wend
end if
rsRelJVCompte.close
set rsRelJVCompte = nothing
Set rsRelJV = Server.CreateObject("ADODB.Recordset")
sqlRelJV = "SELECT * FROM RelVenteJoueur_club WHERE idJ=" & IDJ & " AND idV=" & IDV
openrs rsRelJV, sqlRelJV
If not rsRelJV.eof then
TotalVente = 0
While not rsRelJV.eof
Nbre = rsRelJV("NbPces")
TotalVente = TotalVente + (PrixVente * Nbre)
rsRelJV.movenext
Wend
JVCompteToPay = TotalVente - JVComptePaid
end if
rsRelJV.close
set rsRelJV = nothing
If Request.QueryString("location") = "admin" then
Response.Redirect("mypayventeadmin.asp?idJ=" & IDJ & "&idV=" & IDV & "&APayer=" & JVCompteToPay)
else
Response.Redirect("mypayvente.asp?idJ=" & IDJ & "&idV=" & IDV & "&APayer=" & JVCompteToPay)
end if
%>
|