<% Option Explicit %>
<!--#include file="common.asp" -->
<%
'Dimension variables
Dim rsGetURL 			'database Recordset Variable
Dim intSiteIDNo			'Holds the database ID No for a web site
Dim strURL 			'Holds the URL
Dim intSiteHits			'Holds the number of click through hits the site has recieved


'Read in the site ID number to get the URL for
intSiteIDNo = CInt(Request.QueryString("ID"))
		
'Create a recordset object
Set rsGetURL = Server.CreateObject("ADODB.Recordset")

'Query to get the details about the site the user wants to go to
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT * FROM MB_Company WHERE SiteIDNo = " & intSiteIDNo & ";"

'Set the cursor type property of the record set to Dynamic so we can navigate through the record set
rsGetURL.CursorType = 2
	
'Set the Lock Type for the records so that the record set is only locked when it is updated
rsGetURL.LockType = 3
	
'Query the database with the strSQL statement
rsGetURL.Open strSQL, strCon

%>
<HTML> 
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE><% = strWebname %></TITLE>
<style type="text/css">
<!--
.text {font-family: <% = strTextType %>; font-size: <% = intTextSize %>px; color: <% = strTextColour %>}
.heading {font-family: <% = strTextType %>; font-size: 24px; color: <% = strTextColour %>; font-weight: bold;}
a {font-family: <% = strTextType %>; font-size: <% = intTextSize %>px; color: <% = strLinkColour %>}
a:hover {font-family: <% = strTextType %>; font-size: <% = intTextSize %>px; color: <% = strHoverLinkColour %>}
a:visited {font-family: <% = strTextType %>; font-size: <% = intTextSize %>px; color: <% = strVisitedLinkColour %>}
a:visited:hover {font-family: <% = strTextType %>; font-size: <% = intTextSize %>px; color: <% = strHoverLinkColour %>}
-->
</style>

</head>
<body bgcolor="<% = strBgColour %>" text="<% = strTextColour %>">
<!--#include file="head.asp" -->
<table width="543" border="0" cellspacing="0" cellpadding="1" align="center" bgcolor="<% = strTableBorderColour %>" height="86">
    <tr> 
      <td width="902" height="84"> 
        <table width="541" border="0" align="center" class="normal" height="1" bgcolor="<% = strTableColour %>" cellpadding="3" cellspacing="0">
          <tr align="left"> 
            <td colspan="3" class="text" height="6" width="529">
            <p align="center">　</td>
          </tr>
          <tr class="arial"> 
            <td align="right" width="523" height="8" class="text" colspan="3">
            <p align="center"><b><%= rsGetURL("Title") %></b></td>
          </tr>
          <tr>
            <td align="right" width="118" height="6" class="text">联 系 人：</td>
            <td height="6" width="347" class="text"><%= rsGetURL("Man") %></td>
            <td height="79" width="58" class="text" rowspan="10"> 　</td>
          </tr>
          <tr>
            <td align="right" width="118" height="4" class="text">联系电话：</td>
            <td height="4" width="347" class="text"><%= rsGetURL("Phone") %></td>
          </tr>
          <tr>
            <td align="right" width="118" height="6" class="text">公司传真：</td>
            <td height="6" width="347" class="text"><%= rsGetURL("Code") %></td>
          </tr>
          <tr>
            <td align="right" width="118" height="4" class="text">联络邮箱：</td>
            <td height="4" width="347" class="text"><%= rsGetURL("Email") %></td>
          </tr>
          <tr class="arial"> 
            <td align="right" width="118" class="text" height="7">公司网站：</td>
            <td height="7" width="347" class="text"><a target="_blank" href="<%= rsGetURL("URL") %>"><%= rsGetURL("URL") %></a></td>
          </tr>
          <tr class="arial">
            <td align="right" width="118" class="text" height="1">行业类别：</td>
            <td height="1" width="347" class="text"><%= rsGetURL("Sort") %></td>
          </tr>
          <tr class="text">
            <td align="right" width="118" class="text" height="7">所在地区：</td>
            <td height="7" width="347" class="text"><%= rsGetURL("Area") %> - <%= rsGetURL("city") %></td>
          </tr>
          <tr>
            <td align="right" width="118" class="text" height="9">详细地址：</td>
            <td height="9" width="347" class="text"><%= rsGetURL("Address") %></td>
          </tr>
          <tr class="arial"> 
            <td align="right" width="118" class="text" height="12">主营业务：</td>
            <td width="347" height="12" class="text"><%= rsGetURL("Keywords") %></td>
          </tr>
          <tr class="arial"> 
            <td align="right" width="118" class="text" height="1" valign="top">公司简介：<br>
            </td>
            <td width="347" height="1" valign="top" class="text"><%= rsGetURL("Description") %></td>
          </tr>
          <tr> 
            <td valign="top" align="right" height="2" width="118" class="arial">&nbsp; </td>
            <td height="2" width="347"> 
              <p> 
                　</p>
            </td>
            <td height="16" width="58" class="text"> 　</td>
          </tr>
        </table>
      </td>
    </tr>
  </table><br>
<!--#include file="end.asp" -->
</body>
</html>
<%

'If there is a web site returned then update the hits and go to the site
If NOT rsGetURL.EOF Then

	'Read in the URL of the web site from the database and the number of hits it has received
	strURL = rsGetURL("URL") 
	
	'Save the new click through hit back to the database
	'Initalise the strSQL variable with the SQL string to save the updated hit count back to the database
	rsGetURL.Fields("Hits") = CLng(rsGetURL("Hits") + 1)
	rsGetURL.Update
				
	'Close Server Objects 
	Set rsGetURL = Nothing
	Set adoCon = Nothing
	Set strCon = Nothing

 End If
 
'Close Server Objects 
Set rsGetURL = Nothing
Set adoCon = Nothing
Set strCon = Nothing
%>