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
b92a545f
Commit
b92a545f
authored
Nov 11, 2019
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checker details
parent
12e7b90a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
151 additions
and
148 deletions
+151
-148
Api.php
application/controllers/Api.php
+36
-0
OrganizerServices.php
application/controllers/OrganizerServices.php
+0
-34
Api_model.php
application/models/Api_model.php
+115
-54
Organizer_model.php
application/models/Organizer_model.php
+0
-60
No files found.
application/controllers/Api.php
View file @
b92a545f
...
@@ -658,5 +658,41 @@ class Api extends CI_Controller {
...
@@ -658,5 +658,41 @@ class Api extends CI_Controller {
return
$original_plaintext
;
return
$original_plaintext
;
}
}
}
}
/*================ START : Checker API ================*/
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'
]);
}
}
public
function
getCheckerBookList
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Api_model
->
getOrganiserBookList
(
$data
);
if
(
isset
(
$res
[
'data'
])
&&
!
empty
(
$res
[
'data'
])){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
/*================ END : Checker API ================*/
}
}
?>
?>
application/controllers/OrganizerServices.php
View file @
b92a545f
...
@@ -330,40 +330,6 @@ class OrganizerServices extends CI_Controller {
...
@@ -330,40 +330,6 @@ class OrganizerServices extends CI_Controller {
}
}
}
}
/****************************Checker Api**************************************/
public
function
checker_bookingDetails
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_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
->
Organizer_model
->
checker_login
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
// public function getCheckerBookList(){
// $data = (array) json_decode(file_get_contents('php://input'));
// $res = $this->Api_model->getOrganiserBookList($data);
// if(isset($res['data']) && !empty($res['data'])){
// $this->response($res['data']);
// }
// else{
// $this->errorResponse($res['code'],$res['message']);
// }
// }
/*================ END : Organizer API ================*/
/*================ END : Organizer API ================*/
}
}
?>
?>
application/models/Api_model.php
View file @
b92a545f
...
@@ -1700,58 +1700,119 @@ class Api_model extends CI_Model {
...
@@ -1700,58 +1700,119 @@ class Api_model extends CI_Model {
/*================ START : Checker API ================*/
/*================ START : Checker API ================*/
// function getCheckerBookList($data) {
public
function
checker_login
(
$data
){
// try {
try
{
// $checker_id = $data['checker_id'];
$this
->
db
->
where
(
'status'
,
1
);
// $count = $this->db->get_where('checker',array('id'=>$checker_id,'status'=>'1'))->num_rows();
$this
->
db
->
where
(
'password'
,
md5
(
$data
[
'password'
]));
// if($count > 0){
$this
->
db
->
where
(
'username'
,
$data
[
'email'
]);
// $sql = "SELECT BOOK.bookId AS booking_id
$this
->
db
->
from
(
'checker'
);
// FROM checker_bookings AS CBOOK
$result
=
$this
->
db
->
get
()
->
row
();
// INNER JOIN checker AS CHK ON (CHK.id=$checker_id)
if
(
$result
){
// INNER JOIN booking AS BOOK ON (BOOK.bookId=CBOOK.booking_id)
$res
=
array
(
'status'
=>
1
,
'data'
=>
array
(
'checker_id'
=>
$result
->
id
));
// INNER JOIN events AS EVT ON (EVT.event_id=BOOK.event_id)
}
else
{
// WHERE EVT.provider_id=CHK.provider_id AND BOOK.status='1'";
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Invalid Email Id / Password'
,
'code'
=>
'ER05'
);
// $count = $this->db->query($sql)->num_rows();
}
}
catch
(
Exception
$e
)
{
// if($count > 0) {
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something went South!!'
,
'code'
=>
'ER06'
);
// $perPage = 10;
}
// $page = (isset($data['page']))?$data['page']:1;
return
$res
;
// $limit = ($page - 1) * $perPage;
}
// $meta = array('total_pages'=>ceil($count/$perPage),'total'=>$count,
// 'current_page'=>$page,'per_page'=>$perPage);
function
checkerbookingdetails
(
$data
)
{
// if($count > $limit) {
try
{
$count
=
$this
->
db
->
get_where
(
'checker'
,
array
(
'id'
=>
$data
[
'checker_id'
]))
->
num_rows
();
// $sql = "SELECT TEVT.event_name,TCAT.category_name,CUST.name,EDATE.date,
if
(
$count
>
0
){
// EDATE.time,BOOK.amount,BOOK.bookId AS booking_id
$result
=
$this
->
db
// FROM checker_bookings AS CBOOK
->
select
(
'booking.id AS book_id,booking.bookId,customer.name AS customer_name,
// INNER JOIN checker AS CHK ON (CHK.id=CBOOK.checker_id)
booking.status,booking.no_of_ticket,booking.qrcode,
// INNER JOIN booking AS BOOK ON (BOOK.bookId=CBOOK.booking_id)
booking.ticket_details,event_date_time.date AS booking_date'
)
// INNER JOIN events AS EVT ON (EVT.event_id=BOOK.event_id AND
->
where
(
'booking.bookId'
,
$data
[
'qr_pin'
])
// EVT.provider_id=CHK.provider_id)
->
from
(
'booking'
)
// INNER JOIN event_date_time AS EDATE ON (EDATE.event_id=EVT.event_id)
->
join
(
'events'
,
'booking.event_id = events.event_id'
)
// INNER JOIN event_category AS CAT ON (CAT.cat_id=EVT.category_id)
->
join
(
'event_date_time'
,
'booking.event_date_id = event_date_time.id'
)
// INNER JOIN customer AS CUST ON (CUST.customer_id=BOOK.customer_id)
->
join
(
'venue'
,
'venue.id = events.venue_id'
)
// INNER JOIN translator_event AS TEVT ON (TEVT.event_id=EVT.event_id)
->
join
(
'event_gallery'
,
'events.event_id = event_gallery.event_id'
,
'LEFT'
)
// INNER JOIN translator_category AS TCAT ON (TCAT.category_id=CAT.cat_id)
->
join
(
'customer'
,
'customer.customer_id = booking.customer_id'
)
// WHERE CBOOK.checker_id='$checker_id' AND TEVT.language_code='EN' AND
->
join
(
'host_categories'
,
'venue.host_cat_id = host_categories.host_cat_id'
)
// TCAT.language_code='EN' AND BOOK.status='1'";
->
group_by
(
'booking.bookId'
)
->
get
()
->
row
();
// $result = $this->db->query($sql)->result();
if
(
count
(
$result
)
>
0
){
$result
->
seat_class
=
''
;
// $resp = array('data'=>$result,'meta'=>$meta);
if
(
!
empty
(
$ticketDetls
=
json_decode
(
$result
->
ticket_details
))){
// $res = array('status'=>1,'message'=>'Successfully','data'=>$resp);
if
(
is_array
(
$ticketDetls
)
&&
isset
(
$ticketDetls
[
0
])
&&
isset
(
$ticketDetls
[
0
]
->
color
)){
// } else {
$result
->
seat_class
=
$ticketDetls
[
0
]
->
color
;
// $resp = array('data'=>[],'meta'=>$meta);
}
else
if
(
isset
(
$ticketDetls
->
color
)){
// $res = array('status'=>1,'message'=>'No More Data Found','data'=>$resp);
$result
->
seat_class
=
$ticketDetls
->
color
;
// }
}
// } else {
}
// $res = array('status'=>0,'message'=>'No Record Found','code'=>'ER24');
$this
->
db
->
insert
(
'checker_bookings'
,
// }
array
(
'checker_id'
=>
$data
[
'checker_id'
],
'booking_id'
=>
$data
[
'qr_pin'
],
// } else {
'checked_time'
=>
date
(
'Y-m-d H:i:s'
)));
// $res = array('status'=>0,'message'=>'Checker Doesnot Exist','code'=>'ER25');
// }
$res
=
array
(
'status'
=>
1
,
'data'
=>
$result
);
// } catch(Exception $e) {
}
else
{
// $res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Invalid booking code'
,
'code'
=>
'ER24'
);
// }
}
// return $res;
}
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
;
}
function
getCheckerBookList
(
$data
)
{
try
{
$checker_id
=
$data
[
'checker_id'
];
$count
=
$this
->
db
->
get_where
(
'checker'
,
array
(
'id'
=>
$checker_id
,
'status'
=>
'1'
))
->
num_rows
();
if
(
$count
>
0
){
$sql
=
"SELECT BOOK.bookId AS booking_id
FROM checker_bookings AS CBOOK
INNER JOIN checker AS CHK ON (CHK.id=
$checker_id
)
INNER JOIN booking AS BOOK ON (BOOK.bookId=CBOOK.booking_id)
INNER JOIN events AS EVT ON (EVT.event_id=BOOK.event_id)
WHERE EVT.provider_id=CHK.provider_id AND BOOK.status='1'"
;
$count
=
$this
->
db
->
query
(
$sql
)
->
num_rows
();
if
(
$count
>
0
)
{
$perPage
=
10
;
$page
=
(
isset
(
$data
[
'page'
]))
?
$data
[
'page'
]
:
1
;
$limit
=
(
$page
-
1
)
*
$perPage
;
$meta
=
array
(
'total_pages'
=>
ceil
(
$count
/
$perPage
),
'total'
=>
$count
,
'current_page'
=>
$page
,
'per_page'
=>
$perPage
);
if
(
$count
>
$limit
)
{
$sql
=
"SELECT TEVT.event_name,TCAT.category_name,CUST.name,EDATE.date,
EDATE.time,BOOK.amount,BOOK.bookId AS booking_id
FROM checker_bookings AS CBOOK
INNER JOIN checker AS CHK ON (CHK.id=CBOOK.checker_id)
INNER JOIN booking AS BOOK ON (BOOK.bookId=CBOOK.booking_id)
INNER JOIN events AS EVT ON (EVT.event_id=BOOK.event_id AND
EVT.provider_id=CHK.provider_id)
INNER JOIN event_date_time AS EDATE ON (EDATE.event_id=EVT.event_id)
INNER JOIN event_category AS CAT ON (CAT.cat_id=EVT.category_id)
INNER JOIN customer AS CUST ON (CUST.customer_id=BOOK.customer_id)
INNER JOIN translator_event AS TEVT ON (TEVT.event_id=EVT.event_id)
INNER JOIN translator_category AS TCAT ON (TCAT.category_id=CAT.cat_id)
WHERE CBOOK.checker_id='
$checker_id
' AND TEVT.language_code='EN' AND
TCAT.language_code='EN' AND BOOK.status='1'"
;
$result
=
$this
->
db
->
query
(
$sql
)
->
result
();
$resp
=
array
(
'data'
=>
$result
,
'meta'
=>
$meta
);
$res
=
array
(
'status'
=>
1
,
'message'
=>
'Successfully'
,
'data'
=>
$resp
);
}
else
{
$resp
=
array
(
'data'
=>
[],
'meta'
=>
$meta
);
$res
=
array
(
'status'
=>
1
,
'message'
=>
'No More Data Found'
,
'data'
=>
$resp
);
}
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'No Record Found'
,
'code'
=>
'ER24'
);
}
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Checker Doesnot Exist'
,
'code'
=>
'ER25'
);
}
}
catch
(
Exception
$e
)
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something went South!!'
,
'code'
=>
'ER06'
);
}
return
$res
;
}
}
?>
}
?>
application/models/Organizer_model.php
View file @
b92a545f
...
@@ -985,66 +985,6 @@ class Organizer_model extends CI_Model {
...
@@ -985,66 +985,6 @@ class Organizer_model extends CI_Model {
return
$res
;
return
$res
;
}
}
public
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,event_date_time.date AS 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
))){
if
(
is_array
(
$ticketDetls
)
&&
isset
(
$ticketDetls
[
0
])
&&
isset
(
$ticketDetls
[
0
]
->
color
)){
$result
->
seat_class
=
$ticketDetls
[
0
]
->
color
;
}
else
if
(
isset
(
$ticketDetls
->
color
)){
$result
->
seat_class
=
$ticketDetls
->
color
;
}
}
$this
->
db
->
insert
(
'checker_bookings'
,
array
(
'checker_id'
=>
$data
[
'checker_id'
],
'booking_id'
=>
$data
[
'qr_pin'
],
'checked_time'
=>
date
(
'Y-m-d H:i:s'
)));
$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
;
}
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
;
}
}
}
?>
?>
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