<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% DIM pref_paypal_account, LOG_FILE, VENDOR_IDENTITY, VENDOR_NAME, VENDOR_EMAIL, VENDOR_EMAIL_CC, VENDOR_EMAIL_BCC, DATABASE_PATH, MM_connection_STRING '*** CHANGE THE FOLLOWIN TO YOUR OWN CONFIGURATION *** pref_paypal_account = "services@ericthetrainer.com" pref_private_path = "../private" paypal_notify_url = "http://www.EricTheTrainer.com/ipn_processor.asp" return_url = "http://www.ericthetrainer.com/purchase_confirm.asp" cancel_url = "http://www.ericthetrainer.com/purchase_cancel.asp" login_url = "http://www.EricTheTrainer.com/login.asp" VENDOR_NAME = "ERIC THE TRAINER" '*--> NAME OF YOUR COMPANY VENDOR_EMAIL = "services@ericthetrainer.com" '*--> YOUR PRIMARY EMAIL REGISTERED WITH PAYPAL VENDOR_EMAIL_CC = "" '*--> CC EMAIL - FOR ADDITIONAL NOTIFICATION EMAIL - OPTIONAL VENDOR_EMAIL_BCC = "" '*--> BCC EMAIL - FOR ADDITIONAL NOTIFICATION EMAIL - OPTIONAL CONST TERMINATE_ON_SYSTEM_ERROR = FALSE '*IF THERE IS A SERIOUS SYSTEM ERROR TRAPPED BY THE SYSTEM SUCH AS FAILURE TO '*CREATE A SERVER OBJECT, YOU MAY CHOOSE TO TERMINATE THE SCRIPT RIGHT AWAY. '*JUST SET TERMINATE_ON_SYSTEM_ERROR TO "TRUE" CONST AUDIT_TRAIL_ON = False ' SET THIS TO TRUE TO ENABLE TEXT LOG FILE LOG_FILE = "PAYPAL.txt" '*PAYPAL AUDIT TRAIL LOG FILE '*NOTE: FOR ADDED SECURITY, IT IS BEST TO STORE THE LOG FILE OUTSIDE THE ROOT FOLDER '*EX. "../Private/paypal.txt" --> here folder "Private" is outside the HTTP REACH const remote_admin_login = "ett" const remote_admin_password = "ettadmin" %> <% 'Dim MM_connection_STRING 'dim DB 'editted MapPath and removed .. from "../private/ett_db.mdb" 'the ".." convention is not available 'DB = Server.MapPath("/private/ett_db.mdb") DB = Server.MapPath("/access_db/ett_db.mdb") 'MM_connection_STRING = "Provider=MSDASQL; Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & DB MM_connection_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DB %> <% function checkAdminList(memberid) if session("memberid") = 83 then checkAdminList = 1 else checkAdminList = 0 end if end function sub getAdminLinks(isAdmin) if isAdmin then %> Title: Admin unlimited Fitcall

<% end if end sub sub getTyraLink(isOnTyra) if isOnTyra then %> Title: the FITCALL - 2 week Islander promotion

<% end if end sub sub getPromoLink(promoId) Set rsPromo = Server.CreateObject("ADODB.Recordset") rsPromo.ActiveConnection = MM_connection_STRING rsPromo.Source = _ "select description, link, isActive from " & _ " tbl_promo " & _ " where promoId = " & promoId rsPromo.CursorType = 0 rsPromo.CursorLocation = 2 rsPromo.LockType = 1 rsPromo.Open() if not rsPromo.eof then if rsPromo("isActive") = 1 then %> Title: <%=rsPromo("description")%>

