﻿file = r'resources\views\dashboard\manager.blade.php'
with open(file, 'r', encoding='utf-8') as f:
    c = f.read()

old = '<div class="stat-label">Contact Plan Aktif</div>'
new = "<div class=\"stat-label\">{{ auth()->user()->unit_type === 'divisi' ? 'Panel Test Aktif' : 'Contact Plan Aktif' }}</div>"

if old in c:
    c = c.replace(old, new)
    print("OK!")
else:
    print("GAGAL - cek:")
    idx = c.find('Plan Aktif')
    print(repr(c[idx-30:idx+80]))

with open(file, 'w', encoding='utf-8') as f:
    f.write(c)
