import re

with open('/var/www/html/undangan_digital/index.html', 'r') as f:
    html = f.read()

# 1. Resepsi Card Place
old_place = """<p class="place">Gedung Sasana Kriya TMII<br>Jl. Raya TMII, Jakarta Timur<br>Pintu Gerbang 2</p>"""
new_place = """<p class="place">SMK NEGERI 71 Jakarta<br>Jl. Dr. KRT Radjiman Widyodiningrat<br>Kp. Pulo Jahe, Cakung, Jaktim 13930</p>"""
html = html.replace(old_place, new_place)

# 2. Section Subtitle
old_sub = """<p class="section-subtitle">Gedung Sasana Kriya – Taman Mini Indonesia Indah, Jakarta Timur</p>"""
new_sub = """<p class="section-subtitle">SMK NEGERI 71 Jakarta – Jl. Kp. Pulo Jahe, Jatinegara, Cakung</p>"""
html = html.replace(old_sub, new_sub)

# 3. Embed URL
old_embed = """src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3966.0!2d106.895!3d-6.302!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x2e698f8b3a5f4e3d%3A0x6a3e1a3db5f8b7a2!2sTaman%20Mini%20Indonesia%20Indah!5e0!3m2!1sid!2sid!4v1684567890\""""
new_embed = """src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3966.388334469278!2d106.91427957597143!3d-6.199120993788775!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x2e698b671cc81313%3A0x948df99b821469e3!2sSMK%20Negeri%2071%20Jakarta!5e0!3m2!1sen!2sid!4v1700000000000!5m2!1sen!2sid\""""
html = html.replace(old_embed, new_embed)

# 4. Maps link
old_link = """href="https://maps.google.com/?q=Taman+Mini+Indonesia+Indah+Jakarta\""""
new_link = """href="https://maps.google.com/?q=SMK+Negeri+71+Jakarta\""""
html = html.replace(old_link, new_link)

# 5. Kendaraan Pribadi
old_kpri = """<div style="color:#555;font-size:0.8rem;margin-top:0.3rem;">Via Jl. Taman Mini Raya dari arah Pintu Gerbang 2. Parkir tersedia luas.</div>"""
new_kpri = """<div style="color:#555;font-size:0.8rem;margin-top:0.3rem;">Masuk melalui Jl. Dr. KRT Radjiman Widyodiningrat. Area parkir tersedia.</div>"""
html = html.replace(old_kpri, new_kpri)

# 6. Angkutan Umum
old_ang = """<div style="color:#555;font-size:0.8rem;margin-top:0.3rem;">TransJakarta Koridor 7 turun Halte TMII. Ojek online tersedia di sekitar halte.</div>"""
new_ang = """<div style="color:#555;font-size:0.8rem;margin-top:0.3rem;">Naik JakLingko atau transportasi online dengan tujuan langsung SMK Negeri 71 Jakarta.</div>"""
html = html.replace(old_ang, new_ang)

with open('/var/www/html/undangan_digital/index.html', 'w') as f:
    f.write(html)

print("Updated location to SMK Negeri 71 Jakarta.")
