Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G24 #11

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

G24 #11

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added G24/G24.docx
Binary file not shown.
Binary file added G24/G24.pptx
Binary file not shown.
35 changes: 35 additions & 0 deletions HealthCard.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
QT += core gui sql

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++11

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
databaseconnection.cpp \
docpatop.cpp \
doctorreg.cpp \
main.cpp \
healthc.cpp

HEADERS += \
databaseconnection.h \
docpatop.h \
doctorreg.h \
healthc.h

FORMS += \
docpatop.ui \
doctorreg.ui \
healthc.ui

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

RESOURCES += \
resources.qrc
321 changes: 321 additions & 0 deletions HealthCard.pro.user

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions databaseconnection.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "databaseconnection.h"
#include <qdebug.h>
DatabaseConnection::DatabaseConnection()
{
dataBase = QSqlDatabase::addDatabase("QSQLITE");
dataBase.setDatabaseName(":/img/registration.db");
}
bool DatabaseConnection::Connect()
{
if(dataBase.open())
return true;
else return false;

}
void DatabaseConnection::Disconnect()
{
dataBase.close();
}
16 changes: 16 additions & 0 deletions databaseconnection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef DATABASECONNECTION_H
#define DATABASECONNECTION_H
#include<QSqlDatabase>

class DatabaseConnection
{
private:
QSqlDatabase dataBase;

public:
DatabaseConnection();
bool Connect();
void Disconnect();
};

#endif // DATABASECONNECTION_H
64 changes: 64 additions & 0 deletions docpatop.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#include "docpatop.h"
#include "ui_docpatop.h"
#include "doctorreg.h"
#include<QPixmap>
#include "databaseconnection.h"
#include <QDebug>
#include <QSqlDatabase>
#include <QSqlQuery>

docpatop::docpatop(QWidget *parent) :
QDialog(parent),
ui(new Ui::docpatop)
{
ui->setupUi(this);
QPixmap pix(":/img/goll.png");
int width = ui->label_regis->width();
int height = ui->label_regis->height();
ui->label_regis->setPixmap(pix.scaled(width,height,Qt::KeepAspectRatio));

ui->comboBox_gender->addItem(QIcon(":/img/male.png"),"Male");
ui->comboBox_gender->addItem(QIcon(":/img/female.png"),"Female");
}

docpatop::~docpatop()
{
delete ui;
}

void docpatop::on_pushButton_clicked()
{
}


void docpatop::on_pushButton_sumit_clicked()
{
QString name = ui->lineEdit_name->text();
QString phone = ui->lineEdit_phone->text();
QString gender = ui->comboBox_gender->currentText();
QString email = ui->lineEdit_email->text();
QString state = ui->lineEdit_state->text();
QString city = ui->lineEdit_city->text();
QString aadhar = ui->lineEdit_aadhar->text();
QString allergies = ui->lineEdit_mjrdis->text();
QString reginum = ui->lineEdit_regnum->text();
QString specila = ui->comboBox_spec->currentText();
QString docornot = "YES";



DatabaseConnection connection;

if(connection.Connect())
{
qDebug()<<"Connected";
}

QSqlQuery query;
if(query.exec("INSERT INTO registration_table VALUES ('"+name+"',+'"+phone+"','"+gender+"','"+email+"','"+state+"','"+city+"','"+aadhar+"','"+allergies+"','"+docornot+"','"+reginum+"','"+specila+"')"))
{
qDebug()<<"Query Executed";
}

}

27 changes: 27 additions & 0 deletions docpatop.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef DOCPATOP_H
#define DOCPATOP_H

#include <QDialog>
namespace Ui {
class docpatop;
}

class docpatop : public QDialog
{
Q_OBJECT

public:
explicit docpatop(QWidget *parent = nullptr);
~docpatop();

private slots:
void on_pushButton_clicked();

void on_pushButton_sumit_clicked();

private:
Ui::docpatop *ui;

};

#endif // DOCPATOP_H
Loading