diff --git a/src/fitu.db b/src/fitu.db index 01727a29f76599e9f019e1ff0c5375b24c8ea1bd..3dad54bec647286750152a2e24eaf6939110af4f 100644 Binary files a/src/fitu.db and b/src/fitu.db differ diff --git a/src/tesBacaDB.py b/src/tesBacaDB.py index c0a3e45d5256a49e0da4350ce986f408748c689f..07463a6454f5d9fbe0a5245e8d2da1dc29d5bce6 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 0000000000000000000000000000000000000000..ee8fe52a0f133bf2ea36609bcf55e7fac40a0dc4 --- /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