-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreg.cpp
More file actions
59 lines (55 loc) · 1.61 KB
/
reg.cpp
File metadata and controls
59 lines (55 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "reg.h"
#include "ui_reg.h"
#include "login.h"
#include "ui_login.h"
reg::reg(QWidget *parent) :
QDialog(parent),
ui(new Ui::reg)
{
ui->setupUi(this);
}
reg::~reg()
{
delete ui;
}
void reg::on_pushButton_clicked()
{
Login regs;
QString UserID, UserPW, UserMAIL;
regs.OpenSQL();
ui->loglabel->setText("Server Online");
UserID = ui->idFill->text();
UserPW = ui->pwFill->text();
UserMAIL = ui->mailFill->text();
QSqlQuery qry;
if (UserID == "" || UserPW == "" || UserMAIL == "" )
{
QMessageBox::information(this, "info", "ID or PW or MAIL EMPTY!");
ui->loglabel->setText("ID or PW or MAIL EMPTY!");
}
else
{
if (qry.exec("SELECT UserID FROM MemberINFO WHERE UserID='" + UserID + "\'")) {
if (qry.next())
{
QMessageBox::information(this, "info", "Exist ID");
ui->loglabel->setText("Exist!");
}
else
{
ui->loglabel->setText("Created");
qry.exec("INSERT INTO MemberINFO VALUES ('" + UserID + "','" + UserPW + "','" + UserMAIL + "');");
qry.exec("INSERT INTO MemberSTATUS VALUES('" + UserID + "','0.0.0.0',0,0);");
qry.exec("update MemberINFO set UserID = rtrim(replace(UserID, ' ', ''));");
qry.exec("update MemberINFO set UserPW = rtrim(replace(UserPW, ' ', ''));");
qry.exec("update MemberINFO set UserMAIL = rtrim(replace(UserMAIL, ' ', ''));");
QMessageBox::information(this, "info", "Done!");
close();
}
}
}
}
void reg::on_pushButton_2_clicked() // EXIT BUTTON
{
close();
}