|
|
 |

<% ID = 77 %>
<% ' #### INKLUDERAR PRODUKTHÄMTNING IFRÅN DATABAS #### %>
<%
IF ID <> "" then
'Listning av specifik marknad
SQL = "SELECT M.ID, M.Company, M.Adress1, M.Adress2, M.Adress3, M.Phone, M.Fax, M.Email, M.Contact, M.Map, M.Scheme, M.other, C.name, C.Email, EC.Cat FROM Market M INNER JOIN Contact C on C.ID = M.Contact INNER JOIN ExpCat EC on C.ExpCat = EC.ID WHERE M.ID = " & ID
set rs = conn.execute(SQL)
if not rs.eof then
ID = rs("ID")
Company = trim(rs("Company"))
Adress1 = trim(rs("Adress1"))
Adress2 = trim(rs("Adress2"))
Adress3 = trim(rs("Adress3"))
Phone = trim(rs("Phone"))
Fax = trim(rs("Fax"))
Email = trim(rs("Email"))
Contact = rs("Contact")
Map = rs("map")
Scheme = trim(rs("Scheme"))
Other = rs("Other")
if Contact <> "0" then
CName = trim(rs("Name"))
CEmail = trim(rs("Email"))
CExp = trim(rs("Cat"))
end if
end if
rs.close
set rs = nothing
%>
<% ' response.write(Company & " " & Adress1 & " Phone:" & Phone & " Fax:" & Fax& " ")
' if Email <> "" then response.write("Email: " & Email & "")
%>
|
<%=company%> |
<%if adress1 <> "" or adress2 <> "" or adress3 <> "" then
response.write(adress1 & " " & adress2 & " " & adress3 & " ")
end if%>
|
<%if phone <> "" then response.write("Phone:" & phone & " ")
if fax <> "" then response.write("Fax:" & fax & " ")
if Email <> "" then response.write("Email: " & Email & "")
%>
|
<%
if Map <> "" then response.write("![]()
")
if Scheme <> "" then response.write("![]()
")
if Other <> "" then response.write("![]()
")
%>
|
<%
'SQL = "SELECT C.ID, C.Name, C.Email, EC.Cat FROM Contact C INNER JOIN ExpCat EC on C.ExpCat = EC.ID INNER JOIN C2M on C2M.MarketID = " & ID
'set rs = conn.execute(SQL)
dim ScriptItem()
counter = 0
'Hämtar alla resterande relaterade kontakter till Marketen i fråga
SQL2 = "SELECT C.ID,C.Email,C.ExpCat,C.Name FROM Contact C INNER JOIN C2M on C2M.ContactID = C.ID WHERE C2M.MarketID='" & ID & "'"
set rs = conn.execute(SQL2,,1)
'Kollar om det finns några relaterade kontakter
if not rs.eof then
while not rs.eof
ConEmail = trim(rs("Email"))
SQLen = ("SELECT Cat FROM ExpCat WHERE ID = " & rs("ExpCat"))
set rsCat = conn.execute(SQLen)
'hämtar deras Expertise-area...
'Om de inte är kopplade så står deras namn istället
if not rsCat.eof then
ConTitle = trim(rsCat("Cat"))
else
ConTitle = trim(rs("Name"))
end if
rsCat.close
set rsCat = nothing
redim preserve ScriptItem(counter)
if ConEmail <> "" then
'Om det finns så sätts nu noCont till 1 vilket tar bort felmarkering
noCont = 1
'Gör en array av de kontakter som finns
ScriptItem(counter) = "| " & trim(rs("name")) & ", " & ConTitle & " | " & ConEmail & " | "
'response.write(ScriptItem(counter))
else
ScriptItem(counter) = "| " & trim(rs("name")) & ", " & ConTitle & " | | "
end if
counter = counter + 1
ConEmail = ""
rs.movenext
wend
end if
if Contact <> "0" or noCont <> 0 then
%>
<%'!-- made by tobis, changed by reHanna --%>
| Contact us: |
E-mail us directly or through our contact-page.
|
<%
if Email <> "" then
response.write("| " & Cname & ", " & CExp & " | " & Cemail & " | ")
else
response.write("| " & Cname & ", " & CExp & " | | ")
end if
if noCont <> 0 then
if counter <> 0 then
for ArrayCounter = 0 To counter-1
response.write(ScriptItem(ArrayCounter) & VbCrLf)
Next
end if
end if
'while not rs.eof
'
' Contact = rs("ID")
' CName = trim(rs("Name"))
' CEmail = trim(rs("Email"))
' CExp = trim(rs("Cat"))
' if CEmail <> "" then CName = CNAme & "-"
'response.write("" & Cname & Cemail & " ")
' rs.movenext
'wend
%>
<%
end if
%>
|
|
 |
<%
else %>
<%
'listning av Marknader
'SQL = "select ID, market from market where id = 1"
'set rs = conn.execute(SQL)
'if not rs.eof then
' I = 1
' ID = rs("ID")
' Market = trim(rs("Market"))
' response.write("" & Market & "
| ")
'end if
SQL = "select ID, ContID, Market from Market order by ContID, Market asc"
set rs = conn.execute(SQL)
OldCont = ""
While not rs.eof
i = i + 1
ID = rs("ID")
ContID = rs("ContID")
Market = trim(rs("Market"))
select case ContID
case 1: Continent = "AMERICA"
case 2: Continent = "ASIA"
case 3: Continent = "EUROPE"
case 4: Continent = "MIDDLE EAST"
case 5: Continent = "OCEANIA"
case 6: Continent = "SOUTH AFRICA"
end select
if OldCont <> ContID then
response.write(" " & Continent & " | ")
i = 1
end if
OldCont = ContID
if ID = 1 then
style = "style=color=000000"
end if
response.write("" & Market & "
| ")
if i mod 3 = 0 then response.write(" ")
style = ""
rs.movenext
wend
%>
<%
rs.close
set rs = nothing
Conn.close
set Conn = nothing
end if
%>
<% ' #### INKLUDERAR PRODUKTHÄMTNING IFRÅN DATABAS #### %>
|