| 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, time, random, string
db = json.load(open("/home/rmlac2fmr/public_html/jn.com/ops/data/db.json"))
# Find Carney's travel request
r = next((r for r in db["travelRequests"] if "carney" in r.get("submittedName","").lower()), None)
if not r:
print("No travel request found for Carney")
exit()
print(f"Found request: {r['id']} {r.get('submittedName','')} personId:{r.get('personId','')}")
# Check if person already exists
existing = next((p for p in db["persons"] if "carney" in (p.get("firstName","")+p.get("lastName","")).lower()), None)
if existing:
print(f"Person already exists: {existing['id']} {existing['firstName']} {existing['lastName']}")
# Just link the request
r["personId"] = existing["id"]
print(f"Linked request to {existing['id']}")
else:
# Create person from travel request data
pid = "P" + str(int(time.time()))[-8:] + ''.join(random.choices(string.ascii_lowercase, k=3))
name_parts = r.get("submittedName", "").split()
first = name_parts[0] if name_parts else ""
last = name_parts[-1] if len(name_parts) > 1 else ""
person = {
"id": pid,
"firstName": r.get("firstName", first),
"lastName": r.get("lastName", last),
"middleName": r.get("middleName", ""),
"email": r.get("submittedEmail", ""),
"phone": r.get("submittedPhone", ""),
"title": r.get("submittedTitle", ""),
"dept": r.get("submittedDept", ""),
"gender": r.get("gender", ""),
"dob": r.get("dob", ""),
"tsa": r.get("tsa", ""),
"seatPref": r.get("seatPref", ""),
"dietary": r.get("dietary", ""),
"foodAllergies": r.get("foodAllergies", ""),
"city": "", "state": "", "union": "", "aka": "",
"loyaltyNumbers": [], "emergencyContacts": [],
"created": "2026-04-02"
}
db["persons"].append(person)
# Create assignment
db["assignments"].append({
"id": "A" + str(int(time.time())),
"personId": pid,
"showId": r.get("showId", "S2")
})
# Link request
r["personId"] = pid
print(f"Created person: {pid} {person['firstName']} {person['lastName']}")
print(f"Linked request {r['id']} to {pid}")
json.dump(db, open("/home/rmlac2fmr/public_html/jn.com/ops/data/db.json", "w"), indent=2)
print("Done!")