From c8be8f40f44803ba889605b59ac7c5babb34e942 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 29 Jul 2024 15:37:33 +0200 Subject: [PATCH] ADD /report --- main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.py b/main.py index 9a1f8d2..34b4795 100644 --- a/main.py +++ b/main.py @@ -343,6 +343,10 @@ async def reporting(get: CL.CL_REPORTING,api_key: APIKey = Depends(auth.get_api_ entry = database(f"SELECT s.customer_ID,s.service_ID from `server` s where s.privat_ipaddress LIKE '%{get.ipaddress}%'","Kunden","") customer_ID = entry[0][0] service_ID = entry[0][1] + reportingdate = datetime.now() + reportingdate = reportingdate.strftime("yyyy-MM-dd HH:mm:ss") + print(reportingdate) + database(f"INSERT INTO `Kunden.services.reporting` (username,service_ID,customer_ID,reportingdate,lastaccess) VALUES ('{get.username}','{service_ID}','{customer_ID}',{reportingdate}',{get.lastaccess}'","","") print(f"{service_ID} - {customer_ID}")