Skip to content

Commit

Permalink
Merge pull request #54 from ivoxavier/48-updateusertable-still-has-re…
Browse files Browse the repository at this point in the history
…ference-to-utfoods-db

fix referenc to DB
  • Loading branch information
ivoxavier authored Feb 9, 2023
2 parents 872641b + d087dcf commit f065d11
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions js/UpdateUserTable.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* 2022 Ivo Fernandes <[email protected]>
* 2022-2023 Ivo Xavier
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* utFoods is distributed in the hope that it will be useful,
* kaltracker is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
Expand All @@ -16,37 +16,37 @@


function connectDB() {
return LocalStorage.openDatabaseSync("utFoods_db", "0.1", "utFoods_data", 2000000);
return LocalStorage.openDatabaseSync("kaltracker_db", "0.2", "keepsYourData", 2000000);
}

function updateWeight(newWeight){

var update_weight_statement = 'UPDATE user \
SET weight = new_weight \
WHERE user.id == id_login'.replace("new_weight",newWeight).replace("id_login", app_settings.id_login)
WHERE user.id == id_login'.replace("new_weight",newWeight).replace("id_login", 1)

var db = connectDB();
var rs;
db.transaction(function(tx) {
rs = tx.executeSql(update_weight_statement);
}
);
return console.log("New weight defined")

}

function updateAge(newAge){

var update_age_statement = 'UPDATE user \
SET age = newAge \
WHERE user.id == id_login'.replace("newAge",newAge).replace("id_login", app_settings.id_login)
WHERE user.id == id_login'.replace("newAge",newAge).replace("id_login", 1)

var db = connectDB();
var rs;
db.transaction(function(tx) {
rs = tx.executeSql(update_age_statement);
}
);
return console.log("New age defined")

}


Expand All @@ -55,75 +55,75 @@ function updateAge(newAge){

var update_height_statement = 'UPDATE user \
SET height = new_height \
WHERE user.id == id_login'.replace("new_height",newHeight).replace("id_login", app_settings.id_login)
WHERE user.id == id_login'.replace("new_height",newHeight).replace("id_login", 1)

var db = connectDB();
var rs;
db.transaction(function(tx) {
rs = tx.executeSql(update_height_statement);
}
);
return console.log("New height defined")

}


function updateRecCal(newGoal){

var update_goal_statement = 'UPDATE user \
SET rec_cal = new_goal \
WHERE user.id == id_login'.replace("new_goal",newGoal).replace("id_login", app_settings.id_login)
WHERE user.id == id_login'.replace("new_goal",newGoal).replace("id_login", 1)

var db = connectDB();
var rs;
db.transaction(function(tx) {
rs = tx.executeSql(update_goal_statement);
}
);
return console.log("New goal defined")

}

function updateActivity(newActivity){

var update_activity_statement = 'UPDATE user \
SET activity = new_activity \
WHERE user.id == id_login'.replace("new_activity",newActivity).replace("id_login", app_settings.id_login)
WHERE user.id == id_login'.replace("new_activity",newActivity).replace("id_login", 1)

var db = connectDB();
var rs;
db.transaction(function(tx) {
rs = tx.executeSql(update_activity_statement);
}
);
return console.log("New activity defined")

}


function updateApHi(ap_hi){

var update_ap_hi_statement = 'UPDATE user \
SET ap_hi = new_aphi \
WHERE user.id == id_login'.replace("new_aphi",ap_hi).replace("id_login", app_settings.id_login)
WHERE user.id == id_login'.replace("new_aphi",ap_hi).replace("id_login", 1)

var db = connectDB();
var rs;
db.transaction(function(tx) {
rs = tx.executeSql(update_ap_hi_statement);
}
);
return console.log("ap_hi defined")

}

function updateApLo(ap_lo){

var update_ap_lo_statement = 'UPDATE user \
SET ap_lo = new_aplo \
WHERE user.id == id_login'.replace("new_aplo",ap_lo).replace("id_login", app_settings.id_login)
WHERE user.id == id_login'.replace("new_aplo",ap_lo).replace("id_login", 1)

var db = connectDB();
var rs;
db.transaction(function(tx) {
rs = tx.executeSql(update_ap_lo_statement);
}
);
return console.log("ap_lo defined")
}

}
2 changes: 1 addition & 1 deletion po/kaltracker.ivoxavier.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kaltracker.ivoxavier\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-02-09 11:37+0000\n"
"POT-Creation-Date: 2023-02-09 11:50+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down

0 comments on commit f065d11

Please sign in to comment.