Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#include <iostream> | ||
#include <stdlib.h> | ||
//#include <fstream> | ||
//#include <winsqlite/winsqlite3.h> | ||
|
||
using namespace std; | ||
|
||
string inputText; | ||
|
||
// function inputLogin gets the | ||
// input of the user | ||
string inputLogin(string inputText) | ||
{ | ||
string input; | ||
|
||
cout << "Enter your " + inputText + ": " << endl; | ||
cin >> input; | ||
|
||
return input; | ||
} | ||
|
||
// function login uses the inputLogin function and | ||
// uses it to get the username and password input | ||
// for each user and also checks if the users exist | ||
// in the database | ||
string login() | ||
{ | ||
string username = "username"; | ||
|
||
string usernameInput = inputLogin(username); | ||
|
||
//sqlite3* db; | ||
|
||
//sqlite3_open("Timetablex.db", &db); | ||
|
||
//auto checkingUsername = db("SELECT * FROM Account WHERE (AccountName = " + usernameInput + ";"); | ||
|
||
//if (checkingUsername = NULL) | ||
//{ | ||
// cout << "This username doesn't exist. Try a different username."; | ||
|
||
// return "Restart the program"; | ||
//} | ||
//else | ||
//{ | ||
string password = "password"; | ||
|
||
string passwordInput = inputLogin(password); | ||
|
||
/* auto checkingPassword = db("SELECT * FROM Account WHERE (password = " + passwordInput + ";"); | ||
sqlite3_close(); | ||
if (checkingPassword = NULL) | ||
{ | ||
cout << "This password doesn't exist. Try a different password."; | ||
return "Restart the program"; | ||
} | ||
else | ||
{*/ | ||
system("CLS"); | ||
|
||
return usernameInput; | ||
// } | ||
|
||
|
||
//} | ||
|
||
}; |