Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Summative_Sam_Markey
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sam.markey
Summative_Sam_Markey
Commits
b5208790
Commit
b5208790
authored
Apr 29, 2021
by
Sam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit v6
parent
8b9503b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
8 deletions
+28
-8
Receipt.java
...c/main/java/com/example/museumworld/checkout/Receipt.java
+8
-6
register.java
...src/main/java/com/example/museumworld/login/register.java
+5
-0
activity_booking.xml
app/src/main/res/layout/activity_booking.xml
+15
-2
No files found.
app/src/main/java/com/example/museumworld/checkout/Receipt.java
View file @
b5208790
...
@@ -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
.
Last
nameG
);
data
.
put
(
"username"
,
MainActivity
.
user
nameG
);
return
data
;
return
data
;
}
}
...
...
app/src/main/java/com/example/museumworld/login/register.java
View file @
b5208790
...
@@ -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
);
...
...
app/src/main/res/layout/activity_booking.xml
View file @
b5208790
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment