Commit 57b81eb9 by Tobin

Merge branch 'master' into 'dev_production'

Master See merge request !24
parents f2c6ddf1 a8c975b5
/application/controllers/Webservice.php /application/config/database.php
/application/models/Webservice_model.php /.htaccess
/application/models/Validation_app_model.php /application/config/config.php
/index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
\ No newline at end of file
<IfModule authz_core_module> <IfModule mod_rewrite.c>
Require all denied RewriteEngine On
</IfModule> RewriteCond %{REQUEST_FILENAME} !-f
<IfModule !authz_core_module> RewriteCond %{REQUEST_FILENAME} !-d
Deny from all RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule> </IfModule>
\ No newline at end of file
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| WARNING: You MUST set this value!
|
| If it is not set, then CodeIgniter will try guess the protocol and path
| your installation, but due to security concerns the hostname will be set
| to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise.
| The auto-detection mechanism exists only for convenience during
| development and MUST NOT be used in production!
|
| If you need to allow multiple domains, remember that this file is still
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = "https://".$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']);
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = '';
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of 'REQUEST_URI' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
| 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
| 'PATH_INFO' Uses $_SERVER['PATH_INFO']
|
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
*/
$config['uri_protocol'] = 'REQUEST_URI';
/*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/urls.html
*/
$config['url_suffix'] = '';
/*
|--------------------------------------------------------------------------
| Default Language
|--------------------------------------------------------------------------
|
| This determines which set of language files should be used. Make sure
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language'] = 'english';
/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
| See http://php.net/htmlspecialchars for a list of supported charsets.
|
*/
$config['charset'] = 'UTF-8';
/*
|--------------------------------------------------------------------------
| Enable/Disable System Hooks
|--------------------------------------------------------------------------
|
| If you would like to use the 'hooks' feature you must enable it by
| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = FALSE;
/*
|--------------------------------------------------------------------------
| Class Extension Prefix
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
| native libraries. For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/core_classes.html
| http://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
$config['subclass_prefix'] = 'MY_';
/*
|--------------------------------------------------------------------------
| Composer auto-loading
|--------------------------------------------------------------------------
|
| Enabling this setting will tell CodeIgniter to look for a Composer
| package auto-loader script in application/vendor/autoload.php.
|
| $config['composer_autoload'] = TRUE;
|
| Or if you have your vendor/ directory located somewhere else, you
| can opt to set a specific path as well:
|
| $config['composer_autoload'] = '/path/to/vendor/autoload.php';
|
| For more information about Composer, please visit http://getcomposer.org/
|
| Note: This will NOT disable or override the CodeIgniter-specific
| autoloading (application/config/autoload.php)
*/
$config['composer_autoload'] = FALSE;
/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify which characters are permitted within your URLs.
| When someone tries to submit a URL with disallowed characters they will
| get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| The configured value is actually a regular expression character group
| and it will be executed as: ! preg_match('/^[<permitted_uri_chars>]+$/i
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
/*
|--------------------------------------------------------------------------
| Enable Query Strings
|--------------------------------------------------------------------------
|
| By default CodeIgniter uses search-engine friendly segment based URLs:
| example.com/who/what/where/
|
| By default CodeIgniter enables access to the $_GET array. If for some
| reason you would like to disable it, set 'allow_get_array' to FALSE.
|
| You can optionally enable standard query string based URLs:
| example.com?who=me&what=something&where=here
|
| Options are: TRUE or FALSE (boolean)
|
| The other items let you set the query string 'words' that will
| invoke your controllers and its functions:
| example.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd';
/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
|
| You can also pass an array with threshold levels to show individual error types
|
| array(2) = Debug Messages, without Error Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 0;
/*
|--------------------------------------------------------------------------
| Error Logging Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/logs/ directory. Use a full server path with trailing slash.
|
*/
$config['log_path'] = '';
/*
|--------------------------------------------------------------------------
| Log File Extension
|--------------------------------------------------------------------------
|
| The default filename extension for log files. The default 'php' allows for
| protecting the log files via basic scripting, when they are to be stored
| under a publicly accessible directory.
|
| Note: Leaving it blank will default to 'php'.
|
*/
$config['log_file_extension'] = '';
/*
|--------------------------------------------------------------------------
| Log File Permissions
|--------------------------------------------------------------------------
|
| The file system permissions to be applied on newly created log files.
|
| IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal
| integer notation (i.e. 0700, 0644, etc.)
*/
$config['log_file_permissions'] = 0644;
/*
|--------------------------------------------------------------------------
| Date Format for Logs
|--------------------------------------------------------------------------
|
| Each item that is logged has an associated date. You can use PHP date
| codes to set your own date formatting
|
*/
$config['log_date_format'] = 'Y-m-d H:i:s';
/*
|--------------------------------------------------------------------------
| Error Views Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/views/errors/ directory. Use a full server path with trailing slash.
|
*/
$config['error_views_path'] = '';
/*
|--------------------------------------------------------------------------
| Cache Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/cache/ directory. Use a full server path with trailing slash.
|
*/
$config['cache_path'] = '';
/*
|--------------------------------------------------------------------------
| Cache Include Query String
|--------------------------------------------------------------------------
|
| Whether to take the URL query string into consideration when generating
| output cache files. Valid options are:
|
| FALSE = Disabled
| TRUE = Enabled, take all query parameters into account.
| Please be aware that this may result in numerous cache
| files generated for the same page over and over again.
| array('q') = Enabled, but only take into account the specified list
| of query parameters.
|
*/
$config['cache_query_string'] = FALSE;
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| If you use the Encryption class, you must set an encryption key.
| See the user guide for more info.
|
| http://codeigniter.com/user_guide/libraries/encryption.html
|
*/
$config['encryption_key'] = '';
/*
|--------------------------------------------------------------------------
| Session Variables
|--------------------------------------------------------------------------
|
| 'sess_driver'
|
| The storage driver to use: files, database, redis, memcached
|
| 'sess_cookie_name'
|
| The session cookie name, must contain only [0-9a-z_-] characters
|
| 'sess_expiration'
|
| The number of SECONDS you want the session to last.
| Setting to 0 (zero) means expire when the browser is closed.
|
| 'sess_save_path'
|
| The location to save sessions to, driver dependent.
|
| For the 'files' driver, it's a path to a writable directory.
| WARNING: Only absolute paths are supported!
|
| For the 'database' driver, it's a table name.
| Please read up the manual for the format with other session drivers.
|
| IMPORTANT: You are REQUIRED to set a valid save path!
|
| 'sess_match_ip'
|
| Whether to match the user's IP address when reading the session data.
|
| WARNING: If you're using the database driver, don't forget to update
| your session table's PRIMARY KEY when changing this setting.
|
| 'sess_time_to_update'
|
| How many seconds between CI regenerating the session ID.
|
| 'sess_regenerate_destroy'
|
| Whether to destroy session data associated with the old session ID
| when auto-regenerating the session ID. When set to FALSE, the data
| will be later deleted by the garbage collector.
|
| Other session cookie settings are shared with the rest of the application,
| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
|
*/
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = sys_get_temp_dir();
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a cookie name prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path' = Typically will be a forward slash
| 'cookie_secure' = Cookie will only be set if a secure HTTPS connection exists.
| 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript)
|
| Note: These settings (with the exception of 'cookie_prefix' and
| 'cookie_httponly') will also affect sessions.
|
*/
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
/*
|--------------------------------------------------------------------------
| Standardize newlines
|--------------------------------------------------------------------------
|
| Determines whether to standardize newline characters in input data,
| meaning to replace \r\n, \r, \n occurrences with the PHP_EOL value.
|
| This is particularly useful for portability between UNIX-based OSes,
| (usually \n) and Windows (\r\n).
|
*/
$config['standardize_newlines'] = FALSE;
/*
|--------------------------------------------------------------------------
| Global XSS Filtering
|--------------------------------------------------------------------------
|
| Determines whether the XSS filter is always active when GET, POST or
| COOKIE data is encountered
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['global_xss_filtering'] = FALSE;
/*
|--------------------------------------------------------------------------
| Cross Site Request Forgery
|--------------------------------------------------------------------------
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
| checked on a submitted form. If you are accepting user data, it is strongly
| recommended CSRF protection be enabled.
|
| 'csrf_token_name' = The token name
| 'csrf_cookie_name' = The cookie name
| 'csrf_expire' = The number in seconds the token should expire.
| 'csrf_regenerate' = Regenerate token on every submission
| 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks
*/
$config['csrf_protection'] = FALSE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array();
/*
|--------------------------------------------------------------------------
| Output Compression
|--------------------------------------------------------------------------
|
| Enables Gzip output compression for faster page loads. When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
| Only used if zlib.output_compression is turned off in your php.ini.
| Please do not use it together with httpd-level output compression.
|
| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
| even be a line of whitespace at the end of one of your scripts. For
| compression to work, nothing can be sent before the output buffer is called
| by the output class. Do not 'echo' any values with compression enabled.
|
*/
$config['compress_output'] = FALSE;
/*
|--------------------------------------------------------------------------
| Master Time Reference
|--------------------------------------------------------------------------
|
| Options are 'local' or any PHP supported timezone. This preference tells
| the system whether to use your server's local time as the master 'now'
| reference, or convert it to the configured one timezone. See the 'date
| helper' page of the user guide for information regarding date handling.
|
*/
$config['time_reference'] = 'local';
/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files. Options are TRUE or FALSE (boolean)
|
| Note: You need to have eval() enabled for this to work.
|
*/
$config['rewrite_short_tags'] = FALSE;
/*
|--------------------------------------------------------------------------
| Reverse Proxy IPs
|--------------------------------------------------------------------------
|
| If your server is behind a reverse proxy, you must whitelist the proxy
| IP addresses from which CodeIgniter should trust headers such as
| HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
| the visitor's IP address.
|
| You can use both an array or a comma-separated list of proxy addresses,
| as well as specifying whole subnets. Here are a few examples:
|
| Comma-separated: '10.0.1.200,192.168.5.0/24'
| Array: array('10.0.1.200', '192.168.5.0/24')
*/
$config['proxy_ips'] = '';
$config['theme_color'] = "skin-blue";
\ No newline at end of file
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
| ['dsn'] The full DSN string describe a connection to the database.
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database driver. e.g.: mysqli.
| Currently supported:
| cubrid, ibase, mssql, mysql, mysqli, oci8,
| odbc, pdo, postgre, sqlite, sqlite3, sqlsrv
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Query Builder class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
| ['cachedir'] The path to the folder where cache files should be stored
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
| NOTE: For MySQL and MySQLi databases, this setting is only used
| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
| (and in table creation queries made with DB Forge).
| There is an incompatibility in PHP with mysql_real_escape_string() which
| can make your site vulnerable to SQL injection if you are using a
| multi-byte character set and are running versions lower than these.
| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
| ['encrypt'] Whether or not to use an encrypted connection.
|
| 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE
| 'mysqli' and 'pdo/mysql' drivers accept an array with the following options:
|
| 'ssl_key' - Path to the private key file
| 'ssl_cert' - Path to the public key certificate file
| 'ssl_ca' - Path to the certificate authority file
| 'ssl_capath' - Path to a directory containing trusted CA certificats in PEM format
| 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':')
| 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not ('mysqli' only)
|
| ['compress'] Whether or not to use client compression (MySQL only)
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
| ['ssl_options'] Used to set various SSL options that can be used when making SSL connections.
| ['failover'] array - A array with 0 or more data for connections if the main should fail.
| ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries.
| NOTE: Disabling this will also effectively disable both
| $this->db->last_query() and profiling of DB queries.
| When you run a query, with this setting set to TRUE (default),
| CodeIgniter will store the SQL statement for debugging purposes.
| However, this may cause high memory usage, especially if you run
| a lot of SQL queries ... disable this to avoid that problem.
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $query_builder variables lets you determine whether or not to load
| the query builder class.
*/
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'nuvento_timeout',
'password' => 'Golden_123',
'database' => 'nuvento_timeout',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
...@@ -40,22 +40,22 @@ class CMS extends CI_Controller { ...@@ -40,22 +40,22 @@ class CMS extends CI_Controller {
redirect(base_url($url)); redirect(base_url($url));
} }
if(isset($_POST['faq_en']) && empty($_POST['faq_en'])){ if(!isset($_POST['faq_en']) || empty($_POST['faq_en'])){
unset($_POST['faq_en']); unset($_POST['faq_en']);
} }
if(isset($_POST['privacy_policy_en']) && empty($_POST['privacy_policy_en'])){ if(!isset($_POST['privacy_policy_en']) || empty($_POST['privacy_policy_en'])){
unset($_POST['privacy_policy_en']); unset($_POST['privacy_policy_en']);
} }
if(isset($_POST['terms_and_conditions_en']) && empty($_POST['terms_and_conditions_en'])){ if(!isset($_POST['terms_and_conditions_en']) || empty($_POST['terms_and_conditions_en'])){
unset($_POST['terms_and_conditions_en']); unset($_POST['terms_and_conditions_en']);
} }
if(isset($_POST['faq_ar']) && empty($_POST['faq_ar'])){ if(!isset($_POST['faq_ar']) || empty($_POST['faq_ar'])){
unset($_POST['faq_ar']); unset($_POST['faq_ar']);
} }
if(isset($_POST['privacy_policy_ar']) && empty($_POST['privacy_policy_ar'])){ if(!isset($_POST['privacy_policy_ar']) || empty($_POST['privacy_policy_ar'])){
unset($_POST['privacy_policy_ar']); unset($_POST['privacy_policy_ar']);
} }
if(isset($_POST['terms_and_conditions_ar']) && empty($_POST['terms_and_conditions_ar'])){ if(!isset($_POST['terms_and_conditions_ar']) || empty($_POST['terms_and_conditions_ar'])){
unset($_POST['terms_and_conditions_ar']); unset($_POST['terms_and_conditions_ar']);
} }
...@@ -68,5 +68,48 @@ class CMS extends CI_Controller { ...@@ -68,5 +68,48 @@ class CMS extends CI_Controller {
redirect(base_url($url)); redirect(base_url($url));
} }
public function notification() {
$template['page'] = 'CMS/notification';
$template['menu'] = "Notification Templates";
$template['smenu'] = "Change Notification Templates";
$template['pTitle'] = "Notification Templates";
$template['page_head'] = "Notification Templates";
$template['pDescription'] = "Change Notification Templates";
$template['notificationData'] = $this->Cms_model->getNotifData();
$this->load->view('template',$template);
}
public function changeNotifData(){
$url = 'CMS/notification';
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url($url));
}
if(!isset($_POST['forgot_mail']) || empty($_POST['forgot_mail'])){
unset($_POST['forgot_mail']);
}
if(!isset($_POST['forgot_sms']) || empty($_POST['forgot_sms'])){
unset($_POST['forgot_sms']);
}
if(!isset($_POST['registration_mail']) || empty($_POST['registration_mail'])){
unset($_POST['registration_mail']);
}
if(!isset($_POST['registration_sms']) || empty($_POST['registration_sms'])){
unset($_POST['registration_sms']);
}
$status = $this->Cms_model->updateNotif($_POST);
if($status){
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'Settings Successfully Updated..!';
}
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url($url));
}
} }
?> ?>
\ No newline at end of file
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Checker extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Checker_model');
$this->load->model('Provider_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
}
function viewCheckers(){
$template['page'] = 'Checker/viewChecker';
$template['menu'] = 'Checker Management';
$template['smenu'] = 'View Checker';
$template['pTitle'] = "Checker Management";
$template['pDescription'] = "View Checker List";
$provider_id = $this->session->userdata['id'];
if($this->session->userdata['user_type'] == 1){
$provider_id = (isset($_POST['provider_id'])&&$_POST['provider_id']!='')?$_POST['provider_id']:'';
}
$template['provider_id'] = $provider_id;
$template['checker_data'] = $this->Checker_model->getCheckerData($provider_id);
$template['provider_data'] = $this->Provider_model->getProviderData('','0,1');
$template['enc_provider_id'] = encode_param($provider_id);
$this->load->view('template',$template);
}
function addChecker(){
$template['page'] = 'Checker/checkerAddForm';
$template['menu'] = 'Checker Management';
$template['smenu'] = 'Add Checker';
$template['pTitle'] = "Add Checker";
$template['pDescription'] = "Create New Checker";
$template['provider_id'] = $_GET['provider_id'];
$this->load->view('template',$template);
}
function createChecker(){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Checker/addChecker'));
}
$err = 0;
$errMsg = '';
if($err == 0 && (!isset($_POST['username']) || empty($_POST['username']))){
$err = 1;
$errMsg = 'Provide Checker User Name';
} else if($err == 0 && (!isset($_POST['password']) || empty($_POST['password']))){
$err = 1;
$errMsg = 'Provide Checker Password';
} else if($err == 0 && (!isset($_POST['provider_id']) || empty($_POST['provider_id']) ||
empty($provider_id = decode_param($_POST['provider_id'])))){
$err = 1;
$errMsg = 'Something went wrong, please try again..!';
}
if($err == 1){
$flashMsg['class'] = 'error';
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Checker/viewCheckers'));
}
$_POST['password'] = md5($_POST['password']);
$_POST['provider_id'] = $provider_id;
$status = $this->Checker_model->createChecker($_POST);
if($status == 1){
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'Checker Created';
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Checker/viewCheckers'));
} else if ($status == 2){
$flashMsg['class'] = 'error';
$flashMsg['message'] = 'Checker User name already exist..!';
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Checker/viewCheckers'));
}
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Checker/addChecker'));
}
function changeStatus($checker_id = '',$status = '1'){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($checker_id)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Checker/viewCheckers'));
}
$checker_id = decode_param($checker_id);
$status = $this->Checker_model->changeStatus($checker_id,$status);
if(!$status){
$this->session->set_flashdata('message',$flashMsg);
}
redirect(base_url('Checker/viewCheckers'));
}
}
?>
\ No newline at end of file
<?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);
}
//test changes
class Webservice extends CI_Controller {
var $auth_token;
public function __construct() {
parent::__construct();
$this->load->model('Webservice_model');
$this->load->model('Validation_app_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_app_model->validation_check($method, $data);
if($res['state'] == 1) {
$this->errorResponse($res['response']['code'], $res['response']['message']);
die;
}
}
public function login() {
$data = (array) json_decode(file_get_contents('php://input'));
$res = $this->Webservice_model->login($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function check_email_availability() {
$data = (array) json_decode(file_get_contents('php://input'));
$res = $this->Webservice_model->availability($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function registration(){
$data = (array) json_decode(file_get_contents('php://input'));
$res = $this->Webservice_model->register($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function get_events_list() {
$data = $_GET;
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->discover($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function events_details($event_id = null) {
$data['event_id'] = $_GET['event_id'];
$data['auth_token'] = $this->auth_token;
if($data['event_id'] == null) {
$this->errorResponse("ER16","Event id is null or empty");
die;
}
$res = $this->Webservice_model->event($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function response($data) {
$result = array(
'status' => 'success',
'data' =>$data
);
print json_encode($result);
}
public function favResponse($data) {
$result = array(
'status' => 'success',
'data' => array(
'favorite_events' =>$data)
);
print json_encode($result);
}
public function successResponse($data) {
$result = array(
'status' => 'success',
);
print json_encode($result);
}
public function errorResponse($errorCode, $errorDesc) {
$result = array(
'status' => 'error',
'error'=> $errorCode,
'message'=> $errorDesc
);
print json_encode($result);
}
public function get_category_list($query = null) {
$data['query'] = $_GET['query'];
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->get_category_list($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function add_favorites(){
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->add_favorites($data);
if($res['status']!=0){
$this->successResponse($res);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function get_cities_list() {
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->get_cities_list($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function update_city(){
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->update_city($data);
if($res['status']!=0){
$this->successResponse($res);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function booking_summary($booking_id = null) {
$data['booking_id'] = $_GET['booking_id'];
if($data['booking_id'] == null) {
$this->errorResponse("ER34","Booking id is null or empty");
die;
}
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->booking_summary($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function payment(){
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->payment($data);
if($res['status']!=0){
$this->successResponse($res);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function event_rating(){
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->event_rating($data);
if($res['status']!=0){
$this->successResponse($res);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function update_notification_email_status(){
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->update_notification_email_status($data);
if($res['status']!=0){
$this->successResponse($res);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function profile_details() {
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->profile_details($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function profile_edit() {
$data = $_POST;
if(isset($_FILES['profile_photo'])) {
$data['file'] = $_FILES['profile_photo'];
}
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->update_profile($data);
if($res['status']!=0){
$this->successResponse($res);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function booking() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->booking($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function cancel_booking() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->cancel($data);
if($res['status']!=0){
$this->successResponse($res);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function get_favorites_list() {
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->favouritelist($data);
if($res['status']!=0){
$this->favResponse($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function get_booking_list() {
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->bookedlist($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function settings() {
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->get_settings($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function forgot_password() {
$data = (array) json_decode(file_get_contents('php://input'));
$res = $this->Webservice_model->forgot_password($data);
if($res['status']!=0){
$this->successResponse($res);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function get_last_booking() {
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->get_last_booking($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function filters() {
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->filters($data);
if($res['status']!=0){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
}
?>
\ No newline at end of file
...@@ -125,6 +125,12 @@ ...@@ -125,6 +125,12 @@
include 'BayanPayPaymentLibrary.php'; include 'BayanPayPaymentLibrary.php';
} }
function getNotifTemplate(){
$CI = & get_instance();
$settings = $CI->db->get('notification_templates');
return (!empty($settings))?$settings->row_array():'';
}
// function resizeImage($file=array()){ // function resizeImage($file=array()){
// if(empty($file) || ($size = $file['size']/1024) < 100 || // if(empty($file) || ($size = $file['size']/1024) < 100 ||
// empty($info = getimagesize($file['tmp_name'])) || $info['mime'] == 'image/gif'){ // empty($info = getimagesize($file['tmp_name'])) || $info['mime'] == 'image/gif'){
......
<?php
class Checker_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
public function getCheckerData($provider_id='',$view=''){
$cond = (!empty($view))?" CHK.status IN ($view) ":" CHK.status != '2' ";
$cond .= (!empty($provider_id))?" AND PRV.provider_id='$provider_id' ":"";
$checkerData = $this->db->query("SELECT CHK.*,PRV.name
FROM checker AS CHK
INNER JOIN provider AS PRV ON (CHK.provider_id=PRV.provider_id)
WHERE $cond");
return $checkerData->result();
}
public function createChecker($checkerData = array()){
if(empty($checkerData)){
return 0;
}
$usrCheck=$this->db->get_where('checker',array('username'=>$checkerData['username'],'status !='=>'2'));
if($usrCheck->num_rows() > 0){
return 2;
}
$status = $this->db->insert('checker',$checkerData);
return $status;
}
public function changeStatus($id = '', $status = '0'){
if(empty($id)){
return 0;
}
$status = $this->db->update('checker',array('status'=>$status),array('id'=>$id));
return $status;
}
}
?>
\ No newline at end of file
...@@ -20,5 +20,22 @@ class Cms_model extends CI_Model { ...@@ -20,5 +20,22 @@ class Cms_model extends CI_Model {
$status = $this->db->update('privacy_policy',$cmsData); $status = $this->db->update('privacy_policy',$cmsData);
return $status; return $status;
} }
public function getNotifData(){
$notifData = $this->db->query("SELECT * FROM notification_templates");
if(!empty($notifData)){
return $notifData->row();
}
return 0;
}
public function updateNotif($notifData = array()){
if(empty($notifData)){
return 0;
}
$status = $this->db->update('notification_templates',$notifData);
return $status;
}
} }
?> ?>
\ No newline at end of file
<?php
class Validation_app_model extends CI_Model {
public $validation_array = array(
'login'=> array('email'=>array('required'=>array('code'=>'ER02', 'message'=>'Email id is null or empty'),
'email'=>array('code'=>'ER03', 'message'=>'Invalid Email id')),
'password'=>array('required'=>array('code'=>'ER04', 'message'=>'Password is null or empty'),)),
'check_email_availability'=> array('email'=>array('required'=>array('code'=>'ER02', 'message'=>'Email id is null or empty'),
'email'=>array('code'=>'ER03', 'message'=>'Invalid Email id')
),
'phone'=>array('required'=>array('code'=>'ER07', 'message'=>'Phone no is null or empty'),
'phone'=>array('code'=>'ER08', 'message'=>'Invalid Phone no')
),
),
'registration'=> array('email'=>array('required'=>array('code'=>'ER02', 'message'=>'Email id is null or empty'),
'email'=>array('code'=>'ER03', 'message'=>'Invalid Email id')
),
'phone'=>array('required'=>array('code'=>'ER07', 'message'=>'Phone no is null or empty'),
'phone'=>array('code'=>'ER08', 'message'=>'Invalid Phone no'),
),
'password'=>array('required'=>array('code'=>'ER04', 'message'=>'Password is null or empty'),
)
),
'get_events_list'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
)
),
'filters'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
)
),
'events_details'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
)
),
'get_category_list'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
)
),
'get_last_booking'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
)
),
'add_favorites'=> array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty')),
'event_id'=>array('required'=>array('code'=>'ER16', 'message'=>'Event id is null or empty')),),
'get_cities_list'=>array('auth_token'=>array('required'=>array('code'=>'ER19', 'message'=>'User Id is null or empty'),
)
),
'update_city'=>array('auth_token'=>array('required'=>array('code'=>'ER19', 'message'=>'User Id is null or empty'),
)
),
'booking_summary'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
)
),
'payment'=> array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty')),
'booking_id'=>array('required'=>array('code'=>'ER34', 'message'=>'Booking id is null or empty'))),
'event_rating'=> array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty')),
'rating'=>array('required'=>array('code'=>'ER26', 'message'=>'Rating is null or empty')),
'event_id'=>array('required'=>array('code'=>'ER27', 'message'=>'Event id is null or empty')),
'description'=>array('required'=>array('code'=>'ER28', 'message'=>'description id is null or empty')),),
'update_notification_email_status'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
)
),
'profile_details'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),)),
'profile_edit'=> array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty')),),
'booking'=> array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty')),
'event_id'=>array('required'=>array('code'=>'ER20', 'message'=>'Event id is null or empty')),
'customer_id'=>array('required'=>array('code'=>'ER29', 'message'=>'Customer id is null or empty')),
'event_date_id'=>array('required'=>array('code'=>'ER30', 'message'=>'Event date id is null or empty')),
'no_of_ticket'=>array('required'=>array('code'=>'ER31', 'message'=>'Number of ticket is null or empty')),
'ticket_details'=>array('required'=>array('code'=>'ER32', 'message'=>'Ticket details is null or empty')),
'amount'=>array('required'=>array('code'=>'ER33', 'message'=>'Amount is null or empty')),),
'cancel_booking'=> array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty')),
'booking_id'=>array('required'=>array('code'=>'ER34', 'message'=>'Booking Id is null or empty')),),
'get_favorites_list'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
)
),
'get_booking_list'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
)
),
'settings'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
)
),
'forgot_password'=> array('new_password'=>array('required'=>array('code'=>'ER35', 'message'=>'New password is null or empty')),
'phone'=>array('required'=>array('code'=>'ER07', 'message'=>'Phone is null or empty')),),
);
public function validation_check($method_name, $parms) {
$state = 0;
$rules = $this->validation_array[$method_name];
$error_key = '';
foreach ($rules as $key => $value) {
foreach ($value as $keys => $values) {
switch ($keys) {
case 'required':
if(!isset($parms[$key]) || $parms[$key]=='' || $parms[$key]== null){
$state = 1;
$error_key = $values;
}
break;
case 'email':
if (isset($parms[$key]) && !filter_var($parms[$key], FILTER_VALIDATE_EMAIL)) {
$state = 1;
$error_key = $values;
}
break;
case 'phone':
if(isset($parms[$key])){
$phone = preg_replace('/[^0-9]/', '', $parms[$key]);
/*if (strlen($phone) !== 10) {
$state = 1;
$error_key = $values;
} */
}
break;
default:
# code...
break;
}
if($state==1){
break;
}
}
if($state==1){
break;
}
}
return array('state'=>$state,'response'=>$error_key);
}
}
?>
\ No newline at end of file
<?php
class Webservice_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
function login($data){
try{
$this->db->select("customer.city,customer.name AS user_name,
customer.phone,
customer.email,customer.profile_image AS profile_photo,users.id AS user_id, IF(customer.phone_verified = 0,'false','true') AS is_phone_verified, IF(customer.city = '','false','true') AS is_location_updated");
$this->db->where('users.status',1);
$this->db->where('users.password',md5($data['password']));
$this->db->where('customer.email',$data['email']);
$this->db->from('users');
$this->db->join('customer','customer.customer_id = users.id');
$result = $this->db->get()->row();
if($result){
$auth_token = md5(microtime().rand());
$cityId = $this->db->select('id')->where('name', $result->city)->where('status', 1)->get('region')->row();
$resultArray = array(
'city_id'=>$cityId->id,
'city_name'=>$result->city,
'user_name'=>$result->user_name,
'phone'=>$result->phone,
'email'=>$result->email,
'profile_photo'=>$result->profile_photo,
'user_id'=>$result->user_id,
'is_phone_verified'=>$result->is_phone_verified === 'true'? true: false,
'is_location_updated'=>$result->is_location_updated === 'true'? true: false,
);
$response = array('user'=>$resultArray,'auth_token'=>$auth_token);
$this->generateAuth($result->user_id,$auth_token);
$res = array('status'=>1,'data'=>$response);
} else {
$res = array('status'=>0,'message'=>'Invalid username / Password','code'=>'ER05');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function availability($data) {
try{
$is_email_available = "true";
$is_phone_available = "true";
$res_count = $this->db->where('email',$data['email'])->or_where('phone',$data['phone'])->get('customer')->result();
if(count($res_count) > 0) {
foreach ($res_count as $rs) {
if($rs->email == $data['email']) {
$is_email_available = "false";
}
if($rs->phone == $data['phone']) {
$is_phone_available = "false";
}
}
}
$data = array(
'is_email_available'=>$is_email_available === 'true'? true: false,
'is_phone_available'=>$is_phone_available === 'true'? true: false
);
$res = array('status'=>1,'data'=>$data);
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function register($data) {
try{
$res_count = $this->db->where('email',$data['email'])->or_where('phone',$data['phone'])->get('customer')->row();
if(count($res_count) > 0) {
if($res_count->email == $data['email'] && $res_count->phone == $data['phone']){
$res = array('status'=>0,'message'=>'Already have an account with email id and phone no. Please login','code'=>'ER12');
} else if($res_count->email == $data['email']){
$res = array('status'=>0,'message'=>'Email id already exists','code'=>'ER09');
} else if($res_count->phone == $data['phone']) {
$res = array('status'=>0,'message'=>'Phone no already exists','code'=>'ER10');
}
} else {
$temp_password = $data['password'];
$data['password'] = md5($data['password']);
$user_data = array(
'password'=>$data['password'],
'display_name'=>'Customer',
'user_type'=> 3
);
$this->db->insert('users',$user_data);
$id = $this->db->insert_id();
if($id) {
$customer_data = array(
'customer_id'=>$id,
'phone'=>$data['phone'],
'email'=>$data['email']
);
$this->db->insert('customer', $customer_data);
$subject = "New account created successfully";
$email_id = $data['email'];
$message = "Hi,\n\r Welcome to TimeOut.\r\n Please use username: ".$email_id." and Password: ".$temp_password." for access your account";
$this->send_mail($subject,$email_id,$message);
$this->db->select("customer.name AS user_name,customer.phone,customer.email,customer.profile_image AS profile_photo,users.id AS user_id, IF(customer.phone_verified = 0,'false','true') AS is_phone_verified");
$this->db->where('users.id',$id);
$this->db->from('users');
$this->db->join('customer','customer.customer_id = users.id');
$result = $this->db->get()->row();
if($result){
$auth_token = md5(microtime().rand());
$this->generateAuth($result->user_id,$auth_token);
$resultArray = array(
'user_id'=>$result->user_id,
'user_name'=>$result->user_name,
'phone'=>$result->phone,
'email'=>$result->email,
'profile_photo'=>$result->profile_photo,
'is_phone_verified'=>$result->is_phone_verified === 'true'? true: false
);
$response = array('user'=>$resultArray,'auth_token'=>$auth_token);
$res = array('status'=>1,'data'=>$response);
} else {
$res = array('status'=>0,'message'=>'No record found','code'=>'ER13');
}
} else {
$res = array('status'=>0,'message'=>'Registration failed please try again','code'=>'ER11');
}
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function profile_details($data) {
try {
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$settingsDetails = $this->db->query("SELECT faq_en AS faq,contact_number FROM privacy_policy")->row_array();
$userDetails = $this->db->query("SELECT customer.name AS name, customer.profile_image AS profile_photo,(CASE customer.gender WHEN 1 THEN '0' WHEN 2 THEN '1' ELSE '3' END) AS gender, customer.email, customer.dob, customer.city AS city_name, users.notification_status, users.email_status FROM customer INNER JOIN users ON users.id = customer.customer_id WHERE customer.customer_id = ".$user_id." AND users.status = 1 ")->row_array();
if(count($settingsDetails)>0 && count($userDetails)){
$resultData = array();
$resultData = array_merge($settingsDetails, $userDetails);
$res = array('status'=>1,'data'=>$resultData);
} else {
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function discover($data) {
try {
$per_page = 10;
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$where = '';
$case = "AND event_date_time.date >= DATE_FORMAT(NOW(),'%Y-%m-%d')";
/******************* CATEGORY *********************/
if(isset($data['category_id'])) {
$where = ' AND events.category_id = '.$data['category_id'];
}
/******************* END CATEGORY *********************/
/******************* LATITUDE AND LONGITUDE *********************/
if(isset($data['latitude']) && isset($data['longitude'])) {
$radius = 25;
$res = $this->db->query("SELECT events.category_id,venue.id,venue.status, (((acos(sin((".$data['latitude']."*pi()/180)) * sin((venue.location_lat*pi()/180)) + cos((".$data['latitude']."*pi()/180)) * cos((venue.location_lat*pi()/180)) * cos(((".$data['longitude']." - venue.location_lng)*pi()/180))))*180/pi())*60*1.1515) as distance FROM venue LEFT JOIN events ON events.venue_id = venue.id GROUP BY events.category_id HAVING distance < ".$radius." AND venue.status = '1'")->result_array();
$otherV = '';
foreach($res as $key => $value){
if ($otherV) $otherV .= ',';
$otherV .= $value['category_id'];
}
if($otherV!='') {
$where = ' AND events.category_id IN ('.$otherV.')';
} else{
$where = ' AND events.category_id IN (0)';
}
}
/******************* END LATITUDE AND LONGITUDE *********************/
/******************* CITY ID *********************/
if(isset($data['city_id'])) {
$where = ' AND venue.region_id = '.$data['city_id'];
}
/******************* END CITY ID *********************/
/******************* FILTER *****************************************/
if(isset($data['filters'])){
$filtersElement = json_decode($data['filters'], true);
$locality_id = $filtersElement['cities'];
$dateId = $filtersElement['date'];
$categoryId = $filtersElement['category'];
if($categoryId!=''){
$where = ' AND events.category_id='.$categoryId;
}
//$case = "AND event_date_time.date >= DATE_FORMAT(NOW(),'%Y-%m-%d')";
if($dateId != '') {
switch ($dateId) {
case '1':
$case = "AND event_date_time.date >= DATE_FORMAT(NOW(),'%Y-%m-%d')";
break;
case '2':
$case = "AND event_date_time.date = DATE_FORMAT(NOW(),'%Y-%m-%d')";
break;
case '3':
$case = "AND event_date_time.date = DATE_FORMAT(NOW() + INTERVAL 1 DAY,'%Y-%m-%d')";
break;
case '4':
$first_day_of_the_week = 'Monday';
$start_of_the_week = strtotime("Last $first_day_of_the_week");
if ( strtolower(date('l')) === strtolower($first_day_of_the_week) )
{
$start_of_the_week = strtotime('today');
}
$end_of_the_week = $start_of_the_week + (60 * 60 * 24 * 7) - 1;
$date_format = 'Y-m-d';
$start_date = date($date_format, $start_of_the_week);
$end_date = date($date_format, $end_of_the_week);
$case = "AND event_date_time.date >= $start_date AND event_date_time.date <= $end_date";
break;
case '5':
$sunday = date( 'Y-m-d', strtotime( 'sunday this week'));
$saturday = date( 'Y-m-d', strtotime( 'saturday this week'));
$case = "AND event_date_time.date = $sunday OR event_date_time.date = $saturday";
case '6':
$sunday = date( 'Y-m-d', strtotime( 'sunday this week'));
$saturday = date( 'Y-m-d', strtotime( 'saturday this week'));
$case = "AND event_date_time.date = $sunday OR event_date_time.date = $saturday";
default:
$case = "AND event_date_time.date >= DATE_FORMAT(NOW(),'%Y-%m-%d')";
break;
}
}
if($locality_id!=''){
$venue_res = $this->db->select('id')->where('locality_id',$locality_id)->get('venue')->result_array();
$list = implode(',', array_map(function($v) { return $v['id']; }, $venue_res));
$where .= ' AND events.venue_id IN('.$list.')';
}
// $count = $this->db->query("SELECT events.event_id FROM events INNER JOIN event_date_time ON events.event_id = event_date_time.event_id $case WHERE events.status = 1 $where GROUP BY events.event_id")->num_rows();
}
/******************* END FILTER *********************/
/******************* PAGINATION *********************/
$count = $this->db->query("SELECT events.event_id FROM events INNER JOIN event_date_time ON events.event_id = event_date_time.event_id $case INNER JOIN venue on venue.id = events.venue_id WHERE events.status = 1 $where GROUP BY events.event_id")->num_rows();
if($count > 0) {
if(isset($data['page'])) {
$page = $data['page'];
} else {
$page = 1;
}
$page_limit = ($page - 1)*$per_page;
if($count > $page_limit) {
/******************* END PAGINATION *********************/
$result = $this->db->query("SELECT events.seat_pricing,venue.location_lat AS latitude,venue.location_lng AS longitude,events.event_id AS event_id, events.event_name AS name,`event_gallery`.`media_url` AS image, COUNT(booking.id) AS attendees, event_category.category, AVG(review.rate) AS rating, venue.location, IF(events.avg_price = 0, '100','150') AS rate, IF(events.provider_id = 1,'true','false') AS is_editors_choice, IF(favourite.is_favorite = 1, 'true','false') AS is_favorite FROM events INNER JOIN event_date_time ON events.event_id = event_date_time.event_id ".$case." LEFT JOIN `event_gallery` ON `events`.`event_id` = `event_gallery`.`event_id` AND `event_gallery`.`media_type` = 0 LEFT JOIN booking ON booking.event_id = events.event_id LEFT JOIN event_category ON events.category_id = event_category.cat_id LEFT JOIN review ON review.event_id = events.event_id INNER JOIN venue ON venue.id = events.venue_id LEFT JOIN favourite ON favourite.event_id = events.event_id AND favourite.user_id = ".$user_id." AND favourite.status = 1 WHERE events.status = 1 ".$where." GROUP BY events.event_id")->result();
$response = array();
foreach ($result as $key=>$rs) {
$pricelist = json_decode($rs->seat_pricing, TRUE);
$price = $pricelist['price'];
$resData = array(
'id' => "$key",
'event_id'=>$rs->event_id,
'image'=>$rs->image,
'attendees'=>$rs->attendees,
'category'=>$rs->category,
'name'=>$rs->name,
'rating'=>$rs->rating,
'location'=>$rs->location,
'rate'=>$price,
'is_editors_choice'=>$rs->is_editors_choice,
'is_favorite'=>$rs->is_favorite,
'latitude'=>$rs->latitude,
'longitude'=>$rs->longitude
);
array_push($response, $resData);
}
$cityName = $this->db->select('city')->where('customer_id', $user_id)->get('customer')->row();
$lastBooking = $this->db->query("SELECT booking.id,review.rate FROM booking LEFT JOIN review ON review.event_id = booking.event_id WHERE booking.customer_id = ".$user_id." ORDER BY booking.id DESC LIMIT 1")->row_array();
if($lastBooking['id'] != ''){
if($lastBooking['rate'] != ''){
$lastBooking = "false";
}else{
$lastBooking = "true";
}
}else{
$lastBooking = "false";
}
$meta = array('total_pages'=>ceil($count/$per_page),
'total'=>$count,
'current_page'=>$page,
'per_page'=>$per_page
);
if(count($result)>0){
$resultData = array();
$resultData['is_last_booking_avail'] = $lastBooking;
$resultData['city_name'] = $cityName->city;
$resultData['events'] = $response;
$resultData['meta'] = $meta;
$response = $resultData;
$res = array('status'=>1,'data'=>$response);
}else {
$res = array('status'=>1,'data' => []);
}
} else {
$res = array('status'=>1,'data' => []);
}}else {
$res = array('status'=>1,'data' => []);
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function event($data) {
try {
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$event_id = $data['event_id'];
$this->db->query("SET SESSION group_concat_max_len = 20000");
$rs = $this->db->query("SELECT favourite.is_favorite,events.event_id, AVG(review.rate) AS rate, MAX(booking.id) AS attendees, events.event_name,events.event_discription AS event_description,events.seat_pricing, events.custom_seat_layout, venue.layout, venue.layout_details,venue.venue_name,venue.venue_details,venue.location,venue.location_lat AS lat,venue.location_lng AS lng,venue.venue_name AS address_name,venue.location AS address, GROUP_CONCAT(DISTINCT `event_gallery`.`media_url`) AS media_url,IF(favourite.status = 1,'true','false') AS fav_status, GROUP_CONCAT(DISTINCT tags.tag_name) AS tag, GROUP_CONCAT(DISTINCT CONCAT_WS('#',event_date_time.id,event_date_time.date,event_date_time.time)) AS date_time, events.max_booking FROM events INNER JOIN event_date_time ON events.event_id = event_date_time.event_id INNER JOIN venue ON venue.id = events.venue_id LEFT JOIN `event_gallery` ON `events`.`event_id` = `event_gallery`.`event_id` AND `event_gallery`.`status` != 0 LEFT JOIN booking on booking.event_id = events.event_id LEFT JOIN favourite ON favourite.event_id = events.event_id AND favourite.user_id = ".$user_id." AND favourite.status = 1 LEFT JOIN event_tags ON events.event_id = event_tags.event_id LEFT JOIN tags on tags.tag_id = event_tags.tag_id LEFT JOIN review ON events.event_id = review.event_id WHERE events.event_id = ".$event_id." GROUP BY events.event_id, event_date_time.event_id")->row();
if(count($rs)>0){
$resultData = array();
$event_layout = '';
$colorData = array();
$booking = $this->db->where('event_id',$event_id)->select('ticket_details')->get('booking')->result();
if(count($booking) > 0){
foreach ($booking as $row) {
$priceData[] = json_decode($row->ticket_details);
if(count($priceData) > 0){
foreach ($priceData as $value) {
$colorData[$value->color] = isset($colorData[$value->color]) ? + $colorData[$value->color] + $value->no_ticket: $value->no_ticket;
}
}
}
}
if($rs->layout!=''){
if($rs->custom_seat_layout!=''){
$pricelist = json_decode($rs->custom_seat_layout, TRUE);
$price = min(array_column($pricelist, 'price'));
$event_layout = $rs->custom_seat_layout;
} else {
$pricelist = json_decode($rs->layout_details, TRUE);
$price = min(array_column($pricelist, 'price'));
$event_layout = $rs->layout_details;
}
} else {
$pricelist = json_decode($rs->seat_pricing, TRUE);
$price = $pricelist['price'];
$event_layout = $rs->seat_pricing;
}
$event_layout = json_decode($event_layout);
$event_layouts = array();
if(is_array($event_layout)){
foreach ($event_layout as $value) {
if(isset($colorData[$value->color])) {
$avaliable = $value->capacity - $colorData[$value->color];
} else {
$avaliable = $value->capacity;
}
$priceLayout = array('class_name' => $value->color,
'rate'=>$value->price,
'total_tickets'=>$value->capacity,
'available_tickets'=>$avaliable,
"max_ticket"=>$rs->max_booking
);
array_push($event_layouts, $priceLayout);
}
} else {
$event_layouts[] = array('class_name' => null,
'rate'=>$event_layout->price,
'total_tickets'=>null,
'available_tickets'=>null,
"max_ticket"=>$rs->max_booking
);
}
$dates = explode(',', $rs->date_time);
$time_spec = array();
$data_array = array();
foreach ($dates as $rss) {
list($id,$date,$time) = explode('#', $rss);
$data_array[$date][] = array('id'=>$id, 'time'=>$time);
$time_spec[] = array('id'=>$id, 'date'=>$date, 'time'=>$time);
}
$date_list = array();
foreach ($data_array as $key => $value) {
$date_list[] = array('date'=>$key, 'time'=>$value);
}
$tags = explode(',', $rs->tag);
$media_url = explode(',', $rs->media_url);
$resData = array(
'event_id'=>$rs->event_id,
'name'=>$rs->event_name,
'description'=>$rs->event_description,
'rating'=>$rs->rate,
'total_attendees'=>$rs->attendees == ''? '0': $rs->attendees,
'layout_image'=>$rs->layout,
'is_favorite'=>$rs->is_favorite === 'true'? true: false,
'photos'=>$media_url,
'time'=>$time_spec[0]['time'],
'date'=>$time_spec[0]['date'],
'date_list'=>$date_list,
'classes'=>$event_layouts,
'latitude'=>$rs->lat,
'address_name'=>$rs->address_name,
'address'=>$rs->address,
'longitude'=>$rs->lng
);
$res = array('status'=>1,'data'=>$resData);
} else {
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function generateAuth($userId,$auth_token) {
$this->db->insert('customer_auth',array('user_id'=>$userId, 'auth_token'=>$auth_token));
}
function auth_token_get($token) {
$rs = $this->db->select('user_id')->where('auth_token', $token)->get('customer_auth')->row();
if(count($rs) > 0) {
return $rs->user_id;
} else {
return 0;
}
}
function send_mail($subject,$email,$message,$attach=null) {
$ci =& get_instance();
$ci->load->library('email');
$ci->email->initialize(array(
'protocol' => 'smtp',
'smtp_host' => 'smtp.sendgrid.net',
'smtp_user' => '[email protected]',
'smtp_pass' => 'Golden_123',
'smtp_port' => 587,
'crlf' => "\r\n",
'newline' => "\r\n"
));
$ci->email->from('[email protected]', 'TimeOut');
$ci->email->to($email);
$ci->email->cc('[email protected]');
$ci->email->subject($subject);
$ci->email->message($message);
if($attach!=null) {
$ci->email->attach($attach);
}
return $ci->email->send();
}
function get_category_list($data) {
try {
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
if(isset($data['query'])) {
$where = ' AND event_category.category LIKE '."'".$data['query'].'%'."'";
} else {
$where = '';
}
$result = $this->db->query("SELECT events.venue_id AS region_id,event_category.cat_id AS category_id, event_category.category AS category_name, event_category.category_image AS category_image, event_category.category_description AS category_description FROM event_category LEFT JOIN events ON events.category_id = event_category.cat_id WHERE event_category.status = 1 ".$where." GROUP BY event_category.cat_id")->result();
if(count($result)>0){
$resultData = array();
$resultData['category'] = $result;
$res = array('status'=>1,'data'=>$resultData);
} else {
$res = array('status'=>1,'data' => []);
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function add_favorites($data) {
try{
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$res_count = $this->db->where('event_id',$data['event_id'])->where('user_id',$user_id)->get('favourite')->result();
$favoriteList = array('user_id'=>$user_id, 'event_id'=>$data['event_id'], 'is_favorite'=>$data['is_favorite']);
if(count($res_count) > 0) {
$id = $this->db->update('favourite',$favoriteList);
}else{
$id = $this->db->insert('favourite',$favoriteList);
}
if($id) {
$res = array('status'=>1);
}else {
$res = array('status'=>0,'message'=>'Add Favorite failed please try again','code'=>'ER14');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function get_cities_list($data) {
try {
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$result = $this->db->query("SELECT region.id AS city_id, region.name AS city_name, region.region_icon AS city_image FROM region WHERE region.status = 1 GROUP BY region.name")->result();
if(count($result)>0){
$resultData = array();
$resultData['cities'] = $result;
$res = array('status'=>1,'data'=>$resultData);
} else {
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function update_city($data) {
try{
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
if($data['city_id']!=''){
$re = $this->db->select('name')->where('id', $data['city_id'])->where('status', 1)->get('region')->row();
$cityName = $re->name;
}else{
$radius = 25;
$data = $this->db->query("SELECT name,status, (((acos(sin((".$data['latitude']."*pi()/180)) * sin((region_lat*pi()/180)) + cos((".$data['latitude']."*pi()/180)) * cos((region_lat*pi()/180)) * cos(((".$data['longitude']." - region_lng)*pi()/180))))*180/pi())*60*1.1515) as distance FROM region HAVING distance < ".$radius." AND status = '1' ORDER BY distance ASC LIMIT 1")->result_array();
$cityName = $data[0]['name'];
}
$this->db->where('customer_id', $user_id);
$id = $this->db->update('customer', array('city' => $cityName));
if($id) {
$res = array('status'=>1);
}else {
$res = array('status'=>0,'message'=>'Update failed please try again','code'=>'ER15');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function booking_summary($data) {
try {
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$bookingId = $data['booking_id'];
$ticketDetails = $this->db->query("SELECT ticket_details FROM booking WHERE bookId = '$bookingId'")->row();
$res = json_decode($ticketDetails->ticket_details);
$kk['ticket_rate'] = "$res->total_price";
$settingsDetails = $this->db->query("SELECT contact_number FROM privacy_policy")->row_array();
$result = $this->db->query("SELECT booking.qrcode, events.event_discription AS instruction,events.event_id,events.event_name, `event_gallery`.`media_url` AS event_image,event_date_time.date, booking.bookId AS ticket_id,event_date_time.time,venue.location_lat AS latitude, venue.location_lng AS longitude, venue.venue_name AS address_name, venue.venue_details AS address, booking.amount AS total_rate, booking.no_of_ticket AS ticket_count, customer.name AS profile_name, customer.profile_image AS profile_photo FROM events LEFT JOIN `event_gallery` ON `events`.`event_id` = `event_gallery`.`event_id` AND `event_gallery`.`media_type` = 0 LEFT JOIN booking ON booking.event_id = events.event_id RIGHT JOIN event_date_time ON event_date_time.id = booking.event_date_id LEFT JOIN venue ON venue.id = events.venue_id LEFT JOIN customer ON customer.customer_id = booking.customer_id WHERE booking.bookId = '$bookingId' AND booking.customer_id = ".$user_id."")->row_array();
if(count($result)>0 && count($settingsDetails)>0){
$resultData = array();
$resultData = array_merge($settingsDetails, $result,$kk);
$res = array('status'=>1,'data'=>$resultData);
} else {
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function payment($data) {
try{
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$this->db->where('customer_id', $user_id);
$this->db->where('status', 1);
$this->db->where('id', $data['booking_id']);
$id = $this->db->update('booking', array('payment_status' => 1));
if($id) {
$res = array('status'=>1);
}else {
$res = array('status'=>0,'message'=>'Update failed please try again','code'=>'ER11');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function event_rating($data) {
try{
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$ratingDetails = array(
'event_id'=>$data['event_id'],
'customer_id'=>$user_id,
'rate'=>$data['rating'],
'feedback'=>$data['description']
);
$id = $this->db->insert('review', $ratingDetails);
if($id) {
$res = array('status'=>1);
}else {
$res = array('status'=>0,'message'=>'Event Rating failed please try again','code'=>'ER11');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function update_notification_email_status($data) {
try{
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$notData = array('notification_status'=>$data['notification_status'], 'email_status'=>$data['email_status']);
$this->db->where('id', $user_id);
$this->db->where('status', 1);
$this->db->where('user_type', 3);
$status = $this->db->update('users', $notData);
if ($status){
$res = array('status'=>1);
}else {
$res = array('status'=>0,'message'=>'Update failed please try again','code'=>'ER15');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
public function update_profile($data) {
try{
$user_id = $this->auth_token_get($data['auth_token']);
$img_error = 0;
if($user_id > 0) {
$post_data = $data;
unset($post_data['file']);
unset($post_data['auth_token']);
if(isset($data['file'])){
$img=$data['file']['name'];
$expbanner = explode('.',$img);
$img_ext = strtolower($expbanner[1]);
$rand = rand(10000,99999);
$encname = time().$rand;
if($img_ext=='png' || $img_ext=='jpeg' || $img_ext == 'jpg' || $img_ext == 'gif'){
$bannername = $encname.'.'.$img_ext;
$imagePath="./assets/uploads/".$bannername;
$post_data['profile_image'] = "assets/uploads/".$bannername;
move_uploaded_file($data['file']["tmp_name"],$imagePath);
$state = $this->db->where('customer_id',$user_id)->update('customer',$post_data);
if($state){
$img_error = 1;
} else {
$res = array('status'=>0,'message'=>'Profile update failed','code'=>'ER32');
}
} else {
$res = array('status'=>0,'message'=>'Invalid Image type','code'=>'ER41');
}
} else {
$state = $this->db->where('customer_id',$user_id)->update('customer',$post_data);
if($state){
$img_error = 1;
} else {
$res = array('status'=>0,'message'=>'Profile update failed','code'=>'ER32');
}
}
if($img_error == 1) {
$this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.profile_image AS image,customer.gender,users.id AS userId, customer.city');
$this->db->where('users.id',$user_id);
$this->db->from('users');
$this->db->join('customer','customer.customer_id = users.id');
$result = $this->db->get()->row();
if($result){
$res = array('status'=>1,'data'=>$result);
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
}
catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function booking($data) {
try{
$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'] = 1;
$code = 'TO';
$ymd = date('ymd');
$squence = rand(1111,9999);
$squence = str_pad($squence,4,0,STR_PAD_LEFT);
$post_data['bookId'] = $code.$ymd.$squence;
$post_data['qrcode'] = genQRcode($post_data['bookId']);
$rs = $this->db->insert('booking', $post_data);
$id = $this->db->insert_id();
if($id){
$res = array('status'=>1,'data'=>array('bookingCode'=>$post_data['bookId']));
} else {
$res = array('status'=>0,'message'=>'Seat booking failed','code'=>'ER37');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function generateQR($data) {
return 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png';
}
function cancel($data) {
try {
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$res_count = $this->db->where('bookId',$data['booking_id'])->where('status',1)->get('booking')->num_rows();
if($res_count > 0) {
$rs = $this->db->where('bookId',$data['booking_id'])->update('booking',array('status'=>0));
if($rs) {
$res = array('status'=>1,'data'=>null);
} else {
$res = array('status'=>0,'message'=>'Cancel submission failed','code'=>'ER25');
}
} else {
$res = array('status'=>0,'message'=>'Invalid booking code','code'=>'ER24');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function favouritelist($data) {
try {
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$where = array(
'favourite.status'=>1,
'favourite.is_favorite'=>1,
'favourite.user_id'=>$user_id,
'events.status'=>1
);
$result = $this->db->select("events.event_id,event_gallery.media_url,COUNT(booking.id) AS attendees,
event_category.category,events.event_name,AVG(review.rate) AS rating,venue.location,IF(favourite.is_favorite = 0,'false','true') AS is_favorite,IF(events.provider_id = 0,'false','true') AS is_editors_choice,events.seat_pricing,events.custom_seat_layout,venue.layout,venue.layout_details")->where($where)->from('favourite')->join('review', 'review.event_id = favourite.event_id','LEFT')->join('events', 'events.event_id = favourite.event_id')->join('booking', 'booking.event_id = events.event_id')->join('venue', 'venue.id = events.venue_id')->join('event_category', 'events.category_id = event_category.cat_id')->join('event_gallery', 'events.event_id = event_gallery.event_id AND event_gallery.media_type = 0', 'LEFT')->group_by('events.event_id')->get()->result();
if(count($result)>0){
$response = array();
foreach ($result as $rs) {
if($rs->layout!=''){
if($rs->custom_seat_layout!=''){
$pricelist = json_decode($rs->custom_seat_layout, TRUE);
$price = min(array_column($pricelist, 'price'));
} else {
$pricelist = json_decode($rs->layout_details, TRUE);
$price = min(array_column($pricelist, 'price'));
}
} else {
$pricelist = json_decode($rs->seat_pricing, TRUE);
$price = $pricelist['price'];
}
$resData = array(
'event_id'=>$rs->event_id,
'image'=>$rs->media_url,
'attendees'=>$rs->attendees,
'category'=>$rs->category,
'name'=>$rs->event_name,
'rating'=>$rs->rating,
'location'=>$rs->location,
'rate'=>$price,
'location'=>$rs->location,
'is_favorite'=>$rs->is_favorite === 'true'? true: false,
'is_editors_choice'=>$rs->is_editors_choice === 'true'? true: false
);
array_push($response, $resData);
}
$res = array('status'=>1,'data'=>$response);
//print_r($res);exit();
} else {
$res = array('status'=>1,'data' => []);
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function bookedlist($data) {
try {
$per_page = 10;
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$count = $this->db->select('booking.id')->where('booking.customer_id',$user_id)->get('booking')->num_rows();
if($count > 0) {
if(isset($data['page'])) {
$page = $data['page'];
} else {
$page = 1;
}
$page_limit = ($page - 1) * $per_page;
if($count > $page_limit) {
$result = $this->db->select('booking.bookId AS booking_id,booking.event_id,events.event_name,event_gallery.media_url AS event_image,venue.location,event_date_time.date,event_date_time.time,booking.no_of_ticket AS ticket_count,
(CASE booking.status WHEN 1 THEN 0 WHEN 2 THEN 1 WHEN 0 THEN 2 ELSE 2 END) AS booking_status')->where('booking.customer_id',$user_id)->where('booking.status!=',3)->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 AND event_gallery.media_type = 0', 'LEFT')->limit($per_page,$page_limit)->get()->result();
$meta = array('total_pages'=>ceil($count/$per_page),
'total'=>$count,
'current_page'=>$page,
'per_page'=>$per_page
);
$response = array('bookings'=>$result,'meta'=>$meta);
$res = array('status'=>1,'data'=>$response);
} else {
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13');
}
} else {
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function get_settings($data) {
try {
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$settingsDetails = $this->db->query("SELECT privacy_policy_en,terms_and_conditions_en,contact_number FROM privacy_policy")->row_array();
$notificationDetails = $this->db->query("SELECT notification_status, email_status FROM users WHERE id = ".$user_id."")->row_array();
if(count($settingsDetails)>0 && count($notificationDetails)>0){
$resultData = array_merge($settingsDetails, $notificationDetails);
$resultArray = array(
'privacy_policy'=>$resultData['privacy_policy_en'],
'terms_and_conditions'=>$resultData['terms_and_conditions_en'],
'contact_number'=>$resultData['contact_number'],
'notification_status'=>$resultData['notification_status'] === 0? 1: 0,
'email_status'=>$resultData['email_status'] === 1? 0: 1
);
$res = array('status'=>1,'data'=>$resultArray);
} else {
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function forgot_password($data) {
try {
$res_count = $this->db->select('customer.customer_id')->where('users.status=',1)->where('customer.phone',$data['phone'])->from('customer')->join('users','customer.customer_id = users.id')->get()->row_array();
if($res_count!='') {
$rs = $this->db->where('id',$res_count['customer_id'])->update('users',array('password'=> md5($data['new_password'])));
if($rs) {
$res = array('status'=>1,'data'=>null);
} else {
$res = array('status'=>0,'message'=>'Updation failed Please try again','code'=>'ER15');
}
} else {
$res = array('status'=>0,'message'=>'Phone Number Does not exists','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function get_last_booking($data) {
try {
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$result = $this->db->query("SELECT IF(review.event_id = '','false','true') AS is_last_booking_rated, booking.id AS booking_id, events.event_id AS event_id, events.event_name, `event_gallery`.`media_url` AS event_image,UNIX_TIMESTAMP(event_date_time.date) AS date, booking.amount AS amount FROM events LEFT JOIN `event_gallery` ON `events`.`event_id` = `event_gallery`.`event_id` AND `event_gallery`.`media_type` = 0 LEFT JOIN booking ON booking.event_id = events.event_id RIGHT JOIN event_date_time ON event_date_time.id = booking.event_date_id LEFT JOIN venue ON venue.id = events.venue_id 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." ORDER BY booking.id DESC LIMIT 1")->row_array();
if(count($result)>0){
$resultData = array(
'is_last_booking_rated'=>$result['is_last_booking_rated'] === 'true'? true: false,
'booking_id'=>$result['booking_id'],
'event_id'=>$result['event_id'],
'event_name'=>$result['event_name'],
'event_image'=>$result['event_image'],
'amount'=>$result['amount'],
'date'=>$result['date']
);
$res = array('status'=>1,'data'=>$resultData);
} else {
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
function filters($data) {
try {
$user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) {
$locality = $this->db->select('id AS city_id,locality AS city_name')->where('status',1)->get('locality')->result();
$category = $this->db->select('cat_id AS category_id,category AS category,category_image')->where('status',1)->get('event_category')->result();
$dateArray = [["date_id" => "All Days","date" => "1"],["date_id" => "Today","date" => "2"],["date_id" => "Tomorrow","date" => "3"],
["date_id" => "This week","date" => "4"],["date_id" => "Weekend","date" => "5"],["date_id" => "Later","date" => "6"]];
if(!EMPTY($locality)) {
$locality = $locality;
}else{
$locality = 'null';
}
if(!EMPTY($category)) {
$category = $category;
}else{
$category = 'null';
}
if(isset($dateArray)){
$resultData = array();
$resData = array(
'cities'=>$locality,
'categories'=>$category,
'dates'=>$dateArray
);
$res = array('status'=>1,'data'=>$resData);
} else {
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13');
}
} else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
}
} catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
}
return $res;
}
}
?>
\ No newline at end of file
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="box-footer textCenterAlign"> <div class="box-footer textCenterAlign">
<button type="submit" class="btn btn-primary">Submit</button> <button type="submit" class="btn btn-primary">Submit</button>
<a href="<?= base_url('Category/listCategory') ?>" class="btn btn-primary">Cancel</a> <a href="<?= base_url() ?>" class="btn btn-primary">Cancel</a>
</div> </div>
</div> </div>
......
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<section class="content">
<div class="row">
<div class="col-md-12">
<?php if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
</div>
<div class="col-md-12">
<div class="box box-warning">
<div class="box-body">
<form role="form" action="<?= base_url('CMS/changeNotifData') ?>" method="post"
class="validate" data-parsley-validate="" enctype="multipart/form-data">
<div class="box-header with-border">
<h3 class="box-title padLeft10 padTop5">Email Template</h3>
</div>
<div class="box-body">
<div class="col-sm-12">
<div class="col-sm-6">
<div class="form-group">
<label>Registration Mail</label>
<textarea id="rich_editor" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Registration Mail" name="registration_mail" style="height:108px;" data-parsley-trigger="change"><?= $notificationData->registration_mail ?></textarea>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label>Forgot Mail</label>
<textarea id="rich_editor_1" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Forgot Mail" name="forgot_mail" style="height:108px;" data-parsley-trigger="change"><?= $notificationData->forgot_mail ?></textarea>
</div>
</div>
</div>
</div>
<div class="box-header with-border">
<h3 class="box-title padLeft10 padTop5">SMS Template</h3>
</div>
<div class="box-body">
<div class="col-sm-12">
<div class="col-sm-6">
<div class="form-group">
<label>Registration SMS</label>
<textarea type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Registration SMS" name="registration_sms" style="height:108px;" data-parsley-trigger="change"><?= $notificationData->registration_sms ?></textarea>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label>Forgot SMS</label>
<textarea type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Forgot SMS" name="forgot_sms" style="height:108px;" data-parsley-trigger="change"><?= $notificationData->forgot_sms ?></textarea>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="col-md-6">
<div class="box-footer textCenterAlign">
<button type="submit" class="btn btn-primary">Submit</button>
<a href="<?= base_url() ?>" class="btn btn-primary">Cancel</a>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<section class="content">
<div class="row">
<div class="col-md-12">
<?php
if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
</div>
<div class="col-md-12">
<div class="box box-warning">
<div class="box-body">
<form role="form" action="<?= base_url('Checker/createChecker') ?>" method="post"
class="validate" data-parsley-validate="" enctype="multipart/form-data">
<div class="col-md-6">
<div class="form-group">
<label>User Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" name="username" required="" placeholder="User Name">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control required" name="password" placeholder="Password" required="">
</div>
</div>
<input type="hidden" name="provider_id" value="<?= $provider_id ?>">
<div class="col-md-12 padTop10">
<div class="box-footer textCenterAlign">
<button type="submit" class="btn btn-primary">Submit</button>
<a href="<?= base_url('Checker/viewCheckers') ?>" class="btn btn-primary">Cancel</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
<div class="content-wrapper" >
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-12">
<?php if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
</div>
<div class="col-xs-12">
<?php if($this->session->userdata['user_type'] == 1){ ?>
<div class="box box-warning marginBottom-10">
<div class="box-body">
<form role="form" name="venueForm" action="<?= base_url('Checker/viewCheckers')?>" method="post"
class="validate" data-parsley-validate="" enctype="multipart/form-data">
<div class="col-md-12">
<?php if(!empty($provider_data)){ ?>
<div class="form-group">
<label>Choose Povider</label>
<select name="provider_id" class="form-control"
placeholder="Select Venue" onchange="venueSubmitForm()">
<option selected value="0">All provider</option>
<?php
foreach ($provider_data as $provider) {
$select=(isset($provider_id)&&$provider->provider_id==$provider_id)?'selected':'';
echo '<option '.$select.' value="'.$provider->provider_id.'">'.
$provider->name.
'</option>';
}
?>
</select>
</div>
<?php } ?>
</div>
</form>
</div>
</div>
<?php } ?>
<div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Creater List</h3></div>
<div class="col-md-6" align="right">
<?php if($this->session->userdata['user_type'] != 1){ ?>
<a class="btn btn-sm btn-primary" href="<?= base_url('Checker/addChecker?provider_id='.$enc_provider_id) ?>">
Add New Checker
</a>
<?php } ?>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
</div>
<div class="box-body">
<table id="mechanicUsers" class="table table-bordered table-striped datatable ">
<thead>
<tr>
<th class="hidden">ID</th>
<th width="250px;">Creater User Name</th>
<th width="250px;">Provider</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($checker_data)){
foreach($checker_data as $checker) { ?>
<tr>
<th class="hidden"><?= $checker->id ?></th>
<th class="center"><?= $checker->username ?></th>
<th class="center"><?= $checker->name ?></th>
<th class="center"><?= ($checker->status == 1)?'Active':'De-activate' ?></th>
<td class="center">
<a class="btn btn-sm btn-danger"
href="<?= base_url("Checker/changeStatus/".encode_param($checker->id))."/2" ?>"
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php if($checker->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Checker/changeStatus/".encode_param($checker->id))."/0" ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Checker/changeStatus/".encode_param($checker->id))."/1" ?>">
<i class="fa fa-cog"></i> Activate
</a>
<?php } ?>
</td>
</tr>
<?php } } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
...@@ -10,18 +10,22 @@ x <aside class="main-sidebar"> ...@@ -10,18 +10,22 @@ x <aside class="main-sidebar">
</div> </div>
</div> </div>
<ul class="sidebar-menu"> <ul class="sidebar-menu">
<li><a href="<?= base_url('Dashboard') ?>"> <li>
<img src="<?=base_url("assets/images/m1.png") ?>"> <a href="<?= base_url('Dashboard') ?>">
<span>Dashboard</span></a> <img src="<?=base_url("assets/images/m1.png") ?>">
<span>Dashboard</span>
</a>
</li> </li>
<li><a href="<?= base_url('Tag/listTags') ?>"> <li>
<img src="<?=base_url("assets/images/m2.png") ?>"> <a href="<?= base_url('Tag/listTags') ?>">
<span>Tag Management</span></a> <img src="<?=base_url("assets/images/m2.png") ?>">
<span>Tag Management</span>
</a>
</li> </li>
<li class="treeview"> <li class="treeview">
<a href="#"> <a href="#">
<img src="<?=base_url("assets/images/m3.png") ?>"> <img src="<?=base_url("assets/images/m3.png") ?>">
<span>Host Categories</span> <span>Host Categories</span>
<i class="fa fa-angle-left pull-right"></i> <i class="fa fa-angle-left pull-right"></i>
</a> </a>
<ul class="treeview-menu"> <ul class="treeview-menu">
...@@ -39,18 +43,22 @@ x <aside class="main-sidebar"> ...@@ -39,18 +43,22 @@ x <aside class="main-sidebar">
</li> </li>
</ul> </ul>
</li> </li>
<li><a href="<?= base_url('Region/listRegion') ?>"> <li>
<img src="<?=base_url("assets/images/m4.png") ?>"> <a href="<?= base_url('Region/listRegion') ?>">
<span>Region Management</span></a> <img src="<?=base_url("assets/images/m4.png") ?>">
<span>Region Management</span>
</a>
</li> </li>
<li><a href="<?= base_url('Category/listCategory') ?>"> <li>
<img src="<?=base_url("assets/images/m5.png") ?>"> <a href="<?= base_url('Category/listCategory') ?>">
<span>Category Management</span></a> <img src="<?=base_url("assets/images/m5.png") ?>">
<span>Category Management</span>
</a>
</li> </li>
<li class="treeview"> <li class="treeview">
<a href="#"> <a href="#">
<img src="<?=base_url("assets/images/m6.png") ?>"> <img src="<?=base_url("assets/images/m6.png") ?>">
<span>Venue Management</span> <span>Venue Management</span>
<i class="fa fa-angle-left pull-right"></i> <i class="fa fa-angle-left pull-right"></i>
</a> </a>
<ul class="treeview-menu"> <ul class="treeview-menu">
...@@ -111,6 +119,14 @@ x <aside class="main-sidebar"> ...@@ -111,6 +119,14 @@ x <aside class="main-sidebar">
</li> </li>
</ul> </ul>
</li> </li>
<?php } ?>
<li>
<a href="<?= base_url('Checker/viewCheckers') ?>">
<img src="<?=base_url("assets/images/m2.png") ?>">
<span>Checker Management</span>
</a>
</li>
<?php if($this->session->userdata['user_type'] == 1){ ?>
<li class="treeview"> <li class="treeview">
<a href="#"> <a href="#">
<img src="<?=base_url("assets/images/m9.png") ?>"> <img src="<?=base_url("assets/images/m9.png") ?>">
...@@ -149,6 +165,10 @@ x <aside class="main-sidebar"> ...@@ -149,6 +165,10 @@ x <aside class="main-sidebar">
<span>CMS Management</span> <span>CMS Management</span>
</a> </a>
</li> </li>
<li><a href="<?= base_url('CMS/notification') ?>">
<img src="<?=base_url("assets/images/m2.png") ?>">
<span>Notification Tempaltes</span></a>
</li>
<li> <li>
<a href="<?= base_url('Settings') ?>"> <a href="<?= base_url('Settings') ?>">
<i class="fa fa-wrench" aria-hidden="true"> <i class="fa fa-wrench" aria-hidden="true">
......
<?php
ob_start();
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2015, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
* @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link http://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
/*
*---------------------------------------------------------------
* APPLICATION ENVIRONMENT
*---------------------------------------------------------------
*
* You can load different configurations depending on your
* current environment. Setting the environment also influences
* things like logging and error reporting.
*
* This can be set to anything, but default usage is:
*
* development
* testing
* production
*
* NOTE: If you change these, also change the error_reporting() code below
*/
//define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
define('ENVIRONMENT', 'development');
/*
*---------------------------------------------------------------
* ERROR REPORTING
*---------------------------------------------------------------
*
* Different environments will require different levels of error reporting.
* By default development will show errors but testing and live will hide them.
*/
switch (ENVIRONMENT)
{
case 'development':
error_reporting(-1);
ini_set('display_errors', 1);
break;
case 'testing':
case 'production':
error_reporting(-1);
ini_set('display_errors', 0);
if (version_compare(PHP_VERSION, '5.3', '>='))
{
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
}
else
{
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
}
break;
default:
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'The application environment is not set correctly.';
exit(1); // EXIT_ERROR
}
/*
*---------------------------------------------------------------
* SYSTEM FOLDER NAME
*---------------------------------------------------------------
*
* This variable must contain the name of your "system" folder.
* Include the path if the folder is not in the same directory
* as this file.
*/
$system_path = 'system';
/*
*---------------------------------------------------------------
* APPLICATION FOLDER NAME
*---------------------------------------------------------------
*
* If you want this front controller to use a different "application"
* folder than the default one you can set its name here. The folder
* can also be renamed or relocated anywhere on your server. If
* you do, use a full server path. For more info please see the user guide:
* http://codeigniter.com/user_guide/general/managing_apps.html
*
* NO TRAILING SLASH!
*/
$application_folder = 'application';
/*
*---------------------------------------------------------------
* VIEW FOLDER NAME
*---------------------------------------------------------------
*
* If you want to move the view folder out of the application
* folder set the path to the folder here. The folder can be renamed
* and relocated anywhere on your server. If blank, it will default
* to the standard location inside your application folder. If you
* do move this, use the full server path to this folder.
*
* NO TRAILING SLASH!
*/
$view_folder = '';
/*
* --------------------------------------------------------------------
* DEFAULT CONTROLLER
* --------------------------------------------------------------------
*
* Normally you will set your default controller in the routes.php file.
* You can, however, force a custom routing by hard-coding a
* specific controller class/function here. For most applications, you
* WILL NOT set your routing here, but it's an option for those
* special instances where you might want to override the standard
* routing in a specific front controller that shares a common CI installation.
*
* IMPORTANT: If you set the routing here, NO OTHER controller will be
* callable. In essence, this preference limits your application to ONE
* specific controller. Leave the function name blank if you need
* to call functions dynamically via the URI.
*
* Un-comment the $routing array below to use this feature
*/
// The directory name, relative to the "controllers" folder. Leave blank
// if your controller is not in a sub-folder within the "controllers" folder
// $routing['directory'] = '';
// The controller class file name. Example: mycontroller
// $routing['controller'] = '';
// The controller function you wish to be called.
// $routing['function'] = '';
/*
* -------------------------------------------------------------------
* CUSTOM CONFIG VALUES
* -------------------------------------------------------------------
*
* The $assign_to_config array below will be passed dynamically to the
* config class when initialized. This allows you to set custom config
* items or override any default config values found in the config.php file.
* This can be handy as it permits you to share one application between
* multiple front controller files, with each file containing different
* config values.
*
* Un-comment the $assign_to_config array below to use this feature
*/
// $assign_to_config['name_of_config_item'] = 'value of config item';
// --------------------------------------------------------------------
// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
// --------------------------------------------------------------------
/*
* ---------------------------------------------------------------
* Resolve the system path for increased reliability
* ---------------------------------------------------------------
*/
// Set the current directory correctly for CLI requests
if (defined('STDIN'))
{
chdir(dirname(__FILE__));
}
if (($_temp = realpath($system_path)) !== FALSE)
{
$system_path = $_temp.'/';
}
else
{
// Ensure there's a trailing slash
$system_path = rtrim($system_path, '/').'/';
}
// Is the system path correct?
if ( ! is_dir($system_path))
{
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME);
exit(3); // EXIT_CONFIG
}
/*
* -------------------------------------------------------------------
* Now that we know the path, set the main path constants
* -------------------------------------------------------------------
*/
// The name of THIS file
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
// Path to the system folder
define('BASEPATH', str_replace('\\', '/', $system_path));
// Path to the front controller (this file)
define('FCPATH', dirname(__FILE__).'/');
/*echo FCPATH;
exit;*/
// Name of the "system folder"
define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
// The path to the "application" folder
if (is_dir($application_folder))
{
if (($_temp = realpath($application_folder)) !== FALSE)
{
$application_folder = $_temp;
}
define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
}
else
{
if ( ! is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
{
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
exit(3); // EXIT_CONFIG
}
define('APPPATH', BASEPATH.$application_folder.DIRECTORY_SEPARATOR);
}
// The path to the "views" folder
if ( ! is_dir($view_folder))
{
if ( ! empty($view_folder) && is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
{
$view_folder = APPPATH.$view_folder;
}
elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
{
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
exit(3); // EXIT_CONFIG
}
else
{
$view_folder = APPPATH.'views';
}
}
if (($_temp = realpath($view_folder)) !== FALSE)
{
$view_folder = $_temp.DIRECTORY_SEPARATOR;
}
else
{
$view_folder = rtrim($view_folder, '/\\').DIRECTORY_SEPARATOR;
}
define('VIEWPATH', $view_folder);
/*
* --------------------------------------------------------------------
* LOAD THE BOOTSTRAP FILE
* --------------------------------------------------------------------
*
* And away we go...
*/
require_once BASEPATH.'core/CodeIgniter.php';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment