This repository has been archived on 2026-03-21. You can view files and clone it, but cannot push or open issues or pull requests.
payfrit-biz/yelpforexes.com/Application.cfm.2020-07-10.bup.cfm
John Mizerek 1210249f54 Normalize database column and table names across entire codebase
Update all SQL queries, query result references, and ColdFusion code to match
the renamed database schema. Tables use plural CamelCase, PKs are all `ID`,
column prefixes stripped (e.g. BusinessName→Name, UserFirstName→FirstName).

Key changes:
- Strip table-name prefixes from all column references (Businesses, Users,
  Addresses, Hours, Menus, Categories, Items, Stations, Orders,
  OrderLineItems, Tasks, TaskCategories, TaskRatings, QuickTaskTemplates,
  ScheduledTaskDefinitions, ChatMessages, Beacons, ServicePoints, Employees,
  VisitorTrackings, ApiPerfLogs, tt_States, tt_Days, tt_AddressTypes,
  tt_OrderTypes, tt_TaskTypes)
- Rename PK references from {TableName}ID to ID in all queries
- Rewrite 7 admin beacon files to use ServicePoints.BeaconID instead of
  dropped lt_Beacon_Businesses_ServicePoints link table
- Rewrite beacon assignment files (list, save, delete) for new schema
- Fix FK references incorrectly changed to ID (OrderLineItems.OrderID,
  Categories.MenuID, Tasks.CategoryID, ServicePoints.BeaconID)
- Update Addresses: AddressLat→Latitude, AddressLng→Longitude
- Update Users: UserPassword→Password, UserIsEmailVerified→IsEmailVerified,
  UserIsActive→IsActive, UserBalance→Balance, etc.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:39:12 -08:00

187 lines
No EOL
5.7 KiB
Text

<cfapplication name="yelpforexes_app"
clientmanagement="Yes"
sessionmanagement="Yes"
setclientcookies="Yes"
sessiontimeout="#CreateTimeSpan(0,0,30,0)#"
clientstorage="cookie">
<CFSET application.datasource = "yelpforexes">
<cfset application.businessMasterObj = new library.cfc.businessMaster(odbc = application.datasource) />
<cfset application.twilioObj = new library.cfc.twilio() />
<CFSET border_width = "0">
<CFPARAM name="form.mode" default="start">
<CFPARAM name="form.prev_mode" default="">
<cfset request.cgiPath = getPageContext().getRequest().getRequestURI() />
<!--- Lock persistent scopes to avoid conflicts --->
<cflock scope="session" timeout="15" throwontimeout="yes" type="exclusive">
<!--- Replacing cookie with session variable --->
<cfparam name="session.UserID" default="0">
<!--- <cfparam name="session.bizid" default="0"> --->
<!--- Duplicate the session variables in the request scope so you don't have to CFLOCK them every time you use them. --->
<cfset request.UserID = Duplicate(session.UserID)>
<!--- <cfset request.bizid = Duplicate(session.bizid)> --->
</cflock>
<cfquery name="save_user_visit" datasource="#application.datasource#">
INSERT INTO VisitorTracking
(
PageMode,
UserID,
CfID,
HttpReferer,
HttpUserAgent,
RequestUrl,
LocalIPAddress,
RemoteAddress,
RemoteHost,
RemoteUser,
AddedOn
)
VALUES (
'#form.mode#',
'#request.UserID#',
'#session.CfID#',
'#cgi.http_referer#',
'#cgi.http_user_agent#',
'#cgi.request_url#',
'#cgi.local_addr#',
'#cgi.remote_addr#',
'#cgi.remote_host#',
'#cgi.remote_user#',
#CreateODBCDateTime(now())#
);
</cfquery>
<cfif request.UserID NEQ 0>
<cfquery name="check_user" datasource="#application.datasource#">
SELECT FirstName
FROM Users
WHERE ID = #request.UserID#
</cfquery>
</cfif>
<cfif cgi.Server_Name EQ "127.0.0.1"OR cgi.Server_Name EQ "indigo.payfrit.com">
<CFSET application.wwwrootprefix = "/yelpforexes.com/">
<CFSET application.rootprefix = "\">
<CFSET application.httpprefix = "http://127.0.0.1/yelpforexes.com/">
<CFSET application.httpsprefix = "/">
<CFSET application.uploads_dir = "C:\Inetpub\wwwroot\yelpforexes.com\uploads\">
<cfsetting showDebugOutput="yes">
<cfelse>
<CFSET application.wwwrootprefix = "/">
<CFSET application.rootprefix = "\">
<CFSET application.httpprefix = "https://yelpforexes.com/">
<CFSET application.httpsprefix = "/">
<CFSET application.uploads_dir = "/var/www/yelpforexes.com/uploads/">
<cfsetting showDebugOutput="no">
</cfif>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
<link rel="stylesheet" href="styles/main_website.css">
<cfif (find("logout.cfm", request.cgiPath) EQ 0) AND request.UserID NEQ 0>
<cfoutput><meta http-equiv="refresh" content="900;url=#application.wwwrootprefix#logout.cfm"></cfoutput>
</cfif>
<title>The Yelp For Exes App</title>
</head>
<body bgcolor="C0C0C0">
<cfoutput>
<!--- NEW BEFORE CONTENT --->
<table border="#border_width#" cellspacing="5" cellpadding="0" bgcolor="FFFFFF" width="650"> <!--- Main table for content --->
<tr> <!--- Top menu bar --->
<td colspan="3">
<table border="#border_width#"" cellspacing="0" cellpadding="0" bgcolor="FFFFFF" width="100%">
<tr>
<td width="150"><img src="#application.wwwrootprefix#images/yelpforexeslogo150.jpg" width="150" height="150" border="0" alt=""></td>
<td>&nbsp;</td>
<td width="150" align="right">
<cfif find("logout.cfm", request.cgiPath) EQ 0>
<cfif request.UserID NEQ 0>
Hi, <cfif check_user.FirstName gt "">#check_user.FirstName#<cfelse>Yelp For Exes User</cfif>
<cfelse>
<table border="#border_width#" cellspacing="0" cellpadding="0" bgcolor="FFFFFF" width="100%">
<tr>
<td align="right">
<form action="#application.wwwrootprefix#index.cfm" method="post" name="login_form" id="login_form" style="display:inline;">
<table align="right" cellspacing="0" cellpadding="0" border="#border_width#">
<tr>
<td align="right">email:&nbsp;<input type="Text" name="username" required="No" size="10" maxlength="100"></td>
</tr>
<tr>
<td align="right">pword:&nbsp;<input type="password" name="password" required="No" size="10" maxlength="20"></td>
</tr>
<tr>
<td align="right">
<input type="submit" value="login">
<input type="hidden" name="mode" value="login">
</td>
</tr>
</table>
<input type="hidden" name="submitted" value="1">
</form>
</td>
</tr>
</table>
</cfif>
</cfif>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="150" valign="top">
<cfinclude template="includes/menu.cfm"> <!--- Left side menu bar --->
</td>
<td valign="top"> <!--- Open the main content cell --->
</cfoutput>
<!--- END NEW BEFORE CONTENT --->