Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Simmitive_Chris_Crook
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
chris.crook
Simmitive_Chris_Crook
Commits
4815c6d4
Commit
4815c6d4
authored
Apr 20, 2021
by
chris.crook
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
> basic checkout screen functionality
parent
19c926ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
5 deletions
+43
-5
BookingDetails.java
...ava/com/example/summative_chris_crook/BookingDetails.java
+3
-3
CheckoutScreen.java
...ava/com/example/summative_chris_crook/CheckoutScreen.java
+40
-2
No files found.
app/src/main/java/com/example/summative_chris_crook/BookingDetails.java
View file @
4815c6d4
...
@@ -153,8 +153,8 @@ public class BookingDetails extends AppCompatActivity {
...
@@ -153,8 +153,8 @@ public class BookingDetails extends AppCompatActivity {
// time slot 1
// time slot 1
String
tempwrite
=
((
EditText
)
findViewById
(
R
.
id
.
YEET2
)).
getText
().
toString
();
String
tempwrite
=
((
EditText
)
findViewById
(
R
.
id
.
YEET2
)).
getText
().
toString
();
tempwrite
+=
"&1"
;
tempwrite
+=
"&1"
;
String
[]
temploadarray
=
tempwrite
.
split
(
"&"
);
// id,museum_name,city,country,price,name,password,adminflag,currency,language,id
String
[]
temploadarray
=
tempwrite
.
split
(
"&"
);
// id,museum_name,city,country,price,name,password,adminflag,currency,language,id
,slot
String
filename6
=
"Booking
_"
+
temploadarray
[
5
]
+
temploadarray
[
10
];
// file will be named: Booking_NameID
String
filename6
=
"Booking
"
;
//
+ temploadarray[5] + temploadarray [10]; // file will be named: Booking_NameID
File
file6
;
File
file6
;
file6
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename6
+
".txt"
);
file6
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename6
+
".txt"
);
String
temp
=
""
;
String
temp
=
""
;
...
@@ -169,7 +169,7 @@ public class BookingDetails extends AppCompatActivity {
...
@@ -169,7 +169,7 @@ public class BookingDetails extends AppCompatActivity {
//
//
}
}
else
{
else
{
tempwrite
=
"
%
"
+
tempwrite
;
tempwrite
=
"
&
"
+
tempwrite
;
}
}
try
{
try
{
FileWriter
stream
=
new
FileWriter
(
file6
,
true
);
FileWriter
stream
=
new
FileWriter
(
file6
,
true
);
...
...
app/src/main/java/com/example/summative_chris_crook/CheckoutScreen.java
View file @
4815c6d4
...
@@ -58,7 +58,7 @@ public class CheckoutScreen extends AppCompatActivity {
...
@@ -58,7 +58,7 @@ public class CheckoutScreen extends AppCompatActivity {
//
//
}
}
String
[]
passed
=
temp
.
split
(
"&"
);
// id,name,city,country,price
String
[]
passed
=
temp
.
split
(
"&"
);
// id,name,city,country,price
String
filename6
=
"Booking
_"
+
passed
[
1
]
+
passed
[
0
];
String
filename6
=
"Booking
"
;
//
+ passed[1] + passed[0];
File
file6
;
File
file6
;
file6
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename6
+
".txt"
);
file6
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename6
+
".txt"
);
String
read
=
""
;
String
read
=
""
;
...
@@ -68,7 +68,45 @@ public class CheckoutScreen extends AppCompatActivity {
...
@@ -68,7 +68,45 @@ public class CheckoutScreen extends AppCompatActivity {
read
=
read
+
reader
.
nextLine
();
read
=
read
+
reader
.
nextLine
();
}
}
}
catch
(
Exception
e
)
{
}
}
catch
(
Exception
e
)
{
}
((
EditText
)
findViewById
(
R
.
id
.
outputcheckout
)).
setText
(
read
);
// id,museum_name,city,country,price,name,password,adminflag,currency,language,id,slot
String
[]
loadbooking
=
read
.
split
(
"&"
);
String
bookingoutput
=
"Bookings made:"
;
for
(
int
i
=
0
;
i
<
loadbooking
.
length
;
i
++){
if
(
i
%
12
==
2
){
//museum name
bookingoutput
+=
loadbooking
[
i
];
bookingoutput
+=
", "
;
}
if
(
i
%
12
==
3
){
//city
bookingoutput
+=
"("
;
bookingoutput
+=
loadbooking
[
i
];
bookingoutput
+=
"), "
;
}
if
(
i
%
12
==
9
){
//currency mode to select
}
if
(
i
%
12
==
5
){
//price
bookingoutput
+=
" "
;
String
pricetest
=
loadbooking
[
i
+
4
];
int
price
=
0
;
bookingoutput
+=
loadbooking
[
i
];
bookingoutput
+=
", "
;
}
if
(
i
%
12
==
10
){
//
bookingoutput
+=
loadbooking
[
i
];
bookingoutput
+=
", "
;
}
if
(
i
%
12
==
0
){
//end of each booking entry
bookingoutput
+=
loadbooking
[
i
];
bookingoutput
+=
"\n"
;
bookingoutput
+=
"> "
;
}
}
((
EditText
)
findViewById
(
R
.
id
.
outputcheckout
)).
setText
(
bookingoutput
);
}
}
public
void
gobackfromtheshop
(
View
view
){
public
void
gobackfromtheshop
(
View
view
){
...
...
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