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
18df11cb
Commit
18df11cb
authored
Jun 28, 2019
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get customer vehicle
parent
6e432117
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
5 deletions
+35
-5
Webservices.php
application/controllers/Webservices.php
+23
-0
Vehicle_model.php
application/models/Vehicle_model.php
+12
-5
No files found.
application/controllers/Webservices.php
View file @
18df11cb
...
@@ -2877,5 +2877,28 @@
...
@@ -2877,5 +2877,28 @@
$result
=
$this
->
Webservice_model
->
rateProduct
(
$postData
);
$result
=
$this
->
Webservice_model
->
rateProduct
(
$postData
);
echo
json_encode
(
$result
);
exit
;
echo
json_encode
(
$result
);
exit
;
}
}
public
function
get_my_vehicles
(){
header
(
'Content-type:application/json'
);
$headers
=
apache_request_headers
();
$this
->
load
->
model
(
'Vehicle_model'
);
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
;
}
$postData
[
'customer_id'
]
=
$authRes
[
'data'
][
'customer_id'
];
$result
=
$this
->
Vehicle_model
->
getCustVechiles
(
$postData
);
$respArr
[
'status'
]
=
"success"
;
$respArr
[
'data'
]
=
$result
;
echo
json_encode
(
$respArr
);
exit
;
}
}
}
?>
?>
application/models/Vehicle_model.php
View file @
18df11cb
...
@@ -41,11 +41,18 @@ class Vehicle_model extends CI_Model {
...
@@ -41,11 +41,18 @@ class Vehicle_model extends CI_Model {
if
(
!
empty
(
$vehData
)){
if
(
!
empty
(
$vehData
)){
$vehData
=
$vehData
->
result
();
$vehData
=
$vehData
->
result
();
foreach
(
$vehData
as
$key
=>
$value
)
{
foreach
(
$vehData
as
$key
=>
$value
)
{
$make
=
$this
->
db
->
get_where
(
'vehicles_brand'
,
array
(
'maker'
=>
$value
->
car_maker
))
->
row
();
// $make = $this->db->get_where('vehicles_brand',array('maker'=>$value->car_maker))->row();
$vehData
[
$key
]
->
veh_brand_id
=
$make
->
veh_brand_id
;
// $vehData[$key]->veh_brand_id = $make->veh_brand_id;
$model
=
$this
->
db
->
get_where
(
'vehicles_model'
,
array
(
'model'
=>
$value
->
car_model
,
'veh_brand_id'
=>
$make
->
veh_brand_id
))
->
row
();
// $model = $this->db->get_where('vehicles_model',array('model'=>$value->car_model,'veh_brand_id'=>$make->veh_brand_id))->row();
$vehData
[
$key
]
->
veh_model_id
=
$model
->
veh_modal_id
;
// $vehData[$key]->veh_model_id = $model->veh_modal_id;
$result
=
$this
->
db
->
query
(
"SELECT VEHM.veh_brand_id,VEHM.veh_modal_id
FROM vehicles_model AS VEHM
WHERE VEHM.model='"
.
$value
->
car_model
.
"'"
)
->
row
();
if
(
!
empty
(
$result
)){
$vehData
[
$key
]
->
veh_brand_id
=
$result
->
veh_brand_id
;
$vehData
[
$key
]
->
veh_model_id
=
$result
->
veh_modal_id
;
}
}
}
return
$vehData
;
return
$vehData
;
}
}
...
...
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