%@language="VBScript"%>
<% Response.Expires = -1 %>
<%
if request("typ") = "prodejka" then
text = ""
cena_celkem = 0
id_prodejka = request("id")
Set rs3 = CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM s_prodejka2 WHERE id_s_prodejka = " & request("id")
rs3.Open strSQL, conn, 1, 1
if rs3.eof then response.write " " end if
do while not rs3.eof
id_s_zbozi = rs3("id_s_zbozi")
Set rs2 = CreateObject("ADODB.RecordSet")
strSQL = "SELECT nazev_zbozi FROM s_zbozi WHERE id_s_zbozi = " & rs3("id_s_zbozi")
rs2.Open strSQL, conn, 1, 1
if not rs2.eof then
nazev_zbozi = rs2(0)
zbozi = true
else
nazev_zbozi = ""
zbozi = false
end if
text = text & "" & nazev_zbozi & "
" & rs3("ks") & " ks | " & rs3("cena") & " Kè
"
rs3.movenext
loop
elseif request("typ") = "prijemka" then
text = ""
cena_celkem = 0
id_prijemka = request("id")
Set rs3 = CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM s_prijemka2 WHERE id_s_prijemka = " & request("id")
rs3.Open strSQL, conn, 1, 1
if rs3.eof then response.write " " end if
do while not rs3.eof
id_s_zbozi = rs3("id_s_zbozi")
Set rs2 = CreateObject("ADODB.RecordSet")
strSQL = "SELECT nazev_zbozi FROM s_zbozi WHERE id_s_zbozi = " & rs3("id_s_zbozi")
rs2.Open strSQL, conn, 1, 1
if not rs2.eof then
Set rs4 = CreateObject("ADODB.RecordSet")
strSQL = "SELECT id_zbozi FROM zbozi WHERE id_s_zbozi = " & rs3("id_s_zbozi")
rs4.Open strSQL, conn, 1, 1
if not rs4.eof then
id_zbozi = rs4(0)
else
id_zbozi = 0
end if
rs4.close
nazev_zbozi = rs2(0)
zbozi = true
else
nazev_zbozi = ""
nazev2 = ""
zbozi = false
id_zbozi = 0
end if
rs2.close
cena = rs3("cena_po_sleve")
if id_zbozi > 0 then
www = " | web"
else
www = ""
end if
text = text & "" & nazev_zbozi & "
" & rs3("ks") & " ks | " & cena & " Kè s náklady" & www & "
"
rs3.movenext
loop
elseif request("typ") = "obj" then
text = ""
cena_celkem = 0
id_obj = request("id")
Set rs3 = CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM obj2 WHERE id_obj = " & request("id")
rs3.Open strSQL, conn, 1, 1
if rs3.eof then response.write " " end if
do while not rs3.eof
id_zbozi = rs3("id_zbozi")
Set rs2 = CreateObject("ADODB.RecordSet")
strSQL = "SELECT nazev_zbozi FROM s_zbozi WHERE id_s_zbozi = ANY (SELECT id_s_zbozi FROM zbozi WHERE id_zbozi = " & rs3("id_zbozi") & ")"
rs2.Open strSQL, conn, 1, 1
if not rs2.eof then
nazev_zbozi = rs2(0)
zbozi = true
else
nazev_zbozi = ""
nazev2 = ""
zbozi = false
end if
if rs3("darek") = true then
darek = " | dárek"
else
darek = ""
end if
text = text & "" & nazev_zbozi & "
" & rs3("ks") & " ks | " & rs3("cena") & " Kè" & darek & "
"
rs3.movenext
loop
elseif request("typ") = "dobropis" then
text = ""
cena_celkem = 0
id_prodejka = request("id")
Set rs3 = CreateObject("ADODB.RecordSet")
strSQL = "SELECT cena, ks, id_s_zbozi FROM s_dobropis2 WHERE id_s_dobropis = " & request("id")
rs3.Open strSQL, conn, 1, 1
if rs3.eof then response.write " " end if
do while not rs3.eof
id_s_zbozi = rs3("id_s_zbozi")
Set rs2 = CreateObject("ADODB.RecordSet")
strSQL = "SELECT nazev_zbozi FROM s_zbozi WHERE id_s_zbozi = " & rs3("id_s_zbozi")
rs2.Open strSQL, conn, 1, 1
if not rs2.eof then
nazev_zbozi = rs2(0)
zbozi = true
else
nazev_zbozi = ""
zbozi = false
end if
text = text & "" & nazev_zbozi & "
" & rs3("ks") & " ks | " & rs3("cena") & " Kè
"
rs3.movenext
loop
end if
text = replace(text,"'","\'")
response.write "vypisText('" & request("radek") & "','
" & text & "')"
%>