Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dcarfixers
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
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
Tobin
dcarfixers
Commits
b5a38a64
Commit
b5a38a64
authored
Jul 05, 2019
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get booked service
parent
4869bf3e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
2 deletions
+44
-2
Webservices.php
application/controllers/Webservices.php
+21
-2
Webservice_model.php
application/models/Webservice_model.php
+23
-0
No files found.
application/controllers/Webservices.php
View file @
b5a38a64
...
...
@@ -753,7 +753,7 @@
}
//Get Booked Services
public
function
get_
book
ed_services
(){
public
function
get_
allocat
ed_services
(){
header
(
'Content-type: application/json'
);
$headers
=
apache_request_headers
();
...
...
@@ -771,6 +771,25 @@
$bookData
=
$this
->
Webservice_model
->
getBookedService
(
$authRes
[
'data'
][
'customer_id'
]);
echo
json_encode
(
$bookData
);
exit
;
}
public
function
get_booked_services
(){
header
(
'Content-type: application/json'
);
$headers
=
apache_request_headers
();
if
(
!
isset
(
$headers
[
'Auth'
])
||
empty
(
$headers
[
'Auth'
])){
$respArr
[
'status'
]
=
'error'
;
$respArr
[
'message'
]
=
'Authtoken is Required'
;
echo
json_encode
(
$respArr
);
exit
;
}
$authRes
=
$this
->
Webservice_model
->
get_customer_authtoken
(
$headers
[
'Auth'
]);
if
(
$authRes
[
'status'
]
==
'error'
){
echo
json_encode
(
$authRes
);
exit
;
}
$bookData
=
$this
->
Webservice_model
->
get_booked_services
(
$authRes
[
'data'
][
'customer_id'
]);
echo
json_encode
(
$bookData
);
exit
;
}
//Add Vehicle Details
public
function
add_vehicle_details
(){
...
...
@@ -1111,7 +1130,7 @@
}
public
function
book
ed_service_details
(){
public
function
allocat
ed_service_details
(){
header
(
'Content-type: application/json'
);
$headers
=
apache_request_headers
();
...
...
application/models/Webservice_model.php
View file @
b5a38a64
...
...
@@ -201,6 +201,29 @@ class Webservice_model extends CI_Model {
return
$respArr
;
}
public
function
get_booked_services
(
$id
){
$respArr
=
array
(
'status'
=>
'error'
,
'message'
=>
'Something Went Wrong.'
);
if
(
empty
(
$id
)){
return
$respArr
;
}
$this
->
db
->
select
(
"bookings.booking_id as id,bookings.scheduled_date as date,bookings.scheduled_time as time"
);
$this
->
db
->
where
(
'scheduled_date >'
,
date
(
'Y-m-d h:i'
));
$bookData
=
$this
->
db
->
get_where
(
'bookings'
,
array
(
'bookings.customer_id'
=>
$id
))
->
result_array
();
$respArr
[
'status'
]
=
'success'
;
$respArr
[
'message'
]
=
'success'
;
if
(
!
empty
(
$bookData
)
&&
(
count
(
$bookData
)
>
0
)){
foreach
(
$bookData
as
$key
=>
$value
)
{
$bookData
[
$key
][
'date'
]
=
(
string
)
strtotime
(
$value
[
'date'
])
*
1000
;
$bookData
[
$key
][
'date'
]
=
$bookData
[
$key
][
'date'
]
.
""
;
}
$respArr
[
'data'
]
=
$bookData
;
}
else
{
$respArr
[
'data'
]
=
[];
}
return
$respArr
;
}
public
function
addVehicleDetails
(
$postData
=
array
(),
$customer_id
=
''
){
$respArr
=
array
(
'status'
=>
'error'
,
'message'
=>
'Something Went Wrong.'
);
if
(
empty
(
$postData
)){
...
...
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