From e33e94d0471f9363d3b3985f661d955cd64bbac4 Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 28 Oct 2013 00:02:14 -0400 Subject: [PATCH 001/145] updated php scripts --- PayBackDB/PHP/AccountCreation.php | 2 +- PayBackDB/PHP/AccountLogin.php | 16 ++++++++-------- PayBackDB/PHP/AccountLookup1var.php | 24 ++++++++++++------------ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/PayBackDB/PHP/AccountCreation.php b/PayBackDB/PHP/AccountCreation.php index 66a7a0e..a089aec 100644 --- a/PayBackDB/PHP/AccountCreation.php +++ b/PayBackDB/PHP/AccountCreation.php @@ -37,7 +37,7 @@ //query to add account -$insertuser = mysqli_query($mysqli, "INSERT INTO `Account` (`email`,`fname`,`lname`,`password`) VALUES (\"$email\",\"$fname\",\"$lname\",\"$password\");"); +$insertuser = mysqli_query($mysqli, "INSERT INTO `Account` (`email`,`fname`,`lname`,`password`) VALUES ('$email','$fname','$lname','$password');"); //output diff --git a/PayBackDB/PHP/AccountLogin.php b/PayBackDB/PHP/AccountLogin.php index 886bf27..cb23b68 100644 --- a/PayBackDB/PHP/AccountLogin.php +++ b/PayBackDB/PHP/AccountLogin.php @@ -1,3 +1,4 @@ +password == $password){ //insert code to do things after auth - echo "Login and query sucess"; + echo "Login and query success"; } else - {echo "Query sucess, but Password does not match";} + {echo "Query success, but Password does not match";} } else {echo "Query failed";} diff --git a/PayBackDB/PHP/AccountLookup1var.php b/PayBackDB/PHP/AccountLookup1var.php index e1bdffd..bfbc54a 100644 --- a/PayBackDB/PHP/AccountLookup1var.php +++ b/PayBackDB/PHP/AccountLookup1var.php @@ -1,3 +1,4 @@ +password == $password){ //insert code to do things after auth //check that attribute is one of the following: email, fname, lname if($attribute=="email" || $attribute == "fname" || $attribute == "lname"){ //sql query - if($lookup = mysqli_query("SELECT 'email', 'fname', 'lname' FROM 'Account' WHERE '"+$attribute+"' LIKE '%"+$value"%';");){ + if($lookup = mysqli_query($mysqli, "SELECT `email`, `fname`, `lname` FROM `Account` WHERE `$attribute` LIKE '%$value%';")){ $data = mysqli_fetch_all($lookup); echo json_encode($data); //echo $lookup; } - //echo "Login and query sucess"; + //echo "Login and query success"; } else - echo "Query failed due to attribute name =" + $attribute; + {echo "Query failed due to attribute name = $attribute";} } else - {echo "Query sucess, but Password does not match";} + {echo "Query success, but Password does not match";} } else {echo "Query for auth failed: user does not exist";} - ?> From 442f5d84bb94b6312e35e5ad3be8cfbd33e59ade Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 4 Nov 2013 21:35:19 -0500 Subject: [PATCH 002/145] Select * From Account script Note lines 11 and 13 gather credentials from a separate config file online --- PayBackDB/PHP/db_test_accounts.php | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 PayBackDB/PHP/db_test_accounts.php diff --git a/PayBackDB/PHP/db_test_accounts.php b/PayBackDB/PHP/db_test_accounts.php new file mode 100644 index 0000000..ac4cb71 --- /dev/null +++ b/PayBackDB/PHP/db_test_accounts.php @@ -0,0 +1,53 @@ +close(); + +// check for empty result +if (mysqli_num_rows($result) > 0) { + // looping through all results + // accounts node + $response["rows"] = mysqli_num_rows($result); + $response["accounts"] = array(); + + while ($row = mysqli_fetch_array($result)) { + // temp user array + $account = array(); + $account["AccountID"] = $row["AccountID"]; + $account["Email"] = $row["Email"]; + $account["Password"] = $row["Password"]; + $account["Fname"] = $row["Fname"]; + $account["Lname"] = $row["Lname"]; + + // push single product into final response array + array_push($response["accounts"], $account); + } + // success + $response["success"] = 1; + + // echoing JSON response + echo json_encode($response); +} +else { + // no accounts found + $response["success"] = 0; + $response["message"] = "No accounts found"; + + // echo no users JSON + echo json_encode($response); +} +?> From d467de9788c9226b462bc57f82865f93e5a04712 Mon Sep 17 00:00:00 2001 From: oepstein Date: Tue, 5 Nov 2013 21:48:57 -0500 Subject: [PATCH 003/145] First implementation of dialogs in settings page --- PayBack/res/layout/activity_settings.xml | 33 ++++++-- .../res/layout/dialog_settings_password.xml | 77 +++++++++++++++++++ .../res/values/strings_activity_settings.xml | 5 +- .../com/example/payback/SettingsActivity.java | 37 +++++++++ 4 files changed, 145 insertions(+), 7 deletions(-) create mode 100644 PayBack/res/layout/dialog_settings_password.xml diff --git a/PayBack/res/layout/activity_settings.xml b/PayBack/res/layout/activity_settings.xml index c710a92..eeff5f4 100644 --- a/PayBack/res/layout/activity_settings.xml +++ b/PayBack/res/layout/activity_settings.xml @@ -14,16 +14,37 @@ android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" - android:text="@string/Cancel" /> + android:text="@string/Cancel" + android:onClick="showMainMenu" />