Commit cdf47363 authored by sam.pople's avatar sam.pople

really proud now

parent 2919e307
......@@ -26,7 +26,7 @@ public class MainActivity extends AppCompatActivity {
plays.add(new performancetickets("Antigone", 23));
//This sets the buttons and ensures they open certain screens when clicked
Button performance1 = (Button) findViewById(R.id.Performance1);
Button wheelchair = (Button) findViewById(R.id.filtered);
Button view = (Button) findViewById(R.id.viewall);
......@@ -35,6 +35,15 @@ public class MainActivity extends AppCompatActivity {
Button oedipus = (Button) findViewById(R.id.oedipus);
Button antigone = (Button) findViewById(R.id.antigone);
Button tempest = (Button) findViewById(R.id.tempest);
Button filtertwo = (Button) findViewById(R.id.filtered2);
filtertwo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, lights.class);
startActivity(intent);
}
});
midsummer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
......
......@@ -50,7 +50,7 @@ public class antigone extends AppCompatActivity implements AdapterView.OnItemSel
String playnameforthis = "Antigone";
int ticketsthere = database.gettickets(playnameforthis);
displaytickets.setText(String.valueOf(ticketsthere));
//This ensures that the number of ordered tickets is acceptable
confirm.setOnClickListener(v -> {
TextView displayorderedtickets = findViewById(R.id.orderedticketshamlet6);
int orderedtickets = Integer.parseInt(displayorderedtickets.getText().toString());
......@@ -62,8 +62,11 @@ public class antigone extends AppCompatActivity implements AdapterView.OnItemSel
displaytickets.setText(String.valueOf(ticketsthere));
boolean bookedupdate = database.ticketsupdate(playnameforthis, currentickets);
if (bookedupdate) {
Boolean input = database.bookinginput(playnameforthis, orderedtickets);
if (input == true) {
Intent screenchange = new Intent(antigone.this, booked.class);
startActivity(screenchange);
}
} else {
Toast.makeText(antigone.this, "Please try again.", Toast.LENGTH_SHORT).show();
}
......@@ -83,6 +86,7 @@ public class antigone extends AppCompatActivity implements AdapterView.OnItemSel
startActivity(intent);
}
});
//This allows the user to order a certain number of tickets
Button plusone = findViewById(R.id.plusonehamlet6);
Button minusone = findViewById(R.id.minusonehamlet6);
plusone.setOnClickListener(new View.OnClickListener() {
......
......@@ -15,15 +15,24 @@ public class filtered extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.filteredwheelchair);
//This sets the buttons and ensures they open certain screens when clicked
Button undo = (Button) findViewById(R.id.undo);
Button performance = (Button) findViewById(R.id.performance);
Button view = (Button) findViewById(R.id.filteredview);
Button midsummer = (Button) findViewById(R.id.midsummerfilter);
Button oedipus = (Button) findViewById(R.id.oedipusfilter);
Button tempest = (Button) findViewById(R.id.tempestfilter);
Button undotwo = (Button) findViewById(R.id.undo2);
undotwo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(filtered.this, lights.class);
startActivity(intent);
}
});
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
......
......@@ -50,6 +50,7 @@ public class hamlet extends AppCompatActivity implements AdapterView.OnItemSelec
String playnameforthis = "Hamlet";
int ticketsthere = database.gettickets(playnameforthis);
displaytickets.setText(String.valueOf(ticketsthere));
//This ensures that the number of ordered tickets is acceptable
confirm.setOnClickListener(v -> {
TextView displayorderedtickets = findViewById(R.id.orderedticketshamlet2);
......@@ -62,8 +63,11 @@ public class hamlet extends AppCompatActivity implements AdapterView.OnItemSelec
displaytickets.setText(String.valueOf(ticketsthere));
boolean bookedupdate = database.ticketsupdate(playnameforthis, currentickets);
if (bookedupdate) {
Boolean input = database.bookinginput(playnameforthis, orderedtickets);
if (input == true) {
Intent screenchange = new Intent(hamlet.this, booked.class);
startActivity(screenchange);
}
} else {
Toast.makeText(hamlet.this, "Please try again.", Toast.LENGTH_SHORT).show();
}
......@@ -83,6 +87,7 @@ public class hamlet extends AppCompatActivity implements AdapterView.OnItemSelec
startActivity(intent);
}
});
//This allows the user to order a certain number of tickets
Button plusone = findViewById(R.id.plusonehamlet2);
Button minusone = findViewById(R.id.minusonehamlet2);
plusone.setOnClickListener(new View.OnClickListener() {
......
package com.example.playsrus;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
public class lights extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.lights);
//This sets the buttons and ensures they open certain screens when clicked
Button undo = (Button) findViewById(R.id.undo5);
Button wheelchair = (Button) findViewById(R.id.undo6);
Button view = (Button) findViewById(R.id.filteredview3);
Button midsummer = (Button) findViewById(R.id.midsummerfilter3);
Button hamlet = (Button) findViewById(R.id.hamletfilter3);
wheelchair.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(lights.this, filtered.class);
startActivity(intent);
}
});
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(lights.this, view.class);
startActivity(intent);
}
});
hamlet.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(lights.this, hamlet.class);
startActivity(intent);
}
});
midsummer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(lights.this, midsummer.class);
startActivity(intent);
}
});
undo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(lights.this, MainActivity.class);
startActivity(intent);
}
});
}
}
......@@ -50,7 +50,7 @@ public class midsummer extends AppCompatActivity implements AdapterView.OnItemSe
String playnameforthis = "A Midsummer Night's Dream";
int ticketsthere = database.gettickets(playnameforthis);
displaytickets.setText(String.valueOf(ticketsthere));
//This ensures the customer doesn't order too many tickets or too few
confirm.setOnClickListener(v -> {
TextView displayorderedtickets = findViewById(R.id.orderedticketshamlet2);
int orderedtickets = Integer.parseInt(displayorderedtickets.getText().toString());
......@@ -62,8 +62,11 @@ public class midsummer extends AppCompatActivity implements AdapterView.OnItemSe
displaytickets.setText(String.valueOf(ticketsthere));
boolean bookedupdate = database.ticketsupdate(playnameforthis, currentickets);
if (bookedupdate) {
Boolean input = database.bookinginput(playnameforthis, orderedtickets);
if (input == true) {
Intent screenchange = new Intent(midsummer.this, booked.class);
startActivity(screenchange);
}
} else {
Toast.makeText(midsummer.this, "Please try again.", Toast.LENGTH_SHORT).show();
}
......@@ -83,6 +86,7 @@ public class midsummer extends AppCompatActivity implements AdapterView.OnItemSe
startActivity(intent);
}
});
//This allows the customer to order more or less tickets
Button plusone = findViewById(R.id.plusonehamlet4);
Button minusone = findViewById(R.id.minusonehamlet4);
plusone.setOnClickListener(new View.OnClickListener() {
......
......@@ -30,8 +30,7 @@ public class oedipus extends AppCompatActivity implements AdapterView.OnItemSele
setContentView(R.layout.oedipus);
displayorderedtickets = findViewById(R.id.orderedticketshamlet3);
fullName = (EditText) findViewById(R.id.fullnamehamlet3);
//This sets the spinner
Spinner hamletseatingtype = (Spinner) findViewById(R.id.hamletseatingtype3);
hamletseatingtype.setOnItemSelectedListener(this);
ArrayAdapter aa = new ArrayAdapter(this, android.R.layout.simple_spinner_item, seatings);
......@@ -50,6 +49,7 @@ public class oedipus extends AppCompatActivity implements AdapterView.OnItemSele
String playnameforthis = "Oedipus the King";
int ticketsthere = database.gettickets(playnameforthis);
displaytickets.setText(String.valueOf(ticketsthere));
//This ensures that the number of ordered tickets is acceptable
confirm.setOnClickListener(v -> {
TextView displayorderedtickets = findViewById(R.id.orderedticketshamlet3);
......@@ -62,8 +62,11 @@ public class oedipus extends AppCompatActivity implements AdapterView.OnItemSele
displaytickets.setText(String.valueOf(ticketsthere));
boolean bookedupdate = database.ticketsupdate(playnameforthis, currentickets);
if (bookedupdate) {
Boolean input = database.bookinginput(playnameforthis, orderedtickets);
if (input == true) {
Intent screenchange = new Intent(oedipus.this, booked.class);
startActivity(screenchange);
}
} else {
Toast.makeText(oedipus.this, "Please try again.", Toast.LENGTH_SHORT).show();
}
......@@ -83,6 +86,7 @@ public class oedipus extends AppCompatActivity implements AdapterView.OnItemSele
startActivity(intent);
}
});
//This allows the customer to order tickets
Button plusone = findViewById(R.id.plusonehamlet3);
Button minusone = findViewById(R.id.minusonehamlet3);
plusone.setOnClickListener(new View.OnClickListener() {
......
......@@ -2,6 +2,8 @@ package com.example.playsrus;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.content.ContentValues;
import android.database.sqlite.SQLiteDatabase;
import android.widget.Toast;
import android.widget.EditText;
import android.widget.Spinner;
......@@ -30,7 +32,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
displayorderedtickets = findViewById(R.id.orderedticketshamlet);
fullName = (EditText) findViewById(R.id.fullnamehamlet);
displayplayname = findViewById(R.id.displayplayname);
//This sets the spinner
Spinner seatingtype = (Spinner) findViewById(R.id.hamletseatingtype);
seatingtype.setOnItemSelectedListener(this);
ArrayAdapter aa = new ArrayAdapter(this, android.R.layout.simple_spinner_item, seatings);
......@@ -46,7 +48,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
String playnameforthis = "The Merchant of Venice";
int ticketsthere = database.gettickets(playnameforthis);
displaytickets.setText(String.valueOf(ticketsthere));
//This ensures that the number of ordered tickets is acceptable
confirm.setOnClickListener(v -> {
TextView displayorderedtickets = findViewById(R.id.orderedticketshamlet);
int orderedtickets = Integer.parseInt(displayorderedtickets.getText().toString());
......@@ -58,9 +60,12 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
displaytickets.setText(String.valueOf(ticketsthere));
boolean bookedupdate = database.ticketsupdate(playnameforthis, currentickets);
if (bookedupdate) {
Boolean input = database.bookinginput(playnameforthis, orderedtickets);
if (input == true) {
Intent screenchange = new Intent(seating.this, booked.class);
startActivity(screenchange);
} else {
}
}else {
Toast.makeText(seating.this, "Please try again.", Toast.LENGTH_SHORT).show();
}
......@@ -79,6 +84,7 @@ public class seating extends AppCompatActivity implements AdapterView.OnItemSele
startActivity(intent);
}
});
//This allows the user to order a certain number of tickets
Button plusone = findViewById(R.id.plusonehamlet);
Button minusone = findViewById(R.id.minusonehamlet);
plusone.setOnClickListener(new View.OnClickListener() {
......
......@@ -41,16 +41,16 @@ public class tempest extends AppCompatActivity implements AdapterView.OnItemSele
Button seatingback = (Button) findViewById(R.id.hamletback5);
Intent intent = getIntent();
database = new Database(this);
//This finds and sets the number of tickets
displayorderedtickets.setText(String.valueOf(orderedtickets));
String playName = "The Tempest";
database.playinput(playName, noticket);
database = new Database(this);
TextView displaytickets = findViewById(R.id.hamlettickets5);
String playnameforthis = "The Tempest";
int ticketsthere = database.gettickets(playnameforthis);
displaytickets.setText(String.valueOf(ticketsthere));
//This ensures that the number of ordered tickets is acceptable
confirm.setOnClickListener(v -> {
TextView displayorderedtickets = findViewById(R.id.orderedticketshamlet3);
int orderedtickets = Integer.parseInt(displayorderedtickets.getText().toString());
......@@ -62,8 +62,12 @@ public class tempest extends AppCompatActivity implements AdapterView.OnItemSele
displaytickets.setText(String.valueOf(ticketsthere));
boolean bookedupdate = database.ticketsupdate(playnameforthis, currentickets);
if (bookedupdate) {
Boolean input = database.bookinginput(playnameforthis, orderedtickets);
if (input == true) {
Intent screenchange = new Intent(tempest.this, booked.class);
startActivity(screenchange);
}
} else {
Toast.makeText(tempest.this, "Please try again.", Toast.LENGTH_SHORT).show();
}
......@@ -83,6 +87,7 @@ public class tempest extends AppCompatActivity implements AdapterView.OnItemSele
startActivity(intent);
}
});
//This allows the user to order a certain number of tickets
Button plusone = findViewById(R.id.plusonehamlet5);
Button minusone = findViewById(R.id.minusonehamlet5);
plusone.setOnClickListener(new View.OnClickListener() {
......
......@@ -29,6 +29,7 @@ public class view extends AppCompatActivity {
}
});
}
//This makes sure that if no bookings have been made, it says so.
private void listBookings() {
List<String> findbookings = database.currentbookings();
if (findbookings.isEmpty()) {
......
......@@ -129,6 +129,18 @@
app:layout_constraintHorizontal_bias="0.908"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.826" />
app:layout_constraintVertical_bias="0.791" />
<Button
android:id="@+id/filtered2"
android:layout_width="237dp"
android:layout_height="74dp"
android:text="View Performances With Flashing Lights"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.908"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.939" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -104,6 +104,18 @@
app:layout_constraintHorizontal_bias="0.908"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.826" />
app:layout_constraintVertical_bias="0.773" />
<Button
android:id="@+id/undo2"
android:layout_width="237dp"
android:layout_height="74dp"
android:text="View Performances with Flashing Lights"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.908"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.922" />
</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"
tools:context=".lights">
<TextView
android:id="@+id/textView44"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="List of Performances"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="20sp"
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.096" />
<TextView
android:id="@+id/textView45"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="Plays R Us"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.13"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.043" />
<Button
android:id="@+id/midsummerfilter3"
android:layout_width="143dp"
android:layout_height="86dp"
android:text="A Midsummer Night's Dream"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.865"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.19" />
<Button
android:id="@+id/hamletfilter3"
android:layout_width="143dp"
android:layout_height="86dp"
android:text="Hamlet"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.119"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.19" />
<Button
android:id="@+id/filteredview3"
android:layout_width="143dp"
android:layout_height="60dp"
android:text="View Bookings"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.014"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.83" />
<Button
android:id="@+id/undo5"
android:layout_width="237dp"
android:layout_height="74dp"
android:text="View All"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.908"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.773" />
<Button
android:id="@+id/undo6"
android:layout_width="237dp"
android:layout_height="74dp"
android:text="View Performances with Flashing Lights"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.908"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.922" />
</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