API Improvements: - api/businesses/get.cfm: Fetch address from Addresses table, hours from Hours table - api/tasks/getDetails.cfm: Add CustomerPhone field from UserContactNumber - api/orders/getDetail.cfm: New endpoint for order details with line items - api/Application.cfm: Add new admin endpoints to public allowlist Admin Tools: - api/admin/beaconStatus.cfm: View all beacon-to-business mappings - api/admin/updateBeaconMapping.cfm: Change beacon business assignment - api/admin/setupBigDeansInfo.cfm: Set Big Dean's address and hours - api/admin/listTables.cfm: List all database tables - api/admin/describeTable.cfm: Get table structure and sample data - api/admin/randomizePrices.cfm: Randomize item prices for testing - Various Big Dean's debug/update scripts Portal Enhancements: - Enhanced CSS styling for portal pages - Improved portal.js functionality 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
85 lines
2.5 KiB
Text
85 lines
2.5 KiB
Text
<cfsetting showdebugoutput="false">
|
|
<cfsetting enablecfoutputonly="true">
|
|
<cfcontent type="application/json; charset=utf-8" reset="true">
|
|
|
|
<cfscript>
|
|
// Update Big Dean's business info
|
|
businessId = 27;
|
|
|
|
// Big Dean's actual address and hours
|
|
address = "1615 Ocean Front Walk, Santa Monica, CA 90401";
|
|
phone = "(310) 393-2666";
|
|
hours = "Mon-Thu: 11am-10pm, Fri-Sat: 11am-11pm, Sun: 11am-10pm";
|
|
|
|
try {
|
|
// First get column names from INFORMATION_SCHEMA
|
|
cols = queryExecute("
|
|
SELECT COLUMN_NAME
|
|
FROM INFORMATION_SCHEMA.COLUMNS
|
|
WHERE TABLE_SCHEMA = 'payfrit' AND TABLE_NAME = 'Businesses'
|
|
ORDER BY ORDINAL_POSITION
|
|
");
|
|
|
|
colNames = [];
|
|
for (c in cols) {
|
|
arrayAppend(colNames, c.COLUMN_NAME);
|
|
}
|
|
|
|
// Check if we have the columns we need
|
|
hasAddress = arrayFindNoCase(colNames, "BusinessAddress") > 0;
|
|
hasPhone = arrayFindNoCase(colNames, "BusinessPhone") > 0;
|
|
hasHours = arrayFindNoCase(colNames, "BusinessHours") > 0;
|
|
|
|
// Add columns if missing
|
|
if (!hasAddress) {
|
|
queryExecute("ALTER TABLE Businesses ADD COLUMN BusinessAddress VARCHAR(255)");
|
|
}
|
|
if (!hasPhone) {
|
|
queryExecute("ALTER TABLE Businesses ADD COLUMN BusinessPhone VARCHAR(50)");
|
|
}
|
|
if (!hasHours) {
|
|
queryExecute("ALTER TABLE Businesses ADD COLUMN BusinessHours VARCHAR(255)");
|
|
}
|
|
|
|
// Update with new info
|
|
queryExecute("
|
|
UPDATE Businesses
|
|
SET BusinessAddress = :address,
|
|
BusinessPhone = :phone,
|
|
BusinessHours = :hours
|
|
WHERE BusinessID = :bizId
|
|
", {
|
|
address: address,
|
|
phone: phone,
|
|
hours: hours,
|
|
bizId: businessId
|
|
});
|
|
|
|
// Get updated record
|
|
updated = queryExecute("
|
|
SELECT BusinessID, BusinessName, BusinessAddress, BusinessPhone, BusinessHours
|
|
FROM Businesses
|
|
WHERE BusinessID = :bizId
|
|
", { bizId: businessId });
|
|
|
|
writeOutput(serializeJSON({
|
|
"OK": true,
|
|
"MESSAGE": "Updated Big Dean's info",
|
|
"COLUMNS_EXISTED": { "address": hasAddress, "phone": hasPhone, "hours": hasHours },
|
|
"BUSINESS": {
|
|
"BusinessID": updated.BusinessID,
|
|
"BusinessName": updated.BusinessName,
|
|
"BusinessAddress": updated.BusinessAddress,
|
|
"BusinessPhone": updated.BusinessPhone,
|
|
"BusinessHours": updated.BusinessHours
|
|
}
|
|
}));
|
|
|
|
} catch (any e) {
|
|
writeOutput(serializeJSON({
|
|
"OK": false,
|
|
"ERROR": e.message,
|
|
"DETAIL": e.detail
|
|
}));
|
|
}
|
|
</cfscript>
|