<% If CStr(session("user_logged_ID" & strSUnique)) = Empty And NOT session("admin_loggedin" & strSUnique) = Session.SessionID then Response.Redirect "register.asp" If CStr(session("user_logged_ID" & strSUnique)) = Empty then unick = sq(Request("nick")) infoText = strText_Alertsforuser & ": " & "" & unick & "" Else unick = sq(session("user_logged_nick" & strSUnique)) infoText = strText_MyEmailAlerts End If sdd = dd(objConn) bName = strText_CreateAlert setLocale server_locale J = 0 If Len(Request.Form("aID")) > 0 then aID = CLng(Request.Form("aID")) If Request.Form("ismodify") = "modify" then isModify = true bName = strText_SaveAlert modify_alert = "document.agent.modify.value='1';" mloop = "1" Else objConn.Execute("DELETE FROM " & tablPfx & "Agent WHERE ID = " & aID & ";") Response.Redirect "alert.asp?" & Request.Querystring End If End If agentCatList = Application("Cat_List" & strUnique) savedwords = Request.Form("A1") savedtype = CLng(Request.Form("A2")) duration = CLng(Request.Form("A5")) Select Case Request.Form("act") Case "enable_subcat" catID = Request.Form("A3") If isNumeric(catID) then If catID = 0 then optSCatList = "" Else set rscat = objConn.Execute("SELECT scatName,sCatID FROM " & tablPfx & "Scat WHERE(catID = " & catID & ");") optSCatList = "" scatID = Request.Form("A4") Do While not rscat.EOF If CStr(rscat(1)) = CStr(scatID) then sel = "selected": pickScat = CStr(scatID): Else: sel = Empty optSCatList = optSCatList & "" rscat.MoveNext Loop rscat.close If Len(pickScat) > 0 then set rscat = objConn.Execute("SELECT scatName,sCatID FROM " & tablPfx & "Scat WHERE(catID = " & CLng(pickScat) & ");") opt3rdCatList = "" If rscat.EOF Then opt3rdCatList = Empty Do While not rscat.EOF opt3rdCatList = opt3rdCatList & "" rscat.MoveNext Loop rscat.close End If set rscat = objConn.Execute("SELECT catName,CatID FROM " & tablPfx & "Cat;") agentCatList = "" Do While not rscat.EOF If CStr(rscat(1)) = CStr(catID) then sel = "selected": Else: sel = Empty agentCatList = agentCatList & "" rscat.MoveNext Loop rscat.close End If End If If Request.Form("modify") = "1" Then bName = strText_SaveAlert modify_alert = "document.agent.modify.value='1';" aID = CLng(Request.Form("aIDmod")) mloop = "1" End If Case "save" If CLng(savedtype) < 3 then savedwordsArray = Split(Trim(savedwords)) For each item in savedwordsArray If Len(item) > 2 then formatedwords = formatedwords & " " & item Next formatedwords = Trim(formatedwords) Else: formatedwords = Trim(savedwords) End If If Len(formatedwords) < 3 then msg = "

" & strText_Keywordsareinvalid & "

