Upload app.py
Browse files
app.py
CHANGED
|
@@ -319,7 +319,7 @@ body {
|
|
| 319 |
|
| 320 |
/* ── HERO ── */
|
| 321 |
.hero {
|
| 322 |
-
padding:
|
| 323 |
text-align: center;
|
| 324 |
position: relative;
|
| 325 |
overflow: hidden;
|
|
@@ -358,7 +358,66 @@ body {
|
|
| 358 |
font-size: 16px;
|
| 359 |
color: var(--tx2);
|
| 360 |
max-width: 480px;
|
| 361 |
-
margin: 0 auto;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 362 |
}
|
| 363 |
|
| 364 |
/* ── SEARCH / FILTER BAR ── */
|
|
@@ -537,6 +596,31 @@ body {
|
|
| 537 |
<p>الوصول السريع إلى القيود المدنية والملفات الأسرية حسب الوحدة الإدارية</p>
|
| 538 |
</div>
|
| 539 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 540 |
<div class="search-filter-container">
|
| 541 |
<div class="search-wrapper">
|
| 542 |
<i class="ti ti-search search-icon"></i>
|
|
@@ -551,22 +635,22 @@ body {
|
|
| 551 |
</div>
|
| 552 |
<div class="grid" id="prov-grid">
|
| 553 |
<a class="pcard" href="/search?p=baghdad"><div class="pcard-icon"><i class="ti ti-building-monument"></i></div><span class="pcard-name">بغداد</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 554 |
-
<a class="pcard" href="/search?p=nineveh"><div class="pcard-icon"><i class="ti ti-building"></i></div><span class="pcard-name">نينوى</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 555 |
-
<a class="pcard" href="/search?p=basra"><div class="pcard-icon"><i class="ti ti-
|
| 556 |
-
<a class="pcard" href="/search?p=dhiqar"><div class="pcard-icon"><i class="ti ti-home
|
| 557 |
-
<a class="pcard" href="/search?p=babylon"><div class="pcard-icon"><i class="ti ti-
|
| 558 |
-
<a class="pcard" href="/search?p=sulaymaniyah"><div class="pcard-icon"><i class="ti ti-
|
| 559 |
<a class="pcard" href="/search?p=erbil"><div class="pcard-icon"><i class="ti ti-castle"></i></div><span class="pcard-name">أربيل</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 560 |
-
<a class="pcard" href="/search?p=najaf"><div class="pcard-icon"><i class="ti ti-
|
| 561 |
-
<a class="pcard" href="/search?p=alanbar"><div class="pcard-icon"><i class="ti ti-
|
| 562 |
-
<a class="pcard" href="/search?p=diyala"><div class="pcard-icon"><i class="ti ti-
|
| 563 |
<a class="pcard" href="/search?p=kirkuk"><div class="pcard-icon"><i class="ti ti-flame"></i></div><span class="pcard-name">كركوك</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 564 |
<a class="pcard" href="/search?p=salahaldeen"><div class="pcard-icon"><i class="ti ti-feather"></i></div><span class="pcard-name">صلاح الدين</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 565 |
<a class="pcard" href="/search?p=muthana"><div class="pcard-icon"><i class="ti ti-sun"></i></div><span class="pcard-name">المثنى</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 566 |
<a class="pcard" href="/search?p=mesan"><div class="pcard-icon"><i class="ti ti-fish"></i></div><span class="pcard-name">ميسان</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 567 |
-
<a class="pcard" href="/search?p=karbalaa"><div class="pcard-icon"><i class="ti ti-building-
|
| 568 |
-
<a class="pcard" href="/search?p=qadisiya"><div class="pcard-icon"><i class="ti ti-plant
|
| 569 |
-
<a class="pcard" href="/search?p=duhok"><div class="pcard-icon"><i class="ti ti-
|
| 570 |
<a class="pcard" href="/search?p=wasit"><div class="pcard-icon"><i class="ti ti-droplet"></i></div><span class="pcard-name">واسط</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 571 |
<a class="pcard" href="/search?p=balad"><div class="pcard-icon"><i class="ti ti-map-pin"></i></div><span class="pcard-name">بلد (يثرب)</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 572 |
</div>
|
|
@@ -1029,11 +1113,34 @@ ADMIN_HTML = """<!DOCTYPE html>
|
|
| 1029 |
.ibtn.rd:hover{background:var(--rdd);color:var(--rd);border-color:var(--rd)}
|
| 1030 |
.ibtn.ac:hover{background:var(--acd);color:var(--ac);border-color:var(--ac)}
|
| 1031 |
|
| 1032 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1033 |
.savebar.hidden{display:none}
|
| 1034 |
.savebar-msg{font-size:14px;font-weight:700;color:var(--yl);display:flex;align-items:center;gap:8px}
|
| 1035 |
.savebar-prov{font-size:12px;font-weight:700;color:var(--ac2);background:var(--acd);border:1px solid var(--acg);border-radius:30px;padding:4px 12px}
|
| 1036 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1037 |
.divider{height:1px;background:var(--bd);margin:18px 0}
|
| 1038 |
.note{font-size:12px;color:var(--tx3);margin-top:10px;display:flex;align-items:center;gap:6px}
|
| 1039 |
.empty{text-align:center;padding:40px;color:var(--tx3);font-size:14px}
|
|
@@ -1125,10 +1232,14 @@ ADMIN_HTML = """<!DOCTYPE html>
|
|
| 1125 |
</div>
|
| 1126 |
</div>
|
| 1127 |
|
| 1128 |
-
<!-- Save bar -->
|
| 1129 |
<div class="savebar hidden" id="savebar">
|
| 1130 |
-
<div class="savebar-msg">
|
| 1131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1132 |
</div>
|
| 1133 |
|
| 1134 |
<!-- Toast -->
|
|
@@ -1305,7 +1416,7 @@ ADMIN_HTML = """<!DOCTYPE html>
|
|
| 1305 |
<div class="brow">
|
| 1306 |
<button class="btn rd" onclick="deleteFamily('${famNo}')"><i class="ti ti-trash"></i> حذف القيد العائلي بالكامل</button>
|
| 1307 |
</div>
|
| 1308 |
-
<p class="note"><i class="ti ti-info-circle
|
| 1309 |
}
|
| 1310 |
|
| 1311 |
async function deleteFamily(famNo){
|
|
@@ -1331,190 +1442,12 @@ ADMIN_HTML = """<!DOCTYPE html>
|
|
| 1331 |
document.getElementById('savebar').classList.add('hidden');
|
| 1332 |
}else toast(d.error||'فشل مزامنة الملف على الخادم',true);
|
| 1333 |
}catch{toast('حدث خطأ غير متوقع أثناء الاتصال بالخادم',true);}
|
| 1334 |
-
finally{btn.disabled=false;btn.innerHTML='<i class="ti ti-cloud-upload"></i>
|
| 1335 |
}
|
| 1336 |
</script>
|
| 1337 |
</body></html>"""
|
| 1338 |
|
| 1339 |
|
| 1340 |
-
@app.get("/", response_class=HTMLResponse)
|
| 1341 |
-
def index():
|
| 1342 |
-
return HTMLResponse(INDEX_HTML)
|
| 1343 |
-
|
| 1344 |
-
@app.get("/search", response_class=HTMLResponse)
|
| 1345 |
-
def search_page(p: str = Query(...)):
|
| 1346 |
-
prov = PROVINCE_MAP.get(p)
|
| 1347 |
-
if not prov: return HTMLResponse("<h1>محافظة غير موجودة</h1>", 404)
|
| 1348 |
-
return HTMLResponse(SEARCH_HTML.format(prov_name=prov["name"], prov_key=p))
|
| 1349 |
-
|
| 1350 |
-
# ─── ADMIN API ────────────────────────────────────────────────────────────────
|
| 1351 |
-
|
| 1352 |
-
@app.post("/api/admin/add")
|
| 1353 |
-
def admin_add(data: dict = Body(...)):
|
| 1354 |
-
try:
|
| 1355 |
-
p = data.get("province")
|
| 1356 |
-
first = data.get("p_first","").strip()
|
| 1357 |
-
father = data.get("p_father","").strip()
|
| 1358 |
-
grand = data.get("p_grand","").strip()
|
| 1359 |
-
birth = data.get("p_birth","").strip()
|
| 1360 |
-
fam_no = data.get("fam_no","").strip()
|
| 1361 |
-
|
| 1362 |
-
if not all([p, first, father, grand, fam_no]):
|
| 1363 |
-
return JSONResponse({"error": "جميع الحقول مطلوبة"}, 400)
|
| 1364 |
-
|
| 1365 |
-
db_path = get_db_path(p)
|
| 1366 |
-
if not db_path:
|
| 1367 |
-
return JSONResponse({"error": "محافظة غير موجودة"}, 404)
|
| 1368 |
-
|
| 1369 |
-
conn = sqlite3.connect(db_path)
|
| 1370 |
-
table = get_table(conn)
|
| 1371 |
-
|
| 1372 |
-
birth_int = None
|
| 1373 |
-
if birth:
|
| 1374 |
-
birth_clean = birth.replace("/","").strip()
|
| 1375 |
-
if len(birth_clean) == 4:
|
| 1376 |
-
birth_int = int(birth_clean + "00")
|
| 1377 |
-
elif len(birth_clean) == 6:
|
| 1378 |
-
birth_int = int(birth_clean)
|
| 1379 |
-
|
| 1380 |
-
conn.execute(
|
| 1381 |
-
f"INSERT INTO [{table}] (fam_no, p_first, p_father, p_grand, p_birth) VALUES (?,?,?,?,?)",
|
| 1382 |
-
(fam_no, first, father, grand, birth_int)
|
| 1383 |
-
)
|
| 1384 |
-
conn.commit()
|
| 1385 |
-
conn.close()
|
| 1386 |
-
return JSONResponse({"ok": True})
|
| 1387 |
-
except Exception as e:
|
| 1388 |
-
return JSONResponse({"error": str(e)}, 500)
|
| 1389 |
-
|
| 1390 |
-
|
| 1391 |
-
@app.post("/api/admin/edit")
|
| 1392 |
-
def admin_edit(data: dict = Body(...)):
|
| 1393 |
-
try:
|
| 1394 |
-
p = data.get("province")
|
| 1395 |
-
old_first = data.get("old_first","").strip()
|
| 1396 |
-
old_father = data.get("old_father","").strip()
|
| 1397 |
-
old_grand = data.get("old_grand","").strip()
|
| 1398 |
-
old_fam = data.get("old_fam","").strip()
|
| 1399 |
-
new_first = data.get("p_first","").strip()
|
| 1400 |
-
new_father = data.get("p_father","").strip()
|
| 1401 |
-
new_grand = data.get("p_grand","").strip()
|
| 1402 |
-
new_birth = data.get("p_birth","").strip()
|
| 1403 |
-
new_fam = data.get("fam_no","").strip()
|
| 1404 |
-
|
| 1405 |
-
db_path = get_db_path(p)
|
| 1406 |
-
if not db_path:
|
| 1407 |
-
return JSONResponse({"error": "محافظة غير موجودة"}, 404)
|
| 1408 |
-
|
| 1409 |
-
conn = sqlite3.connect(db_path)
|
| 1410 |
-
table = get_table(conn)
|
| 1411 |
-
|
| 1412 |
-
birth_int = None
|
| 1413 |
-
if new_birth:
|
| 1414 |
-
b = new_birth.replace("/","").strip()
|
| 1415 |
-
if len(b) == 4:
|
| 1416 |
-
birth_int = int(b + "00")
|
| 1417 |
-
elif len(b) == 6:
|
| 1418 |
-
birth_int = int(b)
|
| 1419 |
-
|
| 1420 |
-
conn.execute(
|
| 1421 |
-
f"UPDATE [{table}] SET p_first=?, p_father=?, p_grand=?, p_birth=?, fam_no=? "
|
| 1422 |
-
f"WHERE fam_no=? AND p_first=? AND p_father=? AND p_grand=?",
|
| 1423 |
-
(new_first, new_father, new_grand, birth_int, new_fam,
|
| 1424 |
-
old_fam, old_first, old_father, old_grand)
|
| 1425 |
-
)
|
| 1426 |
-
conn.commit()
|
| 1427 |
-
conn.close()
|
| 1428 |
-
return JSONResponse({"ok": True})
|
| 1429 |
-
except Exception as e:
|
| 1430 |
-
return JSONResponse({"error": str(e)}, 500)
|
| 1431 |
-
|
| 1432 |
-
|
| 1433 |
-
@app.post("/api/admin/delete-person")
|
| 1434 |
-
def admin_delete_person(data: dict = Body(...)):
|
| 1435 |
-
try:
|
| 1436 |
-
p = data.get("province")
|
| 1437 |
-
first = data.get("p_first","").strip()
|
| 1438 |
-
father = data.get("p_father","").strip()
|
| 1439 |
-
grand = data.get("p_grand","").strip()
|
| 1440 |
-
fam_no = data.get("fam_no","").strip()
|
| 1441 |
-
|
| 1442 |
-
db_path = get_db_path(p)
|
| 1443 |
-
if not db_path:
|
| 1444 |
-
return JSONResponse({"error": "محافظة غير موجودة"}, 404)
|
| 1445 |
-
|
| 1446 |
-
conn = sqlite3.connect(db_path)
|
| 1447 |
-
table = get_table(conn)
|
| 1448 |
-
conn.execute(
|
| 1449 |
-
f"DELETE FROM [{table}] WHERE fam_no=? AND p_first=? AND p_father=? AND p_grand=?",
|
| 1450 |
-
(fam_no, first, father, grand)
|
| 1451 |
-
)
|
| 1452 |
-
conn.commit()
|
| 1453 |
-
conn.close()
|
| 1454 |
-
return JSONResponse({"ok": True})
|
| 1455 |
-
except Exception as e:
|
| 1456 |
-
return JSONResponse({"error": str(e)}, 500)
|
| 1457 |
-
|
| 1458 |
-
|
| 1459 |
-
@app.post("/api/admin/delete-family")
|
| 1460 |
-
def admin_delete_family(data: dict = Body(...)):
|
| 1461 |
-
try:
|
| 1462 |
-
p = data.get("province")
|
| 1463 |
-
fam_no = data.get("fam_no","").strip()
|
| 1464 |
-
|
| 1465 |
-
db_path = get_db_path(p)
|
| 1466 |
-
if not db_path:
|
| 1467 |
-
return JSONResponse({"error": "محافظة غير موجودة"}, 404)
|
| 1468 |
-
|
| 1469 |
-
conn = sqlite3.connect(db_path)
|
| 1470 |
-
table = get_table(conn)
|
| 1471 |
-
|
| 1472 |
-
candidates = {fam_no}
|
| 1473 |
-
try:
|
| 1474 |
-
n = int(fam_no)
|
| 1475 |
-
candidates.add(str(n))
|
| 1476 |
-
candidates.add(f"{n:07d}")
|
| 1477 |
-
except:
|
| 1478 |
-
pass
|
| 1479 |
-
|
| 1480 |
-
deleted = 0
|
| 1481 |
-
for candidate in candidates:
|
| 1482 |
-
cur = conn.execute(f"DELETE FROM [{table}] WHERE fam_no=?", (candidate,))
|
| 1483 |
-
deleted += cur.rowcount
|
| 1484 |
-
|
| 1485 |
-
conn.commit()
|
| 1486 |
-
conn.close()
|
| 1487 |
-
return JSONResponse({"ok": True, "deleted": deleted})
|
| 1488 |
-
except Exception as e:
|
| 1489 |
-
return JSONResponse({"error": str(e)}, 500)
|
| 1490 |
-
|
| 1491 |
-
|
| 1492 |
-
@app.post("/api/admin/save")
|
| 1493 |
-
def admin_save(data: dict = Body(...)):
|
| 1494 |
-
try:
|
| 1495 |
-
p = data.get("province")
|
| 1496 |
-
prov = PROVINCE_MAP.get(p)
|
| 1497 |
-
if not prov:
|
| 1498 |
-
return JSONResponse({"error": "محافظة غير موجودة"}, 404)
|
| 1499 |
-
|
| 1500 |
-
db_path = get_db_path(p)
|
| 1501 |
-
token = os.environ.get("HF_TOKEN")
|
| 1502 |
-
if not token:
|
| 1503 |
-
return JSONResponse({"error": "HF_TOKEN غير موجود"}, 500)
|
| 1504 |
-
|
| 1505 |
-
api = HfApi()
|
| 1506 |
-
api.upload_file(
|
| 1507 |
-
path_or_fileobj=db_path,
|
| 1508 |
-
path_in_repo=prov["file"],
|
| 1509 |
-
repo_id=REPO_ID,
|
| 1510 |
-
repo_type="dataset",
|
| 1511 |
-
token=token,
|
| 1512 |
-
)
|
| 1513 |
-
return JSONResponse({"ok": True})
|
| 1514 |
-
except Exception as e:
|
| 1515 |
-
return JSONResponse({"error": str(e)}, 500)
|
| 1516 |
-
|
| 1517 |
-
|
| 1518 |
@app.get("/admin", response_class=HTMLResponse)
|
| 1519 |
def admin_page():
|
| 1520 |
return HTMLResponse(ADMIN_HTML)
|
|
|
|
| 319 |
|
| 320 |
/* ── HERO ── */
|
| 321 |
.hero {
|
| 322 |
+
padding: 50px 24px 20px;
|
| 323 |
text-align: center;
|
| 324 |
position: relative;
|
| 325 |
overflow: hidden;
|
|
|
|
| 358 |
font-size: 16px;
|
| 359 |
color: var(--tx2);
|
| 360 |
max-width: 480px;
|
| 361 |
+
margin: 0 auto 20px;
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
+
/* ── STATISTICS DASHBOARD ── */
|
| 365 |
+
.stats-grid {
|
| 366 |
+
display: grid;
|
| 367 |
+
grid-template-columns: repeat(3, 1fr);
|
| 368 |
+
gap: 16px;
|
| 369 |
+
max-width: 1000px;
|
| 370 |
+
margin: 0 auto 30px;
|
| 371 |
+
padding: 0 24px;
|
| 372 |
+
}
|
| 373 |
+
.stat-card {
|
| 374 |
+
background: var(--sf);
|
| 375 |
+
border: 1.5px solid var(--bd);
|
| 376 |
+
border-radius: var(--r);
|
| 377 |
+
padding: 16px;
|
| 378 |
+
display: flex;
|
| 379 |
+
align-items: center;
|
| 380 |
+
gap: 14px;
|
| 381 |
+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
|
| 382 |
+
transition: transform 0.2s, border-color 0.2s;
|
| 383 |
+
}
|
| 384 |
+
.stat-card:hover {
|
| 385 |
+
transform: translateY(-2px);
|
| 386 |
+
border-color: var(--bd2);
|
| 387 |
+
}
|
| 388 |
+
.stat-icon {
|
| 389 |
+
width: 42px;
|
| 390 |
+
height: 42px;
|
| 391 |
+
background: var(--acd);
|
| 392 |
+
border: 1px solid var(--acg);
|
| 393 |
+
border-radius: 12px;
|
| 394 |
+
display: flex;
|
| 395 |
+
align-items: center;
|
| 396 |
+
justify-content: center;
|
| 397 |
+
color: var(--ac2);
|
| 398 |
+
font-size: 20px;
|
| 399 |
+
}
|
| 400 |
+
.stat-info {
|
| 401 |
+
display: flex;
|
| 402 |
+
flex-direction: column;
|
| 403 |
+
}
|
| 404 |
+
.stat-val {
|
| 405 |
+
font-size: 18px;
|
| 406 |
+
font-weight: 800;
|
| 407 |
+
color: var(--tx);
|
| 408 |
+
line-height: 1.2;
|
| 409 |
+
}
|
| 410 |
+
.stat-lbl {
|
| 411 |
+
font-size: 12px;
|
| 412 |
+
color: var(--tx2);
|
| 413 |
+
font-weight: 600;
|
| 414 |
+
}
|
| 415 |
+
|
| 416 |
+
@media (max-width: 640px) {
|
| 417 |
+
.stats-grid {
|
| 418 |
+
grid-template-columns: 1fr;
|
| 419 |
+
gap: 10px;
|
| 420 |
+
}
|
| 421 |
}
|
| 422 |
|
| 423 |
/* ── SEARCH / FILTER BAR ── */
|
|
|
|
| 596 |
<p>الوصول السريع إلى القيود المدنية والملفات الأسرية حسب الوحدة الإدارية</p>
|
| 597 |
</div>
|
| 598 |
|
| 599 |
+
<!-- Statistics Dashboard Row -->
|
| 600 |
+
<div class="stats-grid">
|
| 601 |
+
<div class="stat-card">
|
| 602 |
+
<div class="stat-icon"><i class="ti ti-map-pins"></i></div>
|
| 603 |
+
<div class="stat-info">
|
| 604 |
+
<span class="stat-val">19</span>
|
| 605 |
+
<span class="stat-lbl">وحدة إدارية</span>
|
| 606 |
+
</div>
|
| 607 |
+
</div>
|
| 608 |
+
<div class="stat-card">
|
| 609 |
+
<div class="stat-icon"><i class="ti ti-cloud-computing"></i></div>
|
| 610 |
+
<div class="stat-info">
|
| 611 |
+
<span class="stat-val">متصل</span>
|
| 612 |
+
<span class="stat-lbl">المزامنة السحابية</span>
|
| 613 |
+
</div>
|
| 614 |
+
</div>
|
| 615 |
+
<div class="stat-card">
|
| 616 |
+
<div class="stat-icon"><i class="ti ti-shield-check"></i></div>
|
| 617 |
+
<div class="stat-info">
|
| 618 |
+
<span class="stat-val">نشط</span>
|
| 619 |
+
<span class="stat-lbl">حالة النظام الآمن</span>
|
| 620 |
+
</div>
|
| 621 |
+
</div>
|
| 622 |
+
</div>
|
| 623 |
+
|
| 624 |
<div class="search-filter-container">
|
| 625 |
<div class="search-wrapper">
|
| 626 |
<i class="ti ti-search search-icon"></i>
|
|
|
|
| 635 |
</div>
|
| 636 |
<div class="grid" id="prov-grid">
|
| 637 |
<a class="pcard" href="/search?p=baghdad"><div class="pcard-icon"><i class="ti ti-building-monument"></i></div><span class="pcard-name">بغداد</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 638 |
+
<a class="pcard" href="/search?p=nineveh"><div class="pcard-icon"><i class="ti ti-building-arch"></i></div><span class="pcard-name">نينوى</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 639 |
+
<a class="pcard" href="/search?p=basra"><div class="pcard-icon"><i class="ti ti-anchor"></i></div><span class="pcard-name">البصرة</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 640 |
+
<a class="pcard" href="/search?p=dhiqar"><div class="pcard-icon"><i class="ti ti-home"></i></div><span class="pcard-name">ذي قار</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 641 |
+
<a class="pcard" href="/search?p=babylon"><div class="pcard-icon"><i class="ti ti-building-fortress"></i></div><span class="pcard-name">بابل</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 642 |
+
<a class="pcard" href="/search?p=sulaymaniyah"><div class="pcard-icon"><i class="ti ti-mountain"></i></div><span class="pcard-name">السليمان��ة</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 643 |
<a class="pcard" href="/search?p=erbil"><div class="pcard-icon"><i class="ti ti-castle"></i></div><span class="pcard-name">أربيل</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 644 |
+
<a class="pcard" href="/search?p=najaf"><div class="pcard-icon"><i class="ti ti-book"></i></div><span class="pcard-name">النجف</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 645 |
+
<a class="pcard" href="/search?p=alanbar"><div class="pcard-icon"><i class="ti ti-tree"></i></div><span class="pcard-name">الأنبار</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 646 |
+
<a class="pcard" href="/search?p=diyala"><div class="pcard-icon"><i class="ti ti-droplets"></i></div><span class="pcard-name">ديالى</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 647 |
<a class="pcard" href="/search?p=kirkuk"><div class="pcard-icon"><i class="ti ti-flame"></i></div><span class="pcard-name">كركوك</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 648 |
<a class="pcard" href="/search?p=salahaldeen"><div class="pcard-icon"><i class="ti ti-feather"></i></div><span class="pcard-name">صلاح الدين</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 649 |
<a class="pcard" href="/search?p=muthana"><div class="pcard-icon"><i class="ti ti-sun"></i></div><span class="pcard-name">المثنى</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 650 |
<a class="pcard" href="/search?p=mesan"><div class="pcard-icon"><i class="ti ti-fish"></i></div><span class="pcard-name">ميسان</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 651 |
+
<a class="pcard" href="/search?p=karbalaa"><div class="pcard-icon"><i class="ti ti-building-monument"></i></div><span class="pcard-name">كربلاء</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 652 |
+
<a class="pcard" href="/search?p=qadisiya"><div class="pcard-icon"><i class="ti ti-plant"></i></div><span class="pcard-name">القادسية</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 653 |
+
<a class="pcard" href="/search?p=duhok"><div class="pcard-icon"><i class="ti ti-leaf"></i></div><span class="pcard-name">دهوك</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 654 |
<a class="pcard" href="/search?p=wasit"><div class="pcard-icon"><i class="ti ti-droplet"></i></div><span class="pcard-name">واسط</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 655 |
<a class="pcard" href="/search?p=balad"><div class="pcard-icon"><i class="ti ti-map-pin"></i></div><span class="pcard-name">بلد (يثرب)</span><span class="pcard-arrow"><i class="ti ti-chevron-left"></i></span></a>
|
| 656 |
</div>
|
|
|
|
| 1113 |
.ibtn.rd:hover{background:var(--rdd);color:var(--rd);border-color:var(--rd)}
|
| 1114 |
.ibtn.ac:hover{background:var(--acd);color:var(--ac);border-color:var(--ac)}
|
| 1115 |
|
| 1116 |
+
/* ── SAVING BAR MODIFIED ── */
|
| 1117 |
+
.savebar{
|
| 1118 |
+
position:fixed;bottom:0;right:0;left:0;
|
| 1119 |
+
background:var(--sf);border-top:1.5px solid var(--bd);
|
| 1120 |
+
padding:16px 24px;display:flex;align-items:center;justify-content:space-between;
|
| 1121 |
+
z-index:200;box-shadow:0 -4px 20px rgba(0,0,0,0.2);
|
| 1122 |
+
animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
| 1123 |
+
}
|
| 1124 |
+
@keyframes slideUp {
|
| 1125 |
+
from { transform: translateY(100%); }
|
| 1126 |
+
to { transform: translateY(0); }
|
| 1127 |
+
}
|
| 1128 |
.savebar.hidden{display:none}
|
| 1129 |
.savebar-msg{font-size:14px;font-weight:700;color:var(--yl);display:flex;align-items:center;gap:8px}
|
| 1130 |
.savebar-prov{font-size:12px;font-weight:700;color:var(--ac2);background:var(--acd);border:1px solid var(--acg);border-radius:30px;padding:4px 12px}
|
| 1131 |
|
| 1132 |
+
/* pulsating dot indicator for unsaved changes */
|
| 1133 |
+
.pulse-dot {
|
| 1134 |
+
width: 8px; height: 8px; background-color: var(--yl); border-radius: 50%;
|
| 1135 |
+
box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
|
| 1136 |
+
animation: pulse 1.4s infinite;
|
| 1137 |
+
}
|
| 1138 |
+
@keyframes pulse {
|
| 1139 |
+
0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
|
| 1140 |
+
70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
|
| 1141 |
+
100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
|
| 1142 |
+
}
|
| 1143 |
+
|
| 1144 |
.divider{height:1px;background:var(--bd);margin:18px 0}
|
| 1145 |
.note{font-size:12px;color:var(--tx3);margin-top:10px;display:flex;align-items:center;gap:6px}
|
| 1146 |
.empty{text-align:center;padding:40px;color:var(--tx3);font-size:14px}
|
|
|
|
| 1232 |
</div>
|
| 1233 |
</div>
|
| 1234 |
|
| 1235 |
+
<!-- Dynamic Save bar with Pulse Indicator -->
|
| 1236 |
<div class="savebar hidden" id="savebar">
|
| 1237 |
+
<div class="savebar-msg">
|
| 1238 |
+
<div class="pulse-dot"></div>
|
| 1239 |
+
<span>تعديلات غير محفوظة محلياً في ملف:</span>
|
| 1240 |
+
<span class="savebar-prov" id="save-prov-label"></span>
|
| 1241 |
+
</div>
|
| 1242 |
+
<button class="btn ac" id="save-btn" onclick="saveToHF()"><i class="ti ti-cloud-upload"></i> مزامنة وحفظ التعديلات الآن</button>
|
| 1243 |
</div>
|
| 1244 |
|
| 1245 |
<!-- Toast -->
|
|
|
|
| 1416 |
<div class="brow">
|
| 1417 |
<button class="btn rd" onclick="deleteFamily('${famNo}')"><i class="ti ti-trash"></i> حذف القيد العائلي بالكامل</button>
|
| 1418 |
</div>
|
| 1419 |
+
<p class="note"><i class="ti ti-info-circle"></i> تنبيه: هذا الإجراء يحذف جميع القيود المرتبطة بهذا السجل نهائياً.</p>`;
|
| 1420 |
}
|
| 1421 |
|
| 1422 |
async function deleteFamily(famNo){
|
|
|
|
| 1442 |
document.getElementById('savebar').classList.add('hidden');
|
| 1443 |
}else toast(d.error||'فشل مزامنة الملف على الخادم',true);
|
| 1444 |
}catch{toast('حدث خطأ غير متوقع أثناء الاتصال بالخادم',true);}
|
| 1445 |
+
finally{btn.disabled=false;btn.innerHTML='<i class="ti ti-cloud-upload"></i> مزامنة وحفظ التعديلات الآن';}
|
| 1446 |
}
|
| 1447 |
</script>
|
| 1448 |
</body></html>"""
|
| 1449 |
|
| 1450 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1451 |
@app.get("/admin", response_class=HTMLResponse)
|
| 1452 |
def admin_page():
|
| 1453 |
return HTMLResponse(ADMIN_HTML)
|