Commit b5208790 authored by Sam's avatar Sam

Commit v6

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