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
19c926ce
Commit
19c926ce
authored
Apr 19, 2021
by
chris.crook
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
> bigboi 2
parent
68f28ee7
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1499 additions
and
53 deletions
+1499
-53
build.gradle
app/build.gradle
+1
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+3
-1
AdminMenu.java
...ain/java/com/example/summative_chris_crook/AdminMenu.java
+112
-0
BookingDetails.java
...ava/com/example/summative_chris_crook/BookingDetails.java
+288
-0
CheckoutScreen.java
...ava/com/example/summative_chris_crook/CheckoutScreen.java
+114
-0
CurrencySelect.java
...ava/com/example/summative_chris_crook/CurrencySelect.java
+155
-0
LanguageSelect.java
...ava/com/example/summative_chris_crook/LanguageSelect.java
+53
-44
MainBookingPage.java
...va/com/example/summative_chris_crook/MainBookingPage.java
+285
-0
Settings.java
...main/java/com/example/summative_chris_crook/Settings.java
+10
-4
UserMenu.java
...main/java/com/example/summative_chris_crook/UserMenu.java
+9
-4
activity_admin_menu.xml
app/src/main/res/layout/activity_admin_menu.xml
+6
-0
activity_booking_details.xml
app/src/main/res/layout/activity_booking_details.xml
+65
-0
activity_checkout_screen.xml
app/src/main/res/layout/activity_checkout_screen.xml
+51
-0
activity_currency_select.xml
app/src/main/res/layout/activity_currency_select.xml
+28
-0
activity_main_booking_page.xml
app/src/main/res/layout/activity_main_booking_page.xml
+319
-0
No files found.
app/build.gradle
View file @
19c926ce
...
...
@@ -33,6 +33,7 @@ dependencies {
implementation
'androidx.appcompat:appcompat:1.2.0'
implementation
'com.google.android.material:material:1.3.0'
implementation
'androidx.constraintlayout:constraintlayout:2.0.4'
implementation
'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation
'junit:junit:4.+'
androidTestImplementation
'androidx.test.ext:junit:1.1.2'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.3.0'
...
...
app/src/main/AndroidManifest.xml
View file @
19c926ce
...
...
@@ -9,7 +9,9 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.Summative_Chris_Crook"
>
<activity
android:name=
".PasswordSettings"
></activity>
<activity
android:name=
".CheckoutScreen"
></activity>
<activity
android:name=
".BookingDetails"
/>
<activity
android:name=
".PasswordSettings"
/>
<activity
android:name=
".CurrencySelect"
/>
<activity
android:name=
".LanguageSelect"
/>
<activity
android:name=
".Settings"
/>
...
...
app/src/main/java/com/example/summative_chris_crook/AdminMenu.java
View file @
19c926ce
...
...
@@ -7,6 +7,8 @@ import android.content.DialogInterface;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.io.File
;
...
...
@@ -19,6 +21,100 @@ public class AdminMenu extends AppCompatActivity {
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_admin_menu
);
String
filename2
=
"appdatatxt"
;
File
file2
;
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
())
{
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
//bugfixing stuff
Toast
.
makeText
(
getApplicationContext
(),
temp
,
Toast
.
LENGTH_LONG
).
show
();
for
(
int
i
=
0
;
i
<
temploadarray
.
length
;
i
++){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
i
],
Toast
.
LENGTH_LONG
).
show
();
}
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
//load english button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
TextView
)
findViewById
(
R
.
id
.
textView4
)).
setText
(
"Main Menu"
);
((
Button
)
findViewById
(
R
.
id
.
button5
)).
setText
(
"Log Out"
);
((
Button
)
findViewById
(
R
.
id
.
button15
)).
setText
(
"Bookings"
);
((
Button
)
findViewById
(
R
.
id
.
button16
)).
setText
(
"Shop"
);
((
Button
)
findViewById
(
R
.
id
.
button17
)).
setText
(
"Cart and checkout"
);
((
Button
)
findViewById
(
R
.
id
.
button24
)).
setText
(
"Settings"
);
((
Button
)
findViewById
(
R
.
id
.
button22
)).
setText
(
"Delete Account"
);
((
TextView
)
findViewById
(
R
.
id
.
textView15
)).
setText
(
"Admin Menu"
);
((
Button
)
findViewById
(
R
.
id
.
button6
)).
setText
(
"Reset app"
);
((
Button
)
findViewById
(
R
.
id
.
button9
)).
setText
(
"Display all logins"
);
((
Button
)
findViewById
(
R
.
id
.
button13
)).
setText
(
"Register page (admin)"
);
((
Button
)
findViewById
(
R
.
id
.
button43
)).
setText
(
"Clear all bookings"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
//load french button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
TextView
)
findViewById
(
R
.
id
.
textView4
)).
setText
(
"Menu principal"
);
((
Button
)
findViewById
(
R
.
id
.
button5
)).
setText
(
"se déconnecter"
);
((
Button
)
findViewById
(
R
.
id
.
button15
)).
setText
(
"réservation"
);
((
Button
)
findViewById
(
R
.
id
.
button16
)).
setText
(
"boutique"
);
((
Button
)
findViewById
(
R
.
id
.
button17
)).
setText
(
"chariot et caisse"
);
((
Button
)
findViewById
(
R
.
id
.
button24
)).
setText
(
"Paramètres"
);
((
Button
)
findViewById
(
R
.
id
.
button22
)).
setText
(
"supprimer le compte"
);
((
TextView
)
findViewById
(
R
.
id
.
textView15
)).
setText
(
"Admin Menu (FR)"
);
((
Button
)
findViewById
(
R
.
id
.
button6
)).
setText
(
"Reset app (FR)"
);
((
Button
)
findViewById
(
R
.
id
.
button9
)).
setText
(
"Display all logins (FR)"
);
((
Button
)
findViewById
(
R
.
id
.
button13
)).
setText
(
"Register page (admin) (FR)"
);
((
Button
)
findViewById
(
R
.
id
.
button43
)).
setText
(
"Clear all bookings (FR)"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
//load spanish button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
TextView
)
findViewById
(
R
.
id
.
textView4
)).
setText
(
"Menú principal"
);
((
Button
)
findViewById
(
R
.
id
.
button5
)).
setText
(
"espalda"
);
((
Button
)
findViewById
(
R
.
id
.
button15
)).
setText
(
"Bookings (ESP)"
);
((
Button
)
findViewById
(
R
.
id
.
button16
)).
setText
(
"Shop (ESP)"
);
((
Button
)
findViewById
(
R
.
id
.
button17
)).
setText
(
"Cart and checkout (ESP)"
);
((
Button
)
findViewById
(
R
.
id
.
button24
)).
setText
(
"Settings (ESP)"
);
((
Button
)
findViewById
(
R
.
id
.
button22
)).
setText
(
"Delete Account (ESP)"
);
((
TextView
)
findViewById
(
R
.
id
.
textView15
)).
setText
(
"Admin Menu (ESP)"
);
((
Button
)
findViewById
(
R
.
id
.
button6
)).
setText
(
"Reset app (ESP)"
);
((
Button
)
findViewById
(
R
.
id
.
button9
)).
setText
(
"Display all logins (ESP)"
);
((
Button
)
findViewById
(
R
.
id
.
button13
)).
setText
(
"Register page (admin) (ESP)"
);
((
Button
)
findViewById
(
R
.
id
.
button43
)).
setText
(
"Clear all bookings (ESP)"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
//load german button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
TextView
)
findViewById
(
R
.
id
.
textView4
)).
setText
(
"Hauptmenü"
);
((
Button
)
findViewById
(
R
.
id
.
button5
)).
setText
(
"rückseite"
);
((
Button
)
findViewById
(
R
.
id
.
button15
)).
setText
(
"Bookings (DE)"
);
((
Button
)
findViewById
(
R
.
id
.
button16
)).
setText
(
"Shop (DE)"
);
((
Button
)
findViewById
(
R
.
id
.
button17
)).
setText
(
"Cart and checkout (DE)"
);
((
Button
)
findViewById
(
R
.
id
.
button24
)).
setText
(
"Settings (DE)"
);
((
Button
)
findViewById
(
R
.
id
.
button22
)).
setText
(
"Delete Account (DE)"
);
((
TextView
)
findViewById
(
R
.
id
.
textView15
)).
setText
(
"Admin Menu (DE)"
);
((
Button
)
findViewById
(
R
.
id
.
button6
)).
setText
(
"Reset app (DE)"
);
((
Button
)
findViewById
(
R
.
id
.
button9
)).
setText
(
"Display all logins (DE)"
);
((
Button
)
findViewById
(
R
.
id
.
button13
)).
setText
(
"Register page (admin) (DE)"
);
((
Button
)
findViewById
(
R
.
id
.
button43
)).
setText
(
"Clear all bookings (DE)"
);
}
else
{
//load a default set of button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
Button
)
findViewById
(
R
.
id
.
button4
)).
setText
(
"Back (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button15
)).
setText
(
"Bookings (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button16
)).
setText
(
"Shop (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button20
)).
setText
(
"Cart and checkout (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button24
)).
setText
(
"Settings (something broke)"
);
((
Button
)
findViewById
(
R
.
id
.
button22
)).
setText
(
"Delete Account (something broke)"
);
((
TextView
)
findViewById
(
R
.
id
.
textView15
)).
setText
(
"Admin Menu"
);
((
Button
)
findViewById
(
R
.
id
.
button6
)).
setText
(
"Reset app"
);
((
Button
)
findViewById
(
R
.
id
.
button9
)).
setText
(
"Display all logins"
);
((
Button
)
findViewById
(
R
.
id
.
button13
)).
setText
(
"Register page (admin)"
);
((
Button
)
findViewById
(
R
.
id
.
button43
)).
setText
(
"Clear all bookings"
);
}
}
public
void
goback
(
View
view
){
...
...
@@ -203,4 +299,20 @@ public class AdminMenu extends AppCompatActivity {
msgbox
.
create
().
show
();
}
public
void
ShutItAllDown
(
View
view
){
Toast
.
makeText
(
getApplicationContext
(),
""
,
Toast
.
LENGTH_SHORT
).
show
();
File
file4
;
String
filename4
=
"Bookings"
;
file4
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename4
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file4
,
false
);
stream
.
append
(
"0%0%0%0&0%0%0%0"
);
stream
.
close
();
Toast
.
makeText
(
getApplicationContext
(),
"Bookings reset"
,
Toast
.
LENGTH_SHORT
).
show
();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"write error"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
\ No newline at end of file
app/src/main/java/com/example/summative_chris_crook/BookingDetails.java
0 → 100644
View file @
19c926ce
package
com
.
example
.
summative_chris_crook
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.EditText
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.io.File
;
import
java.io.FileWriter
;
import
java.text.DecimalFormat
;
import
java.util.Scanner
;
public
class
BookingDetails
extends
AppCompatActivity
{
String
filename5
=
"pass"
;
File
file5
;
Double
Euro
=
1.16
;
Double
USD
=
1.40
;
Double
HKD
=
10.85
;
//private static DecimalFormat df = new DecimalFormat("0.00");
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_booking_details
);
String
filename2
=
"appdatatxt"
;
File
file2
;
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file5
);
while
(
reader
.
hasNextLine
()){
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
){
}
String
[]
passed
=
temp
.
split
(
"&"
);
// id,name,city,country,price
temp
+=
"&"
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
()){
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
){
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
// name,password,adminflag,currency,language,id
String
title
;
for
(
int
i
=
0
;
i
<
temploadarray
.
length
;
i
++){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
i
]
,
Toast
.
LENGTH_LONG
).
show
();
}
String
passedtitle
=
passed
[
1
];
if
(
temploadarray
[
9
].
equals
(
"ENG"
)){
title
=
"Booking for: "
+
passedtitle
;
((
TextView
)
findViewById
(
R
.
id
.
textView24
)).
setText
(
title
);
((
Button
)
findViewById
(
R
.
id
.
button48
)).
setText
(
"Back"
);
}
else
if
(
temploadarray
[
9
].
equals
(
"FRA"
)){
title
=
"Réservation pour: "
+
passedtitle
;
((
TextView
)
findViewById
(
R
.
id
.
textView24
)).
setText
(
title
);
((
Button
)
findViewById
(
R
.
id
.
button48
)).
setText
(
"de retour"
);
}
else
if
(
temploadarray
[
9
].
equals
(
"ESP"
)){
title
=
"Reserva para: "
+
passedtitle
;
((
TextView
)
findViewById
(
R
.
id
.
textView24
)).
setText
(
title
);
((
Button
)
findViewById
(
R
.
id
.
button48
)).
setText
(
"espalda"
);
}
else
if
(
temploadarray
[
9
].
equals
(
"DEU"
)){
title
=
"Buchung für: "
+
passedtitle
;
((
TextView
)
findViewById
(
R
.
id
.
textView24
)).
setText
(
title
);
((
Button
)
findViewById
(
R
.
id
.
button48
)).
setText
(
"rückseite"
);
}
else
{
title
=
"Booking for: (not ENG) "
+
passedtitle
;
((
TextView
)
findViewById
(
R
.
id
.
textView24
)).
setText
(
title
);
((
Button
)
findViewById
(
R
.
id
.
button48
)).
setText
(
"Back"
);
}
((
EditText
)
findViewById
(
R
.
id
.
YEET2
)).
setText
(
temp
);
String
button1
=
"9:00-11:00"
;
String
button2
=
"11:00-13:00"
;
String
button3
=
"13:00-15:00"
;
String
button4
=
"15:00-17:00"
;
if
(
temploadarray
[
8
].
equals
(
"£"
))
{
button1
=
button1
+
" £"
+
temploadarray
[
4
];
button2
=
button2
+
" £"
+
temploadarray
[
4
];
button3
=
button3
+
" £"
+
temploadarray
[
4
];
button4
=
button4
+
" £"
+
temploadarray
[
4
];
((
Button
)
findViewById
(
R
.
id
.
button57
)).
setText
(
button1
);
((
Button
)
findViewById
(
R
.
id
.
button58
)).
setText
(
button2
);
((
Button
)
findViewById
(
R
.
id
.
button59
)).
setText
(
button3
);
((
Button
)
findViewById
(
R
.
id
.
button60
)).
setText
(
button4
);
}
else
if
(
temploadarray
[
8
].
equals
(
"€"
))
{
button1
=
button1
+
" €"
+
(
Integer
.
parseInt
(
temploadarray
[
4
])*
Euro
);
button2
=
button2
+
" €"
+
(
Integer
.
parseInt
(
temploadarray
[
4
])*
Euro
);
button3
=
button3
+
" €"
+
(
Integer
.
parseInt
(
temploadarray
[
4
])*
Euro
);
button4
=
button4
+
" €"
+
(
Integer
.
parseInt
(
temploadarray
[
4
])*
Euro
);
((
Button
)
findViewById
(
R
.
id
.
button57
)).
setText
(
button1
);
((
Button
)
findViewById
(
R
.
id
.
button58
)).
setText
(
button2
);
((
Button
)
findViewById
(
R
.
id
.
button59
)).
setText
(
button3
);
((
Button
)
findViewById
(
R
.
id
.
button60
)).
setText
(
button4
);
}
else
if
(
temploadarray
[
8
].
equals
(
"US$"
))
{
button1
=
button1
+
" $"
+
(
Integer
.
parseInt
(
temploadarray
[
4
])*
USD
);
button2
=
button2
+
" $"
+
(
Integer
.
parseInt
(
temploadarray
[
4
])*
USD
);
button3
=
button3
+
" $"
+
(
Integer
.
parseInt
(
temploadarray
[
4
])*
USD
);
button4
=
button4
+
" $"
+
(
Integer
.
parseInt
(
temploadarray
[
4
])*
USD
);
((
Button
)
findViewById
(
R
.
id
.
button57
)).
setText
(
button1
);
((
Button
)
findViewById
(
R
.
id
.
button58
)).
setText
(
button2
);
((
Button
)
findViewById
(
R
.
id
.
button59
)).
setText
(
button3
);
((
Button
)
findViewById
(
R
.
id
.
button60
)).
setText
(
button4
);
}
else
if
(
temploadarray
[
8
].
equals
(
"HK$"
))
{
button1
=
button1
+
" $"
+
(
Integer
.
parseInt
(
temploadarray
[
4
])*
HKD
);
button2
=
button2
+
" $"
+
(
Integer
.
parseInt
(
temploadarray
[
4
])*
HKD
);
button3
=
button3
+
" $"
+
(
Integer
.
parseInt
(
temploadarray
[
4
])*
HKD
);
button4
=
button4
+
" $"
+
(
Integer
.
parseInt
(
temploadarray
[
4
])*
HKD
);
((
Button
)
findViewById
(
R
.
id
.
button57
)).
setText
(
button1
);
((
Button
)
findViewById
(
R
.
id
.
button58
)).
setText
(
button2
);
((
Button
)
findViewById
(
R
.
id
.
button59
)).
setText
(
button3
);
((
Button
)
findViewById
(
R
.
id
.
button60
)).
setText
(
button4
);
}
else
{
//
}
}
public
void
goback
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
MainBookingPage
.
class
);
startActivity
(
intent
);
}
public
void
timeslot1
(
View
view
){
// time slot 1
String
tempwrite
=
((
EditText
)
findViewById
(
R
.
id
.
YEET2
)).
getText
().
toString
();
tempwrite
+=
"&1"
;
String
[]
temploadarray
=
tempwrite
.
split
(
"&"
);
// id,museum_name,city,country,price,name,password,adminflag,currency,language,id
String
filename6
=
"Booking_"
+
temploadarray
[
5
]
+
temploadarray
[
10
];
// file will be named: Booking_NameID
File
file6
;
file6
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename6
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file6
);
while
(
reader
.
hasNextLine
()){
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
){
}
if
(
temp
.
equals
(
""
)){
//
}
else
{
tempwrite
=
"%"
+
tempwrite
;
}
try
{
FileWriter
stream
=
new
FileWriter
(
file6
,
true
);
stream
.
append
(
tempwrite
);
stream
.
close
();
Toast
.
makeText
(
getApplicationContext
(),
"Booking made"
,
Toast
.
LENGTH_LONG
).
show
();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
public
void
timeslot2
(
View
view
){
// time slot 2
String
tempwrite
=
((
EditText
)
findViewById
(
R
.
id
.
YEET2
)).
getText
().
toString
();
tempwrite
+=
"&2"
;
String
[]
temploadarray
=
tempwrite
.
split
(
"&"
);
// id,museum_name,city,country,price,name,password,adminflag,currency,language,id
String
filename6
=
"Booking_"
+
temploadarray
[
5
]
+
temploadarray
[
10
];
// file will be named: Booking_NameID
File
file6
;
file6
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename6
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file6
);
while
(
reader
.
hasNextLine
()){
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
){
}
if
(
temp
.
equals
(
""
)){
//
}
else
{
tempwrite
=
"%"
+
tempwrite
;
}
try
{
FileWriter
stream
=
new
FileWriter
(
file6
,
true
);
stream
.
append
(
tempwrite
);
stream
.
close
();
Toast
.
makeText
(
getApplicationContext
(),
"Booking made"
,
Toast
.
LENGTH_LONG
).
show
();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
public
void
timeslot3
(
View
view
){
// time slot 3
String
tempwrite
=
((
EditText
)
findViewById
(
R
.
id
.
YEET2
)).
getText
().
toString
();
tempwrite
+=
"&3"
;
String
[]
temploadarray
=
tempwrite
.
split
(
"&"
);
// id,museum_name,city,country,price,name,password,adminflag,currency,language,id
String
filename6
=
"Booking_"
+
temploadarray
[
5
]
+
temploadarray
[
10
];
// file will be named: Booking_NameID
File
file6
;
file6
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename6
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file6
);
while
(
reader
.
hasNextLine
()){
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
){
}
if
(
temp
.
equals
(
""
)){
//
}
else
{
tempwrite
=
"%"
+
tempwrite
;
}
try
{
FileWriter
stream
=
new
FileWriter
(
file6
,
true
);
stream
.
append
(
tempwrite
);
stream
.
close
();
Toast
.
makeText
(
getApplicationContext
(),
"Booking made"
,
Toast
.
LENGTH_LONG
).
show
();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
public
void
timeslot4
(
View
view
){
// time slot 4
String
tempwrite
=
((
EditText
)
findViewById
(
R
.
id
.
YEET2
)).
getText
().
toString
();
tempwrite
+=
"&4"
;
String
[]
temploadarray
=
tempwrite
.
split
(
"&"
);
// id,museum_name,city,country,price,name,password,adminflag,currency,language,id
String
filename6
=
"Booking_"
+
temploadarray
[
5
]
+
temploadarray
[
10
];
// file will be named: Booking_NameID
File
file6
;
file6
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename6
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file6
);
while
(
reader
.
hasNextLine
()){
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
){
}
if
(
temp
.
equals
(
""
)){
//
}
else
{
tempwrite
=
"%"
+
tempwrite
;
}
try
{
FileWriter
stream
=
new
FileWriter
(
file6
,
true
);
stream
.
append
(
tempwrite
);
stream
.
close
();
Toast
.
makeText
(
getApplicationContext
(),
"Booking made"
,
Toast
.
LENGTH_LONG
).
show
();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
}
\ No newline at end of file
app/src/main/java/com/example/summative_chris_crook/CheckoutScreen.java
0 → 100644
View file @
19c926ce
package
com
.
example
.
summative_chris_crook
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.EditText
;
import
android.widget.TextView
;
import
java.io.File
;
import
java.util.Scanner
;
public
class
CheckoutScreen
extends
AppCompatActivity
{
String
filename1
=
"magicwords"
;
String
filename2
=
"appdatatxt"
;
File
file1
;
File
file2
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_checkout_screen
);
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
())
{
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
//
((
TextView
)
findViewById
(
R
.
id
.
textView23
)).
setText
(
"Checkout"
);
((
Button
)
findViewById
(
R
.
id
.
button62
)).
setText
(
"Back"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
//
((
TextView
)
findViewById
(
R
.
id
.
textView23
)).
setText
(
"chariot et caisse"
);
((
Button
)
findViewById
(
R
.
id
.
button62
)).
setText
(
"de retour"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
//
((
TextView
)
findViewById
(
R
.
id
.
textView23
)).
setText
(
"Checkout (ESP)"
);
((
Button
)
findViewById
(
R
.
id
.
button62
)).
setText
(
"espalda"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
//
((
TextView
)
findViewById
(
R
.
id
.
textView23
)).
setText
(
"Checkout (DE)"
);
((
Button
)
findViewById
(
R
.
id
.
button62
)).
setText
(
"rückseite"
);
}
else
{
//
}
String
[]
passed
=
temp
.
split
(
"&"
);
// id,name,city,country,price
String
filename6
=
"Booking_"
+
passed
[
1
]
+
passed
[
0
];
File
file6
;
file6
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename6
+
".txt"
);
String
read
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file6
);
while
(
reader
.
hasNextLine
())
{
read
=
read
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
}
((
EditText
)
findViewById
(
R
.
id
.
outputcheckout
)).
setText
(
read
);
}
public
void
gobackfromtheshop
(
View
view
){
//
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
())
{
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
if
(
temploadarray
[
2
].
equals
(
"ADMIN"
)){
Intent
intent
=
new
Intent
(
this
,
AdminMenu
.
class
);
startActivity
(
intent
);
return
;
}
else
if
(
temploadarray
[
2
].
equals
(
"SUPER"
)){
Intent
intent
=
new
Intent
(
this
,
AdminMenu
.
class
);
startActivity
(
intent
);
return
;
}
else
{
Intent
intent
=
new
Intent
(
this
,
UserMenu
.
class
);
startActivity
(
intent
);
return
;
}
}
public
void
toshop
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
MainShopPage
.
class
);
startActivity
(
intent
);
}
public
void
tobookings
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
MainBookingPage
.
class
);
startActivity
(
intent
);
}
}
\ No newline at end of file
app/src/main/java/com/example/summative_chris_crook/CurrencySelect.java
View file @
19c926ce
...
...
@@ -6,9 +6,11 @@ import android.content.Intent;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.io.File
;
import
java.io.FileWriter
;
import
java.util.Scanner
;
public
class
CurrencySelect
extends
AppCompatActivity
{
...
...
@@ -36,22 +38,31 @@ public class CurrencySelect extends AppCompatActivity {
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
TextView
)
findViewById
(
R
.
id
.
textView19
)).
setText
(
"Currency Selection"
);
((
Button
)
findViewById
(
R
.
id
.
button35
)).
setText
(
"Back"
);
// ((Button)findViewById(R.id.button38)).setText("Pounds (£)");
// ((Button)findViewById(R.id.button39)).setText("Back");
// ((Button)findViewById(R.id.button40)).setText("Back");
// ((Button)findViewById(R.id.button41)).setText("Back");
}
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
TextView
)
findViewById
(
R
.
id
.
textView19
)).
setText
(
"Paramètres de devise"
);
((
Button
)
findViewById
(
R
.
id
.
button35
)).
setText
(
"de retour"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
TextView
)
findViewById
(
R
.
id
.
textView19
)).
setText
(
"Configuración de divisas"
);
((
Button
)
findViewById
(
R
.
id
.
button35
)).
setText
(
"espalda"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
TextView
)
findViewById
(
R
.
id
.
textView19
)).
setText
(
"Währungseinstellungen"
);
((
Button
)
findViewById
(
R
.
id
.
button35
)).
setText
(
"rückseite"
);
}
else
{
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
TextView
)
findViewById
(
R
.
id
.
textView19
)).
setText
(
"Currency Selection"
);
((
Button
)
findViewById
(
R
.
id
.
button35
)).
setText
(
"Back (something broke)"
);
}
}
...
...
@@ -60,4 +71,148 @@ public class CurrencySelect extends AppCompatActivity {
Intent
intent
=
new
Intent
(
this
,
Settings
.
class
);
startActivity
(
intent
);
}
public
void
PoundMe
(
View
view
){
String
filename2
=
"appdatatxt"
;
File
file2
;
//
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
())
{
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
//format: name,password,adminflag,currency,language
temploadarray
[
3
]
=
"£"
;
String
writetotemp
=
""
;
for
(
int
i
=
0
;
i
<
temploadarray
.
length
;
i
++){
writetotemp
+=
temploadarray
[
i
];
if
(
i
<
(
temploadarray
.
length
)-
1
){
writetotemp
+=
"&"
;
}
}
try
{
FileWriter
stream
=
new
FileWriter
(
file2
,
false
);
stream
.
append
(
writetotemp
);
stream
.
close
();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
public
void
EuroVision
(
View
view
){
String
filename2
=
"appdatatxt"
;
File
file2
;
//
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
())
{
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
//format: name,password,adminflag,currency,language
temploadarray
[
3
]
=
"€"
;
String
writetotemp
=
""
;
for
(
int
i
=
0
;
i
<
temploadarray
.
length
;
i
++){
writetotemp
+=
temploadarray
[
i
];
if
(
i
<
(
temploadarray
.
length
)-
1
){
writetotemp
+=
"&"
;
}
}
try
{
FileWriter
stream
=
new
FileWriter
(
file2
,
false
);
stream
.
append
(
writetotemp
);
stream
.
close
();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
public
void
ThisIsAmerica
(
View
view
){
String
filename2
=
"appdatatxt"
;
File
file2
;
//
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
())
{
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
//format: name,password,adminflag,currency,language
temploadarray
[
3
]
=
"US$"
;
String
writetotemp
=
""
;
for
(
int
i
=
0
;
i
<
temploadarray
.
length
;
i
++){
writetotemp
+=
temploadarray
[
i
];
if
(
i
<
(
temploadarray
.
length
)-
1
){
writetotemp
+=
"&"
;
}
}
try
{
FileWriter
stream
=
new
FileWriter
(
file2
,
false
);
stream
.
append
(
writetotemp
);
stream
.
close
();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
public
void
BestDisneyland
(
View
view
){
String
filename2
=
"appdatatxt"
;
File
file2
;
//
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file2
);
while
(
reader
.
hasNextLine
())
{
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
)
{
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
String
[]
temploadarray
=
temp
.
split
(
"&"
);
//format: name,password,adminflag,currency,language
temploadarray
[
3
]
=
"HK$"
;
String
writetotemp
=
""
;
for
(
int
i
=
0
;
i
<
temploadarray
.
length
;
i
++){
writetotemp
+=
temploadarray
[
i
];
if
(
i
<
(
temploadarray
.
length
)-
1
){
writetotemp
+=
"&"
;
}
}
try
{
FileWriter
stream
=
new
FileWriter
(
file2
,
false
);
stream
.
append
(
writetotemp
);
stream
.
close
();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
}
\ No newline at end of file
app/src/main/java/com/example/summative_chris_crook/LanguageSelect.java
View file @
19c926ce
...
...
@@ -6,6 +6,7 @@ import android.content.Intent;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.io.File
;
...
...
@@ -45,6 +46,7 @@ public class LanguageSelect extends AppCompatActivity {
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
//Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView18
)).
setText
(
"Language Settings"
);
((
Button
)
findViewById
(
R
.
id
.
button31
)).
setText
(
"Back"
);
((
Button
)
findViewById
(
R
.
id
.
button32
)).
setText
(
"English"
);
((
Button
)
findViewById
(
R
.
id
.
button33
)).
setText
(
"French (Français)"
);
...
...
@@ -53,6 +55,7 @@ public class LanguageSelect extends AppCompatActivity {
}
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
//Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView18
)).
setText
(
"Sélectionnez la langue"
);
((
Button
)
findViewById
(
R
.
id
.
button31
)).
setText
(
"de retour"
);
((
Button
)
findViewById
(
R
.
id
.
button32
)).
setText
(
"Anglais (English)"
);
((
Button
)
findViewById
(
R
.
id
.
button33
)).
setText
(
"Français"
);
...
...
@@ -61,6 +64,7 @@ public class LanguageSelect extends AppCompatActivity {
}
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
//Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView18
)).
setText
(
"Selección de idioma"
);
((
Button
)
findViewById
(
R
.
id
.
button31
)).
setText
(
"espalda"
);
((
Button
)
findViewById
(
R
.
id
.
button32
)).
setText
(
"Inglés (English)"
);
((
Button
)
findViewById
(
R
.
id
.
button33
)).
setText
(
"Francés (Français)"
);
...
...
@@ -69,6 +73,7 @@ public class LanguageSelect extends AppCompatActivity {
}
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
//Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView18
)).
setText
(
"Spracheinstellungen"
);
((
Button
)
findViewById
(
R
.
id
.
button31
)).
setText
(
"rückseite"
);
((
Button
)
findViewById
(
R
.
id
.
button32
)).
setText
(
"Englisch (English)"
);
((
Button
)
findViewById
(
R
.
id
.
button33
)).
setText
(
"Französisch (Français)"
);
...
...
@@ -139,6 +144,7 @@ public class LanguageSelect extends AppCompatActivity {
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
((
TextView
)
findViewById
(
R
.
id
.
textView18
)).
setText
(
"Language Settings"
);
((
Button
)
findViewById
(
R
.
id
.
button31
)).
setText
(
"Back"
);
((
Button
)
findViewById
(
R
.
id
.
button32
)).
setText
(
"English"
);
((
Button
)
findViewById
(
R
.
id
.
button33
)).
setText
(
"French (Français)"
);
...
...
@@ -189,15 +195,15 @@ public class LanguageSelect extends AppCompatActivity {
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
magicwords
[
i
][
0
]
=
temploadarray
[
i
];
// splits by user
}
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
String
[]
sort
=
temploadarray
[
i
].
split
(
"&"
);
magicwords
[
i
][
1
]
=
sort
[
0
];
// name of user
magicwords
[
i
][
2
]
=
sort
[
1
];
// username
magicwords
[
i
][
3
]
=
sort
[
2
];
// password
magicwords
[
i
][
4
]
=
sort
[
3
];
// admin flag
magicwords
[
i
][
5
]
=
sort
[
4
];
// currency mode
magicwords
[
i
][
6
]
=
sort
[
5
];
// language
}
//
for (int i = 0; i < size; i++) {
//
String[] sort = temploadarray[i].split("&");
//
magicwords[i][1] = sort[0]; // name of user
//
magicwords[i][2] = sort[1]; // username
//
magicwords[i][3] = sort[2]; // password
//
magicwords[i][4] = sort[3]; // admin flag
//
magicwords[i][5] = sort[4]; // currency mode
//
magicwords[i][6] = sort[5]; // language
//
}
// for (int i = 0; i < 50; i++) {
// if (magicwords[i][0].equals("END")) {
// // end marker found
...
...
@@ -209,7 +215,7 @@ public class LanguageSelect extends AppCompatActivity {
// find user and replace
magicwords
[
Integer
.
parseInt
(
hold
[
5
])]
[
6
]
=
"ENG"
;
try
{
/*
try{
FileWriter stream = new FileWriter(file1, false);
stream.append("");
stream.close();
...
...
@@ -236,7 +242,7 @@ public class LanguageSelect extends AppCompatActivity {
stream.close();
} catch(Exception e){
Toast.makeText(getApplicationContext(), "Internal File Error", Toast.LENGTH_LONG).show();
}
}
*/
}
public
void
WhiteFlagsAgain
(
View
view
){
...
...
@@ -274,6 +280,7 @@ public class LanguageSelect extends AppCompatActivity {
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
((
TextView
)
findViewById
(
R
.
id
.
textView18
)).
setText
(
"Sélectionnez la langue"
);
((
Button
)
findViewById
(
R
.
id
.
button31
)).
setText
(
"de retour"
);
((
Button
)
findViewById
(
R
.
id
.
button32
)).
setText
(
"Anglais (English)"
);
((
Button
)
findViewById
(
R
.
id
.
button33
)).
setText
(
"Français"
);
...
...
@@ -324,15 +331,15 @@ public class LanguageSelect extends AppCompatActivity {
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
magicwords
[
i
][
0
]
=
temploadarray
[
i
];
// splits by user
}
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
String
[]
sort
=
temploadarray
[
i
].
split
(
"&"
);
magicwords
[
i
][
1
]
=
sort
[
0
];
// name of user
magicwords
[
i
][
2
]
=
sort
[
1
];
// username
magicwords
[
i
][
3
]
=
sort
[
2
];
// password
magicwords
[
i
][
4
]
=
sort
[
3
];
// admin flag
magicwords
[
i
][
5
]
=
sort
[
4
];
// currency mode
magicwords
[
i
][
6
]
=
sort
[
5
];
// language
}
//
for (int i = 0; i < size; i++) {
//
String[] sort = temploadarray[i].split("&");
//
magicwords[i][1] = sort[0]; // name of user
//
magicwords[i][2] = sort[1]; // username
//
magicwords[i][3] = sort[2]; // password
//
magicwords[i][4] = sort[3]; // admin flag
//
magicwords[i][5] = sort[4]; // currency mode
//
magicwords[i][6] = sort[5]; // language
//
}
// for (int i = 0; i < 50; i++) {
// if (magicwords[i][0].equals("END")) {
// // end marker found
...
...
@@ -344,7 +351,7 @@ public class LanguageSelect extends AppCompatActivity {
// find user and replace
magicwords
[
Integer
.
parseInt
(
hold
[
5
])]
[
6
]
=
"FRA"
;
try
{
/*
try{
FileWriter stream = new FileWriter(file1, false);
stream.append("");
stream.close();
...
...
@@ -371,7 +378,7 @@ public class LanguageSelect extends AppCompatActivity {
stream.close();
} catch(Exception e){
Toast.makeText(getApplicationContext(), "Internal File Error", Toast.LENGTH_LONG).show();
}
}
*/
}
public
void
TortillasAreBeMySecondFavoriteFood
(
View
view
){
...
...
@@ -405,6 +412,7 @@ public class LanguageSelect extends AppCompatActivity {
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
((
TextView
)
findViewById
(
R
.
id
.
textView18
)).
setText
(
"Selección de idioma"
);
((
Button
)
findViewById
(
R
.
id
.
button31
)).
setText
(
"espalda"
);
((
Button
)
findViewById
(
R
.
id
.
button32
)).
setText
(
"Inglés (English)"
);
((
Button
)
findViewById
(
R
.
id
.
button33
)).
setText
(
"Francés (Français)"
);
...
...
@@ -433,15 +441,15 @@ public class LanguageSelect extends AppCompatActivity {
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
magicwords
[
i
][
0
]
=
temploadarray
[
i
];
// splits by user
}
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
String
[]
sort
=
temploadarray
[
i
].
split
(
"&"
);
magicwords
[
i
][
1
]
=
sort
[
0
];
// name of user
magicwords
[
i
][
2
]
=
sort
[
1
];
// username
magicwords
[
i
][
3
]
=
sort
[
2
];
// password
magicwords
[
i
][
4
]
=
sort
[
3
];
// admin flag
magicwords
[
i
][
5
]
=
sort
[
4
];
// currency mode
magicwords
[
i
][
6
]
=
sort
[
5
];
// language
}
//
for (int i = 0; i < size; i++) {
//
String[] sort = temploadarray[i].split("&");
//
magicwords[i][1] = sort[0]; // name of user
//
magicwords[i][2] = sort[1]; // username
//
magicwords[i][3] = sort[2]; // password
//
magicwords[i][4] = sort[3]; // admin flag
//
magicwords[i][5] = sort[4]; // currency mode
//
magicwords[i][6] = sort[5]; // language
//
}
// for (int i = 0; i < sizeoverride; i++) {
// if (magicwords[i][0].equals("END")) {
// // end marker found
...
...
@@ -455,7 +463,7 @@ public class LanguageSelect extends AppCompatActivity {
// find user and replace
magicwords
[
Integer
.
parseInt
(
hold
[
5
])]
[
6
]
=
"ESP"
;
try
{
/*
try{
FileWriter stream = new FileWriter(file1, false);
stream.append("");
stream.close();
...
...
@@ -482,7 +490,7 @@ public class LanguageSelect extends AppCompatActivity {
stream.close();
} catch(Exception e){
Toast.makeText(getApplicationContext(), "Internal File Error", Toast.LENGTH_LONG).show();
}
}
*/
}
public
void
MoreReliableThanATigerII
(
View
view
){
...
...
@@ -516,6 +524,7 @@ public class LanguageSelect extends AppCompatActivity {
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
((
TextView
)
findViewById
(
R
.
id
.
textView18
)).
setText
(
"Spracheinstellungen"
);
((
Button
)
findViewById
(
R
.
id
.
button31
)).
setText
(
"rückseite"
);
((
Button
)
findViewById
(
R
.
id
.
button32
)).
setText
(
"Englisch (English)"
);
((
Button
)
findViewById
(
R
.
id
.
button33
)).
setText
(
"Französisch (Français)"
);
...
...
@@ -544,15 +553,15 @@ public class LanguageSelect extends AppCompatActivity {
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
magicwords
[
i
][
0
]
=
temploadarray
[
i
];
// splits by user
}
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
String
[]
sort
=
temploadarray
[
i
].
split
(
"&"
);
magicwords
[
i
][
1
]
=
sort
[
0
];
// name of user
magicwords
[
i
][
2
]
=
sort
[
1
];
// username
magicwords
[
i
][
3
]
=
sort
[
2
];
// password
magicwords
[
i
][
4
]
=
sort
[
3
];
// admin flag
magicwords
[
i
][
5
]
=
sort
[
4
];
// currency mode
magicwords
[
i
][
6
]
=
sort
[
5
];
// language
}
//
for (int i = 0; i < size; i++) {
//
String[] sort = temploadarray[i].split("&");
//
magicwords[i][1] = sort[0]; // name of user
//
magicwords[i][2] = sort[1]; // username
//
magicwords[i][3] = sort[2]; // password
//
magicwords[i][4] = sort[3]; // admin flag
//
magicwords[i][5] = sort[4]; // currency mode
//
magicwords[i][6] = sort[5]; // language
//
}
// for (int i = 0; i < sizeoverride; i++) {
// if (magicwords[i][0].equals("END")) {
// // end marker found
...
...
@@ -566,7 +575,7 @@ public class LanguageSelect extends AppCompatActivity {
// find user and replace
magicwords
[
Integer
.
parseInt
(
hold
[
5
])]
[
6
]
=
"DEU"
;
try
{
/*
try{
FileWriter stream = new FileWriter(file1, false);
stream.append("");
stream.close();
...
...
@@ -593,6 +602,6 @@ public class LanguageSelect extends AppCompatActivity {
stream.close();
} catch(Exception e){
Toast.makeText(getApplicationContext(), "Internal File Error", Toast.LENGTH_LONG).show();
}
}
*/
}
}
\ No newline at end of file
app/src/main/java/com/example/summative_chris_crook/MainBookingPage.java
View file @
19c926ce
package
com
.
example
.
summative_chris_crook
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.EditText
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.io.File
;
import
java.io.FileWriter
;
import
java.util.Scanner
;
public
class
MainBookingPage
extends
AppCompatActivity
{
...
...
@@ -22,6 +28,9 @@ public class MainBookingPage extends AppCompatActivity {
String
tempload
=
""
;
String
[]
[]
magicwords
=
new
String
[
sizeoverride
]
[
7
];
// storage of the login info
Button
button
;
RelativeLayout
.
LayoutParams
layoutparams
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
...
...
@@ -40,24 +49,52 @@ public class MainBookingPage extends AppCompatActivity {
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
TextView
)
findViewById
(
R
.
id
.
textView14
)).
setText
(
"Bookings"
);
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"Back"
);
((
TextView
)
findViewById
(
R
.
id
.
textView21
)).
setText
(
"Search for museums"
);
((
Button
)
findViewById
(
R
.
id
.
button42
)).
setText
(
"Search"
);
((
Button
)
findViewById
(
R
.
id
.
button56
)).
setText
(
"Shop"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
TextView
)
findViewById
(
R
.
id
.
textView14
)).
setText
(
"Menu de réservation"
);
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"de retour"
);
((
TextView
)
findViewById
(
R
.
id
.
textView21
)).
setText
(
"Search for museums"
);
((
Button
)
findViewById
(
R
.
id
.
button42
)).
setText
(
"Search"
);
((
Button
)
findViewById
(
R
.
id
.
button56
)).
setText
(
"Shop"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
TextView
)
findViewById
(
R
.
id
.
textView14
)).
setText
(
"Menú de reserva"
);
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"espalda"
);
((
TextView
)
findViewById
(
R
.
id
.
textView21
)).
setText
(
"Search for museums"
);
((
Button
)
findViewById
(
R
.
id
.
button42
)).
setText
(
"Search"
);
((
Button
)
findViewById
(
R
.
id
.
button56
)).
setText
(
"Shop"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
TextView
)
findViewById
(
R
.
id
.
textView14
)).
setText
(
"Buchungsmenü"
);
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"rückseite"
);
((
TextView
)
findViewById
(
R
.
id
.
textView21
)).
setText
(
"Suche nach Museum"
);
((
Button
)
findViewById
(
R
.
id
.
button42
)).
setText
(
"durchsuchung"
);
((
Button
)
findViewById
(
R
.
id
.
button56
)).
setText
(
"kaufhaus"
);
}
else
{
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
TextView
)
findViewById
(
R
.
id
.
textView14
)).
setText
(
"Back"
);
((
Button
)
findViewById
(
R
.
id
.
button14
)).
setText
(
"Back (something broke)"
);
((
TextView
)
findViewById
(
R
.
id
.
textView21
)).
setText
(
"Search for museums"
);
((
Button
)
findViewById
(
R
.
id
.
button42
)).
setText
(
"Search"
);
((
Button
)
findViewById
(
R
.
id
.
button56
)).
setText
(
"Shop"
);
}
// button = (Button)findViewById(R.id.button44);
//
// layoutparams = (RelativeLayout.LayoutParams) button.getLayoutParams();
//
// layoutparams.height = 10;
}
public
String
openandload
(){
...
...
@@ -176,4 +213,252 @@ public class MainBookingPage extends AppCompatActivity {
return
;
}
}
public
void
toshop
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
MainShopPage
.
class
);
startActivity
(
intent
);
}
public
void
tocart
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
CheckoutScreen
.
class
);
startActivity
(
intent
);
}
public
void
saaavveeeemeeeee
(
String
data
){
//save to a new .txt temp file
String
filename3
=
"tempstorage"
;
File
file3
;
file3
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename3
+
".txt"
);
String
temp
=
""
;
try
{
Scanner
reader
=
new
Scanner
(
file1
);
while
(
reader
.
hasNextLine
()){
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"File Error"
,
Toast
.
LENGTH_SHORT
).
show
();
try
{
FileWriter
stream
=
new
FileWriter
(
file1
,
true
);
stream
.
append
(
""
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
if
(
temp
.
equals
(
""
)){
//
}
else
{
temp
+=
"#"
;
}
if
(
data
.
equals
(
""
)){
return
;
}
temp
+=
data
;
try
{
FileWriter
stream
=
new
FileWriter
(
file1
,
true
);
stream
.
append
(
temp
);
stream
.
close
();
//Toast.makeText(getApplicationContext(), "Booking made", Toast.LENGTH_LONG).show();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
public
void
Lbook
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"01&Louvre&Paris&France&10"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
BookingDetails
.
class
);
startActivity
(
intent
);
// AlertDialog.Builder builder = new AlertDialog.Builder(this);
// builder.setTitle("Choose a time slot");
// String [] options1 = {"9:00-11:00","11:00-13:00","13:00-15:00","15:00-17:00","Cancel"};
// builder.setItems(options1, new DialogInterface.OnClickListener() {
// @Override
// public void onClick(DialogInterface dialog, int which) {
// switch (which) {
// case 0:
// // time slot 1 selected
// ((EditText)findViewById(R.id.YEET)).setText("1");
// case 1:
// // time slot 2 selected
// ((EditText)findViewById(R.id.YEET)).setText("2");
// case 2:
// // time slot 3 selected
// ((EditText)findViewById(R.id.YEET)).setText("3");
// case 3:
// // time slot 4 selected
// ((EditText)findViewById(R.id.YEET)).setText("4");
// case 4:
// // time slot 4 selected
// //((EditText)findViewById(R.id.YEET)).setText("4");
// return;
// }
// }
// });
// AlertDialog dialog = builder.create();
// dialog.show();
// String save = ((EditText) findViewById(R.id.YEET)).getText().toString();
// save += "&01&Louvre&Paris&France&10";
// saaavveeeemeeeee(save);
}
public
void
NMOCbook
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"02&National Museum of China&Beijing&China&10"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
BookingDetails
.
class
);
startActivity
(
intent
);
}
public
void
VMbook
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"03&Vatican Museums&Vatican City&Vatican&10"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
BookingDetails
.
class
);
startActivity
(
intent
);
}
public
void
MMOAbook
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"04&Metropolitan Museum of Art&New York City&USA&10"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
BookingDetails
.
class
);
startActivity
(
intent
);
}
public
void
BMbook
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"05&British Museums&London&UK&10"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
BookingDetails
.
class
);
startActivity
(
intent
);
}
public
void
TMbook
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"06&Tate Modern&London&UK&5"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
BookingDetails
.
class
);
startActivity
(
intent
);
}
public
void
NGbook
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"07&National Gallery&London&UK&5"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
BookingDetails
.
class
);
startActivity
(
intent
);
}
public
void
NHMbook
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"08&Natural History Museum&London&UK&5"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
BookingDetails
.
class
);
startActivity
(
intent
);
}
public
void
AMONHbook
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"09&American Museum of Natural History&New York City&USA&5"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
BookingDetails
.
class
);
startActivity
(
intent
);
}
public
void
SHMbook
(
View
view
){
String
filename5
=
"pass"
;
File
file5
;
file5
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename5
+
".txt"
);
try
{
FileWriter
stream
=
new
FileWriter
(
file5
,
false
);
stream
.
append
(
"10&State Hermitage Museum&Saint Petersburg&Russia&5"
);
stream
.
close
();
}
catch
(
Exception
f
){
Toast
.
makeText
(
getApplicationContext
(),
"Internal File Error"
,
Toast
.
LENGTH_LONG
).
show
();
}
Intent
intent
=
new
Intent
(
this
,
BookingDetails
.
class
);
startActivity
(
intent
);
}
}
\ No newline at end of file
app/src/main/java/com/example/summative_chris_crook/Settings.java
View file @
19c926ce
...
...
@@ -6,6 +6,7 @@ import android.content.Intent;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.io.File
;
...
...
@@ -35,7 +36,8 @@ public class Settings extends AppCompatActivity {
String
[]
temploadarray
=
temp
.
split
(
"&"
);
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView16
)).
setText
(
"Settings"
);
((
Button
)
findViewById
(
R
.
id
.
button25
)).
setText
(
"Back"
);
((
Button
)
findViewById
(
R
.
id
.
button27
)).
setText
(
"Language"
);
((
Button
)
findViewById
(
R
.
id
.
button28
)).
setText
(
"Currency"
);
...
...
@@ -43,7 +45,8 @@ public class Settings extends AppCompatActivity {
((
Button
)
findViewById
(
R
.
id
.
button30
)).
setText
(
"Details"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView16
)).
setText
(
"Paramètres"
);
((
Button
)
findViewById
(
R
.
id
.
button25
)).
setText
(
"de retour"
);
((
Button
)
findViewById
(
R
.
id
.
button27
)).
setText
(
"Langue"
);
((
Button
)
findViewById
(
R
.
id
.
button28
)).
setText
(
"monnaie"
);
...
...
@@ -51,7 +54,8 @@ public class Settings extends AppCompatActivity {
((
Button
)
findViewById
(
R
.
id
.
button30
)).
setText
(
"Détails"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView16
)).
setText
(
"Configuración"
);
((
Button
)
findViewById
(
R
.
id
.
button25
)).
setText
(
"espalda"
);
((
Button
)
findViewById
(
R
.
id
.
button27
)).
setText
(
"lenguaje"
);
((
Button
)
findViewById
(
R
.
id
.
button28
)).
setText
(
"moneda"
);
...
...
@@ -59,7 +63,8 @@ public class Settings extends AppCompatActivity {
((
Button
)
findViewById
(
R
.
id
.
button30
)).
setText
(
"detalles"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView16
)).
setText
(
"Einstellungen"
);
((
Button
)
findViewById
(
R
.
id
.
button25
)).
setText
(
"rückseite"
);
((
Button
)
findViewById
(
R
.
id
.
button27
)).
setText
(
"Sprache"
);
((
Button
)
findViewById
(
R
.
id
.
button28
)).
setText
(
"Währung"
);
...
...
@@ -68,6 +73,7 @@ public class Settings extends AppCompatActivity {
}
else
{
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
((
TextView
)
findViewById
(
R
.
id
.
textView16
)).
setText
(
"Settings"
);
((
Button
)
findViewById
(
R
.
id
.
button25
)).
setText
(
"Back (something broke)"
);
}
}
...
...
app/src/main/java/com/example/summative_chris_crook/UserMenu.java
View file @
19c926ce
...
...
@@ -6,6 +6,7 @@ import android.content.Intent;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.io.File
;
...
...
@@ -38,7 +39,8 @@ public class UserMenu extends AppCompatActivity {
}
if
(
temploadarray
[
4
].
equals
(
"ENG"
)){
//load english button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView3
)).
setText
(
"Main Menu"
);
((
Button
)
findViewById
(
R
.
id
.
button4
)).
setText
(
"Log Out"
);
((
Button
)
findViewById
(
R
.
id
.
button18
)).
setText
(
"Bookings"
);
((
Button
)
findViewById
(
R
.
id
.
button19
)).
setText
(
"Shop"
);
...
...
@@ -47,7 +49,8 @@ public class UserMenu extends AppCompatActivity {
((
Button
)
findViewById
(
R
.
id
.
button21
)).
setText
(
"Delete Account"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"FRA"
)){
//load french button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView3
)).
setText
(
"Menu principal"
);
((
Button
)
findViewById
(
R
.
id
.
button4
)).
setText
(
"se déconnecter"
);
((
Button
)
findViewById
(
R
.
id
.
button18
)).
setText
(
"réservation"
);
((
Button
)
findViewById
(
R
.
id
.
button19
)).
setText
(
"boutique"
);
...
...
@@ -56,7 +59,8 @@ public class UserMenu extends AppCompatActivity {
((
Button
)
findViewById
(
R
.
id
.
button21
)).
setText
(
"supprimer le compte"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"ESP"
)){
//load spanish button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView3
)).
setText
(
"Menú principal"
);
((
Button
)
findViewById
(
R
.
id
.
button4
)).
setText
(
"espalda"
);
((
Button
)
findViewById
(
R
.
id
.
button18
)).
setText
(
"Bookings"
);
((
Button
)
findViewById
(
R
.
id
.
button19
)).
setText
(
"Shop"
);
...
...
@@ -65,7 +69,8 @@ public class UserMenu extends AppCompatActivity {
((
Button
)
findViewById
(
R
.
id
.
button21
)).
setText
(
"Delete Account"
);
}
else
if
(
temploadarray
[
4
].
equals
(
"DEU"
)){
//load german button names
Toast
.
makeText
(
getApplicationContext
(),
temploadarray
[
4
],
Toast
.
LENGTH_LONG
).
show
();
//Toast.makeText(getApplicationContext(), temploadarray [4], Toast.LENGTH_LONG).show();
((
TextView
)
findViewById
(
R
.
id
.
textView3
)).
setText
(
"Hauptmenü"
);
((
Button
)
findViewById
(
R
.
id
.
button4
)).
setText
(
"rückseite"
);
((
Button
)
findViewById
(
R
.
id
.
button18
)).
setText
(
"Bookings"
);
((
Button
)
findViewById
(
R
.
id
.
button19
)).
setText
(
"Shop"
);
...
...
app/src/main/res/layout/activity_admin_menu.xml
View file @
19c926ce
...
...
@@ -84,5 +84,11 @@
android:onClick=
"register2electricboogaloo"
android:text=
"Register page (admin)"
/>
<Button
android:id=
"@+id/button43"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"ShutItAllDown"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_booking_details.xml
0 → 100644
View file @
19c926ce
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".BookingDetails"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
tools:layout_editor_absoluteX=
"137dp"
tools:layout_editor_absoluteY=
"148dp"
>
<TextView
android:id=
"@+id/textView24"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Booking Details"
/>
<Button
android:id=
"@+id/button48"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"goback"
android:text=
"Back"
/>
<Button
android:id=
"@+id/button57"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"timeslot1"
android:text=
"9:00-11:00"
/>
<Button
android:id=
"@+id/button58"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"timeslot2"
android:text=
"11:00-13:00"
/>
<Button
android:id=
"@+id/button59"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"timeslot3"
android:text=
"13:00-15:00"
/>
<Button
android:id=
"@+id/button60"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"timeslot4"
android:text=
"15:00-17:00"
/>
<EditText
android:id=
"@+id/YEET2"
android:layout_width=
"match_parent"
android:layout_height=
"0px"
android:ems=
"10"
android:inputType=
"textPersonName"
android:text=
"Name"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_checkout_screen.xml
0 → 100644
View file @
19c926ce
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".CheckoutScreen"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
tools:layout_editor_absoluteY=
"244dp"
>
<TextView
android:id=
"@+id/textView23"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Checkout"
/>
<Button
android:id=
"@+id/button62"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"gobackfromtheshop"
android:text=
"Menu"
/>
<Button
android:id=
"@+id/button63"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"tobookings"
android:text=
"Booking"
/>
<Button
android:id=
"@+id/button64"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"toshop"
android:text=
"Shop"
/>
<EditText
android:id=
"@+id/outputcheckout"
android:layout_width=
"match_parent"
android:layout_height=
"523dp"
android:ems=
"10"
android:inputType=
"textPersonName"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_currency_select.xml
View file @
19c926ce
...
...
@@ -25,5 +25,33 @@
android:layout_height=
"wrap_content"
android:onClick=
"goback"
android:text=
"Back"
/>
<Button
android:id=
"@+id/button38"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"PoundMe"
android:text=
"GBP (£)"
/>
<Button
android:id=
"@+id/button39"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"EuroVision"
android:text=
"Euro (€)"
/>
<Button
android:id=
"@+id/button40"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"ThisIsAmerica"
android:text=
"USD ($)"
/>
<Button
android:id=
"@+id/button41"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"BestDisneyland"
android:text=
"HKD ($)"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_main_booking_page.xml
View file @
19c926ce
...
...
@@ -2,6 +2,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/santaslittlehelper"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".MainBookingPage"
>
...
...
@@ -25,5 +26,323 @@
android:layout_height=
"wrap_content"
android:onClick=
"gobackfromtheshop"
android:text=
"Back"
/>
<TextView
android:id=
"@+id/textView21"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"TextView"
/>
<EditText
android:id=
"@+id/editTextTextPersonName"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:ems=
"10"
android:inputType=
"textPersonName"
/>
<Button
android:id=
"@+id/button42"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Button"
/>
<TextView
android:id=
"@+id/textView22"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<androidx.core.widget.NestedScrollView
android:layout_width=
"match_parent"
android:layout_height=
"414dp"
android:fillViewport=
"true"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView12"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button55"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:onClick=
"Lbook"
android:text=
"Louvre"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView7"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button50"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:onClick=
"NMOCbook"
android:text=
"NMOC"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView8"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button51"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:onClick=
"VMbook"
android:text=
"VM"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView9"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button52"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:onClick=
"MMOAbook"
android:text=
"MMOA"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView10"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button53"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:onClick=
"BMbook"
android:text=
"BM"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView2"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button44"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:onClick=
"TMbook"
android:text=
"TM"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView3"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button45"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:onClick=
"NGbook"
android:text=
"NG"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView4"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button46"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:onClick=
"NGbook"
android:text=
"NG"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView5"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button47"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:onClick=
"NHMbook"
android:text=
"NHM"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView6"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button49"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:onClick=
"AMONHbook"
android:text=
"AMONH"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/miv1"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/mb1"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:onClick=
"SHMbook"
android:text=
"SHM"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"0px"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/imageView11"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
app:srcCompat=
"@android:drawable/ic_menu_gallery"
/>
<Button
android:id=
"@+id/button54"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"Button"
/>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<Button
android:id=
"@+id/button61"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:onClick=
"tocart"
android:text=
"cart"
/>
<Button
android:id=
"@+id/button56"
android:layout_width=
"199dp"
android:layout_height=
"match_parent"
android:onClick=
"toshop"
android:text=
"shop"
/>
</LinearLayout>
<EditText
android:id=
"@+id/YEET"
android:layout_width=
"match_parent"
android:layout_height=
"0px"
android:ems=
"10"
android:inputType=
"textPersonName"
android:text=
"Name"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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