Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
parkingo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
SHAILESH KUMAR
parkingo
Commits
5b4c0cf0
Commit
5b4c0cf0
authored
Nov 08, 2019
by
Bhavesh Yadav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added checkout receipt
parent
9d7a6b2a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
94 additions
and
2 deletions
+94
-2
.idea/caches/build_file_checksums.ser
.idea/caches/build_file_checksums.ser
+0
-0
.idea/render.experimental.xml
.idea/render.experimental.xml
+6
-0
app/src/main/java/com/example/shady/parkingo/checkout.java
app/src/main/java/com/example/shady/parkingo/checkout.java
+4
-0
app/src/main/java/com/example/shady/parkingo/sqlite_ops.java
app/src/main/java/com/example/shady/parkingo/sqlite_ops.java
+2
-1
app/src/main/java/com/example/shady/parkingo/ticket.java
app/src/main/java/com/example/shady/parkingo/ticket.java
+26
-1
app/src/main/res/layout/ticket_layout.xml
app/src/main/res/layout/ticket_layout.xml
+56
-0
No files found.
.idea/caches/build_file_checksums.ser
View file @
5b4c0cf0
No preview for this file type
.idea/render.experimental.xml
0 → 100644
View file @
5b4c0cf0
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"RenderSettings"
>
<option
name=
"showDecorations"
value=
"true"
/>
</component>
</project>
\ No newline at end of file
app/src/main/java/com/example/shady/parkingo/checkout.java
View file @
5b4c0cf0
...
...
@@ -71,6 +71,10 @@ public class checkout extends Activity {
else
{
sqlite_ops
so
=
new
sqlite_ops
(
this
);
if
(
so
.
check_out
(
slot_number
,
Long
.
parseLong
(
ticket_number
))){
Intent
i
=
new
Intent
(
this
,
ticket
.
class
);
i
.
putExtra
(
"ticket_no"
,
Long
.
parseLong
(
ticket_number
));
i
.
putExtra
(
"checkout"
,
true
);
startActivity
(
i
);
Toast
.
makeText
(
this
,
"Successfully,Checked Out"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
...
...
app/src/main/java/com/example/shady/parkingo/sqlite_ops.java
View file @
5b4c0cf0
...
...
@@ -141,7 +141,7 @@ public class sqlite_ops extends SQLiteOpenHelper{
public
ArrayList
getTicketDetails
(
long
ticket_no
)
{
ArrayList
al
=
new
ArrayList
();
SQLiteDatabase
db
=
this
.
getWritableDatabase
();
Cursor
cr
=
db
.
query
(
"records"
,
new
String
[]{
"tkt_no"
,
"slot"
,
"vehicle"
,
"check_in"
},
"tkt_no=?"
,
new
String
[]{
Long
.
toString
(
ticket_no
)},
null
,
null
,
null
,
null
);
Cursor
cr
=
db
.
query
(
"records"
,
new
String
[]{
"tkt_no"
,
"slot"
,
"vehicle"
,
"check_in"
,
"check_out"
},
"tkt_no=?"
,
new
String
[]{
Long
.
toString
(
ticket_no
)},
null
,
null
,
null
,
null
);
if
(
cr
!=
null
){
cr
.
moveToFirst
();
if
(
cr
.
getCount
()>
0
){
...
...
@@ -149,6 +149,7 @@ public class sqlite_ops extends SQLiteOpenHelper{
al
.
add
(
1
,
cr
.
getString
(
cr
.
getColumnIndex
(
"slot"
)));
al
.
add
(
2
,
cr
.
getString
(
cr
.
getColumnIndex
(
"vehicle"
)));
al
.
add
(
3
,
cr
.
getString
(
cr
.
getColumnIndex
(
"check_in"
)));
al
.
add
(
4
,
cr
.
getString
(
cr
.
getColumnIndex
(
"check_out"
)));
}
else
{
al
.
add
(
0
,
ticket_no
);
...
...
app/src/main/java/com/example/shady/parkingo/ticket.java
View file @
5b4c0cf0
...
...
@@ -3,6 +3,7 @@ package com.example.shady.parkingo;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.View
;
import
android.widget.TextView
;
import
android.widget.Toast
;
...
...
@@ -10,7 +11,8 @@ import android.widget.Toast;
import
java.util.ArrayList
;
public
class
ticket
extends
Activity
{
TextView
slot
,
tkt
,
time_tv
,
date_tv
,
vehicle
;
TextView
slot
,
tkt
,
time_tv
,
date_tv
,
vehicle
,
ticket_title
,
checkout_label
,
checkout_time
;
TextView
checkout_date_label
,
checkout_date
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
...
...
@@ -21,6 +23,11 @@ public class ticket extends Activity {
tkt
=
findViewById
(
R
.
id
.
ticket
);
time_tv
=
findViewById
(
R
.
id
.
time_tv
);
date_tv
=
findViewById
(
R
.
id
.
date_tv
);
ticket_title
=
findViewById
(
R
.
id
.
ticket_title
);
checkout_label
=
findViewById
(
R
.
id
.
checkout_label
);
checkout_time
=
findViewById
(
R
.
id
.
checkout_time
);
checkout_date
=
findViewById
(
R
.
id
.
checkout_date
);
checkout_date_label
=
findViewById
(
R
.
id
.
checkout_date_label
);
Intent
i
=
getIntent
();
long
ticket_no
;
if
(
i
.
hasExtra
(
"ticket_no"
)){
...
...
@@ -33,6 +40,24 @@ public class ticket extends Activity {
sqlite_ops
so
=
new
sqlite_ops
(
this
);
ArrayList
data
=
so
.
getTicketDetails
(
ticket_no
);
if
(
i
.
hasExtra
(
"checkout"
)){
Log
.
d
(
"CHECKOUT"
,
"successfully checkout out"
);
ticket_title
.
setText
(
"Checkout Receipt"
);
checkout_label
.
setVisibility
(
View
.
VISIBLE
);
checkout_time
.
setVisibility
(
View
.
VISIBLE
);
checkout_date
.
setVisibility
(
View
.
VISIBLE
);
checkout_date_label
.
setVisibility
(
View
.
VISIBLE
);
String
checkout_date_data
=
data
.
get
(
4
).
toString
();
String
[]
checkoutdateandtime
=
checkout_date_data
.
split
(
" "
);
checkout_date
.
setText
(
checkoutdateandtime
[
0
]);
checkout_time
.
setText
(
checkoutdateandtime
[
1
]);
}
else
{
ticket_title
.
setText
(
"Parking Ticket"
);
checkout_label
.
setVisibility
(
View
.
INVISIBLE
);
checkout_time
.
setVisibility
(
View
.
INVISIBLE
);
checkout_date
.
setVisibility
(
View
.
INVISIBLE
);
checkout_date_label
.
setVisibility
(
View
.
INVISIBLE
);
}
slot
.
setText
(
data
.
get
(
1
).
toString
());
tkt
.
setText
(
data
.
get
(
0
).
toString
());
String
date_data
=
data
.
get
(
3
).
toString
();
...
...
app/src/main/res/layout/ticket_layout.xml
View file @
5b4c0cf0
...
...
@@ -14,6 +14,7 @@
android:background=
"#fff"
android:padding=
"30sp"
>
<TextView
android:id=
"@+id/ticket_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Parking Ticket"
...
...
@@ -127,6 +128,61 @@
android:textColor=
"#000"
android:textSize=
"20sp"
android:text=
"parking slot"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"25dp"
android:gravity=
"left"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/checkout_date_label"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Checkout Date:"
android:textColor=
"#000"
android:gravity=
"left"
android:textSize=
"20sp"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/checkout_date"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"20sp"
android:textColor=
"#000"
android:textStyle=
"bold"
android:paddingLeft=
"10dp"
android:text=
"Date here"
android:visibility=
"gone"
/>
</LinearLayout>
<LinearLayout
android:layout_marginTop=
"5dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:gravity=
"left"
>
<TextView
android:id=
"@+id/checkout_label"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Checkout Time:"
android:textSize=
"20sp"
android:textColor=
"#000"
android:visibility=
"gone"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/checkout_time"
android:textSize=
"20sp"
android:textColor=
"#000"
android:textStyle=
"bold"
android:paddingLeft=
"10dp"
android:text=
"time here"
android:visibility=
"gone"
/>
</LinearLayout>
<LinearLayout
android:layout_marginTop=
"25dp"
...
...
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