', 'map', '342', '64', 1, 1)" <% end if end if rsPromo.Close() end sub function getPromo(memberid) Set rsPromo = Server.CreateObject("ADODB.Recordset") rsPromo.ActiveConnection = MM_connection_STRING rsPromo.Source = _ "select promoId from " & _ " tbl_promomember " & _ " where memberid = " & memberid rsPromo.CursorType = 0 rsPromo.CursorLocation = 2 rsPromo.LockType = 1 rsPromo.Open() if rsPromo.eof then getPromo = 0 else getPromo = rsPromo("promoId") end if rsPromo.Close() end function function checkTyraList(memberid) Set rsTyra = Server.CreateObject("ADODB.Recordset") rsTyra.ActiveConnection = MM_connection_STRING rsTyra.Source = _ "select memberid from " & _ " tbl_tyraList " & _ " where memberid = " & memberid rsTyra.CursorType = 0 rsTyra.CursorLocation = 2 rsTyra.LockType = 1 rsTyra.Open() if rsTyra.eof then checkTyraList = "0" else checkTyraList = "1" end if rsTyra.Close() end function if trim(session("memberid")) = "" then response.redirect "member_login.asp" response.end end if if trim(session("longmemberid")) = "" then Set rsMemberID = Server.CreateObject("ADODB.Recordset") rsMemberID.ActiveConnection = MM_connection_STRING rsMemberID.Source = "SELECT longmemberid where memberid = " & session("memberid") rsMemberID.CursorType = 0 rsMemberID.CursorLocation = 2 rsMemberID.LockType = 1 rsMemberID.Open() if rsMemberID.eof then longmemberid = "#######" else longmemberid = rsMemberID("longmemberid") end if rsMemberID.Close() else longmemberid = session("longmemberid") end if Set rsAllMsgs = Server.CreateObject("ADODB.Recordset") rsAllMsgs.ActiveConnection = MM_connection_STRING rsAllMsgs.Source = "SELECT count(*) as AllMsgs FROM tbl_member_msg where to_memberid = " & session("memberid") rsAllMsgs.CursorType = 0 rsAllMsgs.CursorLocation = 2 rsAllMsgs.LockType = 1 rsAllMsgs.Open() AllMsgs = rsAllMsgs("AllMsgs") Set rsNewMsgs = Server.CreateObject("ADODB.Recordset") rsNewMsgs.ActiveConnection = MM_connection_STRING rsNewMsgs.Source = "SELECT count(*) as UnreadMsgs FROM tbl_member_msg where to_memberid = " & session("memberid") & " and msg_status = 'NEW'" rsNewMsgs.CursorType = 0 rsNewMsgs.CursorLocation = 2 rsNewMsgs.LockType = 1 rsNewMsgs.Open() UnreadMsgs = rsNewMsgs("UnreadMsgs") msg_caption = "(" & UnreadMsgs & " new out of " & AllMsgs & " total messages)" isOnTyra = checkTyraList(session("memberid")) promoId = getPromo(session("memberid")) isAdmin = checkAdminList(session("memberid")) Dim SQLcommand Set rsMast = Server.CreateObject("ADODB.Recordset") rsMast.ActiveConnection = MM_connection_STRING SQLcommand = SQLcommand & "select m.txn_id, m.payment_date, " SQLcommand = SQLcommand & " d.item_code, " SQLcommand = SQLcommand & " i.item_description, " SQLcommand = SQLcommand & " x.filename, x.days_valid, i.item_isStreaming, i.item_isPhone" SQLcommand = SQLcommand & " from tbl_ordermast as m, " SQLcommand = SQLcommand & " tbl_orderdetail as d, " SQLcommand = SQLcommand & " tbl_items as i, " SQLcommand = SQLcommand & " tbl_item_multimedia as x " SQLcommand = SQLcommand & " where m.memberid = " & session("memberid") SQLcommand = SQLcommand & " and m.orderid = d.orderid " SQLcommand = SQLcommand & " and d.item_code = i.item_code " SQLcommand = SQLcommand & " and i.item_code = x.item_code " if session("memberid") = 1747 then SQlcommand = SQlcommand & "union " SQLcommand = SQLcommand & "select '000000000' as txn_id, now() as payment_date, " SQLcommand = SQLcommand & " 'THE SLEEPING BEAUTY FITCALL FOR WOMEN' as item_code, " SQLcommand = SQLcommand & " i.item_description, " SQLcommand = SQLcommand & " x.filename, x.days_valid, i.item_isStreaming, i.item_isPhone" SQLcommand = SQLcommand & " from " SQLcommand = SQLcommand & " tbl_items as i, " SQLcommand = SQLcommand & " tbl_item_multimedia as x " SQLcommand = SQLcommand & " where 1 = 1 " SQLcommand = SQLcommand & " and x.item_code = 'THE SLEEPING BEAUTY FITCALL FOR WOMEN' " SQLcommand = SQLcommand & " and i.item_code = 'THE SLEEPING BEAUTY FITCALL FOR WOMEN' " end if SQLcommand = SQLcommand & " order by payment_date desc " rsMast.Source = SQLcommand rsMast.CursorType = 0 rsMast.CursorLocation = 2 rsMast.LockType = 1 rsMast.Open() if rsMast.eof then if promoId = 0 then if not isOnTyra = 1 then if not isAdmin = 1 then no_files = "1" end if end if end if end if %> The Sleeping Giant Workout
Eric the Trainer Home page
About Eric the Trainer
About the Workouts
Sponsored Athletes
News & Tips
Testimonials
     
