<!--#include file="../inc/conn.asp"--><!--#include file="../inc/function.asp"--><%gaction=trim(request("gaction"))
iid=trim(request("iid"))
if iid="" or IsNumeric(iid)<>true then
  response.write "0"
  Response.End
end if

if gaction<>"news" and gaction<>"product" then
  response.write "0"
  Response.End
end if

if gaction="news" then

  sql="select n_hit from news_grcms where n_id="&iid&""
  set rs=server.createobject("ADODB.Recordset")
  rs.open sql,conn,1,3
  if not rs.eof then 
    rs("n_hit")=rs("n_hit")+1
    rs.update
    infohit=rs("n_hit")
    rs.close
    set rs=nothing
  else
    infohit=0
  end if
  
elseif gaction="product" then

  sql="select p_hit from product_grcms where p_id="&iid&""
  set rs=server.createobject("ADODB.Recordset")
  rs.open sql,conn,1,3
  if not rs.eof then 
    rs("p_hit")=rs("p_hit")+1
    rs.update
    infohit=rs("p_hit")
    rs.close
    set rs=nothing
  else
    infohit=0
  end if
  
else
  infohit=0
end if%>document.write('<%=infohit%>');