Commit 1f0dbf94 authored by Sam's avatar Sam

Commit v9

parent 176d5661
...@@ -78,12 +78,9 @@ public class Receipt extends AppCompatActivity implements View.OnClickListener { ...@@ -78,12 +78,9 @@ public class Receipt extends AppCompatActivity implements View.OnClickListener {
allQuantities = getIntent().getStringArrayListExtra("allQuantities"); allQuantities = getIntent().getStringArrayListExtra("allQuantities");
allPrices = getIntent().getStringArrayListExtra("allPrices"); allPrices = getIntent().getStringArrayListExtra("allPrices");
bookingID = getIntent().getIntExtra("bookingID", 0); bookingID = getIntent().getIntExtra("bookingID", 0);
userDetailsReceipt();
displayItemsOnReceipt();
usersReceipt(); usersReceipt();
Log.d("Receipt", String.valueOf(bookingID));
Log.d("Receipt", String.valueOf(allItems));
Log.d("Receipt", String.valueOf(allQuantities));
Log.d("Receipt", String.valueOf(MainActivity.usernameG));
} }
//creates user receipt of the database //creates user receipt of the database
...@@ -92,8 +89,7 @@ public class Receipt extends AppCompatActivity implements View.OnClickListener { ...@@ -92,8 +89,7 @@ public class Receipt extends AppCompatActivity implements View.OnClickListener {
Log.d("usernameG", MainActivity.usernameG); Log.d("usernameG", MainActivity.usernameG);
Log.d("responseuserR", response); Log.d("responseuserR", response);
if(response.equals("success")) { if(response.equals("success")) {
userDetailsReceipt();
displayItemsOnReceipt();
if (allItems.size() > 0) { if (allItems.size() > 0) {
for (int i = 0; i < allItems.size(); i++) { for (int i = 0; i < allItems.size(); i++) {
......
...@@ -165,8 +165,10 @@ public class register extends AppCompatActivity implements View.OnClickListener ...@@ -165,8 +165,10 @@ public class register extends AppCompatActivity implements View.OnClickListener
else{ else{
ResetParams(ErrorMessagepassword2); ResetParams(ErrorMessagepassword2);
} }
if(password.equals(password2) && password2.length() >= 7 && password.length() >= 7 && username.length() >= 5 && lastname.length() >= 3 && firstname.length() >= 2) { if(password.matches("[a-zA-Z0-9]*") && username.matches("[a-zA-Z0-9]*")&& lastname.matches("[a-zA-Z]*") && firstname.matches("[a-zA-Z]*") && password.equals(password2) && password2.length() >= 7 && password.length() >= 7 && username.length() >= 5 && lastname.length() >= 3 && firstname.length() >= 2) {
firstname = firstname.substring(0,1).toUpperCase() + firstname.substring(1);
lastname = lastname.substring(0,1).toUpperCase() + lastname.substring(1);
addAccount(firstname, lastname, username, password); addAccount(firstname, lastname, username, password);
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment