| Server IP : 202.61.199.114 / Your IP : 216.73.217.139 Web Server : nginx/1.22.1 System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64 User : web20 ( 1018) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/self/root/tmp/ |
Upload File : |
import subprocess
from playwright.sync_api import sync_playwright
TOK=open('/tmp/tok.txt').read().strip(); BID="115517"
url="https://seaside.pacim.de/day-list.php?t="+TOK
def cls(pg): return pg.eval_on_selector('tr[data-id="%s"]'%BID,'e=>e.className')
def db(sql): subprocess.run(["php","-r",'require_once("/var/www/seaside.pacim.de/web/includes/config.inc.php");$db=new MysqliDb(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB);$db->rawQuery(\''+sql+'\');'],check=True)
with sync_playwright() as p:
b=p.chromium.launch(); pg=p.chromium.launch().new_page() if False else b.new_page(viewport={"width":440,"height":820})
pg.goto(url, wait_until="networkidle"); pg.wait_for_timeout(500)
print("initial:", cls(pg)) # st-paid
# external change: another staff checks this car in
db("UPDATE pacim_booking SET booking_checkin=NOW() WHERE booking_id=115517")
# trigger a poll (same as the 20s interval firing / tab refocus)
pg.evaluate("document.dispatchEvent(new Event('visibilitychange'))"); pg.wait_for_timeout(2000)
print("after external check-in + poll:", cls(pg)) # expect st-in
# external uncheck
db("UPDATE pacim_booking SET booking_checkin=NULL WHERE booking_id=115517")
pg.evaluate("document.dispatchEvent(new Event('visibilitychange'))"); pg.wait_for_timeout(2000)
print("after external uncheck + poll:", cls(pg)) # expect st-paid
b.close()