https://looka.com/s/207486057 CREATE TABLE users ( id INT AUTO_INCREMENT PRIMARY KEY, username VARCHAR(50) NOT NULL, email VARCHAR(100) NOT NULL UNIQUE, password VARCHAR(255) NOT NULL); ALTER TABLE users ADD isAdmin BOOLEAN NOT NULL DEFAULT FALSE; ps aux | grep apache2 root 1623 0.0 0.2 211628 21284 ? Ss 12:59 0:03 /usr/sbin/apache2 -k start www-data 1639 0.0 0.1 212364 10624 ? S 12:59 0:00 /usr/sbin/apache2 -k start www-data 1640 0.0 0.1 212364 10624 ? S 12:59 0:00 /usr/sbin/apache2 -k start www-data 1646 0.0 0.1 212364 10624 ? S 12:59 0:00 /usr/sbin/apache2 -k start www-data 1647 0.0 0.1 212364 10496 ? S 12:59 0:00 /usr/sbin/apache2 -k start www-data 1650 0.0 0.1 212364 10624 ? S 12:59 0:00 /usr/sbin/apache2 -k start ubuntu 28734 0.0 0.0 6628 2176 pts/2 S+ 17:16 0:00 grep --color=auto apache2 ubuntu@ubuntu2204:/opt/lampp/htdocs/php/knowgym/img$ sudo chmod -R 777 exercises-gif/ ubuntu@ubuntu2204:/opt/lampp/htdocs/php/knowgym/img$ sudo chown -R www-data:www-data exercises-gif/ http://localhost/phpmyadmin/index.php?route=/sql&pos=0&db=knowgym&table=users CREATE TABLE muscles ( id INT AUTO_INCREMENT PRIMARY KEY, muscle_name VARCHAR(50) NOT NULL UNIQUE ); CREATE TABLE exercises ( id INT AUTO_INCREMENT PRIMARY KEY, muscle_id INT NOT NULL, name VARCHAR(100) NOT NULL, gif VARCHAR(255) NOT NULL, description TEXT NOT NULL, FOREIGN KEY (muscle_id) REFERENCES muscles(id) ON DELETE CASCADE ); INSERT INTO muscles (muscle_name) VALUES ('Traps'), ('Front Shoulders'), ('Chest'), ('Biceps'), ('Forearms'), ('Obliques'), ('Abdominals'), ('Quads'), ('Rear Shoulders'), ('Lats'), ('Triceps'), ('Lower Back'), ('Glutes'), ('Hamstrings'), ('Traps Middle'), ('Calves'); INSERT INTO exercises (muscle_id, name, gif, description) VALUES -- Traps (1, 'T Bar Row Back', 'traps/t-bar-row-back.webp', 'Perform a T-bar row, pulling the elbows back to activate the traps.'), (1, 'Upright Rowing Cable', 'traps/upright-rowin-cable.webp', 'Use a cable to perform an upright row, lifting the bar towards your chest.'), (1, 'Deadlifts Multi Press', 'traps/deadlifts-multi-press.webp', 'Deadlift exercise with a barbell, focusing on the traps and lower back.'), (1, 'Upright Rowing BarraZ', 'traps/upright-rowing-barraZ.webp', 'Using a Z-bar, perform an upright row, bringing the bar to chest height.'), (1, 'Machine Shrugs', 'traps/machine-shrugs.webp', 'Use the shrug machine to activate the traps with controlled weight.'); -- Front Shoulders (2, 'Dumbbell Fly (Bench)', 'front-shoulders/dumbbell-fly-bench.webp', 'Open your arms wide with dumbbells and bring them back together.'), (2, 'Dumbbell Front Raise (One Arm)', 'front-shoulders/dumbbell-front-raise-one-arm.webp', 'Raise one dumbbell in front of you up to eye level.'), (2, 'Plate Front Raise', 'front-shoulders/plate-front-raise.webp', 'Lift a weight plate in front of you up to eye level.'), (2, 'Incline Bench Press', 'front-shoulders/incline-bench-press.webp', 'Press the barbell upwards from an inclined bench position.'), (2, 'Plate Finger Curls', 'front-shoulders/plate-finger-curls.webp', 'Hold a plate with both hands and perform wrist curls.'), (2, 'Seated Dumbbell Shoulder Press', 'front-shoulders/seated-dumbbell-shoulder-press.webp', 'Press the dumbbells upward from shoulder level while seated.'), (2, 'Push-Ups', 'front-shoulders/push-ups.webp', 'Lower your body and push back up while keeping a straight posture.'), (2, 'Shoulder Press Machine', 'front-shoulders/shoulder-press-machine.webp', 'Push the machine handles upwards to engage your shoulders.'); -- Chest (3, 'Dumbbell Flyes', 'chest/dumbbell-flyes.webp', 'Open your arms wide with dumbbells and then bring them together in the center.'), (3, 'Machine Flyes', 'chest/machine-flyes.webp', 'Perform flyes on a pec machine to target the chest muscles.'), (3, 'Push-Ups', 'chest/push-ups.webp', 'Do push-ups by lowering your body until almost touching the floor.'), (3, 'Decline Barbell Bench Press', 'chest/decline-barbell-bench-press.webp', 'Perform the bench press in a declined position to target the lower chest.'), (3, 'Barbell Bench Press', 'chest/barbell-bench-press.webp', 'Push the barbell from your chest while lying on a flat bench.') -- Biceps (4, 'Bicep Curl Barbell', 'biceps/bicep-curl-barbell.webp', 'Lift the barbell toward your chest with elbows fixed at your sides.'), (4, 'Bicep Curl Cable', 'biceps/bicep-curl-cable.webp', 'Use a cable machine to perform the bicep curl with a straight grip.'), (4, 'Bicep Curl Dumbbell', 'biceps/bicep-curl-dumbbell.webp', 'Perform the bicep curl with dumbbells, keeping elbows fixed.'), (4, 'Hammer Curl', 'biceps/hammer-curl-alternate.webp', 'Perform the hammer curl with dumbbells, alternating arms.'), (4, 'Hammer Curl Machine', 'biceps/hammer-curl-machine.webp', 'Use the machine to perform a hammer curl for biceps.') -- Forearms (5, 'Dumbbell Forearm Curls', 'forearms/dumbbell-forearm-curls.webp', 'Lift the dumbbells using only your forearms.'), (5, 'Reverse Dumbbell Forearm Curls', 'forearms/reverse-dumbbell-forearm-curls.webp', 'Lift the dumbbells with palms facing down using your forearms.'), (5, 'Seated Finger Curls', 'forearms/seated-finger-curls.webp', 'Use dumbbells or a barbell while performing wrist curls seated.'), (5, 'Wrist Roller', 'forearms/wrist-roller.webp', 'Use a roller to work on wrist strength by lifting weight with a rope.') -- Obliques (6, 'Classic Mountain Climber', 'obliques/classic-mountain-climber.webp', 'Perform jumps alternating legs towards the chest in a plank position.'), (6, 'Pike Push Ups', 'obliques/pike-push-ups.webp', 'Perform push-ups with hips elevated to target obliques and shoulders.'), (6, 'Classic Russian Twists', 'obliques/classic-russian-twists.webp', 'Sit with legs elevated and twist the torso from side to side while holding a weight.'), (6, 'Crunches', 'obliques/crunches.webp', 'Perform torso crunches focusing on your abdominal area.'), (6, 'Cross Lunges with Dumbbells', 'obliques/cross-lunges-dumbbells.webp', 'Perform lunges while crossing the dumbbells in front of your chest for added resistance.') -- Abdominals (7, 'Classic Mountain Climber', 'abdominals/classic-mountain-climber.webp', 'Perform jumps alternating legs towards the chest in a plank position.'), (7, 'Classic Russian Twists', 'abdominals/classic-russian-twists.webp', 'Sit with legs elevated and twist the torso from side to side while holding a weight.'), (7, 'Classic V-Ups', 'abdominals/classic-V-ups.webp', 'Lying down, simultaneously lift your legs and torso, touching your feet with your hands.'), (7, 'Crunches', 'abdominals/crunches.webp', 'Perform torso crunches focusing on your abdominal area.'), (7, 'Knee Raises Machine', 'abdominals/knee-raises-machine.webp', 'Hold onto a machine and raise your knees towards your chest from a suspended position.') -- Quads (8, 'Classic Deadlift', 'quads/classic-deadlift.webp', 'Classic deadlift exercise, primarily working the posterior legs and lower back.'), (8, 'Lunges', 'quads/lunges.webp', 'Perform lunges alternating legs to work the quadriceps and glutes.'), (8, 'Cross Lunges Dumbbells', 'quads/cross-lunges-dumbbells.webp', 'Cross lunges with dumbbells to activate the quadriceps and glutes.'), (8, 'Romanian Deadlift Dumbbells', 'quads/romanian-deadlift-dumbbells.webp', 'Romanian deadlift with dumbbells, focusing on hamstrings and glutes.'), (8, 'Hack Squat', 'quads/hack-squat.webp', 'Hack squat, using a machine that allows you to perform the exercise in a controlled manner.'), (8, 'Squats Dumbbells', 'quads/squats-dumbbells.webp', 'Dumbbell squats to activate the quadriceps and glutes.'), (8, 'Hip Thrust Barbell', 'quads/hip-thrust-barbell.webp', 'Barbell hip thrusts to work the glutes and quadriceps.'), (8, 'Sumo Squats', 'quads/sumo-squats.webp', 'Sumo squats with wider feet to activate the quadriceps and adductors.'), (8, 'Leg Extensions', 'quads/leg-extensions.webp', 'Leg extensions on a machine to target the quadriceps.'), (8, 'Zercher Squat', 'quads/zercher-squat.webp', 'Zercher squat, holding the barbell in your elbows to target the quadriceps in a different way.'), (8, 'Leg Press', 'quads/leg-press.webp', 'Leg press, where you push a platform with your feet to work the quadriceps and glutes.') -- Rear Shoulders (9, 'Incline Bench Flyes', 'rear-shoulders/incline-bench-flyes.webp', 'Incline bench flyes to target the rear shoulders.'), (9, 'Machine Shrugs', 'rear-shoulders/machine-shrugs.webp', 'Shoulder shrugs on a machine to target the traps and rear deltoids.'), (9, 'Bent-over Rowing with Dumbbells', 'rear-shoulders/bent-over-rowing-dumbbells.webp', 'Bent-over dumbbell rows, great for targeting the rear shoulders and back.'), (9, 'Reverse Butterfly', 'rear-shoulders/reverse-butterfly.webp', 'Machine exercise to work the rear delts and upper back.') -- Lats (10, 'T-Bar Row', 'lats/t-bar-row.webp', 'T-bar row exercise targeting the back and lats.'), (10, 'Machine Contraction with Hand', 'lats/machine-contraction-hand.webp', 'Machine exercise to activate and work the lats with a focus on contraction.'), (10, 'Pulldown', 'lats/pulldown.webp', 'Lat pulldown exercise, where you pull a bar towards your chest.'), (10, 'Bent-over Rowing with Dumbbells', 'lats/bent-over-rowing-dumbbells.webp', 'Bent-over dumbbell rows, focused on lats and mid-back.'), (10, 'Pull-ups', 'lats/pull-ups.webp', 'Grab the bar and lift your body until your chin passes above it.'), (10, 'Cable Covers', 'lats/cable-covers.webp', 'Use cables to work lats with controlled movements focusing on the upper back.'), (10, 'Low Pulley Row', 'lats/low-pulley-row.webp', 'Low pulley row exercise to target the lats and mid-back.') -- Triceps (11, 'French Press', 'triceps/french-press.webp', 'Perform a French press with a barbell or dumbbells, extending the arms overhead.'), (11, 'Pushdown with Cable', 'triceps/pushdown-with-cable.webp', 'Cable exercise to target the triceps by pushing the cable down with fixed elbows.'), (11, 'One-arm Dumbbell Tricep Press', 'triceps/one-arm-dumbbell-tricep-press.webp', 'Perform a dumbbell tricep press, using one arm at a time for better isolation.'), (11, 'Triceps Dip Bar', 'triceps/triceps-dip-bar.webp', 'Perform dips on parallel bars to intensely work the triceps.'), (11, 'Pike Push Ups', 'triceps/pike-push-ups.webp', 'Perform push-ups with elevated hips, activating the triceps and shoulders.'), (11, 'Triceps Press with Dumbbells (Both Arms)', 'triceps/triceps-press-with-dumbbells-both-arms.webp', 'Hold two dumbbells and press upwards, fully extending the arms to work the triceps.') -- Lower Back (12, 'Classic Deadlift', 'lower-back/classic-deadlift.webp', 'Classic deadlift exercise, primarily targeting the posterior legs and lower back.'), (12, 'Hyperextensions', 'lower-back/hyperextensions.webp', 'Perform extensions on a machine or bench to strengthen the lumbar region.'), (12, 'Good Mornings', 'lower-back/good-morning.webp', 'Use a barbell to perform forward flexions, targeting the lower back and hamstrings.'), (12, 'Romanian Deadlift Dumbbells', 'lower-back/romanian-deadlift-dumbbells.webp', 'Use dumbbells to perform the Romanian deadlift, working the hamstrings and lower back.'), (12, 'Hyperextensions Machine', 'lower-back/hyperextensions-machine.webp', 'Machine extensions focused on the lumbar region to strengthen the lower back.'), (12, 'Superman', 'lower-back/superman.webp', 'Perform the Superman exercise by raising arms and legs while lying face down to work the lower back.') -- Glutes (13, 'Donkey Kick Machine', 'glutes/donkey-kick-machine.webp', 'Work the glutes by lifting the legs backward on the donkey kick machine.'), (13, 'Hip Thrust Barbell', 'glutes/hip-thrust-barbell.webp', 'Hold a barbell and perform a hip thrust to activate the glutes.'), (13, 'Knee Raises Machine', 'glutes/knee-raises-machine.webp', 'Hold onto a machine and raise your knees to your chest while working the glutes.'), (13, 'Dumbbell Squats', 'glutes/squats-dumbbells.webp', 'Perform squats with dumbbells by your sides.'), (13, 'Squats', 'glutes/squats.webp', 'Perform squats with bodyweight or a barbell to work the glutes.') -- Hamstrings (14, 'Deadlifts Multi-Press', 'hamstrings/deadlifts-multi-press.webp', 'Perform deadlifts using multiple machines to activate the hamstrings.'), (14, 'Donkey Kick Machine', 'hamstrings/donkey-kick-machine.webp', 'Use the donkey kick machine, focusing on the glutes and hamstrings.'), (14, 'Good Morning', 'hamstrings/good-morning.webp', 'Perform the good morning movement with a barbell to target the posterior chain.'), (14, 'Nordic Hamstring Curls', 'hamstrings/nordic-hamstring-curls.webp', 'Perform leg curls while on your knees to target the hamstrings.'), (14, 'Romanian Deadlift Dumbbells', 'hamstrings/romanian-deadlift-dumbbells.webp', 'Use dumbbells to perform the Romanian deadlift, focusing on the hamstrings.') -- Traps Middle (15, 'T-Bar Row', 'traps-middle/t-bar-row.webp', 'T-bar row exercise, targeting the back and lats.'), (15, 'Upright Rowing Cable', 'traps-middle/upright-rowing-cable.webp', 'Vertical rowing with a cable to work the traps and upper back.'), (15, 'Deadlifts Multi-Press', 'traps-middle/deadlifts-multi-press.webp', 'Perform deadlifts using multiple machines to activate the hamstrings and traps.'), (15, 'Upright Rowing Barbell', 'traps-middle/upright-rowing-barbell.webp', 'Vertical rowing with a barbell to activate the traps and shoulders.'), (15, 'Machine Shrugs', 'traps-middle/machine-shrugs.webp', 'Shoulder shrugs on a machine to work the traps and rear delts.'); -- Calves (16, 'Calf Raise Machine', 'calves/calf-raise-machine-both-legs.webp', 'Raise your heels using the machine to work the calves.'), (16, 'Calf Raises Leg Press', 'calves/calf-raises-leg-press.webp', 'Perform calf raises on the leg press machine.'), (16, 'Standing Barbell Calf Raises', 'calves/standing-barbell-calf-raises.webp', 'Raise your heels while standing with a barbell over your shoulders.'), (16, 'Toe Raises', 'calves/toe-raises.webp', 'Raise your toes while keeping the heels on the ground.'); CREATE TABLE routines ( id INT AUTO_INCREMENT PRIMARY KEY, user_id INT NOT NULL, name VARCHAR(100) NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE ); CREATE TABLE routine_exercises ( id INT AUTO_INCREMENT PRIMARY KEY, routine_id INT NOT NULL, exercise_id INT NOT NULL, sets INT NOT NULL DEFAULT 3, -- Número de series reps INT DEFAULT 12, -- Número de repeticiones (para ejercicios de fuerza) duration INT DEFAULT 60, -- Duración en segundos (para ejercicios de resistencia o cardio) FOREIGN KEY (routine_id) REFERENCES routines(id) ON DELETE CASCADE, FOREIGN KEY (exercise_id) REFERENCES exercises(id) ON DELETE CASCADE ); CREATE TABLE routine_events ( id INT AUTO_INCREMENT PRIMARY KEY, user_id INT NOT NULL, routine_id INT NOT NULL, event_date DATE NOT NULL, start_time TIME NOT NULL, end_time TIME NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE, FOREIGN KEY (routine_id) REFERENCES routines(id) ON DELETE CASCADE ); CREATE TABLE routine_event_exercises ( id INT AUTO_INCREMENT PRIMARY KEY, event_id INT NOT NULL, exercise_id INT NOT NULL, sets INT NOT NULL DEFAULT 3, reps INT DEFAULT NULL, duration INT DEFAULT NULL, FOREIGN KEY (event_id) REFERENCES routine_events(id) ON DELETE CASCADE, FOREIGN KEY (exercise_id) REFERENCES exercises(id) ON DELETE CASCADE ); CREATE TABLE user_messages ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100) NOT NULL, email VARCHAR(100) NOT NULL, message TEXT NOT NULL, is_read BOOLEAN DEFAULT FALSE, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP );