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
a52f59bc
Commit
a52f59bc
authored
May 08, 2019
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
booking and event api
parent
9e81086b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
bookingStatusCrone.php
application/controllers/bookingStatusCrone.php
+1
-1
Webservice_model.php
application/models/Webservice_model.php
+20
-5
No files found.
application/controllers/bookingStatusCrone.php
View file @
a52f59bc
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
WHERE event_date_time.date < '
$todate
' and event_date_time.time < now() and booking.status='1'"
;
WHERE event_date_time.date < '
$todate
' and event_date_time.time < now() and booking.status='1'"
;
$result
=
mysqli_query
(
$conn
,
$sql
);
$result
=
mysqli_query
(
$conn
,
$sql
);
$date_time
=
date
(
'Y-m-d H:i:s
a
'
,
strtotime
(
'- 15 minutes'
));
$date_time
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
'- 15 minutes'
));
$sql
=
"UPDATE booking
$sql
=
"UPDATE booking
INNER JOIN transaction ON transaction.booking_id = booking.bookId
INNER JOIN transaction ON transaction.booking_id = booking.bookId
SET booking.status = '5',transaction.status='3'
SET booking.status = '5',transaction.status='3'
...
...
application/models/Webservice_model.php
View file @
a52f59bc
...
@@ -461,6 +461,18 @@ class Webservice_model extends CI_Model {
...
@@ -461,6 +461,18 @@ class Webservice_model extends CI_Model {
$price
=
$pricelist
[
'price'
];
$price
=
$pricelist
[
'price'
];
$event_layout
=
$rs
->
seat_pricing
;
$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_layout
=
json_decode
(
$event_layout
);
$event_layouts
=
array
();
$event_layouts
=
array
();
if
(
is_array
(
$event_layout
)){
if
(
is_array
(
$event_layout
)){
...
@@ -474,7 +486,7 @@ class Webservice_model extends CI_Model {
...
@@ -474,7 +486,7 @@ class Webservice_model extends CI_Model {
'rate'
=>
$value
->
price
,
'rate'
=>
$value
->
price
,
'total_tickets'
=>
$value
->
capacity
,
'total_tickets'
=>
$value
->
capacity
,
'available_tickets'
=>
$avaliable
,
'available_tickets'
=>
$avaliable
,
"max_ticket"
=>
$rs
->
max_booking
"max_ticket"
=>
$rs
->
max_booking
-
$bookedCount
);
);
array_push
(
$event_layouts
,
$priceLayout
);
array_push
(
$event_layouts
,
$priceLayout
);
...
@@ -484,7 +496,7 @@ class Webservice_model extends CI_Model {
...
@@ -484,7 +496,7 @@ class Webservice_model extends CI_Model {
'rate'
=>
$event_layout
->
price
,
'rate'
=>
$event_layout
->
price
,
'total_tickets'
=>
null
,
'total_tickets'
=>
null
,
'available_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 {
...
@@ -514,6 +526,10 @@ class Webservice_model extends CI_Model {
$date_list
[]
=
array
(
'date'
=>
$key
,
'time'
=>
$value
);
$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
);
$tags
=
explode
(
','
,
$rs
->
tag
);
$media_url
=
explode
(
','
,
$rs
->
media_url
);
$media_url
=
explode
(
','
,
$rs
->
media_url
);
$resData
=
array
(
$resData
=
array
(
...
@@ -923,10 +939,10 @@ class Webservice_model extends CI_Model {
...
@@ -923,10 +939,10 @@ class Webservice_model extends CI_Model {
$user_id
=
$this
->
auth_token_get
(
$data
[
'auth_token'
]);
$user_id
=
$this
->
auth_token_get
(
$data
[
'auth_token'
]);
if
(
$user_id
>
0
)
{
if
(
$user_id
>
0
)
{
$post_data
=
$data
;
$post_data
=
$data
;
unset
(
$post_data
[
'auth_token'
]);
$post_data
[
'customer_id'
]
=
$user_id
;
$post_data
[
'customer_id'
]
=
$user_id
;
$post_data
[
'ticket_details'
]
=
json_encode
(
$post_data
[
'ticket_details'
]);
$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'
;
$code
=
'TO'
;
$ymd
=
date
(
'ymd'
);
$ymd
=
date
(
'ymd'
);
$squence
=
rand
(
1111
,
9999
);
$squence
=
rand
(
1111
,
9999
);
...
@@ -1154,7 +1170,6 @@ class Webservice_model extends CI_Model {
...
@@ -1154,7 +1170,6 @@ class Webservice_model extends CI_Model {
'contact_number'
=>
$resultData
[
'contact_number'
],
'contact_number'
=>
$resultData
[
'contact_number'
],
'notification_status'
=>
$resultData
[
'notification_status'
]
==
0
?
0
:
1
,
'notification_status'
=>
$resultData
[
'notification_status'
]
==
0
?
0
:
1
,
'email_status'
=>
$resultData
[
'email_status'
]
==
0
?
0
:
1
'email_status'
=>
$resultData
[
'email_status'
]
==
0
?
0
:
1
);
);
$res
=
array
(
'status'
=>
1
,
'data'
=>
$resultArray
);
$res
=
array
(
'status'
=>
1
,
'data'
=>
$resultArray
);
}
else
{
}
else
{
...
...
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