Expand|Select|Wrap|Line Numbers
- <%
- path = Server.mappath("../db/ServerData.mdb")
- set con = Server.createobject("ADODB.Connection")
- con.open "driver={Microsoft Access Driver (*.mdb)};DBQ="&path
- set r = con.execute("select * from News")
- Dim max
- Dim filename
- r.movefirst
- filename = r.fields("Name")
- max = r.fields("Views")
- do until r.eof
- if max < r.fields("Views") Then
- max = r.fields("Views")
- filename = r.fields("Name")
- r.movenext
- else
- r.movenext
- end if
- loop
- set t = con.execute("select * from News where Name='"&filename&"'")
- response.write "<table width='2%' bgcolor='white' marginbottom='0' margintop='0' align='center'>"
- response.write "<tr>"
- response.write "<th>Category</th>"
- response.write "<th>Header</th>"
- response.write "<th>Picture</th>"
- response.write "<th>Writer</th>"
- response.write "<th>Summary</th>"
- response.write "<th>Views</th>"
- response.write "<th>Link</th>"
- response.write "</tr>"
- response.write "<tr>"
- response.write "<td>"&t.fields("Category")&"</td>"
- response.write "<td>"&t.fields("Header")&"</td>"
- response.write "<td><img src='../"&t.fields("Picture")&"' width='50px' height='50px'></td>"
- response.write "<td>"&t.fields("Writer")&"</td>"
- response.write "<td>"&t.fields("Summary")&"</td>"
- response.write "<td >"&t.fields("Views")&"</td>"
- if t.fields("Category") = "Playstation" Then
- response.write "<td><a href='news/psnews/"&t.fields("Name")&"/"&t.fields("Name")&".asp' target='_top'>למעבר</a></td>"
- end if
- if t.fields("Category") = "Xbox" Then
- response.write "<td ><a href='news/xboxnews/"&t.fields("Name")&"/"&t.fields("Name")&".asp' target='_top'>למעבר</a></td>"
- end if
- if t.fields("Category") = "Nitendo" Then
- response.write "<td><a href='news/nitendonews/"&t.fields("Name")&"/"&t.fields("Name")&".asp' target='_top'>למעבר</a></td>"
- end if
- if t.fields("Category") = "Computers" Then
- response.write "<td><a href='news/computersnews/"&t.fields("Name")&"/"&t.fields("Name")&".asp' target='_top'>למעבר</a></td>"
- end if
- response.write "</tr>"
- response.write "</table>"
- t.close
- set t = nothing
- r.close
- set r = nothing
- con.close
- set con = nothing
- %>