| 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"))
# Find the two persons with same ID
dupes = [p for p in db["persons"] if p["id"] == "P9547022"]
print("Found", len(dupes), "persons with ID P9547022:")
for p in dupes:
print(f" {p['firstName']} {p['lastName']} - {p['email']}")
# Give Allan Wells a new unique ID
new_id = "P" + str(int(time.time()))[-8:] + "AW"
for p in db["persons"]:
if p["id"] == "P9547022" and p["email"] == "allan@mdots.tv":
p["id"] = new_id
print(f"\nAllan Wells: P9547022 -> {new_id}")
# Update Allan's travel request to point to new ID
for r in db["travelRequests"]:
if r["id"] == "R1774535445702":
r["personId"] = new_id
print(f"Travel request R1774535445702: personId -> {new_id}")
# Update assignments
for a in db["assignments"]:
# Find any assignment that was for Allan (check by looking at all P9547022 assignments)
pass
# Add assignment for Allan with new ID if not exists
has_allan_assign = any(a["personId"] == new_id for a in db["assignments"])
if not has_allan_assign:
db["assignments"].append({"id": "A" + str(int(time.time())), "personId": new_id, "showId": "S2"})
print(f"Added assignment for Allan Wells -> S2")
json.dump(db, open("/home/rmlac2fmr/public_html/jn.com/ops/data/db.json", "w"), indent=2)
print("\nDone! Also check for any other duplicate person IDs:")
# Scan for other duplicate IDs
from collections import Counter
ids = Counter(p["id"] for p in db["persons"])
for pid, count in ids.items():
if count > 1:
names = [f"{p['firstName']} {p['lastName']}" for p in db["persons"] if p["id"] == pid]
print(f" DUPLICATE: {pid} -> {names}")
if all(c == 1 for c in ids.values()):
print(" None found - all clean!")