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
09343300
Commit
09343300
authored
Feb 20, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daily commit
parent
1a7a3108
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
656 additions
and
13 deletions
+656
-13
Customer.php
application/controllers/Customer.php
+210
-2
Event.php
application/controllers/Event.php
+2
-2
Customer_model.php
application/models/Customer_model.php
+165
-0
Event_model.php
application/models/Event_model.php
+2
-1
customerForm.php
application/views/Customer/customerForm.php
+146
-0
viewCustomer.php
application/views/Customer/viewCustomer.php
+94
-0
footer.php
application/views/Templates/footer.php
+3
-2
left-menu.php
application/views/Templates/left-menu.php
+21
-0
custom-style.css
assets/css/custom-style.css
+5
-0
custom-script.js
assets/js/custom-script.js
+8
-6
No files found.
application/controllers/Customer.php
View file @
09343300
...
@@ -7,10 +7,218 @@ class Customer extends CI_Controller {
...
@@ -7,10 +7,218 @@ class Customer extends CI_Controller {
parent
::
__construct
();
parent
::
__construct
();
date_default_timezone_set
(
"Asia/Kolkata"
);
date_default_timezone_set
(
"Asia/Kolkata"
);
$this
->
load
->
model
(
'Customer_model'
);
$this
->
load
->
model
(
'Customer_model'
);
$this
->
load
->
model
(
'Dashboard_model'
);
if
(
!
$this
->
session
->
userdata
(
'logged_in'
))
{
if
(
!
$this
->
session
->
userdata
(
'logged_in'
))
{
redirect
(
base_url
(
'Login'
));
redirect
(
base_url
());
}
}
public
function
addCustomer
(){
$template
[
'page'
]
=
'Customer/customerForm'
;
$template
[
'menu'
]
=
'Customer Management'
;
$template
[
'smenu'
]
=
'Add Customer'
;
$template
[
'pTitle'
]
=
"Add Customer"
;
$template
[
'pDescription'
]
=
"Create New Customer"
;
$this
->
load
->
view
(
'template'
,
$template
);
}
public
function
viewCustomers
(){
$template
[
'page'
]
=
'Customer/viewCustomer'
;
$template
[
'menu'
]
=
'Customer Management'
;
$template
[
'smenu'
]
=
'View Customers'
;
$template
[
'pTitle'
]
=
"View Customers"
;
$template
[
'pDescription'
]
=
"View and Manage Customers"
;
$template
[
'page_head'
]
=
"Customer Management"
;
$template
[
'customer_data'
]
=
$this
->
Customer_model
->
getCustomerData
(
''
,
'0,1'
);
$this
->
load
->
view
(
'template'
,
$template
);
}
public
function
getCustomerData
(){
$resArr
=
array
(
'status'
=>
0
);
if
(
!
isset
(
$_POST
)
||
empty
(
$_POST
)
||!
isset
(
$_POST
[
'customer_id'
])
||
empty
(
$_POST
[
'customer_id'
])
||
!
is_numeric
(
$customer_id
=
decode_param
(
$_POST
[
'customer_id'
]))){
echo
json_encode
(
$resArr
);
exit
;
}
$view_all
=
(
isset
(
$_POST
[
'view_all'
])
&&
$_POST
[
'view_all'
]
==
1
)
?
1
:
0
;
$mechData
=
$this
->
Customer_model
->
getCustomerData
(
$customer_id
,
$view_all
);
if
(
empty
(
$mechData
)){
echo
json_encode
(
$resArr
);
exit
;
}
$resArr
[
'status'
]
=
1
;
$resArr
[
'data'
]
=
$mechData
;
echo
json_encode
(
$resArr
);
exit
;
}
function
changeStatus
(
$customer_id
=
''
,
$status
=
'1'
){
$flashMsg
=
array
(
'message'
=>
'Something went wrong, please try again..!'
,
'class'
=>
'error'
);
if
(
empty
(
$customer_id
)
||
!
is_numeric
(
$customer_id
=
decode_param
(
$customer_id
))){
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/viewCustomers'
));
}
$status
=
$this
->
Customer_model
->
changeStatus
(
$customer_id
,
$status
);
if
(
!
$status
){
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
}
redirect
(
base_url
(
'Customer/viewCustomers'
));
}
public
function
createCustomer
(){
$err
=
0
;
$errMsg
=
''
;
$flashMsg
=
array
(
'message'
=>
'Something went wrong, please try again..!'
,
'class'
=>
'error'
);
if
(
!
isset
(
$_POST
)
||
empty
(
$_POST
)
||
!
isset
(
$_FILES
)
||
empty
(
$_FILES
)){
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/addCustomer'
));
}
if
(
$err
==
0
&&
(
!
isset
(
$_POST
[
'display_name'
])
||
empty
(
$_POST
[
'display_name'
]))){
$err
=
1
;
$errMsg
=
'Provide a Display Name'
;
}
else
if
(
$err
==
0
&&
(
!
isset
(
$_POST
[
'username'
])
||
empty
(
$_POST
[
'username'
]))){
$err
=
1
;
$errMsg
=
'Provide a User Name'
;
}
else
if
(
$err
==
0
&&
(
!
isset
(
$_POST
[
'password'
])
||
empty
(
$_POST
[
'password'
])
||
empty
(
$_POST
[
'password'
]
=
md5
(
$_POST
[
'password'
])))){
$err
=
1
;
$errMsg
=
'Provide a Password'
;
}
else
if
(
$err
==
0
&&
(
!
isset
(
$_POST
[
'name'
])
||
empty
(
$_POST
[
'name'
]))){
$err
=
1
;
$errMsg
=
'Provide a Name'
;
}
else
if
(
$err
==
0
&&
(
!
isset
(
$_POST
[
'email'
])
||
empty
(
$_POST
[
'email'
]))){
$err
=
1
;
$errMsg
=
'Provide an Email ID'
;
}
else
if
(
$err
==
0
&&
(
!
isset
(
$_POST
[
'phone'
])
||
empty
(
$_POST
[
'phone'
]))){
$err
=
1
;
$errMsg
=
'Provide a Phone Number'
;
}
if
(
$err
==
0
){
$config
=
set_upload_service
(
"assets/uploads/services"
);
$this
->
load
->
library
(
'upload'
);
$config
[
'file_name'
]
=
time
()
.
"_"
.
$_FILES
[
'profile_image'
][
'name'
];
$this
->
upload
->
initialize
(
$config
);
if
(
!
$this
->
upload
->
do_upload
(
'profile_image'
)){
$err
=
1
;
$errMsg
=
$this
->
upload
->
display_errors
();
}
else
{
$upload_data
=
$this
->
upload
->
data
();
$_POST
[
'profile_image'
]
=
$config
[
'upload_path'
]
.
"/"
.
$upload_data
[
'file_name'
];
}
}
if
(
$err
==
1
){
$flashMsg
[
'message'
]
=
$errMsg
;
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/addCustomer'
));
}
$status
=
$this
->
Customer_model
->
addCustomer
(
$_POST
);
if
(
$status
==
1
){
$flashMsg
=
array
(
'message'
=>
'Successfully Updated User Details..!'
,
'class'
=>
'success'
);
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/viewCustomers'
));
}
else
if
(
$status
==
2
){
$flashMsg
=
array
(
'message'
=>
'Email ID alrady exist..!'
,
'class'
=>
'error'
);
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/addCustomer'
));
}
else
if
(
$status
==
3
){
$flashMsg
=
array
(
'message'
=>
'Phone Number alrady exist..!'
,
'class'
=>
'error'
);
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/addCustomer'
));
}
else
if
(
$status
==
4
){
$flashMsg
=
array
(
'message'
=>
'User Name alrady exist..!'
,
'class'
=>
'error'
);
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/addCustomer'
));
}
else
{
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/addCustomer'
));
}
}
public
function
editCustomers
(
$customer_id
){
$flashMsg
=
array
(
'message'
=>
'Something went wrong, please try again..!'
,
'class'
=>
'error'
);
if
(
empty
(
$customer_id
)
||
!
is_numeric
(
$customer_id
=
decode_param
(
$customer_id
))){
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/viewCustomers'
));
}
$template
[
'page'
]
=
'Customer/customerForm'
;
$template
[
'menu'
]
=
'Customer Management'
;
$template
[
'smenu'
]
=
'Edit Customer'
;
$template
[
'pTitle'
]
=
"Edit Customers"
;
$template
[
'pDescription'
]
=
"Update Customer Data"
;
$template
[
'customer_data'
]
=
$this
->
Customer_model
->
getCustomerData
(
$customer_id
,
1
);
$template
[
'customer_id'
]
=
encode_param
(
$customer_id
);
$this
->
load
->
view
(
'template'
,
$template
);
}
public
function
updateCustomer
(
$customer_id
=
''
){
$err
=
0
;
$errMsg
=
''
;
$flashMsg
=
array
(
'message'
=>
'Something went wrong, please try again..!'
,
'class'
=>
'error'
);
if
(
!
isset
(
$_POST
)
||
empty
(
$_POST
)
||
!
isset
(
$_FILES
)
||
empty
(
$_FILES
)){
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/addCustomer'
));
}
if
(
$err
==
0
&&
(
!
isset
(
$_POST
[
'display_name'
])
||
empty
(
$_POST
[
'display_name'
]))){
$err
=
1
;
$errMsg
=
'Provide a Display Name'
;
}
else
if
(
$err
==
0
&&
(
!
isset
(
$_POST
[
'username'
])
||
empty
(
$_POST
[
'username'
]))){
$err
=
1
;
$errMsg
=
'Provide a User Name'
;
}
else
if
(
$err
==
0
&&
(
!
isset
(
$_POST
[
'name'
])
||
empty
(
$_POST
[
'name'
]))){
$err
=
1
;
$errMsg
=
'Provide a Name'
;
}
else
if
(
$err
==
0
&&
(
!
isset
(
$_POST
[
'email'
])
||
empty
(
$_POST
[
'email'
]))){
$err
=
1
;
$errMsg
=
'Provide an Email ID'
;
}
else
if
(
$err
==
0
&&
(
!
isset
(
$_POST
[
'phone'
])
||
empty
(
$_POST
[
'phone'
]))){
$err
=
1
;
$errMsg
=
'Provide a Phone Number'
;
}
if
(
$err
==
0
){
$config
=
set_upload_service
(
"assets/uploads/services"
);
$this
->
load
->
library
(
'upload'
);
$config
[
'file_name'
]
=
time
()
.
"_"
.
$_FILES
[
'profile_image'
][
'name'
];
$this
->
upload
->
initialize
(
$config
);
if
(
$this
->
upload
->
do_upload
(
'profile_image'
)){
$upload_data
=
$this
->
upload
->
data
();
$_POST
[
'profile_image'
]
=
$config
[
'upload_path'
]
.
"/"
.
$upload_data
[
'file_name'
];
}
}
if
(
$err
==
1
){
$flashMsg
[
'message'
]
=
$errMsg
;
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/editCustomers/'
.
$customer_id
));
}
$status
=
$this
->
Customer_model
->
updateCustomer
(
decode_param
(
$customer_id
),
$_POST
);
if
(
$status
==
1
){
$flashMsg
=
array
(
'message'
=>
'Successfully Updated User Details..!'
,
'class'
=>
'success'
);
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/viewCustomers'
));
}
else
if
(
$status
==
2
){
$flashMsg
=
array
(
'message'
=>
'Email ID alrady exist..!'
,
'class'
=>
'error'
);
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/editCustomers/'
.
$customer_id
));
}
else
if
(
$status
==
3
){
$flashMsg
=
array
(
'message'
=>
'Phone Number alrady exist..!'
,
'class'
=>
'error'
);
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/editCustomers/'
.
$customer_id
));
}
else
if
(
$status
==
4
){
$flashMsg
=
array
(
'message'
=>
'User Name alrady exist..!'
,
'class'
=>
'error'
);
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/editCustomers/'
.
$customer_id
));
}
else
{
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Customer/editCustomers/'
.
$customer_id
));
}
}
}
}
}
}
...
...
application/controllers/Event.php
View file @
09343300
...
@@ -20,8 +20,8 @@ class Event extends CI_Controller {
...
@@ -20,8 +20,8 @@ class Event extends CI_Controller {
$template
[
'smenu'
]
=
'View Event List'
;
$template
[
'smenu'
]
=
'View Event List'
;
$template
[
'pTitle'
]
=
"Event Management"
;
$template
[
'pTitle'
]
=
"Event Management"
;
$template
[
'pDescription'
]
=
"View Event List"
;
$template
[
'pDescription'
]
=
"View Event List"
;
$provider_id
=
(
$this
->
session
->
userdata
[
'user_type'
]
==
2
)
?
$this
->
session
->
userdata
[
'id'
]
:
''
;
$template
[
'event_data'
]
=
$this
->
Event_model
->
getEventData
();
$template
[
'event_data'
]
=
$this
->
Event_model
->
getEventData
(
''
,
''
,
$provider_id
);
$this
->
load
->
view
(
'template'
,
$template
);
$this
->
load
->
view
(
'template'
,
$template
);
}
}
...
...
application/models/Customer_model.php
View file @
09343300
...
@@ -21,5 +21,169 @@ class Customer_model extends CI_Model {
...
@@ -21,5 +21,169 @@ class Customer_model extends CI_Model {
}
}
return
0
;
return
0
;
}
}
public
function
addCustomer
(
$customer_data
=
array
()){
if
(
empty
(
$customer_data
))
return
0
;
$userNameChk
=
$this
->
db
->
query
(
"SELECT * FROM users
WHERE status!='2' AND username='"
.
$customer_data
[
'username'
]
.
"'"
);
if
(
!
empty
(
$userNameChk
)
&&
$userNameChk
->
num_rows
()
>
0
)
return
4
;
$emailChk
=
$this
->
db
->
query
(
"SELECT * FROM customer AS PRV
INNER JOIN users AS USR ON (USR.id=PRV.customer_id)
WHERE USR.status!='2' AND PRV.email='"
.
$customer_data
[
'email'
]
.
"'"
);
if
(
!
empty
(
$emailChk
)
&&
$emailChk
->
num_rows
()
>
0
)
return
2
;
$phoneChk
=
$this
->
db
->
query
(
"SELECT * FROM customer AS PRV
INNER JOIN users AS USR ON (USR.id=PRV.customer_id)
WHERE USR.status!='2' AND PRV.phone='"
.
$customer_data
[
'phone'
]
.
"'"
);
if
(
!
empty
(
$phoneChk
)
&&
$phoneChk
->
num_rows
()
>
0
)
return
3
;
$status
=
$this
->
db
->
insert
(
'users'
,
array
(
'username'
=>
$customer_data
[
'username'
],
'password'
=>
$customer_data
[
'password'
],
'display_name'
=>
$customer_data
[
'display_name'
],
'profile_image'
=>
$customer_data
[
'profile_image'
],
'user_type'
=>
'2'
,
'status'
=>
'1'
));
if
(
!
$status
){
return
0
;
}
$customer_id
=
$this
->
db
->
insert_id
();
$status
=
$this
->
db
->
insert
(
'customer'
,
array
(
'customer_id'
=>
$customer_id
,
'name'
=>
$customer_data
[
'name'
],
'email'
=>
$customer_data
[
'email'
],
'phone'
=>
$customer_data
[
'phone'
],
'profile_image'
=>
$customer_data
[
'profile_image'
]));
return
$status
;
}
function
updateCustomer
(
$customer_id
=
''
,
$customer_data
=
array
()){
if
(
empty
(
$customer_id
)
||
empty
(
$customer_data
))
return
0
;
$userIdChk
=
$this
->
db
->
query
(
"SELECT * FROM customer AS PRV
INNER JOIN users AS USR ON (USR.id = PRV.customer_id)
WHERE USR.status!='2' AND USR.id!='"
.
$customer_id
.
"' AND
USR.username='"
.
$customer_data
[
'username'
]
.
"'"
);
if
(
!
empty
(
$userIdChk
)
&&
$userIdChk
->
num_rows
()
>
0
)
{
return
4
;
}
$emailChk
=
$this
->
db
->
query
(
"SELECT * FROM customer AS PRV
INNER JOIN users AS USR ON (USR.id = PRV.customer_id)
WHERE USR.status!='2' AND USR.id!='"
.
$customer_id
.
"' AND
PRV.email='"
.
$customer_data
[
'email'
]
.
"'"
);
if
(
!
empty
(
$emailChk
)
&&
$emailChk
->
num_rows
()
>
0
)
{
return
2
;
}
$phoneChk
=
$this
->
db
->
query
(
"SELECT * FROM customer AS PRV
INNER JOIN users AS USR ON (USR.id = PRV.customer_id)
WHERE USR.status!='2' AND USR.id!='"
.
$customer_id
.
"' AND
PRV.phone='"
.
$customer_data
[
'phone'
]
.
"'"
);
if
(
!
empty
(
$phoneChk
)
&&
$phoneChk
->
num_rows
()
>
0
)
{
return
3
;
}
$upMecArr
=
array
(
'name'
=>
$customer_data
[
'name'
],
'email'
=>
$customer_data
[
'email'
],
'phone'
=>
$customer_data
[
'phone'
]);
$admUpdateArr
=
array
(
'username'
=>
$customer_data
[
'username'
],
'display_name'
=>
$customer_data
[
'display_name'
]);
if
(
isset
(
$customer_data
[
'profile_image'
])
&&
!
empty
(
$customer_data
[
'profile_image'
])){
$upMecArr
[
'profile_image'
]
=
$customer_data
[
'profile_image'
];
$admUpdateArr
[
'profile_image'
]
=
$customer_data
[
'profile_image'
];
}
$status
=
$this
->
db
->
update
(
'users'
,
$admUpdateArr
,
array
(
'id'
=>
$customer_id
));
if
(
!
$status
)
{
return
0
;
}
if
(
isset
(
$customer_data
[
'licence'
])
&&
!
empty
(
$customer_data
[
'licence'
]))
$upMecArr
[
'licence'
]
=
$customer_data
[
'licence'
];
$status
=
$this
->
db
->
update
(
'customer'
,
$upMecArr
,
array
(
'customer_id'
=>
$customer_id
));
return
$status
;
}
function
changeStatus
(
$customer_id
=
''
,
$status
=
'0'
){
if
(
empty
(
$customer_id
)){
return
0
;
}
$status
=
$this
->
db
->
update
(
'users'
,
array
(
'status'
=>
$status
),
array
(
'id'
=>
$customer_id
));
return
$status
;
}
function
getNearByCustomers
(
$location_data
=
array
(),
$sub_issues
=
array
()){
if
(
empty
(
$location_data
)
||
empty
(
$sub_issues
)){
return
0
;
}
$current_lat
=
$location_data
[
'pickup_lat'
];
$current_lng
=
$location_data
[
'pickup_lng'
];
$issue_cat_id
=
implode
(
','
,
$sub_issues
);
$sql
=
"SELECT USR.display_name,USR.profile_image,ME.*,MS.shop_name,MS.address AS shop_address,
MS.phone AS shop_phone,MS.email_id AS shop_email_id,
3956*2*ASIN(SQRT(POWER(SIN((
$current_lat
-ME.location_lat)*pi()/180/2),2)+
COS(
$current_lat
*pi()/180 )*COS(ME.location_lat*pi()/180)*
POWER(SIN((
$current_lng
-ME.location_lng)*pi()/180/2),2) )) AS distance
FROM customer AS ME
INNER JOIN users AS USR ON (USR.id=ME.customer_id)
LEFT JOIN customer_shop AS MS ON (MS.shop_id=ME.shop_id AND MS.status='1')
WHERE USR.status='1'
-- HAVING distance<30"
;
$mechData
=
$this
->
db
->
query
(
$sql
);
if
(
empty
(
$mechData
)
||
empty
(
$mechData
=
$mechData
->
result_array
())){
return
0
;
}
$estimate
=
0
;
$mechDataArr
=
array
();
foreach
(
$mechData
AS
$index
=>
$data
){
if
(
empty
(
$data
[
'start_time'
])
||
empty
(
$data
[
'end_time'
])){
$scheduleTiming
=
array
(
'09:00 AM'
,
'10:00 AM'
,
'11:00 AM'
,
'12:00 PM'
,
'01:00 PM'
,
'02:00 PM'
,
'03:00 PM'
,
'04:00 PM'
,
'05:00 PM'
,
'06:00 PM'
);
}
else
{
$endTime
=
strtotime
(
$data
[
'end_time'
]);
$schTime
=
strtotime
(
$data
[
'start_time'
]);
$scheduleTiming
=
array
();
for
(
;
$schTime
<=
(
$endTime
-
3600
)
;
$schTime
+=
3600
){
$scheduleTiming
[]
=
date
(
'h:i A'
,
$schTime
);
}
}
$customer_id
=
$data
[
'customer_id'
];
$sql
=
"SELECT ISS.*, IC.*, MI.*
FROM issues_category AS IC
INNER JOIN issues AS ISS ON (IC.issue_id=ISS.issue_id)
LEFT JOIN customer_issues AS MI ON (MI.issue_cat_id=IC.issue_cat_id AND
MI.customer_id='
$customer_id
' AND MI.status='1')
WHERE ISS.status='1' AND IC.status='1' AND IC.issue_cat_id IN (
$issue_cat_id
)"
;
$subIssData
=
$this
->
db
->
query
(
$sql
);
$sIssueData
=
array
();
if
(
!
empty
(
$subIssData
)
&&
!
empty
(
$subIssData
=
$subIssData
->
result_array
())){
$sIssueData
=
$subIssData
;
}
$estimate
=
0
;
foreach
(
$sIssueData
AS
$sIndex
=>
$sIssue
){
if
(
!
empty
(
$sIssue
[
'custom_service_fee'
])){
$estimate
+=
$sIssue
[
'custom_service_fee'
];
$sIssueData
[
$sIndex
][
'service_fee'
]
=
$sIssue
[
'custom_service_fee'
];
}
else
{
$estimate
+=
$sIssue
[
'default_service_fee'
];
$sIssueData
[
$sIndex
][
'service_fee'
]
=
$sIssue
[
'default_service_fee'
];
}
}
$mechData
[
$index
][
'estimate'
]
=
$estimate
;
$mechData
[
$index
][
'sub_issues'
]
=
$sIssueData
;
$mechData
[
$index
][
'scheduleTiming'
]
=
$scheduleTiming
;
}
return
$mechData
;
}
}
}
?>
?>
\ No newline at end of file
application/models/Event_model.php
View file @
09343300
...
@@ -4,9 +4,10 @@ class Event_model extends CI_Model {
...
@@ -4,9 +4,10 @@ class Event_model extends CI_Model {
parent
::
_construct
();
parent
::
_construct
();
}
}
public
function
getEventData
(
$event_id
=
''
,
$view
=
''
){
public
function
getEventData
(
$event_id
=
''
,
$view
=
''
,
$provider_id
=
''
){
$cond
=
(
!
empty
(
$view
))
?
" EVT.status IN (
$view
) "
:
" EVT.status != '2' "
;
$cond
=
(
!
empty
(
$view
))
?
" EVT.status IN (
$view
) "
:
" EVT.status != '2' "
;
$cond
.=
(
!
empty
(
$event_id
))
?
" AND EVT.event_id='
$event_id
' "
:
""
;
$cond
.=
(
!
empty
(
$event_id
))
?
" AND EVT.event_id='
$event_id
' "
:
""
;
$cond
.=
(
!
empty
(
$provider_id
))
?
" AND EVT.provider_id='
$provider_id
' "
:
""
;
$sql
=
"SELECT EVT.*,EVT.status AS event_status,VEN.*,REG.name AS region_name,CAT.*,PRV.*,HST.*
$sql
=
"SELECT EVT.*,EVT.status AS event_status,VEN.*,REG.name AS region_name,CAT.*,PRV.*,HST.*
FROM events AS EVT
FROM events AS EVT
...
...
application/views/Customer/customerForm.php
0 → 100644
View file @
09343300
<div
class=
"content-wrapper"
>
<section
class=
"content-header"
>
<h1>
<?=
$pTitle
?>
<small>
<?=
$pDescription
?>
</small>
</h1>
<ol
class=
"breadcrumb"
>
<li><a
href=
"
<?=
base_url
()
?>
"
><i
class=
"fa fa-star-o"
aria-hidden=
"true"
></i>
Home
</a></li>
<li>
<?=
$menu
?>
</li>
<li
class=
"active"
>
<?=
$smenu
?>
</li>
</ol>
</section>
<section
class=
"content"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<?php
$url
=
(
!
isset
(
$customer_id
)
||
empty
(
$customer_id
))
?
'Customer/createCustomer'
:
'Customer/updateCustomer/'
.
$customer_id
;
if
(
$this
->
session
->
flashdata
(
'message'
))
{
$flashdata
=
$this
->
session
->
flashdata
(
'message'
);
?>
<div
class=
"alert alert-
<?=
$flashdata
[
'class'
]
?>
"
>
<button
class=
"close"
data-dismiss=
"alert"
type=
"button"
>
×
</button>
<?=
$flashdata
[
'message'
]
?>
</div>
<?php
}
?>
</div>
<div
class=
"col-md-12"
>
<div
class=
"box box-warning"
>
<div
class=
"box-body"
>
<form
role=
"form"
action=
"
<?=
base_url
(
$url
)
?>
"
method=
"post"
class=
"validate"
data-parsley-validate=
""
enctype=
"multipart/form-data"
>
<!-- Customer Data -->
<div
class=
"col-md-12"
>
<div
class=
"box-header with-border padUnset"
>
<h3
class=
"box-title"
>
Personal Details
</h3>
</div><br>
</div>
<div
class=
"col-md-6"
>
<div
class=
"form-group"
>
<label>
Customer Name
</label>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
data-parsley-pattern=
"^[a-zA-Z0-9\ . _ - ' \/]+$"
name=
"name"
required=
""
value=
"
<?=
(
isset
(
$customer_data
->
name
))
?
$customer_data
->
name
:
''
?>
"
placeholder=
"Enter Customer Name"
>
</div>
<div
class=
"form-group"
>
<label>
Email
</label>
<input
type=
"email"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
required=
""
name=
"email"
placeholder=
"Enter email ID"
value=
"
<?=
(
isset
(
$customer_data
->
email
))
?
$customer_data
->
email
:
''
?>
"
>
</div>
<div
class=
"form-group"
>
<label>
Phone
</label>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
data-parsley-pattern=
"^[0-9\ , - + \/]+$"
required=
""
value=
"
<?=
(
isset
(
$customer_data
->
phone
))
?
$customer_data
->
phone
:
''
?>
"
name=
"phone"
placeholder=
"Enter Phone Number"
>
</div>
<div
class=
"form-group"
>
<label>
Phone
</label>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
data-parsley-pattern=
"^[0-9\ , - + \/]+$"
required=
""
value=
"
<?=
(
isset
(
$customer_data
->
phone
))
?
$customer_data
->
phone
:
''
?>
"
name=
"phone"
placeholder=
"Enter Phone Number"
>
</div>
</div>
<div
class=
"col-md-6"
>
<div
class=
"form-group"
>
<label>
Profile Picture
</label>
<div
class=
"col-md-12"
style=
"padding-bottom:10px;"
>
<div
class=
"col-md-3"
>
<img
id=
"image_id"
src=
"
<?=
(
isset
(
$customer_data
->
profile_image
))
?
base_url
(
$customer_data
->
profile_image
)
:
''
?>
"
onerror=
"this.src='
<?=
base_url
(
"assets/images/user_avatar.jpg"
)
?>
';"
height=
"75"
width=
"75"
/>
</div>
<div
class=
"col-md-9"
style=
"padding-top: 25px;"
>
<input
name=
"profile_image"
type=
"file"
accept=
"image/*"
onchange=
"setImg(this,'image_id');"
/>
</div>
</div>
</div>
<div
class=
"form-group"
style=
"margin-top: 124px;"
>
<label>
Gender
</label>
<select
name=
"gender"
class=
"form-control"
>
<option
selected
value=
"1"
>
Male
</option>
<option
value=
"2"
>
Female
</option>
<option
value=
"3"
>
Others
</option>
</select>
</div>
<div
class=
"form-group"
>
<label>
City
</label>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
id=
"loc_search_1"
name=
"city"
placeholder=
"City"
value=
"
<?=
(
isset
(
$customer_data
->
city
))
?
$customer_data
->
city
:
''
?>
"
required
>
</div>
</div>
<div
class=
"col-md-12"
>
<div
class=
"box-footer textCenterAlign"
>
<button
type=
"submit"
class=
"btn btn-primary"
>
Submit
</button>
<a
href=
"
<?=
base_url
(
'Customer/viewCustomers'
)
?>
"
class=
"btn btn-primary"
>
Cancel
</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- Basic Details -->
<!-- <div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Admin User Details</h3>
</div><br>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Display Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" name="display_name" required=""
placeholder="Enter Display Name" value="
<?=
(
isset
(
$customer_data
->
display_name
))
?
$customer_data
->
display_name
:
''
?>
">
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>User Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" name="username" required="" value="
<?=
(
isset
(
$customer_data
->
username
))
?
$customer_data
->
username
:
''
?>
"
data-parsley-pattern="^[a-zA-Z0-9\ . _ @ \/]+$" placeholder="Enter User Name">
<span class="glyphicon form-control-feedback"></span>
</div>
<?php
if
(
!
isset
(
$customer_id
)){
?>
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control required" name="password" placeholder="Password" required="">
<span class="glyphicon form-control-feedback"></span>
</div>
<?php
}
?>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Profile Picture</label>
<div class="col-md-12" style="padding-bottom:10px;">
<div class="col-md-3">
<img id="image_id" src="
<?=
(
isset
(
$customer_data
->
profile_image
))
?
base_url
(
$customer_data
->
profile_image
)
:
''
?>
" onerror="this.src='
<?=
base_url
(
"assets/images/user_avatar.jpg"
)
?>
';" height="75" width="75" />
</div>
<div class="col-md-9" style="padding-top: 25px;">
<input name="profile_image" type="file" accept="image/*" onchange="setImg(this,'image_id');" />
</div>
</div>
</div>
</div> -->
application/views/Customer/viewCustomer.php
0 → 100644
View file @
09343300
<div
class=
"content-wrapper"
>
<!-- Content Header (Page header) -->
<section
class=
"content-header"
>
<h1>
<?=
$pTitle
?>
<small>
<?=
$pDescription
?>
</small>
</h1>
<ol
class=
"breadcrumb"
>
<li><a
href=
"
<?=
base_url
()
?>
"
><i
class=
"fa fa-star-o"
aria-hidden=
"true"
></i>
Home
</a></li>
<li>
<?=
$menu
?>
</li>
<li
class=
"active"
>
<?=
$smenu
?>
</li>
</ol>
</section>
<!-- Main content -->
<section
class=
"content"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<?php
if
(
$this
->
session
->
flashdata
(
'message'
))
{
$flashdata
=
$this
->
session
->
flashdata
(
'message'
);
?>
<div
class=
"alert alert-
<?=
$flashdata
[
'class'
]
?>
"
>
<button
class=
"close"
data-dismiss=
"alert"
type=
"button"
>
×
</button>
<?=
$flashdata
[
'message'
]
?>
</div>
<?php
}
?>
</div>
<div
class=
"col-xs-12"
>
<div
class=
"box box-warning"
>
<div
class=
"box-header with-border"
>
<div
class=
"col-md-6"
><h3
class=
"box-title"
>
Customer List
</h3></div>
<div
class=
"col-md-6"
align=
"right"
>
<a
class=
"btn btn-sm btn-primary"
href=
"
<?=
base_url
(
'Customer/addCustomer'
)
?>
"
>
Add New Customer
</a>
<a
class=
"btn btn-sm btn-primary"
href=
"
<?=
base_url
()
?>
"
>
Back
</a>
</div>
</div>
<div
class=
"box-body"
>
<table
id=
"mechanicUsers"
class=
"table table-bordered table-striped datatable "
>
<thead>
<tr>
<th
class=
"hidden"
>
ID
</th>
<th
width=
"150px;"
>
Customer Name
</th>
<th
width=
"150px;"
>
User Name
</th>
<th
width=
"150px;"
>
Email_id
</th>
<th
width=
"100px;"
>
Phone
</th>
<th
width=
"100px;"
>
Status
</th>
<th
width=
"500px;"
>
Action
</th>
</tr>
</thead>
<tbody>
<?php
if
(
!
empty
(
$customer_data
)){
foreach
(
$customer_data
as
$customer
)
{
?>
<tr>
<th
class=
"hidden"
>
<?=
$customer
->
customer_id
?>
</th>
<th
class=
"center"
>
<?=
$customer
->
name
?>
</th>
<th
class=
"center"
>
<?=
$customer
->
username
?>
</th>
<th
class=
"center"
>
<?=
$customer
->
email
?>
</th>
<th
class=
"center"
>
<?=
$customer
->
phone
?>
</th>
<th
class=
"center"
>
<?=
(
$customer
->
status
==
1
)
?
'Active'
:
'De-activate'
?>
</th>
<td
class=
"center"
>
<a
class=
"btn btn-sm btn-info"
id=
"viewCustomer"
customer_id=
"
<?=
encode_param
(
$customer
->
customer_id
)
?>
"
>
<i
class=
"fa fa-fw fa-eye"
></i>
View
</a>
<a
class=
"btn btn-sm btn-primary"
href=
"
<?=
base_url
(
'Customer/editCustomers/'
.
encode_param
(
$customer
->
customer_id
))
?>
"
>
<i
class=
"fa fa-fw fa-edit"
></i>
Edit
</a>
<a
class=
"btn btn-sm btn-danger"
href=
"
<?=
base_url
(
"Customer/changeStatus/"
.
encode_param
(
$customer
->
customer_id
))
.
"/2"
?>
"
onClick=
"return doconfirm()"
>
<i
class=
"fa fa-fw fa-trash"
></i>
Delete
</a>
<?php
if
(
$customer
->
status
==
1
){
?>
<a
class=
"btn btn-sm btn-success"
style=
"background-color:#ac2925"
href=
"
<?=
base_url
(
"Customer/changeStatus/"
.
encode_param
(
$customer
->
customer_id
))
.
"/0"
?>
"
>
<i
class=
"fa fa-cog"
></i>
De-activate
</a>
<?php
}
else
{
?>
<a
class=
"btn btn-sm btn-success"
href=
"
<?=
base_url
(
"Customer/changeStatus/"
.
encode_param
(
$customer
->
customer_id
))
.
"/1"
?>
"
>
<i
class=
"fa fa-cog"
></i>
Activate
</a>
<?php
}
?>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
application/views/Templates/footer.php
View file @
09343300
...
@@ -20,8 +20,8 @@
...
@@ -20,8 +20,8 @@
<!-- POP-UP VIEW MODAL END -->
<!-- POP-UP VIEW MODAL END -->
<footer
class=
"main-footer"
>
<footer
class=
"main-footer"
>
<div
class=
"pull-right hidden-xs"
>
<
!-- <
div class="pull-right hidden-xs">
<b>Version</b> 1.0
<b>Version</b> 1.0
</div>
</div>
<strong>
Copyright
©
2015-2016
<a
href=
"#"
>
Techware Solution
</a>
.
</strong>
All rights reserved.
<strong>Copyright © 2015-2016 <a href="#">Techware Solution</a>.</strong> All rights reserved.
-->
</footer>
</footer>
\ No newline at end of file
application/views/Templates/left-menu.php
View file @
09343300
...
@@ -107,6 +107,27 @@
...
@@ -107,6 +107,27 @@
</li>
</li>
</ul>
</ul>
</li>
</li>
<!-- <li class="treeview">
<a href="#">
<i class="fa fa-bars" aria-hidden="true"></i>
<span>Customer Management</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li>
<a href="
<?=
base_url
(
'Customer/addCustomer'
)
?>
">
<i class="fa fa-circle-o text-aqua"></i>
Add Customer
</a>
</li>
<li>
<a href="
<?=
base_url
(
'Customer/viewCustomers'
)
?>
">
<i class="fa fa-circle-o text-aqua"></i>
View Customer
</a>
</li>
</ul>
</li> -->
<li><a
href=
"
<?=
base_url
(
'Settings'
)
?>
"
>
<li><a
href=
"
<?=
base_url
(
'Settings'
)
?>
"
>
<i
class=
"fa fa-wrench"
aria-hidden=
"true"
>
<i
class=
"fa fa-wrench"
aria-hidden=
"true"
>
</i><span>
Settings
</span></a>
</i><span>
Settings
</span></a>
...
...
assets/css/custom-style.css
View file @
09343300
...
@@ -659,3 +659,7 @@
...
@@ -659,3 +659,7 @@
margin-top
:
0px
;
margin-top
:
0px
;
margin-bottom
:
15px
;
margin-bottom
:
15px
;
}
}
.green
{
color
:
#2d9652
!important
;
}
\ No newline at end of file
assets/js/custom-script.js
View file @
09343300
...
@@ -166,9 +166,9 @@ jQuery('[id="viewVenueDetails"]').on('click',function() {
...
@@ -166,9 +166,9 @@ jQuery('[id="viewVenueDetails"]').on('click',function() {
jQuery
.
each
(
jQuery
.
parseJSON
(
venue_data
[
'layout_details'
]),
function
(
indexLayout
,
layoutValue
)
{
jQuery
.
each
(
jQuery
.
parseJSON
(
venue_data
[
'layout_details'
]),
function
(
indexLayout
,
layoutValue
)
{
innerLyOut
+=
'<div>'
+
innerLyOut
+=
'<div>'
+
'<div onclick="showLyDivDtls(jQuery(this))" class="cpoint">'
+
'<div onclick="showLyDivDtls(jQuery(this))"
show="0"
class="cpoint">'
+
'<i class="fa fa-caret-square-o-down" aria-hidden="true"></i>'
+
'<i class="fa fa-caret-square-o-down
green
" aria-hidden="true"></i>'
+
'<label class="padLeft10">'
+
layoutValue
[
'color'
]
+
'</label> Block'
+
'<label class="padLeft10
cpoint
">'
+
layoutValue
[
'color'
]
+
'</label> Block'
+
'</div>'
+
'</div>'
+
'<div class="hide">'
+
'<div class="hide">'
+
'<div class="padLeft40"><label>'
+
layoutValue
[
'price'
]
+
'</label> /Seat</div>'
+
'<div class="padLeft40"><label>'
+
layoutValue
[
'price'
]
+
'</label> /Seat</div>'
+
...
@@ -488,9 +488,11 @@ jQuery('[id="viewEventDetails"]').on('click',function(event) {
...
@@ -488,9 +488,11 @@ jQuery('[id="viewEventDetails"]').on('click',function(event) {
});
});
function
showLyDivDtls
(
thisObj
){
function
showLyDivDtls
(
thisObj
){
if
(
thisObj
.
attr
(
'show'
)
==
'0'
){
thisObj
.
attr
(
'show'
,
'1'
);
thisObj
.
next
(
"div"
).
removeClass
(
'hide'
);
thisObj
.
next
(
"div"
).
removeClass
(
'hide'
);
}
else
{
setTimeout
(
function
(){
thisObj
.
attr
(
'show'
,
'0'
);
thisObj
.
next
(
"div"
).
addClass
(
'hide'
);
thisObj
.
next
(
"div"
).
addClass
(
'hide'
);
}
,
3000
);
}
}
}
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