<% If Not Sess_Array(48) = Session.SessionID then UpdateSessions False Response.Redirect "default.asp" End If Select Case Request.Form("flag") Case 1: Call SavePP() Case 2: Call CreatePP() Case 3: Call DeletePP() Case 4: Call MoveCat(0) Case 5: Call MoveCat(1) End Select If isnotfree then iScheme = Request("scheme") isTrial = True strFees = "SELECT * FROM " & tablPfx & "Pack ORDER BY sortID;" Set rs = objConn.Execute(strFees) I = 1 Do While Not rs.EOF nextScheme = rs("pname") nextpackID = CLng(rs("packID")) If I = 1 And Len(Cstr(iScheme)) = 0 then iScheme = CStr(nextpackID) If CStr(nextpackID) = CStr(iScheme) then selectedScheme = nextScheme If nextpackID = 1000 then isallowtrial = CBool(rs("isallowtrial")) Else: isTrial = False End If price = rs("price") descr = rs("descr") pdur = rs("pdur") adur = rs("adur") isadexpire = CBool(rs("isadexpire")) alimit = rs("alimit") isallowlock = CBool(rs("isallowlock")) nimage = CInt(rs("nimage")) isallowhot = CBool(rs("isallowhot")) selected = "selected" packID = nextpackID pack2coID = rs("id2co") fname = rs("formatname") isoffline = CBool(rs("isoffline")) isdefault = Cbool(rs("custom1")) Else selected = Empty End If optScheme = optScheme & "" I = I + 1 rs.MoveNext Loop rs.close %> Default Scheme | Custom Scheme | Link to Categories | Refresh

<% Call Build_Box_Top("700", 20, "Classified Board Custom Packages", "xl") %> >
Selected Payment Package:
Price:   <% If isTrial then %>  FREE type="checkbox" name="AP10" value="1"> - Enable Free trial <% Else %> Must be in n.nn format - 2.34, 5.00, 30.00 <% End If %>
Description:  
Product ID:   set for 2Checkout
Package Duration:   day(s)
Ads Duration:   day(s)
Expire Ads as Package Expires:   type="checkbox" name="AP5" value="1">*
 Allow to post no more than:   ad(s) per package **
Max. Number of Images:   image(s) per ad
Allow to post in locked categories:   type="checkbox" name="AP11" value="1">***
Allow to post in "What's Hot" list:   type="checkbox" name="AP9" value="1">
Default to Free Trial when Expired:   type="checkbox" name="AP14" value="1">
Take Package Offline:   type="checkbox" name="AP13" value="1"> ****
Formatted Package Name:   - HTML allowed
      <% If not isTrial then %> <% End If %>
  New Package (No HTML in a Name):
<% strSQL = "SELECT catID,isfree,catName FROM " & tablPfx & "Cat ORDER BY catName;" Set rscat = objConn.Execute(strSQL) Do while not rscat.EOF nextcatID = rscat(0) nextcatName = rscat(2) nextisFree = CBool(rscat(1)) Select Case nextisFree Case True optCatsFree = optCatsFree & "" & vbcrLf Case Else optCats = optCats & "" & vbcrLf End Select rscat.MoveNext Loop rscat.close %>

Show Payments Page | Show Display Page

List Code Row | List Code Row Bare | List Code Column | List Code Column Bare

NOTE: To use package schemes you must switch "Pay Mode" to "Package Payment Mode" in Admin Preferences

* Sets Ads expiration date to the Package expiration date; overrides Ads Duration setting for this package.
** Set to 0 to allow unlimited ads posted.
*** Categories are locked by linking custom payment schemes with enabled lock to appropriate categories.
**** If this package already been purchased, clients will continue to utilize it. But it will not be presented in the list of packages available for sale. The "Trial - Free" package ignores this setting and follows the "Enable Free Trial" setting.

"Free Post" Categories Configuration
Pay Categories Free Categories

NOTE: Move appropriate categories to "Free Post" list to allow client to post ads to those categories without having to purchase any packages. Free categories inherit the duration scheme from the linked payment scheme ("default" scheme assigned by default) and images limit from the number assigned in "Admin Preferences". Once client purchased the package however, ALL categories including "Free Post" categories would inherit the properties of the purchased package (ad duration, image limit.. etc.).

<% Call Build_Box_Bottom("") %>
<% Else Response.Write "

