%
Dim fntGeneral,fntBoldWhite,sysTitle,fntBoldBlack,fntBoldRed
fntGeneral = "style=""font-family:verdana;font-size:10px;font-weight: normal;color:black;"""
fntBoldWhite = "style=""font-family:verdana;font-size:10px;font-weight: bold;color:white;"""
fntBoldBlack = "style=""font-family:verdana;font-size:10px;font-weight: bold;color:black;"""
fntBoldRed = "style=""font-family:verdana;font-size:10px;font-weight: bold;color:red;"""
sysTitle = "DagangNet Technology"
Dim linecontrol,linecontrol1,color
linecontrol = "bgcolor='#ffffff' onmouseover='borderit(this)' onmouseout='unborderit(this)'"
linecontrol1 = "bgcolor='#ffffff' onmouseover='borderit(this)' onmouseout='unborderit2(this)'"
%>
<%
Function changeToDB(str)
if IsNull(str) then
changeToDB=""
Else
changeToDB=Replace(str,"'","^")
end if
End Function
Function changeFromDB(str)
if IsNull(str) then
changeFromDB=""
Else
changeFromDB=Replace(str,"^","'")
end if
End Function
Dim arr
Function changeDateFrmt(a)
if a <> "N/A" then
changeDatefrmt = day(a)&"/"&month(a)&"/"&year(a)
else
changeDateFrmt = a
end if
End Function
Function changeDateToServer(a)
if a <> "" then
arr = split(a,"/")
changeDateToServer = arr(1)&"/"&arr(0)&"/"&arr(2)
else
changeDateToServer = ""
end if
End Function
Function rcDnx(SQL)
Dim find,ganti,SQLbuntat,rsBuntat
find = left(SQL,inStr(1,LCase(SQL),"from")+3)
'ganti = replace(SQL,find,"SELECT COUNT(*) FROM ")
ganti = replace(SQL,find,"SELECT * FROM ")
SQLbuntat = ganti
Set rsBuntat = Server.CreateObject("ADODB.Recordset")
rsBuntat.Open SQLbuntat,ConnObj,3,3
'rcDnx= rsBuntat(0)
rcDnx = rsBuntat.recordcount
End Function
Function rcRef(SQL)
Dim find,ganti,SQLbuntat,rsBuntat
find = left(SQL,inStr(1,LCase(SQL),"from")+3)
'ganti = replace(SQL,find,"SELECT COUNT(*) FROM ")
ganti = replace(SQL,find,"SELECT * FROM ")
SQLbuntat = ganti
'response.write SQLBuntat
'response.end
Set rsBuntat = Server.CreateObject("ADODB.Recordset")
rsBuntat.Open SQLbuntat,connObj,3,3
'rcRef= rsBuntat(0)
rcRef=rsBuntat.recordcount
End Function
Function dateForMySQL(carryDate)
'---------------- Function change date ----------------
' format is yyyy-dd-mm hh:mm:ss
Dim boxYear,dateArray,boxMonth,timeArray,time24Array,boxDay
boxYear = Year(carryDate)
boxMonth = Month(carryDate)
boxDay = Day(carryDate)
timeArray = Split(time())
time24Array = Split(timeArray(0),":")
if timeArray(1) = "PM" and time24Array(0) <> "12" then
time24Array(0) = time24Array(0) + 12
end if
dateForMySQL = boxYear&"-"&addZero(boxMonth)&"-"&addZero(boxDay)&" "&time24Array(0)&":"&time24Array(1)&":"&time24Array(2)
'------------------ Change date ends ------------------
End Function
Function timeForMySQL(carryTime)
'---------------- Function change time ----------------
' format is yyyy-dd-mm hh:mm:ss
Dim thehourchange,newdate24,thenewdate24
if instr(1,carryTime," AM") then
timeForMySQL = Replace(carryTime," AM","")
elseif instr(1,carryTime," PM") then
Newdate24 = Replace(carryTime," PM","")
thehourchange = mid(Newdate24,12,2)
thenewdate24 = replace(newdate24,thehourchange,thehourchange+12,12,13,0)
timeForMySQL = left(carrytime,10) &" "& thenewdate24
end if
'------------------ Change time ends ------------------
End Function
Function addZero(strValue)
'------- Adding zero to date ---
if len(strValue) = 1 then
addZero = "0"&strValue
else
addZero = strValue
end if
'------- Adding zero ends -----
End Function
Function dateTimeDisplay(dataDrDB)
if dataDrDB="0000-00-00 00:00:00" then
dateTimeDisplay = ""
else
dateTimeDisplay = Day(left(dataDrDB,10))&" "&MonthName(Month(left(dataDrDB,10)),true)&" "&Year(left(dataDrDB,10))&" "&mid(dataDrDB,12,8)
end if
End Function
Function extensio(docname) '---------- to check the file extention
dim W,X,Y,parted
parted = split(docname,".",-1,1)
W = parted(0)
Y = parted(1)
extensio = Y
End function
%>