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
465b7d9d
Commit
465b7d9d
authored
6 years ago
by
Tobin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jansa' into 'master'
Jansa See merge request
!45
parents
4f9a1319
ad03ecd3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
Webservice_model.php
application/models/Webservice_model.php
+20
-5
No files found.
application/models/Webservice_model.php
View file @
465b7d9d
...
...
@@ -461,6 +461,18 @@ class Webservice_model extends CI_Model {
$price
=
$pricelist
[
'price'
];
$event_layout
=
$rs
->
seat_pricing
;
}
$bookedCount
=
0
;
$sql
=
"SELECT SUM(no_of_ticket) AS bookCount
FROM booking AS BOK
WHERE event_id='
$event_id
' AND customer_id='
$user_id
' AND status IN (1)"
;
$result
=
$this
->
db
->
query
(
$sql
)
->
row_array
();
if
(
!
empty
(
$result
)){
$bookedCount
=
$result
[
'bookCount'
];
}
$event_layout
=
json_decode
(
$event_layout
);
$event_layouts
=
array
();
if
(
is_array
(
$event_layout
)){
...
...
@@ -474,7 +486,7 @@ class Webservice_model extends CI_Model {
'rate'
=>
$value
->
price
,
'total_tickets'
=>
$value
->
capacity
,
'available_tickets'
=>
$avaliable
,
"max_ticket"
=>
$rs
->
max_booking
"max_ticket"
=>
$rs
->
max_booking
-
$bookedCount
);
array_push
(
$event_layouts
,
$priceLayout
);
...
...
@@ -484,7 +496,7 @@ class Webservice_model extends CI_Model {
'rate'
=>
$event_layout
->
price
,
'total_tickets'
=>
null
,
'available_tickets'
=>
null
,
"max_ticket"
=>
$rs
->
max_booking
"max_ticket"
=>
$rs
->
max_booking
-
$bookedCount
);
}
...
...
@@ -514,6 +526,10 @@ class Webservice_model extends CI_Model {
$date_list
[]
=
array
(
'date'
=>
$key
,
'time'
=>
$value
);
}
if
(
$rs
->
is_layout
&&
!
empty
(
$pData
=
json_decode
(
$rs
->
seat_pricing
,
TRUE
))){
$rs
->
event_description
.=
'<p>'
.
$pData
[
'price_details'
]
.
' '
.
'(SAR '
.
$pData
[
'price'
]
.
')'
.
'</p>'
;
}
$tags
=
explode
(
','
,
$rs
->
tag
);
$media_url
=
explode
(
','
,
$rs
->
media_url
);
$resData
=
array
(
...
...
@@ -923,10 +939,10 @@ class Webservice_model extends CI_Model {
$user_id
=
$this
->
auth_token_get
(
$data
[
'auth_token'
]);
if
(
$user_id
>
0
)
{
$post_data
=
$data
;
unset
(
$post_data
[
'auth_token'
]);
$post_data
[
'customer_id'
]
=
$user_id
;
$post_data
[
'ticket_details'
]
=
json_encode
(
$post_data
[
'ticket_details'
]);
$post_data
[
'status'
]
=
3
;
$post_data
[
'status'
]
=
(
isset
(
$post_data
[
'has_payment'
])
&&
$post_data
[
'has_payment'
]
==
0
)
?
'1'
:
'3'
;
unset
(
$post_data
[
'auth_token'
],
$post_data
[
'has_payment'
]);
$code
=
'TO'
;
$ymd
=
date
(
'ymd'
);
$squence
=
rand
(
1111
,
9999
);
...
...
@@ -1154,7 +1170,6 @@ class Webservice_model extends CI_Model {
'contact_number'
=>
$resultData
[
'contact_number'
],
'notification_status'
=>
$resultData
[
'notification_status'
]
==
0
?
0
:
1
,
'email_status'
=>
$resultData
[
'email_status'
]
==
0
?
0
:
1
);
$res
=
array
(
'status'
=>
1
,
'data'
=>
$resultArray
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
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