Commit 67e195a8 authored by austin.blanke's avatar austin.blanke

Working On Booking Page

parent c9c1871d
...@@ -104,23 +104,6 @@ public class DatabaseConnector extends SQLiteOpenHelper { ...@@ -104,23 +104,6 @@ public class DatabaseConnector extends SQLiteOpenHelper {
play1.put(COLUMN_STEPS, "false"); play1.put(COLUMN_STEPS, "false");
play1.put(COLUMN_TICSEAT, 17); play1.put(COLUMN_TICSEAT, 17);
play1.put(COLUMN_TICSEATCOST, 8); play1.put(COLUMN_TICSEATCOST, 8);
play1.put(COLUMN_TICSTAND, 0);
play1.put(COLUMN_TICSTANDCOST, 0);
play1.put(COLUMN_TICSTAGE, 0);
play1.put(COLUMN_TICSTAGECOST, 0);
play1.put(COLUMN_TICGRASS, 0);
play1.put(COLUMN_TICGRASSCOST, 0);
play1.put(COLUMN_TICBOATA, 0);
play1.put(COLUMN_TICBOATACOST, 0);
play1.put(COLUMN_TICBOATB, 0);
play1.put(COLUMN_TICBOATBCOST, 0);
play1.put(COLUMN_TICRIVERBANK, 0);
play1.put(COLUMN_TICRIVERBANKCOST, 0);
play1.put(COLUMN_TICINNERCIRCLE, 0);
play1.put(COLUMN_TICINNERCIRCLECOST, 0);
play1.put(COLUMN_TICOUTTERCIRCLE, 0);
play1.put(COLUMN_TICOUTTERCIRCLECOST, 0);
db.insert(TABLE_PERFORMANCES, null, play1); db.insert(TABLE_PERFORMANCES, null, play1);
ContentValues play2 = new ContentValues(); ContentValues play2 = new ContentValues();
...@@ -240,14 +223,16 @@ public class DatabaseConnector extends SQLiteOpenHelper { ...@@ -240,14 +223,16 @@ 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();
for(int i=8;i<16;i++){ for(int i=8;i<26;i = i+2){
if(Integer.valueOf((cursor.getString(i))) != 0){ if(cursor.getString(i) != null){
count = count + 1; count = count + 1;
if(count==t){ if(count==t){
result = cursor.getString(i+1).toString(); result = cursor.getString(i+1);
} }
} }
} }
if (result == null) {result = "";}
cursor.close(); cursor.close();
db.close(); db.close();
return result; return result;
...@@ -260,14 +245,15 @@ public class DatabaseConnector extends SQLiteOpenHelper { ...@@ -260,14 +245,15 @@ 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();
for(int i=8;i<26;i++){ for(int i=8;i<26;i = i + 2){
if(cursor.getString(i) != null){ if(cursor.getString(i) != null){
count = count + 1; count = count + 1;
if(count==t){ if(count==t){
result = cursor.getString(i+1).toString(); result = cursor.getString(i+1);
} }
} }
} }
if (result == null || result == "0") {result = "";}
cursor.close(); cursor.close();
db.close(); db.close();
return result; return result;
......
...@@ -5,6 +5,48 @@ ...@@ -5,6 +5,48 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<EditText
android:id="@+id/bookTicket1Cnt"
android:layout_width="163dp"
android:layout_height="48dp"
android:ems="10"
android:hint="Input Ticket Count"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.883"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.572" />
<EditText
android:id="@+id/bookTicket2Cnt"
android:layout_width="161dp"
android:layout_height="48dp"
android:ems="10"
android:hint="Input Ticket Count"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.876"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.653" />
<EditText
android:id="@+id/bookTicket3Cnt"
android:layout_width="161dp"
android:layout_height="48dp"
android:ems="10"
android:hint="Input Ticket Count"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.884"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.733" />
<Button <Button
android:id="@+id/BookNow" android:id="@+id/BookNow"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -29,7 +71,7 @@ ...@@ -29,7 +71,7 @@
app:layout_constraintHorizontal_bias="0.495" app:layout_constraintHorizontal_bias="0.495"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.097" /> app:layout_constraintVertical_bias="0.025" />
<TextView <TextView
android:id="@+id/date" android:id="@+id/date"
...@@ -39,13 +81,14 @@ ...@@ -39,13 +81,14 @@
android:textSize="24sp" android:textSize="24sp"
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.197" app:layout_constraintHorizontal_bias="0.18"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.257" /> app:layout_constraintVertical_bias="0.181" />
<TextView <TextView
android:id="@+id/flash" android:id="@+id/stairs"
android:layout_width="107dp" android:layout_width="107dp"
android:layout_height="39dp" android:layout_height="39dp"
android:text="TextView" android:text="TextView"
...@@ -54,94 +97,94 @@ ...@@ -54,94 +97,94 @@
app:layout_constraintHorizontal_bias="0.799" app:layout_constraintHorizontal_bias="0.799"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.359" /> app:layout_constraintVertical_bias="0.439" />
<TextView <TextView
android:id="@+id/tickets2" android:id="@+id/time"
android:layout_width="107dp" android:layout_width="107dp"
android:layout_height="39dp" android:layout_height="39dp"
android:text="TextView" android:text="TextView"
android:textSize="24sp"
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.197" app:layout_constraintHorizontal_bias="0.799"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.547" app:layout_constraintVertical_bias="0.18" />
tools:ignore="DuplicateIds" />
<TextView <TextView
android:id="@+id/tickets3" android:id="@+id/flash"
android:layout_width="107dp" android:layout_width="107dp"
android:layout_height="39dp" android:layout_height="39dp"
android:text="TextView" android:text="TextView"
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.197" app:layout_constraintHorizontal_bias="0.799"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.619" app:layout_constraintVertical_bias="0.283" />
tools:ignore="DuplicateIds" />
<TextView <TextView
android:id="@+id/tickets1" android:id="@+id/wheelchair"
android:layout_width="107dp" android:layout_width="107dp"
android:layout_height="39dp" android:layout_height="39dp"
android:text="TextView" android:text="TextView"
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.197" app:layout_constraintHorizontal_bias="0.799"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.478" app:layout_constraintVertical_bias="0.362" />
tools:ignore="DuplicateIds" />
<TextView <TextView
android:id="@+id/stairs" android:id="@+id/location"
android:layout_width="107dp" android:layout_width="145dp"
android:layout_height="39dp" android:layout_height="55dp"
android:text="TextView" android:text="TextView"
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.799" app:layout_constraintHorizontal_bias="0.15"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.515" /> app:layout_constraintVertical_bias="0.289" />
<TextView <TextView
android:id="@+id/wheelchair" android:id="@+id/tickets1"
android:layout_width="107dp" android:layout_width="165dp"
android:layout_height="39dp" android:layout_height="44dp"
android:text="TextView" android:text="TextView"
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.799" app:layout_constraintHorizontal_bias="0.134"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.439" /> app:layout_constraintVertical_bias="0.569"
tools:ignore="DuplicateIds" />
<TextView <TextView
android:id="@+id/location" android:id="@+id/tickets3"
android:layout_width="145dp" android:layout_width="167dp"
android:layout_height="55dp" android:layout_height="46dp"
android:text="TextView" android:text="TextView"
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.197" app:layout_constraintHorizontal_bias="0.135"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.368" /> app:layout_constraintVertical_bias="0.731"
tools:ignore="DuplicateIds" />
<TextView <TextView
android:id="@+id/time" android:id="@+id/tickets2"
android:layout_width="107dp" android:layout_width="167dp"
android:layout_height="39dp" android:layout_height="47dp"
android:text="TextView" android:text="TextView"
android:textSize="24sp"
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.799" app:layout_constraintHorizontal_bias="0.134"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.257" /> app:layout_constraintVertical_bias="0.651"
tools:ignore="DuplicateIds" />
</androidx.constraintlayout.widget.ConstraintLayout> </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