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
ef51177d
Commit
ef51177d
authored
Nov 08, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dc
parent
c65d1d6e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
18 deletions
+43
-18
Booking.php
application/controllers/Booking.php
+5
-4
Booking_model.php
application/models/Booking_model.php
+1
-1
viewBooking.php
application/views/Booking/viewBooking.php
+20
-9
custom-script.js
assets/js/custom-script.js
+17
-4
No files found.
application/controllers/Booking.php
View file @
ef51177d
...
...
@@ -22,7 +22,7 @@ class Booking extends CI_Controller {
$template
[
'page_head'
]
=
"Booking Management"
;
$provider_id
=
(
$this
->
session
->
userdata
(
'user_type'
)
==
2
)
?
$this
->
session
->
userdata
(
'id'
)
:
''
;
$template
[
'booking_data'
]
=
$this
->
Booking_model
->
getBookingData
(
''
,
$provider_id
,
'0,1,2,3,5'
);
$template
[
'booking_data'
]
=
$this
->
Booking_model
->
getBookingData
(
''
,
$provider_id
,
'0,1,2,3,5
,6
'
);
$this
->
load
->
view
(
'template'
,
$template
);
}
...
...
@@ -35,7 +35,7 @@ class Booking extends CI_Controller {
$booking_id
=
(
!
is_numeric
(
$_POST
[
'booking_id'
]))
?
decode_param
(
$_POST
[
'booking_id'
])
:
$_POST
[
'booking_id'
];
$view_all
=
(
isset
(
$_POST
[
'view_all'
])
&&
$_POST
[
'view_all'
]
!=
''
)
?
$_POST
[
'view_all'
]
:
'0,1,2,3,5'
;
$view_all
=
(
isset
(
$_POST
[
'view_all'
])
&&
$_POST
[
'view_all'
]
!=
''
)
?
$_POST
[
'view_all'
]
:
'0,1,2,3,5
,6
'
;
$provider_id
=
(
$this
->
session
->
userdata
(
'user_type'
)
==
2
)
?
$this
->
session
->
userdata
(
'id'
)
:
''
;
$bookData
[
'bookData'
]
=
$this
->
Booking_model
->
getBookingData
(
$booking_id
,
$provider_id
,
$view_all
);
...
...
@@ -48,10 +48,11 @@ class Booking extends CI_Controller {
if
(
!
isset
(
$_POST
)
||
!
isset
(
$_POST
[
'booking_id'
])
||
empty
(
$_POST
[
'booking_id'
])){
echo
json_encode
(
array
(
'status'
=>
'0'
));
exit
;
}
$status
=
(
isset
(
$_POST
[
'status'
])
&&
$_POST
[
'status'
]
!=
''
)
?
$_POST
[
'status'
]
:
'1'
;
$booking_id
=
decode_param
(
$_POST
[
'booking_id'
]);
$resp
=
$this
->
Booking_model
->
changeStatus
(
$booking_id
,
'4'
);
$resp
=
$this
->
Booking_model
->
changeStatus
(
$booking_id
,
$status
);
if
(
$resp
){
echo
json_encode
(
array
(
'status'
=>
'1'
));
exit
;
echo
json_encode
(
array
(
'status'
=>
'1'
,
'data'
=>
array
(
'booking_id'
=>
$_POST
[
'booking_id'
])
));
exit
;
}
echo
json_encode
(
array
(
'status'
=>
'0'
));
exit
;
}
...
...
application/models/Booking_model.php
View file @
ef51177d
...
...
@@ -5,7 +5,7 @@ class Booking_model extends CI_Model {
parent
::
_construct
();
}
public
function
getBookingData
(
$booking_id
=
''
,
$provider_id
=
''
,
$view
=
'0,1,2,3,5'
){
public
function
getBookingData
(
$booking_id
=
''
,
$provider_id
=
''
,
$view
=
'0,1,2,3,5
,6
'
){
$cond
=
(
!
empty
(
$view
))
?
" BOK.status IN (
$view
) "
:
" BOK.status != '4' "
;
$cond
.=
(
!
empty
(
$booking_id
))
?
" AND BOK.id='
$booking_id
' "
:
""
;
$cond
.=
(
!
empty
(
$provider_id
))
?
" AND EVT.provider_id='
$provider_id
' "
:
""
;
...
...
application/views/Booking/viewBooking.php
View file @
ef51177d
...
...
@@ -59,7 +59,7 @@
<th
class=
"center"
>
<?=
$booking
->
customer_name
?>
</th>
<th
class=
"center"
>
<?=
$booking
->
date
.
' '
.
$booking
->
time
?>
</th>
<th
class=
"center"
>
<?=
$booking
->
amount
?>
</th>
<th
class=
"center"
>
<th
class=
"center"
id=
"bookingStatus_
<?=
encode_param
(
$booking
->
booking_id
)
?>
"
>
<?php
switch
(
$booking
->
book_status
){
case
0
:
echo
'Cancelled'
;
break
;
...
...
@@ -68,16 +68,28 @@
case
3
:
echo
'Pending'
;
break
;
case
4
:
echo
'Deleted'
;
break
;
case
5
:
echo
'Payment Failed'
;
break
;
case
6
:
echo
'Waiting for Aproval'
;
break
;
}
?>
</th>
<td
class=
"center"
>
<a
class=
"btn btn-sm btn-info"
id=
"viewBooking"
booking_id=
"
<?=
encode_param
(
$booking
->
booking_id
)
?>
"
>
<td
class=
"center"
>
<a
class=
"cpoint text-primary"
id=
"viewBooking"
booking_id=
"
<?=
encode_param
(
$booking
->
booking_id
)
?>
"
>
<i
class=
"fa fa-fw fa-eye"
></i>
View
</a>
<!-- <a class="btn btn-sm btn-danger" status="2" onclick="confirmDelete(jQuery(this),'Booking/changeStatus',{'booking_id':'
<?=
encode_param
(
$booking
->
booking_id
)
?>
'})">
<i class="fa fa-fw fa-trash"></i>Delete
</a> -->
</a>
<br>
<?php
if
(
$this
->
session
->
userdata
(
'user_type'
)
==
2
&&
$booking
->
book_status
==
'6'
){
$msg
=
"Are you sure to Aprove this booking ?"
;
$bookId
=
encode_param
(
$booking
->
booking_id
);
$param
=
"
{
'booking_id':'$bookId','alertMsg':'$msg'
}
"
;
?>
<a
id=
"approveBooking_
<?=
encode_param
(
$booking
->
booking_id
)
?>
"
class=
"cpoint text-success"
status=
"1"
call_back=
"updateBokApproved"
status_id=
"
<?=
encode_param
(
$booking
->
booking_id
)
?>
"
onclick=
"confirmDelete(jQuery(this),'Booking/changeStatus',
<?=
$param
?>
)"
>
<i
class=
"fa fa-fw fa-check"
></i>
Approve
</a>
<?php
}
?>
<?php
}
?>
</td>
</tr>
...
...
@@ -89,4 +101,4 @@
</div>
</div>
</section>
</div>
\ No newline at end of file
</div>
assets/js/custom-script.js
View file @
ef51177d
...
...
@@ -603,7 +603,7 @@ function viewBooking(booking_id){
jQuery
.
ajax
({
url
:
base_url
+
"Booking/getBookingData"
,
type
:
'POST'
,
data
:
{
'booking_id'
:
booking_id
,
'view_all'
:
'0,1,2,3,4,5'
},
data
:
{
'booking_id'
:
booking_id
,
'view_all'
:
'0,1,2,3,4,5
,6
'
},
success
:
function
(
resp
){
if
(
resp
==
''
||
resp
==
undefined
||
resp
==
'undefined'
||
resp
==
null
||
resp
==
'null'
){
remModalLoader
();
...
...
@@ -933,8 +933,22 @@ function setPromoStatus(elmId,data){
jQuery
(
'[id="statusFlag_'
+
elmId
+
'"]'
).
html
(
data
[
'c_status'
]);
}
function
updateBokApproved
(
elmId
,
data
){
if
(
data
==
undefined
||
data
==
'undefined'
||
data
==
null
||
data
==
'null'
||
data
==
''
||
elmId
==
undefined
||
elmId
==
'undefined'
||
elmId
==
null
||
elmId
==
'null'
||
elmId
==
''
){
return
false
;
}
jQuery
(
'[id="bookingStatus_'
+
elmId
+
'"]'
).
html
(
'Booked'
);
console
.
log
(
'[id="bookingStatus_'
+
elmId
+
'"]'
);
jQuery
(
'[id="approveBooking_'
+
elmId
+
'"]'
).
remove
();
}
function
confirmDelete
(
thisObj
,
fnName
,
params
){
if
(
confirm
(
"Are you sure to delete permanently?"
)){
var
msg
=
"Are you sure to delete permanently ?"
;
if
(
params
.
alertMsg
){
msg
=
params
.
alertMsg
;
}
if
(
confirm
(
msg
)){
updateStatus
(
thisObj
,
fnName
,
params
,
status
);
}
}
...
...
@@ -1011,4 +1025,4 @@ jQuery('[id^="addMultiLang"]').on('click',function() {
jQuery
(
'[id="showMultiLangBlock_'
+
block
+
'"]'
).
removeClass
(
'hide'
);
}
});
\ No newline at end of file
});
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