Commit b5208790 authored by Sam's avatar Sam

Commit v6

parent 8b9503b6
......@@ -88,19 +88,21 @@ public class Receipt extends AppCompatActivity implements View.OnClickListener {
Log.d("Receipt", String.valueOf(allQuantities));
Log.d("Receipt", String.valueOf(MainActivity.usernameG));
usersReceipt();
if (allItems.size() > 0) {
for (int i = 0; i < allItems.size(); i++) {
itemsOnReceipt(i);
}
}
}
//creates user receipt of the database
private void usersReceipt() {
StringRequest stringRequest = new StringRequest(Request.Method.POST, userReceiptUrl, (Response.Listener<String>) response -> {
Log.d("responseuserR", response);
if(response.equals("success")) {
if (allItems.size() > 0) {
for (int i = 0; i < allItems.size(); i++) {
itemsOnReceipt(i);
}
}
}
}, error -> Log.d("errorUserReceipt", error.toString())) {
......@@ -108,7 +110,7 @@ public class Receipt extends AppCompatActivity implements View.OnClickListener {
protected Map<String, String> getParams() {
Map<String, String> data = new HashMap<>();
data.put("bookingID", String.valueOf(bookingID));
data.put("username", MainActivity.FirstnameG + " " + MainActivity.LastnameG);
data.put("username", MainActivity.usernameG);
return data;
}
......
......@@ -159,6 +159,11 @@ public class register extends AppCompatActivity implements View.OnClickListener
if (response.equals("success")) {
snackbarAlert("You have successfully registered the account!", false);
Firstname_EditText.setText("");
Lastname_EditText.setText("");
username_EditText.setText("");
password_EditText.setText("");
password_EditText2.setText("");
} else if (response.equals("failure")) {
snackbarAlert("Something Went Wrong!", true);
......
......@@ -185,19 +185,32 @@
android:padding="5dp"
app:cardCornerRadius="15dp">
<RelativeLayout
android:layout_below="@+id/time_label"
android:id="@+id/relSpinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_centerVertical="true"
android:elevation="20dp"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignEnd="@+id/timeSpinner"
android:background="@drawable/dropdown"
/>
<Spinner
android:id="@+id/timeSpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/time_label"
android:background="@color/cream"
android:popupBackground="@color/cream"
/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
......
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