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
fc52ab24
Commit
fc52ab24
authored
Oct 17, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'dev_production'
Master See merge request
!111
parents
9ef99d99
a6f32e8e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
715 additions
and
127 deletions
+715
-127
Api.php
application/controllers/Api.php
+86
-52
OrganizerServices.php
application/controllers/OrganizerServices.php
+240
-0
Api_model.php
application/models/Api_model.php
+71
-65
Organizer_model.php
application/models/Organizer_model.php
+0
-0
Validation_model.php
application/models/Validation_model.php
+289
-1
viewSettings.php
application/views/Settings/viewSettings.php
+29
-9
No files found.
application/controllers/Api.php
View file @
fc52ab24
...
...
@@ -20,7 +20,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
class
Api
extends
CI_Controller
{
var
$auth_token
;
private
$cipher
=
"AES-256-CBC"
;
public
function
__construct
()
{
parent
::
__construct
();
date_default_timezone_set
(
"Asia/Riyadh"
);
...
...
@@ -319,7 +319,7 @@ class Api extends CI_Controller {
}
}
public
function
payNow
(
$auth_token
=
''
,
$amount
=
0
,
$booking_id
=
''
,
$event_id
=
''
){
public
function
payNow
(
$auth_token
=
''
,
$amount
=
0
,
$booking_id
=
''
,
$event_id
=
''
,
$cardData
=
''
){
$settings
=
getSettings
();
$redUrl
=
$settings
[
'web_base_url'
];
...
...
@@ -330,32 +330,42 @@ class Api extends CI_Controller {
$res
=
$this
->
Api_model
->
payNow
(
$payData
);
if
(
$res
[
'status'
]
==
1
){
$this
->
paymentGateway
(
$amount
,
$res
[
'transaction_id'
],
$event_id
,
$booking_id
,
$res
[
'custData'
]);
$this
->
paymentGateway
(
$amount
,
$res
[
'transaction_id'
],
$event_id
,
$booking_id
,
$res
[
'custData'
]
,
$cardData
);
}
else
{
redirect
(
$redUrl
.
'failure?event_id='
.
$eventid
);
}
}
public
function
paymentGateway
(
$amount
=
'0'
,
$last_id
=
'0'
,
$event_id
=
'0'
,
$booking_id
=
'0'
,
$custData
=
array
()){
public
function
paymentGateway
(
$amount
=
'0'
,
$last_id
=
'0'
,
$event_id
=
'0'
,
$booking_id
=
'0'
,
$custData
=
array
(),
$cardData
=
''
){
$customerName
=
array
();
if
(
isset
(
$custData
->
name
)
&&
!
empty
(
$custData
->
name
)){
$customerName
=
explode
(
' '
,
$custData
->
name
);
}
$amount
=
$amount
;
$phone
=
(
isset
(
$custData
->
phone
))
?
$custData
->
phone
:
''
;
$email
=
(
isset
(
$custData
->
email
))
?
$custData
->
email
:
''
;
$userId
=
(
isset
(
$custData
->
userId
))
?
$custData
->
userId
:
''
;
$f_Name
=
(
isset
(
$custData
->
name
))
?
$custData
->
name
:
''
;
$l_Name
=
'T'
;
$add1
=
'Mumbai'
;
$add2
=
'Mumbai'
;
$city
=
'Mumbai'
;
$state
=
'Maharashtra'
;
$pincode
=
'123456'
;
$f_Name
=
(
isset
(
$customerName
[
0
]))
?
$customerName
[
0
]
:
''
;
$l_Name
=
(
isset
(
$customerName
[
1
]))
?
$customerName
[
1
]
:
'T'
;
$add1
=
$add2
=
$city
=
$state
=
'Saudi Arabia'
;
$pincode
=
'61961'
;
$holder
=
'Basanta Mahunta'
;
$cardType
=
'MasterCard'
;
$cardNo
=
'5111111111111118'
;
$cvv
=
'100'
;
$expMonth
=
'06'
;
$expYear
=
'2022'
;
$cvv
=
'100'
;
$holder
=
'Basanta Mahunta'
;
$cardType
=
'MasterCard'
;
// if(!empty($cardData)){
// if(isset($cardData['tocken'])){
// } else {
// }
// }
$failureUrl
=
base_url
(
'Api/paymentFailureUrl'
);
$successUrl
=
base_url
(
'Api/paymentSuccessUrl'
);
...
...
@@ -369,10 +379,10 @@ class Api extends CI_Controller {
$colabId
=
$settings
[
'collaborator_id'
];
$requestUrl
=
$settings
[
'payment_gateway_url'
];
$size
=
openssl_cipher_iv_length
(
'AES-256-CBC'
);
$size
=
openssl_cipher_iv_length
(
$this
->
cipher
);
$pad
=
$size
-
(
strlen
(
$pText
)
%
$size
);
$painText
=
$pText
.
str_repeat
(
chr
(
$pad
),
$pad
);
$painText
=
base64_encode
(
openssl_encrypt
(
$painText
,
'AES-256-CBC'
,
base64_decode
(
$mKey
),
OPENSSL_RAW_DATA
|
OPENSSL_ZERO_PADDING
,
$iv
));
$painText
=
base64_encode
(
openssl_encrypt
(
$painText
,
$this
->
cipher
,
base64_decode
(
$mKey
),
OPENSSL_RAW_DATA
|
OPENSSL_ZERO_PADDING
,
$iv
));
$this
->
load
->
view
(
'payment/payment'
,
array
(
'rUrl'
=>
$requestUrl
,
'mId'
=>
$mId
,
'colabId'
=>
$colabId
,
'requestParam'
=>
$mId
.
'||'
.
$colabId
.
'||'
.
$painText
));
...
...
@@ -392,7 +402,7 @@ class Api extends CI_Controller {
}
$enctext
=
base64_decode
(
$response
[
1
]);
$padtext
=
openssl_decrypt
(
$enctext
,
'AES-256-CBC'
,
base64_decode
(
$mKey
),
OPENSSL_RAW_DATA
|
OPENSSL_ZERO_PADDING
,
$iv
);
$padtext
=
openssl_decrypt
(
$enctext
,
$this
->
cipher
,
base64_decode
(
$mKey
),
OPENSSL_RAW_DATA
|
OPENSSL_ZERO_PADDING
,
$iv
);
$pad
=
ord
(
$padtext
{
strlen
(
$padtext
)
-
1
});
if
(
$pad
>
strlen
(
$padtext
)){
redirect
(
$redUrl
.
'failure'
);
...
...
@@ -452,7 +462,7 @@ class Api extends CI_Controller {
redirect
(
$redUrl
.
'failure'
);
}
$enctext
=
base64_decode
(
$response
[
1
]);
$padtext
=
openssl_decrypt
(
$enctext
,
'AES-256-CBC'
,
base64_decode
(
$mKey
),
OPENSSL_RAW_DATA
|
OPENSSL_ZERO_PADDING
,
$iv
);
$padtext
=
openssl_decrypt
(
$enctext
,
$this
->
cipher
,
base64_decode
(
$mKey
),
OPENSSL_RAW_DATA
|
OPENSSL_ZERO_PADDING
,
$iv
);
$pad
=
ord
(
$padtext
{
strlen
(
$padtext
)
-
1
});
if
(
$pad
>
strlen
(
$padtext
)){
redirect
(
$redUrl
.
'failure'
);
...
...
@@ -484,27 +494,6 @@ class Api extends CI_Controller {
redirect
(
$redUrl
.
'failure'
);
}
public
function
checker_bookingDetails
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Api_model
->
checkerbookingdetails
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
checker_login
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Api_model
->
checker_login
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
reset_password
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Api_model
->
reset_password
(
$data
);
...
...
@@ -551,17 +540,6 @@ class Api extends CI_Controller {
print
json_encode
(
$result
);
exit
;
}
public
function
getCheckerBookList
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Api_model
->
getCheckerBookList
(
$data
);
if
(
isset
(
$res
[
'data'
])
&&
!
empty
(
$res
[
'data'
])){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
getSavedCards
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$cust_id
=
$this
->
Api_model
->
auth_token_get
(
$this
->
auth_token
);
...
...
@@ -602,7 +580,7 @@ class Api extends CI_Controller {
if
(
empty
(
$merchant_iv
)
||
empty
(
$merchant_key
)
||
empty
(
$plainText
)){
return
false
;
}
$key
=
'AES-256-CBC'
;
$key
=
$this
->
cipher
;
$size
=
openssl_cipher_iv_length
(
$key
);
$mKey
=
base64_decode
(
$merchant_key
);
$padDat
=
$size
-
(
strlen
(
$plainText
)
%
$size
);
...
...
@@ -615,7 +593,7 @@ class Api extends CI_Controller {
if
(
empty
(
$merchant_iv
)
||
empty
(
$merchant_key
)
||
empty
(
$encText
)){
return
false
;
}
$key
=
'AES-256-CBC'
;
$key
=
$this
->
cipher
;
$mKey
=
base64_decode
(
$merchant_key
);
$encText
=
base64_decode
(
$encText
);
$padtext
=
openssl_decrypt
(
$encText
,
$key
,
$mKey
,
OPENSSL_RAW_DATA
|
OPENSSL_ZERO_PADDING
,
$merchant_iv
);
...
...
@@ -627,5 +605,61 @@ class Api extends CI_Controller {
$response
=
substr
(
$padtext
,
0
,
-
1
*
$padData
);
return
json_decode
(
$response
);
}
public
function
encrypt
(
$plainText
=
''
,
$mKey
=
''
,
$mIv
=
''
)
{
if
(
empty
(
$plainText
)
||
empty
(
$mKey
)
||
empty
(
$mIv
)){
return
''
;
}
if
(
in_array
(
$this
->
cipher
,
openssl_get_cipher_methods
()))
{
$ciphertext
=
openssl_encrypt
(
$plainText
,
$this
->
cipher
,
$this
->
key
,
$options
=
0
,
$this
->
iv
);
return
$ciphertext
;
}
}
public
function
decrypt
(
$encText
=
''
,
$mKey
=
''
,
$mIv
=
''
)
{
if
(
empty
(
$plainText
)
||
empty
(
$mKey
)
||
empty
(
$mIv
)){
return
''
;
}
if
(
in_array
(
$this
->
cipher
,
openssl_get_cipher_methods
()))
{
$original_plaintext
=
openssl_decrypt
(
$encText
,
$this
->
cipher
,
$this
->
key
,
$options
=
0
,
$this
->
iv
);
return
$original_plaintext
;
}
}
/*================ START : Checker API ================*/
public
function
checker_bookingDetails
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Api_model
->
checkerbookingdetails
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
checker_login
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Api_model
->
checker_login
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
getCheckerBookList
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Api_model
->
getOrganiserBookList
(
$data
);
if
(
isset
(
$res
[
'data'
])
&&
!
empty
(
$res
[
'data'
])){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
/*================ END : Checker API ================*/
}
?>
application/controllers/OrganizerServices.php
0 → 100644
View file @
fc52ab24
<?php
defined
(
'BASEPATH'
)
OR
exit
(
'No direct script access allowed'
);
if
(
isset
(
$_SERVER
[
'HTTP_ORIGIN'
]))
{
header
(
"Access-Control-Allow-Origin:
{
$_SERVER
[
'HTTP_ORIGIN'
]
}
"
);
header
(
'Access-Control-Allow-Credentials: true'
);
header
(
'Access-Control-Max-Age: 86400'
);
}
if
(
$_SERVER
[
'REQUEST_METHOD'
]
==
'OPTIONS'
)
{
if
(
isset
(
$_SERVER
[
'HTTP_ACCESS_CONTROL_REQUEST_METHOD'
])){
header
(
"Access-Control-Allow-Methods: GET, POST, OPTIONS"
);
}
if
(
isset
(
$_SERVER
[
'HTTP_ACCESS_CONTROL_REQUEST_HEADERS'
])){
header
(
"Access-Control-Allow-Headers:
{
$_SERVER
[
'HTTP_ACCESS_CONTROL_REQUEST_HEADERS'
]
}
"
);
}
exit
(
0
);
}
class
OrganizerServices
extends
CI_Controller
{
var
$auth_token
;
private
$cipher
=
"AES-256-CBC"
;
public
function
__construct
()
{
parent
::
__construct
();
date_default_timezone_set
(
"Asia/Riyadh"
);
$this
->
load
->
model
(
'Organizer_model'
);
$this
->
load
->
model
(
'Validation_model'
);
$method
=
$this
->
router
->
fetch_method
();
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
if
(
$method
==
'profile'
)
{
$data
=
$_POST
;
}
if
(
isset
(
apache_request_headers
()[
'Auth'
]))
{
$this
->
auth_token
=
apache_request_headers
()[
'Auth'
];
$data
[
'auth_token'
]
=
$this
->
auth_token
;
}
$res
=
$this
->
Validation_model
->
validation_check
(
$method
,
$data
);
if
(
$res
[
'state'
]
==
1
)
{
$this
->
errorResponse
(
$res
[
'response'
][
'code'
],
$res
[
'response'
][
'message'
]);
die
;
}
}
public
function
index
()
{
$res
=
$this
->
Validation_model
->
validation_check
(
'login'
,
array
(
'email_id'
=>
'adarsh'
));
}
public
function
response
(
$data
)
{
$result
=
array
(
'code'
=>
1
,
'message'
=>
'Success'
,
'data'
=>
$data
);
print
json_encode
(
$result
);
exit
;
}
public
function
errorResponse
(
$errorCode
,
$errorDesc
)
{
$result
=
array
(
'code'
=>
0
,
'message'
=>
'error'
,
'errorCode'
=>
$errorCode
,
'errorDesc'
=>
$errorDesc
);
print
json_encode
(
$result
);
exit
;
}
public
function
successResponse
(
$data
)
{
$result
=
array
(
'status'
=>
'success'
,
'message'
=>
(
isset
(
$data
[
'message'
])
&&
!
empty
(
$data
[
'message'
]))
?
$data
[
'message'
]
:
'success'
);
print
json_encode
(
$result
);
}
public
function
getOrganizerEventList
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
getOrganizerEventList
(
$data
);
if
(
isset
(
$res
[
'data'
])
&&
!
empty
(
$res
[
'data'
])){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
getOrganizerEventDetails
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
event
(
$data
);
if
(
isset
(
$res
[
'data'
])
&&
!
empty
(
$res
[
'data'
])){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
editOrganizerEventDetails
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
editOrganizerEventDetails
(
$data
);
if
(
isset
(
$res
[
'data'
])
&&
!
empty
(
$res
[
'data'
])){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
deleteOrganizerEvent
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
changeOrganizerEventStatus
(
$data
,
2
);
if
(
$res
[
'status'
]
!=
'0'
){
$this
->
successResponse
(
$res
);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
deActivateOrganizerEvent
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
changeOrganizerEventStatus
(
$data
,
0
);
if
(
$res
[
'status'
]
!=
'0'
){
$this
->
successResponse
(
$res
);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
getVenueList
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
getVenueList
(
$data
);
if
(
isset
(
$res
[
'data'
])
&&
!
empty
(
$res
[
'data'
])){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
getVenueDetails
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
getVenueDetails
(
$data
);
if
(
isset
(
$res
[
'data'
])
&&
!
empty
(
$res
[
'data'
])){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
getCustomerList
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
getCustomerList
(
$data
);
if
(
isset
(
$res
[
'data'
])
&&
!
empty
(
$res
[
'data'
])){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
getBookingList
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
getBookingList
(
$data
);
if
(
isset
(
$res
[
'data'
])
&&
!
empty
(
$res
[
'data'
])){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
getBookingDetails
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
getBookingDetails
(
$data
);
if
(
isset
(
$res
[
'data'
])
&&
!
empty
(
$res
[
'data'
])){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
organiserSignUp
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
organiserSignUp
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
successResponse
(
$res
);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
signIn
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
signIn
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
successResponse
(
$res
);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
changePassword
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
changePassword
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
successResponse
(
$res
);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
checkerDeactivate
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
checkerDeactivate
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
successResponse
(
$res
);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
getTagList
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
getTagList
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
public
function
addEvent
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Organizer_model
->
addEvent
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
/*================ END : Organizer API ================*/
}
?>
application/models/Api_model.php
View file @
fc52ab24
...
...
@@ -1444,67 +1444,6 @@ class Api_model extends CI_Model {
return
$res
;
}
public
function
checker_login
(
$data
){
try
{
$this
->
db
->
where
(
'status'
,
1
);
$this
->
db
->
where
(
'password'
,
md5
(
$data
[
'password'
]));
$this
->
db
->
where
(
'username'
,
$data
[
'email'
]);
$this
->
db
->
from
(
'checker'
);
$result
=
$this
->
db
->
get
()
->
row
();
if
(
$result
){
$res
=
array
(
'status'
=>
1
,
'data'
=>
array
(
'checker_id'
=>
$result
->
id
));
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Invalid Email Id / Password'
,
'code'
=>
'ER05'
);
}
}
catch
(
Exception
$e
)
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something went South!!'
,
'code'
=>
'ER06'
);
}
return
$res
;
}
function
checkerbookingdetails
(
$data
)
{
try
{
$count
=
$this
->
db
->
get_where
(
'checker'
,
array
(
'id'
=>
$data
[
'checker_id'
]))
->
num_rows
();
if
(
$count
>
0
){
$result
=
$this
->
db
->
select
(
'booking.id AS book_id,booking.bookId,customer.name AS customer_name,
booking.status,booking.no_of_ticket,booking.qrcode,
booking.ticket_details,event_date_time.date AS booking_date'
)
->
where
(
'booking.bookId'
,
$data
[
'qr_pin'
])
->
from
(
'booking'
)
->
join
(
'events'
,
'booking.event_id = events.event_id'
)
->
join
(
'event_date_time'
,
'booking.event_date_id = event_date_time.id'
)
->
join
(
'venue'
,
'venue.id = events.venue_id'
)
->
join
(
'event_gallery'
,
'events.event_id = event_gallery.event_id'
,
'LEFT'
)
->
join
(
'customer'
,
'customer.customer_id = booking.customer_id'
)
->
join
(
'host_categories'
,
'venue.host_cat_id = host_categories.host_cat_id'
)
->
group_by
(
'booking.bookId'
)
->
get
()
->
row
();
if
(
count
(
$result
)
>
0
){
$result
->
seat_class
=
''
;
if
(
!
empty
(
$ticketDetls
=
json_decode
(
$result
->
ticket_details
))){
if
(
is_array
(
$ticketDetls
)
&&
isset
(
$ticketDetls
[
0
])
&&
isset
(
$ticketDetls
[
0
]
->
color
)){
$result
->
seat_class
=
$ticketDetls
[
0
]
->
color
;
}
else
if
(
isset
(
$ticketDetls
->
color
)){
$result
->
seat_class
=
$ticketDetls
->
color
;
}
}
$this
->
db
->
insert
(
'checker_bookings'
,
array
(
'checker_id'
=>
$data
[
'checker_id'
],
'booking_id'
=>
$data
[
'qr_pin'
],
'checked_time'
=>
date
(
'Y-m-d H:i:s'
)));
$res
=
array
(
'status'
=>
1
,
'data'
=>
$result
);
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Invalid booking code'
,
'code'
=>
'ER24'
);
}
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Checker Doesnot Exist'
,
'code'
=>
'ER24'
);
}
}
catch
(
Exception
$e
)
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something went South!!'
,
'code'
=>
'ER06'
);
}
return
$res
;
}
public
function
reset_password
(
$data
){
try
{
$cust
=
$this
->
db
->
query
(
"SELECT CUST.customer_id FROM customer AS CUST
...
...
@@ -1752,6 +1691,69 @@ class Api_model extends CI_Model {
}
}
/*================ START : Checker API ================*/
public
function
checker_login
(
$data
){
try
{
$this
->
db
->
where
(
'status'
,
1
);
$this
->
db
->
where
(
'password'
,
md5
(
$data
[
'password'
]));
$this
->
db
->
where
(
'username'
,
$data
[
'email'
]);
$this
->
db
->
from
(
'checker'
);
$result
=
$this
->
db
->
get
()
->
row
();
if
(
$result
){
$res
=
array
(
'status'
=>
1
,
'data'
=>
array
(
'checker_id'
=>
$result
->
id
));
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Invalid Email Id / Password'
,
'code'
=>
'ER05'
);
}
}
catch
(
Exception
$e
)
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something went South!!'
,
'code'
=>
'ER06'
);
}
return
$res
;
}
function
checkerbookingdetails
(
$data
)
{
try
{
$count
=
$this
->
db
->
get_where
(
'checker'
,
array
(
'id'
=>
$data
[
'checker_id'
]))
->
num_rows
();
if
(
$count
>
0
){
$result
=
$this
->
db
->
select
(
'booking.id AS book_id,booking.bookId,customer.name AS customer_name,
booking.status,booking.no_of_ticket,booking.qrcode,
booking.ticket_details,event_date_time.date AS booking_date'
)
->
where
(
'booking.bookId'
,
$data
[
'qr_pin'
])
->
from
(
'booking'
)
->
join
(
'events'
,
'booking.event_id = events.event_id'
)
->
join
(
'event_date_time'
,
'booking.event_date_id = event_date_time.id'
)
->
join
(
'venue'
,
'venue.id = events.venue_id'
)
->
join
(
'event_gallery'
,
'events.event_id = event_gallery.event_id'
,
'LEFT'
)
->
join
(
'customer'
,
'customer.customer_id = booking.customer_id'
)
->
join
(
'host_categories'
,
'venue.host_cat_id = host_categories.host_cat_id'
)
->
group_by
(
'booking.bookId'
)
->
get
()
->
row
();
if
(
count
(
$result
)
>
0
){
$result
->
seat_class
=
''
;
if
(
!
empty
(
$ticketDetls
=
json_decode
(
$result
->
ticket_details
))){
if
(
is_array
(
$ticketDetls
)
&&
isset
(
$ticketDetls
[
0
])
&&
isset
(
$ticketDetls
[
0
]
->
color
)){
$result
->
seat_class
=
$ticketDetls
[
0
]
->
color
;
}
else
if
(
isset
(
$ticketDetls
->
color
)){
$result
->
seat_class
=
$ticketDetls
->
color
;
}
}
$this
->
db
->
insert
(
'checker_bookings'
,
array
(
'checker_id'
=>
$data
[
'checker_id'
],
'booking_id'
=>
$data
[
'qr_pin'
],
'checked_time'
=>
date
(
'Y-m-d H:i:s'
)));
$res
=
array
(
'status'
=>
1
,
'data'
=>
$result
);
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Invalid booking code'
,
'code'
=>
'ER24'
);
}
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Checker Doesnot Exist'
,
'code'
=>
'ER24'
);
}
}
catch
(
Exception
$e
)
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something went South!!'
,
'code'
=>
'ER06'
);
}
return
$res
;
}
function
getCheckerBookList
(
$data
)
{
try
{
$checker_id
=
$data
[
'checker_id'
];
...
...
@@ -1759,8 +1761,11 @@ class Api_model extends CI_Model {
if
(
$count
>
0
){
$sql
=
"SELECT BOOK.bookId AS booking_id
FROM checker_bookings AS CBOOK
INNER JOIN checker AS CHK ON (CHK.id=
$checker_id
)
INNER JOIN booking AS BOOK ON (BOOK.bookId=CBOOK.booking_id)
WHERE CBOOK.checker_id='
$checker_id
' AND BOOK.status='1'"
;
INNER JOIN events AS EVT ON (EVT.event_id=BOOK.event_id)
WHERE EVT.provider_id=CHK.provider_id AND BOOK.status='1'"
;
pr
(
$sql
);
$count
=
$this
->
db
->
query
(
$sql
)
->
num_rows
();
if
(
$count
>
0
)
{
...
...
@@ -1774,8 +1779,10 @@ class Api_model extends CI_Model {
$sql
=
"SELECT TEVT.event_name,TCAT.category_name,CUST.name,EDATE.date,
EDATE.time,BOOK.amount,BOOK.bookId AS booking_id
FROM checker_bookings AS CBOOK
INNER JOIN checker AS CHK ON (CHK.id=CBOOK.checker_id)
INNER JOIN booking AS BOOK ON (BOOK.bookId=CBOOK.booking_id)
INNER JOIN events AS EVT ON (EVT.event_id=BOOK.event_id)
INNER JOIN events AS EVT ON (EVT.event_id=BOOK.event_id AND
EVT.provider_id=CHK.provider_id)
INNER JOIN event_date_time AS EDATE ON (EDATE.event_id=EVT.event_id)
INNER JOIN event_category AS CAT ON (CAT.cat_id=EVT.category_id)
INNER JOIN customer AS CUST ON (CUST.customer_id=BOOK.customer_id)
...
...
@@ -1802,5 +1809,4 @@ class Api_model extends CI_Model {
}
return
$res
;
}
}
?>
}
?>
application/models/Organizer_model.php
0 → 100644
View file @
fc52ab24
This diff is collapsed.
Click to expand it.
application/models/Validation_model.php
View file @
fc52ab24
...
...
@@ -403,7 +403,295 @@ class Validation_model extends CI_Model {
'message'
=>
'User Id is null or empty'
)
)
)
),
'getOrganizerEventList'
=>
array
(
'organiser_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Organizer ID is null or empty'
)
)
),
'getOrganizerEventDetails'
=>
array
(
'organiser_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Organizer ID is null or empty'
)
),
'event_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Event ID is null or empty'
)
)
),
'editOrganizerEventDetails'
=>
array
(
'organiser_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Organizer ID is null or empty'
)
),
'event_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Event ID is null or empty'
)
),
'event_name_en'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Event name is null or empty'
)
),
'category'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Category is null or empty'
)
),
'maximum_seat_booking'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Maximum Seat Booking Filed is null or empty'
)
),
'payment_mode'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Payment Mode is null or empty'
)
),
'images'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Images is null or empty'
)
),
'event_desc_en'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Event Description is null or empty'
)
),
'price'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Price Field is null or empty'
)
),
'capacity'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Capacity Field is null or empty'
)
),
'about_price_division_en'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'About Price Division is null or empty'
)
),
'show_type'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Show Type is null or empty'
)
),
'start_date'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Start Date is null or empty'
)
),
'end_date'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'End Date is null or empty'
)
),
'show_timing'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Show Timing is null or empty'
)
),
'tag'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Tag is null or empty'
)
)
),
'deleteOrganizerEvent'
=>
array
(
'organiser_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Organizer ID is null or empty'
)
),
'event_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Event ID is null or empty'
)
)
),
'deActivateOrganizerEvent'
=>
array
(
'organiser_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Organizer ID is null or empty'
)
),
'event_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Event ID is null or empty'
)
)
),
'getVenueList'
=>
array
(
'organiser_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Organizer ID is null or empty'
)
)
),
'getVenueDetails'
=>
array
(
'organiser_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Organizer ID is null or empty'
)
),
'venue_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Venue ID is null or empty'
)
)
),
'getCustomerList'
=>
array
(
'organiser_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Organizer ID is null or empty'
)
)
),
'getBookingList'
=>
array
(
'organiser_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Organizer ID is null or empty'
)
)
),
'getBookingDetails'
=>
array
(
'booking_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Booking ID is null or empty'
)
)
),
'organiserSignUp'
=>
array
(
'username'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Username is null or empty'
)
),
'email_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Email Id is null or empty'
)
),
'contact_no'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Contact Number is null or empty'
)
),
'password'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Password is null or empty'
)
)
),
'signIn'
=>
array
(
'email_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Email Id is null or empty'
)
),
'password'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Password is null or empty'
)
),
'user_type'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'User Type is null or empty'
)
),
),
'changePassword'
=>
array
(
'new_password'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'New Password is null or empty'
)
),
'confirm_password'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Confirm Password is null or empty'
)
),
'user_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'User Id is null or empty'
)
),
'user_type'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'User Type is null or empty'
)
),
),
'checkerDeactivate'
=>
array
(
'checker_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Checker Id is null or empty'
)
),
'organiser_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Organizer Id is null or empty'
)
)
),
'getTagList'
=>
array
(
'organiser_id'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Organizer Id is null or empty'
)
)
),
);
public
function
_consruct
(){
...
...
application/views/Settings/viewSettings.php
View file @
fc52ab24
...
...
@@ -59,14 +59,6 @@
<input
type=
"text"
name=
"service_charge"
class=
"form-control required"
placeholder=
"Enter Service Charge"
value=
"
<?=
$data
[
'service_charge'
]
?>
"
>
</div>
<div
class=
"form-group col-xs-6"
>
<label>
BayanPay Merchant Key
</label>
<input
type=
"text"
name=
"merchant_key"
class=
"form-control required"
placeholder=
"Enter Merchant Key"
value=
"
<?=
$data
[
'merchant_key'
]
?>
"
>
</div>
<div
class=
"form-group col-xs-6"
>
<label>
BayanPay Merchant ID
</label>
<input
type=
"text"
name=
"merchant_id"
class=
"form-control required"
placeholder=
"Enter Merchant ID"
value=
"
<?=
$data
[
'merchant_id'
]
?>
"
>
</div>
<div
class=
"form-group col-xs-6"
>
<label>
Admin Email-ID
</label>
<input
type=
"email"
name=
"admin_mail_id"
class=
"form-control required"
placeholder=
"Admin Email-ID"
value=
"
<?=
$data
[
'admin_mail_id'
]
?>
"
>
</div>
...
...
@@ -96,7 +88,35 @@
</div>
</div>
</div>
<div
class=
"box-header with-border"
>
<div
class=
"col-md-6"
>
<h3
class=
"box-title"
>
Payment Gateway Details
</h3>
</div>
</div>
<div
class=
"box-body"
>
<div
class=
"form-group col-xs-12"
>
<div
class=
"form-group col-xs-4"
>
<label>
BayanPay Merchant ID
</label>
<input
type=
"text"
name=
"merchant_id"
class=
"form-control required"
placeholder=
"Enter Merchant ID"
value=
"
<?=
$data
[
'merchant_id'
]
?>
"
>
</div>
<div
class=
"form-group col-xs-4"
>
<label>
BayanPay Merchant IV
</label>
<input
type=
"text"
name=
"merchant_iv"
class=
"form-control required"
placeholder=
"Enter Merchant IV"
value=
"
<?=
$data
[
'merchant_iv'
]
?>
"
>
</div>
<div
class=
"form-group col-xs-4"
>
<label>
BayanPay Merchant Key
</label>
<input
type=
"text"
name=
"merchant_key"
class=
"form-control required"
placeholder=
"Enter Merchant Key"
value=
"
<?=
$data
[
'merchant_key'
]
?>
"
>
</div>
<div
class=
"form-group col-xs-4"
>
<label>
BayanPay Collaborator ID
</label>
<input
type=
"text"
name=
"collaborator_id"
class=
"form-control required"
placeholder=
"Enter Collaborator ID"
value=
"
<?=
$data
[
'collaborator_id'
]
?>
"
>
</div>
<div
class=
"form-group col-xs-8"
>
<label>
BayanPay Gateway URL
</label>
<input
type=
"text"
name=
"payment_gateway_url"
class=
"form-control required"
placeholder=
"Enter Gateway URL"
value=
"
<?=
$data
[
'payment_gateway_url'
]
?>
"
>
</div>
</div>
</div>
<div
class=
"box-header with-border"
>
<div
class=
"col-md-6"
>
<h3
class=
"box-title"
>
APP Details
</h3>
...
...
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