From 69e748371ad0fa27ecba4330d20fe81220514a44 Mon Sep 17 00:00:00 2001
From: afnanramadhan <13521011@std.stei.itb.ac.id>
Date: Tue, 4 Apr 2023 01:40:45 +0700
Subject: [PATCH] add nyoba database

---
 src/fitu.db      | Bin 24576 -> 24576 bytes
 src/tesBacaDB.py |  41 ++++++++++++++++++++++++++---------------
 src/tesQuery.py  |  10 ++++++++++
 3 files changed, 36 insertions(+), 15 deletions(-)
 create mode 100644 src/tesQuery.py

diff --git a/src/fitu.db b/src/fitu.db
index 01727a29f76599e9f019e1ff0c5375b24c8ea1bd..3dad54bec647286750152a2e24eaf6939110af4f 100644
GIT binary patch
literal 24576
zcmeI2&u`l{6vye>vEwvpvH^in1jD$)(7FxWZ8;7o<`mxMA8{SW-4LLF!OG7v7g<tB
zs)>(E3+%ev{)PPk`x|y0cHepbz%JWuq*NJ}<Ml4%5s)H@e&qXp9!ZJFJ3H-g1$69*
zDO2=_?2%lKd_^fCq@a(YK9Z8x7v@<~a>>Pe{uW5>`_|6xKV)P3DY^Ie?(aK)Z2zP$
zu^<5?fCP{L5<mh-00|%gB#=1*y^Uh!@#EaNVy_&KmyX^_3?*C!;9ASK#b^CSebAtT
z`f;a0mwx-uWm7oRmerf5g_3FV?NQXG;8$$M)X-syPnf%OyOC;hsgge2q6=lhrSimV
z$VZgB3TzOx*KeNG`{%UXIH&a&gXhhzZttYg9UP`Cec{=HO&2WF^~QIq;98|0E3O<E
zzB67?Z!yOc9Ax57+IqzFu53l4o*Iq<p=o$-VwiHadh>C<RH;^TZ)Op|5gRKe5`O8s
zLJD8HZiyaTgRr=S1qh4y(!NK^S2#ZcX$kH}zTcK+d(4rmtP;7mO$7L$J6m9pcEsl6
zsKGR$@H|(l?C<B^>_>zG3BnwAQZ&qyB?j|2|G)AHaC@SXz@(kIdQY9vzCyYU?nt|F
zTR5{J=_IY~!JT5|%l#bT+VJ|_Bx8Z{qWhr{HT>M1&0c=fEH^vmv}aCOkN^@u0!RP}
zAOR$R1dsp{Kmter2_S)WC9q|L;r@SJ!;89*01`j~NB{{S0VIF~kN^@u0!RP}L<G$L
z|M&8nWb@b3U!@O=UvJC`zvTbSZ|;6^4|aau{_XC+cOPxNEdPkOkia?<2v40dd2nM_
zJ|GAEKuXSBI=Ip~V;xVxlyYANQ#$f=$`+MeQJwOo4yon25-bHO5R{F$&!xp(n}W`R
ztI_X3D*h^Pv>mhPYjDBUX<L%|flfE7(Qe>4j50bF+Jr~fIxVe6>-vYfZ<D4L_34A-
zfUc1`t1jyCHFF%@3|v#4#AcibgbZZt+czeM>gcmt?FpaSPr~L!nN(s;XO{uXw3hA<
zW%5a^<y)O(McXcb%yMvAyiD%Lf{q0r*^p&1&B=VE^&IA2WLe9pJzoi0!PGZ1y2Y%E
zOb@p9xJ(X`)y;LarYuLO2W9eUtR{(2-}5s)flk9-nN+nVk~=u&*35E%J`;g!O|loL
zt>pdF3ZKWr&WH+xpUD+_uBIJ!%jBatL~&@c_yU^CX@)293rGj26S#J!#hiql`13%E
zi9U6xSr{@sb=vc()6<`d^hK7{G{e?>texr4=S+)fh0TS~$VsNvVE+F)?`lyS5<mh-
z00|%gB!C2v01`j~NB{{SftUd9|8XQB0VIF~kN^@u0!RP}AOR$R1dsp{SbqZl0g7zE
A^#A|>

delta 92
zcmV-i0HgnazyW~30gxL31Cbm<7Xtt;S4s^J_y7eASO5<556=zi45|!Rvk?&D3zI$!
yQwco;2Nx?V0faHLnhXa4lcEhU2?hfP7bz(LgGZCw4ehhx4kID61VH>BqEHZ+uNq$f

diff --git a/src/tesBacaDB.py b/src/tesBacaDB.py
index c0a3e45..07463a6 100644
--- a/src/tesBacaDB.py
+++ b/src/tesBacaDB.py
@@ -20,7 +20,8 @@ cur.execute("""
             description text,
             goals text,
             duration text,
-            repetition text
+            repetition integer,
+            gif text
             )
             """)
 
@@ -31,23 +32,34 @@ cur.execute("""
             name text,
             title_program text,
             calories integer,
-            date text
+            date text,
             tot_duration integer
             )
             """)
 
 cur.execute("""
             INSERT INTO daftar_latihan 
-                (exercise_id, title, description, goals, duration, repetition)
+                (exercise_id, title, description, goals, duration, repetition, gif)
             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)
+                (201, 'Push Up', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor','Goals', NULL, 10, '../img/push-up.gif'),
+                (202, "Sit Up", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor", 'Goals', NULL, 10, "../img/"),
+                (203, "Pull Up", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor", 'Goals', NULL, 10, "../img/"),
+                (204, "Squat Jump", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor", 'Goals', NULL, 10, "../img/"),
+                (205, "Lunges", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor", 'Goals', NULL, 10, "../img/"),
+                (206, "Crunches", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor", 'Goals', NULL, 10, "../img/"),
+                (207, "Burpees", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor", 'Goals', NULL, 10, "../img/"),
+                (208, "Bicycle Crunch", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor", 'Goals', NULL, 10, "../img/"),
+                (101, "Jumping Rope", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor", 'Goals', 30, NULL, "../img/"),
+                (102, "Running", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor", 'Goals', 30, NULL, "../img/"),
+                (103, "Jumping Jacks", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor", 'Goals', 30, NULL, "../img/"),
+                (104, "Plank", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor", 'Goals', 30, NULL, "../img/"),
+                (105, "Bridge", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor", 'Goals', 30, NULL, "../img/"),
+                (106, "High Knees", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor", 'Goals', 30, NULL, "../img/"),
+                (107, "Squat", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor", 'Goals', 30, NULL, "../img/"),
+                (108, "Russian Twist", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ac venenatis purus. Nulla a fringilla ante. Aenean id ipsum pellentesque, convallis ex eget, cursus dolor", 'Goals', 30, NULL,"../img/")
             """)
+
+con.commit()
 # cur.execute("""
 #             INSERT INTO daftar_request
 #                 (user_id, trainer_id, umur, jenis_kelamin, berat_badan, tinggi_badan, tujuan, status, title, description)
@@ -66,10 +78,9 @@ cur.execute("""
 #                 (2, 7, False)
 #             """)
 
-# a = cur.execute("Select * from list_olahraga")
-
-# a = cur.fetchall()
 
-# for i in a:
-#     print(i)
+# daftarLatihan = cur.execute("SELECT * FROM daftar_latihan")
+# daftarLatihan = daftarLatihan.fetchall()
 
+# for i in daftarLatihan:
+#     print(i)
\ No newline at end of file
diff --git a/src/tesQuery.py b/src/tesQuery.py
new file mode 100644
index 0000000..ee8fe52
--- /dev/null
+++ b/src/tesQuery.py
@@ -0,0 +1,10 @@
+import sqlite3
+
+con = sqlite3.connect("fitu.db")
+cur = con.cursor()
+daftarLatihan = cur.execute("SELECT * FROM daftar_latihan")
+
+count = 1
+for i in daftarLatihan.fetchall():
+    print(f"{count}. {i[0]}")
+    count+=1
\ No newline at end of file
-- 
GitLab