Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Summative_Lucy_Hemingway
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
lucy.hemingway
Summative_Lucy_Hemingway
Commits
f91b79f3
Commit
f91b79f3
authored
May 09, 2021
by
lucy.hemingway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
5 commit - login started
parent
b5891779
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
261 additions
and
3 deletions
+261
-3
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-1
Booking.java
app/src/main/java/com/example/appppppp/Booking.java
+15
-0
DBconnect.java
app/src/main/java/com/example/appppppp/DBconnect.java
+108
-0
fulldetails.java
app/src/main/java/com/example/appppppp/fulldetails.java
+90
-0
activity_booking.xml
app/src/main/res/layout/activity_booking.xml
+32
-0
activity_fulldetails.xml
app/src/main/res/layout/activity_fulldetails.xml
+14
-2
No files found.
app/src/main/AndroidManifest.xml
View file @
f91b79f3
...
@@ -9,7 +9,8 @@
...
@@ -9,7 +9,8 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.APPPPPpp"
>
android:theme=
"@style/Theme.APPPPPpp"
>
<activity
android:name=
".fulldetails"
></activity>
<activity
android:name=
".Booking"
></activity>
<activity
android:name=
".fulldetails"
/>
<activity
android:name=
".MuseumList"
/>
<activity
android:name=
".MuseumList"
/>
<activity
android:name=
".HelpPage"
/>
<activity
android:name=
".HelpPage"
/>
<activity
android:name=
".Register"
/>
<activity
android:name=
".Register"
/>
...
...
app/src/main/java/com/example/appppppp/Booking.java
0 → 100644
View file @
f91b79f3
package
com
.
example
.
appppppp
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.os.Bundle
;
public
class
Booking
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_booking
);
}
}
\ No newline at end of file
app/src/main/java/com/example/appppppp/DBconnect.java
0 → 100644
View file @
f91b79f3
package
com
.
example
.
appppppp
;
import
android.content.ContentValues
;
import
android.content.Context
;
import
android.database.Cursor
;
import
android.database.sqlite.SQLiteDatabase
;
import
android.database.sqlite.SQLiteOpenHelper
;
import
androidx.annotation.Nullable
;
public
class
DBconnect
extends
SQLiteOpenHelper
{
private
static
final
int
db_version
=
1
;
private
static
final
String
db_name
=
"Registered.db"
;
private
static
final
String
table_users
=
"Users"
;
private
static
final
String
column_id
=
"ID"
;
private
static
final
String
column_name
=
"First Name"
;
private
static
final
String
column_last
=
"Last Name"
;
private
static
final
String
column_email
=
"Email"
;
private
static
final
String
column_pass
=
"Password"
;
public
DBconnect
(
Context
context
,
String
name
,
SQLiteDatabase
.
CursorFactory
factory
,
int
version
)
{
super
(
context
,
db_name
,
factory
,
db_version
);
}
@Override
public
void
onCreate
(
SQLiteDatabase
db
)
{
//create table for storing users
String
create
=
"CREATE TABLE "
+
table_users
+
"("
+
column_id
+
"INTEGER PRIMARY KEY,"
+
column_name
+
"TEXT,"
+
column_last
+
"TEXT,"
+
column_email
+
"TEXT,"
+
column_pass
+
"INTEGER"
+
")"
;
//create
db
.
execSQL
(
create
);
}
@Override
public
void
onUpgrade
(
SQLiteDatabase
db
,
int
oldVersion
,
int
newVersion
)
{
}
public
void
addNew
(
String
name
,
String
last
,
String
email
,
String
password
){
ContentValues
values
=
new
ContentValues
();
values
.
put
(
column_name
,
name
);
values
.
put
(
column_last
,
last
);
values
.
put
(
column_email
,
email
);
values
.
put
(
column_pass
,
password
);
SQLiteDatabase
db
=
this
.
getWritableDatabase
();
db
.
insert
(
table_users
,
null
,
values
);
db
.
close
();
}
public
boolean
check
(
String
Email
,
String
password
){
//check password variable
boolean
checked
=
false
;
//query check email
String
email
=
"SELECT * FROM "
+
table_users
+
"WHERE "
+
column_email
+
"= \""
+
Email
+
"\""
;
SQLiteDatabase
db
=
this
.
getWritableDatabase
();
Cursor
cursor
=
db
.
rawQuery
(
email
,
null
);
if
(
cursor
.
moveToFirst
())
{
if
(
cursor
.
getString
(
4
).
equals
(
password
)
)
{
checked
=
true
;
}
}
else
{
checked
=
false
;
}
cursor
.
close
();
db
.
close
();
return
checked
;
}
public
String
find
(
String
Email
){
//store result
String
f
=
null
;
String
query
=
"SELECT * FROM "
+
table_users
+
"WHERE "
+
column_email
+
"= \""
+
Email
+
"\""
;
SQLiteDatabase
db
=
this
.
getWritableDatabase
();
Cursor
cursor
=
db
.
rawQuery
(
query
,
null
);
if
(
cursor
.
moveToFirst
()){
f
=
Integer
.
parseInt
(
cursor
.
getString
(
0
))
+
cursor
.
getString
(
1
)
+
cursor
.
getString
(
2
)
+
cursor
.
getString
(
3
)
+
cursor
.
getString
(
4
);
}
cursor
.
close
();
db
.
close
();
return
f
;
}
}
app/src/main/java/com/example/appppppp/fulldetails.java
View file @
f91b79f3
...
@@ -4,6 +4,7 @@ import androidx.appcompat.app.AppCompatActivity;
...
@@ -4,6 +4,7 @@ import androidx.appcompat.app.AppCompatActivity;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
android.widget.TextView
;
...
@@ -20,30 +21,119 @@ public class fulldetails extends AppCompatActivity {
...
@@ -20,30 +21,119 @@ public class fulldetails extends AppCompatActivity {
setDetail
(
selectedMuseum
);
setDetail
(
selectedMuseum
);
}
}
void
setDetail
(
String
s
){
void
setDetail
(
String
s
){
//variables for next page if this museum is selected
String
mname
=
""
;
int
price
=
0
;
int
i
=
0
;
switch
(
s
)
{
switch
(
s
)
{
case
"Louvre"
:
case
"Louvre"
:
mname
=
"Louvre"
;
price
=
10
;
i
=
1
;
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
louvre
);
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
louvre
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"The Louvre asdaskjhdasdlkasda al s dlasdajsdjasjd jka "
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"The Louvre asdaskjhdasdlkasda al s dlasdajsdjasjd jka "
);
break
;
break
;
case
"National Museum of China"
:
case
"National Museum of China"
:
mname
=
"National Museum of China"
;
price
=
10
;
i
=
2
;
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
china
);
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
china
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"China asdaskjhdasdlkasda al s dlasdajsdjasjd jka "
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"China asdaskjhdasdlkasda al s dlasdajsdjasjd jka "
);
break
;
break
;
case
"Vatican Museums"
:
case
"Vatican Museums"
:
mname
=
"Vatican Museums"
;
price
=
10
;
i
=
3
;
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
vatican
);
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
vatican
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"Vatican d jka "
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"Vatican d jka "
);
break
;
break
;
case
"Metropolitan Museum of Art"
:
case
"Metropolitan Museum of Art"
:
mname
=
"Metropolitan Museum of Art"
;
price
=
10
;
i
=
4
;
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
metropolitan
);
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
metropolitan
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka "
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka "
);
break
;
break
;
case
"British Museum"
:
mname
=
"British Museum"
;
price
=
10
;
i
=
5
;
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
british
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka "
);
break
;
case
"Tate Modern"
:
mname
=
"Tate Modern"
;
price
=
5
;
i
=
6
;
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
tate
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka "
);
break
;
case
"National Gallery"
:
mname
=
"National Gallery"
;
price
=
5
;
i
=
7
;
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
national
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka "
);
break
;
case
"Natural History Museum"
:
mname
=
"Natural History Museum"
;
price
=
5
;
i
=
8
;
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
natural
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka "
);
break
;
case
"American Museum of Natural History"
:
mname
=
"American Museum of Natural History"
;
price
=
5
;
i
=
9
;
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
american
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka "
);
break
;
case
"State Hermitage Museum"
:
mname
=
"State Hermitage Museum"
;
price
=
5
;
i
=
10
;
((
ImageView
)
findViewById
(
R
.
id
.
theimage
)).
setImageResource
(
R
.
drawable
.
state
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"The metropolitan asdaskjhdasdlkasda al s dlasdajsdjasjd jka "
);
break
;
default
:
default
:
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"Not Added"
);
((
TextView
)
findViewById
(
R
.
id
.
thetext
)).
setText
(
"Not Added"
);
break
;
break
;
}
}
//send price and name of museum to next page when pressing book now button
Bundle
n
=
getIntent
().
getExtras
();
Intent
book
=
new
Intent
(
this
,
Booking
.
class
);
book
.
putExtra
(
"museumname"
,
mname
);
book
.
putExtra
(
"fee"
,
price
);
book
.
putExtra
(
"number"
,
i
);
}
}
}
}
app/src/main/res/layout/activity_booking.xml
0 → 100644
View file @
f91b79f3
<?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=
".Booking"
>
<TextView
android:id=
"@+id/name1"
android:layout_width=
"192dp"
android:layout_height=
"32dp"
android:text=
"TextView"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.169"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.089"
/>
<CalendarView
android:id=
"@+id/calendarView"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"42dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.491"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/name1"
app:layout_constraintVertical_bias=
"0.023"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_fulldetails.xml
View file @
f91b79f3
...
@@ -33,12 +33,24 @@
...
@@ -33,12 +33,24 @@
<ImageView
<ImageView
android:id=
"@+id/theimage"
android:id=
"@+id/theimage"
android:layout_width=
"
189
dp"
android:layout_width=
"
283
dp"
android:layout_height=
"1
62
dp"
android:layout_height=
"1
94
dp"
app:layout_constraintBottom_toTopOf=
"@+id/thetext"
app:layout_constraintBottom_toTopOf=
"@+id/thetext"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/check"
app:layout_constraintTop_toBottomOf=
"@+id/check"
app:layout_constraintVertical_bias=
"0.428"
app:layout_constraintVertical_bias=
"0.428"
tools:srcCompat=
"@tools:sample/avatars"
/>
tools:srcCompat=
"@tools:sample/avatars"
/>
<Button
android:id=
"@+id/button9"
android:layout_width=
"124dp"
android:layout_height=
"42dp"
android:layout_marginTop=
"49dp"
android:text=
"Book Now"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/thetext"
app:layout_constraintVertical_bias=
"0.0"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</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