diff --git a/BD_LR3.pro b/BD_LR3.pro index 81ea6224e276d89b118acc3e1947c1dc95dd98a2..41b60d6e3dd3088ff3240cd06fc793994fa1f794 100644 --- a/BD_LR3.pro +++ b/BD_LR3.pro @@ -30,7 +30,11 @@ SOURCES += main.cpp\ lindun.cpp \ basket.cpp \ clientmainwindow.cpp \ - blondinkawindow.cpp + blondinkawindow.cpp \ + intervaldialog.cpp \ + filmratingdialog.cpp \ + deleteticketdialog.cpp \ + editfilmdialog.cpp HEADERS += startdialog.h \ adminmainwindow.h \ @@ -38,11 +42,19 @@ HEADERS += startdialog.h \ lindun.h \ basket.h \ clientmainwindow.h \ - blondinkawindow.h + blondinkawindow.h \ + intervaldialog.h \ + filmratingdialog.h \ + deleteticketdialog.h \ + editfilmdialog.h FORMS += startdialog.ui \ adminmainwindow.ui \ lindun.ui \ basket.ui \ clientmainwindow.ui \ - blondinkawindow.ui + blondinkawindow.ui \ + intervaldialog.ui \ + filmratingdialog.ui \ + deleteticketdialog.ui \ + editfilmdialog.ui diff --git a/basket.ui b/basket.ui index b091ee96631622bdbddd6a67b107d2d7bf357618..d5a2ce6c2722d8e670ec01c9626355067c5e75ae 100644 --- a/basket.ui +++ b/basket.ui @@ -6,7 +6,7 @@ 0 0 - 790 + 767 232 diff --git a/blondinkawindow.cpp b/blondinkawindow.cpp index ce31f4b58726aa556deb428ab099ae7a01e718e3..189fb534c234472a6310b09ec89b3d3818e59154 100644 --- a/blondinkawindow.cpp +++ b/blondinkawindow.cpp @@ -8,6 +8,12 @@ BlondinkaWindow::BlondinkaWindow(QWidget *parent) : ui->setupUi(this); this->setWindowTitle("blondinkaWindow"); this->show(); + m_db = QSqlDatabase::addDatabase("QPSQL"); + connectDB(m_db); + + if (!m_db.open()) ui->statusbar->showMessage("Error: DB not connectred"); + else ui->statusbar->showMessage("DB connected succesfully"); + } BlondinkaWindow::~BlondinkaWindow() @@ -15,9 +21,47 @@ BlondinkaWindow::~BlondinkaWindow() delete ui; } -void BlondinkaWindow::on_actionPromode_triggered() +void BlondinkaWindow::on_actionPROmode_triggered() { admin = new AdminMainWindow(); this->close(); } + +void BlondinkaWindow::on_hallIncomeButton_clicked() +{ + interval = new intervalDialog(); + interval->setInfoLabelText("Вывести прибыль зала за интервал времени"); + interval->m_db = m_db; +} + +void BlondinkaWindow::on_filmIncomeButton_clicked() +{ + interval = new intervalDialog(); + interval->setInfoLabelText("Вывести прибыль фильма за интервал времени"); + interval->m_db = m_db; +} +void BlondinkaWindow::on_ticketsButton_clicked() +{ + interval = new intervalDialog(); + interval->setInfoLabelText("Вывести билеты, купленные за интервал времени"); + interval->m_db = m_db; +} + +void BlondinkaWindow::on_filmRatingButton_clicked() +{ + filmRating = new filmRatingDialog(); + filmRating->m_db = m_db; +} + +void BlondinkaWindow::on_deleteTicketButton_clicked() +{ + deleteTicket = new deleteTicketDialog(); + deleteTicket->m_db = m_db; +} + +void BlondinkaWindow::on_editFilmButton_clicked() +{ + editFilm = new editFilmDialog(); + editFilm->m_db = m_db; +} diff --git a/blondinkawindow.h b/blondinkawindow.h index e333c9d5dd008647ce929f656a7ab09a247eb5e6..6ca26103a3f8513f6d953f85fa734c89b934b02a 100644 --- a/blondinkawindow.h +++ b/blondinkawindow.h @@ -3,6 +3,13 @@ #include #include "adminmainwindow.h" +#include "intervaldialog.h" +#include "filmratingdialog.h" +#include "clientmainwindow.h" +#include "deleteticketdialog.h" +#include "editfilmdialog.h" +#include "connectdb.h" + namespace Ui { class BlondinkaWindow; @@ -17,11 +24,29 @@ public: ~BlondinkaWindow(); private slots: - void on_actionPromode_triggered(); + void on_actionPROmode_triggered(); + + void on_hallIncomeButton_clicked(); + + void on_filmIncomeButton_clicked(); + + void on_ticketsButton_clicked(); + + void on_filmRatingButton_clicked(); + + void on_deleteTicketButton_clicked(); + + void on_editFilmButton_clicked(); private: Ui::BlondinkaWindow *ui; AdminMainWindow *admin; + intervalDialog *interval; + filmRatingDialog *filmRating; + deleteTicketDialog *deleteTicket; + editFilmDialog *editFilm; + + QSqlDatabase m_db; }; #endif // BLONDINKAWINDOW_H diff --git a/blondinkawindow.ui b/blondinkawindow.ui index a5a34b0ed0577857c31b8da6b6e1847df3cb875b..3e38b3ff043430d4330d79b81e731a22d3e3261d 100644 --- a/blondinkawindow.ui +++ b/blondinkawindow.ui @@ -13,72 +13,90 @@ MainWindow + + + - - - - 130 - 220 - 102 - 20 - - - - RadioButton - - - - - - 200 - 160 - 102 - 20 - - - - RadioButton - - - - - - 430 - 260 - 26 - 22 - - - - ... - - - - - - 190 - 340 - 87 - 20 - - - - CheckBox - - - - - - 400 - 330 - 199 - 41 - - - - CommandLinkButton - - + + + + + + 0 + 0 + + + + Удалить билет (добавить билет можно в окне клиента) + + + + + + + + 0 + 0 + + + + Прибыль фильма + + + + + + + + 0 + 0 + + + + Прибыль зала + + + + + + + + 0 + 0 + + + + Добавить/удалить фильм + + + + + + + + 0 + 0 + + + + Купленные билеты + + + + + + + + 0 + 0 + + + + Информация о фильмах + + + + @@ -93,14 +111,14 @@ Я не блондинка! - + - + - PRO ULTRA SUPER EBAT PIZDEC MODE + Я прям точно в этом уверена diff --git a/deleteticketdialog.cpp b/deleteticketdialog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e4fd282f2e41b478e5179ad4ea0a0965964c5503 --- /dev/null +++ b/deleteticketdialog.cpp @@ -0,0 +1,16 @@ +#include "deleteticketdialog.h" +#include "ui_deleteticketdialog.h" + +deleteTicketDialog::deleteTicketDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::deleteTicketDialog) +{ + ui->setupUi(this); + this->show(); + +} + +deleteTicketDialog::~deleteTicketDialog() +{ + delete ui; +} diff --git a/deleteticketdialog.h b/deleteticketdialog.h new file mode 100644 index 0000000000000000000000000000000000000000..9ab8e642dbd86c5af7397a87365ec57601159109 --- /dev/null +++ b/deleteticketdialog.h @@ -0,0 +1,26 @@ +#ifndef DELETETICKETDIALOG_H +#define DELETETICKETDIALOG_H + +#include +#include +#include + +namespace Ui { +class deleteTicketDialog; +} + +class deleteTicketDialog : public QDialog +{ + Q_OBJECT + +public: + explicit deleteTicketDialog(QWidget *parent = 0); + ~deleteTicketDialog(); + + QSqlDatabase m_db; + +private: + Ui::deleteTicketDialog *ui; +}; + +#endif // DELETETICKETDIALOG_H diff --git a/deleteticketdialog.ui b/deleteticketdialog.ui new file mode 100644 index 0000000000000000000000000000000000000000..fd29ca4622602e5dccd74c0390d342f5c593661e --- /dev/null +++ b/deleteticketdialog.ui @@ -0,0 +1,104 @@ + + + deleteTicketDialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + 30 + 240 + 91 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + 260 + 240 + 131 + 32 + + + + Удалить билет + + + + + + 10 + 40 + 381 + 192 + + + + + + + 130 + 10 + 121 + 16 + + + + Список билетов + + + + + + + buttonBox + accepted() + deleteTicketDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + deleteTicketDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/editfilmdialog.cpp b/editfilmdialog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..20a20eda6b5e374f7cafe7b237fb0688c3f9031e --- /dev/null +++ b/editfilmdialog.cpp @@ -0,0 +1,16 @@ +#include "editfilmdialog.h" +#include "ui_editfilmdialog.h" + +editFilmDialog::editFilmDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::editFilmDialog) +{ + ui->setupUi(this); + this->show(); + +} + +editFilmDialog::~editFilmDialog() +{ + delete ui; +} diff --git a/editfilmdialog.h b/editfilmdialog.h new file mode 100644 index 0000000000000000000000000000000000000000..ac80f8195ece7bc535c70fe0a64c922d0b697cd4 --- /dev/null +++ b/editfilmdialog.h @@ -0,0 +1,27 @@ +#ifndef EDITFILMDIALOG_H +#define EDITFILMDIALOG_H + +#include +#include +#include + +namespace Ui { +class editFilmDialog; +} + +class editFilmDialog : public QDialog +{ + Q_OBJECT + +public: + explicit editFilmDialog(QWidget *parent = 0); + ~editFilmDialog(); + + QSqlDatabase m_db; + + +private: + Ui::editFilmDialog *ui; +}; + +#endif // EDITFILMDIALOG_H diff --git a/editfilmdialog.ui b/editfilmdialog.ui new file mode 100644 index 0000000000000000000000000000000000000000..c00e14615fc6d27730b4db497d666a79ce094cb8 --- /dev/null +++ b/editfilmdialog.ui @@ -0,0 +1,182 @@ + + + editFilmDialog + + + + 0 + 0 + 727 + 413 + + + + Dialog + + + + + 10 + 370 + 91 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + 270 + 10 + 121 + 16 + + + + Список фильмов: + + + + + + 260 + 370 + 71 + 16 + + + + errorLabel + + + + + + 10 + 40 + 691 + 192 + + + + + + + 553 + 360 + 141 + 32 + + + + Добавить фильм + + + + + + 410 + 360 + 141 + 32 + + + + Удалить фильм + + + + + + 10 + 280 + 681 + 47 + + + + + + + Название фильма + + + + + + + Режиссёр + + + + + + + Длительность + + + + + + + Год выпуска + + + + + + + + + + + + + + + + + + + + + + buttonBox + accepted() + editFilmDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + editFilmDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/filmratingdialog.cpp b/filmratingdialog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..34682f1833f78b3711ca89ffd98f9dee476653c2 --- /dev/null +++ b/filmratingdialog.cpp @@ -0,0 +1,16 @@ +#include "filmratingdialog.h" +#include "ui_filmratingdialog.h" + +filmRatingDialog::filmRatingDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::filmRatingDialog) +{ + ui->setupUi(this); + this->show(); + +} + +filmRatingDialog::~filmRatingDialog() +{ + delete ui; +} diff --git a/filmratingdialog.h b/filmratingdialog.h new file mode 100644 index 0000000000000000000000000000000000000000..40aa6535caab1b034ab1b5b3a997408e114b6937 --- /dev/null +++ b/filmratingdialog.h @@ -0,0 +1,27 @@ +#ifndef FILMRATINGDIALOG_H +#define FILMRATINGDIALOG_H + +#include +#include +#include + +namespace Ui { +class filmRatingDialog; +} + +class filmRatingDialog : public QDialog +{ + Q_OBJECT + +public: + explicit filmRatingDialog(QWidget *parent = 0); + ~filmRatingDialog(); + + QSqlDatabase m_db; + + +private: + Ui::filmRatingDialog *ui; +}; + +#endif // FILMRATINGDIALOG_H diff --git a/filmratingdialog.ui b/filmratingdialog.ui new file mode 100644 index 0000000000000000000000000000000000000000..f4e79069fd8154c5764f06ba2d0f0a4d099423f4 --- /dev/null +++ b/filmratingdialog.ui @@ -0,0 +1,91 @@ + + + filmRatingDialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + 10 + 250 + 81 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + 120 + 10 + 161 + 16 + + + + Информация о фильмах + + + + + + 10 + 40 + 381 + 192 + + + + + + + + buttonBox + accepted() + filmRatingDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + filmRatingDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/intervaldialog.cpp b/intervaldialog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2df58a9db8b3836d8659511bb48563dc57f3284e --- /dev/null +++ b/intervaldialog.cpp @@ -0,0 +1,20 @@ +#include "intervaldialog.h" +#include "ui_intervaldialog.h" + +intervalDialog::intervalDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::intervalDialog) +{ + ui->setupUi(this); + this->show(); + +} + +intervalDialog::~intervalDialog() +{ + delete ui; +} + +void intervalDialog::setInfoLabelText(QString string){ + ui->infoLabel->setText(string); +} diff --git a/intervaldialog.h b/intervaldialog.h new file mode 100644 index 0000000000000000000000000000000000000000..e29a46ad12971882d9bc2424dac7ec64c6d3a09b --- /dev/null +++ b/intervaldialog.h @@ -0,0 +1,28 @@ +#ifndef INTERVALDIALOG_H +#define INTERVALDIALOG_H + +#include +#include +#include + +namespace Ui { +class intervalDialog; +} + +class intervalDialog : public QDialog +{ + Q_OBJECT + +public: + explicit intervalDialog(QWidget *parent = 0); + ~intervalDialog(); + void setInfoLabelText(QString string); + + QSqlDatabase m_db; + + +private: + Ui::intervalDialog *ui; +}; + +#endif // INTERVALDIALOG_H diff --git a/intervaldialog.ui b/intervaldialog.ui new file mode 100644 index 0000000000000000000000000000000000000000..82bb0ccc319d59145fbc902385e2a0143efe6edf --- /dev/null +++ b/intervaldialog.ui @@ -0,0 +1,139 @@ + + + intervalDialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + 10 + 260 + 91 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + 10 + 30 + 391 + 20 + + + + ... + + + Qt::AlignCenter + + + + + + 110 + 270 + 141 + 16 + + + + errorLabel + + + Qt::AlignCenter + + + + + + 270 + 260 + 114 + 32 + + + + Посмотреть + + + + + + 90 + 60 + 234 + 26 + + + + + + + С + + + + + + + + + + до + + + + + + + + + + + + 10 + 100 + 381 + 141 + + + + + + + + buttonBox + rejected() + intervalDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/startdialog.ui b/startdialog.ui index 6ef8901ad3844c42d668f2fff06ed811b4866581..28bed7031d742335ab2b3d3abfc3535fba0ebbab 100755 --- a/startdialog.ui +++ b/startdialog.ui @@ -41,7 +41,7 @@ - 25 + 20