Commit b2c43ec1 authored by Sam's avatar Sam

Commit v7

parent b5208790
......@@ -71,10 +71,6 @@ public class Receipt extends AppCompatActivity implements View.OnClickListener {
mainMenu_btn.setOnClickListener(this);
initDatabase();
userDetailsReceipt();
displayItemsOnReceipt();
}
public void initDatabase() {
......@@ -82,20 +78,22 @@ public class Receipt extends AppCompatActivity implements View.OnClickListener {
allQuantities = getIntent().getStringArrayListExtra("allQuantities");
allPrices = getIntent().getStringArrayListExtra("allPrices");
bookingID = getIntent().getIntExtra("bookingID", 0);
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));
usersReceipt();
}
//creates user receipt of the database
private void usersReceipt() {
StringRequest stringRequest = new StringRequest(Request.Method.POST, userReceiptUrl, (Response.Listener<String>) response -> {
Log.d("usernameG", MainActivity.usernameG);
Log.d("responseuserR", response);
if(response.equals("success")) {
userDetailsReceipt();
displayItemsOnReceipt();
if (allItems.size() > 0) {
for (int i = 0; i < allItems.size(); i++) {
......
......@@ -123,6 +123,11 @@ public class register extends AppCompatActivity implements View.OnClickListener
setParams(ErrorMessageuserName);
ErrorMessageuserName.setText(message);
}
else if(username.length() > 30){
message = getString(R.string.reister_username);
setParams(ErrorMessageuserName);
ErrorMessageuserName.setText(message);
}
else{
ResetParams(ErrorMessageuserName);
}
......@@ -140,9 +145,12 @@ public class register extends AppCompatActivity implements View.OnClickListener
setParams(ErrorMessagepassword2);
ErrorMessagepassword2.setText(message);
} else {
}
else{
ResetParams(ErrorMessagepassword2);
}
if(password.equals(password2) && password2.length() >= 7 && password.length() >= 7 && username.length() >= 5 && lastname.length() >= 3 && firstname.length() >= 2) {
addAccount(firstname, lastname, username, password);
return false;
}
......
......@@ -207,6 +207,7 @@
android:layout_below="@+id/ErrorMessageuserName">
<EditText
android:maxLength="30"
android:id="@+id/username_EditText"
style="@style/input_text_theme"
android:autofillHints=""
......
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