Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Booking App COM5007
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
austin.blanke
Booking App COM5007
Commits
916890f0
Commit
916890f0
authored
May 29, 2023
by
austin.blanke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Booking List Working
parent
90fff506
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
17 deletions
+90
-17
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+8
-0
DatabaseConnector.java
...om/example/bookingapp_austinblanke/DatabaseConnector.java
+7
-13
MyBookingsActivity.java
...m/example/bookingapp_austinblanke/MyBookingsActivity.java
+32
-2
SingleBookingActivity.java
...xample/bookingapp_austinblanke/SingleBookingActivity.java
+20
-0
mybookings_activity.xml
app/src/main/res/layout/mybookings_activity.xml
+4
-2
singlebooking.xml
app/src/main/res/layout/singlebooking.xml
+19
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
916890f0
...
@@ -52,6 +52,14 @@
...
@@ -52,6 +52,14 @@
android:name=
".MyBookingsActivity"
android:name=
".MyBookingsActivity"
android:exported=
"false"
>
android:exported=
"false"
>
<meta-data
android:name=
"android.app.lib_name"
android:value=
""
/>
</activity>
<activity
android:name=
".SingleBookingActivity"
android:exported=
"false"
>
<meta-data
<meta-data
android:name=
"android.app.lib_name"
android:name=
"android.app.lib_name"
android:value=
""
/>
android:value=
""
/>
...
...
app/src/main/java/com/example/bookingapp_austinblanke/DatabaseConnector.java
View file @
916890f0
...
@@ -6,10 +6,6 @@ import android.database.Cursor;
...
@@ -6,10 +6,6 @@ import android.database.Cursor;
import
android.database.sqlite.SQLiteDatabase
;
import
android.database.sqlite.SQLiteDatabase
;
import
android.database.sqlite.SQLiteOpenHelper
;
import
android.database.sqlite.SQLiteOpenHelper
;
import
androidx.annotation.Nullable
;
import
java.sql.ResultSet
;
import
java.sql.Statement
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Random
;
import
java.util.Random
;
...
@@ -49,7 +45,7 @@ public class DatabaseConnector extends SQLiteOpenHelper {
...
@@ -49,7 +45,7 @@ public class DatabaseConnector extends SQLiteOpenHelper {
private
static
final
String
COLUMN_TIC1CNT
=
"ticket1count"
;
private
static
final
String
COLUMN_TIC1CNT
=
"ticket1count"
;
private
static
final
String
COLUMN_TIC2CNT
=
"ticket2count"
;
private
static
final
String
COLUMN_TIC2CNT
=
"ticket2count"
;
private
static
final
String
COLUMN_TIC3CNT
=
"ticket3count"
;
private
static
final
String
COLUMN_TIC3CNT
=
"ticket3count"
;
private
static
final
String
COLUMN_B
OOKINGTITLE
=
"booking title
"
;
private
static
final
String
COLUMN_B
T
=
"bt
"
;
public
DatabaseConnector
(
Context
context
,
SQLiteDatabase
.
CursorFactory
factory
)
{
public
DatabaseConnector
(
Context
context
,
SQLiteDatabase
.
CursorFactory
factory
)
{
...
@@ -92,7 +88,7 @@ public class DatabaseConnector extends SQLiteOpenHelper {
...
@@ -92,7 +88,7 @@ public class DatabaseConnector extends SQLiteOpenHelper {
COLUMN_TIC1CNT
+
" INT, "
+
COLUMN_TIC1CNT
+
" INT, "
+
COLUMN_TIC2CNT
+
" INT, "
+
COLUMN_TIC2CNT
+
" INT, "
+
COLUMN_TIC3CNT
+
" INT, "
+
COLUMN_TIC3CNT
+
" INT, "
+
COLUMN_B
OOKINGTITLE
+
"
TEXT)"
;
COLUMN_B
T
+
"
TEXT)"
;
db
.
execSQL
(
CREATE_table3
);
db
.
execSQL
(
CREATE_table3
);
ContentValues
play1
=
new
ContentValues
();
ContentValues
play1
=
new
ContentValues
();
...
@@ -218,7 +214,7 @@ public class DatabaseConnector extends SQLiteOpenHelper {
...
@@ -218,7 +214,7 @@ public class DatabaseConnector extends SQLiteOpenHelper {
SQLiteDatabase
db
=
this
.
getWritableDatabase
();
SQLiteDatabase
db
=
this
.
getWritableDatabase
();
Cursor
cursor
=
db
.
rawQuery
(
query
,
null
);
Cursor
cursor
=
db
.
rawQuery
(
query
,
null
);
cursor
.
moveToFirst
();
cursor
.
moveToFirst
();
String
title
=
cursor
.
getString
(
1
)
;
String
title
=
"\'"
+
cursor
.
getString
(
1
)
+
"\'"
;
CurrentPTicCount1
=
cursor
.
getString
(
10
);
CurrentPTicCount1
=
cursor
.
getString
(
10
);
CurrentPTicCount2
=
cursor
.
getString
(
13
);
CurrentPTicCount2
=
cursor
.
getString
(
13
);
CurrentPTicCount3
=
cursor
.
getString
(
16
);
CurrentPTicCount3
=
cursor
.
getString
(
16
);
...
@@ -248,9 +244,9 @@ public class DatabaseConnector extends SQLiteOpenHelper {
...
@@ -248,9 +244,9 @@ public class DatabaseConnector extends SQLiteOpenHelper {
values
.
put
(
COLUMN_BID
,
BID
);
values
.
put
(
COLUMN_BID
,
BID
);
values
.
put
(
COLUMN_PID
,
PID
);
values
.
put
(
COLUMN_PID
,
PID
);
values
.
put
(
COLUMN_TIC1CNT
,
TIC1CNT
);
values
.
put
(
COLUMN_TIC1CNT
,
TIC1CNT
);
values
.
put
(
COLUMN_TIC
1
CNT
,
TIC2CNT
);
values
.
put
(
COLUMN_TIC
2
CNT
,
TIC2CNT
);
values
.
put
(
COLUMN_TIC
1
CNT
,
TIC3CNT
);
values
.
put
(
COLUMN_TIC
3
CNT
,
TIC3CNT
);
values
.
put
(
COLUMN_B
OOKINGTITLE
,
title
);
values
.
put
(
COLUMN_B
T
,
title
);
db
.
insert
(
TABLE_BOOKINGS
,
null
,
values
);
db
.
insert
(
TABLE_BOOKINGS
,
null
,
values
);
db
.
close
();
db
.
close
();
}
}
...
@@ -348,14 +344,12 @@ public class DatabaseConnector extends SQLiteOpenHelper {
...
@@ -348,14 +344,12 @@ public class DatabaseConnector extends SQLiteOpenHelper {
public
ArrayList
bookings
(){
public
ArrayList
bookings
(){
ArrayList
<
String
>
bookings
=
new
ArrayList
<>();
ArrayList
<
String
>
bookings
=
new
ArrayList
<>();
String
booking
=
null
;
String
query
=
"SELECT * FROM "
+
TABLE_BOOKINGS
;
String
query
=
"SELECT * FROM "
+
TABLE_BOOKINGS
;
SQLiteDatabase
db
=
this
.
getWritableDatabase
();
SQLiteDatabase
db
=
this
.
getWritableDatabase
();
Cursor
cursor
=
db
.
rawQuery
(
query
,
null
);
Cursor
cursor
=
db
.
rawQuery
(
query
,
null
);
cursor
.
moveToFirst
();
cursor
.
moveToFirst
();
for
(
int
i
=
0
;
i
<
cursor
.
getCount
();
i
++){
for
(
int
i
=
0
;
i
<
cursor
.
getCount
();
i
++){
bookings
.
add
(
cursor
.
getString
(
1
)
+
"id: "
+
cursor
.
getString
(
0
));
bookings
.
add
(
cursor
.
getString
(
5
)
+
"id: "
+
cursor
.
getString
(
0
));
cursor
.
moveToNext
();
cursor
.
moveToNext
();
cursor
.
moveToNext
();
}
}
return
bookings
;
return
bookings
;
...
...
app/src/main/java/com/example/bookingapp_austinblanke/MyBookingsActivity.java
View file @
916890f0
package
com
.
example
.
bookingapp_austinblanke
;
package
com
.
example
.
bookingapp_austinblanke
;
import
android.os.Bundle
;
import
androidx.appcompat.app.ActionBar
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.recyclerview.widget.RecyclerView
;
import
android.app.assist.AssistStructure
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.provider.ContactsContract
;
import
android.view.View
;
import
android.widget.CheckBox
;
import
android.widget.EditText
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
public
class
MyBookingsActivity
extends
AppCompatActivity
{
public
class
MyBookingsActivity
extends
AppCompatActivity
{
...
@@ -27,6 +37,26 @@ public class MyBookingsActivity extends AppCompatActivity {
...
@@ -27,6 +37,26 @@ public class MyBookingsActivity extends AppCompatActivity {
recyclerObj
.
setLayoutManager
(
new
LinearLayoutManager
(
this
));
recyclerObj
.
setLayoutManager
(
new
LinearLayoutManager
(
this
));
adapterObj
=
new
adapter2
(
this
,
bookingList
);
adapterObj
=
new
adapter2
(
this
,
bookingList
);
recyclerObj
.
setAdapter
(
adapterObj
);
recyclerObj
.
setAdapter
(
adapterObj
);
}
public
void
performanceBack
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
MainActivity
.
class
);
startActivity
(
intent
);
}
public
void
toBooking
(
View
view
){
toBooking
();}
private
void
toBooking
(){
EditText
BID
=
findViewById
(
R
.
id
.
bookingID
);
Intent
intent
=
new
Intent
(
this
,
SingleBookingActivity
.
class
);
Bundle
bundle
=
new
Bundle
();
bundle
.
putString
(
"BID"
,
BID
.
getText
().
toString
());
intent
.
putExtras
(
bundle
);
startActivity
(
intent
);
}
}
}
}
...
...
app/src/main/java/com/example/bookingapp_austinblanke/SingleBookingActivity.java
0 → 100644
View file @
916890f0
package
com
.
example
.
bookingapp_austinblanke
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
androidx.appcompat.app.AppCompatActivity
;
public
class
SingleBookingActivity
extends
AppCompatActivity
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
singlebooking
);
}
public
void
myBookings
(
View
view
){
Intent
intent
=
new
Intent
(
this
,
MyBookingsActivity
.
class
);
startActivity
(
intent
);
}
}
app/src/main/res/layout/mybookings_activity.xml
View file @
916890f0
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Look at Booking"
android:text=
"Look at Booking"
android:onClick=
"toBooking"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.995"
app:layout_constraintHorizontal_bias=
"0.995"
...
@@ -33,8 +34,8 @@
...
@@ -33,8 +34,8 @@
<EditText
<EditText
android:id=
"@+id/bookingID"
android:id=
"@+id/bookingID"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
213dp
"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
72dp
"
android:ems=
"10"
android:ems=
"10"
android:hint=
"Booking ID"
android:hint=
"Booking ID"
android:inputType=
"textPersonName"
android:inputType=
"textPersonName"
...
@@ -50,6 +51,7 @@
...
@@ -50,6 +51,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Performances"
android:text=
"Performances"
android:onClick=
"performanceBack"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.498"
app:layout_constraintHorizontal_bias=
"0.498"
...
...
app/src/main/res/layout/singlebooking.xml
0 → 100644
View file @
916890f0
<?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"
>
<Button
android:id=
"@+id/myBookings"
android:layout_width=
"229dp"
android:layout_height=
"54dp"
android:onClick=
"myBookings"
android:text=
"My Bookings"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.134"
/>
</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