diff --git a/src/controller.py b/src/controller.py index 14ccca99fe4a74cde7ebe729e65cd9d078cfcd6f..d90966b06c911accc18feabd154a0fdbcb00bd2a 100644 --- a/src/controller.py +++ b/src/controller.py @@ -5,6 +5,8 @@ from register import register from dashboard import dashboard from listlatihan2 import listLatihan2 from tesBacaDB import tesBaca +from customize import customizeWorkout +from plan import plan class controller: def __init__(self): self.conn = sqlite3.connect('fitu.db') @@ -12,9 +14,11 @@ class controller: self.registerWin = register() self.registerWin.switch.connect(self.fromRegister) self.dashboard = dashboard() - # self.dashboard.switch.connect(self.fromDashboard) - # self.listLatihan = listLatihan2() - # self.listLatihan.switch.connect(self.fromListLatihan) + self.dashboard.switch.connect(self.fromDashboard) + self.listLatihan = listLatihan2() + self.listLatihan.switch.connect(self.fromListLatihan) + self.customize = customizeWorkout() + self.plan = plan() pass @@ -32,15 +36,23 @@ class controller: self.registerWin.close() self.dashboard.show() - # def fromDashboard(self, page): - # self.registerWin.close() - # if (page == "listLatihan"): - # self.listLatihan.show() + def fromDashboard(self, page): + self.registerWin.close() + self.dashboard.close() + if (page == "listLatihan"): + self.listLatihan.show() + elif (page == "customize"): + self.customize.show() + elif (page == "plan"): + self.plan.show() + - # def fromListLatihan(self, page): - # self.listLatihan.close() - # if (page == "dashboard"): - # self.dashboard.show() + def fromListLatihan(self, page): + self.listLatihan.close() + if (page == "dashboard"): + self.dashboard.show() + elif (page == "customize"): + self.customize.show() if __name__ == "__main__": app = QApplication(sys.argv) diff --git a/src/customize.py b/src/customize.py index b8fa2d73c60060cc64f4dea6cd8ac5b5eff76806..5fce0a1d4efe51b488d4c562ea95511eaaab3883 100644 --- a/src/customize.py +++ b/src/customize.py @@ -1,7 +1,7 @@ import sqlite3 import sys -from PyQt6.QtCore import Qt, QSize, QPropertyAnimation, QAbstractAnimation, QEasingCurve, QAnimationGroup +from PyQt6.QtCore import Qt, QSize, QPropertyAnimation, QAbstractAnimation, QEasingCurve, QAnimationGroup, pyqtSignal from PyQt6.QtGui import QIcon, QPixmap, QCursor, QFont, QMovie from PyQt6.QtWidgets import (QApplication, QMainWindow, QWidget, QGridLayout, QGroupBox, QRadioButton, QCheckBox, QMessageBox, @@ -13,8 +13,8 @@ text_color = '#EEEEE2' cardColor = '#D2DCC4' class customizeWorkout(QWidget): - - + switch = pyqtSignal(str, dict) + def __init__(self): super().__init__() @@ -239,11 +239,21 @@ class customizeWorkout(QWidget): exLabel1.setFixedSize(79, 79) exLabel1.setStyleSheet(styleSheet5) #add gif - gif = QMovie('img/exercise-unscreen.gif') + + # pic = QLabel(exLabel) + # # pixmap = QPixmap() + # # pixmap.loadFromData(image) + # pic.setPixmap(QPixmap('img/exe-pushup.gif').scaled(79, 79)) + # pic.move(10, 10) + # pic.setFixedSize(79, 79) + # pic.setStyleSheet(styleSheet5) + + # pic.setScaledContents(True) + gif = QMovie('img/exe-pushup.gif') exLabel1.setMovie(gif) gif.start() gif.setScaledSize(QSize(79, 79)) - gif.setSpeed(100) + gif.setSpeed(200) addButton = QPushButton(exLabel) addButton.setIcon(QIcon('img/add button.png')) @@ -291,7 +301,10 @@ class customizeWorkout(QWidget): scroll2.verticalScrollBar().setStyleSheet(scroll_bar_style) scroll2.setWidget(scrollWidget2) + area2 = [] + def handleButtonClicked(i, buttonList): + area2.append(i) button = buttonList[i] button.setEnabled(False) button.setIcon(QIcon('img/check button.png')) @@ -303,15 +316,23 @@ class customizeWorkout(QWidget): exLabel1.move(10, 10) exLabel1.setFixedSize(79, 79) exLabel1.setStyleSheet(styleSheet5) + #add gif - gif = QMovie('img/exercise-unscreen.gif') + gif = QMovie('img/exe-pushup.gif') exLabel1.setMovie(gif) gif.start() gif.setScaledSize(QSize(79, 79)) gif.setSpeed(100) title = QLabel(exLabel) - title.setText(f'<b><p><font style="font-size:24px;" color="#D2DCC4">{self.listEx[i][1]}</font><tab></p></b> <b><p><font color="#D2DCC4" style="font-size:14px;">{self.listEx[i][4]} Repetisi</font></p><b>') + title.setText(f'<font style="font-size:24px;" color="#D2DCC4"; font-family="Sogoe UI";><b>{self.listEx[i][1]}<b>') title.move(100, 15) + repDur = QLabel(exLabel) + if(i<8): + repDur.setText(f'<font style="font-size:14px;" color="#D2DCC4"; font-family="Sogoe UI";><b>{self.listEx[i][4]} Detik<b>') + repDur.move(100, 60) + else: + repDur.setText(f'<font style="font-size:14px;" color="#D2DCC4"; font-family="Sogoe UI";><b>{self.listEx[i][5]} Repetisi<b>') + repDur.move(100,60) deleteButton = QPushButton(exLabel) deleteButton.setIcon(QIcon('img/delete button.png')) deleteButton.setIconSize(QPixmap('img/delete button.png').size()) @@ -321,20 +342,8 @@ class customizeWorkout(QWidget): QCursor(Qt.CursorShape.PointingHandCursor)) deleteButton.clicked.connect(lambda checked, index=i: handleDeleteButtonClicked(index, exLabel, scrollLayout2)) scrollLayout2.addWidget(exLabel) - - def handleDeleteButtonClicked(index, exLabel, layout): - # item = scrollLayout2.itemAt(index) - # if item is not None: - # widget = item.widget() - # if widget is not None: - # widget.deleteLater() - # # setelah exLabel dihapus, kita perlu mengupdate addButtonList - # for i, button in enumerate(addButtonList): - # if i == index: - # button.setEnabled(True) - # button.setIcon(QIcon('img/add button.png')) - # button.setIconSize(QPixmap('img/add button.png').size()) + def handleDeleteButtonClicked(index, exLabel, layout): exLabel.setParent(None) layout.removeWidget(exLabel) exLabel.deleteLater() @@ -343,6 +352,30 @@ class customizeWorkout(QWidget): button.setEnabled(True) button.setIcon(QIcon('img/add button.png')) button.setIconSize(QPixmap('img/add button.png').size()) + def saveButtonClicked(): + if(progNameInput.text() == '' or scrollLayout2 == []): + QMessageBox.about(self, "Error", "Please input program name") + else: + # QMessageBox.about(self, "Success", "Program saved") + # self.close() + cur = self.con.cursor() + data = cur.execute("SELECT program_id FROM program") + lenProg = len(data.fetchall()) + cur.execute( + f"INSERT INTO program (program_id, title_program) VALUES ({lenProg+1} ,'{progNameInput.text()}')" + ) + for i in area2: + cur.execute( + f"INSERT INTO latihan_program (program_id, exercise_id) VALUES ({lenProg+1} ,{self.listEx[i][0]})" + ) + print(lenProg) + self.con.commit() + self.close() + + + + # self.parent().show() + # print(area2) font = QFont() font.setFamily("Segoe UI") font.setPointSize(28) @@ -401,15 +434,8 @@ class customizeWorkout(QWidget): saveButton.move(1065, 635) saveButton.setCursor( QCursor(Qt.CursorShape.PointingHandCursor)) - # saveButton.clicked.connect(self.customize) - # def customize(self): - # c = self.conn.cursor() - # if (progNameInput == "" or scrollLayout2 == ""): - # QMessageBox.about(self, "Error", "Please fill all the fields") - # else: - # c.execute( - # f"INSERT INTO program (program_id, title_program) VALUES ('{progNameInput.text()}')" - # ) + saveButton.clicked.connect(saveButtonClicked) + if __name__ == '__main__': app = QApplication(sys.argv) diff --git a/src/dashboard.py b/src/dashboard.py index 00bf39e700211b7d0692ea0e023d6fb26f5c2907..bf038ff8ca5d870b36a43be798f49ca077f0d7c2 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -1,15 +1,57 @@ import sys -from PyQt6.QtCore import Qt, pyqtSignal -from PyQt6.QtGui import QCursor, QFont, QPixmap -from PyQt6.QtWidgets import QApplication, QLabel, QPushButton, QWidget +from PyQt6.QtCore import Qt, pyqtSignal, QSize, pyqtSignal +from PyQt6.QtGui import QCursor, QFont, QPixmap, QMovie +from PyQt6.QtWidgets import QApplication, QLabel, QPushButton, QWidget, QScrollArea, QVBoxLayout, QHBoxLayout +import sqlite3 +con = sqlite3.connect("fitu.db") +cur = con.cursor() background = '#5A8D6C' button_color = '#174728' text_color = '#EEEEE2' card_color = '#D2DCC4' + +# kumpulan font +helloFont = QFont() +helloFont.setFamily('Segoe UI') +helloFont.setPointSize(47) +# helloFont.setBold(True) + +quoteFont = QFont() +quoteFont.setFamily('Segoe UI') +quoteFont.setPointSize(25) + +buttonFont = QFont() +buttonFont.setFamily('Segoe UI') +buttonFont.setPointSize(18) +buttonFont.setBold(True) + +dateFont = QFont() +dateFont.setFamily('Segoe UI') +dateFont.setPointSize(23) +dateFont.setBold(True) + +historyFont = QFont() +historyFont.setFamily('Segoe UI') +historyFont.setPointSize(16) + +rincianFont = QFont() +rincianFont.setFamily('Segoe UI') +rincianFont.setPointSize(13) + +repetisiFont = QFont() +repetisiFont.setFamily('Segoe UI') +repetisiFont.setPointSize(10) + +styleSheetCard = ( + "background-color: #5A8D6C;" + "border-radius: 20px;" + ) + + class dashboard(QWidget): switch = pyqtSignal(str, dict) def __init__(self, user=None): @@ -25,36 +67,170 @@ class dashboard(QWidget): } else: self.user = user + self.index_history = int(-1) + self.banyaknyaKartu = int(-1) self.dashboardWindow() def dashboardWindow(self): self.setWindowTitle('Dashboard - FitU') self.setFixedSize(1280, 720) self.setStyleSheet(f'background-color: {background};') + self.label = QLabel("") + self.label.setParent(self) self.element() - def element(self): - # kumpulan font - helloFont = QFont() - helloFont.setFamily('Segoe UI') - helloFont.setPointSize(47) + def historyElement(self, historyDate, idx): + self.index_history = idx + print(self.index_history) + print("panjang historyDate: ", len(historyDate)) + tanggal = historyDate[self.index_history][0] + print(tanggal) + # menyiapkan history card + self.card = QLabel(self) + self.card.setPixmap(QPixmap('img/card-dashboard.png')) + self.card.move(633, 172) + + daftar_latihan = cur.execute(f""" + SELECT name FROM riwayat_latihan WHERE date = '{tanggal}' + """).fetchall() + + jumlahCard = len(daftar_latihan) + + self.banyaknyaKartu = jumlahCard - quoteFont = QFont() - quoteFont.setFamily('Segoe UI') - quoteFont.setPointSize(25) + self.date = QLabel(self) + self.date.setText(f"{tanggal}") + self.date.setStyleSheet(f'color: {button_color}; background-color: {card_color};') + self.date.move(820, 195) + self.date.setFont(dateFont) + self.date.setAlignment(Qt.AlignmentFlag.AlignLeft) - buttonFont = QFont() - buttonFont.setFamily('Segoe UI') - buttonFont.setPointSize(18) + keterangan = cur.execute(f""" + SELECT tot_duration, title_program FROM riwayat_latihan WHERE date = '{tanggal}' + """).fetchone() + print(keterangan) + self.duration = QLabel(self) + self.duration.setText("Duration : " + str(keterangan[0]) + " minutes") + self.duration.setStyleSheet(f'color: {button_color}; background-color: {card_color};') + self.duration.move(667,282) + self.duration.setFixedWidth(300) + self.duration.setFont(historyFont) + self.duration.setAlignment(Qt.AlignmentFlag.AlignLeft) - dateFont = QFont() - dateFont.setFamily('Segoe UI') - dateFont.setPointSize(23) + self.prog = QLabel(self) + self.prog.setText("Program Name: " + keterangan[1]) + self.prog.setStyleSheet(f'color: {button_color}; background-color: {card_color};') + self.prog.move(667, 317) + self.prog.setFixedWidth(300) + self.prog.setFont(historyFont) + self.prog.setAlignment(Qt.AlignmentFlag.AlignLeft) + + + self.scroll = QScrollArea(self) + self.scroll.setGeometry(654, 369, 486, 204) # mengatur posisi dan ukuran QScrollArea + self.scroll.setStyleSheet(f"background-color: {card_color}; border-radius: 0px;") + self.scrollWidget = QWidget(self.scroll) + self.scrollLayout = QHBoxLayout(self.scrollWidget) + self.scrollWidget.setStyleSheet(f"background-color: {card_color}; border-radius: 0px;") + self.scrollWidget.setLayout(self.scrollLayout) + horizontal_scrollbar = self.scroll.horizontalScrollBar() + # Mengatur bentuk scroll bar + scroll_bar_style = """ + QScrollBar:horizontal { + border : 0px; + background-color: #5A8D6C; + height: 10px; + margin: 0px 0px 0px 0px; + } + QScrollBar::handle:horizontal { + background-color: #174728; + border-radius: 50px; + border: 0px; + } + """ + self.scroll.horizontalScrollBar().setStyleSheet(scroll_bar_style) + self.hbox = QHBoxLayout() + print(jumlahCard) + for j in range(self.banyaknyaKartu): + self.label = QLabel() + self.label.setFixedSize(150, 175) + self.label.setStyleSheet(styleSheetCard) + self.hbox.addWidget(self.label) + nama_latihan = daftar_latihan[j][0] + repetisi_latihan = cur.execute(f""" + SELECT repetition FROM daftar_latihan WHERE title = '{nama_latihan}' + """).fetchone() + durasi_latihan = cur.execute(f""" + SELECT duration FROM daftar_latihan WHERE title = '{nama_latihan}' + """).fetchone() + gambar_latihan = cur.execute(f""" + SELECT gif FROM daftar_latihan WHERE title = '{nama_latihan}' + """).fetchone() + con.commit() + self.show_nama_latihan = QLabel(self.label) + self.show_nama_latihan.setText(nama_latihan) + self.show_nama_latihan.setStyleSheet(f'color: {card_color};') + self.show_nama_latihan.move(10, 120) + self.show_nama_latihan.setFont(rincianFont) + self.show_nama_latihan.setAlignment(Qt.AlignmentFlag.AlignLeft) + + self.show_repetisi_latihan = QLabel(self.label) + if (repetisi_latihan[0] == None): + self.show_repetisi_latihan.setText("Duration: " + str(durasi_latihan[0]) + " seconds") + else: + self.show_repetisi_latihan.setText("Repetition: " + str(repetisi_latihan[0])) + self.show_repetisi_latihan.setStyleSheet(f'color: {card_color};') + self.show_repetisi_latihan.move(10, 145) + self.show_repetisi_latihan.setFont(repetisiFont) + self.show_repetisi_latihan.setAlignment(Qt.AlignmentFlag.AlignLeft) + + self.gif = "img/exercise-unscreen.gif" + self.gif2 = QMovie(self.gif) + self.gif2.setScaledSize(QSize(90, 90)) + self.gif2.start() + self.show_gambar_latihan = QLabel(self.label) + self.show_gambar_latihan.setMovie(self.gif2) + self.show_gambar_latihan.move(25, 20) + self.scrollLayout.addLayout(self.hbox) + self.scroll.setWidget(self.scrollWidget) + + self.kiri = QPushButton(self) + self.kiri.setText('<') + self.kiri.setStyleSheet(f''' + QPushButton {{ + color: {button_color}; + background-color: {card_color}; + border: none; + border-radius: 20px; + }} + ''') + self.kiri.setFont(dateFont) + self.kiri.move(727, 195) + self.kiri.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) + self.kiri.clicked.connect(lambda:self.prev(historyDate)) + + + self.kanan = QPushButton(self) + self.kanan.setText('>') + self.kanan.setStyleSheet(f''' + QPushButton {{ + color: {button_color}; + background-color: {card_color}; + border: none; + border-radius: 20px; + }} + ''') + self.kanan.setFont(dateFont) + self.kanan.move(1047, 195) + self.kanan.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) + self.kanan.clicked.connect(lambda:self.next(historyDate)) - historyFont = QFont() - historyFont.setFamily('Segoe UI') - historyFont.setPointSize(16) + if(idx == len(historyDate)-1): + self.kanan.hide() + elif (idx == 0): + self.kiri.hide() + def element(self): # masukkan logo logo = QLabel(self) logo.setPixmap(QPixmap('img/logo-dashboard.png')) @@ -92,6 +268,7 @@ class dashboard(QWidget): customizeButton.move(649, 58) customizeButton.setCursor( QCursor(Qt.CursorShape.PointingHandCursor)) + customizeButton.clicked.connect(self.customWindow) # tombol plan planButton = QPushButton(self) @@ -108,6 +285,7 @@ class dashboard(QWidget): planButton.move(807, 58) planButton.setCursor( QCursor(Qt.CursorShape.PointingHandCursor)) + planButton.clicked.connect(self.planWindow) # tombol list listButton = QPushButton(self) @@ -124,6 +302,8 @@ class dashboard(QWidget): listButton.move(898, 58) listButton.setCursor( QCursor(Qt.CursorShape.PointingHandCursor)) + listButton.clicked.connect(self.listWindow) + # tombol history historyButton = QPushButton(self) @@ -177,66 +357,161 @@ class dashboard(QWidget): start.setFixedSize(233, 47) #pake ini buat kalau dia buletan start.move(101, 511) start.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) + start.clicked.connect(self.planWindow) # membuat history card - card = QLabel(self) - card.setPixmap(QPixmap('img/card-dashboard.png')) - card.move(633, 172) + historyDate = cur.execute(""" + SELECT DISTINCT strftime(date) FROM riwayat_latihan + """).fetchall() + + # menyiapkan history card + + print(len(historyDate)) + tanggal = historyDate[0][0] + print(tanggal) + idx = (len(historyDate)-1) + # print(idx) + self.historyElement(historyDate, idx) + + def prev(self, historyDate): + if (self.index_history == 0): + self.kiri.hide() + else: + self.scroll.setParent(None) + tanggal = historyDate[self.index_history-1][0] + self.date.setText(f"{tanggal}") + daftar_latihan = cur.execute(f""" + SELECT name FROM riwayat_latihan WHERE date = '{tanggal}' + """).fetchall() + print(daftar_latihan) + jumlahCard = len(daftar_latihan) + keterangan = cur.execute(f""" + SELECT tot_duration, title_program FROM riwayat_latihan WHERE date = '{tanggal}' + """).fetchone() + + self.duration.setText("Duration : " + str(keterangan[0]) + " minutes") + self.prog.setText("Program Name: " + keterangan[1]) + # for k in range(self.banyaknyaKartu): + # print(k) + # self.boxdelete(k) + # self.scroll.setParent(None) + for i in reversed(range(self.banyaknyaKartu)): + self.hbox.itemAt(i).widget().setParent(None) + + # self.scroll = QScrollArea(self) + # self.scroll.setGeometry(654, 369, 486, 204) # mengatur posisi dan ukuran QScrollArea + # self.scroll.setStyleSheet(f"background-color: {card_color}; border-radius: 0px;") + # self.scrollWidget = QWidget(self.scroll) + # self.scrollLayout = QVBoxLayout(self.scrollWidget) + # self.scrollWidget.setStyleSheet(f"background-color: {card_color}; border-radius: 0px;") + # self.scrollWidget.setLayout(self.scrollLayout) + # horizontal_scrollbar = self.scroll.horizontalScrollBar() + # # Mengatur bentuk scroll bar + # scroll_bar_style = """ + # QScrollBar:horizontal { + # border : 0px; + # background-color: #5A8D6C; + # height: 10px; + # margin: 0px 0px 0px 0px; + # } + # QScrollBar::handle:horizontal { + # background-color: #174728; + # border-radius: 50px; + # border: 0px; + # } + # """ + # self.scroll.horizontalScrollBar().setStyleSheet(scroll_bar_style) + # self.hbox = QHBoxLayout() + # print(jumlahCard) + + self.banyaknyaKartu = jumlahCard + for j in range(self.banyaknyaKartu): + print(j) + self.label = QLabel() + self.label.setFixedSize(150, 175) + self.label.setStyleSheet(styleSheetCard) + self.hbox.addWidget(self.label) + nama_latihan = daftar_latihan[j][0] + print(nama_latihan) + repetisi_latihan = cur.execute(f""" + SELECT repetition FROM daftar_latihan WHERE title = '{nama_latihan}' + """).fetchone() + durasi_latihan = cur.execute(f""" + SELECT duration FROM daftar_latihan WHERE title = '{nama_latihan}' + """).fetchone() + gambar_latihan = cur.execute(f""" + SELECT gif FROM daftar_latihan WHERE title = '{nama_latihan}' + """).fetchone() + con.commit() + self.show_nama_latihan = QLabel(self.label) + self.show_nama_latihan.setText(nama_latihan) + self.show_nama_latihan.setStyleSheet(f'color: {card_color};') + self.show_nama_latihan.move(10, 120) + self.show_nama_latihan.setFont(rincianFont) + self.show_nama_latihan.setAlignment(Qt.AlignmentFlag.AlignLeft) + + self.show_repetisi_latihan = QLabel(self.label) + if (repetisi_latihan[0] == None): + self.show_repetisi_latihan.setText("Duration: " + str(durasi_latihan[0]) + " seconds") + else: + self.show_repetisi_latihan.setText("Repetition: " + str(repetisi_latihan[0])) + self.show_repetisi_latihan.setStyleSheet(f'color: {card_color};') + self.show_repetisi_latihan.move(10, 145) + self.show_repetisi_latihan.setFont(repetisiFont) + self.show_repetisi_latihan.setAlignment(Qt.AlignmentFlag.AlignLeft) + + self.gif = "img/exercise-unscreen.gif" + self.gif2 = QMovie(self.gif) + self.gif2.setScaledSize(QSize(90, 90)) + self.gif2.start() + self.show_gambar_latihan = QLabel(self.label) + self.show_gambar_latihan.setMovie(self.gif2) + self.show_gambar_latihan.move(25, 20) + self.scrollLayout.addLayout(self.hbox) + self.scroll.setWidget(self.scrollWidget) + - kiri = QPushButton(self) - kiri.setText('<') - kiri.setStyleSheet(f''' - QPushButton {{ - color: {button_color}; - background-color: {card_color}; - border: none; - border-radius: 20px; - }} - ''') - kiri.setFont(dateFont) - kiri.move(727, 195) - kiri.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) - - date = QLabel(self) - date.setText("Date :") - date.setStyleSheet(f'color: {button_color}; background-color: {card_color};') - date.move(793, 195) - date.setFont(dateFont) - date.setAlignment(Qt.AlignmentFlag.AlignLeft) - - kanan = QPushButton(self) - kanan.setText('>') - kanan.setStyleSheet(f''' - QPushButton {{ - color: {button_color}; - background-color: {card_color}; - border: none; - border-radius: 20px; - }} - ''') - kanan.setFont(dateFont) - kanan.move(1047, 195) - kanan.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) - - duration = QLabel(self) - duration.setText("Duration :") - duration.setStyleSheet(f'color: {button_color}; background-color: {card_color};') - duration.move(667,282) - duration.setFont(historyFont) - duration.setAlignment(Qt.AlignmentFlag.AlignLeft) - - prog = QLabel(self) - prog.setText("Program Name: ") - prog.setStyleSheet(f'color: {button_color}; background-color: {card_color};') - prog.move(667, 317) - prog.setFont(historyFont) - prog.setAlignment(Qt.AlignmentFlag.AlignLeft) - def showRegister(self): - self.switch.emit(self, "register") - def listLatihann(self): - self.switch.emit(self, "listLatihan") + def next(self, historyDate): + if (self.index_history == len(historyDate)-1): + self.kanan.hide() + else: + self.historyElement(historyDate, self.index_history+1) + + def planWindow(self): + self.switch.emit("plan", {}) + + def listWindow(self): + self.switch.emit("listLatihan", {}) + + def customWindow(self): + self.switch.emit("customize", {}) + + def boxdelete(self, box): + for i in range(self.vlayout.count()): + layout_item = self.vlayout.itemAt(i) + if layout_item.layout() == box: + deleteItemsOfLayout(layout_item.layout()) + self.vlayout.removeItem(layout_item) + break + def clear_item(self, item): + if hasattr(item, "layout"): + if callable(item.layout): + layout = item.layout() + else: + layout = None + + if hasattr(item, "widget"): + if callable(item.widget): + widget = item.widget() + else: + widget = None + if widget: + widget.setParent(None) + elif layout: + for i in reversed(range(layout.count())): + self.clear_item(layout.itemAt(i)) diff --git a/src/listlatihan2.py b/src/listlatihan2.py index dc03628a7ab6f69ad401b61ae8c842edfcf6425e..fc746e6c9cb219eabb05c41a3f8cdc9c1e16a32f 100644 --- a/src/listlatihan2.py +++ b/src/listlatihan2.py @@ -1,12 +1,12 @@ import sqlite3 import sys import textwrap +from functools import partial -from PyQt6.QtCore import Qt -from PyQt6.QtGui import QIcon, QPixmap, QCursor, QFont -from PyQt6.QtWidgets import (QWidget, QApplication, QMainWindow, QWidget, QGridLayout, - QGroupBox, QRadioButton, QCheckBox, QMessageBox, - QLabel, QLineEdit, QVBoxLayout, QHBoxLayout, QPushButton, QScrollArea) +from PyQt6.QtCore import Qt, QSize, pyqtSignal +from PyQt6.QtGui import QIcon, QPixmap, QCursor, QFont, QMovie +from PyQt6.QtWidgets import (QWidget, QApplication, QWidget, + QLabel, QVBoxLayout, QHBoxLayout, QPushButton, QScrollArea, QDialog) # from PyQt6 import QtWidgets background = '#5A8D6C' @@ -14,14 +14,19 @@ button_color = '#174728' text_color = '#EEEEE2' card_color = '#D2DCC4' +imgPath = None +descLat = None +titleLat = None + class listLatihan2(QWidget): + switch = pyqtSignal(str, dict) def __init__(self): - super().__init__() self.con = sqlite3.connect('fitu.db') - self.listLat = self.fetchListLatihan() + self.listLat = self.fetchListLatihan() + self.count = 0 self.setUpListLatihanWindow() self.setupGUI() @@ -37,7 +42,11 @@ class listLatihan2(QWidget): self.setWindowIcon(QIcon("img/logo.png")) self.setWindowTitle("Fit-U - Daftar Latihan") self.setStyleSheet('background-color: #5A8D6C;') - + + def openDetail(self, count, listLat): + popup = MyPopup(count, listLat) + popup.exec() + def setupGUI(self): buttonFont = QFont() @@ -63,14 +72,14 @@ class listLatihan2(QWidget): homeButton.setStyleSheet(f''' QPushButton {{ color: {text_color}; - background-color: {button_color}; + background-color: {background}; border: none; border-radius: 20px; }} ''') homeButton.setFont(buttonFont) homeButton.setFixedSize(96, 42) #pake ini buat kalau dia buletan - homeButton.move(507, 53) + homeButton.move(507, 58) homeButton.setCursor( QCursor(Qt.CursorShape.PointingHandCursor)) @@ -109,16 +118,17 @@ class listLatihan2(QWidget): # tombol list listButton = QPushButton(self) listButton.setText('List') + listButton.setFixedSize(96, 42) listButton.setStyleSheet(f''' QPushButton {{ color: {text_color}; - background-color: {background}; + background-color: {button_color}; border: none; border-radius: 20px; }} ''') listButton.setFont(buttonFont) - listButton.move(898, 58) + listButton.move(870, 53) listButton.setCursor( QCursor(Qt.CursorShape.PointingHandCursor)) @@ -147,7 +157,7 @@ class listLatihan2(QWidget): # scroll.setWidget(greenCard) scroll = QScrollArea(self) - scroll.setGeometry(0, 150, 1280,570) # mengatur posisi dan ukuran QScrollArea + scroll.setGeometry(0, 150, 1265,570) # mengatur posisi dan ukuran QScrollArea scroll.setStyleSheet("background-color: #5A8D6C;border-radius: none;") scrollWidget = QWidget(scroll) scrollLayout = QVBoxLayout(scrollWidget) @@ -158,18 +168,20 @@ class listLatihan2(QWidget): scroll_bar_style = """ QScrollBar:vertical { background-color: #D2DCC4; - width: 20px; + width: 15px; margin: 20px 0 20px 0; } QScrollBar::handle:vertical { background-color: #174728; - border-radius: 10px; + border-radius: 6px; } QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { height: 20px; background-color: #D2DCC4; subcontrol-origin: margin; subcontrol-position: top; + border-top-left-radius: 6px; + border-top-right-radius: 6px; } QScrollBar::add-line:vertical { top: 0; @@ -180,43 +192,145 @@ class listLatihan2(QWidget): """ scroll.verticalScrollBar().setStyleSheet(scroll_bar_style) count = 0 - for j in range(4): + for j in range(5): hbox = QHBoxLayout() hbox.setContentsMargins(10, 0, 0, 0) - for i in range (4): - card = QLabel(self) - card.setFixedSize(266, 266) - card.setStyleSheet(styleSheetCard) - pathImg = QPixmap('img/logo.png') - image = QLabel(card) - image.setPixmap(pathImg.scaled(100,100)) - image.move(83, 10) - title = QLabel(card) - title.setText(f'<font style="font-size:24px;font-family="Sogoe UI;" ><b>{self.listLat[count][1]}<b>') - title.move(10, 120) - repDur = QLabel(card) - if(count<8): - repDur.setText(f'<font style="font-size:14px;font-family="Sogoe UI;"><b>{self.listLat[count][4]} Detik<b>') - repDur.move(203, 130) - else: - repDur.setText(f'<font style="font-size:14px;font-family="Sogoe UI;"><b>{self.listLat[count][5]} Repetisi<b>') - repDur.move(187,130) - desc = QLabel(card) - t = f'<font style="font-size:12px;font-family="Sogoe UI;">{self.listLat[count][2]}' - desc.setText(t) - desc.move(10, 170) - desc.setWordWrap(True) - desc.setFixedWidth(245) - hbox.addWidget(card) - count+=1 + if(j<4): + for i in range (4): + card = QPushButton(self) + card.setFixedSize(266, 266) + card.setStyleSheet(styleSheetCard) + + pathImg = QPixmap(self.listLat[count][6]) + image = QLabel(card) + image.setPixmap(pathImg.scaled(100,100)) + image.move(83, 10) + + title = QLabel(card) + title.setText(f'<font style="font-size:24px;font-family="Sogoe UI;" ><b>{self.listLat[count][1]}<b>') + title.setStyleSheet("color: #174728") + title.move(10, 120) + + repDur = QLabel(card) + if(count<8): + repDur.setText(f'<font style="font-size:14px;font-family="Sogoe UI;"><b>{self.listLat[count][4]} Detik<b>') + repDur.setStyleSheet("color: #174728") + repDur.move(203, 130) + else: + repDur.setText(f'<font style="font-size:14px;font-family="Sogoe UI;"><b>{self.listLat[count][5]} Repetisi<b>') + repDur.setStyleSheet("color: #174728") + repDur.move(187,130) + + desc = QLabel(card) + t = f'<font style="font-size:12px;font-family="Sogoe UI;">{self.listLat[count][2]}' + if(len(t)> 200): + t = t[0:200]+f" <font color='blue';>See More..." + + desc.setText(t) + desc.move(10, 170) + desc.setWordWrap(True) + desc.setFixedWidth(245) + desc.setFixedHeight(70) + desc.setAlignment(Qt.AlignmentFlag.AlignJustify) + desc.setStyleSheet("color: #174728") + self.count = count + hbox.addWidget(card) + card.clicked.connect(partial(self.openDetail, self.count, self.listLat)) + card.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) + count+=1 + else: + box = QLabel() + box.setFixedHeight(12) + scrollLayout.addWidget(box) + scrollLayout.addLayout(hbox) scrollLayout.setSpacing(50) scroll.setWidget(scrollWidget) +class MyPopup(QDialog): + def __init__(self, count, listLat): + super().__init__() - + self.setWindowFlags(Qt.WindowType.FramelessWindowHint) + self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground) + + styleSheet = ( + "background-color: #5A8D6C;" + "border-radius: 20px;" + ) + + styleSheet2 = ( + "background-color: #D2DCC4;" + "border-radius: 20px;" + ) + + bg = QLabel(self) + bg.setFixedSize(942, 464) + bg.move(198, 164) + bg.setStyleSheet("background-color: black; border-radius: 20px; color: #174728;") + + label = QLabel(bg) + label.setFixedSize(938,460) + label.move(2,2) + label.setStyleSheet(styleSheet2) + + + okButton = QPushButton(label) + okButton.setText("OK") + okButton.setFixedSize(70, 40) + okButton.move(840, 395) + okButton.setStyleSheet("color: #D2DCC4; background-color: #174728;font-weight: bold; font-size: 15px;") + okButton.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) + okButton.clicked.connect(self.close) + + + pathGif = QMovie(listLat[count][6]) + pathGif.setScaledSize(QSize(325,325)) + pathGif.setSpeed(100) + gif = QLabel(bg) + gif.setMovie(pathGif) + gif.move(40,60) + gif.setStyleSheet("background-color: #D2DCC4;") + pathGif.start() + + garis = QLabel(bg) + garis.setFixedSize(2,440) + garis.setStyleSheet("background-color: #174728;") + garis.move(400,10) + + title = QLabel(bg) + title.setText(f'<font style="font-size:60px;font-family="Sogoe UI; ><b>{listLat[count][1]}<b>') + title.setStyleSheet("color: #174728; background-color: #D2DCC4;") + title.move(420, 40) + + goal = QLabel(bg) + goal.setText(f'<font style="font-size:26px;font-family="Sogoe UI; ><b>{listLat[count][3]}<b>') + goal.setStyleSheet("color: #174728; background-color: #D2DCC4;") + goal.move(420, 130) + + repDur = QLabel(bg) + if(count<8): + repDur.setText(f'<font style="font-size:17px;font-family="Sogoe UI;"><b>{listLat[count][4]} Detik<b>') + repDur.move(760, 140) + else: + repDur.setText(f'<font style="font-size:17px;font-family="Sogoe UI;"><b>{listLat[count][5]} Repetisi<b>') + repDur.move(740, 140) + repDur.setStyleSheet("color: #174728; background-color: #D2DCC4;") + + + desc = QLabel(bg) + desc.setText(f'<font style="font-size:14px;font-family="Sogoe UI; ><b>{listLat[count][2]}<b>') + desc.setStyleSheet("color: #174728; background-color: #D2DCC4;") + desc.setAlignment(Qt.AlignmentFlag.AlignJustify) + desc.move(420, 180) + desc.setWordWrap(True) + desc.setFixedWidth(410) + + + + if __name__ == '__main__': app = QApplication(sys.argv) ex = listLatihan2() diff --git a/src/plan.py b/src/plan.py index 63fa172278cea0cf33a3c8b410136464123e23f3..b0d869e15f403baeb68d84d647aeb7c0b3ea2907 100644 --- a/src/plan.py +++ b/src/plan.py @@ -3,7 +3,7 @@ import sys from PyQt6.QtCore import Qt from PyQt6.QtGui import QPixmap, QCursor, QFont -from PyQt6.QtWidgets import (QApplication, QWidget, QLabel, QHBoxLayout, QVBoxLayout, QPushButton, QScrollArea) +from PyQt6.QtWidgets import QApplication, QWidget, QLabel, QHBoxLayout, QVBoxLayout, QPushButton, QScrollArea # COLORS PALLETE BACKGROUNDCOLOR = '#5A8D6C' @@ -38,6 +38,7 @@ class plan(QWidget): buttonFont = QFont() buttonFont.setFamily('Segoe UI') buttonFont.setPointSize(18) + buttonFont.setBold(True) # Style sheets styleSheetNavbar0 = (f''' @@ -47,6 +48,9 @@ class plan(QWidget): border: none; border-radius: 20px; }} + QPushButton:hover {{ + color: {BUTTONCOLOR}; + }} ''') styleSheetNavbar1 = (f''' @@ -58,46 +62,55 @@ class plan(QWidget): }} ''') - styleSheetBigCard = ( - "background-color: #D2DCC4;" - "border-radius: 20px;" + styleSheetSmallCard = ( + ''' + QPushButton { + background-color: #5A8D6C; + border: 1.2px solid rgba(255, 255, 255, 0.8); + border-radius: 20px; + } + QPushButton:hover { + background-color: #174728; + border: 1.2px solid rgba(255, 255, 255, 0.8); + } + ''' ) - styleSheetSmallCard = ( - "color: #5A8D6C;" + styleSheetBigCard = ( "background-color: #D2DCC4;" "border-radius: 20px;" ) - styleSheet2 = ( + styleSheet = ( "color: #5A8D6C;" "background-color: #D2DCC4;" "border-radius: 20px;" ) - styleSheet4 = ( - "color: #EEEEE2;" - "background-color: #174728;" - "border-radius: 20px;" + styleSheetStart = ( f''' QPushButton {{ color: {TEXTCOLOR}; background-color: {BACKGROUNDCOLOR}; - border: none; + border: 1.2px solid rgba(255, 255, 255, 0.8); border-radius: 20px; }} + QPushButton:hover {{ + background-color: {BUTTONCOLOR}; + }} ''') - - styleSheetCard = ( - "background-color: #5A8D6C;" - "border-radius: 20px;" - ) - styleSheet6 = (f''' + styleSheetCutomize = (f''' + QPushButton {{ background-color: {CARDCOLOR}; color: {BUTTONCOLOR}; border: none; border-radius: 20px; text-decoration: underline; + }} + QPushButton:hover {{ + background-color: {CARDCOLOR}; + color: {BACKGROUNDCOLOR}; + }} ''') verticallScrollBarStyle = (""" @@ -162,8 +175,7 @@ class plan(QWidget): homeButton.setFont(buttonFont) homeButton.setFixedSize(96, 42) homeButton.move(507, 53) - homeButton.setCursor( - QCursor(Qt.CursorShape.PointingHandCursor)) + homeButton.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) # Customize Button customizeButton = QPushButton(self) @@ -171,8 +183,7 @@ class plan(QWidget): customizeButton.setStyleSheet(styleSheetNavbar0) customizeButton.setFont(buttonFont) customizeButton.move(649, 58) - customizeButton.setCursor( - QCursor(Qt.CursorShape.PointingHandCursor)) + customizeButton.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) # Plan Button planButton = QPushButton(self) @@ -188,8 +199,7 @@ class plan(QWidget): listButton.setStyleSheet(styleSheetNavbar0) listButton.setFont(buttonFont) listButton.move(898, 58) - listButton.setCursor( - QCursor(Qt.CursorShape.PointingHandCursor)) + listButton.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) # History Button historyButton = QPushButton(self) @@ -197,8 +207,7 @@ class plan(QWidget): historyButton.setStyleSheet(styleSheetNavbar0) historyButton.setFont(buttonFont) historyButton.move(979, 58) - historyButton.setCursor( - QCursor(Qt.CursorShape.PointingHandCursor)) + historyButton.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) # Profile Picture profilePicture = QLabel(self) @@ -233,15 +242,13 @@ class plan(QWidget): exButton = QPushButton(self) exButton.setStyleSheet(styleSheetSmallCard) exButton.setFixedSize(366, 99) - exButton.setStyleSheet("background-color: #5A8D6C; border-radius: 20px;") exButton.setFont(buttonFont) - exButton.setCursor( - QCursor(Qt.CursorShape.PointingHandCursor)) + exButton.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) exButton.clicked.connect(lambda state, index=i: showExercise(index)) title = QLabel(exButton) title.setText(f'<font style="font-size:24px;" color="#D2DCC4"; font-family="Sogoe UI";><b>{data[i][1]}<b>') title.move(20, 15) - dur = QLabel(exButton) + title.setStyleSheet("background-color: transparent;") con = sqlite3.connect('fitu.db') c = con.cursor() @@ -250,8 +257,10 @@ class plan(QWidget): c.close() predict = len(data2) + dur = QLabel(exButton) dur.setText(f'<font style="font-size:18px;" color="#D2DCC4"; font-family="Sogoe UI";>{predict} Minutes') dur.move(20, 50) + dur.setStyleSheet("background-color: transparent;") scrollLayout.addWidget(exButton) scroll.setWidget(scrollWidget) @@ -276,49 +285,49 @@ class plan(QWidget): # create a function to show exercise data based on index def showExercise(index): - clickedRowData = data[index][0] - con = sqlite3.connect('fitu.db') - c = con.cursor() - c.execute("SELECT title, repetition, duration, gif FROM latihan_program, daftar_latihan WHERE latihan_program.exercise_id = daftar_latihan.exercise_id AND latihan_program.program_id = ?", (clickedRowData,)) - data2 = c.fetchall() - c.close() - - # clear the exercise data list - exercise_data.clear() - - # append new exercise data to the list - for i in range(len(data2)): - exercise_data.append(data2[i]) - - # remove all widgets from scrollLayout2 - for i in reversed(range(scrollLayout2.count())): - scrollLayout2.itemAt(i).widget().setParent(None) - - # create QLabel widgets for each exercise and add them to scrollLayout2 - for i in range(len(exercise_data)): - exLabel = QLabel(self) - exLabel.setFixedSize(202, 270) - exLabel.setStyleSheet("background-color: #5A8D6C; border-radius: 20px;") - title = QLabel(exLabel) - title.setText(f'<font style="font-size:24px;" color="#D2DCC4"; font-family="Sogoe UI";><b>{exercise_data[i][0]}<b>') - title.move(20, 15) - repDur = QLabel(exLabel) - if exercise_data[i][1] == None: - repDur.setText(f'<font style="font-size:18px;" color="#D2DCC4"; font-family="Sogoe UI";>{exercise_data[i][2]} Minutes') - else: - repDur.setText(f'<font style="font-size:18px;" color="#D2DCC4"; font-family="Sogoe UI";>{exercise_data[i][1]} Repetitions') - repDur.move(20, 50) - exPix = QPixmap(exercise_data[i][3]) - image = QLabel(exLabel) - image.setPixmap(exPix) - image.setScaledContents(True) - image.move(20, 80) - image.setFixedSize(160, 160) - - scrollLayout2.addWidget(exLabel) - - # set the widget of scroll2 to scrollWidget2 to update the view - scroll2.setWidget(scrollWidget2) + clickedRowData = data[index][0] + con = sqlite3.connect('fitu.db') + c = con.cursor() + c.execute("SELECT title, repetition, duration, gif FROM latihan_program, daftar_latihan WHERE latihan_program.exercise_id = daftar_latihan.exercise_id AND latihan_program.program_id = ?", (clickedRowData,)) + data2 = c.fetchall() + c.close() + + # clear the exercise data list + exercise_data.clear() + + # append new exercise data to the list + for i in range(len(data2)): + exercise_data.append(data2[i]) + + # remove all widgets from scrollLayout2 + for i in reversed(range(scrollLayout2.count())): + scrollLayout2.itemAt(i).widget().setParent(None) + + # create QLabel widgets for each exercise and add them to scrollLayout2 + for i in range(len(exercise_data)): + exLabel = QLabel(self) + exLabel.setFixedSize(202, 270) + exLabel.setStyleSheet("background-color: #5A8D6C; border-radius: 20px;") + title = QLabel(exLabel) + title.setText(f'<font style="font-size:22px;" color="#D2DCC4"; font-family="Sogoe UI";><b>{exercise_data[i][0]}<b>') + title.move(20, 15) + repDur = QLabel(exLabel) + if exercise_data[i][1] == None: + repDur.setText(f'<font style="font-size:18px;" color="#D2DCC4"; font-family="Sogoe UI";>{exercise_data[i][2]} Minutes') + else: + repDur.setText(f'<font style="font-size:18px;" color="#D2DCC4"; font-family="Sogoe UI";>{exercise_data[i][1]} Repetitions') + repDur.move(20, 50) + exPix = QPixmap(exercise_data[i][3]) + image = QLabel(exLabel) + image.setPixmap(exPix) + image.setScaledContents(True) + image.move(20, 80) + image.setFixedSize(160, 160) + + scrollLayout2.addWidget(exLabel) + + # set the widget of scroll2 to scrollWidget2 to update the view + scroll2.setWidget(scrollWidget2) font = QFont() font.setFamily("Segoe UI") @@ -334,13 +343,13 @@ class plan(QWidget): exText = QLabel(self) exText.setText("Workout Plan") exText.setFont(font) - exText.setStyleSheet(styleSheet2) + exText.setStyleSheet(styleSheet) exText.setFixedSize(250, 50) exText.move(140,185) progText = QLabel(self) progText.setText("Exercise") - progText.setStyleSheet(styleSheet2) + progText.setStyleSheet(styleSheet) progText.setFixedSize(165, 50) progText.setFont(font) progText.move(599, 182) @@ -351,21 +360,17 @@ class plan(QWidget): startButton.setText("START >") startButton.move(1004, 620) startButton.setFixedSize(144, 42) - startButton.setStyleSheet(styleSheet4) + startButton.setStyleSheet(styleSheetStart) startButton.setFont(font1) - startButton.setCursor( - QCursor(Qt.CursorShape.PointingHandCursor)) + startButton.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) custButton = QPushButton(self) custButton.setFont(font) custButton.setText("Customize") custButton.move(825, 620) - custButton.setStyleSheet(styleSheet6) + custButton.setStyleSheet(styleSheetCutomize) custButton.setFont(font1) - custButton.setCursor( - QCursor(Qt.CursorShape.PointingHandCursor)) - - + custButton.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) if __name__ == '__main__': app = QApplication(sys.argv) diff --git a/src/tesBacaDB.py b/src/tesBacaDB.py index 347fcbc200561097e5f88f545862754271478b95..14ea10eef17f53d98e3ad497c7371da404af3446 100644 --- a/src/tesBacaDB.py +++ b/src/tesBacaDB.py @@ -93,6 +93,36 @@ def tesBaca(): (1, 106), (1, 202) """) + cur.execute(""" + INSERT INTO riwayat_latihan + (program_id, name, title_program, calories, date, tot_duration) + VALUES + (1, 'Push Up', 'Chest Day', 100, '2020-12-12', 30), + (1, 'Sit Up', 'Chest Day', 100, '2020-12-12', 30), + (1, 'Pull Up', 'Chest Day', 100, '2020-12-12', 30), + (1, 'Squat Jump', 'Chest Day', 100, '2020-12-12', 30), + (1, 'Lunges', 'Chest Day', 100, '2020-12-12', 30), + (1, 'Crunches', 'Chest Day', 100, '2020-12-12', 30), + (1, 'Burpees', 'Chest Day', 100, '2020-12-12', 30), + (1, 'Bicycle Crunch', 'Chest Day', 100, '2020-12-12', 30), + (1, 'Jumping Rope', 'Chest Day', 100, '2020-12-12', 30), + (1, 'Running', 'Chest Day', 100, '2020-12-12', 30), + (1, 'Jumping Jacks', 'Chest Day', 100, '2020-12-12', 30), + (1, 'Plank', 'Chest Day', 100, '2020-12-12', 30), + (1, 'Bridge', 'Chest Day', 100, '2020-12-12', 30), + (1, 'High Knees', 'Chest Day', 100, '2020-12-12', 30), + (1, 'Squat', 'Chest Day', 100, '2020-12-12', 30), + (2, 'Push Up', 'Leg Day', 100, '2020-12-15', 30), + (2, 'Sit Up', 'Leg Day', 100, '2020-12-15', 30), + (2, 'Pull Up', 'Leg Day', 100, '2020-12-15', 30), + (2, 'Squat Jump', 'Leg Day', 100, '2020-12-15', 30), + (2, 'Lunges', 'Leg Day', 100, '2020-12-15', 30), + (2, 'Crunches', 'Leg Day', 100, '2020-12-15', 30), + (2, 'Burpees', 'Leg Day', 100, '2020-12-15', 30), + (2, 'Bicycle Crunch', 'Leg Day', 100, '2020-12-15', 30), + (2, 'Jumping Rope', 'Leg Day', 100, '2020-12-15', 30), + (2, 'Running', 'Leg Day', 100, '2020-12-15', 30) + """) con.commit() con.close()