SIGN-UP
  <% '1. function parse (str) : parse all incoming submissions '2. function unparse (str) : opposite of parse '3. function record_exists( tbl_name, column_name, the_value) ' : checks for duplicate record based on 1 primary column -- used in adding records '4. function record_exists_ext( tbl_name, column_name_1, column_name_2, the_value_1, the_value_2) ' : checks for duplicate record based on 2 columns -- used in updating records '5. function insert_command(tbl_name, arr_cols, arr_values) ' : constructs an insert command ' : makes insertions of quotes and commas a breeze '6. function update_command(tbl_name, idcol, idval, arr_cols, arr_values) ' : constructs and edit command ' : makes insertions of quotes and commas a breeze %> <% function parse (str) parse = trim(replace(replace(str, "'", "''"), "|", "")) end function function unparse (str) if str <> "" then unparse = trim(replace(str, "''", "'")) else unparse = "" end if end function function record_exists( tbl_name, column_name, the_value, isInteger) Dim quote quote = "'" if isInteger=1 then quote = "" Set rs = Server.CreateObject("ADODB.Recordset") rs.ActiveConnection = MM_Connection_STRING rs.Source = "SELECT * FROM " & tbl_name & " WHERE " & column_name & " = " & quote & the_value & quote 'response.write rs.Source 'response.End() rs.CursorType = 0 rs.CursorLocation = 2 rs.LockType = 1 rs.Open() if rs.eof then record_exists = false else record_exists = true end if rs.Close() Set rs = Nothing end function function record_exists_ext( tbl_name, column_name_1, column_name_2, the_value_1, value_1_isInt, the_value_2, value_2_isInt) Dim quote1 Dim quote2 quote1 = "'" quote2 = "'" if value_1_isInt = 1 then quote1 = "" if value_2_isInt = 1 then quote2 = "" Set rs = Server.CreateObject("ADODB.Recordset") rs.ActiveConnection = MM_Connection_STRING rs.Source = "SELECT * FROM " & tbl_name & " WHERE " & column_name_1 & " = " & quote1 & the_value_1 & quote1 & " AND " & column_name_2 & " = " & quote2 & the_value_2 & quote2 ' response.write rs.Source ' response.end() rs.CursorType = 0 rs.CursorLocation = 2 rs.LockType = 1 rs.Open() if rs.eof then record_exists_ext = false else record_exists_ext = true end if rs.Close() Set rs = Nothing end function function record_exists_edit_level_1( tbl_name, column_name_1, column_name_2, the_value_1, value_1_isInt, the_value_2, value_2_isInt) Dim quote1 Dim quote2 quote1 = "'" quote2 = "'" if value_1_isInt = 1 then quote1 = "" if value_2_isInt = 1 then quote2 = "" Set rs = Server.CreateObject("ADODB.Recordset") rs.ActiveConnection = MM_Connection_STRING rs.Source = "SELECT * FROM " & tbl_name & " WHERE " & column_name_1 & " = " & quote1 & the_value_1 & quote1 & " AND " & column_name_2 & " <> " & quote2 & the_value_2 & quote2 ' response.write rs.Source ' response.end() rs.CursorType = 0 rs.CursorLocation = 2 rs.LockType = 1 rs.Open() if rs.eof then record_exists_edit_level_1 = false else record_exists_edit_level_1 = true end if rs.Close() Set rs = Nothing end function function record_exists_edit_level_2( tbl_name, column_name_1, column_name_2, column_name_3, the_value_1, value_1_isInt, the_value_2, value_2_isInt, the_value_3, value_3_isInt) Dim quote1 Dim quote2 quote1 = "'" quote2 = "'" quote3 = "'" if value_1_isInt = 1 then quote1 = "" if value_2_isInt = 1 then quote2 = "" if value_3_isInt = 1 then quote3 = "" Set rs = Server.CreateObject("ADODB.Recordset") rs.ActiveConnection = MM_Connection_STRING rs.Source = "SELECT * FROM " & tbl_name & " WHERE " & column_name_1 & " = " & quote1 & the_value_1 & quote1 & " AND " & column_name_2 & " <> " & quote2 & the_value_2 & quote2 & " AND " & column_name_3 & " = " & quote3 & the_value_3 & quote3 ' response.write rs.Source ' response.end() rs.CursorType = 0 rs.CursorLocation = 2 rs.LockType = 1 rs.Open() if rs.eof then record_exists_edit_level_2 = false else record_exists_edit_level_2 = true end if rs.Close() Set rs = Nothing end function function insert_command(tbl_name, arr_cols, arr_values) dim i cols = split(arr_cols, "|") vals = split(arr_values, "|") ub_arr = ubound(cols) str = "INSERT INTO " & tbl_name & "(" scol = "" sval = "" for i = 0 to ub_arr if i < ub_arr then scol = scol & cols(i) & "," sval = sval & "'" & vals(i) & "'," else scol = scol & cols(i) sval = sval & "'" & vals(i) & "'" end if next str = str & scol & ") VALUES (" & sval & ")" insert_command = str end function function update_command(tbl_name, idcol, idcol_isInt, idval, arr_cols, arr_values) dim i if idcol_isInt = 1 then quote1 = "" else quote1 = "'" end if cols = split(arr_cols, "|") vals = split(arr_values, "|") ub_arr = ubound(cols) str = "UPDATE " & tbl_name & " SET " s = "" for i = 0 to ub_arr if i < ub_arr then s = s & cols(i) & "='" & vals(i) & "'," else s = s & cols(i) & "='" & vals(i) & "'" end if next str = str & s & " WHERE " & idcol & "=" & quote1 & idval & quote1 update_command = str end function function update_all_command(tbl_name, arr_cols, arr_values) dim i cols = split(arr_cols, "|") vals = split(arr_values, "|") ub_arr = ubound(cols) str = "UPDATE " & tbl_name & " SET " s = "" for i = 0 to ub_arr if i < ub_arr then s = s & cols(i) & "='" & vals(i) & "'," else s = s & cols(i) & "='" & vals(i) & "'" end if next str = str & s & " " update_all_command = str end function function delete_command(tbl_name, idcol, idval ) if isnumeric(idval) then str = "DELETE FROM " & tbl_name & " WHERE " & idcol & "=" & idval else str = "DELETE FROM " & tbl_name & " WHERE " & idcol & "='" & idval & "'" end if delete_command = str end function Function IsValidEmail(sText) 'validate email address Dim i Dim iTmpChar Dim sDomainExt Dim vEmail Dim vDomain IsValidEmail = False 'check for 1 @ symbol vEmail = Split(sText, "@") If UBound(vEmail) <> 1 Then Exit Function If vEmail(0) = "" Or vEmail(1) = "" Then Exit Function 'validate account For i = 1 To Len(vEmail(0)) 'check for valid characters iTmpChar = Asc(Mid(LCase(vEmail(0)), i, 1)) 'test for letters If Not (iTmpChar >= Asc("a")) And (iTmpChar <= Asc("z")) Then 'test for numbers If Not IsNumeric(Chr(iTmpChar)) Then 'test for exceptions If Chr(iTmpChar) <> "." And Chr(iTmpChar) <> "_" And Chr(iTmpChar) <> "-" Then Exit Function End If End If Next 'validate domain For i = 1 To Len(vEmail(1)) 'check for valid characters iTmpChar = Asc(Mid(LCase(vEmail(1)), i, 1)) 'test for letters If Not (iTmpChar >= Asc("a")) And (iTmpChar <= Asc("z")) Then 'test for numbers If Not IsNumeric(Chr(iTmpChar)) Then 'test for exceptions If Chr(iTmpChar) <> "." And Chr(iTmpChar) <> "-" Then Exit Function End If End If Next 'validate domain extension vDomain = Split(vEmail(1), ".") sDomainExt = vDomain(UBound(vDomain)) If Len(sDomainExt) < 2 Or Len(sDomainExt) > 4 Then Exit Function 'test for letters For i = 1 To Len(sDomainExt) iTmpChar = Asc(Mid(LCase(sDomainExt), i, 1)) If Not (iTmpChar >= Asc("a")) And (iTmpChar <= Asc("z")) Then Exit Function Next IsValidEmail = True End Function %> <% dim subs_error_msg subscribe = trim(request("subscribe")) if subscribe <> "" then name = trim(request("name")) email = trim(request("email")) if name = "" then subs_push_error "Please enter your name." if NOT IsValidEmail(email) then subs_push_error "Please enter a valid email address." if record_exists( "tbl_subscriber", "email", email, 0) then subs_push_error "This email address is already subscribed." if subs_error_msg <> "" then subs_error_msg = "" & subs_error_msg & "

