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
84c73885
Commit
84c73885
authored
Feb 25, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daily commit
parent
e32029c6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
36 deletions
+92
-36
Booking.php
application/controllers/Booking.php
+43
-0
Booking_model.php
application/models/Booking_model.php
+1
-4
generate.php
application/views/Booking/generate.php
+30
-28
custom-script.js
assets/js/custom-script.js
+18
-4
No files found.
application/controllers/Booking.php
View file @
84c73885
...
...
@@ -94,6 +94,7 @@ class Booking extends CI_Controller {
echo
json_encode
(
$return_arr
);
exit
;
}
$report_data
=
$this
->
formatReportData
(
$report_data
);
if
(
!
empty
(
$report_data
)){
if
(
$action
==
'view'
){
$return_arr
[
'status'
]
=
1
;
...
...
@@ -168,5 +169,46 @@ class Booking extends CI_Controller {
header
(
'Content-Disposition: attachement; filename="'
.
$fileName
.
'";'
);
fpassthru
(
$temp_memory
);
}
function
formatReportData
(
$reportData
=
array
()){
if
(
empty
(
$reportData
)){
return
0
;
}
foreach
(
$reportData
AS
$key
=>
$data
){
if
(
isset
(
$data
[
'Book_Status'
])){
switch
(
$data
[
'Book_Status'
])
{
case
'0'
:
$reportData
[
$key
][
'Book_Status'
]
=
'Cancelled'
;
break
;
case
'1'
:
$reportData
[
$key
][
'Book_Status'
]
=
'Booked'
;
break
;
case
'2'
:
$reportData
[
$key
][
'Book_Status'
]
=
'Completed'
;
break
;
case
'3'
:
$reportData
[
$key
][
'Book_Status'
]
=
'Pending'
;
break
;
case
'4'
:
$reportData
[
$key
][
'Book_Status'
]
=
'Deleted'
;
break
;
}
}
if
(
isset
(
$data
[
'Reserved_By'
])){
switch
(
$data
[
'Reserved_By'
])
{
case
'1'
:
$reportData
[
$key
][
'Reserved_By'
]
=
'Super Admin '
;
break
;
case
'2'
:
$reportData
[
$key
][
'Reserved_By'
]
=
'Provider '
;
break
;
case
'3'
:
$reportData
[
$key
][
'Reserved_By'
]
=
'Customer'
;
break
;
}
}
if
(
!
empty
(
$data
[
'Ticket_Details'
])){
$tktDtls
=
json_decode
(
$data
[
'Ticket_Details'
],
true
);
if
(
isset
(
$tktDtls
[
'price'
],
$tktDtls
[
'no_ticket'
],
$tktDtls
[
'total_price'
])
&&
!
empty
(
$tktDtls
[
'price'
])
&&!
empty
(
$tktDtls
[
'no_ticket'
])
&&!
empty
(
$tktDtls
[
'total_price'
])){
$pDiv
=
(
isset
(
$tktDtls
[
'color'
])
&&!
empty
(
$tktDtls
[
'color'
]))
?
$tktDtls
[
'color'
]
.
' Block : '
:
''
;
$pDiv
.=
$tktDtls
[
'price'
]
.
' * '
.
$tktDtls
[
'no_ticket'
]
.
'(Seats) = '
.
$tktDtls
[
'total_price'
];
$reportData
[
$key
][
'Ticket_Details'
]
=
$pDiv
;
}
}
}
return
$reportData
;
}
}
?>
\ No newline at end of file
application/models/Booking_model.php
View file @
84c73885
...
...
@@ -50,7 +50,7 @@ class Booking_model extends CI_Model {
$where_clause
=
''
;
if
(
!
empty
(
$where_cond
)){
if
(
!
empty
(
$where_cond
[
'provider_id'
])){
$where_clause
=
" WHERE
BOK
.provider_id = '"
.
$where_cond
[
'provider_id'
]
.
"' "
;
$where_clause
=
" WHERE
EVT
.provider_id = '"
.
$where_cond
[
'provider_id'
]
.
"' "
;
}
if
(
!
empty
(
$where_cond
[
'start_date'
])
&&
!
empty
(
$where_cond
[
'end_date'
])){
$where_clause
.=
(
empty
(
$where_clause
))
?
' WHERE '
:
' AND '
;
...
...
@@ -98,9 +98,6 @@ class Booking_model extends CI_Model {
if
(
empty
(
$resData
)){
return
2
;
}
foreach
(
$resData
AS
$key
=>
$data
){
$resData
[
$key
][
'Appointment_Time'
]
=
(
!
empty
(
$data
[
'Appointment_Time'
]))
?
date
(
'd-M-y G:i'
,
$data
[
'Appointment_Time'
])
:
''
;
}
return
$resData
;
}
return
0
;
...
...
application/views/Booking/generate.php
View file @
84c73885
...
...
@@ -117,45 +117,45 @@
$tables
=
array
(
'booking_details'
=>
array
(
'name'
=>
'Basic Details'
,
'fields'
=>
array
(
'BOK.bookId AS
book_id
'
=>
'Book ID'
,
'CONCAT(EDT.date,\' \',EDT.time) AS
show_t
ime'
=>
'Show Time'
,
'BOK.qrcode AS
qrc
ode'
=>
'QR Code'
,
'BOK.no_of_ticket AS
no_of_t
icket'
=>
'No Of Ticket'
,
'BOK.ticket_details AS
ticket_d
etails'
=>
'Ticked Details'
,
'BOK.amount AS
a
mount'
=>
'Booking Amount'
,
'BOK.reserved_by AS
reserved_b
y'
=>
'Reserved By'
,
'BOK.status AS
book_s
tatus'
=>
'Booking Status'
array
(
'BOK.bookId AS
Book_ID
'
=>
'Book ID'
,
'CONCAT(EDT.date,\' \',EDT.time) AS
Show_T
ime'
=>
'Show Time'
,
'BOK.qrcode AS
QR_C
ode'
=>
'QR Code'
,
'BOK.no_of_ticket AS
No_Of_T
icket'
=>
'No Of Ticket'
,
'BOK.ticket_details AS
Ticket_D
etails'
=>
'Ticked Details'
,
'BOK.amount AS
A
mount'
=>
'Booking Amount'
,
'BOK.reserved_by AS
Reserved_B
y'
=>
'Reserved By'
,
'BOK.status AS
Book_S
tatus'
=>
'Booking Status'
)
),
array
(
'name'
=>
'Event Details'
,
'fields'
=>
array
(
'EVT.event_name AS
event_n
ame'
=>
'Event Name'
,
'EVT.event_discription AS
event_d
iscription'
=>
'Event Discription'
,
'ECAT.category AS
c
ategory'
=>
'Event Category'
,
'ECAT.category_description AS
category_d
escription'
=>
'Category Description'
array
(
'EVT.event_name AS
Event_N
ame'
=>
'Event Name'
,
'EVT.event_discription AS
Event_D
iscription'
=>
'Event Discription'
,
'ECAT.category AS
C
ategory'
=>
'Event Category'
,
'ECAT.category_description AS
Category_D
escription'
=>
'Category Description'
)
),
array
(
'name'
=>
'Customer Details'
,
'fields'
=>
array
(
'CUST.name AS
customer_n
ame'
=>
'Customer Name'
,
'CUST.phone AS
customer_p
hone'
=>
'Customer Phone'
,
'CUST.email AS
customer_e
mail'
=>
'Customer Email'
,
'CUST.city AS
customer_c
ity'
=>
'Customer City'
array
(
'CUST.name AS
Customer_N
ame'
=>
'Customer Name'
,
'CUST.phone AS
Customer_P
hone'
=>
'Customer Phone'
,
'CUST.email AS
Customer_E
mail'
=>
'Customer Email'
,
'CUST.city AS
Customer_C
ity'
=>
'Customer City'
)
),
array
(
'name'
=>
'Provider Details'
,
'fields'
=>
array
(
'PRV.name AS
provider_n
ame'
=>
'Provider Name'
,
'PRV.phone AS
provider_p
hone'
=>
'Provider Phone'
,
'PRV.email AS
provider_e
mail'
=>
'Provider Email'
array
(
'PRV.name AS
Provider_N
ame'
=>
'Provider Name'
,
'PRV.phone AS
Provider_P
hone'
=>
'Provider Phone'
,
'PRV.email AS
Provider_E
mail'
=>
'Provider Email'
)
),
array
(
'name'
=>
'Venue Details'
,
'fields'
=>
array
(
'VEN.venue_name AS
venue_n
ame'
=>
'Venue Name'
,
'VEN.venue_details AS
venue_d
etails'
=>
'Venue Details'
,
'REG.name AS
r
egion'
=>
'Region'
,
'VEN.location AS
l
ocation'
=>
'Location'
array
(
'VEN.venue_name AS
Venue_N
ame'
=>
'Venue Name'
,
'VEN.venue_details AS
Venue_D
etails'
=>
'Venue Details'
,
'REG.name AS
R
egion'
=>
'Region'
,
'VEN.location AS
L
ocation'
=>
'Location'
)
)
...
...
@@ -230,11 +230,12 @@
<thead>
<tr>
<th
width=
"60px;"
>
Book ID
</th>
<th
width=
"1
00px;"
>
Event Name
</th>
<th
width=
"
80px;"
>
Tickets Booked
</th>
<th
width=
"
10
0px;"
>
Amount
</th>
<th
width=
"1
20px;"
>
Event
</th>
<th
width=
"
120px;"
>
Customer Name
</th>
<th
width=
"
8
0px;"
>
Amount
</th>
<th
width=
"100px;"
>
Show Time
</th>
<th
width=
"80px;"
>
Action
</th>
<th
width=
"50px;"
>
Status
</th>
<th
width=
"50px;"
>
Action
</th>
</tr>
</thead>
<tbody
id=
"report_table_body"
>
...
...
@@ -250,6 +251,6 @@
<script
type=
"text/javascript"
>
jQuery
(
document
).
ready
(
function
(){
jQuery
(
'[name^="
TDLS.transport_id"],[name^="TDLS.medical_no"],[name^="TDLS.patient_name"],[name^="TDLS.age"],[name^="TDLS.phone"],[name^="APRES.reason"],[name^="TDLS.appointment_ti
me"]'
).
prop
(
"checked"
,
true
).
parent
().
closest
(
'div'
).
addClass
(
'disable-block'
);
jQuery
(
'[name^="
BOK.bookId"],[name^="CONCAT(EDT.date,
\'
\'
,EDT.time)"],[name^="BOK.amount"],[name^="BOK.status"],[name^="EVT.event_name"],[name^="CUST.na
me"]'
).
prop
(
"checked"
,
true
).
parent
().
closest
(
'div'
).
addClass
(
'disable-block'
);
});
</script>
\ No newline at end of file
assets/js/custom-script.js
View file @
84c73885
...
...
@@ -636,7 +636,9 @@ function checkChild(thisObj){
}
else
{
jQuery
(
'[id^="table_'
+
table
+
'_"]'
).
prop
(
"checked"
,
false
);
}
jQuery
(
'[name^="TDLS.transport_id"],[name^="TDLS.medical_no"],[name^="TDLS.patient_name"],[name^="TDLS.age"],[name^="TDLS.phone"],[name^="APRES.reason"],[name^="TDLS.appointment_time"]'
).
prop
(
"checked"
,
true
).
parent
().
closest
(
'div'
).
addClass
(
'disable-block'
);
jQuery
(
document
).
ready
(
function
(){
jQuery
(
'[name^="BOK.bookId"],[name^="CONCAT(EDT.date,
\'
\'
,EDT.time)"],[name^="BOK.amount"],[name^="BOK.status"],[name^="EVT.event_name"],[name^="CUST.name"]'
).
prop
(
"checked"
,
true
).
parent
().
closest
(
'div'
).
addClass
(
'disable-block'
);
});
}
jQuery
(
'[name="fieldType"]'
).
click
(
function
(){
...
...
@@ -699,7 +701,7 @@ jQuery('[id="rGenerate"]').click(function(){
jQuery
.
each
(
resp_data
[
'report_data'
],
function
(
key
,
data
)
{
report_data
[
key
]
=
data
;
var
vBtn
=
'<a class="btn btn-sm btn-primary" id="report_view_pop_'
+
key
+
'" key="'
+
key
+
'"><i class="fa fa-fw fa-edit"></i>View</a>'
;
table
.
row
.
add
([
data
[
'
book_id'
],
data
[
'event_name'
],
data
[
'no_of_ticket'
],
data
[
'amount'
],
data
[
'show_time
'
],
vBtn
]).
draw
();
table
.
row
.
add
([
data
[
'
Book_ID'
],
data
[
'Event_Name'
],
data
[
'Customer_Name'
],
data
[
'Amount'
],
data
[
'Show_Time'
],
data
[
'Book_Status
'
],
vBtn
]).
draw
();
});
jQuery
(
'[id="report_table_html"]'
).
removeClass
(
'hide'
);
...
...
@@ -713,4 +715,16 @@ jQuery('[id="rGenerate"]').click(function(){
}
}
});
});
\ No newline at end of file
});
function
setErrModal
(
header_msg
,
body_msg
){
jQuery
(
'[id="modal_body_msg"]'
).
html
(
body_msg
);
jQuery
(
'[id="modal_header_msg"]'
).
html
(
header_msg
);
jQuery
(
'[id="errModal"]'
).
modal
(
'show'
);
}
function
slideTo
(
id
){
jQuery
(
'html, body'
).
animate
({
scrollTop
:
jQuery
(
'[id="'
+
id
+
'"]'
).
offset
().
top
},
800
);
}
\ 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