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
f4f71a89
Commit
f4f71a89
authored
Jun 12, 2019
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vin audit,import data
parent
3a9b920d
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
80 additions
and
23 deletions
+80
-23
Brand.php
application/controllers/Brand.php
+28
-0
Product.php
application/controllers/Product.php
+5
-2
Webservices.php
application/controllers/Webservices.php
+29
-15
Booking_model.php
application/models/Booking_model.php
+1
-0
Product_model.php
application/models/Product_model.php
+2
-1
list-customer-users.php
application/views/Customer/list-customer-users.php
+4
-1
viewMechanic.php
application/views/Mechanic/viewMechanic.php
+4
-1
list_orders.php
application/views/Orders/list_orders.php
+3
-1
addproduct.php
application/views/Product/addproduct.php
+1
-1
viewProduct.php
application/views/Product/viewProduct.php
+3
-1
No files found.
application/controllers/Brand.php
View file @
f4f71a89
...
...
@@ -155,6 +155,33 @@ class Brand extends CI_Controller {
}
}
// public function import_data(){
// $template['page'] = 'Brand/importdata';
// $template['menu'] = 'brand Management';
// $template['smenu'] = 'Edit brand';
// $template['pTitle'] = "Edit brand";
// $template['brand_id'] = '';
// $template['pDescription'] = "Update brand Data";
// $this->load->view('template',$template);
// }
// public function importCsvData(){
// $filename=$_FILES["brand_logo"]["name"];
// $ext=pathinfo($filename, PATHINFO_EXTENSION);
// if($ext=="csv")
// {
// $file = fopen($filename, "r");
// while (($emapData = fgetcsv($file, 10000, ",")) !== FALSE)
// {
// $sql = "INSERT into import(product_id,name,brand_name,short_description,part_id,vehicle_model,amount,status) values('$emapData[0]','$emapData[1]','$emapData[2]','$emapData[3]','$emapData[4]','$emapData[5]','$emapData[6]','$emapData[7]')";
// $this->db->query($sql);
// }
// fclose($file);
// echo "CSV File has been successfully Imported.";
// }
// }
}
?>
\ No newline at end of file
application/controllers/Product.php
View file @
f4f71a89
...
...
@@ -37,7 +37,8 @@ class Product extends CI_Controller {
$template
[
'pTitle'
]
=
"View Product"
;
$template
[
'pDescription'
]
=
"View and Manage Product"
;
$template
[
'product_data'
]
=
$this
->
Product_model
->
getProduct
(
''
,
1
);
$mechanic_id
=
(
$this
->
session
->
userdata
[
'user_type'
]
==
2
)
?
$this
->
session
->
userdata
[
'id'
]
:
''
;
$template
[
'product_data'
]
=
$this
->
Product_model
->
getProduct
(
''
,
1
,
$mechanic_id
);
$this
->
load
->
view
(
'template'
,
$template
);
}
...
...
@@ -96,6 +97,7 @@ class Product extends CI_Controller {
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Product/addproduct'
));
}
$_POST
[
'created_by'
]
=
(
$this
->
session
->
userdata
[
'user_type'
]
==
2
)
?
$this
->
session
->
userdata
[
'id'
]
:
0
;
$product_id
=
$this
->
Product_model
->
addProduct
(
$_POST
);
if
(
$product_id
){
...
...
@@ -262,7 +264,8 @@ class Product extends CI_Controller {
public
function
exportProductData
(){
$productData
=
$this
->
Product_model
->
getProduct
(
''
,
1
);
$mechanic_id
=
(
$this
->
session
->
userdata
[
'user_type'
]
==
2
)
?
$this
->
session
->
userdata
[
'id'
]
:
''
;
$productData
=
$this
->
Product_model
->
getProduct
(
''
,
1
,
$mechanic_id
);
if
(
empty
(
$productData
)){
return
;
}
...
...
application/controllers/Webservices.php
View file @
f4f71a89
...
...
@@ -519,7 +519,7 @@
echo
json_encode
(
$respArr
);
exit
;
}
$
param
=
""
;
$
url
=
""
;
$searchType
=
$postData
[
'type'
];
$searchData
=
$postData
[
'vehicleData'
];
$locationData
=
$postData
[
'location'
];
...
...
@@ -543,36 +543,50 @@
$vehicle_data
[
'car_model'
]
=
$searchData
[
'modelName'
];
$vehicle_data
[
'car_model_year'
]
=
$searchData
[
'modelYear'
];
$param
=
"?format=json&key="
.
urlencode
(
$settings
[
'vin_audit_api'
])
.
"&year="
.
urlencode
(
$searchData
[
'modelYear'
])
.
"&make="
.
urlencode
(
$searchData
[
'car_maker'
])
.
"&model="
.
urlencode
(
$searchData
[
'modelName'
]);
//$param = "?format=json&key=".urlencode($settings['vin_audit_api'])."&year=".
//urlencode($searchData['modelYear'])."&make=".urlencode($searchData['car_maker']).
//"&model=".urlencode($searchData['modelName']);
$url
=
"https://specifications.vinaudit.com/v3/selections?format=json&key="
.
urlencode
(
$settings
[
'vin_audit_api'
])
.
"&id="
.
urlencode
(
$searchData
[
'modelYear'
])
.
"_"
.
urlencode
(
$searchData
[
'car_maker'
])
.
"_"
.
urlencode
(
$searchData
[
'modelName'
]);
}
else
if
(
$searchType
==
2
&&
isset
(
$searchData
[
'vin'
])
&&
!
empty
(
$searchData
[
'vin'
])){
$vehicle_data
[
'car_vin'
]
=
$searchData
[
'vin'
];
$param
=
"?format=json&key="
.
urlencode
(
$settings
[
'vin_audit_api'
])
.
"&vin="
.
urlencode
(
$searchData
[
'vin'
]);
// $param = "?format=json&key=".urlencode($settings['vin_audit_api']).
// "&vin=".urlencode($searchData['vin']);
$url
=
"https://specifications.vinaudit.com/v3/specifications?format=json&key="
.
urlencode
(
$settings
[
'vin_audit_api'
])
.
"&vin="
.
urlencode
(
$searchData
[
'vin'
]);
}
if
(
!
empty
(
$
param
)){
$vehData
=
file_get_contents
(
"https://specifications.vinaudit.com/getspecifications.php"
.
$param
);
if
(
!
empty
(
$
url
)){
$vehData
=
file_get_contents
(
$url
);
if
(
empty
(
$vehData
)
||
empty
(
$vehData
=
json_decode
(
$vehData
,
true
))){
echo
json_encode
(
$return_arr
);
exit
;
}
if
(
!
isset
(
$vehData
[
'success'
])
||
empty
(
$vehData
[
'success'
])
||
$vehData
[
'success'
]
==
false
){
if
(
!
isset
(
$vehData
[
'success'
])
||
empty
(
$vehData
[
'success'
])
||
$vehData
[
'success'
]
==
false
||
((
!
isset
(
$vehData
[
'attributes'
])
||
empty
(
$vehData
[
'attributes'
]))
&&
(
!
isset
(
$vehData
[
'selections'
])
||
empty
(
$vehData
[
'selections'
])))){
$return_arr
[
'status'
]
=
2
;
$return_arr
[
'message'
]
=
'No Data Found.'
;
echo
json_encode
(
$return_arr
);
exit
;
}
if
(
$searchType
==
2
){
$vehicle_data
[
'car_model'
]
=
$vehData
[
'attributes'
][
'Model'
];
$vehicle_data
[
'car_maker'
]
=
$vehData
[
'attributes'
][
'Make'
];
$vehicle_data
[
'car_model_year'
]
=
$vehData
[
'attributes'
][
'Year'
];
$vehData
[
'vehicle'
]
=
$vehData
[
'attributes'
][
'Year'
]
.
' '
.
$vehData
[
'attributes'
][
'Make'
]
.
' '
.
$vehData
[
'attributes'
][
'Model'
]
.
' '
.
$vehData
[
'attributes'
][
'Trim'
];
}
$vehicle_data
[
'car_model'
]
=
$vehData
[
'attributes'
][
'model'
];
$vehicle_data
[
'car_maker'
]
=
$vehData
[
'attributes'
][
'make'
];
$vehicle_data
[
'car_model_year'
]
=
$vehData
[
'attributes'
][
'year'
];
$vehData
[
'vehicle'
]
=
$vehData
[
'attributes'
][
'year'
]
.
' '
.
$vehData
[
'attributes'
][
'make'
]
.
' '
.
$vehData
[
'attributes'
][
'model'
]
.
' '
.
$vehData
[
'attributes'
][
'trim'
];
}
else
if
(
$searchType
==
1
){
$vehSele
=
$vehData
[
'selections'
];
$vehicle_data
[
'car_model_year'
]
=
$vehSele
[
'years'
][
0
][
'name'
];
$vehicle_data
[
'car_maker'
]
=
$vehSele
[
'years'
][
0
][
'makes'
][
0
][
'name'
];
$vehicle_data
[
'car_model'
]
=
$vehSele
[
'years'
][
0
][
'makes'
][
0
][
'models'
][
0
][
'name'
];
$vehData
[
'vehicle'
]
=
$vehSele
[
'years'
][
0
][
'name'
]
.
' '
.
$vehSele
[
'years'
][
0
][
'makes'
][
0
][
'name'
]
.
' '
.
$vehSele
[
'years'
][
0
][
'makes'
][
0
][
'models'
][
0
][
'name'
]
.
' '
.
$vehSele
[
'years'
][
0
][
'makes'
][
0
][
'models'
][
0
][
'trims'
][
0
][
'name'
];
}
$vehicle_data
[
'car_name'
]
=
$vehData
[
'vehicle'
];
$vehicle_data
[
'vehicle_data'
]
=
json_encode
(
$vehData
);
...
...
application/models/Booking_model.php
View file @
f4f71a89
...
...
@@ -15,6 +15,7 @@ class Booking_model extends CI_Model {
return
0
;
}
$vehData
=
$postData
[
'vechile_info'
];
//$vehName = $this->db->get_where('vehicles_brand',array('veh_brand_id'=>$vehData['maker']))->row();
$car_name
=
$vehData
[
'modelYear'
]
.
' '
.
$vehData
[
'maker'
]
.
' '
.
$vehData
[
'modelName'
];
$vehJson
=
array
(
'vehicle'
=>
$car_name
,
...
...
application/models/Product_model.php
View file @
f4f71a89
...
...
@@ -23,9 +23,10 @@ class Product_model extends CI_Model {
return
$last_id
;
}
function
getProduct
(
$product_id
=
''
,
$view_all
=
0
){
function
getProduct
(
$product_id
=
''
,
$view_all
=
0
,
$mechanic_id
=
''
){
$cond
=
(
$view_all
!=
0
)
?
' products.status IN (0,1) '
:
' products.status IN (1) '
;
$cond
.=
(
!
empty
(
$product_id
))
?
" AND products.product_id = '
$product_id
'"
:
""
;
$cond
.=
(
!
empty
(
$mechanic_id
))
?
" AND products.created_by = '
$mechanic_id
'"
:
""
;
$result
=
$this
->
db
->
query
(
"SELECT cardetails.veh_modal_id,cardetails.year,vehicles_model.* ,products.*,product_brand.brand_name
FROM products
...
...
application/views/Customer/list-customer-users.php
View file @
f4f71a89
...
...
@@ -26,7 +26,10 @@
<div
class=
"box-header with-border"
>
<div
class=
"col-md-6"
><h3
class=
"box-title"
>
Customers List
</h3></div>
<div
class=
"col-md-6"
align=
"right"
>
<a
class=
"btn btn-sm btn-success"
href=
"
<?=
base_url
(
'Customer/exportCustomerData'
)
?>
"
>
Generate Report
</a>
<?php
if
(
!
empty
(
$customerData
)){
?>
<a
class=
"btn btn-sm btn-success"
href=
"
<?=
base_url
(
'Customer/exportCustomerData'
)
?>
"
>
Generate Report
</a>
<?php
}
?>
<a
class=
"btn btn-sm btn-primary"
href=
"
<?=
base_url
(
'Customer/addCustomerUser'
)
?>
"
>
Add New Customer
</a>
<a
class=
"btn btn-sm btn-primary"
href=
"
<?=
base_url
()
?>
"
>
Back
</a>
</div>
...
...
application/views/Mechanic/viewMechanic.php
View file @
f4f71a89
...
...
@@ -28,7 +28,10 @@
<div
class=
"box-header with-border"
>
<div
class=
"col-md-6"
><h3
class=
"box-title"
>
Mechanics List
</h3></div>
<div
class=
"col-md-6"
align=
"right"
>
<a
class=
"btn btn-sm btn-success"
href=
"
<?=
base_url
(
'Mechanic/exportMechanicData'
)
?>
"
>
Generate Report
</a>
<?php
if
(
!
empty
(
$user_data
)){
?>
<a
class=
"btn btn-sm btn-success"
href=
"
<?=
base_url
(
'Mechanic/exportMechanicData'
)
?>
"
>
Generate Report
</a>
<?php
}
?>
<a
class=
"btn btn-sm btn-primary"
href=
"
<?=
base_url
(
'Mechanic/addMechanic'
)
?>
"
>
Add New Mechanic
</a>
<a
class=
"btn btn-sm btn-primary"
href=
"
<?=
base_url
()
?>
"
>
Back
</a>
</div>
...
...
application/views/Orders/list_orders.php
View file @
f4f71a89
...
...
@@ -26,7 +26,9 @@
<div
class=
"box-header with-border"
>
<div
class=
"col-md-6"
><h3
class=
"box-title"
>
Order List
</h3></div>
<div
class=
"col-md-6"
align=
"right"
>
<a
class=
"btn btn-sm btn-success"
href=
"
<?=
base_url
(
'Orders/exportOrderData'
)
?>
"
>
Generate Report
</a>
<?php
if
(
!
empty
(
$orderData
)){
?>
<a
class=
"btn btn-sm btn-success"
href=
"
<?=
base_url
(
'Orders/exportOrderData'
)
?>
"
>
Generate Report
</a>
<?php
}
?>
<a
class=
"btn btn-sm btn-primary"
href=
"
<?=
base_url
()
?>
"
>
Back
</a>
</div>
</div>
...
...
application/views/Product/addproduct.php
View file @
f4f71a89
...
...
@@ -73,7 +73,7 @@
</div>
<div
class=
"form-group"
>
<label>
Amount
</label>
<input
type=
"
text
"
class=
"form-control required"
data-parsley-trigger=
"change"
<input
type=
"
number
"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
name=
"amount"
required=
""
value=
"
<?=
(
isset
(
$product_data
->
amount
))
?
$product_data
->
amount
:
''
?>
"
data-parsley-pattern=
"^[0-9\ . \/]+$"
placeholder=
"Enter Amount"
>
<span
class=
"glyphicon form-control-feedback"
></span>
...
...
application/views/Product/viewProduct.php
View file @
f4f71a89
...
...
@@ -28,7 +28,9 @@
<div
class=
"box-header with-border"
>
<div
class=
"col-md-6"
><h3
class=
"box-title"
>
Brand List
</h3></div>
<div
class=
"col-md-6"
align=
"right"
>
<a
class=
"btn btn-sm btn-success"
href=
"
<?=
base_url
(
'Product/exportProductData'
)
?>
"
>
Generate Report
</a>
<?php
if
(
!
empty
(
$product_data
)){
?>
<a
class=
"btn btn-sm btn-success"
href=
"
<?=
base_url
(
'Product/exportProductData'
)
?>
"
>
Generate Report
</a>
<?php
}
?>
<a
class=
"btn btn-sm btn-primary"
href=
"
<?=
base_url
()
?>
"
>
Back
</a>
</div>
</div>
...
...
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