" else Set rsSubs = Server.CreateObject("ADODB.Recordset") rsSubs.ActiveConnection = MM_connection_STRING rsSubs.Source = "insert into tbl_subscriber(name,email) values ('" & name & "', '" & email & "')" rsSubs.CursorType = 0 rsSubs.CursorLocation = 2 rsSubs.LockType = 1 rsSubs.Open() rsSubs.Source = "SELECT max(subscriber_id) as id FROM tbl_subscriber" rsSubs.Open() id = rsSubs("id") rsSubs.Close set rsSubs = Nothing name = "" email = "" response.Redirect("subsribed_confirm.asp?id=" & id ) response.End() end if end if %>

Sign up to be part of the Eric the Trainer fitness community: receive newsletters, chat with Eric, join community chats & forums, be alerted to events and special opportunities.

<%=subs_error_msg%>NAME:

EMAIL:


<%if trim(session("memberid")) = "" then %>

Existing Clients: <%else%>
My Account

Logout <%end if%>

 Privacy Policy

<% sub subs_push_error (str) if subs_error_msg = "" then subs_error_msg = "* " & str else subs_error_msg = subs_error_msg & "
* " & str end if end sub %>
 
 

NEWS & QUICKTIPS
 

HOLIDAY TIPS
5 tips for surviving the
holidays...that will
ensure "good health
and good looks"

