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
c87c96e9
Commit
c87c96e9
authored
Nov 06, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dc
parent
ac99572b
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
51 additions
and
23 deletions
+51
-23
Api.php
application/controllers/Api.php
+5
-0
Booking.php
application/controllers/Booking.php
+1
-1
Dashboard.php
application/controllers/Dashboard.php
+0
-2
Webservice.php
application/controllers/Webservice.php
+10
-0
Api_model.php
application/models/Api_model.php
+1
-0
Booking_model.php
application/models/Booking_model.php
+2
-3
Country_model.php
application/models/Country_model.php
+7
-8
Event_model.php
application/models/Event_model.php
+2
-3
Validation_app_model.php
application/models/Validation_app_model.php
+2
-1
Webservice_model.php
application/models/Webservice_model.php
+19
-2
generate.php
application/views/Booking/generate.php
+2
-3
No files found.
application/controllers/Api.php
View file @
c87c96e9
...
...
@@ -659,6 +659,11 @@ class Api extends CI_Controller {
}
}
public
function
addCard
(){
pr
(
$_POST
);
}
/*================ START : Checker API ================*/
public
function
checker_bookingDetails
(){
...
...
application/controllers/Booking.php
View file @
c87c96e9
...
...
@@ -12,7 +12,7 @@ class Booking extends CI_Controller {
redirect
(
base_url
());
}
}
public
function
viewBookings
(){
$template
[
'page'
]
=
'Booking/viewBooking'
;
$template
[
'menu'
]
=
'Booking Management'
;
...
...
application/controllers/Dashboard.php
View file @
c87c96e9
...
...
@@ -21,7 +21,5 @@ class Dashboard extends CI_Controller {
$this
->
load
->
view
(
'template'
,
$template
);
}
}
?>
application/controllers/Webservice.php
View file @
c87c96e9
...
...
@@ -570,5 +570,15 @@ class Webservice extends CI_Controller {
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
create_guest_user
()
{
$res
=
$this
->
Webservice_model
->
createGuestUser
();
if
(
$res
[
'status'
]
==
'success'
){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
}
?>
application/models/Api_model.php
View file @
c87c96e9
...
...
@@ -8,6 +8,7 @@ class Api_model extends CI_Model {
public
function
login
(
$data
){
try
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Something went wrong'
,
'code'
=>
'ER07'
);
$this
->
db
->
select
(
'customer.name,customer.dob,customer.phone,customer.email,customer.profile_image
AS image,customer.gender,users.id AS userId,customer.profile_city AS city,customer.dob,customer.email_verified'
);
$this
->
db
->
where
(
'users.status'
,
1
);
...
...
application/models/Booking_model.php
View file @
c87c96e9
...
...
@@ -95,7 +95,7 @@ class Booking_model extends CI_Model {
$end_date
=
date
(
'Y-m-d'
,
strtotime
(
trim
(
$where_cond
[
'end_date'
])
.
' 23:59'
));
$where_clause
.=
" BOK.booking_date <= '"
.
$end_date
.
"' "
;
}
if
(
!
empty
(
$where_cond
[
'status'
])
){
if
(
$where_cond
[
'status'
]
!=
''
){
$where_clause
.=
(
empty
(
$where_clause
))
?
' WHERE '
:
' AND '
;
$where_clause
.=
" BOK.status = '"
.
$where_cond
[
'status'
]
.
"' "
;
...
...
@@ -145,4 +145,4 @@ class Booking_model extends CI_Model {
return
$reportData
;
}
}
?>
\ No newline at end of file
?>
application/models/Country_model.php
View file @
c87c96e9
...
...
@@ -5,10 +5,11 @@ class Country_model extends CI_Model {
}
public
function
getCountryData
(
$country_id
=
''
,
$view
=
''
){
$cond
=
(
!
empty
(
$view
))
?
" status IN (
$view
) "
:
" status != '2' "
;
$cond
.=
(
!
empty
(
$country_id
))
?
" AND country_id='
$country_id
' "
:
""
;
$countryData
=
$this
->
db
->
query
(
"SELECT * FROM country WHERE
$cond
"
);
$cond
=
(
!
empty
(
$view
))
?
" CTRY.status IN (
$view
) "
:
" CTRY.status != '2' "
;
$cond
.=
(
!
empty
(
$country_id
))
?
" AND CTRY.country_id='
$country_id
' "
:
""
;
$sql
=
"SELECT CTRY.* FROM country AS CTRY WHERE
$cond
"
;
$countryData
=
$this
->
db
->
query
(
$sql
);
if
(
!
empty
(
$countryData
)){
return
(
empty
(
$country_id
))
?
$countryData
->
result
()
:
$countryData
->
row
();
}
...
...
@@ -35,8 +36,7 @@ class Country_model extends CI_Model {
if
(
empty
(
$country_id
)){
return
0
;
}
$status
=
$this
->
db
->
update
(
'country'
,
array
(
'status'
=>
$status
),
array
(
'country_id'
=>
$country_id
));
$status
=
$this
->
db
->
update
(
'country'
,
array
(
'status'
=>
$status
),
array
(
'country_id'
=>
$country_id
));
return
$status
;
}
...
...
@@ -52,4 +52,4 @@ class Country_model extends CI_Model {
return
(
!
empty
(
$locality_id
))
?
$locData
->
row
()
:
$locData
->
result
();
}
}
?>
\ No newline at end of file
?>
application/models/Event_model.php
View file @
c87c96e9
...
...
@@ -209,7 +209,7 @@ class Event_model extends CI_Model {
if
(
empty
(
$event_id
)
||
empty
(
$eventData
)){
return
0
;
}
$this
->
db
->
update
(
'event_date_time'
,
array
(
'status'
=>
'0'
),
array
(
'event_id'
=>
$event_id
));
$this
->
db
->
update
(
'event_date_time'
,
array
(
'status'
=>
'0'
),
array
(
'event_id'
=>
$event_id
,
'status'
=>
'1'
));
$status
=
$this
->
db
->
insert_batch
(
'event_date_time'
,
$eventData
);
return
$status
;
}
...
...
@@ -263,4 +263,4 @@ class Event_model extends CI_Model {
return
$status
;
}
}
?>
\ No newline at end of file
?>
application/models/Validation_app_model.php
View file @
c87c96e9
...
...
@@ -168,7 +168,8 @@ class Validation_app_model extends CI_Model {
'message'
=>
'Total Cost is null or empty'
)
)
)
),
'create_guest_user'
=>
array
()
);
public
function
validation_check
(
$method_name
,
$parms
)
{
...
...
application/models/Webservice_model.php
View file @
c87c96e9
...
...
@@ -1400,7 +1400,7 @@ class Webservice_model extends CI_Model {
INNER JOIN venue ON venue.id = events.venue_id
INNER JOIN translator_event ON translator_event.event_id = events.event_id
WHERE booking.customer_id = '
$user_id
' AND booking.status IN(0, 1, 2) AND
translator_event.language_code = '
$lang
'
(translator_event.language_code='
$lang
' OR translator_event.language_code='EN')
GROUP BY booking.id
ORDER BY booking.id DESC
LIMIT
$page_limit
,
$per_page
"
;
...
...
@@ -1511,7 +1511,7 @@ class Webservice_model extends CI_Model {
LEFT JOIN customer ON customer.customer_id = booking.customer_id
LEFT JOIN review ON review.event_id = booking.event_id
WHERE booking.customer_id = '
$user_id
' AND booking.status='2' AND
translator_event.language_code='
$lang
'
(translator_event.language_code='
$lang
' OR translator_event.language_code='EN')
ORDER BY booking.id DESC LIMIT 1"
;
$result
=
$this
->
db
->
query
(
$sql
)
->
row_array
();
...
...
@@ -2039,5 +2039,22 @@ class Webservice_model extends CI_Model {
$this
->
image_lib
->
initialize
(
$config
);
$this
->
image_lib
->
resize
();
}
public
function
createGuestUser
(){
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Something went wrong'
,
'code'
=>
'ER10'
);
$status
=
$this
->
db
->
insert
(
'users'
,
array
(
'display_name'
=>
'Guest'
,
'user_type'
=>
'6'
));
if
(
!
$status
||
empty
(
$guest_id
=
$this
->
db
->
insert_id
())){
return
$res
;
}
$guestInfo
=
array
(
'customer_id'
=>
$guest_id
,
'name'
=>
'Guest'
,
'phone_verified'
=>
'1'
);
$status
=
$this
->
db
->
insert
(
'customer'
,
$guestInfo
);
if
(
!
$status
){
return
$res
;
}
$auth_token
=
md5
(
microtime
()
.
rand
());
$this
->
generateAuth
(
$guest_id
,
$auth_token
);
return
array
(
'status'
=>
'success'
,
'data'
=>
array
(
'auth_token'
=>
$auth_token
));
}
}
?>
application/views/Booking/generate.php
View file @
c87c96e9
...
...
@@ -83,7 +83,7 @@
<option
selected
disabled
>
Select Booking Status
</option>
<option
value=
""
>
All Bookings
</option>
<?php
$status
=
array
(
'2'
=>
'Completed'
,
'1'
=>
'Bookings'
,
'3'
=>
'Pending'
,
'0'
=>
'Cancelled'
,
'4'
=>
'Deleted'
);
$status
=
array
(
'2'
=>
'Completed'
,
'1'
=>
'Bookings'
,
'3'
=>
'Pending'
,
'0'
=>
'Cancelled'
,
'4'
=>
'Deleted'
,
'5'
=>
'Payment Failed'
);
foreach
(
$status
as
$key
=>
$stat
)
{
echo
'<option value="'
.
$key
.
'">'
.
$stat
.
'</option>'
;
}
...
...
@@ -258,4 +258,4 @@
jQuery
(
document
).
ready
(
function
(){
jQuery
(
'
<?=
$defFields
?>
'
).
prop
(
"checked"
,
true
).
parent
().
closest
(
'div'
).
addClass
(
'disable-block'
);
});
</script>
\ No newline at end of file
</script>
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