Commit 310c2d60 authored by austin.blanke's avatar austin.blanke

Im Him (Working on Displaying Performance)

parent 0ccd2f7a
......@@ -36,6 +36,14 @@
android:name=".CreateAccountActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".MoreInfoActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
......
......@@ -20,6 +20,7 @@ public class DatabaseConnector extends SQLiteOpenHelper {
private static final String COLUMN_USERNAME = "username";
private static final String COLUMN_PASSWORD = "password";
private static final String TABLE_PERFORMANCES = "performances";
private static final String COLUMN_PERFORMANCEID = "performanceID";
private static final String COLUMN_NAME = "name";
......@@ -51,10 +52,11 @@ public class DatabaseConnector extends SQLiteOpenHelper {
COLUMN_UID + " INTEGER PRIMARY KEY, " +
COLUMN_USERNAME + " TEXT, " +
COLUMN_PASSWORD + " TEXT)";
;
db.execSQL(CREATE_table1);
String CREATE_table2 = "CREATE TABLE " + TABLE_PERFORMANCES + "(" +
COLUMN_PERFORMANCEID + " INTEGER PRIMARY KEY, " +
COLUMN_PERFORMANCEID + " TEXT PRIMARY KEY, " +
COLUMN_NAME + " TEXT, " +
COLUMN_DATE + " TEXT, " +
COLUMN_TIME + " TEXT, " +
......@@ -74,7 +76,7 @@ public class DatabaseConnector extends SQLiteOpenHelper {
db.execSQL(CREATE_table2);
ContentValues play1 = new ContentValues();
play1.put(COLUMN_PERFORMANCEID, 1);
play1.put(COLUMN_PERFORMANCEID, "1");
play1.put(COLUMN_NAME, "The Merchant of Venice by William Shakespeare");
play1.put(COLUMN_DATE, "Sunday April 23 2023");
play1.put(COLUMN_TIME, "20:00");
......@@ -86,7 +88,7 @@ public class DatabaseConnector extends SQLiteOpenHelper {
db.insert(TABLE_PERFORMANCES, null, play1);
ContentValues play2 = new ContentValues();
play2.put(COLUMN_PERFORMANCEID, 2);
play2.put(COLUMN_PERFORMANCEID, "2");
play2.put(COLUMN_NAME, "Hamlet by William Shakespeare");
play2.put(COLUMN_DATE, "Friday 19 May 2023");
play2.put(COLUMN_TIME, "18:00");
......@@ -98,7 +100,7 @@ public class DatabaseConnector extends SQLiteOpenHelper {
db.insert(TABLE_PERFORMANCES, null, play2);
ContentValues play3 = new ContentValues();
play3.put(COLUMN_PERFORMANCEID, 3);
play3.put(COLUMN_PERFORMANCEID, "3");
play3.put(COLUMN_NAME, "A Midsummer Night's Dream by William Shakespeare");
play3.put(COLUMN_DATE, "Saturday 3 June 2023");
play3.put(COLUMN_TIME, "19:00");
......@@ -111,7 +113,7 @@ public class DatabaseConnector extends SQLiteOpenHelper {
db.insert(TABLE_PERFORMANCES, null, play3);
ContentValues play4 = new ContentValues();
play4.put(COLUMN_PERFORMANCEID, 4);
play4.put(COLUMN_PERFORMANCEID, "4");
play4.put(COLUMN_NAME, "Oedipus the King by Sophocles");
play4.put(COLUMN_DATE, "Friday 28 July");
play4.put(COLUMN_TIME, "20:00");
......@@ -124,7 +126,7 @@ public class DatabaseConnector extends SQLiteOpenHelper {
db.insert(TABLE_PERFORMANCES, null, play4);
ContentValues play5 = new ContentValues();
play5.put(COLUMN_PERFORMANCEID, 5);
play5.put(COLUMN_PERFORMANCEID, "5");
play5.put(COLUMN_NAME, "The Tempest by William Shakespeare");
play5.put(COLUMN_DATE, "Saturday 19 August");
play5.put(COLUMN_TIME, "14:00");
......@@ -137,7 +139,7 @@ public class DatabaseConnector extends SQLiteOpenHelper {
db.insert(TABLE_PERFORMANCES, null, play5);
ContentValues play6 = new ContentValues();
play6.put(COLUMN_PERFORMANCEID, 6);
play6.put(COLUMN_PERFORMANCEID, "6");
play6.put(COLUMN_NAME, "Antigone by Sophocles");
play6.put(COLUMN_DATE, "Thursday 20 September");
play6.put(COLUMN_TIME, "21:00");
......@@ -156,7 +158,6 @@ public class DatabaseConnector extends SQLiteOpenHelper {
ContentValues values = new ContentValues();
values.put(COLUMN_USERNAME, username);
values.put(COLUMN_PASSWORD, password);
SQLiteDatabase db = this.getWritableDatabase();
db.insert(TABLE_USERS, null, values);
db.close();
......@@ -184,6 +185,15 @@ public class DatabaseConnector extends SQLiteOpenHelper {
return result;
}
public void moreInfo(String username, String PID) {
String query = "SELECT * FROM " + TABLE_PERFORMANCES + " WHERE " + COLUMN_PERFORMANCEID + " = \"" + PID + "\"";
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(query, null);
cursor.close();
db.close();
}
public boolean login(String username, String password) {
String query = "SELECT * FROM " + TABLE_USERS + " WHERE " + COLUMN_USERNAME + " = \"" + username + "\"";
SQLiteDatabase db = this.getWritableDatabase();
......
......@@ -16,6 +16,9 @@ public class LoginActivity extends AppCompatActivity {
}
public void createAccount(View view) {
createAccount();
}
private void createAccount(){
Intent intent = new Intent(this, CreateAccountActivity.class);
startActivity(intent);
}
......
......@@ -7,11 +7,13 @@ import androidx.recyclerview.widget.LinearLayoutManager;
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;
......@@ -32,7 +34,7 @@ public class MainActivity extends AppCompatActivity {
flash = (CheckBox)findViewById(R.id.Flash);
wheelChair = (CheckBox)findViewById(R.id.Wheelchair);
stairs = (CheckBox)findViewById(R.id.Stairs);
String filter = null;
DatabaseConnector connector = new DatabaseConnector(this, null);
......@@ -49,7 +51,18 @@ public class MainActivity extends AppCompatActivity {
}
public void moreInfoClick(View view){moreInfo();}
private void moreInfo(){
EditText PID = findViewById(R.id.PID);
Intent intent = new Intent(this, MoreInfoActivity.class);
Bundle bundle = new Bundle();
bundle.putString("PID", PID.getText().toString());
intent.putExtras(bundle);
startActivity(intent);
}
public void filter(View view){ filter();}
public void filter()
{
......
......@@ -2,17 +2,43 @@ package com.example.bookingapp_austinblanke;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import org.w3c.dom.Text;
public class MoreInfoActivity extends AppCompatActivity {
String PID;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.moreinfo);
setContentView(R.layout.moreinfo_activity);
String Performance = null;
String Date = null;
String Time = null;
String Location = null;
Boolean Flash = false;
Boolean Wheelchair = false;
Boolean Stairs = false;
String Tickets = null;
DatabaseConnector connector = new DatabaseConnector(this, null);
Bundle loginBundle = getIntent().getExtras();
PID = loginBundle.getString("PID");
TextView title = (TextView) findViewById(R.id.PTitle);
title.setText(PID);
Intent intent = getIntent();
String name = intent.getStringExtra("name");
}
}
......@@ -42,21 +42,12 @@ public class adapter extends RecyclerView.Adapter<adapter.ViewHolder>{
return mData.size();
}
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
public class ViewHolder extends RecyclerView.ViewHolder{
TextView myTextView;
ViewHolder(View v){
super(v);
myTextView = itemView.findViewById(R.id.performance);
itemView.setOnClickListener(this);
}
@Override
public void onClick(View view) {
int position = getAdapterPosition();
Intent intent = new Intent(context,MoreInfoActivity.class);
intent.putExtra("name", mData.get(position));
context.startActivity(intent);
}
}
......
......@@ -68,5 +68,32 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.31" />
<EditText
android:id="@+id/PID"
android:layout_width="197dp"
android:layout_height="62dp"
android:ems="10"
android:hint="Input Performance ID"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.199"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.112" />
<Button
android:id="@+id/moreInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="More Info"
android:onClick="moreInfoClick"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.848"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.112" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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/BookNow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="bookNow"
android:text="Book Now"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.879" />
<TextView
android:id="@+id/PTitle"
android:layout_width="290dp"
android:layout_height="92dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.495"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.097" />
<TextView
android:id="@+id/date"
android:layout_width="107dp"
android:layout_height="39dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.197"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.257" />
<TextView
android:id="@+id/flash"
android:layout_width="107dp"
android:layout_height="39dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.799"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.368" />
<TextView
android:id="@+id/tickets"
android:layout_width="107dp"
android:layout_height="39dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.197"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.478"
tools:ignore="DuplicateIds" />
<TextView
android:id="@+id/stairs"
android:layout_width="107dp"
android:layout_height="39dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.799"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.515" />
<TextView
android:id="@+id/time"
android:layout_width="107dp"
android:layout_height="39dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.799"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.257" />
<TextView
android:id="@+id/PTitle"
android:layout_width="290dp"
android:layout_height="92dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.495"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.097" />
<TextView
android:id="@+id/date"
android:layout_width="107dp"
android:layout_height="39dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.197"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.257" />
<TextView
android:id="@+id/wheelchair"
android:layout_width="107dp"
android:layout_height="39dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.799"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.439" />
<TextView
android:id="@+id/location"
android:layout_width="107dp"
android:layout_height="39dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.197"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.368" />
<TextView
android:id="@+id/time"
android:layout_width="107dp"
android:layout_height="39dp"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.799"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.257" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment