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
230632fc
Commit
230632fc
authored
Feb 15, 2019
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
admin panel
parent
256df255
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
104 additions
and
9 deletions
+104
-9
Bookings.php
application/controllers/Bookings.php
+2
-1
Webservices.php
application/controllers/Webservices.php
+1
-1
Booking_model.php
application/models/Booking_model.php
+1
-1
Mechanic_model.php
application/models/Mechanic_model.php
+3
-2
list-booking.php
application/views/Bookings/list-booking.php
+7
-1
mechanicForm.php
application/views/Mechanic/mechanicForm.php
+1
-2
custom-script.js
assets/js/custom-script.js
+89
-1
No files found.
application/controllers/Bookings.php
View file @
230632fc
...
...
@@ -36,7 +36,8 @@ class Bookings extends CI_Controller {
$template
[
'menu'
]
=
"Bookings Management"
;
$template
[
'smenu'
]
=
"View Bookings"
;
$template
[
'mechanic_id'
]
=
$mechanic_id
;
$template
[
'mechanic_id'
]
=
(
$this
->
session
->
userdata
(
'user_type'
)
==
1
&&
empty
(
$mechanic_id
))
?
'1'
:
$mechanic_id
;
$template
[
'mechanic_data'
]
=
$mechanic_data
;
$template
[
'bookingData'
]
=
$this
->
Booking_model
->
getMechBookings
(
$mechanic_id
,
''
,
'0,1,3,4'
);
$this
->
load
->
view
(
'template'
,
$template
);
...
...
application/controllers/Webservices.php
View file @
230632fc
...
...
@@ -1153,7 +1153,7 @@
if
(
$authRes
[
'status'
]
==
'error'
){
echo
json_encode
(
$authRes
);
exit
;
}
print_r
(
$_FILES
);
exit
();
if
(
isset
(
$_FILES
[
'images'
])
&&
!
empty
(
$_FILES
[
'images'
])){
$files
=
$_FILES
;
$config
=
set_upload_service
(
'assets/uploads/services'
);
...
...
application/models/Booking_model.php
View file @
230632fc
...
...
@@ -105,7 +105,7 @@ class Booking_model extends CI_Model {
}
function
getMechBookings
(
$mechanic_id
=
''
,
$booking_id
=
''
,
$status
=
'1'
){
if
(
empty
(
$mechanic_id
)
&&
empty
(
$booking
_id
)){
if
(
$this
->
session
->
userdata
(
'user_type'
)
!=
1
&&
empty
(
$mechanic
_id
)){
return
0
;
}
...
...
application/models/Mechanic_model.php
View file @
230632fc
...
...
@@ -62,7 +62,7 @@ class Mechanic_model extends CI_Model {
$cond
.=
(
!
empty
(
$cond
))
?
" AND "
:
$cond
;
$cond
.=
(
!
empty
(
$view_all
))
?
" ADMN.status IN (0,1) "
:
" ADMN.status IN (1) "
;
$sql
=
"SELECT ADMN.username,ADMN.user_type,
ADMN.
display_name,ADMN.profile_image,ADMN.status,
$sql
=
"SELECT ADMN.username,ADMN.user_type,
TRIM(CONCAT(MECH.first_name,' ' ,IFNULL(MECH.last_name,''))) as
display_name,ADMN.profile_image,ADMN.status,
MSH.shop_name, MSH.address AS shop_address, MSH.phone AS shop_phone,
MSH.email_id AS shop_email, MECH.*
FROM mechanic AS MECH
...
...
@@ -107,7 +107,8 @@ class Mechanic_model extends CI_Model {
if
(
!
$status
)
{
return
0
;
}
$upMecArr
=
array
(
'city'
=>
$mechanic_data
[
'city'
],
'first_name'
=>
$mechanic_data
[
'first_name'
],
'state'
=>
$mechanic_data
[
'state'
],
'shop_id'
=>
$mechanic_data
[
'shop_id'
],
'state'
=>
$mechanic_data
[
'state'
],
'shop_id'
=>
(
!
empty
(
$mechanic_data
[
'shop_id'
])
?
$mechanic_data
[
'shop_id'
]
:
'0'
),
'address'
=>
$mechanic_data
[
'address'
],
'email_id'
=>
$mechanic_data
[
'email_id'
],
'last_name'
=>
$mechanic_data
[
'last_name'
],
'phone'
=>
$mechanic_data
[
'phone'
],
'location'
=>
$mechanic_data
[
'location'
],
...
...
application/views/Bookings/list-booking.php
View file @
230632fc
...
...
@@ -38,8 +38,11 @@
<label>
Choose a Mechanic
</label>
<select
name=
"mechanic_id"
class=
"form-control required"
data-parsley-trigger=
"change"
onchange=
"changeMechanic()"
dmClick=
"0"
required
>
<?php
if
(
$this
->
session
->
userdata
[
'user_type'
]
==
1
){
?>
<option>
View All
</option>
<?php
}
else
{
?>
<option
selected
disabled
>
Select Mechanic
</option>
<?php
<?php
}
if
(
!
empty
(
$mechanic_data
)){
foreach
(
$mechanic_data
as
$mechanic
)
{
$chkFlg
=
(
$mechanic_id
==
$mechanic
->
mechanic_id
)
?
'selected'
:
''
;
...
...
@@ -116,6 +119,9 @@
onClick=
"return doconfirm()"
>
<i
class=
"fa fa-fw fa-trash"
></i>
Delete
</a>
<button
class=
"btn btn-sm btn-primary"
style=
"margin-top:3px;"
booking_id=
"
<?=
encode_param
(
$bookData
->
booking_id
)
?>
"
id=
"customQuote"
>
<i
class=
"fa fa-fw fa-edit"
></i>
Generate Custom Quote
</button>
</td>
</tr>
<?php
}
}
?>
...
...
application/views/Mechanic/mechanicForm.php
View file @
230632fc
...
...
@@ -37,8 +37,7 @@
<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=
""
<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
(
$user_data
->
display_name
))
?
$user_data
->
display_name
:
''
?>
"
>
<span
class=
"glyphicon form-control-feedback"
></span>
</div>
...
...
assets/js/custom-script.js
View file @
230632fc
...
...
@@ -756,6 +756,94 @@ function viewMapIssueDetails(issue_id) {
return
false
;
}
jQuery
(
'[id="customQuote"]'
).
on
(
'click'
,
function
(){
var
booking_id
=
jQuery
(
this
).
attr
(
'booking_id'
);
if
(
booking_id
==
''
||
booking_id
==
undefined
||
booking_id
==
'undefined'
||
booking_id
==
null
||
booking_id
==
'null'
){
return
true
;
}
modalTrigger
(
'Generate Custom Description'
,
''
);
addModalLoader
();
jQuery
.
ajax
({
url
:
base_url
+
"Bookings/getBooking"
,
type
:
'POST'
,
data
:
{
'booking_id'
:
booking_id
,
'view_all'
:
'1'
},
success
:
function
(
resp
){
if
(
resp
==
''
||
resp
==
undefined
||
resp
==
'undefined'
||
resp
==
null
||
resp
==
'null'
){
remModalLoader
();
jQuery
(
'[id="modal_content"]'
).
html
(
'Something went wrong, please try again later...!'
);
return
false
;
}
var
resp_data
=
jQuery
.
parseJSON
(
resp
);
if
(
resp_data
[
'status'
]
==
'0'
){
remModalLoader
();
jQuery
(
'[id="modal_content"]'
).
htnl
(
'Something went wrong, Please try again later...!'
);
return
false
;
}
var
booking_data
=
resp_data
[
'data'
];
jQuery
.
each
(
booking_data
,
function
(
index
,
value
){
if
(
value
==
''
||
value
==
null
||
value
==
'null'
||
value
==
undefined
||
value
==
'undefined'
){
booking_data
[
index
]
=
' -- '
;
}
});
var
html
=
''
,
imgCount
=
0
,
issueHtml
=
''
,
optionalHtml
=
''
,
issues_selected
=
jQuery
.
parseJSON
(
booking_data
[
'issues_selected'
]);
if
(
issues_selected
!=
''
){
var
comma
=
''
;
issueHtml
+=
'<div class="col-md-12" style="padding-top:10px">'
+
'<div class="col-md-3"><div class="row"><label>Selected Issue</label></div></div>'
+
'<div class="col-md-6"><div class="row"><label>Description</label></div></div>'
+
'<div class="col-md-3"><div class="row"><label>Amount</label></div></div>'
'<div class="row">'
;
jQuery
.
each
(
issues_selected
,
function
(
index
,
value
)
{
issueHtml
+=
'<div class="col-md-12">'
issueHtml
+=
'<div class="col-md-3">'
;
issueHtml
+=
comma
+
' '
+
value
[
'issue_category'
]
+
' '
;
issueHtml
+=
'</div>'
+
'<div class="col-md-6"><textarea rows="4" cols="60" name="description'
+
index
+
'"></textarea></div>'
+
'<div class="col-md-3"><input type="number" value="" name="amount_'
+
index
+
'"></div>'
+
'</div>'
;
comma
=
'<br>'
;
});
issueHtml
+=
'</div>'
+
'</div>'
+
'<div class="col-md-12">'
+
'<div class="box-footer textCenterAlign">'
+
'<button type="submit" id="custom_data_submit" class="btn btn-primary">Submit</button>'
+
'</div>'
+
'</div>'
;
}
remModalLoader
();
jQuery
(
'[id="modal_content"]'
).
html
(
issueHtml
);
jQuery
(
'[id^="optionalImage_"]'
).
error
(
function
()
{
jQuery
(
'[id^="optionalImage_"]'
).
attr
(
'src'
,
base_url
+
'assets/images/no_image_text.png'
);
});
},
fail
:
function
(
xhr
,
textStatus
,
errorThrown
){
remModalLoader
();
jQuery
(
'[id="modal_content"]'
).
html
(
'Something went wrong, please try again later...!'
);
},
error
:
function
(
ajaxContext
)
{
remModalLoader
();
jQuery
(
'[id="modal_content"]'
).
html
(
'Something went wrong, please try again later...!'
);
}
})
})
jQuery
(
'[id="custom_data_submit"]'
).
on
(
'click'
,
function
()
{
alert
(
'hi'
);
console
.
log
(
'hi'
);
})
jQuery
(
'[id="showBookinDetails"]'
).
on
(
'click'
,
function
()
{
var
booking_id
=
jQuery
(
this
).
attr
(
'booking_id'
);
...
...
@@ -788,7 +876,7 @@ jQuery('[id="showBookinDetails"]').on('click',function() {
}
});
var
html
=
''
,
imgCount
=
0
;
imgCount
=
0
,
issueHtml
=
''
,
optionalHtml
=
''
,
optional_data
=
jQuery
.
parseJSON
(
booking_data
[
'custom_issue_data'
]),
...
...
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