Skip to content
Open
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 Documentation/NotionSetUp.mp4
Binary file not shown.
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,23 @@
"devDependencies": {
"cordova-android": "^12.0.1",
"cordova-browser": "^7.0.0",
"cordova-ios": "^7.0.1"
"cordova-ios": "^7.0.1",
"cordova-plugin-file": "^8.0.1",
"cordova-sqlite-storage": "^6.1.0"
},
"cordova": {
"platforms": [
"browser",
"android",
"ios"
]
],
"plugins": {
"cordova-sqlite-storage": {},
"cordova-plugin-file": {}
}
},
"dependencies": {
"sqlite3": "^5.1.7",
"cordova": "^6.5.0"
}
}
93 changes: 93 additions & 0 deletions www/MainSetUp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Settings</title>
<style>
body {
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center; /* Center items horizontally */
min-height: 100vh;
}

.navbar {
background-color: #333;
overflow: hidden;
display: flex;
width: 100%;
margin-top: auto;
}

.navbar a {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
text-decoration: none;
background-color: white;
}

.navbar a:first-child {
background-color: pink;
}

.navbar a img {
width: 30px;
height: 30px;
}

.navbar a:hover img {
opacity: 0.7;
}

.navbar a.active img {
filter: brightness(0) invert(1);
}

/* Added styles for the new links */
.middle-links {
margin-top: 50px; /* Adjust margin as needed */
display: flex;
flex-direction: column;
align-items: center;
}

.middle-links a {
margin: 10px 0;
padding: 10px 20px;
background-color: #f0f0f0;
color: #333;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s ease;
}

.middle-links a:hover {
background-color: #ddd;
}
</style>
</head>
<body>
<h1>Settings</h1>

<div class="middle-links">
<a href="personal_info.html">Personal Information</a>
<a href="hobbies_interests.html">Hobbies/Interests</a>
<a href="configurations.html">Configurations</a>
<a href="notifications.html">Notifications</a>
<a href="dietaryRestrictions.html">Dietary Restrictions</a> <!-- New link -->
</div>

<div class="navbar">
<a class="active" href="home.html"><img src="img/Rectangle 64.png" alt="Home"></a>
<a href="ExpandedCalendarView.html"><img src="img/calendar.png" alt="Calendar"></a>
<a href="profile.html"><img src="img/Avatar.png" alt="Profile"></a>
<a href="Settings.html"><img src="img/settings.png" alt="Settings"></a>
</div>

</body>
</html>
42 changes: 42 additions & 0 deletions www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,49 @@ document.addEventListener('deviceready', onDeviceReady, false);

function onDeviceReady() {
// Cordova is now initialized. Have fun!
async function initDatabase() {
try {
var db = window.sqlitePlugin.openDatabase({name: 'CyncSafe.db', location: "default"});
alert (cordova.file.applicationDirectory + 'www/schema.spsql');
// Resolve the local file system URL for the schema file
window.resolveLocalFileSystemURL('file://' + cordova.file.applicationDirectory + 'www/schema.spsql', function(fileEntry) {
fileEntry.file(function(file) {
var reader = new FileReader();
reader.onloadend = function() {
// File contents are in this.result
var schema = this.result;

// Execute the schema in the database
db.exec(schema, function() {
alert("executed Schema")
window.console.log('Schema executed successfully');
}, function(error) {
alert("Error occured")
window.console.error('Error executing schema:', error);
});
};

// Read the file as text
reader.readAsText(file);
}, function(error) {
window.console.error('Error reading file:', error);
});
}, function(error) {
window.console.error('Error resolving file URL:', error);
});
} catch (error) {
window.console.error('Error initializing database:', error);
}
}

initDatabase();

console.log('Running cordova-' + cordova.platformId + '@' + cordova.version);
document.getElementById('deviceready').classList.add('ready');


}




83 changes: 83 additions & 0 deletions www/schema.spsql
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@

--Table for Types of Food Restrictions--
CREATE TABLE Restrictions (
RestrictionID INTEGER PRIMARY KEY,
RestrctionType INTEGER,
Description Text
);

--Table for the Users Data--
CREATE TABLE User (
UserID INTEGER PRIMARY KEY,
UserName Text,
Gender TEXT CHECK (Gender IN ('male', 'female', 'non-binary', 'other')),
Age Integer,
Email Text,
Password Text
);


--Table for the types of User Energy
CREATE TABLE EnergyLevels (
EnergyID INTEGER PRIMARY KEY,
EnergyLevel Text
);

INSERT INTO EnergyLevels(EngeryID,EnergyLevel) Values (1,"Low");


--Table for FoodReccomendations for Types of Restrctions
CREATE TABLE FoodRecommendations (
RecommendationID INTEGER PRIMARY KEY,
FoodItem Text,
RestrictionID References Restrctions(RestrictionID)
);


--Table for MenstrualCycle for Females
CREATE TABLE MenstrualCycle (
CycleID INTEGER PRIMARY KEY,
StartDate Date,
EndDate Date,
CycleLength Integer,
UserID References User(UserID)
);


--Table for Phases for Mentral Cycle
CREATE TABLE MenstrualCycle (
PhaseID INTEGER PRIMARY KEY,
PhaseType Text,
CycleID References MenstrualCycle(CycleID)
);


--Table for Sleep Entries
CREATE TABLE SleepEntries (
SleepID INTEGER PRIMARY KEY,
SleepDuration Real,
SleepDate Date,
UserID References User(UserID)
);


--Table for Male Testosterone
CREATE TABLE TestosteroneLevel (
LevelID INTEGER PRIMARY KEY,
TestDate Date,
Level TEXT CHECK (Level IN ('High', 'Medium', 'Low')),
UserID References User(UserID)
);


--Table for Male Factors for their Testosterone
CREATE TABLE TestosteroneFactors (
FactorID INTEGER PRIMARY KEY,
FactorDate Date,
FactorType Integer,
FactorDescription Text,
FactorImpact Text,
UserID References User(UserID)
);