From 3b38f06a70d10156b16ce8b242c53d5be280ea5a Mon Sep 17 00:00:00 2001
From: afnanramadhan <13521011@std.stei.itb.ac.id>
Date: Mon, 3 Apr 2023 18:48:18 +0700
Subject: [PATCH] add db

---
 src/fitu.db      | Bin 0 -> 24576 bytes
 src/tesBacaDB.py |  75 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+)
 create mode 100644 src/fitu.db
 create mode 100644 src/tesBacaDB.py

diff --git a/src/fitu.db b/src/fitu.db
new file mode 100644
index 0000000000000000000000000000000000000000..01727a29f76599e9f019e1ff0c5375b24c8ea1bd
GIT binary patch
literal 24576
zcmeI%&u-H&90%}ZZBsO@Y?rE6-&nK>Y2t{GC@4Z>e;B0*dWuZ*TWTpyI>*(zBio*a
zm*G9Qa^Z*_EhtVq9w7Q!N@~aXIsSc|R<io(<Ec=@E;BjjioJ059M^STGv+u>OCO#-
z%3|8>vY|iSO8v2F%X$9geQ)=V)7kmzJpH}<v-fM~hpwVP00Izz00bZa0SG_<0u2(l
z=y-#J19zhMw}kSmL~k;}oUWFXPU}tY?I;+I12!JMISp9t-u;x%=}<@dx3Ah=GvxhI
zF{TvP{D!MA;Y!SST5EQ!F>9S{f16dxOynw)H=&4_NEO8-*~RGiY&e>*lVHMzpT{4L
z&-Hj`!TI>mid@JnmV91`wENB6nWB}lFDs!E3Lk<u^iO$`NkMrz9XmSWdcS4{wWgvn
z6-G;`F|xFbvu^Njy;gVN`|jPl!Y|^Nip!GEZnZ5vyRU{vE0R-@Q^laFXHUIId_%$!
z<x?pZ#oX7q;*2Nxrl>OA^$<x5(hoBhYf}FAiQ66Y`|e%8fLP`v&9P-AZLZW({kNKr
zCpaS!&s6DeCx88)K9k~x3}Z?oJ&pDJcueI(>_vXI<qcl;T}SA^)x%ebFI85wLz7f^
zWX@(U|HS;<^vr3`oKPSD0SG_<0uX=z1Rwwb2tWV=5NN8vwn+^8|E4Z4@`3;aAOHaf
zKmY;|fB*y_009UT0{H(QF9HN0009U<00Izz00bZa0SG{#`2yJgH-C+hAp{@*0SG_<
o0uX=z1Rwwb2tWY)f4l<_fB*y_009U<00Izz00bZaf#wVR1wg(LivR!s

literal 0
HcmV?d00001

diff --git a/src/tesBacaDB.py b/src/tesBacaDB.py
new file mode 100644
index 0000000..c0a3e45
--- /dev/null
+++ b/src/tesBacaDB.py
@@ -0,0 +1,75 @@
+import sqlite3
+
+con = sqlite3.connect("fitu.db")
+cur = con.cursor()
+
+cur.execute("""
+            CREATE TABLE IF NOT EXISTS user (
+            name text PRIMARY KEY,
+            height integer,
+            weight integer,
+            goal text,
+            gender text,
+            age integer
+            )
+            """)
+cur.execute("""
+            CREATE TABLE IF NOT EXISTS daftar_latihan (
+            exercise_id integer PRIMARY KEY,
+            title text,
+            description text,
+            goals text,
+            duration text,
+            repetition text
+            )
+            """)
+
+cur.execute("""
+            CREATE TABLE IF NOT EXISTS riwayat_latihan (
+            history_id integer PRIMARY KEY AUTOINCREMENT,
+            program_id integer,
+            name text,
+            title_program text,
+            calories integer,
+            date text
+            tot_duration integer
+            )
+            """)
+
+cur.execute("""
+            INSERT INTO daftar_latihan 
+                (exercise_id, title, description, goals, duration, repetition)
+            VALUES 
+                (001, 'Push Up', 'Push-ups are exercises to strengthen your arms and \nchest muscles. They are done by lying with your face \ntowards the floor and pushing with your hands to \nraise your body until your arms are straight.', '10 Repetition', '../img/push-up.png', 'https://www.youtube.com/watch?v=bTJIkQRsmaE', NULL),
+                ("Sit Up", "Sit-ups are exercises that you do to strengthen your \nstomach muscles. They involve sitting up from a lying \nposition while keeping your legs straight on the floor.", "10 Repetition", "../img/sit-up.png", "https://www.youtube.com/watch?v=6eJVLbgxbBE", NULL),
+                ("Pull Up", "A pull-up is an upper-body strength exercise. The \npull-up is a closed-chain movement where the body \nis suspended by the hands and pulls up.", "10 Repetition", "../img/pull-up.png", "https://www.youtube.com/watch?v=eGo4IYlbE5g", NULL),
+                ("Jumping Rope", "Jumping rope is jumping over a rope held with \none end in each hand as the rope is repeatedly \nspun over the head and under the feet.", "20 Repetition", "../img/jumping-rope.png", "https://www.youtube.com/watch?v=FJmRQ5iTXKE", NULL),
+                ("Weightlifting", "Weight training is a common type of strength training \nfor developing the strength and size of skeletal \nmuscles.", "70Kg", "../img/weightlifting.png", "https://www.youtube.com/watch?v=RP85w6g7jPU", NULL),
+                ("Swimming", "The propulsion of the body through water by \ncombined arm and leg motions and the natural \nflotation of the body.", "300 meters", "../img/swimming.png", "https://www.youtube.com/watch?v=gh5mAtmeR3Y", NULL),
+                ("Running", "Running is a form of exercise that is usually \ndone to develop the speed and endurance of the body.", "5Km", "../img/running.png", "https://www.youtube.com/watch?v=ZQQ6_XQQxQ4", NULL)
+            """)
+# cur.execute("""
+#             INSERT INTO daftar_request
+#                 (user_id, trainer_id, umur, jenis_kelamin, berat_badan, tinggi_badan, tujuan, status, title, description)
+#             VALUES
+#                 (1, 2, 20, 'Laki-laki', 65, 170, 'I want to have a sixpack stomach', True, 'Chest Day', 'This workout plan is made to strengthen your \nabdominal muscles.'),
+#                 (1,2,20, 'Laki-laki', 65, 170, 'I want to have a strong leg muscles', True, 'Leg Day', 'This workout plan is made to strengthen your \nleg muscles.')
+#             """)
+# cur.execute("""
+#             INSERT INTO workout
+#                 (request_id, olahraga_id, status)
+#             VALUES
+#                 (1, 2, False),
+#                 (1, 3, False),
+#                 (1, 6, False),
+#                 (2, 4, False),
+#                 (2, 7, False)
+#             """)
+
+# a = cur.execute("Select * from list_olahraga")
+
+# a = cur.fetchall()
+
+# for i in a:
+#     print(i)
+
-- 
GitLab