Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
TimeOutAdmin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
TimeOut
TimeOutAdmin
Commits
35b13554
Commit
35b13554
authored
Mar 30, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api for checker
parent
3a1f9d8f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
0 deletions
+105
-0
Api.php
application/controllers/Api.php
+23
-0
Api_model.php
application/models/Api_model.php
+54
-0
Validation_model.php
application/models/Validation_model.php
+28
-0
No files found.
application/controllers/Api.php
View file @
35b13554
...
...
@@ -499,5 +499,27 @@ class Api extends CI_Controller {
);
return
$BayanPayArray
;
}
public
function
checker_bookingDetails
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Api_model
->
checkerbookingdetails
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
checker_login
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Api_model
->
checker_login
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
}
?>
\ No newline at end of file
application/models/Api_model.php
View file @
35b13554
...
...
@@ -951,5 +951,59 @@ class Api_model extends CI_Model {
}
return
$res
;
}
public
function
checker_login
(
$data
){
try
{
$this
->
db
->
where
(
'status'
,
1
);
$this
->
db
->
where
(
'password'
,
md5
(
$data
[
'password'
]));
$this
->
db
->
where
(
'username'
,
$data
[
'email'
]);
$this
->
db
->
from
(
'checker'
);
$result
=
$this
->
db
->
get
()
->
row
();
if
(
$result
){
$res
=
array
(
'status'
=>
1
,
'data'
=>
array
(
'checker_id'
=>
$result
->
id
));
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Invalid Email Id / Password'
,
'code'
=>
'ER05'
);
}
}
catch
(
Exception
$e
)
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something went South!!'
,
'code'
=>
'ER06'
);
}
return
$res
;
}
function
checkerbookingdetails
(
$data
)
{
try
{
$count
=
$this
->
db
->
get_where
(
'checker'
,
array
(
'id'
=>
$data
[
'checker_id'
]))
->
num_rows
();
if
(
$count
>
0
){
$result
=
$this
->
db
->
select
(
'booking.id AS book_id,booking.bookId,customer.name AS customer_name,
booking.status,booking.no_of_ticket,booking.qrcode,
booking.ticket_details,booking.booking_date'
)
->
where
(
'booking.bookId'
,
$data
[
'qr_pin'
])
->
from
(
'booking'
)
->
join
(
'events'
,
'booking.event_id = events.event_id'
)
->
join
(
'event_date_time'
,
'booking.event_date_id = event_date_time.id'
)
->
join
(
'venue'
,
'venue.id = events.venue_id'
)
->
join
(
'event_gallery'
,
'events.event_id = event_gallery.event_id'
,
'LEFT'
)
->
join
(
'customer'
,
'customer.customer_id = booking.customer_id'
)
->
join
(
'host_categories'
,
'venue.host_cat_id = host_categories.host_cat_id'
)
->
group_by
(
'booking.bookId'
)
->
get
()
->
row
();
if
(
count
(
$result
)
>
0
){
$result
->
seat_class
=
''
;
if
(
!
empty
(
$ticketDetls
=
json_decode
(
$result
->
ticket_details
))){
$result
->
seat_class
=
$ticketDetls
[
0
]
->
color
;
}
$res
=
array
(
'status'
=>
1
,
'data'
=>
$result
);
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Invalid booking code'
,
'code'
=>
'ER24'
);
}
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Checker Doesnot Exist'
,
'code'
=>
'ER24'
);
}
}
catch
(
Exception
$e
)
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something went South!!'
,
'code'
=>
'ER06'
);
}
return
$res
;
}
}
?>
application/models/Validation_model.php
View file @
35b13554
...
...
@@ -296,6 +296,34 @@ class Validation_model extends CI_Model {
)
)
)
,
'checker_bookingDetails'
=>
array
(
'qr_pin'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER17'
,
'message'
=>
'Booking Id is null or empty'
)
,
)
,
'checker_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER20'
,
'message'
=>
'User Id is null or empty'
)
,
)
)
,
'checker_login'
=>
array
(
'email'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER17'
,
'message'
=>
'Email Id is null or empty'
)
)
,
'password'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER20'
,
'message'
=>
'Password is null or empty'
)
)
)
,
'payNow'
=>
array
(),
'searchEvent'
=>
array
()
);
...
...
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