<%@ Language=VBScript %> <% Function ccdate() a = datepart("d", date) & "/" b = datepart("m", date) & "/" c = datepart("yyyy", date ) d = a & b & c ccdate = d end function Set conn = Server.CreateObject("ADODB.connection") conn.Open "DSN=prokhas", "sa" ssql = "select * from alerthits where datehits = '" & ccdate & "'" set rs = conn.Execute(ssql) 'response.write ssql if not rs.eof then NewHits = rs("hits") updateHits = NewHits + 1 ssql1 = "update alerthits set hits = '" & updateHits & "' where datehits = '" & ccdate & "'" set rs1 = conn.Execute(ssql1) 'response.write ssql1 else ssql = "select count(*) as chk from alerthits" set rs = conn.Execute(ssql) if rs("chk") = 0 then maxval = 1 else ssql = "select max(idx) as idx from alerthits" set rsmax = conn.Execute(ssql) maxval = trim(rsmax("idx")) + 1 end if idx = maxval Select Case len(idx) Case 1 idx = "000000000" & idx Case 2 idx = "00000000" & idx Case 3 idx = "0000000" & idx Case 4 idx = "000000" & idx Case 5 idx = "00000" & idx End Select hits = "1" logdatetime = now ssql = "insert alerthits values('" & idx & "','" & ccdate & "','" & hits & "','" & logdatetime & "'" & ")" set rs = conn.Execute(ssql) emailke = "sky@prokhas.com.my" Set JMail = Server.CreateObject("JMail.SMTPMail") JMail.ServerAddress = "190.1.1.20" JMail.Sender = "sky@prokhas.com.my" JMail.Subject = "Alert Hits OK!" Jmail.AddRecipient emailke 'Jmail.AddRecipientBCC ("sky@danaharta.com.my") JMail.Body = "Hits on " & now JMail.Execute Jmail.Close 'response.write ssql %> <% end if %> <% ssql = "select hits from hits" set rs = conn.Execute(ssql) set rs1 = conn.Execute(ssql) NewHits1 = rs("hits") updateHits1 = NewHits1 + 1 ssql1 = "update hits set hits = '" & updateHits1 & "'" set rs1 = conn.Execute(ssql1) Set FileObject = Server.CreateObject("Scripting.FileSystemObject") 'HitsFile = Server.MapPath ("/hits") & "\hits.txt" 'HitsFile = Server.MapPath("hits.txt") 'HitsFile = Server.MapPath ("/prokhaswebfinal") & "hits.txt" 'Set InStream= FileObject.OpenTextFile (HitsFile, 1, false ) 'OldHits = Trim(InStream.ReadLine) 'NewHits = OldHits + 1 'Set OutStream= FileObject.CreateTextFile (HitsFile, True) 'OutStream.WriteLine(NewHits) Function FormattedInteger2(sValue) FormattedInteger2 = FormatNumber(sValue,0) End Function %> Prokhas Sdn Bhd :: Prokhas at a glance

This page is currently under maintenance!



 
© 2006 Prokhas Sdn. Bhd. All rights are reserved. No part of this page may be copied
or reproduced in any manner without the prior written consent of Prokhas Sdn Bhd.
Please read the Legal Notice for further terms of use of this website.