" Else catID = Request.Form("A3") scatID = Request.Form("A4") cat3rdID = Request.Form("A6") If Len(cat3rdID) = 0 then cat3rdID = 0 If CStr(session("user_logged_ID" & strSUnique)) = Empty then userID = CLng(Request("id")) Set rsuser = objConn.Execute("SELECT email FROM " & tablPfx & "User WHERE userID = " & userID & ";") If not rsuser.EOF then email = rsuser(0) rsuser.close Else userID = CLng(session("user_logged_ID" & strSUnique)) email = CryptText(session("user_logged_email" & strSUnique), key, False) End If catName = Request.Form("catName") scatName = Request.Form("scatName") cat3rdName = Request.Form("cat3rdName") If catID = 0 then catName = "=" If scatID = 0 then scatName = "=" If cat3rdID = 0 then cat3rdName = "=" pdate = Date pdate = ConvDateShort(Date) edate = CDate(date + duration) edate = ConvDateShort(edate) If Request.Form("modify") = "1" then aID = CLng(Request.Form("aIDmod")) strSQL = "UPDATE " & tablPfx & "Agent SET keyword = '" & sq(formatedwords) & "', stype = " & savedtype & ", catID = " & catID strSQL = strSQL & ", scatID = " & scatID & ", catName='" & sq(catName) & "', scatName='" & sq(scatName) & "', cat3rdID = " & cat3rdID & ", cat3rdName = '" & sq(cat3rdName) & "', " If mysql then strSQL = strSQL & " pdate = " & sdd & pdate & sdd & ", edate = ADDDATE(pdate,INTERVAL " & duration & " DAY) WHERE ID = " & aID & ";" Else: strSQL = strSQL & " pdate = " & sdd & pdate & sdd & ", edate = pdate + " & duration & " WHERE ID = " & aID & ";" End If Else strSQL = "INSERT INTO " & tablPfx & "Agent (userID,keyword,stype,catID,scatID,catName,scatName,pdate,edate,email,unick,cat3rdID,cat3rdName,alertlist) VALUES (" & userID strSQL = strSQL & ",'" & sq(formatedwords) & "'," & savedtype & "," & catID & "," & scatID & ",'" & catName & "','" & scatName strSQL = strSQL & "', " & sdd & pdate & sdd & ", " & sdd & edate & sdd & ", '" & email & "', '" & unick & "', " & cat3rdID & ", '" & cat3rdName & "','');" End If objConn.Execute(strSQL) Response.Redirect "alert.asp?" & Request.Querystring End If optSCatList = "" Case Else optSCatList = "" End Select %>
<%= strText_Home %>::<%= infoText %>
<% If CStr(session("user_logged_ID" & strSUnique)) = Empty then userID = CLng(Request("id")) Else: userID = CLng(session("user_logged_ID" & strSUnique)) End If set rs = objConn.Execute("SELECT " & tablPfx & "Agent.* FROM " & tablPfx & "Agent WHERE(userID = " & userID & ");") If not rs.EOF then %>
<% setLocale resetLocale Do while not rs.EOF keys = rs(2) stype = CLng(rs(3)) id = CLng(rs(0)) cID = rs(4) scID = rs(5) c3rdID = rs(13) cName = rs(6) scName = rs(7) cat3rdN = rs(14) Select Case stype Case 1: stypetext = strText_AnyWord Case 2: stypetext = strText_AllWords Case 3: stypetext = strText_ExactPhrase End Select pdate = CDate(rs(8)) edate = CDate(rs(9)) dur = edate - pdate If isModify And id = aID Then savedwords = keys savedtype = stype duration = Round(dur) If Len(cID) > 1 then agentCatList = "" End If If Len(scID) > 1 then set rscat = objConn.Execute("SELECT scatName,sCatID FROM " & tablPfx & "Scat WHERE(catID = " & cID & ");") Do While not rscat.EOF If CStr(rscat(1)) = CStr(scID) then sel = "selected": pickScat = CStr(rscat(1)): Else: sel = Empty optSCatList = optSCatList & "" rscat.MoveNext Loop rscat.close Else: optSCatList = "" End If If Len(pickScat) > 0 then opt3rdCatList = "" set rscat = objConn.Execute("SELECT scatName,sCatID FROM " & tablPfx & "Scat WHERE(catID = " & scID & ");") If rscat.EOF then opt3rdCatList = Empty Else Do While not rscat.EOF If CStr(rscat(1)) = CStr(c3rdID) then sel = "selected": Else: sel = Empty opt3rdCatList = opt3rdCatList & "" rscat.MoveNext Loop End If rscat.close End If End If If J mod 2 = 0 then cellColor = "class='evencell'": Else: cellColor = "class='oddcell'" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" J = J + 1 rs.MoveNext Loop %>
<%= strText_Keywords %>: <%= strText_SearchType %>: <%= strText_Category %>: <%= strText_Subcategory %>: <%= strText_3rdLevel %>: <%= strText_Expired %>: <%= strText_Duration %>: <%= strText_Action %>:
" & keys & "" & stypetext & "" & cName & "" & scName & "" & cat3rdN & "" & edate & "" & dur & " " & strText_days & "" Response.Write "
" Response.Write "
<% Else: Response.Write "
" & strText_noAlertscreatedyet & "
" End If rs.close %>
<% If J < alertlimit Or isModify Or mloop = "1" then Response.Write "
" & strText_Youmaycreate & " " & alertlimit-J & " " & strText_CreatemoreEmailAlert & "
" %>
<% If Len(opt3rdCatList) = 0 then %> <% Else %> <% End If %>

<%= strText_AlertHead %> <%= msg %>

<%= strText_Keywords %>: 
<%= strText_SearchType %>: 
<%= strText_RemoveAlertAfter %>: 
<%= strText_RestrictCategory %>: 
<%= strText_RestrictSubcategory %>: 
<%= strText_Restrict3rdLevel %>:  <%= strText_Restrict3rdLevel %>: 
<% Else: Response.Write "
" & strText_EmailAlertslimit & "" & alertlimit & ".
" End If %>