| Server IP : 216.92.14.13 / Your IP : 216.73.217.126 Web Server : Apache System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 User : rmlac2fmr ( 1040637) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/home/rmlac2fmr/ |
Upload File : |
import json
db = json.load(open("/home/rmlac2fmr/public_html/jn.com/ops/data/db.json"))
names = ["diego", "gorenc", "tipiere", "king"]
fixed = 0
for person in db.get("persons", []):
lastName = person.get("lastName", "").lower()
if not any(n in lastName for n in names):
continue
# Find their travel request with intake data
reqs = [r for r in db.get("travelRequests", []) if r.get("personId") == person["id"] and r.get("source") == "intake_form"]
if not reqs:
continue
r = reqs[-1] # latest intake submission
name = f"{person.get('firstName','')} {person.get('lastName','')}"
changes = []
# Map submitted fields to person fields (only fill empty ones)
field_map = {
"submittedDept": "dept",
"submittedPhone": "phone",
"submittedGender": "gender",
"submittedDob": "dob",
"submittedTsa": "tsaNumber",
"submittedSeatPref": "seatPref",
"submittedHomeAirport": "homeAirport",
"submittedLoyalty": "loyaltyNumbers",
"submittedDietary": "dietary",
}
for src, dst in field_map.items():
val = r.get(src, "")
if val and not person.get(dst):
person[dst] = val
changes.append(f" {dst} = {val}")
# Check for address fields
for addr_field in ["submittedAddress", "mailingAddress", "address"]:
val = r.get(addr_field)
if val and not person.get("address"):
person["address"] = val
changes.append(f" address = {val}")
break
# Check for emergency contacts
ec = r.get("submittedEmergencyContacts") or r.get("emergencyContacts")
if ec and not person.get("emergencyContacts"):
person["emergencyContacts"] = ec
changes.append(f" emergencyContacts = (set)")
if changes:
print(f"\n{name} ({person['id']}):")
for c in changes:
print(c)
fixed += 1
else:
print(f"\n{name}: no empty fields to fill (already populated or no intake data)")
if fixed:
json.dump(db, open("/home/rmlac2fmr/public_html/jn.com/ops/data/db.json", "w"), indent=2)
print(f"\nUpdated {fixed} profiles. Done!")