Not available in Free Mode
" End If Sub CreatePP() newScheme = Replace(Request.Form("T1"), chr(34), "") newScheme = sqbl(newScheme) If Len(newScheme) > 0 then If mysql then strFees = "SELECT packID FROM " & tablPfx & "Pack ORDER BY packID DESC LIMIT 0,1;" Else: strFees = "SELECT TOP 1 packID FROM " & tablPfx & "Pack ORDER BY packID DESC;" End If Set rs = objConn.Execute(strFees) newPackID = CLng(rs(0)) + 1 rs.close strPackIns = "packID,sortID,pname,descr,price,pdur,adur,isadexpire,alimit,isallowlock,nimage,isallowhot,id2co,formatname,isoffline,custom1" strPackInsVal = newPackID & "," & newPackID & ",'" & newScheme & "','" & sq(Request.Form("AP2")) & "','" strPackInsVal = strPackInsVal & sq(Request.Form("AP1")) & "'," & CLng(Request.Form("AP3")) & "," strPackInsVal = strPackInsVal & CLng(Request.Form("AP4")) & "," & CLng(Request.Form("AP5")) & "," strPackInsVal = strPackInsVal & CLng(Request.Form("AP6")) & "," & CLng(Request.Form("AP11")) & "," strPackInsVal = strPackInsVal & CLng(Request.Form("AP7")) & "," strPackInsVal = strPackInsVal & CLng(Request.Form("AP9")) & ",0, '" & newScheme & "',0," & CLng(Request.Form("AP14")) strSQL = "INSERT INTO " & tablPfx & "Pack(" & strPackIns & ") VALUES(" & strPackInsVal & ");" objConn.Execute(strSQL) UpdateSessions False Response.Redirect "admin_paymentpack.asp?scheme=" & newPackID End If End Sub Sub SavePP() updateScheme = Replace(Request.Form("T2"), chr(34), "") updateScheme = sqbl(updateScheme) If Len(updateScheme) > 0 then packID = CLng(Request.Form("pid")) If packID = 1000 then isallowtrial = CLng(Request.Form("AP10")): Else: isallowtrial = 0 strSQL = "UPDATE " & tablPfx & "Pack SET " strSQL = strSQL & "pname = '" & updateScheme & "', " strSQL = strSQL & "descr = '" & sq(Request.Form("AP2")) & "', " strSQL = strSQL & "price = '" & sq(Request.Form("AP1")) & "', " strSQL = strSQL & "pdur = " & CLng(Request.Form("AP3")) & ", " strSQL = strSQL & "adur = " & CLng(Request.Form("AP4")) & ", " strSQL = strSQL & "isadexpire = " & CLng(Request.Form("AP5")) & ", " strSQL = strSQL & "alimit = " & CLng(Request.Form("AP6")) & ", " strSQL = strSQL & "isallowlock = " & CLng(Request.Form("AP11")) & ", " strSQL = strSQL & "nimage = " & CLng(Request.Form("AP7")) & ", " strSQL = strSQL & "isallowhot = " & CLng(Request.Form("AP9")) & ", " strSQL = strSQL & "isallowtrial = " & isallowtrial & ", " strSQL = strSQL & "id2co = " & Request.Form("AP12") & ", " strSQL = strSQL & "formatname = '" & sq(Request.Form("T3")) & "', " strSQL = strSQL & "isoffline = " & CLng(Request.Form("AP13")) & ", " strSQL = strSQL & "custom1 = " & CLng(Request.Form("AP14")) strSQL = strSQL & " WHERE packID = " & packID & ";" objConn.Execute(strSQL) UpdateSessions False Response.Redirect "admin_paymentpack.asp?scheme=" & packID End If End Sub Sub DeletePP() packID = CLng(Request.Form("pid")) objConn.Execute("DELETE FROM " & tablPfx & "Pack WHERE packID = " & packID & ";") UpdateSessions False Response.Redirect "admin_paymentpack.asp" End Sub Sub MoveCat(action) Select Case action Case 0 For Each form in Request.Form("D2") objConn.Execute("UPDATE " & tablPfx & "Cat SET isfree = 1 WHERE catID = " & CLng(form) & ";") Next Case 1 For Each form in Request.Form("D3") objConn.Execute("UPDATE " & tablPfx & "Cat SET isfree = 0 WHERE catID = " & CLng(form) & ";") Next End Select UpdateSessions False Response.Redirect "admin_paymentpack.asp" End Sub %>