| 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
db = json.load(open("/home/rmlac2fmr/public_html/jn.com/ops/data/db.json"))
fixed = 0
for r in db["travelRequests"]:
if r["personId"] == "TEMP" and r.get("submittedEmail"):
email = r["submittedEmail"].lower()
p = next((x for x in db["persons"] if x.get("email", "").lower() == email), None)
if not p:
pid = "P" + str(int(time.time() * 1000))[-8:] + str(fixed)
parts = (r.get("submittedName") or "").split()
p = {
"id": pid,
"firstName": parts[0] if parts else "",
"lastName": " ".join(parts[1:]) if len(parts) > 1 else "",
"middleName": "", "aka": "",
"email": r["submittedEmail"],
"phone": r.get("submittedPhone", ""),
"title": r.get("submittedTitle", ""),
"dept": r.get("submittedDept", ""),
"title2": "", "dept2": "",
"city": "", "state": "",
"gender": "", "dob": "",
"tsa": "", "seatPref": "",
"homeAirport": "", "prefAirline": "",
"loyaltyNumbers": [],
"passport": "", "passportCountry": "", "passportExp": "",
"union": "",
"dietary": r.get("dietary", ""),
"foodAllergies": r.get("foodAllergies", ""),
"emergency": r.get("emergency", ""),
"emergencyContacts": [],
"hotelRewards": r.get("hotelRewards", ""),
"created": r.get("submittedDate", "")
}
db["persons"].append(p)
if not any(a["personId"] == pid and a["showId"] == r["showId"] for a in db["assignments"]):
db["assignments"].append({"id": "A" + str(int(time.time() * 1000))[-8:] + str(fixed), "personId": pid, "showId": r["showId"]})
r["personId"] = p["id"]
fixed += 1
print("Fixed:", r["submittedName"], "->", p["id"])
json.dump(db, open("/home/rmlac2fmr/public_html/jn.com/ops/data/db.json", "w"), indent=2)
print("Done. Fixed", fixed)