<% '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 'this is a function to validate the date field. 'instruction:- '1) include this file to your asp file ' ' '2) in your date field ' eg: <% 'use for ListReceiveJobK1 and ListReceiveJobK2, ListSendEFT.asp function ValidateDate if session("startDate")="" and session("dateEnd")="" then if Request.Form("endDate") = "" then dateC = "January 19,2010" dateEnd = cdate(dateC) else dateEnd = cdate(Request.Form("endDate")) end if dayE = day(dateEnd) monthE = month(dateEnd) yearE = year(dateEnd) dateEnd = dayE&"/"&monthE&"/"&yearE if Request.Form("startDate") = "" then dateA = "January 19,1900" dateB = CDate(dateA) dateB = day(dateB)&"/"&month(dateB)&"/"&year(dateB) session("startDate") = month(dateB)&"/"&day(dateB)&"/"&year(dateB) session("dateEnd") = month(dateEnd) &"/"&day(dateEnd)&"/"&year(dateEnd) else dateA = cdate(Request.Form("startDate")) dateA = day(dateA)&"/"&month(dateA)&"/"&year(dateA) session("startDate") = month(dateA)&"/"&day(dateA)&"/"&year(dateA) session("dateEnd") = month(dateEnd) &"/"&day(dateEnd)&"/"&year(dateEnd) end if end if end function 'this function is use to make sure the date is in mm/dd/yyyy format 'i put in process file eg.saving, editing mostly on declaration part function VDate(dateI) if not(isNull(dateI) or dateI = "") then dateI = day(dateI)&"/"&month(dateI)&"/"&year(dateI) dateI = month(dateI)&"/"&day(dateI)&"/"&year(dateI) VDate = dateI else VDate = "" end if end function 'this function is use to make date format in dd/mm/yyyy function TDate(DateValue) if not(isNull(DateValue) or DateValue = "") then dateJ = day(DateValue)&"/"&month(DateValue)&"/"&year(DateValue) TDate = dateJ else TDate = "" end if end function 'Function TransformDate(i) ' YD = year(i) ' MD = month(i) ' DD = day(i) ' TransformDate = DD&"/"&MD&"/"&YD 'end function Function TransformDate(i) if i <>"" then YD = year(i) if (len(month(i))<2) then MD = "0"&month(i) else MD = month(i) end if if(len(day(i))<2) then DD = "0"&day(i) else DD = day(i) end if TransformDate = DD&"/"&MD&"/"&YD end if end function Function TransformTime(o) H = Hour(o) M = Minute(o) S = Second(o) TransformTime = H &":"& M &":"& S end function %> <% 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 %> <% 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)'" %> DNX
<% '----------------------------------------------- ' .:: Developed ::. ' Module : Menu ' Start date : 31st Oct 2003 ' End date : 31st Oct 2003 ' By : Zuraida Mohammad Rezuan ' Teras Teknologi Sdn Bhd '----------------------------------------------- '---------- Get cookies ---------- Dim cksUserID,cksUserROC,goSeek cksUserID = request.cookies("cUserID") cksUserROC = request.cookies("cUserROC") '--------- Get privilege --------- if len(cksUserID) <> 0 then Dim SQLpriv,RsPriv SQLpriv = "SELECT user_type FROM acct_info WHERE userid='"&cksUserID&"'" Set RsPriv = Server.CreateObject("ADODB.Recordset") RsPriv.Open SQLpriv,connObj,3,3 end if %> DNX
  <%if len(cksUserID) <> 0 then%> <%'goSeek = func1_menuName(RsPriv(0)) 'response.write(goSeek)%> <%end if%>
<% function func1_menuName(strPriv) if strPriv = "0" then func1_menuName = "| "&""&"Create user " func1_menuName = func1_menuName & " "&"| Rate Maintenance " func1_menuName = func1_menuName & " "&"| Feedback List " func1_menuName = func1_menuName & " "&"| Create shipping Schedule " elseif strPriv = "1" then func1_menuName = "| Create user "&" " elseif strPriv = "4" then func1_menuName = "" end if end function %>
 Exchange Rate Variance [Back]
 
Exchange Code :
    KES  
 
Country :
    KENYA  
 
Currency Description:
    SCHILLING  
 
Exchange Date :
     08/09/2010  
 
Start Date
End Date
Import Rate
Export Rate
Current Week
8/3/2010
14/3/2010
0.0446
0.0437
Previous Week
1/3/2010
7/3/2010
0.0446
0.0437
Amount in KES: Current Week's and Previous Week's rates 
 
Import Rate
Import Amount (RM)
Export Rate
Export Amount (RM)
Current Week
0.0446
0.0437
Previous Week
0.0446
0.0437
 
Import Variance
Export Variance  
(-ve) sign shows that Current week's rate is lower than Previous week