<% If ((Len(Trim(session("myuser"))) = 0) or (Len(Trim(session("mypass"))) = 0)) Then response.Redirect "http://localhost/ced/admin/admin-main.html" End If %> <% whichYear = request.querystring("which_year") whichmonth = request.querystring("which_month") whichdate = request.querystring("which_date") ScrollAction = Request("ScrollAction") if ((whichdate <> "") and (whichdate <> "empty")) then if ((Cint(whichdate) < 10) and (len(whichdate)=1)) then whichdate = "0" & whichdate end if end if if ((whichmonth <> "") and (whichmonth <> "empty")) then if ((Cint(whichmonth) < 10) and (len(whichmonth)=1)) then whichmonth = "0" & whichmonth end if end if %> Customs and Excise Department - latest news edit
 
 
  what's new - edit
Search: 
  day month year
<% present_day = Cint(day(date)) present_month = Cint(month(date)) present_year = Cint(year(date)) if (present_day < 10) then present_day = "0" & present_day end if if (present_month < 10) then present_month = "0" & present_month end if if ((whichYear = "") and (whichmonth = "") and (whichdate = "")) then call selection() %> <% response.end elseif ((whichYear = "empty") or (whichmonth = "empty")) then call incorrect_para() %> <% response.end end if if (((whichYear <> "empty") and (whichmonth <> "empty") and (whichdate <> "empty")) or ((whichYear <> "empty") and (whichmonth <> "empty") and (whichdate = "empty"))) then if ((whichYear <> "empty") and (whichmonth <> "empty") and (whichdate <> "empty")) then sqltext = "SELECT pub_date, title, fname FROM news WHERE to_char(pub_date,'dd') ='"& whichdate &"' and to_char(pub_date,'mm') ='"& whichmonth &"' and to_char(pub_date,'yyyy') ='"& whichYear &"' ORDER BY pub_date" sqltext1 = "SELECT COUNT(*) FROM news WHERE to_char(pub_date,'dd') ='"& whichdate &"' and to_char(pub_date,'mm') ='"& whichmonth &"' and to_char(pub_date,'yyyy') ='"& whichYear &"' ORDER BY pub_date" elseif ((whichYear <> "empty") and (whichmonth <> "empty") and (whichdate = "empty")) then sqltext = "SELECT pub_date, title, fname FROM news WHERE to_char(pub_date,'mm') ='"& whichmonth &"' and to_char(pub_date,'yyyy') ='"& whichYear &"' ORDER BY pub_date" sqltext1 = "SELECT COUNT(*) FROM news WHERE to_char(pub_date,'mm') ='"& whichmonth &"' and to_char(pub_date,'yyyy') ='"& whichYear &"' ORDER BY pub_date" end if set rs1=conntemp.Execute(sqltext1) totalRecord = rs1.fields(0) rs1.close set rs1 = nothing set rs=conntemp.Execute(sqltext) if rs.eof then call incorrect_para() %> <% response.end end if RS.PageSize = 25 ' Number of rows per page if (ScrollAction <> "") Then PageNo = ScrollAction if (PageNo < 1) Then PageNo = 1 end if else PageNo = 1 end if display = 0 if not rs.eof then display = 1 end if RowCount = rs.PageSize %> <%startpoint = ((PageNo - 1) * 25) + 1 stoppoint = PageNo * 25 x = 1%> <% if not rs.eof then %> <% do while not rs.eof and RowCount > 0 if x => startpoint and x <= stoppoint then %> <% end if %> <% rs.movenext x = x+1 loop %> <% n = 1 %> <%if (Cint(totalRecord)/25) > 1 then %> <%end if %> <% end if rs.close set rs = nothing end if %> <% sub incorrect_para() %>
  what's new listing
Date
Title
<%=formatdatetime(rs("pub_date"),2)%>
"><%=rs("title")%>
  page <%do while n <= ( cint(totalRecord)/25)+1%> <%=n%> <%n = n +1 loop%>
  Oops, we cannot find any records that match your request.
 
Copyright @ 1999 Customs & Excise Department, Singapore. All Rights Reserved.
(mock up done by Nettropolis Pte Ltd)
<% end sub %> <% sub selection() sqltext = "SELECT pub_date, title, fname FROM news WHERE to_char(pub_date,'dd')='" & present_day & "' and to_char(pub_date,'mm')='" & present_month & "' and to_char(pub_date,'yyyy')='" & present_year & "' ORDER BY pub_date" sqltext1 = "SELECT COUNT(*) FROM news WHERE to_char(pub_date,'dd')='" & present_day & "' and to_char(pub_date,'mm')='" & present_month & "' and to_char(pub_date,'yyyy')='" & present_year & "' ORDER BY pub_date" set rs1=conntemp.Execute(sqltext1) totalRecord = rs1.fields(0) rs1.close set rs1 = nothing set rs=conntemp.Execute(sqltext) RS.PageSize = 25 ' Number of rows per page if (ScrollAction <> "") Then PageNo = ScrollAction if (PageNo < 1) Then PageNo = 1 end if else PageNo = 1 end if display = 0 if not rs.eof then display = 1 end if RowCount = rs.PageSize %> <%startpoint = ((PageNo - 1) * 25) + 1 stoppoint = PageNo * 25 x = 1%> <% if not rs.eof then %>
Date
Title
<% do while not rs.eof and RowCount > 0 if x => startpoint and x <= stoppoint then ftype = mid(rs("fname"),1,1) %>
<%=formatdatetime(rs("pub_date"),2)%>
"><%=rs("title")%> <% end if %> <% rs.movenext x = x+1 loop ' response.write ("") ' response.write ("") %> <% n = 1 %> <% end if %> <%if (Cint(totalRecord)/25) > 1 then %>   page <%do while n <= ( cint(totalRecord)/25)+1%> <%=n%> <%n = n +1 loop%> <%end if %> <% rs.close set rs = nothing %>
 
Copyright @ 1999 Customs & Excise Department, Singapore. All Rights Reserved.
(mock up done by Nettropolis Pte Ltd)
<% end sub %>
 
Copyright @ 1999 Customs & Excise Department, Singapore. All Rights Reserved.
(mock up done by Nettropolis Pte Ltd)