> more

 

 
 
My account
Welcome back <%=session("firstname")%>!
(client #: <%=longmemberid%>)
 
Read messages  <%=msg_caption%>
Update my account
Logout

<% if no_files <> "" then %>

You have no files available for online viewing.

<% else %>

Available files

<% getAdminLinks(isAdmin) getTyraLink(isOnTyra) getPromoLink(promoId) do until rsMast.eof is_expired = Date - rsMast("Payment_Date") is_streaming = rsMast("item_isStreaming") %> <% rsMast.movenext() loop %>
Transaction ID: <%=rsMast("txn_id")%>
Payment date: <%=rsMast("payment_date")%>
Item code: <%=rsMast("item_code")%>
Title: <%=rsMast("item_description")%>
<%if is_expired <= rsMast("days_valid") then if rsMast("item_isStreaming") = "1" then if rsMast("filename") = "" then filename = "/vxml/player.html" else filename = rsMast("filename") end if %> <% end if if rsMast("item_isPhone") = "1" then %> Congratulations! You’ve made an important step to being a healthier you.
Due to popular demand, the Fitcall is now available 24hrs a day 7 days a week.

You have purchased a telephone Fitcall. Now dial Eric's toll-free number 866-350-1271 (USA and Canada only) and ENTER YOUR CLIENT ID (<%=longmemberid%>). NOTE: Eric will ask for a 4 digit pin -- please use ALL 7 DIGITS OF YOUR CLIENT ID.
<% end if else%> This item has expired and is no longer available for online viewing. <%end if%>

<%end if%>

Basic Fitcall Positions
View/Download the basic positions used during a Fitcall Workout.
You will need Adobe Acrobat Reader to view the file.

Amedia :: Web | Print | Multimedia Eric the Trainer Home About Us Sitemap Contact