From 037d95d2f665cd52a43030b3aac750ee66ca1957 Mon Sep 17 00:00:00 2001 From: Agnibho Mondal Date: Fri, 12 Jan 2024 00:29:24 +0530 Subject: [PATCH] Generic name --- inventory.py | 4 ++-- templates/inventory-edit.html | 6 ++++++ templates/inventory-view.html | 13 +++++++------ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/inventory.py b/inventory.py index 1476d5e..efa7363 100644 --- a/inventory.py +++ b/inventory.py @@ -7,7 +7,7 @@ def create(cursor, data): try: - cursor.execute("INSERT INTO inventory (mid, vaccine, dose, dpv, route, batch, doe, available, data) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", (data["mid"], data["vaccine"], data["dose"], data["dpv"], data["route"], data["batch"], data["doe"], "", "")) + cursor.execute("INSERT INTO inventory (mid, vaccine, altname, dose, dpv, route, batch, doe, available, data) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", (data["mid"], data["vaccine"], data["altname"], data["dose"], data["dpv"], data["route"], data["batch"], data["doe"], "", "")) if(cursor.rowcount==0): return (False, "Failed to create record.") else: @@ -28,7 +28,7 @@ def read(cursor, iid): def update(cursor, iid, data): try: - cursor.execute("UPDATE inventory SET vaccine=?, dose=?, dpv=?, route=?, batch=?, doe=?, available=? WHERE iid=?", (data["vaccine"], data["dose"], data["dpv"], data["route"], data["batch"], data["doe"], "", iid)) + cursor.execute("UPDATE inventory SET vaccine=?, altname=?, dose=?, dpv=?, route=?, batch=?, doe=?, available=? WHERE iid=?", (data["vaccine"], data["altname"], data["dose"], data["dpv"], data["route"], data["batch"], data["doe"], "", iid)) if(cursor.rowcount==0): return (False, "Failed to update record.") else: diff --git a/templates/inventory-edit.html b/templates/inventory-edit.html index d61aae5..06c5ab2 100644 --- a/templates/inventory-edit.html +++ b/templates/inventory-edit.html @@ -21,6 +21,12 @@ You should have received a copy of the GNU General Public License along with Lib +
+ +
+ +
+
diff --git a/templates/inventory-view.html b/templates/inventory-view.html index 78c8eca..4e72d80 100644 --- a/templates/inventory-view.html +++ b/templates/inventory-view.html @@ -31,12 +31,13 @@ You should have received a copy of the GNU General Public License along with Lib - - - - - - + + + + + + +
Vaccine{{data["vaccine"]}}
Dose{{data["dose"]}}
Dose per Vial{{data["dpv"]}}
Route of Administration{{data["route"]}}
Batch Number{{data["batch"]}}
Date of Expiry{{data["doe"]}}
Vaccine{{data["vaccine"]}}
Generic{{data["altname"]}}
Dose{{data["dose"]}}
Dose per Vial{{data["dpv"]}}
Route of Administration{{data["route"]}}
Batch Number{{data["batch"]}}
Date of Expiry{{data["doe"]}}
Edit Delete -- 2.39.5