final 20211130

This commit is contained in:
Kaleeswari 2021-11-30 16:26:55 +05:30
parent 2059a53a61
commit 754dc8196f
2727 changed files with 558278 additions and 0 deletions

50
.gitignore vendored Normal file
View File

@ -0,0 +1,50 @@
# These are some examples of commonly ignored file patterns.
# You should customize this list as applicable to your project.
# Learn more about .gitignore:
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore
# Node artifact files
node_modules/
dist/
# Compiled Java class files
*.class
# Compiled Python bytecode
*.py[cod]
# Log files
*.log
# Package files
*.jar
# Maven
target/
dist/
# JetBrains IDE
.idea/
# Unit test reports
TEST*.xml
# Generated by MacOS
.DS_Store
# Generated by Windows
Thumbs.db
# Applications
*.app
*.exe
*.war
# Large media files
*.mp4
*.tiff
*.avi
*.flv
*.mov
*.wmv
/nbproject/private/

6
.htaccess Normal file
View File

@ -0,0 +1,6 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

6
application/.htaccess Normal file
View File

@ -0,0 +1,6 @@
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>

11
application/cache/index.html vendored Normal file
View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,135 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| AUTO-LOADER
| -------------------------------------------------------------------
| This file specifies which systems should be loaded by default.
|
| In order to keep the framework as light-weight as possible only the
| absolute minimal resources are loaded by default. For example,
| the database is not connected to automatically since no assumption
| is made regarding whether you intend to use it. This file lets
| you globally define which systems you would like loaded with every
| request.
|
| -------------------------------------------------------------------
| Instructions
| -------------------------------------------------------------------
|
| These are the things you can load automatically:
|
| 1. Packages
| 2. Libraries
| 3. Drivers
| 4. Helper files
| 5. Custom config files
| 6. Language files
| 7. Models
|
*/
/*
| -------------------------------------------------------------------
| Auto-load Packages
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/
$autoload['packages'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in system/libraries/ or your
| application/libraries/ directory, with the addition of the
| 'database' library, which is somewhat of a special case.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'email', 'session');
|
| You can also supply an alternative library name to be assigned
| in the controller:
|
| $autoload['libraries'] = array('user_agent' => 'ua');
*/
$autoload['libraries'] = array('database', 'email', 'session');
/*
| -------------------------------------------------------------------
| Auto-load Drivers
| -------------------------------------------------------------------
| These classes are located in system/libraries/ or in your
| application/libraries/ directory, but are also placed inside their
| own subdirectory and they extend the CI_Driver_Library class. They
| offer multiple interchangeable driver options.
|
| Prototype:
|
| $autoload['drivers'] = array('cache');
|
| You can also supply an alternative property name to be assigned in
| the controller:
|
| $autoload['drivers'] = array('cache' => 'cch');
|
*/
$autoload['drivers'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Helper Files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('url', 'file','form','custom','pdf');
/*
| -------------------------------------------------------------------
| Auto-load Config files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['config'] = array('config1', 'config2');
|
| NOTE: This item is intended for use ONLY if you have created custom
| config files. Otherwise, leave it blank.
|
*/
$autoload['config'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Language files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['language'] = array('lang1', 'lang2');
|
| NOTE: Do not include the "_lang" part of your file. For example
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/
$autoload['language'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Models
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['model'] = array('first_model', 'second_model');
|
| You can also supply an alternative model name to be assigned
| in the controller:
|
| $autoload['model'] = array('first_model' => 'first');
*/
$autoload['model'] = array('commonsql_model');

View File

@ -0,0 +1,523 @@
<?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'] = 'http://localhost/policybot/';
/*
|--------------------------------------------------------------------------
| 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:
|
| https://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:
|
| https://codeigniter.com/user_guide/general/core_classes.html
| https://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/
|
| 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['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd';
/*
|--------------------------------------------------------------------------
| Allow $_GET array
|--------------------------------------------------------------------------
|
| 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.
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['allow_get_array'] = TRUE;
/*
|--------------------------------------------------------------------------
| 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.
|
| https://codeigniter.com/user_guide/libraries/encryption.html
|
*/
$config['encryption_key'] = 'nMTGeuY4aG6yd5ntSXTdgynqX5Qmg0e7';
/*
|--------------------------------------------------------------------------
| 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'] = NULL;
$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.
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$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'] = '';

View File

@ -0,0 +1,85 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Display Debug backtrace
|--------------------------------------------------------------------------
|
| If set to TRUE, a backtrace will be displayed along with php errors. If
| error_reporting is disabled, the backtrace will not display, regardless
| of this setting
|
*/
defined('SHOW_DEBUG_BACKTRACE') OR define('SHOW_DEBUG_BACKTRACE', TRUE);
/*
|--------------------------------------------------------------------------
| File and Directory Modes
|--------------------------------------------------------------------------
|
| These prefs are used when checking and setting modes when working
| with the file system. The defaults are fine on servers with proper
| security, but you may wish (or even need) to change the values in
| certain environments (Apache running a separate process for each
| user, PHP under CGI with Apache suEXEC, etc.). Octal values should
| always be used to set the mode correctly.
|
*/
defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644);
defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666);
defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755);
defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755);
/*
|--------------------------------------------------------------------------
| File Stream Modes
|--------------------------------------------------------------------------
|
| These modes are used when working with fopen()/popen()
|
*/
defined('FOPEN_READ') OR define('FOPEN_READ', 'rb');
defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b');
defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
defined('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab');
defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
/*
|--------------------------------------------------------------------------
| Exit Status Codes
|--------------------------------------------------------------------------
|
| Used to indicate the conditions under which the script is exit()ing.
| While there is no universal standard for error codes, there are some
| broad conventions. Three such conventions are mentioned below, for
| those who wish to make use of them. The CodeIgniter defaults were
| chosen for the least overlap with these conventions, while still
| leaving room for others to be defined in future versions and user
| applications.
|
| The three main conventions used for determining exit status codes
| are as follows:
|
| Standard C/C++ Library (stdlibc):
| http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
| (This link also contains other GNU-specific conventions)
| BSD sysexits.h:
| http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
| Bash scripting:
| http://tldp.org/LDP/abs/html/exitcodes.html
|
*/
defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors
defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error
defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error
defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found
defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input
defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error
defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code

View File

@ -0,0 +1,96 @@
<?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 certificates 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' => 'root',
'password' => '',
'database' => 'policybot',
'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
);

View File

@ -0,0 +1,24 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$_doctypes = array(
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
'xhtml-basic11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">',
'html5' => '<!DOCTYPE html>',
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
'mathml1' => '<!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd">',
'mathml2' => '<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">',
'svg10' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">',
'svg11' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',
'svg11-basic' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">',
'svg11-tiny' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">',
'xhtml-math-svg-xh' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
'xhtml-math-svg-sh' => '<!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
'xhtml-rdfa-1' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">',
'xhtml-rdfa-2' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">'
);

View File

@ -0,0 +1,103 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| Foreign Characters
| -------------------------------------------------------------------
| This file contains an array of foreign characters for transliteration
| conversion used by the Text helper
|
*/
$foreign_characters = array(
'/ä|æ|ǽ/' => 'ae',
'/ö|œ/' => 'oe',
'/ü/' => 'ue',
'/Ä/' => 'Ae',
'/Ü/' => 'Ue',
'/Ö/' => 'Oe',
'/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά|Ả|Ạ|Ầ|Ẫ|Ẩ|Ậ|Ằ|Ắ|Ẵ|Ẳ|Ặ|А/' => 'A',
'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά|ả|ạ|ầ|ấ|ẫ|ẩ|ậ|ằ|ắ|ẵ|ẳ|ặ|а/' => 'a',
'/Б/' => 'B',
'/б/' => 'b',
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
'/ç|ć|ĉ|ċ|č/' => 'c',
'/Д/' => 'D',
'/д/' => 'd',
'/Ð|Ď|Đ|Δ/' => 'Dj',
'/ð|ď|đ|δ/' => 'dj',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ|Ẽ|Ẻ|Ẹ|Ề|Ế|Ễ|Ể|Ệ|Е|Э/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε|ẽ|ẻ|ẹ|ề|ế|ễ|ể|ệ|е|э/' => 'e',
'/Ф/' => 'F',
'/ф/' => 'f',
'/Ĝ|Ğ|Ġ|Ģ|Γ|Г|Ґ/' => 'G',
'/ĝ|ğ|ġ|ģ|γ|г|ґ/' => 'g',
'/Ĥ|Ħ/' => 'H',
'/ĥ|ħ/' => 'h',
'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ|Ỉ|Ị|И|Ы/' => 'I',
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ|ỉ|ị|и|ы|ї/' => 'i',
'/Ĵ/' => 'J',
'/ĵ/' => 'j',
'/Ķ|Κ|К/' => 'K',
'/ķ|κ|к/' => 'k',
'/Ĺ|Ļ|Ľ|Ŀ|Ł|Λ|Л/' => 'L',
'/ĺ|ļ|ľ|ŀ|ł|λ|л/' => 'l',
'/М/' => 'M',
'/м/' => 'm',
'/Ñ|Ń|Ņ|Ň|Ν|Н/' => 'N',
'/ñ|ń|ņ|ň|ʼn|ν|н/' => 'n',
'/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|Ο|Ό|Ω|Ώ|Ỏ|Ọ|Ồ|Ố|Ỗ|Ổ|Ộ|Ờ|Ớ|Ỡ|Ở|Ợ|О/' => 'O',
'/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|ο|ό|ω|ώ|ỏ|ọ|ồ|ố|ỗ|ổ|ộ|ờ|ớ|ỡ|ở|ợ|о/' => 'o',
'/П/' => 'P',
'/п/' => 'p',
'/Ŕ|Ŗ|Ř|Ρ|Р/' => 'R',
'/ŕ|ŗ|ř|ρ|р/' => 'r',
'/Ś|Ŝ|Ş|Ș|Š|Σ|С/' => 'S',
'/ś|ŝ|ş|ș|š|ſ|σ|ς|с/' => 's',
'/Ț|Ţ|Ť|Ŧ|τ|Т/' => 'T',
'/ț|ţ|ť|ŧ|т/' => 't',
'/Þ|þ/' => 'th',
'/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự|У/' => 'U',
'/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự|у/' => 'u',
'/Ƴ|Ɏ|Ỵ|Ẏ|Ӳ|Ӯ|Ў|Ý|Ÿ|Ŷ|Υ|Ύ|Ϋ|Ỳ|Ỹ|Ỷ|Ỵ|Й/' => 'Y',
'/ẙ|ʏ|ƴ|ɏ|ỵ|ẏ|ӳ|ӯ|ў|ý|ÿ|ŷ|ỳ|ỹ|ỷ|ỵ|й/' => 'y',
'/В/' => 'V',
'/в/' => 'v',
'/Ŵ/' => 'W',
'/ŵ/' => 'w',
'/Ź|Ż|Ž|Ζ|З/' => 'Z',
'/ź|ż|ž|ζ|з/' => 'z',
'/Æ|Ǽ/' => 'AE',
'/ß/' => 'ss',
'/IJ/' => 'IJ',
'/ij/' => 'ij',
'/Œ/' => 'OE',
'/ƒ/' => 'f',
'/ξ/' => 'ks',
'/π/' => 'p',
'/β/' => 'v',
'/μ/' => 'm',
'/ψ/' => 'ps',
'/Ё/' => 'Yo',
'/ё/' => 'yo',
'/Є/' => 'Ye',
'/є/' => 'ye',
'/Ї/' => 'Yi',
'/Ж/' => 'Zh',
'/ж/' => 'zh',
'/Х/' => 'Kh',
'/х/' => 'kh',
'/Ц/' => 'Ts',
'/ц/' => 'ts',
'/Ч/' => 'Ch',
'/ч/' => 'ch',
'/Ш/' => 'Sh',
'/ш/' => 'sh',
'/Щ/' => 'Shch',
'/щ/' => 'shch',
'/Ъ|ъ|Ь|ь/' => '',
'/Ю/' => 'Yu',
'/ю/' => 'yu',
'/Я/' => 'Ya',
'/я/' => 'ya'
);

View File

@ -0,0 +1,13 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Hooks
| -------------------------------------------------------------------------
| This file lets you define "hooks" to extend CI without hacking the core
| files. Please see the user guide for info:
|
| https://codeigniter.com/user_guide/general/hooks.html
|
*/

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,19 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Memcached settings
| -------------------------------------------------------------------------
| Your Memcached servers can be specified below.
|
| See: https://codeigniter.com/user_guide/libraries/caching.html#memcached
|
*/
$config = array(
'default' => array(
'hostname' => '127.0.0.1',
'port' => '11211',
'weight' => '1',
),
);

View File

@ -0,0 +1,84 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Enable/Disable Migrations
|--------------------------------------------------------------------------
|
| Migrations are disabled by default for security reasons.
| You should enable migrations whenever you intend to do a schema migration
| and disable it back when you're done.
|
*/
$config['migration_enabled'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migration Type
|--------------------------------------------------------------------------
|
| Migration file names may be based on a sequential identifier or on
| a timestamp. Options are:
|
| 'sequential' = Sequential migration naming (001_add_blog.php)
| 'timestamp' = Timestamp migration naming (20121031104401_add_blog.php)
| Use timestamp format YYYYMMDDHHIISS.
|
| Note: If this configuration value is missing the Migration library
| defaults to 'sequential' for backward compatibility with CI2.
|
*/
$config['migration_type'] = 'timestamp';
/*
|--------------------------------------------------------------------------
| Migrations table
|--------------------------------------------------------------------------
|
| This is the name of the table that will store the current migrations state.
| When migrations runs it will store in a database table which migration
| level the system is at. It then compares the migration level in this
| table to the $config['migration_version'] if they are not the same it
| will migrate up. This must be set.
|
*/
$config['migration_table'] = 'migrations';
/*
|--------------------------------------------------------------------------
| Auto Migrate To Latest
|--------------------------------------------------------------------------
|
| If this is set to TRUE when you load the migrations class and have
| $config['migration_enabled'] set to TRUE the system will auto migrate
| to your latest migration (whatever $config['migration_version'] is
| set to). This way you do not have to call migrations anywhere else
| in your code to have the latest migration.
|
*/
$config['migration_auto_latest'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migrations version
|--------------------------------------------------------------------------
|
| This is used to set migration version that the file system should be on.
| If you run $this->migration->current() this is the version that schema will
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 0;
/*
|--------------------------------------------------------------------------
| Migrations Path
|--------------------------------------------------------------------------
|
| Path to your migrations folder.
| Typically, it will be within your application path.
| Also, writing permission is required within the migrations path.
|
*/
$config['migration_path'] = APPPATH.'migrations/';

View File

@ -0,0 +1,184 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| MIME TYPES
| -------------------------------------------------------------------
| This file contains an array of mime types. It is used by the
| Upload class to help identify allowed file types.
|
*/
return array(
'hqx' => array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'),
'cpt' => 'application/mac-compactpro',
'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain'),
'bin' => array('application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'),
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => array('application/octet-stream', 'application/x-msdownload'),
'class' => 'application/octet-stream',
'psd' => array('application/x-photoshop', 'image/vnd.adobe.photoshop'),
'so' => 'application/octet-stream',
'sea' => 'application/octet-stream',
'dll' => 'application/octet-stream',
'oda' => 'application/oda',
'pdf' => array('application/pdf', 'application/force-download', 'application/x-download', 'binary/octet-stream'),
'ai' => array('application/pdf', 'application/postscript'),
'eps' => 'application/postscript',
'ps' => 'application/postscript',
'smi' => 'application/smil',
'smil' => 'application/smil',
'mif' => 'application/vnd.mif',
'xls' => array('application/vnd.ms-excel', 'application/msexcel', 'application/x-msexcel', 'application/x-ms-excel', 'application/x-excel', 'application/x-dos_ms_excel', 'application/xls', 'application/x-xls', 'application/excel', 'application/download', 'application/vnd.ms-office', 'application/msword'),
'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint', 'application/vnd.ms-office', 'application/msword'),
'pptx' => array('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/x-zip', 'application/zip'),
'wbxml' => 'application/wbxml',
'wmlc' => 'application/wmlc',
'dcr' => 'application/x-director',
'dir' => 'application/x-director',
'dxr' => 'application/x-director',
'dvi' => 'application/x-dvi',
'gtar' => 'application/x-gtar',
'gz' => 'application/x-gzip',
'gzip' => 'application/x-gzip',
'php' => array('application/x-httpd-php', 'application/php', 'application/x-php', 'text/php', 'text/x-php', 'application/x-httpd-php-source'),
'php4' => 'application/x-httpd-php',
'php3' => 'application/x-httpd-php',
'phtml' => 'application/x-httpd-php',
'phps' => 'application/x-httpd-php-source',
'js' => array('application/x-javascript', 'text/plain'),
'swf' => 'application/x-shockwave-flash',
'sit' => 'application/x-stuffit',
'tar' => 'application/x-tar',
'tgz' => array('application/x-tar', 'application/x-gzip-compressed'),
'z' => 'application/x-compress',
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed', 'application/s-compressed', 'multipart/x-zip'),
'rar' => array('application/x-rar', 'application/rar', 'application/x-rar-compressed'),
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mpga' => 'audio/mpeg',
'mp2' => 'audio/mpeg',
'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
'aif' => array('audio/x-aiff', 'audio/aiff'),
'aiff' => array('audio/x-aiff', 'audio/aiff'),
'aifc' => 'audio/x-aiff',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
'rpm' => 'audio/x-pn-realaudio-plugin',
'ra' => 'audio/x-realaudio',
'rv' => 'video/vnd.rn-realvideo',
'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'),
'bmp' => array('image/bmp', 'image/x-bmp', 'image/x-bitmap', 'image/x-xbitmap', 'image/x-win-bitmap', 'image/x-windows-bmp', 'image/ms-bmp', 'image/x-ms-bmp', 'application/bmp', 'application/x-bmp', 'application/x-win-bitmap'),
'gif' => 'image/gif',
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg' => array('image/jpeg', 'image/pjpeg'),
'jpe' => array('image/jpeg', 'image/pjpeg'),
'jp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'j2k' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpf' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpg2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpx' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpm' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'mj2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'mjp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'png' => array('image/png', 'image/x-png'),
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'css' => array('text/css', 'text/plain'),
'html' => array('text/html', 'text/plain'),
'htm' => array('text/html', 'text/plain'),
'shtml' => array('text/html', 'text/plain'),
'txt' => 'text/plain',
'text' => 'text/plain',
'log' => array('text/plain', 'text/x-log'),
'rtx' => 'text/richtext',
'rtf' => 'text/rtf',
'xml' => array('application/xml', 'text/xml', 'text/plain'),
'xsl' => array('application/xml', 'text/xsl', 'text/xml'),
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',
'avi' => array('video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'),
'movie' => 'video/x-sgi-movie',
'doc' => array('application/msword', 'application/vnd.ms-office'),
'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', 'application/x-zip'),
'dot' => array('application/msword', 'application/vnd.ms-office'),
'dotx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword'),
'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/vnd.ms-excel', 'application/msword', 'application/x-zip'),
'word' => array('application/msword', 'application/octet-stream'),
'xl' => 'application/excel',
'eml' => 'message/rfc822',
'json' => array('application/json', 'text/json'),
'pem' => array('application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'),
'p10' => array('application/x-pkcs10', 'application/pkcs10'),
'p12' => 'application/x-pkcs12',
'p7a' => 'application/x-pkcs7-signature',
'p7c' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
'p7m' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
'p7r' => 'application/x-pkcs7-certreqresp',
'p7s' => 'application/pkcs7-signature',
'crt' => array('application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert'),
'crl' => array('application/pkix-crl', 'application/pkcs-crl'),
'der' => 'application/x-x509-ca-cert',
'kdb' => 'application/octet-stream',
'pgp' => 'application/pgp',
'gpg' => 'application/gpg-keys',
'sst' => 'application/octet-stream',
'csr' => 'application/octet-stream',
'rsa' => 'application/x-pkcs7',
'cer' => array('application/pkix-cert', 'application/x-x509-ca-cert'),
'3g2' => 'video/3gpp2',
'3gp' => array('video/3gp', 'video/3gpp'),
'mp4' => 'video/mp4',
'm4a' => 'audio/x-m4a',
'f4v' => array('video/mp4', 'video/x-f4v'),
'flv' => 'video/x-flv',
'webm' => 'video/webm',
'aac' => 'audio/x-acc',
'm4u' => 'application/vnd.mpegurl',
'm3u' => 'text/plain',
'xspf' => 'application/xspf+xml',
'vlc' => 'application/videolan',
'wmv' => array('video/x-ms-wmv', 'video/x-ms-asf'),
'au' => 'audio/x-au',
'ac3' => 'audio/ac3',
'flac' => 'audio/x-flac',
'ogg' => array('audio/ogg', 'video/ogg', 'application/ogg'),
'kmz' => array('application/vnd.google-earth.kmz', 'application/zip', 'application/x-zip'),
'kml' => array('application/vnd.google-earth.kml+xml', 'application/xml', 'text/xml'),
'ics' => 'text/calendar',
'ical' => 'text/calendar',
'zsh' => 'text/x-scriptzsh',
'7z' => array('application/x-7z-compressed', 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
'7zip' => array('application/x-7z-compressed', 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
'cdr' => array('application/cdr', 'application/coreldraw', 'application/x-cdr', 'application/x-coreldraw', 'image/cdr', 'image/x-cdr', 'zz-application/zz-winassoc-cdr'),
'wma' => array('audio/x-ms-wma', 'video/x-ms-asf'),
'jar' => array('application/java-archive', 'application/x-java-application', 'application/x-jar', 'application/x-compressed'),
'svg' => array('image/svg+xml', 'application/xml', 'text/xml'),
'vcf' => 'text/x-vcard',
'srt' => array('text/srt', 'text/plain'),
'vtt' => array('text/vtt', 'text/plain'),
'ico' => array('image/x-icon', 'image/x-ico', 'image/vnd.microsoft.icon'),
'odc' => 'application/vnd.oasis.opendocument.chart',
'otc' => 'application/vnd.oasis.opendocument.chart-template',
'odf' => 'application/vnd.oasis.opendocument.formula',
'otf' => 'application/vnd.oasis.opendocument.formula-template',
'odg' => 'application/vnd.oasis.opendocument.graphics',
'otg' => 'application/vnd.oasis.opendocument.graphics-template',
'odi' => 'application/vnd.oasis.opendocument.image',
'oti' => 'application/vnd.oasis.opendocument.image-template',
'odp' => 'application/vnd.oasis.opendocument.presentation',
'otp' => 'application/vnd.oasis.opendocument.presentation-template',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
'odt' => 'application/vnd.oasis.opendocument.text',
'odm' => 'application/vnd.oasis.opendocument.text-master',
'ott' => 'application/vnd.oasis.opendocument.text-template',
'oth' => 'application/vnd.oasis.opendocument.text-web'
);

View File

@ -0,0 +1,14 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Profiler Sections
| -------------------------------------------------------------------------
| This file lets you determine whether or not various sections of Profiler
| data are displayed when the Profiler is enabled.
| Please see the user guide for info:
|
| https://codeigniter.com/user_guide/general/profiling.html
|
*/

View File

@ -0,0 +1,122 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$route['default_controller'] = 'user';
$route['admin/login'] = 'user/login';
$route['admin/dashboard'] = 'user/dashboard';
$route['admin/dashboard-request'] = 'user/dashboard';
$route['admin/dashboard-completed'] = 'user/dashboard';
$route['admin/dashboard-onboard'] = 'user/dashboard';
$route['admin/dashboard-response'] = 'user/dashboard';
$route['admin/dashboard-not-response'] = 'user/dashboard';
$route['admin/logout'] = 'user/logout';
$route['admin/profile'] = 'user/profile';
//role
$route['admin/role'] = 'role/list_role';
//slider
$route['admin/slider'] = 'slider/list_slider';
$route['admin/add-slider'] = 'slider/add_slider';
$route['admin/edit-slider/(:num)'] = 'slider/edit_slider/$1';
//staff
$route['admin/staff'] = 'staff/list_staff';
$route['admin/add-staff'] = 'staff/add_staff';
$route['admin/edit-staff/(:num)'] = 'staff/edit_staff/$1';
$route['admin/delete-staff/(:num)'] = 'staff/delete_staff/$1';
//company
$route['admin/company'] = 'company/list_company';
//category
$route['admin/add-category'] = 'category/add_category';
$route['admin/category'] = 'category/list_category';
$route['admin/view-category/(:num)'] = 'category/view_category/$1';
$route['admin/edit-category/(:num)'] = 'category/edit_category/$1';
//policies
$route['admin/policies'] = 'policy/list_policy';
$route['admin/add-policy'] = 'policy/add_policy';
$route['admin/view-policy/(:num)'] = 'policy/view_policy/$1';
$route['admin/edit-policy/(:num)'] = 'policy/edit_policy/$1';
//blog
$route['admin/blog'] = 'blog/list_blog';
$route['admin/add-blog'] = 'blog/add_blog';
$route['admin/edit-blog/(:num)'] = 'blog/edit_blog/$1';
//testimonial
$route['admin/testimonial'] = 'testimonial/list_testimonial';
$route['admin/add-testimonial'] = 'testimonial/add_testimonial';
$route['admin/edit-testimonial/(:num)'] = 'testimonial/edit_testimonial/$1';
//faq
$route['admin/faq'] = 'faq/list_faq';
$route['admin/add-faq'] = 'faq/add_faq';
$route['admin/edit-faq/(:num)'] = 'faq/edit_faq/$1';
//admin/enquiries
$route['admin/enquiries'] = 'lists/list_enquiries';
$route['admin/reviews'] = 'lists/list_reviews';
//menu
$route['admin/cmenu'] = 'menu/list_menu';
$route['admin/add-menu'] = 'menu/update_menu';
//orders
$route['admin/orders'] = 'orders/list_orders';
//fornt end
//================================
$route['home'] = 'frontend/home';
$route['register'] = 'frontend/register';
$route['front-dashboard'] = 'frontend/dashboard';
$route['become-an-agent'] = 'frontend/becoame_agent';
$route['policy-list'] = 'frontend/list_policy';
$route['policy-detail/(:num)'] = 'frontend/policy_detail/$1';
$route['category/view-price/(:num)'] = 'frontend/category_view_price/$1';
$route['plan-comparision/(:num)'] = 'frontend/compare_plan_details/$1';
$route['view-agent-profile/(:num)/(:num)'] = 'frontend/view_agent_profile/$1/$2';
$route['agent-collect-documents/(:num)/(:num)'] = 'frontend/agent_collect_documents/$1/$2';
//widhlist
$route['add-to-wishlist/(:num)/(:num)'] = 'frontend/add_wish/$1/$2'; //1-userid,2-policyid
$route['remove-from-wishlist/(:num)/(:num)'] = 'frontend/remove_wish/$1/$2'; //1-userid,2-policyid
//request
$route['agent-request'] = 'frontend/agent_request';
$route['user-request'] = 'frontend/user_request';
$route['view-user-response/(:num)'] = 'frontend/view_user_response/$1';
//order
$route['agent-order'] = 'frontend/agent_order';
$route['user-order'] = 'frontend/user_order';
//user profile
$route['user-profile'] = 'frontend/user_profile';
$route['user-edit-profile'] = 'frontend/user_editprofile';
$route['user-change-profile'] = 'frontend/user_changeprofile';
$route['user-change-password'] = 'frontend/user_change_password';
$route['user-favourite'] = 'frontend/favourites';
//agent profile
$route['agent-profile'] = 'frontend/agent_profile';
$route['agent-edit-profile'] = 'frontend/agent_edit_profile';
$route['agent-change-profile'] = 'frontend/agent_change_profile';
$route['agent-change-password'] = 'frontend/agent_change_password';
//review
$route['agent-review'] = 'frontend/agent_review';
$route['user-review'] = 'frontend/user_review';
//login
$route['front-user-logout'] = 'frontend/user_logout';
$route['front-agent-logout'] = 'frontend/agent_logout';

View File

@ -0,0 +1,64 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| SMILEYS
| -------------------------------------------------------------------
| This file contains an array of smileys for use with the emoticon helper.
| Individual images can be used to replace multiple smileys. For example:
| :-) and :) use the same image replacement.
|
| Please see user guide for more info:
| https://codeigniter.com/user_guide/helpers/smiley_helper.html
|
*/
$smileys = array(
// smiley image name width height alt
':-)' => array('grin.gif', '19', '19', 'grin'),
':lol:' => array('lol.gif', '19', '19', 'LOL'),
':cheese:' => array('cheese.gif', '19', '19', 'cheese'),
':)' => array('smile.gif', '19', '19', 'smile'),
';-)' => array('wink.gif', '19', '19', 'wink'),
';)' => array('wink.gif', '19', '19', 'wink'),
':smirk:' => array('smirk.gif', '19', '19', 'smirk'),
':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'),
':-S' => array('confused.gif', '19', '19', 'confused'),
':wow:' => array('surprise.gif', '19', '19', 'surprised'),
':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'),
':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'),
'%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'),
';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'),
':P' => array('raspberry.gif', '19', '19', 'raspberry'),
':blank:' => array('blank.gif', '19', '19', 'blank stare'),
':long:' => array('longface.gif', '19', '19', 'long face'),
':ohh:' => array('ohh.gif', '19', '19', 'ohh'),
':grrr:' => array('grrr.gif', '19', '19', 'grrr'),
':gulp:' => array('gulp.gif', '19', '19', 'gulp'),
'8-/' => array('ohoh.gif', '19', '19', 'oh oh'),
':down:' => array('downer.gif', '19', '19', 'downer'),
':red:' => array('embarrassed.gif', '19', '19', 'red face'),
':sick:' => array('sick.gif', '19', '19', 'sick'),
':shut:' => array('shuteye.gif', '19', '19', 'shut eye'),
':-/' => array('hmm.gif', '19', '19', 'hmmm'),
'>:(' => array('mad.gif', '19', '19', 'mad'),
':mad:' => array('mad.gif', '19', '19', 'mad'),
'>:-(' => array('angry.gif', '19', '19', 'angry'),
':angry:' => array('angry.gif', '19', '19', 'angry'),
':zip:' => array('zip.gif', '19', '19', 'zipper'),
':kiss:' => array('kiss.gif', '19', '19', 'kiss'),
':ahhh:' => array('shock.gif', '19', '19', 'shock'),
':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'),
':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'),
':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'),
':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'),
':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'),
':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'),
':vampire:' => array('vampire.gif', '19', '19', 'vampire'),
':snake:' => array('snake.gif', '19', '19', 'snake'),
':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'),
':question:' => array('question.gif', '19', '19', 'question')
);

View File

@ -0,0 +1,214 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| USER AGENT TYPES
| -------------------------------------------------------------------
| This file contains four arrays of user agent data. It is used by the
| User Agent Class to help identify browser, platform, robot, and
| mobile device data. The array keys are used to identify the device
| and the array values are used to set the actual name of the item.
*/
$platforms = array(
'windows nt 10.0' => 'Windows 10',
'windows nt 6.3' => 'Windows 8.1',
'windows nt 6.2' => 'Windows 8',
'windows nt 6.1' => 'Windows 7',
'windows nt 6.0' => 'Windows Vista',
'windows nt 5.2' => 'Windows 2003',
'windows nt 5.1' => 'Windows XP',
'windows nt 5.0' => 'Windows 2000',
'windows nt 4.0' => 'Windows NT 4.0',
'winnt4.0' => 'Windows NT 4.0',
'winnt 4.0' => 'Windows NT',
'winnt' => 'Windows NT',
'windows 98' => 'Windows 98',
'win98' => 'Windows 98',
'windows 95' => 'Windows 95',
'win95' => 'Windows 95',
'windows phone' => 'Windows Phone',
'windows' => 'Unknown Windows OS',
'android' => 'Android',
'blackberry' => 'BlackBerry',
'iphone' => 'iOS',
'ipad' => 'iOS',
'ipod' => 'iOS',
'os x' => 'Mac OS X',
'ppc mac' => 'Power PC Mac',
'freebsd' => 'FreeBSD',
'ppc' => 'Macintosh',
'linux' => 'Linux',
'debian' => 'Debian',
'sunos' => 'Sun Solaris',
'beos' => 'BeOS',
'apachebench' => 'ApacheBench',
'aix' => 'AIX',
'irix' => 'Irix',
'osf' => 'DEC OSF',
'hp-ux' => 'HP-UX',
'netbsd' => 'NetBSD',
'bsdi' => 'BSDi',
'openbsd' => 'OpenBSD',
'gnu' => 'GNU/Linux',
'unix' => 'Unknown Unix OS',
'symbian' => 'Symbian OS'
);
// The order of this array should NOT be changed. Many browsers return
// multiple browser types so we want to identify the sub-type first.
$browsers = array(
'OPR' => 'Opera',
'Flock' => 'Flock',
'Edge' => 'Edge',
'Chrome' => 'Chrome',
// Opera 10+ always reports Opera/9.80 and appends Version/<real version> to the user agent string
'Opera.*?Version' => 'Opera',
'Opera' => 'Opera',
'MSIE' => 'Internet Explorer',
'Internet Explorer' => 'Internet Explorer',
'Trident.* rv' => 'Internet Explorer',
'Shiira' => 'Shiira',
'Firefox' => 'Firefox',
'Chimera' => 'Chimera',
'Phoenix' => 'Phoenix',
'Firebird' => 'Firebird',
'Camino' => 'Camino',
'Netscape' => 'Netscape',
'OmniWeb' => 'OmniWeb',
'Safari' => 'Safari',
'Mozilla' => 'Mozilla',
'Konqueror' => 'Konqueror',
'icab' => 'iCab',
'Lynx' => 'Lynx',
'Links' => 'Links',
'hotjava' => 'HotJava',
'amaya' => 'Amaya',
'IBrowse' => 'IBrowse',
'Maxthon' => 'Maxthon',
'Ubuntu' => 'Ubuntu Web Browser'
);
$mobiles = array(
// legacy array, old values commented out
'mobileexplorer' => 'Mobile Explorer',
// 'openwave' => 'Open Wave',
// 'opera mini' => 'Opera Mini',
// 'operamini' => 'Opera Mini',
// 'elaine' => 'Palm',
'palmsource' => 'Palm',
// 'digital paths' => 'Palm',
// 'avantgo' => 'Avantgo',
// 'xiino' => 'Xiino',
'palmscape' => 'Palmscape',
// 'nokia' => 'Nokia',
// 'ericsson' => 'Ericsson',
// 'blackberry' => 'BlackBerry',
// 'motorola' => 'Motorola'
// Phones and Manufacturers
'motorola' => 'Motorola',
'nokia' => 'Nokia',
'palm' => 'Palm',
'iphone' => 'Apple iPhone',
'ipad' => 'iPad',
'ipod' => 'Apple iPod Touch',
'sony' => 'Sony Ericsson',
'ericsson' => 'Sony Ericsson',
'blackberry' => 'BlackBerry',
'cocoon' => 'O2 Cocoon',
'blazer' => 'Treo',
'lg' => 'LG',
'amoi' => 'Amoi',
'xda' => 'XDA',
'mda' => 'MDA',
'vario' => 'Vario',
'htc' => 'HTC',
'samsung' => 'Samsung',
'sharp' => 'Sharp',
'sie-' => 'Siemens',
'alcatel' => 'Alcatel',
'benq' => 'BenQ',
'ipaq' => 'HP iPaq',
'mot-' => 'Motorola',
'playstation portable' => 'PlayStation Portable',
'playstation 3' => 'PlayStation 3',
'playstation vita' => 'PlayStation Vita',
'hiptop' => 'Danger Hiptop',
'nec-' => 'NEC',
'panasonic' => 'Panasonic',
'philips' => 'Philips',
'sagem' => 'Sagem',
'sanyo' => 'Sanyo',
'spv' => 'SPV',
'zte' => 'ZTE',
'sendo' => 'Sendo',
'nintendo dsi' => 'Nintendo DSi',
'nintendo ds' => 'Nintendo DS',
'nintendo 3ds' => 'Nintendo 3DS',
'wii' => 'Nintendo Wii',
'open web' => 'Open Web',
'openweb' => 'OpenWeb',
// Operating Systems
'android' => 'Android',
'symbian' => 'Symbian',
'SymbianOS' => 'SymbianOS',
'elaine' => 'Palm',
'series60' => 'Symbian S60',
'windows ce' => 'Windows CE',
// Browsers
'obigo' => 'Obigo',
'netfront' => 'Netfront Browser',
'openwave' => 'Openwave Browser',
'mobilexplorer' => 'Mobile Explorer',
'operamini' => 'Opera Mini',
'opera mini' => 'Opera Mini',
'opera mobi' => 'Opera Mobile',
'fennec' => 'Firefox Mobile',
// Other
'digital paths' => 'Digital Paths',
'avantgo' => 'AvantGo',
'xiino' => 'Xiino',
'novarra' => 'Novarra Transcoder',
'vodafone' => 'Vodafone',
'docomo' => 'NTT DoCoMo',
'o2' => 'O2',
// Fallback
'mobile' => 'Generic Mobile',
'wireless' => 'Generic Mobile',
'j2me' => 'Generic Mobile',
'midp' => 'Generic Mobile',
'cldc' => 'Generic Mobile',
'up.link' => 'Generic Mobile',
'up.browser' => 'Generic Mobile',
'smartphone' => 'Generic Mobile',
'cellphone' => 'Generic Mobile'
);
// There are hundreds of bots but these are the most common.
$robots = array(
'googlebot' => 'Googlebot',
'msnbot' => 'MSNBot',
'baiduspider' => 'Baiduspider',
'bingbot' => 'Bing',
'slurp' => 'Inktomi Slurp',
'yahoo' => 'Yahoo',
'ask jeeves' => 'Ask Jeeves',
'fastcrawler' => 'FastCrawler',
'infoseek' => 'InfoSeek Robot 1.0',
'lycos' => 'Lycos',
'yandex' => 'YandexBot',
'mediapartners-google' => 'MediaPartners Google',
'CRAZYWEBCRAWLER' => 'Crazy Webcrawler',
'adsbot-google' => 'AdsBot Google',
'feedfetcher-google' => 'Feedfetcher Google',
'curious george' => 'Curious George',
'ia_archiver' => 'Alexa Crawler',
'MJ12bot' => 'Majestic-12',
'Uptimebot' => 'Uptimebot'
);

View File

@ -0,0 +1,174 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Blog extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Blog_model');
}
function list_blog()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['blo']=$this->Blog_model->list_blogs();
$this->load->view('admin/blog/list',$data);
}
function add_blog()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post("add"))
{
$Title=$this->input->post("Title");
$tags=$this->input->post("tags");
$Detail=$this->input->post("Detail");
$tg =array();
foreach($tags as $key1=>$val1)
{
$tg[]=$tags[$key1];
}
$tg_res= implode(', ', $tg);
//make directory
if (!is_dir('uploads/blog')) {
mkdir('./uploads/blog', 0777, TRUE);
}
$valid_extensions = array('jpeg', 'jpg', 'png'); // valid extensions
$path = 'uploads/blog/'; // upload directory
if($_FILES['Image'])
{
$img = $_FILES['Image']['name'];
$tmp = $_FILES['Image']['tmp_name'];
// get uploaded file's extension
$ext = strtolower(pathinfo($img, PATHINFO_EXTENSION));
// can upload same image using rand function
$final_image = "Image".rand(1000,1000000).$img;
// check's valid format
if(in_array($ext, $valid_extensions))
{
$path = $path.strtolower($final_image);
if(move_uploaded_file($tmp,$path))
{
$table="blog";
$rvalue=array(
'name'=>$Title,
'intro'=>$Detail,
'image'=>$path,
'tags'=>$tg_res,
'cdate'=>date('Y-m-d H:i:s'),
'cby'=>$this->session->userdata('id'),
'status'=>1);
$result=$this->commonsql_model->insert_table($table,$rvalue);
} } }
if($result)
{
$this->session->set_userdata('suc','successfully added');
redirect('admin/blog');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/blog');
}
}
$this->load->view('admin/blog/add');
}
function edit_blog($id)
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post("edit"))
{
$Title=$this->input->post("Title");
$tags=$this->input->post("tags");
$Detail=$this->input->post("Detail");
$oldimage=$this->input->post("old_image");
$Image=$this->input->post("Image");
$tg =array();
foreach($tags as $key1=>$val1)
{
$tg[]=$tags[$key1];
}
$tg_res= implode(', ', $tg);
if($Image=="") {
$simage=$oldimage;
}
if (!is_dir('uploads/blog')) {
mkdir('./uploads/blog', 0777, TRUE);
}
$valid_extensions = array('jpeg', 'jpg', 'png'); // valid extensions
$path = 'uploads/blog/'; // upload directory
if($_FILES['Image']['tmp_name'])
{
$img = $_FILES['Image']['name'];
$tmp = $_FILES['Image']['tmp_name'];
// get uploaded file's extension
$ext = strtolower(pathinfo($img, PATHINFO_EXTENSION));
// can upload same image using rand function
$final_image = "Image".rand(1000,1000000).$img;
// check's valid format
if(in_array($ext, $valid_extensions))
{
$simage = $path.strtolower($final_image);
if(move_uploaded_file($tmp,$simage))
{}} }
$tblname="blog";
$wheredata=(array('id'=>$id));
$values=array(
'name'=>$Title,
'intro'=>$Detail,
'image'=>$simage,
'tags'=>$tg_res,
'udate'=>date('Y-m-d H:i:s'),
'uby'=>$this->session->userdata('id'),
);
$result=$this->commonsql_model->updateTable($tblname,$wheredata,$values);
if($result)
{
$this->session->set_userdata('suc','successfully Updated');
redirect('admin/blog');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/blog');
}
}
$data['blo']=$this->Blog_model->list_blogs($id);
$this->load->view('admin/blog/edit',$data);
}
function check_uncheck_blog()
{
$id=$_POST['id'];
$value=$_POST['val'];
$tblname="blog";
$where=array('id'=>$id);
$update=array('status'=>$value);
$results=$this->commonsql_model->updateTable($tblname,$where,$update);
if($results)
{
echo "1";
}
else
{
echo "2";
}
}
}
?>

View File

@ -0,0 +1,443 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
date_default_timezone_set('Asia/Kolkata');
class Category extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Category_model');
}
function list_category()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['cat']=$this->Category_model->list_cat();
$this->load->view('admin/category/list',$data);
}
function add_category()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('cat'))
{
$name=$this->input->post('catname');
$short_des=$this->input->post('short_des');
$comparefields=$this->input->post('comparefields');
$questions=$this->input->post('questions');
$options=$this->input->post('options');
$optionmethods=$this->input->post('optionmethods');
$Documents=$this->input->post('Documents');
//make directory
if (!is_dir('uploads/category')) {
mkdir('./uploads/category', 0777, TRUE);
}
$valid_extensions = array('jpeg', 'jpg', 'png'); // valid extensions
$path = 'uploads/category/'; // upload directory
if($_FILES['Image'])
{
$img = $_FILES['Image']['name'];
$tmp = $_FILES['Image']['tmp_name'];
// get uploaded file's extension
$ext = strtolower(pathinfo($img, PATHINFO_EXTENSION));
// can upload same image using rand function
$final_image = "Image".rand(1000,1000000).$img;
// check's valid format
if(in_array($ext, $valid_extensions))
{
$path = $path.strtolower($final_image);
if(move_uploaded_file($tmp,$path))
{
$table="categories";
$rvalue=array(
'name'=>$name,
'short_description'=>$short_des,
'icon'=>$path,
'cdate'=>date('Y-m-d H:i:s'),
'status'=>1);
$result=$this->commonsql_model->insert_table($table,$rvalue);
$catid=$this->db->insert_id();
} } }
// document details
foreach($Documents as $ke=>$val)
{
$tblname="documents_master";
if (is_numeric($Documents[$ke])){
$did = $Documents[$ke];
}
else{
$values=array('name'=>ucwords($Documents[$ke]),
'status'=>1);
if($Documents[$ke]!="") {
$result=$this->commonsql_model->insert_table($tblname,$values);
}
$did = $this->db->insert_id();
}
$tblnames="category_document_details";
$value=array(
'category'=>$catid,
'document'=>$did ,
'status'=>1);
if($catid!="" && $did!="") {
$result=$this->commonsql_model->insert_table($tblnames,$value);
}
}
// compare details
foreach($comparefields as $ke=>$val)
{
$tblname="category_compare_master";
if (is_numeric($comparefields[$ke])){
$cid = $comparefields[$ke];
}
else{
$values=array('compare_name'=>ucwords($comparefields[$ke]),
'status'=>1);
if($comparefields[$ke]!="") {
$result=$this->commonsql_model->insert_table($tblname,$values);
}
$cid = $this->db->insert_id();
}
$tblnames="category_compare_detail";
$value=array(
'category'=>$catid,
'compare'=>$cid ,
'status'=>1);
if($catid!="" && $cid!="") {
$result=$this->commonsql_model->insert_table($tblnames,$value);
}
}
foreach($questions as $que=>$que_va)
{
$optionsnew=$options[$que];$opti=array();
foreach($optionsnew as $opt=>$optval)
{
$opti[]=$options[$que][$opt];
}$opt_res= implode('|', $opti);
$tblname="category_questions_before_quote";
$value=array(
'category'=>$catid,
'question'=>$questions[$que],
'option_input_type'=>$optionmethods[$que],
'options'=>$opt_res,
'status'=>1);
if($questions[$que]!=""){
$result=$this->commonsql_model->insert_table($tblname,$value);
}
}
if($result)
{
$this->session->set_userdata('suc','successfully added');
redirect('admin/category');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/category');
}
}
$data['catcom']=$this->Category_model->get_compare_master();
$data['doccom']=$this->Category_model->get_document_master();
$this->load->view('admin/category/add',$data);
}
function cataction()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$type=$_POST['type']; //types like view, edit etc.,
$id=$_POST['id'];
//selecting table
$tableName="categories";
$select=array('id','name','icon');
$where=array('id'=>$id);
$data['cat']=$this->commonsql_model->selectTable($tableName,$where,$select);
$data['type']=$type;
$this->load->view('admin/category/cataction',$data);
}
function view_category($id)
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['cat']=$this->Category_model->list_cat($id);
$data['com']=$this->Category_model->get_compare_details($id);
$data['quest']=$this->Category_model->questions_before_quote($id);
$data['doc']=$this->Category_model->get_document_details($id);
$this->load->view('admin/category/view',$data);
}
function edit_category($id)
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('cat'))
{
$name=$this->input->post('cmpname');
$oldimage=$this->input->post("old_image");
$image=$this->input->post("Image");
$short_des=$this->input->post("short_des");
$comparefields=$this->input->post("comparefields");
$Documentsfields=$this->input->post("Documents");
$hiddenprimary=$this->input->post("hiddenprimary");
$questions=$this->input->post('questions');
$options=$this->input->post('options');
$optionmethods=$this->input->post('optionmethods');
if($Image=="") {
$simage=$oldimage;
}
if (!is_dir('uploads/category')) {
mkdir('./uploads/category', 0777, TRUE);
}
$valid_extensions = array('jpeg', 'jpg', 'png'); // valid extensions
$path = 'uploads/category/'; // upload directory
if($_FILES['Image']['tmp_name'])
{
$img = $_FILES['Image']['name'];
$tmp = $_FILES['Image']['tmp_name'];
// get uploaded file's extension
$ext = strtolower(pathinfo($img, PATHINFO_EXTENSION));
// can upload same image using rand function
$final_image = "Image".rand(1000,1000000).$img;
// check's valid format
if(in_array($ext, $valid_extensions))
{
$simage = $path.strtolower($final_image);
if(move_uploaded_file($tmp,$simage))
{}} }
$tblname="categories";
$wheredata=(array('id'=>$id));
$values=array(
'name'=>$name,
'short_description'=>$short_des,
'icon'=>$simage,
'udate'=>date('Y-m-d H:i:s'),
);
$result=$this->commonsql_model->updateTable($tblname,$wheredata,$values);
/* comparision edit */
$exist_tag=$this->Category_model->get_compare_details($id);
if($exist_tag->num_rows()>0)
{
$oldcompare=array();
foreach($exist_tag->result() as $list)
{
$oldcompare[]=$list->compare ;
}
}
//different1
$diff=array_diff($oldcompare,$comparefields);
if($diff>0){
foreach($diff as $value){
$where=array('compare'=>$value,'category'=>$id);
$tablename="category_compare_detail";
$values=array('status'=>0);
$product=$this->commonsql_model->updateTable($tablename,$where,$values);
}
}
//new one
$diffnew=array_diff($comparefields,$oldcompare);
if($diffnew>0)
{
foreach ($diffnew as $new_tag)
{
$tblname="category_compare_master";
if (is_numeric($new_tag)){
$cid = $new_tag;
}
else{
$values=array('compare_name'=>ucwords($new_tag),
'status'=>1);
if($new_tag!="") {
$result=$this->commonsql_model->insert_table($tblname,$values);
}
$cid = $this->db->insert_id();
}
$tblnames="category_compare_detail";
$value=array(
'category'=>$id,
'compare'=>$cid ,
'status'=>1);
if($id!="" && $cid!="") {
$result=$this->commonsql_model->insert_table($tblnames,$value);
}
}
}
/* end of comparision edit */
/* Documentsfields edit */
$exist_tags=$this->Category_model->get_document_details($id);
if($exist_tags->num_rows()>0)
{
$olddocument=array();
foreach($exist_tags->result() as $lists)
{
$olddocument[]=$lists->document ;
}
}
//different1
$diffs=array_diff($olddocument,$Documentsfields);
if($diffs>0){
foreach($diffs as $value){
$where=array('document'=>$value,'category'=>$id);
$tablename="category_document_details";
$values=array('status'=>0);
$product=$this->commonsql_model->updateTable($tablename,$where,$values);
}
}
//new one
$diffnews=array_diff($Documentsfields,$olddocument);
if($diffnews>0)
{
foreach ($diffnews as $new_tags)
{
$tblname="documents_master";
if (is_numeric($new_tags)){
$cdid = $new_tags;
}
else{
$values=array('name'=>ucwords($new_tags),
'status'=>1);
if($new_tags!="") {
$result=$this->commonsql_model->insert_table($tblname,$values);
}
$cdid = $this->db->insert_id();
}
$tblnames="category_document_details";
$value=array(
'category'=>$id,
'document'=>$cdid ,
'status'=>1);
if($id!="" && $cdid!="") {
$result=$this->commonsql_model->insert_table($tblnames,$value);
}
}
}
/* end of comparision edit */
/* delete entire row minus */
foreach($questions as $que=>$que_va)
{
$optionsnew=$options[$que];$opti=array();
foreach($optionsnew as $opt=>$optval)
{
$opti[]=$options[$que][$opt];
}$opt_res= implode('|', $opti);
$tblname="category_questions_before_quote";
$value=array(
'category'=>$id,
'question'=>$questions[$que],
'option_input_type'=>$optionmethods[$que],
'options'=>$opt_res,
'status'=>1);
if($hiddenprimary[$que]==""){
if($questions[$que]!=""){
$result=$this->commonsql_model->insert_table($tblname,$value);
}
}
if($hiddenprimary[$que]!=""){
$where=array("id"=>$hiddenprimary[$que]);
$result=$this->commonsql_model->updateTable($tblname,$where,$value);
}
}
/* end of delete entire row minus */
if($result)
{
$this->session->set_userdata('suc','successfully Updated');
redirect('admin/category');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/category');
}
}
$data['catcom']=$this->Category_model->get_compare_master();
$data['doccom']=$this->Category_model->get_document_master();
$data['cat']=$this->Category_model->list_cat($id);
$data['com']=$this->Category_model->get_compare_details($id);
$data['quest']=$this->Category_model->questions_before_quote($id);
$data['doc']=$this->Category_model->get_document_details($id);
$this->load->view('admin/category/edit',$data);
}
function delete_category($id)
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('yes'))
{
$table="categories";
//echo $ledgername;
$values=array(
'status'=>0);
$where=array("id"=>$id);
$result=$this->commonsql_model->updatetable($table,$where,$values);
if($result)
{
$this->session->set_userdata('suc','successfully deleted');
redirect('admin/category');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/category');
}
}
}
function delete_minus_questions()
{
$rid=$_POST['rid'];
$table="category_questions_before_quote";
//echo $ledgername;
$values=array(
'status'=>0);
$where=array("id"=>$rid);
$result=$this->commonsql_model->updatetable($table,$where,$values);
if($result)
{
echo "1";
}
else
{
echo "2";
}
}
}
?>

View File

@ -0,0 +1,168 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
date_default_timezone_set('Asia/Kolkata');
class Company extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Company_model');
}
function list_company()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['cmp']=$this->Company_model->list_cmp();
$this->load->view('admin/company/list',$data);
}
function add_company()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('cmp'))
{
$name=$this->input->post('cmpname');
//make directory
if (!is_dir('uploads/company')) {
mkdir('./uploads/company', 0777, TRUE);
}
$valid_extensions = array('jpeg', 'jpg', 'png'); // valid extensions
$path = 'uploads/company/'; // upload directory
if($_FILES['Image'])
{
$img = $_FILES['Image']['name'];
$tmp = $_FILES['Image']['tmp_name'];
// get uploaded file's extension
$ext = strtolower(pathinfo($img, PATHINFO_EXTENSION));
// can upload same image using rand function
$final_image = "Image".rand(1000,1000000).$img;
// check's valid format
if(in_array($ext, $valid_extensions))
{
$path = $path.strtolower($final_image);
if(move_uploaded_file($tmp,$path))
{
$table="companies";
//echo $ledgername;
$values=array('name'=>$name,
'logo'=>$path,
'cdate'=>date('Y-m-d H:i:s'),
'status'=>1);
$result=$this->commonsql_model->insert_table($table,$values);
} } }
if($result)
{
$this->session->set_userdata('suc','successfully added');
redirect('admin/company');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/company');
}
}
}
function cmpaction()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$type=$_POST['type']; //types like view, edit etc.,
$id=$_POST['id'];
//selecting table
$tableName="companies";
$select=array('id','name','logo');
$where=array('id'=>$id);
$data['cmp']=$this->commonsql_model->selectTable($tableName,$where,$select);
$data['type']=$type;
$this->load->view('admin/company/cmpaction',$data);
}
function edit_company($id)
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('cmp'))
{
$name=$this->input->post('cmpname');
$image=$this->input->post("Image");
$oldimage=$this->input->post("old_image");
if($Image=="") {
$simage=$oldimage;
}
if (!is_dir('uploads/company')) {
mkdir('./uploads/company', 0777, TRUE);
}
$valid_extensions = array('jpeg', 'jpg', 'png'); // valid extensions
$path = 'uploads/company/'; // upload directory
if($_FILES['Image']['tmp_name'])
{
$img = $_FILES['Image']['name'];
$tmp = $_FILES['Image']['tmp_name'];
// get uploaded file's extension
$ext = strtolower(pathinfo($img, PATHINFO_EXTENSION));
// can upload same image using rand function
$final_image = "Image".rand(1000,1000000).$img;
// check's valid format
if(in_array($ext, $valid_extensions))
{
$simage = $path.strtolower($final_image);
if(move_uploaded_file($tmp,$simage))
{}} }
$table="companies";
//echo $ledgername;
$values=array('name'=>$name,'logo'=>$simage,
'udate'=>date('Y-m-d H:i:s'),
'status'=>1);
$where=array("id"=>$id);
$result=$this->commonsql_model->updatetable($table,$where,$values);
if($result)
{
$this->session->set_userdata('suc','successfully updated');
redirect('admin/company');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/company');
}
}
}
function delete_company($id)
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('yes'))
{
$table="companies";
//echo $ledgername;
$values=array(
'status'=>0);
$where=array("id"=>$id);
$result=$this->commonsql_model->updatetable($table,$where,$values);
if($result)
{
$this->session->set_userdata('suc','successfully deleted');
redirect('admin/company');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/company');
}
}
}
}
?>

View File

@ -0,0 +1,32 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Dashboard extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Dashboard_model');
}
function get_dashboard_detail_content()
{
$id=$_POST["id"];
if($id=="1")
{
$quo_det=$this->Dashboard_model->get_quotes_details();
}
if($id=="2")
{
$quo_det=$this->Dashboard_model->get_request_details();
}
if($id=="3")
{
$quo_det=$this->Dashboard_model->get_response_details();
}
}
}
?>

View File

@ -0,0 +1,98 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
date_default_timezone_set('Asia/Kolkata');
class Faq extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Faq_model');
}
function list_faq()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['faq']=$this->Faq_model->list_faq();
$this->load->view('admin/faq/list',$data);
}
function add_faq()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('add'))
{
$Question=$this->input->post('Question');
$Answer=$this->input->post('Answer');
$table="faq";
//echo $ledgername;
$values=array('question'=>$Question,
'answer'=>$Answer,
'cdate'=>date('Y-m-d H:i:s'),
'status'=>1);
$result=$this->commonsql_model->insert_table($table,$values);
if($result)
{
$this->session->set_userdata('suc','successfully added');
redirect('admin/faq');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/faq');
}
}
$this->load->view('admin/faq/add');
}
function edit_faq($id)
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('edit'))
{
$Question=$this->input->post('Question');
$Answer=$this->input->post('Answer');
$table="faq";
//echo $ledgername;
$values=array('question'=>$Question,
'answer'=>$Answer,
'udate'=>date('Y-m-d H:i:s'),
'status'=>1);
$where=array("id"=>$id);
$result=$this->commonsql_model->updatetable($table,$where,$values);
if($result)
{
$this->session->set_userdata('suc','successfully updated');
redirect('admin/faq');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/faq');
}
}
$data['faq']=$this->Faq_model->list_faq($id);
$this->load->view('admin/faq/edit',$data);
}
function check_uncheck_faq()
{
$id=$_POST['id'];
$value=$_POST['val'];
$tblname="faq";
$where=array('id'=>$id);
$update=array('status'=>$value);
$results=$this->commonsql_model->updateTable($tblname,$where,$update);
if($results)
{
echo "1";
}
else
{
echo "2";
}
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,36 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class lists extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Lists_model');
}
function list_enquiries()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['enq']=$this->Lists_model->list_enquiry();
$this->load->view('admin/list/enquire_list',$data);
}
function get_enquire()
{
$id=$_POST['id'];
$tblname="contact";
$where=array('id'=>$id);$show=('message');
$results=$this->commonsql_model->selectTable($tblname,$where,$show);
$data['res']=$results;
$this->load->view('admin/list/enquire_more',$data);
}
function list_reviews()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['rev']=$this->Lists_model->list_review();
$this->load->view('admin/list/review_list',$data);
}
}
?>

View File

@ -0,0 +1,52 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Menu extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Menu_model');
}
function list_menu()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['men']=$this->Menu_model->list_menu();
$this->load->view('admin/menu/list',$data);
}
function update_menu()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('add'))
{
$checkhide=$this->input->post('checkhide');
$pri_id=$this->input->post('pri_id');
foreach($pri_id as $key=>$val)
{
$PID=$pri_id[$key];
$VAL=$checkhide[$key];
$table="menu";
$where=array("id"=>$PID);
$rvalue=array("status"=>$VAL);
$result=$this->commonsql_model->updateTable($table,$where,$rvalue);
}
if($result)
{
$this->session->set_userdata('suc','successfully Updated');
redirect('admin/cmenu');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/cmenu');
}
}
}
}
?>

View File

@ -0,0 +1,22 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Orders extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Orders_model');
}
function list_orders()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['ord']=$this->Orders_model->show_quote_of_all();
$this->load->view('admin/orders/list',$data);
}
}
?>

View File

@ -0,0 +1,332 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
date_default_timezone_set('Asia/Kolkata');
class Policy extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Policy_model');
$this->load->model('Company_model');
$this->load->model('Category_model');
}
function list_policy()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['pol']=$this->Policy_model->list_policies();
$this->load->view('admin/policy/list',$data);
}
function add_policy()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('add'))
{
$policyname=$this->input->post('policyname');
$Company=$this->input->post('Company');
$Category=$this->input->post('Category');
$p_amount=$this->input->post('p_amount');
$pa_period=$this->input->post('pa_period');
$p_period=$this->input->post('p_period');
$pp_period=$this->input->post('pp_period');
$guarantee=$this->input->post('guarantee');
$g_period=$this->input->post('g_period');
$Intro=$this->input->post('Intro');
$topplan=$this->input->post('topplan');
$claimsettleper=$this->input->post('claimsettleper');
$lifecover=$this->input->post('lifecover');
$am_type=$this->input->post('am_type');
$Compare=$this->input->post('Compare');
$cmp_detail=$this->input->post('cmp_detail');
$maxager=$this->input->post('maxager');
//multi
$benefits=$this->input->post('benefits');
$Specialization=$this->input->post('Specialization');
$array_benefits = implode(",", $benefits);
$ben =array();
foreach($benefits as $key=>$val)
{
$ben[]=$benefits[$key];
}
$ben_res= implode(', ', $ben);
$spec =array();
foreach($Specialization as $key1=>$val1)
{
$spec[]=$Specialization[$key1];
}
$spec_res= implode(', ', $spec);
//make directory
if (!is_dir('uploads/policy')) {
mkdir('./uploads/policy', 0777, TRUE);
}
$valid_extensions = array('jpeg', 'jpg', 'png'); // valid extensions
$path = 'uploads/policy/'; // upload directory
if($_FILES['Image'])
{
$img = $_FILES['Image']['name'];
$tmp = $_FILES['Image']['tmp_name'];
// get uploaded file's extension
$ext = strtolower(pathinfo($img, PATHINFO_EXTENSION));
// can upload same image using rand function
$final_image = "Image".rand(1000,1000000).$img;
// check's valid format
if(in_array($ext, $valid_extensions))
{
$path = $path.strtolower($final_image);
if(move_uploaded_file($tmp,$path))
{} } }
$table="policies";
$rvalue=array(
'name'=>$policyname,
'category'=>$Category,
'company'=>$Company,
'amount'=>$p_amount,
'amount_period'=>$pa_period,
'image'=>$path,
'intro'=>$Intro,
'max_cover_age'=>$maxager,
'benefits'=>$ben_res,
'life_cover'=>$lifecover." ".$am_type,
'claimed_settlement'=>$claimsettleper,
'is_this_top_plan'=>$topplan,
'specializations'=>$spec_res,
'guarantee'=>$guarantee." ".$g_period,
'policy_period'=>$p_period." ".$pp_period,
'cdate'=>date('Y-m-d H:i:s'),
'status'=>1);
$result=$this->commonsql_model->insert_table($table,$rvalue);
$polid=$this->db->insert_id();
foreach($Compare as $ck=>$cv){
$table="policy_compare_details";
$rvalue=array(
'policy'=>$polid,
'category'=>$Category,
'compare'=>$Compare[$ck],
'comparedetail'=>$cmp_detail[$ck],
'cdate'=>date('Y-m-d H:i:s'),
'status'=>1);
if($cmp_detail[$ck]!=""){
$result=$this->commonsql_model->insert_table($table,$rvalue);
}
}
if($result)
{
$this->session->set_userdata('suc','successfully added');
redirect('admin/policies');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/policies');
}
}
$data['cmp']=$this->Company_model->list_cmp();
$data['cat']=$this->Category_model->list_cat();
$this->load->view('admin/policy/add',$data);
}
function get_compare_master()
{
$cid=$_POST['val'];
$com=$this->Policy_model->get_compare_master($cid);
foreach($com->result() as $c){
$comid=$c->id;
$compare_name=$c->compare_name;?>
<option value="<?=$comid;?>"><?=$compare_name;?></option>
<?php }
}
function view_policy($id)
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['pol']=$this->Policy_model->list_policies($id);
$data['cmp_det']=$this->Policy_model->get_polict_compare_details($id);
$this->load->view('admin/policy/view',$data);
}
function edit_policy($id)
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('edit'))
{
$policyname=$this->input->post('policyname');
$Company=$this->input->post('Company');
$Category=$this->input->post('Category');
$p_amount=$this->input->post('p_amount');
$pa_period=$this->input->post('pa_period');
$p_period=$this->input->post('p_period');
$pp_period=$this->input->post('pp_period');
$guarantee=$this->input->post('guarantee');
$g_period=$this->input->post('g_period');
$Intro=$this->input->post('Intro');
$Image=$this->input->post('Image');
$oldimage=$this->input->post('oldimage');
$topplan=$this->input->post('topplan');
$claimsettleper=$this->input->post('claimsettleper');
$lifecover=$this->input->post('lifecover');
$am_type=$this->input->post('am_type');
$Compare=$this->input->post('Compare');
$cmp_detail=$this->input->post('cmp_detail');
$maxager=$this->input->post('maxager');
$hiddenprimary=$this->input->post('hiddenprimary');
//multi
$benefits=$this->input->post('benefits');
$Specialization=$this->input->post('Specialization');
$array_benefits = implode(",", $benefits);
$ben =array();
foreach($benefits as $key=>$val)
{
$ben[]=$benefits[$key];
}
$ben_res= implode(', ', $ben);
$spec =array();
foreach($Specialization as $key1=>$val1)
{
$spec[]=$Specialization[$key1];
}
$spec_res= implode(', ', $spec);
if($Image=="") {
$simage=$oldimage;
}
if (!is_dir('uploads/policy')) {
mkdir('./uploads/policy', 0777, TRUE);
}
$valid_extensions = array('jpeg', 'jpg', 'png'); // valid extensions
$path = 'uploads/policy/'; // upload directory
if($_FILES['Image']['tmp_name'])
{
$img = $_FILES['Image']['name'];
$tmp = $_FILES['Image']['tmp_name'];
// get uploaded file's extension
$ext = strtolower(pathinfo($img, PATHINFO_EXTENSION));
// can upload same image using rand function
$final_image = "Image".rand(1000,1000000).$img;
// check's valid format
if(in_array($ext, $valid_extensions))
{
$simage = $path.strtolower($final_image);
if(move_uploaded_file($tmp,$simage))
{}} }
$table="policies";
$where=array("id"=>$id);
$rvalue=array(
'name'=>$policyname,
'category'=>$Category,
'company'=>$Company,
'amount'=>$p_amount,
'amount_period'=>$pa_period,
'image'=>$simage,
'intro'=>$Intro,
'benefits'=>$ben_res,
'max_cover_age'=>$maxager,
'life_cover'=>$lifecover." ".$am_type,
'claimed_settlement'=>$claimsettleper,
'is_this_top_plan'=>$topplan,
'specializations'=>$spec_res,
'guarantee'=>$guarantee." ".$g_period,
'policy_period'=>$p_period." ".$pp_period,
'udate'=>date('Y-m-d H:i:s'),
'status'=>1);
$result=$this->commonsql_model->updateTable($table,$where,$rvalue);
foreach($Compare as $ck=>$cv){
/* comparision edit */
$exist_tag=$this->Policy_model->get_polict_compare_details($id);
if($exist_tag->num_rows()>0)
{
$oldcompare=array();
foreach($exist_tag->result() as $list)
{
$oldcompare[]=$list->id ;
}
}
//different1
$diff=array_diff($oldcompare,$hiddenprimary);
if($diff>0){
foreach($diff as $value){
$where=array('id'=>$value);
$tablename="policy_compare_details";
$values=array('status'=>0);
if($hiddenprimary[$ck]!=""){
$product=$this->commonsql_model->updateTable($tablename,$where,$values);
}
}
}
$table="policy_compare_details";
$rvalue=array(
'policy'=>$id,
'category'=>$Category,
'compare'=>$Compare[$ck],
'comparedetail'=>$cmp_detail[$ck],
'cdate'=>date('Y-m-d H:i:s'),
'status'=>1);
if($hiddenprimary[$ck]==""){
if($cmp_detail[$ck]!=""){
$result=$this->commonsql_model->insert_table($table,$rvalue);
}
}
if($hiddenprimary[$ck]!="")
{
$where=array("id"=>$hiddenprimary[$ck]);
$result=$this->commonsql_model->updateTable($table,$where,$rvalue);
}
}
if($result)
{
$this->session->set_userdata('suc','successfully updated');
redirect('admin/policies');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/policies');
}
}
$data['pol']=$this->Policy_model->list_policies($id);
$data['cmp_det']=$this->Policy_model->get_polict_compare_details($id);
$data['cmp']=$this->Company_model->list_cmp();
$data['cat']=$this->Category_model->list_cat();
$this->load->view('admin/policy/edit',$data);
}
function delete_policy($id)
{
$table="policies";
$where=array("id"=>$id);
$rvalue=array(
'status'=>0);
$result=$this->commonsql_model->updateTable($table,$where,$rvalue);
if($result)
{
$this->session->set_userdata('suc','successfully deleted');
redirect('admin/policies');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/policies');
}
}
}
?>

View File

@ -0,0 +1,112 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
date_default_timezone_set('Asia/Kolkata');
class Role extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Role_model');
}
function list_role()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['role']=$this->Role_model->list_roles();
$this->load->view('admin/role/list',$data);
}
function add_role()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('role'))
{
$name=$this->input->post('rolename');
$table="staff_roles";
//echo $ledgername;
$values=array('name'=>$name,
'cdate'=>date('Y-m-d H:i:s'),
'cby'=>$this->session->userdata('id'),
'status'=>1);
$result=$this->commonsql_model->insert_table($table,$values);
if($result)
{
$this->session->set_userdata('suc','successfully added');
redirect('admin/role');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/role');
}
}
}
function roleaction()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$type=$_POST['type']; //types like view, edit etc.,
$id=$_POST['id'];
//selecting table
$tableName="staff_roles";
$select=array('id','name');
$where=array('id'=>$id);
$data['role']=$this->commonsql_model->selectTable($tableName,$where,$select);
$data['type']=$type;
$this->load->view('admin/role/roleaction',$data);
}
function edit_role($id)
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('roleupdate'))
{
$name=$this->input->post('rolename');
$table="staff_roles";
//echo $ledgername;
$values=array('name'=>$name,
'udate'=>date('Y-m-d H:i:s'),
'status'=>1);
$where=array("id"=>$id);
$result=$this->commonsql_model->updatetable($table,$where,$values);
if($result)
{
$this->session->set_userdata('suc','successfully updated');
redirect('admin/role');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/role');
}
}
}
function delete_role($id)
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('roleupdate'))
{
$table="staff_roles";
//echo $ledgername;
$values=array(
'status'=>0);
$where=array("id"=>$id);
$result=$this->commonsql_model->updatetable($table,$where,$values);
if($result)
{
$this->session->set_userdata('suc','successfully deleted');
redirect('admin/role');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/role');
}
}
}
}
?>

View File

@ -0,0 +1,158 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Slider extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Slider_model');
}
function list_slider()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['slider']=$this->Slider_model->list_sliders();
$this->load->view('admin/slider/list',$data);
}
function add_slider()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post("addslider"))
{
$Title=$this->input->post("Title");
$Subtitle=$this->input->post("Subtitle");
//make directory
if (!is_dir('uploads/slider')) {
mkdir('./uploads/slider', 0777, TRUE);
}
$valid_extensions = array('jpeg', 'jpg', 'png'); // valid extensions
$path = 'uploads/slider/'; // upload directory
if($_FILES['Image'])
{
$img = $_FILES['Image']['name'];
$tmp = $_FILES['Image']['tmp_name'];
// get uploaded file's extension
$ext = strtolower(pathinfo($img, PATHINFO_EXTENSION));
// can upload same image using rand function
$final_image = "Image".rand(1000,1000000).$img;
// check's valid format
if(in_array($ext, $valid_extensions))
{
$path = $path.strtolower($final_image);
if(move_uploaded_file($tmp,$path))
{
$table="slider";
$rvalue=array(
'title'=>$Title,
'subtitle'=>$Subtitle,
'image'=>$path,
'cdate'=>date('Y-m-d H:i:s'),
'cby'=>$this->session->userdata('id'),
'status'=>1);
if($Title!="" && $Subtitle!="" && $path!="") {
$result=$this->commonsql_model->insert_table($table,$rvalue);
}
} } }
if($result)
{
$this->session->set_userdata('suc','successfully added');
redirect('admin/slider');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/slider');
}
}
$this->load->view('admin/slider/add');
}
function edit_slider($id)
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post("editslider"))
{
$Title=$this->input->post("Title");
$Subtitle=$this->input->post("Subtitle");
$oldimage=$this->input->post("old_image");
$image=$this->input->post("Image");
if($Image=="") {
$simage=$oldimage;
}
if (!is_dir('uploads/slider')) {
mkdir('./uploads/slider', 0777, TRUE);
}
$valid_extensions = array('jpeg', 'jpg', 'png'); // valid extensions
$path = 'uploads/slider/'; // upload directory
if($_FILES['Image']['tmp_name'])
{
$img = $_FILES['Image']['name'];
$tmp = $_FILES['Image']['tmp_name'];
// get uploaded file's extension
$ext = strtolower(pathinfo($img, PATHINFO_EXTENSION));
// can upload same image using rand function
$final_image = "Image".rand(1000,1000000).$img;
// check's valid format
if(in_array($ext, $valid_extensions))
{
$simage = $path.strtolower($final_image);
if(move_uploaded_file($tmp,$simage))
{}} }
$tblname="slider";
$wheredata=(array('id'=>$id));
$values=array(
'title'=>$Title,
'subtitle'=>$Subtitle,
'image'=>$simage,
'udate'=>date('Y-m-d H:i:s'),
);
$result=$this->commonsql_model->updateTable($tblname,$wheredata,$values);
if($result)
{
$this->session->set_userdata('suc','successfully Updated');
redirect('admin/slider');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/slider');
}
}
$data['slider']=$this->Slider_model->list_sliders($id);
$this->load->view('admin/slider/edit',$data);
}
function check_uncheck_slider()
{
$id=$_POST['id'];
$value=$_POST['val'];
$tblname="slider";
$where=array('id'=>$id);
$update=array('status'=>$value);
$results=$this->commonsql_model->updateTable($tblname,$where,$update);
if($results)
{
echo "1";
}
else
{
echo "2";
}
}
}
?>

View File

@ -0,0 +1,126 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
date_default_timezone_set('Asia/Kolkata');
class Staff extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Staff_model');
$this->load->model('Role_model');
}
function list_staff()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['staff']=$this->Staff_model->list_staffs();
$this->load->view('admin/staff/list',$data);
}
function add_staff()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('addstaff'))
{
$name=$this->input->post('Name');
$Role=$this->input->post('Role');
$Mobile=$this->input->post('Mobile');
$Email=$this->input->post('Email');
$loginvalue=$this->input->post('loginvalue');
$username=$this->input->post('username');
$password=$this->input->post('password');
$table="staff";
//echo $ledgername;
$values=array('role'=>$Role,
'name'=>$name,
'email'=>$Email,
'mobile'=>$Mobile,
'username'=>$username,
'password'=>md5($password),
'cdate'=>date('Y-m-d H:i:s'),
'status'=>1);
$result=$this->commonsql_model->insert_table($table,$values);
if($result)
{
$this->session->set_userdata('suc','successfully added');
redirect('admin/staff');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/staff');
}
}
$data['role']=$this->Role_model->list_roles();
$this->load->view('admin/staff/add',$data);
}
function edit_staff($id)
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('addstaff'))
{
$name=$this->input->post('Name');
$Role=$this->input->post('Role');
$Mobile=$this->input->post('Mobile');
$Email=$this->input->post('Email');
$loginvalue=$this->input->post('loginvalue');
$username=$this->input->post('username');
$password=$this->input->post('password');
$old_pass=$this->input->post('old_pass');
if($password==""){ $curr_pass=$old_pass; }
else { $curr_pass=md5($password); }
$table="staff";
//echo $ledgername;
$values=array('role'=>$Role,
'name'=>$name,
'email'=>$Email,
'mobile'=>$Mobile,
'username'=>$username,
'password'=>$curr_pass,
'udate'=>date('Y-m-d H:i:s'),
'status'=>1);
$where=array("id"=>$id);
$result=$this->commonsql_model->updatetable($table,$where,$values);
if($result)
{
$this->session->set_userdata('suc','successfully updated');
redirect('admin/staff');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/staff');
}
}
$data['role']=$this->Role_model->list_roles();
$data['staff']=$this->Staff_model->list_staffs($id);
$this->load->view('admin/staff/edit',$data);
}
function delete_staff($id)
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('yes'))
{
$table="staff";
//echo $ledgername;
$values=array(
'status'=>0);
$where=array("id"=>$id);
$result=$this->commonsql_model->updatetable($table,$where,$values);
if($result)
{
$this->session->set_userdata('suc','successfully deleted');
redirect('admin/staff');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/staff');
}
}
}
}
?>

View File

@ -0,0 +1,169 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Testimonial extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Testimonial_model');
}
function list_testimonial()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['tes']=$this->Testimonial_model->list_testimonial();
$this->load->view('admin/testimonial/list',$data);
}
function add_testimonial()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post("add"))
{
$Title=$this->input->post("Title");
$Detail=$this->input->post("Detail");
$tg =array();
foreach($tags as $key1=>$val1)
{
$tg[]=$tags[$key1];
}
$tg_res= implode(', ', $tg);
//make directory
if (!is_dir('uploads/testimonial')) {
mkdir('./uploads/testimonial', 0777, TRUE);
}
$valid_extensions = array('jpeg', 'jpg', 'png'); // valid extensions
$path = 'uploads/testimonial/'; // upload directory
if($_FILES['Image'])
{
$img = $_FILES['Image']['name'];
$tmp = $_FILES['Image']['tmp_name'];
// get uploaded file's extension
$ext = strtolower(pathinfo($img, PATHINFO_EXTENSION));
// can upload same image using rand function
$final_image = "Image".rand(1000,1000000).$img;
// check's valid format
if(in_array($ext, $valid_extensions))
{
$path = $path.strtolower($final_image);
if(move_uploaded_file($tmp,$path))
{
$table="testimonial";
$rvalue=array(
'name'=>$Title,
'message'=>$Detail,
'image'=>$path,
'cdate'=>date('Y-m-d H:i:s'),
'status'=>1);
$result=$this->commonsql_model->insert_table($table,$rvalue);
} } }
if($result)
{
$this->session->set_userdata('suc','successfully added');
redirect('admin/testimonial');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/testimonial');
}
}
$this->load->view('admin/testimonial/add');
}
function edit_testimonial($id)
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post("edit"))
{
$Title=$this->input->post("Title");
$Detail=$this->input->post("Detail");
$oldimage=$this->input->post("old_image");
$Image=$this->input->post("Image");
if($Image=="") {
$simage=$oldimage;
}
if (!is_dir('uploads/testimonial')) {
mkdir('./uploads/testimonial', 0777, TRUE);
}
$valid_extensions = array('jpeg', 'jpg', 'png'); // valid extensions
$path = 'uploads/testimonial/'; // upload directory
if($_FILES['Image']['tmp_name'])
{
$img = $_FILES['Image']['name'];
$tmp = $_FILES['Image']['tmp_name'];
// get uploaded file's extension
$ext = strtolower(pathinfo($img, PATHINFO_EXTENSION));
// can upload same image using rand function
$final_image = "Image".rand(1000,1000000).$img;
// check's valid format
if(in_array($ext, $valid_extensions))
{
$simage = $path.strtolower($final_image);
if(move_uploaded_file($tmp,$simage))
{}} }
$tblname="testimonial";
$wheredata=(array('id'=>$id));
$values=array(
'name'=>$Title,
'message'=>$Detail,
'image'=>$simage,
'udate'=>date('Y-m-d H:i:s'),
);
$result=$this->commonsql_model->updateTable($tblname,$wheredata,$values);
if($result)
{
$this->session->set_userdata('suc','successfully Updated');
redirect('admin/testimonial');
}
else
{
$this->session->set_userdata('err','Please try again');
redirect('admin/testimonial');
}
}
$data['tes']=$this->Testimonial_model->list_testimonial($id);
$this->load->view('admin/testimonial/edit',$data);
}
function check_uncheck_testimonial()
{
$id=$_POST['id'];
$value=$_POST['val'];
$tblname="testimonial";
$where=array('id'=>$id);
$update=array('status'=>$value);
$results=$this->commonsql_model->updateTable($tblname,$where,$update);
if($results)
{
echo "1";
}
else
{
echo "2";
}
}
}
?>

View File

@ -0,0 +1,126 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class User extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Dashboard_model');
}
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see https://codeigniter.com/user_guide/general/urls.html
*/
public function index()
{
$this->load->view('front/index');
}
function login()
{
$this->load->view('admin/login');
}
function dashboard()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
$data['quo']=$this->Dashboard_model->get_quotes();
$data['req']=$this->Dashboard_model->get_request();
$data['res']=$this->Dashboard_model->get_response();
$data['ongo']=$this->Dashboard_model->get_onboard();
$data['com']=$this->Dashboard_model->get_completed();
$data['quo_det']=$this->Dashboard_model->get_quotes_details();
$data['req_det']=$this->Dashboard_model->get_request_details();
$data['res_det']=$this->Dashboard_model->get_response_details();
$data['on_det']=$this->Dashboard_model->get_onboard_details();
$data['com_det']=$this->Dashboard_model->get_complete_details();
$this->load->view('admin/dashboard',$data);
}
function login_validation()
{
// echo "sdfdsf";exit;
$username = $this->input->post('username');
$password = $this->input->post('password');
$check_user=$this->commonsql_model->user($username,$password);
//echo $this->db->last_query();exit;
if($check_user->num_rows()>0)
{
$ch = $check_user->row();
$this->session->set_userdata('id',$ch->id);
$this->session->set_userdata('name',$ch->name);
$this->session->set_userdata('role_id',$ch->role);
$this->session->set_userdata('email',$ch->email);
$this->session->set_userdata('mobile',$ch->mobile);
$this->session->set_userdata('suc','Successfully Logged in..!');
redirect('admin/dashboard');
}
else
{
$this->session->set_userdata('err','The username or password you entered is incorrect.');
redirect('admin/login');
}
}
function logout()
{
$session_data=array('username'=>'');
$this->session->unset_userdata($session_data);
$this->session->sess_destroy();
redirect('admin/login');
}
function profile()
{
if($this->session->userdata('id')==""){redirect('admin/login');}
if($this->input->post('update_profile'))
{
$username=$this->input->post('username');
$new_password=$this->input->post('new_password');
$unique_id=$this->input->post('unique_id');
$old_password=$this->input->post('old_password');
$password=$old_password;
if($username==""){$this->session->set_userdata('err','User Name is a required field');redirect('admin/profile');}
if($new_password!=""){$password=md5($new_password);}
$values=array('username'=>$username,'password'=>$password);
$tablename="staff";$wheredata=array('id'=>$unique_id);
$update_user=$this->commonsql_model->updateTable($tablename,$wheredata,$values);
if($update_user)
{
$this->session->set_userdata('suc'," Successfully updated!");
redirect('admin/profile');
}
else
{
$this->session->set_userdata('err'," Please try again");
redirect('admin/profile');
}
}
$this->load->view('admin/profile');
}
}
?>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,28 @@
// compare details
foreach($comparefields as $ke=>$val)
{
$tblname="category_compare_master";
if (is_numeric($comparefields[$ke])){
$cid = $comparefields[$ke];
}
else{
$values=array('compare_name'=>ucwords($comparefields[$ke]),
'status'=>1);
if($comparefields[$ke]!="") {
$result=$this->commonsql_model->insert_table($tblname,$values);
}
$cid = $this->db->insert_id();
}
$tblnames="category_compare_detail";
$value=array(
'category'=>$catid,
'compare'=>$cid ,
'status'=>1);
if($catid!="" && $cid!="") {
$result=$this->commonsql_model->insert_table($tblnames,$value);
}
}

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,67 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
* @license https://codeigniter.com/user_guide/license.html
* @link https://codeigniter.com
* @since Version 1.0
* @filesource
*/
// ------------------------------------------------------------------------
/**
* CodeIgniter Path Helpers
*
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
* @author ExpressionEngine Dev Team
* @link https://codeigniter.com/user_guide/helpers/xml_helper.html
*/
// ------------------------------------------------------------------------
//Set Default Time Zone as India
//date_default_timezone_set('NZ');
//check page access - STARTS
if (!function_exists('checkpageaccess')) {
function checkpageaccess($role,$userid,$module,$submodule,$page) {
$CI = & get_instance();
$page_access_module=$CI->commonsql_model->page_access_check($role,$userid,$module,$submodule,$page);
//echo $CI->db->last_query();
if($page_access_module->num_rows()>0){
return TRUE;
}else{
return FALSE;
}
}
}
function times_counter($time){
$seconds = 0;
foreach($time as $t)
{
$new=$t.":00";
$timeArr = array_reverse(explode(":", $new));
foreach ($timeArr as $key => $value)
{
if ($key > 2) break;
$seconds += pow(60, $key) * $value;
}
}
$hours = floor($seconds / 3600);
$mins = floor(($seconds - ($hours*3600)) / 60);
//$secs = floor($seconds % 60);
echo $hours.':'.$mins;
}

View File

@ -0,0 +1,90 @@
<?php
function view_table($values)
{
$get_controller_start=$values['start'];
//echo $get_controller_start;exit;
$get_controller_end=$values['end'];
?>
<!------------------Table------------------------>
<div class="col-md-12">
<table class="table table-striped table-bordered table-hover table-checkable order-column" id="sample_1">
<thead>
<tr>
<th>
<label class="mt-checkbox mt-checkbox-single mt-checkbox-outline">
<input type="checkbox" id="main_checkbox" class="group-checkable" data-set="#sample_1 .checkboxes" />
<span></span>
</label>
</th>
<th> Ledger Name </th>
<th> Opening Balance </th>
<th> Closing Balance </th>
</tr>
</thead>
<tbody>
<?php
$CI =& get_instance();
$CI->load->model('Finance_model');
$table=$CI->Finance_model->show_date($get_controller_start,$get_controller_end);
if(isset($table) && $table->num_rows()>0)
{
$i=1;
foreach($table->result() as $rep)
{
$ledger_id=$rep->ledger_id;
$ledger_name=$rep->ledger_name;
$opening_balance=$rep->opening_balance;
$ob_debit_credit_id=$rep->ob_debit_credit_id;
$closing_balance=$rep->closing_balance;
$cb_debit_credit=$rep->cb_debit_credit;
if($ob_debit_credit_id==1)
{
$ob_debit_credit_id="Dr";
}
else
{
$ob_debit_credit_id="Cr";
}
if($cb_debit_credit==1)
{
$cb_debit_credit="Dr";
}
else
{
$cb_debit_credit="Cr";
}
?>
<tr class="odd gradeX">
<td>
<label class="mt-checkbox mt-checkbox-single mt-checkbox-outline">
<input type="checkbox" class="ledger_checkbox" class="checkboxes" value="1" />
<span></span>
</label>
</td>
<td> <?=$ledger_name;?> </td>
<input type="hidden" value="<?=$ledger_id;?>" name="ledger_id[]"/>
<input type="hidden" value="<?=$ledger_name;?>" name="ledger_name[]"/>
<td>
<a> <?=$opening_balance.' '.$ob_debit_credit_id;?></a>
<input type="hidden" value="<?=$opening_balance;?>" name="opening_balance[]"/>
<input type="hidden" value="<?=$ob_debit_credit_id;?>" name="opening_dr_cr[]"/>
</td>
<td>
<span class="label label-sm label-success"> <?=$closing_balance.' '.$cb_debit_credit;?></span>
<input type="hidden" value="<?=$closing_balance;?>" name="closing_balance[]"/>
<input type="hidden" value="<?=$cb_debit_credit;?>" name="closing_dr_cr[]"/>
</td>
</tr>
<?php $i++; } } else { ?> <tr><td colspan="11" style= "color: red; text-align: center;"><h4>No result found</h4></td> </tr> <?php } ?>
</tbody>
</table>
</div>
<!------------------Table------------------------>
<?php } ?>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,135 @@
<?php
function ledger($values)
{
$CI =& get_instance();
$CI->load->model('commonsql_model');
$tableName="ledger";
$whereData=array('status'=>1,'type'=>$values);$order="ledger_id";
$seller=$CI->commonsql_model->selectTable($tableName, $whereData,'',$order);
?>
<div class="portlet-body">
<div class="tab-content">
<div class="tab-pane active" id="portlet_comments_1">
<!-- BEGIN: Comments -->
<div class="portlet box green">
<div class="portlet-title">
<div class="caption">
<?php
if($values=='0')
{
echo "Customer";
}
else
{
echo "Seller";
}
?>
</div>
<?php
if(!pageaccess('Ledger','page_insert'))
{
?><div class="tools">
<a href="<?=base_url();?>add-ledger"><i class="fa fa-plus"id="add"></i></a>
</div>
<?php
} ?>
</div>
<div class="portlet-body">
<div class="table-scrollable">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>S NO</th>
<th><?php
if($values=='0')
{
echo "Customer Name";
}
else
{
echo "Company Name";
}
?></th>
<th>Contact Number</th>
<th>Email</th>
<th>Address</th>
<?php
if(!pageaccess('Ledger','page_edit','page_delete'))
{
?> <th>ACTION </th><?php
}
?>
</tr>
</thead>
<tbody>
<?php
if(isset($seller)&& $seller->num_rows()>0)
{
$i=1;
foreach($seller->result() as $b)
{
$id=$b->ledger_id;
$cname=$b->customer_name;
$name=$b->company;
$contact=$b->contact_number;
$email=$b->email;
$address=$b->address;
$status=$b->status;
?>
<tr id="customer_<?=$id;?>">
<td><?=$i;?></td>
<td><?php
if($values=='0')
{
echo $cname;
}
else
{
echo $name;
}
?></td>
<td><?=$contact;?></td>
<td><?=$email;?></td>
<td><?=$address;?></td>
<td>
<?php
if(!pageaccess('Ledger','page_edit'))
{
?><a href="<?=base_url();?>edit-ledger/<?=$id;?>" id="" class="update_cus"><i id="edit" class="fa fa-pencil" aria-hidden="true"></i></i></a><?php
} ?>
<?php
if(!pageaccess('Ledger','page_delete'))
{
?><a href="<?=base_url();?>delete-ledger/<?=$id;?>" id="<?=$id;?>" class="delete_sku" data-toggle="confirmation" data-singleton="true"><i id="delete" class="fa fa-trash" aria-hidden="true"></i></a><br/><?php
} ?></td>
</tr>
<?php
}
}
else
{
?><tr><td>No record found</td></tr><?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
<!-- END: Comments -->
</div>
<!-- END: Comments -->
</div>
</div>
<?php
}
?>

View File

@ -0,0 +1,147 @@
<?php
function page($role,$emp)
{
$CI =& get_instance();
$CI->load->model('commonsql_model');
$tableName="module";
$whereData=array('status'=>1);
$module_list=$CI->commonsql_model->selectTable($tableName, $whereData,'','','','module_order');
$tableName="module_sub";
$whereData=array('status'=>1);
$sub_module_list=$CI->commonsql_model->selectTable($tableName, $whereData,'');
?>
<div class="portlet box bordered">
<div class="portlet-body">
<div class="alldesign">
<label class="select_all" for="" style="cursor:pointer">Select All </label>
<input type="checkbox" value="1" class="select_all" id="select_all">
</div>
<table class="table table-bordered">
<thead>
<tr>
<th style="font-size: 17px;"> MODULE </th>
<th style="font-size: 17px;"> SUB MODULE </th>
<th> </th>
<th style="font-size: 17px;" style="text-align: center;"> ADD</th>
<th style="font-size: 17px;" style="text-align: center;"> VIEW </th>
<th style="font-size: 17px;" style="text-align: center;"> EDIT </th>
<th style="font-size: 17px;" style="text-align: center;"> DELETE </th>
<th style="font-size: 17px;" style="text-align: center;"> Notification </th>
</tr>
</thead>
<tbody>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td style="text-align:center;"> <input type="checkbox" id="func_1" class="select_func selall" value="1"> </td>
<td style="text-align:center;"> <input type="checkbox" id="func_2" class="select_func selall" value="1"> </td>
<td style="text-align:center;"> <input type="checkbox" id="func_3" class="select_func selall" value="1"> </td>
<td style="text-align:center;"> <input type="checkbox" id="func_4" class="select_func selall" value="1"> </td>
<td style="text-align:center;"> <input type="checkbox" id="func_5" class="select_func selall" value="1"> </td>
</tr>
<?php
if(isset($module_list) && $module_list->num_rows()>0)
{
$i=1;
foreach($module_list->result() as $m_list)
{
$module_id=$m_list->module_id;
$module_name=$m_list->module_name;
$tableName="page_access";
$whereData=array('page_module_id'=>$module_id,'page_role_id'=>$role,'page_user_id'=>$emp,'status'=>1);
$access=$CI->commonsql_model->selectTable($tableName,$whereData);
//echo $CI->db->last_query();
$page_add="0"; $page_view="0"; $page_edit="0"; $page_delete="0"; $page_notify="0";
if($access->num_rows()>0)
{
$acc=$access->row();
$page_add = $acc->page_add;
$page_view = $acc->page_view;
$page_edit = $acc->page_edit;
$page_delete = $acc->page_delete;
$page_notify = $acc->page_notify;
}
?>
<tr>
<td style="font-size:16px !important;"> <?=ucfirst($module_name);?> </td>
<td> </td>
<td style="text-align:center;"> <input type="checkbox" id="main_<?=$module_id;?>" class="select_main_module selall" value=""> </td>
<td style="text-align:center;"> <input type="checkbox" id="mf_1_<?=$module_id;?>" class="smf_1 main_func selall selfun sm_<?=$module_id;?>" name="add_access_mod[<?=$module_id;?>]" value="1" <?php if($page_add==1){?> checked <?php } ?> ></td>
<td style="text-align:center;"> <input type="checkbox" id="mf_2_<?=$module_id;?>" class="smf_2 main_func selall selfun sm_<?=$module_id;?>" name="view_access_mod[<?=$module_id;?>]" value="1" <?php if($page_view==1){?> checked <?php } ?> ></td>
<td style="text-align:center;"> <input type="checkbox" id="mf_3_<?=$module_id;?>" class="smf_3 main_func selall selfun sm_<?=$module_id;?>" name="edit_access_mod[<?=$module_id;?>]" value="1" <?php if($page_edit==1){?> checked <?php } ?> ></td>
<td style="text-align:center;"> <input type="checkbox" id="mf_4_<?=$module_id;?>" class="smf_4 main_func selall selfun sm_<?=$module_id;?>" name="delete_access_mod[<?=$module_id;?>]" value="1" <?php if($page_delete==1){?> checked <?php } ?> ></td>
<td style="text-align:center;"> <input type="checkbox" id="mf_5_<?=$module_id;?>" class="smf_5 main_func selall selfun sm_<?=$module_id;?>" name="notify_access_mod[<?=$module_id;?>]" value="1" <?php if($page_notify==1){?> checked <?php } ?> ></td>
</tr>
<?php
if(isset($sub_module_list) && $sub_module_list->num_rows()>0)
{
$i=1;
foreach($sub_module_list->result() as $s_list)
{
$sub_module_id=$s_list->sub_module_id;
$sub_module_name=$s_list->sub_module_name;
$sub_module_module_id=$s_list->sub_module_module_id;
$tableName="page_access";
$whereData=array('page_submodule_id'=>$sub_module_id,'page_module_id'=>$sub_module_module_id,'page_role_id'=>$role,'page_user_id'=>$emp,'status'=>1);
$access1=$CI->commonsql_model->selectTable($tableName,$whereData);
//echo $CI->db->last_query();
$page_add="0"; $page_view="0"; $page_edit="0"; $page_delete="0"; $page_notify="0";
if($access1->num_rows()>0)
{
$acc1=$access1->row();
$page_add = $acc1->page_add;
$page_view = $acc1->page_view;
$page_edit = $acc1->page_edit;
$page_delete = $acc1->page_delete;
$page_notify = $acc1->page_notify;
}
if($module_id == $sub_module_module_id)
{
?>
<tr>
<td> </td>
<td style="font-size:15px !important;"> <?=ucfirst($sub_module_name);?></td>
<td style="text-align:center;"><input type="checkbox" id="sub_main_<?=$module_id;?>_<?=$sub_module_id;?>" class="select_sub_module selall sm_<?=$module_id;?> msm_<?=$module_id;?> sub_<?=$sub_module_id;?>" value=""> </td>
<td style="text-align:center;"> <input type="checkbox" id="sm_1_<?=$module_id;?>_<?=$sub_module_id;?>" class="select_module selall selfun ssmf_1 ssm_<?=$sub_module_id;?> sm_<?=$module_id;?> mf_1_<?=$module_id;?> f_1_<?=$module_id;?>_<?=$sub_module_id;?> fun_1" value="1" name="add_access[<?=$module_id;?>][<?=$sub_module_id;?>]" <?php if($page_add==1){?> checked <?php } ?> ></td>
<td style="text-align:center;"> <input type="checkbox" id="sm_2_<?=$module_id;?>_<?=$sub_module_id;?>" class="select_module selall selfun ssmf_2 ssm_<?=$sub_module_id;?> sm_<?=$module_id;?> mf_2_<?=$module_id;?> f_2_<?=$module_id;?>_<?=$sub_module_id;?> fun_2" value="1" name="view_access[<?=$module_id;?>][<?=$sub_module_id;?>]" <?php if($page_view==1){?> checked <?php } ?> ></td>
<td style="text-align:center;"> <input type="checkbox" id="sm_3_<?=$module_id;?>_<?=$sub_module_id;?>" class="select_module selall selfun ssmf_3 ssm_<?=$sub_module_id;?> sm_<?=$module_id;?> mf_3_<?=$module_id;?> f_3_<?=$module_id;?>_<?=$sub_module_id;?> fun_3" value="1" name="edit_access[<?=$module_id;?>][<?=$sub_module_id;?>]" <?php if($page_edit==1){?> checked <?php } ?> ></td>
<td style="text-align:center;"> <input type="checkbox" id="sm_4_<?=$module_id;?>_<?=$sub_module_id;?>" class="select_module selall selfun ssmf_4 ssm_<?=$sub_module_id;?> sm_<?=$module_id;?> mf_4_<?=$module_id;?> f_4_<?=$module_id;?>_<?=$sub_module_id;?> fun_4" value="1" name="delete_access[<?=$module_id;?>][<?=$sub_module_id;?>]" <?php if($page_delete==1){?> checked <?php } ?> ></td>
<td style="text-align:center;"> <input type="checkbox" id="sm_5_<?=$module_id;?>_<?=$sub_module_id;?>" class="select_module selall selfun ssmf_5 ssm_<?=$sub_module_id;?> sm_<?=$module_id;?> mf_5_<?=$module_id;?> f_5_<?=$module_id;?>_<?=$sub_module_id;?> fun_5" value="1" name="notify_access[<?=$module_id;?>][<?=$sub_module_id;?>]" <?php if($page_notify==1){?> checked <?php } ?> ></td>
</tr>
<?php
}
$i++;
}
}
$i++;
}
}
?>
</tbody>
</table>
</div>
</div>
<?php
}
?>
<!--
smf ==> select main function,
ssm ==> select sub module,
sm ==> select module,
mf ==> main function,
msm ==> module sub module.
-->

View File

@ -0,0 +1,162 @@
<?php
function tcpdf()
{
require_once('tcpdf/examples/lang/eng.php');
require_once('tcpdf/tcpdf.php');
}
function getStringOfAmount($number) {
$no = round($number);
$decimal = round($number - ($no = floor($number)), 2) * 100;
$digits_length = strlen($no);
$i = 0;
$str = array();
$words = array(
0 => '',
1 => 'One',
2 => 'Two',
3 => 'Three',
4 => 'Four',
5 => 'Five',
6 => 'Six',
7 => 'Seven',
8 => 'Eight',
9 => 'Nine',
10 => 'Ten',
11 => 'Eleven',
12 => 'Twelve',
13 => 'Thirteen',
14 => 'Fourteen',
15 => 'Fifteen',
16 => 'Sixteen',
17 => 'Seventeen',
18 => 'Eighteen',
19 => 'Nineteen',
20 => 'Twenty',
30 => 'Thirty',
40 => 'Forty',
50 => 'Fifty',
60 => 'Sixty',
70 => 'Seventy',
80 => 'Eighty',
90 => 'Ninety');
$digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');
while ($i < $digits_length) {
$divider = ($i == 2) ? 10 : 100;
$number = floor($no % $divider);
$no = floor($no / $divider);
$i += $divider == 10 ? 1 : 2;
if ($number) {
$plural = (($counter = count($str)) && $number > 9) ? 's' : null;
$str [] = ($number < 21) ? $words[$number] . ' ' . $digits[$counter] . $plural : $words[floor($number / 10) * 10] . ' ' . $words[$number % 10] . ' ' . $digits[$counter] . $plural;
} else {
$str [] = null;
}
}
$Rupees = implode(' ', array_reverse($str));
$paise = ($decimal) ? "And Paise " . ($words[$decimal - $decimal%10]) ." " .($words[$decimal%10]) : '';
return ($Rupees ? '' . $Rupees : '') . $paise . "";
}
/**
* Function to dislay tens and ones
*/
function commonloop($val, $str1 = '', $str2 = '') {
global $ones, $tens;
$string = '';
if ($val == 0)
$string .= $ones[$val];
else if ($val < 20)
$string .= $str1.$ones[$val] . $str2;
else
$string .= $str1 . $tens[(int) ($val / 10)] . $ones[$val % 10] . $str2;
return $string;
}
/**
* returns the number as an anglicized string
*/
function convertNum($num) {
$num = (int) $num; // make sure it's an integer
if ($num < 0)
return 'negative' . convertTri(-$num, 0);
if ($num == 0)
return 'Zero';
return convertTri($num, 0);
}
/**
* recursive fn, converts numbers to words
*/
function convertTri($num, $tri) {
global $ones, $tens, $triplets, $count;
$test = $num;
$count++;
// chunk the number, ...rxyy
// init the output string
$str = '';
// to display hundred & digits
if ($count == 1) {
$r = (int) ($num / 1000);
$x = ($num / 100) % 10;
$y = $num % 100;
// do hundreds
if ($x > 0) {
$str = $ones[$x] . ' Hundred';
// do ones and tens
$str .= commonloop($y, ' and ', '');
}
else if ($r > 0) {
// do ones and tens
$str .= commonloop($y, ' and ', '');
}
else {
// do ones and tens
$str .= commonloop($y);
}
}
// To display lakh and thousands
else if($count == 2) {
$r = (int) ($num / 10000);
$x = ($num / 100) % 100;
$y = $num % 100;
$str .= commonloop($x, '', ' Lakh ');
$str .= commonloop($y);
if ($str != '')
$str .= $triplets[$tri];
}
// to display till hundred crore
else if($count == 3) {
$r = (int) ($num / 1000);
$x = ($num / 100) % 10;
$y = $num % 100;
// do hundreds
if ($x > 0) {
$str = $ones[$x] . ' Hundred';
// do ones and tens
$str .= commonloop($y,' and ',' Crore ');
}
else if ($r > 0) {
// do ones and tens
$str .= commonloop($y,' and ',' Crore ');
}
else {
// do ones and tens
$str .= commonloop($y);
}
}
else {
$r = (int) ($num / 1000);
}
// add triplet modifier only if there
// is some output to be modified...
// continue recursing?
if ($r > 0)
return convertTri($r, $tri+1) . $str;
else
return $str;
}
?>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

11
application/index.html Normal file
View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,22 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Blog_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function list_blogs($id=0)
{
$this->db->select('*');
$this->db->from('blog');
if($id!=0){$this->db->where(array('id'=>$id));}
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
}

View File

@ -0,0 +1,68 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Category_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function list_cat($id=0)
{
$this->db->select('*');
$this->db->from('categories');
$this->db->where(array('status'=>1));
if($id!=""){ $this->db->where(array('id'=>$id)); }
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_compare_master()
{
$this->db->select('*');
$this->db->from('category_compare_master');
$this->db->where(array('status'=>1));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_document_master()
{
$this->db->select('*');
$this->db->from('documents_master');
$this->db->where(array('status'=>1));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_compare_details($id)
{
$this->db->select('cd.*,cm.compare_name');
$this->db->from('category_compare_detail as cd');
$this->db->join('category_compare_master as cm','cm.id=cd.compare','left');
$this->db->where(array('cm.status'=>1,'cd.status'=>1,'category'=>$id));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function questions_before_quote($id)
{
$this->db->select('*');
$this->db->from('category_questions_before_quote');
$this->db->where(array('status'=>1,'category'=>$id));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_document_details($id)
{
$this->db->select('cd.*,cm.name as docname');
$this->db->from('category_document_details as cd');
$this->db->join('documents_master as cm','cm.id=cd.document','left');
$this->db->where(array('cm.status'=>1,'cd.status'=>1,'category'=>$id));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
}

View File

@ -0,0 +1,196 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Commonsql_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function insert_table($tableName, $tableData = array()) {
// Insert the user record
if (isset($tableData) && count($tableData) > 0) {
$this->db->insert($tableName, $tableData);
return $this->db->insert_id();
}
return false;
}
/* get the data to table
* $tableName -> Name of the table
* $whereData -> Array -> where fields
* $showField -> Array -> what are the fields need to show
* */
public function selectTable($tableName, $whereData = array(), $showField = array('*'), $order = '') {
$this->db->select($showField);
$this->db->from($tableName);
if (!empty($whereData) > 0) {
$this->db->where($whereData);
}
if ($order != '') {
$this->db->order_by($order,"DESC");
}
/*if (count($limit>0)) {
//$this->db->limit($limit[0],$limit[1]);//example $limit[0] = "0,10" where 0 is for offset and 10 for limit
}*/
$query = $this->db->get();
return $query;
}
/* update the data to table
* $tableName -> Name of the table
* $whereData -> Array -> where fields
* $updateData -> Array -> updated fields and data
* */
public function updateTable($tableName, $whereData = array(), $updateData = array()) {
$this->db->where($whereData);
$this->db->update($tableName, $updateData);
$return = $this->db->affected_rows() > 0;
return $return;
//$query->result_array();
//$query->num_rows();
}
/* update the data to table
* $tableName -> Name of the table
* $whereData -> Array -> where fields
* $updateData -> Array -> updated fields and data
* */
public function deleteTableData($tableName, $whereData = array()) {
// Insert the user record
if (isset($whereData) && count($whereData) > 0) {
$insert_id = $this->db->delete($tableName, $whereData);
return true;
}
return false;
}
function user($username,$password)
{
$this->db->select('*');
$this->db->from('staff');
$this->db->where('username',$username);
$this->db->where(array('password'=>md5($password),'status'=>1));
$query = $this->db->get();
return $query;
}
function type()
{
$this->db->select('mat.mat_mas_id,mat.mat_mas_name,mat.opening,mat.minimum,mat.des,m.mat_type,u.mat_unit');
$this->db->from('material_master as mat');
$this->db->join('material_type as m',' m.type_id = mat.mat_mas_type', 'INNER');
$this->db->join('material_unit as u','u.unit_id = mat.mat_mas_unit','INNER');
$this->db->where('mat.status',1);
$query = $this->db->get();
return $query;
}
function role()
{
$this->db->select('emp.emp_id,emp.emp_name,emp.contact_number,emp.address,emp.role_id,r.role_name,r.role_id');
$this->db->from('employee as emp');
$this->db->join('role as r','emp.role_id= r.role_id ');
$this->db->where('emp.status',1);
$query = $this->db->get();
return $query;
}
function module_list()
{
$this->db->select('ms.sub_id,ms.sub_name,m.module_id,m.module_name');
$this->db->from('sub_module AS ms');
$this->db->join('module AS m','ms.module_id=m.module_id','INNER');
$this->db->where(array('ms.status'=>1,'m.status'=>1));
$query = $this->db->get();
return $query;
}
function rol($roleid) {
$this->db->select('*');
$this->db->from('page_access');
$this->db->where('role_id',$roleid);
$query = $this->db->get();
return $query;
}
function materialsku(){
$this->db->select('product_id,quantity,sk.sku_name,mm.mat_mas_name,sk.sku_id,mu.mat_unit');
$this->db->from('material_sku AS ms');
$this->db->join('material_master AS mm','mm.mat_mas_id=ms.product_id','INNER');
$this->db->join('sku AS sk','sk.sku_id=ms.sku_id','INNER');
$this->db->join('material_unit AS mu','mu.unit_id=mm.mat_mas_unit','LEFT');
$query = $this->db->get();
return $query;
}
function check_emp_userlogin($id)
{
$this->db->select('*');
$this->db->from('login');
$this->db->where('emp_id',$id);
$query = $this->db->get();
return $query;
}
function check_emp_ledr($id)
{
$this->db->select('*');
$this->db->from('employee');
$this->db->where('emp_id',$id);
$query = $this->db->get();
return $query;
}
function page_access_check($role,$userid,$module,$submodule,$page){
$this->db->select('p.*');
$this->db->from('page_access as p');
if($page==1){ $this->db->where('p.page_add',1);}
else if($page==2){ $this->db->where('p.page_view',1);}
else if($page==3){ $this->db->where('p.page_edit',1);}
else if($page==4){ $this->db->where('p.page_delete',1);}
else if($page==5){ $this->db->where('p.page_notify',1);}
$this->db->where(array('p.page_role_id'=>$role,'p.page_user_id'=>$userid,'p.page_module_id'=>$module,'p.page_submodule_id'=>$submodule,'p.status'=>1));
$query = $this->db->get();
return $query;
}
function page_access_module($role,$emp){
$this->db->select('p.page_id,p.page_role_id,p.page_user_id,p.page_module_id,p.status,m.*');
$this->db->from('page_access as p');
$this->db->join('module as m','p.page_module_id=m.module_id','LEFT');
//$this->db->join('module_sub as sm','p.page_submodule_id=sm.sub_module_id','LEFT');
$this->db->group_by('p.page_module_id');
$this->db->where(array('p.status'=>1,'p.page_role_id'=>$role,'p.page_user_id'=>$emp));
$query = $this->db->get();
return $query;
}
function pageaccess_submodule($id,$role,$emp)
{
$this->db->distinct();
$this->db->select('p.*,m.sub_module_id,m.sub_module_name,m.sub_module_route,m.sub_module_icon');
$this->db->from('page_access as p');
$this->db->join('module_sub as m','p.page_submodule_id=m.sub_module_id','RIGHT');
$this->db->where(array('p.page_module_id'=>$id,'p.status'=>1,'p.page_role_id'=>$role,'p.page_user_id'=>$emp));
$query = $this->db->get();
return $query;
}
function emp_bus_id($eid)
{
$this->db->select('emp_cmp_id');
$this->db->from('employee');
$this->db->where('emp_id',$eid);
$query = $this->db->get();
return $query;
}
}

View File

@ -0,0 +1,21 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Company_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function list_cmp()
{
$this->db->select('*');
$this->db->from('companies');
$this->db->where(array('status'=>1));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
}

View File

@ -0,0 +1,118 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Dashboard_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function get_quotes()
{
$this->db->select('count(id) as quotecount');
$this->db->from('quotes');
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_request()
{
$this->db->select('count(id) as requestcount');
$this->db->from('quotes');
$this->db->where("status",0);
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_response()
{
$this->db->distinct();
$this->db->select('quote_id');
$this->db->from('quote_response');
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_onboard()
{
$this->db->select('count(id) as oncount');
$this->db->from('quotes');
$this->db->where(array('status!='=>2));
$this->db->where(array('status!='=>0));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_completed()
{
$this->db->select('count(id) as comcount');
$this->db->from('quotes');
$this->db->where(array('status'=>2));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_quotes_details()
{
$this->db->select('a.*,b.name as policyname,b.permalink,b.category');
$this->db->from('quotes as a');
$this->db->join('policies as b','b.id=a.policy_id','inner');
$this->db->where(array('a.policy_id!='=>0));
$this->db->order_by('a.id','desc');
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_request_details()
{
$this->db->select('a.*,b.name as policyname,b.permalink,b.category');
$this->db->from('quotes as a');
$this->db->join('policies as b','b.id=a.policy_id','inner');
$this->db->where(array('a.policy_id!='=>0,'a.status'=>0));
$this->db->order_by('a.id','desc');
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_onboard_details()
{
$this->db->select('a.*,b.name as policyname,b.permalink,b.category');
$this->db->from('quotes as a');
$this->db->join('policies as b','b.id=a.policy_id','inner');
$this->db->where(array('a.status!='=>2));
$this->db->where(array('a.status!='=>0));
$this->db->order_by('a.id','desc');
$query = $this->db->get();
// echo $this->db->last_query();exit;
return $query;
}
function get_response_details()
{
$this->db->select('a.*,b.name as policyname,b.permalink,b.category,qr.mobile,qr.email,qr.message');
$this->db->from('quotes as a');
$this->db->join('quote_response as qr','qr.quote_id=a.id','inner');
$this->db->join('policies as b','b.id=a.policy_id','inner');
$this->db->order_by('a.id','desc');
$query = $this->db->get();
// echo $this->db->last_query();exit;
return $query;
}
function get_complete_details()
{
$this->db->select('a.*,b.name as policyname,b.permalink,b.category');
$this->db->from('quotes as a');
$this->db->join('policies as b','b.id=a.policy_id','inner');
$this->db->where(array('a.status'=>2));
$this->db->order_by('a.id','desc');
$query = $this->db->get();
// echo $this->db->last_query();exit;
return $query;
}
}

View File

@ -0,0 +1,21 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Faq_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function list_faq($id=0)
{
$this->db->select('*');
$this->db->from('faq');
if($id!=0){ $this->db->where('id',$id); }
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
}

View File

@ -0,0 +1,389 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Frontend_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function list_policy($id=0)
{
$this->db->select('p.*,cm.name as cmpname,ca.name as catname');
$this->db->from('policies as p');
$this->db->join('companies as cm','cm.id=p.company','left');
$this->db->join('categories as ca','ca.id=p.category','left');
$this->db->where(array('p.status'=>1,'cm.status'=>1,'ca.status'=>1));
if($id!=0){ $this->db->where(array('p.id'=>$id)); }
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function frontusercheck($username,$password)
{
$this->db->select('*');
$this->db->from('users');
$this->db->where('email',$username);
$this->db->where(array('password'=>md5($password)));
$query = $this->db->get();
return $query;
}
function agent_racetype()
{
$this->db->select('*');
$this->db->from('agent_racetype');
$this->db->where('status',1);
$query = $this->db->get();
return $query;
}
function agent_detail($id=0)
{
$this->db->select('a.*,cm.name as cmpname,u.name as agentname,u.password,u.profilepic');
$this->db->from('agents as a');
$this->db->join('users as u','u.id=a.user_id','INNER');
$this->db->join('companies as cm','cm.id=a.company','left');
$this->db->where(array('a.status'=>1,'cm.status'=>1));
if($id!=0){ $this->db->where(array('a.user_id'=>$id)); }
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function user_review_to_agent($id=0)
{
$this->db->select('r.*,u.name as username');
$this->db->from('reviews as r');
$this->db->join('users as u','u.id=r.user_id','left');
if($id!=0){ $this->db->where(array('r.agency_id'=>$id)); }
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function show_quote_to_agent()
{
$this->db->select('a.*,b.email,b.mobile,b.name,b.city,b.state,b.country,b.userrole,b.pincode,c.company');
$this->db->from('quotes as a');
$this->db->join('users as b','b.id=a.user_id','inner');
$this->db->join('policies as c','c.id=a.policy_id','left');
//$this->db->where(array('a.agency_id'=>0));
$this->db->order_by('a.id','desc');
$query = $this->db->get();
//echo $this->db->last_query();
return $query;
}
function select_pincode_agentcount($pin,$cont,$cmp)
{
$this->db->select('a.*,b.company,b.experience,b.racetype,ABS( a.pincode - '.$pin.' ) AS pincode');
$this->db->from('users as a');
$this->db->join('agents as b','b.user_id=a.id','inner');
$this->db->where(array('a.userrole'=>1,'a.status'=>1,'b.company'=>$cmp));
$this->db->order_by('pincode');
$this->db->limit($cont);
$query = $this->db->get();
//echo $this->db->last_query(); exit;
return $query;
}
function show_quote_to_user($id)
{
$this->db->select('a.*,b.name as policyname,b.permalink,b.category');
$this->db->from('quotes as a');
$this->db->join('policies as b','b.id=a.policy_id','inner');
$this->db->where(array('a.policy_id!='=>0,'a.user_id'=>$id));
$this->db->order_by('a.id','desc');
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_already_send_quote_details($polid,$primaryid)
{
$this->db->select('*');
$this->db->from('quotes');
$this->db->where(array('policy_id'=>$polid,'user_id'=>$primaryid));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function list_policy_agent_having($catid)
{
$this->db->select('b.*,a.name as agentname,a.profilepic');
$this->db->from('users as a');
$this->db->join('agents as b','b.user_id=a.id','inner');
$this->db->where('find_in_set("'.$catid.'", b.category)');
$this->db->where(array('a.status'=>1,'b.status'=>1));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function agent_review_from_user($agid)
{
$this->db->select('a.*,b.name as username');
$this->db->from('reviews as a');
$this->db->join('users as b','b.id=a.user_id','inner');
$this->db->where(array('a.status'=>1,'agency_id'=>$agid));
$query = $this->db->get();
//echo $this->db->last_query();
return $query;
}
function agent_completed_policy($agid)
{
$this->db->select('*');
$this->db->from('quotes');
$this->db->where(array('status'=>2,'agency_id'=>$agid));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function write_review_permission($user,$policy)
{
$this->db->select('*');
$this->db->from('quotes');
$this->db->where(array('status'=>2,'user_id'=>$user,'policy_id'=>$policy));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function show_response_detail_to_user($uid,$quoteid)
{
$this->db->select('q.*,a.name as agentname,a.profilepic');
$this->db->from('quote_response as q');
$this->db->join('users as a','a.id=q.agency_id','inner');
$this->db->where(array('q.user_id'=>$uid,'q.quote_id'=>$quoteid));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function show_single_agent_response_detail_to_user($qid,$aid,$uid)
{
$this->db->select('q.*,a.name as agentname');
$this->db->from('quote_response as q');
$this->db->join('users as a','a.id=q.agency_id','inner');
$this->db->where(array('q.status'=>0,'q.agency_id'=>$aid,'q.user_id'=>$uid,'q.quote_id'=>$qid));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function show_response_to_agent_for_accept($aid)
{
$this->db->select('a.*,b.name,b.city,b.state,b.country');
$this->db->from('quotes as a');
$this->db->join('users as b','b.id=a.user_id','inner');
$this->db->where(array('a.agency_id'=>$aid));
$this->db->order_by('a.id','desc');
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function show_response_to_user_for_accept_complete($uid)
{
$this->db->select('a.*,b.name as policyname,b.category');
$this->db->from('quotes as a');
$this->db->join('policies as b','b.id=a.policy_id','inner');
$this->db->join('agents as c ','c.user_id=a.agency_id','inner');
$this->db->where(array('a.user_id'=>$uid));
$this->db->order_by('a.id','desc');
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function agent_approve_review_to_user($id=0)
{
$this->db->select('r.*,u.name as agentname');
$this->db->from('reviews as r');
$this->db->join('users as u','u.id=r.agency_id','left');
if($id!=0){ $this->db->where(array('r.user_id'=>$id)); }
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function select_sent_quotes_from_user($pid,$uid)
{
$this->db->select('*');
$this->db->from('quotes');
$this->db->where(array('policy_id'=>$pid,'user_id'=>$uid,'agency_id'=>0,'status!='=>2));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_categorywise_policy_with_agelimit($cid,$age=0)
{
$this->db->select('p.*,cm.name as cmpname,cm.logo');
$this->db->from('policies as p');
$this->db->join('companies as cm','cm.id=p.company','left');
$this->db->where(array('p.status'=>1,'cm.status'=>1,'p.is_this_top_plan'=>0));
$this->db->where(array('p.category'=>$cid));
if($age!=""){ $this->db->where('p.max_cover_age>=',$age); }
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_company_name($cid)
{
$this->db->select('*');
$this->db->from('companies');
$this->db->where(array('status'=>1,'id'=>$cid));
$query = $this->db->get();
return $query;
}
function get_categorywise_policy_with_agelimit_top($cid,$age=0)
{
$this->db->select('p.*,cm.name as cmpname,cm.logo');
$this->db->from('policies as p');
$this->db->join('companies as cm','cm.id=p.company','left');
$this->db->where(array('p.status'=>1,'cm.status'=>1,'p.is_this_top_plan'=>1));
$this->db->where(array('p.category'=>$cid));
if($age!=""){ $this->db->where('p.max_cover_age>=',$age); }
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_categorydetails_for_categoryview($cid)
{
$this->db->select('*');
$this->db->from('categories');
$this->db->where(array('id'=>$cid,'status'=>1));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_category_questions($id)
{
$this->db->select('*');
$this->db->from('category_questions_before_quote');
$this->db->where(array('category'=>$id,'status'=>1));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function check_mobile_exist_for_login_register($mob)
{
$this->db->select('*');
$this->db->from('users');
$this->db->where(array('mobile'=>$mob));
$query = $this->db->get();
return $query;
}
function get_policy_compare($pid,$plan)
{
$this->db->select('p.*,cm.name as cmpname,cm.logo');
$this->db->from('policies as p');
$this->db->join('companies as cm','cm.id=p.company','left');
$this->db->where(array('p.status'=>1,'cm.status'=>1,'p.is_this_top_plan'=>$plan));
$this->db->where(array('p.id'=>$pid));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_comparisions($cid,$pol)
{
$this->db->select('p.*,cm.name as cmpname,cm.logo');
$this->db->from('policies as p');
$this->db->join('companies as cm','cm.id=p.company','left');
$this->db->where(array('p.status'=>1,'cm.status'=>1,'p.category'=>$cid));
$this->db->where_in('p.id',$pol);
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_compare_details($cm,$pol,$cat)
{
$this->db->select('cd.comparedetail');
$this->db->from('policy_compare_details as cd');
$this->db->where(array('compare'=>$cm,'policy'=>$pol,'cd.status'=>1,'cd.category'=>$cat));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_comparisions_master($cat,$pol)
{
$this->db->distinct();
$this->db->select('cd.compare,cm.compare_name');
$this->db->from('policy_compare_details as cd');
$this->db->join('category_compare_master as cm','cm.id=cd.compare','LEFT');
$this->db->where(array('cd.status'=>1,'cd.category'=>$cat));
$this->db->where_in('policy',$pol);
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_recent_order_details($id)
{
$this->db->select('q.*,p.name as policyname');
$this->db->from('quotes as q');
$this->db->join('policies as p','p.id=q.policy_id','left');
$this->db->where(array('user_id'=>$id));
$this->db->order_by("id","DESC");
$this->db->limit(5);
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_recent_order_details_agent($id)
{
$this->db->select('q.*,p.name as policyname');
$this->db->from('quotes as q');
$this->db->join('policies as p','p.id=q.policy_id','left');
$this->db->where(array('q.agency_id'=>$id));
$this->db->order_by("id","DESC");
$this->db->limit(5);
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_documents_collection($cid)
{
$this->db->select('cd.*,dm.name as doc_name,c.name as catname');
$this->db->from('category_document_details cd');
$this->db->join('documents_master dm','dm.id=cd.document','left');
$this->db->join('categories c','c.id=cd.category','left');
$this->db->where(array('cd.category'=>$cid,'cd.status'=>1,'c.status'=>1,'dm.status'=>1));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_details_of_quote_user($qid)
{
$this->db->select('q.*,u.name as username');
$this->db->from('quotes as q');
$this->db->join('users as u','u.id=q.user_id','left');
$this->db->where(array('q.id'=>$qid,'u.status'=>1,'q.status'=>1));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_current_policy_detail($cid)
{
$this->db->select('p.*,cm.logo,cm.name as cmpname,ca.name as catname');
$this->db->from('policies as p');
$this->db->join('companies as cm','cm.id=p.company','left');
$this->db->join('categories as ca','ca.id=p.category','left');
$this->db->where(array('p.status'=>1,'cm.status'=>1,'ca.status'=>1));
$this->db->where(array('p.category'=>$cid));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_agent_det_to_show_quote($aid)
{
$this->db->select('r.id,r.status,a.*,b.company,b.experience,b.racetype,ABS( a.pincode - '.$pin.' ) AS pincode');
$this->db->from('quote_response');
$this->db->where_in('status',array(2,3));
$query = $this->db->get();
//echo $this->db->last_query();
return $query;
}
}

View File

@ -0,0 +1,34 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Lists_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function list_enquiry($id=0)
{
$this->db->select('*');
$this->db->from('contact');
$this->db->where('status',1);
if($id!=0){$this->db->where(array('id'=>$id));}
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function list_review()
{
$this->db->select('r.*,u.name as username,ua.name as agentname');
$this->db->from('reviews as r');
$this->db->join('users as u','u.id=r.user_id','left');
$this->db->join('users as ua','ua.id=r.agency_id','Left');
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
}

View File

@ -0,0 +1,22 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Menu_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function list_menu()
{
$this->db->select('*');
$this->db->from('menu');
$this->db->where(array('parent_id'=>0));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
}

View File

@ -0,0 +1,27 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Orders_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function show_quote_of_all()
{
$this->db->select('a.*,b.name as policyname,b.permalink,b.category');
$this->db->from('quotes as a');
$this->db->join('policies as b','b.id=a.policy_id','inner');
$this->db->where(array('a.policy_id!='=>0));
$this->db->order_by('a.id','desc');
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
}

View File

@ -0,0 +1,47 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Policy_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function list_policies($id=0)
{
$this->db->select('p.*,cm.name as cmpname,ca.name as catname');
$this->db->from('policies as p');
$this->db->join('companies as cm','cm.id=p.company','left');
$this->db->join('categories as ca','ca.id=p.category','left');
$this->db->where(array('p.status'=>1,'cm.status'=>1,'ca.status'=>1));
if($id!=0){ $this->db->where(array('p.id'=>$id)); }
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_compare_master($cid)
{
$this->db->select('cm.*');
$this->db->from('category_compare_detail as cd');
$this->db->join('category_compare_master as cm','cm.id=cd.compare','left');
$this->db->where(array('cm.status'=>1,'cd.status'=>1));
$this->db->where(array('cd.category'=>$cid));
$query = $this->db->get();
return $query;
}
function get_polict_compare_details($pid)
{
$this->db->select('cd.*,cm.compare_name');
$this->db->from('policy_compare_details as cd');
$this->db->join('category_compare_master as cm','cm.id=cd.compare','left');
$this->db->where(array('cm.status'=>1,'cd.status'=>1));
$this->db->where(array('cd.policy'=>$pid));
$query = $this->db->get();
// echo $this->db->last_query();exit;
return $query;
}
}

View File

@ -0,0 +1,21 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Role_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function list_roles()
{
$this->db->select('*');
$this->db->from('staff_roles');
$this->db->where(array('status'=>1));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
}

View File

@ -0,0 +1,22 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Slider_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function list_sliders($id=0)
{
$this->db->select('*');
$this->db->from('slider');
//$this->db->where(array('status'=>1));
if($id!=0){$this->db->where(array('id'=>$id));}
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
}

View File

@ -0,0 +1,23 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Staff_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function list_staffs($id=0)
{
$this->db->select('s.*,r.name as rolename');
$this->db->from('staff as s');
$this->db->join('staff_roles as r','r.id=s.role','inner');
$this->db->where(array('s.status'=>1));
if($id!=0){$this->db->where(array('s.id'=>$id));}
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
}

View File

@ -0,0 +1,22 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Testimonial_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function list_testimonial($id=0)
{
$this->db->select('*');
$this->db->from('testimonial');
if($id!=0){$this->db->where(array('id'=>$id));}
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
}

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

11
application/third_party/index.html vendored Normal file
View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,118 @@
<link href="<?=base_url();?>bassets/jquery-tags-input/jquery-tags-input.css" rel="stylesheet">
<?php $this->load->view('admin/includes/header');?>
<style>
div.tagsinput span.tag {
border-radius: 20px !important;
color:#fff;
padding: 2px 10px 2px 10px!important;
background: #ef7f1a!important;
}
div.tagsinput span.tag a {
color: #fff !important;;
}
</style>
<div class="page-container">
<?php $this->load->view('admin/includes/sidebar');?>
<!-- start page content -->
<div class="page-content-wrapper">
<div class="page-content">
<div class="page-bar">
<div class="page-title-breadcrumb">
<div class=" pull-left">
<div class="page-title">Blog Add</div>
</div>
<ol class="breadcrumb page-breadcrumb pull-right">
<li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.html">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li><a class="parent-item" href="<?=base_url();?>admin/blog">Blog</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li class="active">Blog Add</li>
</ol>
</div>
</div>
<?php $this->load->view('admin/includes/msg');?>
<div class="row">
<div class="col-md-12">
<div class="card card-topline-orange">
<div class="white-box">
<div class="card card-box">
<div class="card-head">
<header>Add Blog</header>
</div>
<div class="card-body ">
<?=form_open_multipart(base_url().'admin/add-blog');?>
<div class="row">
<div class="form-group col-md-6">
<label for="simpleFormEmail"> Title <span class="required">*</span></label>
<input type="text" name="Title" autocomplete="off" class="form-control" data-validation="required" placeholder="Title">
</div>
<div class="form-group col-md-6">
<label for="simpleFormEmail"> Image <span class="required">*</span> </label>
<input type="file" name="Image" autocomplete="off" class="form-control" data-validation="required" >
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label for="simpleFormEmail"> Tags <span class="required">*</span></label>
<input type="text" class="form-control tags tags-input" data-type="tags" name="tags[]" data-validation="required"/>
</div>
<div class="form-group col-md-6">
<label for="simpleFormEmail"> Detail <span class="required">*</span> </label>
<textarea name="Detail" autocomplete="off" rows="4" class="form-control" data-validation="required" placeholder="Description"></textarea>
</div>
</div>
<input type="submit" name="add" class="btn btn-primary" value="Submit">
<?=form_close();?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--modal -->
<div class="modal fade" id="rolepop" tabindex="-1" role="basic" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="viewdetails">
<img src="<?=base_url();?>bassets/admin/img/process.gif" class="loader-img">
</div>
</div>
</div>
</div>
<?php $this->load->view('admin/includes/footer');?>
<script type="text/javascript" src="<?=base_url();?>bassets/admin/js/jquery.cookie.min.js"></script>
<!--tags input-->
<script src="<?=base_url();?>bassets/jquery-tags-input/jquery-tags-input.js"></script>
<script src="<?=base_url();?>bassets/jquery-tags-input/jquery-tags-input-init.js"></script>
<script>
var base_path=$('body').attr('data-path');
//Common View Edit Specification
$('body').on('click','.roleeditpop',function(){
//alert("sdadsd");
$('#rolepop').modal('show');
$('.viewdetails').html('<img src='+base_path+'bassets/admin/img/process.gif class="loader-img">');
var type=$(this).attr('data-type');
var id=$(this).attr('data-id');
var url22=base_path+"role/roleaction";
$.post(url22,{type:type,id:id,csrf_test_name:$.cookie('csrf_cookie_name')},function(result){
$('.viewdetails').html(result);
});
});
</script>

View File

@ -0,0 +1,132 @@
<link href="<?=base_url();?>bassets/jquery-tags-input/jquery-tags-input.css" rel="stylesheet">
<?php $this->load->view('admin/includes/header');?>
<style>
div.tagsinput span.tag {
border-radius: 20px !important;
color:#fff;
padding: 2px 10px 2px 10px!important;
background: #ef7f1a!important;
}
div.tagsinput span.tag a {
color: #fff !important;;
}
</style>
<div class="page-container">
<?php $this->load->view('admin/includes/sidebar');?>
<!-- start page content -->
<div class="page-content-wrapper">
<div class="page-content">
<div class="page-bar">
<div class="page-title-breadcrumb">
<div class=" pull-left">
<div class="page-title">Blog Edit</div>
</div>
<ol class="breadcrumb page-breadcrumb pull-right">
<li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.html">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li><a class="parent-item" href="<?=base_url();?>admin/blog">Blog</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li class="active">Blog Edit</li>
</ol>
</div>
</div>
<?php $this->load->view('admin/includes/msg');?>
<div class="row">
<div class="col-md-12">
<div class="card card-topline-orange">
<div class="white-box">
<div class="card card-box">
<div class="card-head">
<header>Edit Blog</header>
</div>
<?php
if(isset($blo)&& $blo->num_rows()>0)
{
$s=$blo->row();
$id=$s->id;
$name=$s->name;
$image=$s->image;
$intro=$s->intro;
$tags=$s->tags;
}
?>
<div class="card-body ">
<?=form_open_multipart(base_url().'admin/edit-blog/'.$id);?>
<div class="row">
<div class="form-group col-md-6">
<label for="simpleFormEmail"> Title <span class="required">*</span></label>
<input type="text" name="Title" value="<?=$name;?>" autocomplete="off" class="form-control" data-validation="required" placeholder="Title">
</div>
<div class="form-group col-md-6">
<label for="simpleFormEmail"> Image </label>
<input type="file" name="Image" autocomplete="off" class="form-control" >
<input type="hidden" name="old_image" value="<?=$image;?>" autocomplete="off" class="form-control" >
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label for="simpleFormEmail"> Tags <span class="required">*</span></label>
<input type="text" class="form-control tags tags-input" data-type="tags" value="<?=$tags;?>" name="tags[]" data-validation="required"/>
</div>
<div class="form-group col-md-6">
<label for="simpleFormEmail"> Detail <span class="required">*</span> </label>
<textarea name="Detail" autocomplete="off" rows="4" class="form-control" data-validation="required" placeholder="Description"><?=$intro?></textarea>
</div>
</div>
<input type="submit" name="edit" class="btn btn-primary" value="Submit">
<?=form_close();?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--modal -->
<div class="modal fade" id="rolepop" tabindex="-1" role="basic" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="viewdetails">
<img src="<?=base_url();?>bassets/admin/img/process.gif" class="loader-img">
</div>
</div>
</div>
</div>
<?php $this->load->view('admin/includes/footer');?>
<script type="text/javascript" src="<?=base_url();?>bassets/admin/js/jquery.cookie.min.js"></script>
<!--tags input-->
<script src="<?=base_url();?>bassets/jquery-tags-input/jquery-tags-input.js"></script>
<script src="<?=base_url();?>bassets/jquery-tags-input/jquery-tags-input-init.js"></script>
<script>
var base_path=$('body').attr('data-path');
//Common View Edit Specification
$('body').on('click','.roleeditpop',function(){
//alert("sdadsd");
$('#rolepop').modal('show');
$('.viewdetails').html('<img src='+base_path+'bassets/admin/img/process.gif class="loader-img">');
var type=$(this).attr('data-type');
var id=$(this).attr('data-id');
var url22=base_path+"role/roleaction";
$.post(url22,{type:type,id:id,csrf_test_name:$.cookie('csrf_cookie_name')},function(result){
$('.viewdetails').html(result);
});
});
</script>

View File

@ -0,0 +1,227 @@
<link href="<?=base_url();?>bassets/jquery-tags-input/jquery-tags-input.css" rel="stylesheet">
<?php $this->load->view('admin/includes/header');?>
<style>
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.sliderrr {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #e43a45;
-webkit-transition: .4s;
transition: .4s;
width: 50px;
height: 30px;
border-radius: 20px !important;
}
.sliderrr:before {
position: absolute;
content: "";
height: 22px;
width: 22px;
left: 0px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .sliderrr {
background-color: #26c281;
width: 50px;
height: 30px;
border-radius: 20px !important;
}
input:focus + .sliderrr {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .sliderrr:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}
/* Rounded sliders */
.sliderrr.round {
border-radius: 34px;
}
.sliderrr.round:before {
border-radius: 50%;
}
</style>
<div class="page-container">
<?php $this->load->view('admin/includes/sidebar');?>
<!-- start page content -->
<div class="page-content-wrapper">
<div class="page-content">
<div class="page-bar">
<div class="page-title-breadcrumb">
<div class=" pull-left">
<div class="page-title">Blog List</div>
</div>
<ol class="breadcrumb page-breadcrumb pull-right">
<li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.html">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li><a class="parent-item" href="#">Blog</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li class="active">Blog List</li>
</ol>
</div>
</div>
<?php $this->load->view('admin/includes/msg');?>
<div class="row">
<div class="col-md-12">
<div class="card card-topline-orange">
<div class="white-box">
<div class="card card-box">
<div class="card-head">
<header>Blog</header>
</div>
<div class="card-body ">
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-6" style="float:left">
<div class="btn-group">
<a href="<?=base_url();?>admin/add-blog" id="addRow" class="btn btn-info">
Add New <i class="fa fa-plus"></i>
</a>
</div>
</div>
</div>
<div class="table-scrollable">
<table class="table table-hover table-checkable order-column full-width" id="example4">
<thead>
<tr>
<th>S no</th>
<th> Name </th>
<th> Image </th>
<th> Details </th>
<th> Tags </th>
<th> Edit </th>
<th> Action </th>
</tr>
</thead>
<tbody>
<?php
if(isset($blo)&& $blo->num_rows()>0)
{
$i=1;
foreach($blo->result() as $s)
{
$id=$s->id;
$name=$s->name;
$tags=$s->tags;
$image=$s->image;
$intro=$s->intro;
$enable_disable=$s->status;
?>
<tr class="odd gradeX">
<td><?=$i;?></td>
<td><?=ucwords($name);?></td>
<td><img src="<?=base_url();?>/<?=$image;?>" width="75px" height="75px"></td>
<td><?=ucwords($intro);?></td>
<td>
<?php
$i=1;
$tag=explode(",", $tags);
foreach($tag as $tg)
{ if($tg!=" "){?>
<i class="label label-sm label-primary" href="javascript::"><?=ucwords($tg);?></i>
</p> <?php } $i++;} ?>
</td>
<td>
<a href="<?=base_url();?>admin/edit-blog/<?=$id;?>" class="btn btn-primary btn-xs " > <!--data-type="1" for edit-->
<i class="fa fa-pencil"></i>
</a>
</td>
<td>
<label class="switch">
<input type="checkbox" id="chkid_<?=$id;?>" <?php if($enable_disable==1) { ?> checked <?php } ?>>
<span class="sliderrr round"></span>
</label>
</td>
</tr>
<?php $i++;} } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php $this->load->view('admin/includes/footer');?>
<script type="text/javascript" src="<?=base_url();?>bassets/admin/js/jquery.cookie.min.js"></script>
<script>
var base_path=$('body').attr('data-path');
$('input[type="checkbox"]').click(function(){
if($(this).prop("checked") == true){
var pri_id=$(this).attr("id");
var sep_id = pri_id.split('_');
var banner_id=sep_id[1];
var del_value="1";
var url23=base_path+"blog/check_uncheck_blog";
$.post(url23,{id:banner_id,val:del_value,csrf_test_name:$.cookie('csrf_cookie_name')},function(res23){
if(res23==1)
{
location.reload();
}
});
}
else if($(this).prop("checked") == false){
var pri_id=$(this).attr("id");
var sep_id = pri_id.split('_');
var banner_id=sep_id[1];
var del_value="0";
var url23=base_path+"blog/check_uncheck_blog";
$.post(url23,{id:banner_id,val:del_value,csrf_test_name:$.cookie('csrf_cookie_name')},function(res23){
if(res23==1)
{
location.reload();
}
});
}
});
</script>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,333 @@
<link href="<?=base_url();?>bassets/select2/css/select2.css" rel="stylesheet" type="text/css" />
<link href="<?=base_url();?>bassets/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />
<?php $this->load->view('admin/includes/header');?>
<div class="page-container">
<?php $this->load->view('admin/includes/sidebar');?>
<!-- start page content -->
<div class="page-content-wrapper">
<div class="page-content">
<div class="page-bar">
<div class="page-title-breadcrumb">
<div class=" pull-left">
<div class="page-title">Category Add</div>
</div>
<ol class="breadcrumb page-breadcrumb pull-right">
<li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.html">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li><a class="parent-item" href="<?=base_url();?>admin/category">Category</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li class="active">Category Add</li>
</ol>
</div>
</div>
<?php $this->load->view('admin/includes/msg');?>
<div class="row">
<div class="col-md-12">
<div class="card card-topline-orange">
<div class="white-box">
<div class="card card-box">
<div class="card-head">
<header>Add Category</header>
</div>
<div class="card-body ">
<?=form_open_multipart(base_url().'category/add_category');?>
<div class="row">
<div class="form-group col-md-6">
<label for="simpleFormEmail"> Name <span class="required">*</span></label>
<input type="text" name="catname" autocomplete="off" class="form-control" data-validation="required" placeholder="Category Name">
</div>
<div class="form-group col-md-6">
<label for="simpleFormEmail"> Icon <span class="required">*</span></label>
<input type="file" name="Image" autocomplete="off" class="form-control" data-validation="required" >
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label for="simpleFormEmail"> Short Description <span class="required">*</span></label>
<textarea type="text" name="short_des" autocomplete="off" class="form-control" data-validation="required" placeholder="Description"></textarea>
</div>
<div class="form-group col-md-6">
<label for="simpleFormEmail">Comparison Fields <span class="required">*</span></label>
<select name="comparefields[]" id="comparefields" multiple="multiple" class="form-control" data-validation="required" >
<?php
if(isset($catcom) && $catcom->num_rows()>0) {
foreach($catcom->result() as $cl){
?><option value="<?=$cl->id;?>"><?=$cl->compare_name;?></option><?php
}
}
?>
</select>
</div>
</div>
<hr>
<h4 style="color:red;text-decoration:underline">Make Questions & Options</h4>
<div class="form-group">
<div class="row">
<div class="form-group col-md-6">
<label for="simpleFormEmail"><i class="fa fa-arrow-right" style="color:#c46210"></i> Questions <span class="required">*</span></label>
<textarea type="text" name="questions[0]" id="questions_0" autocomplete="off" class="form-control" data-validation="required" placeholder="Questions"></textarea>
</div>
<div class="form-group col-md-2">
<label for="simpleFormEmail"> Options Method <span class="required">*</span></label>
<div class="radio p-0">
<input type="radio" name="optionsRadios" class="optionmethod" id="value1_0" value="1" >
<label for="optionsRadios1">
Select One
</label>
</div>
<div class="radio p-0">
<input type="radio" name="optionsRadios" class="optionmethod" id="value2_0" value="2">
<label for="optionsRadios2">
Input field
</label>
</div>
<div class="radio p-0">
<input type="radio" name="optionsRadios" class="optionmethod" id="value3_0" value="3">
<label for="optionsRadios2">
Select Multiple
</label>
</div>
<input type="hidden" name="optionmethods[0]" id="optionmethods_0">
</div>
<div class="col-md-2">
<button type="button" style="margin-top:0px" class="btn btn-primary addButton" >Add Questions</button>
</div>
<div class="col-md-2">
<button type="button" style="margin-top:0px" id="addopt_0" class="btn btn-warning addButton1" >Add Options</button>
</div>
</div>
<div class="row">
<div class="form-group col-md-4">
<div class="form-group col-md-12">
<label for="simpleFormEmail"> Make Options <span class="required">*</span></label>
<input type="text" name="options[0][0]" id="options_00" autocomplete="off" class="form-control" data-validation="required" placeholder="Options">
</div>
</div>
<div class="row form-group col-md-4 form-group2 hide" id="bookTemplate_0">
<div class="form-group col-md-10">
<label for="simpleFormEmail"> Make Options <span class="required">*</span></label>
<input type="text" name="optionsin[][]" id="optionsin" autocomplete="off" class="form-control" data-validation="required" placeholder="Options">
</div>
<div class="col-md-1">
<button type="button" style="margin-top:0px" class="btn btn-danger removeButton1" ><i class="fa fa-minus"></i></button>
</div>
</div>
</div>
</div>
<div class="form-group form-group1 hide" id="bookTemplatehead">
<div class="row">
<div class="form-group col-md-6">
<label for="simpleFormEmail"><i class="fa fa-arrow-right" style="color:#c46210"></i> Questions <span class="required">*</span></label>
<textarea type="text" name="questions[]" id="questions" autocomplete="off" class="form-control" data-validation="required" placeholder="Questions"></textarea>
</div>
<div class="form-group col-md-2">
<label for="simpleFormEmail"> Options Method <span class="required">*</span></label>
<div class="radio p-0">
<input type="radio" name="optionsRadios" class="optionmethod" id="value1" value="1" >
<label for="optionsRadios1">
Select One
</label>
</div>
<div class="radio p-0">
<input type="radio"name="optionsRadios" class="optionmethod" id="value2" value="2">
<label for="optionsRadios2">
Input field
</label>
</div>
<div class="radio p-0">
<input type="radio" name="optionsRadios" class="optionmethod" id="value3" value="3">
<label for="optionsRadios3">
Select Multiple
</label>
</div>
<input type="hidden" name="optionmethods[]" id="optionmethods">
</div>
<div class="col-md-2">
<button type="button" style="margin-top:0px" class="btn btn-danger removeButton" >Remove Questions</button>
</div>
<div class="col-md-2">
<button type="button" style="margin-top:0px" id="addopt" class="btn btn-warning addButton1" >Add Options</button>
</div>
</div>
<div class="row">
<div class="form-group col-md-4">
<div class="form-group col-md-12">
<label for="simpleFormEmail"> Make Options <span class="required">*</span></label>
<input type="text" name="option[][]" id="option" autocomplete="off" class="form-control" data-validation="required" placeholder="Options"></textarea>
</div>
</div>
<div class="row form-group col-md-4 form-group2 hide" id="bookTemplate">
<div class="form-group col-md-10">
<label for="simpleFormEmail"> Make Options <span class="required">*</span></label>
<input type="text" name="optionsin[][]" id="optionsin" autocomplete="off" class="form-control" data-validation="required" placeholder="Options">
</div>
<div class="col-md-1">
<button type="button" style="margin-top:0px" class="btn btn-danger removeButton1" ><i class="fa fa-minus"></i></button>
</div>
</div>
</div>
</div>
<hr>
<h4 style="color:red;text-decoration:underline">Needed Documents for this policy</h4>
<div class="form-group col-md-6">
<label for="simpleFormEmail">Documents <span class="required">*</span></label>
<select name="Documents[]" id="Documents" multiple="multiple" class="form-control" data-validation="required" >
<?php
if(isset($doccom) && $doccom->num_rows()>0) {
foreach($doccom->result() as $dc){
?><option value="<?=$dc->id;?>"><?=$dc->name;?></option><?php
}
}
?>
</select>
</div>
<input type="submit" name="cat" class="btn btn-primary" value="Submit">
<?=form_close();?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--modal -->
<div class="modal fade" id="rolepop" tabindex="-1" role="basic" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="viewdetails">
<img src="<?=base_url();?>bassets/admin/img/process.gif" class="loader-img">
</div>
</div>
</div>
</div>
<?php $this->load->view('admin/includes/footer');?>
<script type="text/javascript" src="<?=base_url();?>bassets/admin/js/jquery.cookie.min.js"></script>
<script src="<?=base_url();?>bassets/select2/js/select2.js"></script>
<script src="<?=base_url();?>bassets/select2/js/select2-init.js"></script>
<script>
sevIndex = 1;
$('body').on('click', '.addButton', function() {
var $template = $('#bookTemplatehead'),
$clone = $template
.clone(true)
.removeClass('hide')
.removeAttr('id')
.attr('data-book-index1', sevIndex)
.insertBefore($template);
// Update the name attributes sev_account
// Update the name attributes sev_account
$clone
.find('[id="questions"]').attr('id', 'questions_' + sevIndex ).end()
.find('[id="optionmethods"]').attr('id', 'optionmethods_' + sevIndex ).end()
.find('[id="value1"]').attr('id', 'value1_' + sevIndex ).end()
.find('[id="value2"]').attr('id', 'value2_' + sevIndex ).end()
.find('[id="value3"]').attr('id', 'value3_' + sevIndex ).end()
.find('[id="option"]').attr('id', 'options_' + sevIndex+0).end()
.find('[name="questions[]"]').attr('name', 'questions['+ sevIndex+']').end()
.find('[name="optionmethods[]"]').attr('name', 'optionmethods['+ sevIndex+']').end()
.find('[name="option[][]"]').attr('name', 'options['+sevIndex+']['+0+']').end()
.find('[id="bookTemplate"]').attr('id', 'bookTemplate_'+sevIndex).end()
.find('[id="addopt"]').attr('id', 'addopt_'+sevIndex).end()
sevIndex++;
})
// Remove button click handler
.on('click', '.removeButton', function() {
var $row = $(this).parents('.form-group1'),
index = $row.attr('data-book-index1');
$row.remove();
});
</script>
<script>
sevIndexx = 0;
$('body').on('click', '.addButton1', function() {
sevIndexx++;
var appendid=$(this).attr('id');
var apid=appendid.split("_");
var rowid=apid[1];
var $template = $('#bookTemplate_'+rowid),
$clone = $template
.clone(true)
.removeClass('hide')
.removeAttr('id')
.attr('data-book-index2', sevIndexx)
.insertBefore($template);
// Update the name attributes sev_account
// Update the name attributes sev_account
$clone
.find('[id="optionsin"]').attr('id', 'options_'+rowid+sevIndexx).end()
.find('[name="optionsin[][]"]').attr('name', 'options['+rowid+']['+sevIndexx+']').end()
})
// Remove button click handler
.on('click', '.removeButton1', function() {
var $row = $(this).parents('.form-group2'),
index = $row.attr('data-book-index2');
$row.remove();
});
</script>
<script>
$(document).ready(function() {
//function to initialize select2
function initializeSelect2(selectElementObj) {
selectElementObj.select2({
width: "100%",
tags: true
});
}
$("#comparefields").each(function() {
initializeSelect2($(this));
});
$("#Documents").each(function() {
initializeSelect2($(this));
});
})
</script>
<script>
$(".optionmethod").on('click',function() {
var id = $(this).attr("id");
var apid=id.split("_");
var idd=apid[1];
var val = $(this).val();
$("#optionmethods_"+idd).val(val);
});
</script>

View File

@ -0,0 +1,75 @@
<?php
if($type==1)
{
if(isset($cat) && $cat->num_rows()>0) {
$rm=$cat->row();
$cmp_id= $rm->id;
$cmp_name= $rm->name;
$icon= $rm->icon;
}?>
<div class="modal-header form-group">
<h4 class="col-md-12 modal-title" style="text-align:center">Edit Category</h4>
</div>
<?=form_open_multipart(base_url().'category/edit_category/'.$cmp_id,array('class'=>'form-horizontal','id'=>'form_add','enctype'=>"multipart/form-data"));?>
<div class="form-body">
<div class="row ">
<div class="col-md-12 form-group">
<div class="col-md-8" style="margin:0px auto;float:none;text-align:left">
<label for="simpleFormEmail" style="text-align:left!important"> Name</label></div>
<div class="col-md-8" style="margin:0px auto;float:none;text-align:center">
<input type="text" name="cmpname" value="<?=$cmp_name;?>" autocomplete="off" class="form-control" data-validation="required" placeholder="Role Name">
</div>
</div>
<div class="col-md-12 form-group">
<div class="col-md-8" style="margin:0px auto;float:none;text-align:left">
<label for="simpleFormEmail" style="text-align:left!important"> Icon</label></div>
<div class="col-md-8" style="margin:0px auto;float:none;text-align:center">
<input type="file" name="Image" autocomplete="off" class="form-control" data-validation="required" placeholder="Role Name">
</div>
</div>
<input type="hidden" name="old_image" value="<?=$icon;?>">
</div>
</div>
<div class="modal-footer col-md-4" style="margin:0px auto;float:none;text-align:center">
<input type="submit" class="btn btn-primary roleupdate" value="Submit" name="cat"/>
<button type="button" class="btn dark btn-outline" data-dismiss="modal">Close</button>
</div>
<?=form_close();?>
<?php
}
if($type==2)
{
if(isset($cat) && $cat->num_rows()>0) {
$rm=$cat->row();
$cmp_id= $rm->id;
$cmp_name= $rm->name;
$icon= $rm->icon;
}?>
<div class="modal-header form-group">
<h4 class="col-md-12 modal-title" style="text-align:center">Delete Category</h4>
</div>
<?=form_open_multipart(base_url().'category/delete_category/'.$cmp_id,array('class'=>'form-horizontal','id'=>'form_add','enctype'=>"multipart/form-data"));?>
<div class="form-body">
<div class="row ">
<div class="col-md-12 form-group">
<div class="col-md-8" style="margin:0px auto;float:none;text-align:center">
<h4 style="color:red">Are you sure you want to delete this ?</h4>
</div>
</div>
</div>
</div>
<div class="modal-footer col-md-4" style="margin:0px auto;float:none;text-align:center">
<input type="submit" class="btn btn-primary roleupdate" value="Yes" name="yes"/>
<button type="button" class="btn dark btn-outline" data-dismiss="modal">No</button>
</div>
<?=form_close();?>
<?php
}

View File

@ -0,0 +1,412 @@
<link href="<?=base_url();?>bassets/select2/css/select2.css" rel="stylesheet" type="text/css" />
<link href="<?=base_url();?>bassets/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />
<?php $this->load->view('admin/includes/header');?>
<div class="page-container">
<?php $this->load->view('admin/includes/sidebar');?>
<!-- start page content -->
<div class="page-content-wrapper">
<div class="page-content">
<div class="page-bar">
<div class="page-title-breadcrumb">
<div class=" pull-left">
<div class="page-title">Category </div>
</div>
<ol class="breadcrumb page-breadcrumb pull-right">
<li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.html">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li><a class="parent-item" href="<?=base_url();?>admin/category">Category</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li class="active">Category Edit</li>
</ol>
</div>
</div>
<?php $this->load->view('admin/includes/msg');?>
<div class="row">
<div class="col-md-12">
<div class="card card-topline-orange">
<div class="white-box">
<div class="card card-box">
<div class="card-head">
<header>Edit Category</header>
</div>
<?php
if(isset($cat)&& $cat->num_rows()>0)
{
$r=$cat->row();
$catid=$r->id;
$catname=$r->name;
$icon=$r->icon;
$short_description=$r->short_description;
}
?>
<div class="card-body ">
<?=form_open_multipart(base_url().'category/edit_category/'.$catid);?>
<div class="row">
<div class="form-group col-md-6">
<label for="simpleFormEmail"> Name <span class="required">*</span></label>
<input type="text" name="cmpname" value="<?=$catname;?>" autocomplete="off" class="form-control" data-validation="required" placeholder="Category Name">
</div>
<div class="form-group col-md-6">
<label for="simpleFormEmail"> Icon </label>
<input type="file" name="Image" autocomplete="off" class="form-control">
</div>
<input type="hidden" name="old_image" value="<?=$icon;?>">
</div>
<div class="row">
<div class="form-group col-md-6">
<label for="simpleFormEmail"> Short Description <span class="required">*</span></label>
<textarea type="text" name="short_des" autocomplete="off" class="form-control" data-validation="required" placeholder="Description"><?=$short_description;?></textarea>
</div>
<?php
$compare=array();
if(isset($com)&& $com->num_rows()>0)
{
foreach($com->result() as $list)
{
$compare[]= $list->compare;
}
}
?>
<div class="form-group col-md-6">
<label for="simpleFormEmail">Comparison Fields <span class="required">*</span></label>
<select name="comparefields[]" id="comparefields" multiple="multiple" class="form-control" data-validation="required" >
<?php
if(isset($catcom) && $catcom->num_rows()>0) {
foreach($catcom->result() as $cl){
$coid= $cl->id;
?><option <?php if(in_array($coid,$compare)){echo "selected";}?> value="<?=$cl->id;?>"><?=$cl->compare_name;?></option><?php
}
}
?>
</select>
</div>
</div>
<hr>
<h4 style="color:red;text-decoration:underline">Needed Documents for this policy</h4>
<?php
$document=array();
if(isset($doc)&& $doc->num_rows()>0)
{
foreach($doc->result() as $lists)
{
$document[]= $lists->document;
}
}
?>
<div class="form-group col-md-6">
<label for="simpleFormEmail">Documents <span class="required">*</span></label>
<select name="Documents[]" id="Documents" multiple="multiple" class="form-control" data-validation="required" >
<?php
if(isset($doccom) && $doccom->num_rows()>0) {
foreach($doccom->result() as $dc){
?><option value="<?=$dc->id;?>" <?php if(in_array($dc->id,$document)){echo "selected";}?>><?=$dc->name;?></option><?php
}
}
?>
</select>
</div>
<hr>
<h4 style="color:red;text-decoration:underline">Make Questions & Options</h4>
<input type="hidden" name="quest_count" id="quest_count" value="<?=$quest->num_rows();?>" >
<?php if(isset($quest)&& $quest->num_rows()>0)
{ $k=0;
foreach($quest->result() as $q){
$primaryid=$q->id;
$question=$q->question;
$option_input_types=$q->option_input_type;
$options=$q->options;
?>
<div class="col-md-12 form-group1">
<input type="hidden" name="hiddenprimary[<?=$k;?>]" value="<?=$primaryid;?>" id="hiddenprimary_<?=$k;?>" >
<div class="row">
<div class="form-group col-md-6">
<label for="simpleFormEmail"><i class="fa fa-arrow-right" style="color:#c46210"></i> Questions <span class="required">*</span></label>
<textarea type="text" name="questions[<?=$k;?>]" id="questions_<?=$k;?>" autocomplete="off" class="form-control" data-validation="required" placeholder="Questions"><?=$question;?></textarea>
</div>
<div class="form-group col-md-2">
<label for="simpleFormEmail"> Options Method <span class="required">*</span></label>
<div class="radio p-0">
<input type="radio" name="optionsRadios<?=$k;?>" class="optionmethod" id="value1_<?=$k;?>" value="1" <?php if($option_input_types==1){?> checked="checked" <?php } ?>>
<label for="optionsRadios1">
Select One
</label>
</div>
<div class="radio p-0">
<input type="radio" name="optionsRadios<?=$k;?>" class="optionmethod" id="value2_<?=$k;?>" value="2" <?php if($option_input_types==2){?> checked="checked" <?php } ?>>
<label for="optionsRadios2">
Input field
</label>
</div>
<div class="radio p-0">
<input type="radio" name="optionsRadios<?=$k;?>" class="optionmethod" id="value3_<?=$k;?>" value="3" <?php if($option_input_types==3){?> checked="checked" <?php } ?>>
<label for="optionsRadios2">
Select Multiple
</label>
</div>
<input type="hidden" name="optionmethods[<?=$k;?>]" value="<?=$option_input_types;?>" id="optionmethods_<?=$k;?>">
</div>
<div class="col-md-2">
<button type="button" style="margin-top:0px" id="<?=$primaryid;?>" class="btn btn-danger removeButton" >Remove Questions</button>
</div>
<div class="col-md-2">
<button type="button" style="margin-top:0px" id="addopt_<?=$k;?>" class="btn btn-warning addButton1" >Add Options</button>
</div>
</div>
<div class="row">
<?php $j=0;
$spec=explode("|", $options);
foreach($spec as $sp)
{ if($sp!=" "){?>
<div class="row form-group form-group2 col-md-4">
<div class="form-group col-md-12">
<label for="simpleFormEmail"> Make Options <span class="required">*</span></label><button type="button" style="margin-top:0px" class="btn btn-danger removeButton1" ><i class="fa fa-minus"></i></button>
<input type="text" name="options[<?=$k;?>][<?=$j;?>]" value="<?=$sp;?>" id="options_<?=$k;?><?=$j;?>" autocomplete="off" class="form-control" data-validation="required" placeholder="Options">
</div>
</div> <?php $j++; } } ?>
<div class="row form-group col-md-4 form-group2 hide" id="bookTemplate_<?=$k;?>">
<div class="form-group col-md-12">
<label for="simpleFormEmail"> Make Options <span class="required">*</span></label><button type="button" style="margin-top:0px" class="btn btn-danger removeButton1" ><i class="fa fa-minus"></i></button>
<input type="text" name="optionsin[][]" id="optionsin" autocomplete="off" class="form-control" data-validation="required" placeholder="Options">
</div>
</div>
</div>
</div>
<?php $k++;} } ?>
<div class="col-md-12 form-group form-group1 hide" id="bookTemplatehead">
<input type="hidden" name="hiddenprimary[]" id="hiddenprimary" >
<div class="row">
<div class="form-group col-md-6">
<label for="simpleFormEmail"><i class="fa fa-arrow-right" style="color:#c46210"></i> Questions <span class="required">*</span></label>
<textarea type="text" name="questions[]" id="questions" autocomplete="off" class="form-control" data-validation="required" placeholder="Questions"></textarea>
</div>
<div class="form-group col-md-2">
<label for="simpleFormEmail"> Options Method <span class="required">*</span></label>
<div class="radio p-0">
<input type="radio" name="optionsRadios" class="optionmethod" id="value1" value="1" >
<label for="optionsRadios1">
Select One
</label>
</div>
<div class="radio p-0">
<input type="radio"name="optionsRadios" class="optionmethod" id="value2" value="2">
<label for="optionsRadios2">
Input field
</label>
</div>
<div class="radio p-0">
<input type="radio" name="optionsRadios" class="optionmethod" id="value3" value="3">
<label for="optionsRadios3">
Select Multiple
</label>
</div>
<input type="hidden" name="optionmethods[]" id="optionmethods">
</div>
<div class="col-md-2">
<button type="button" style="margin-top:0px" class="btn btn-danger removeButton" >Remove Questions</button>
</div>
<div class="col-md-2">
<button type="button" style="margin-top:0px" id="addopt" class="btn btn-warning addButton1" >Add Options</button>
</div>
</div>
<div class="row">
<div class="form-group col-md-4">
<div class="form-group col-md-12">
<label for="simpleFormEmail"> Make Options <span class="required">*</span></label>
<input type="text" name="option[][]" id="option" autocomplete="off" class="form-control" data-validation="required" placeholder="Options"></textarea>
</div>
</div>
<div class="row form-group col-md-4 form-group2 hide" id="bookTemplate">
<div class="form-group col-md-10">
<label for="simpleFormEmail"> Make Options <span class="required">*</span></label>
<input type="text" name="optionsin[][]" id="optionsin" autocomplete="off" class="form-control" data-validation="required" placeholder="Options">
</div>
<div class="col-md-1">
<button type="button" style="margin-top:0px" class="btn btn-danger removeButton1" ><i class="fa fa-minus"></i></button>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="col-md-2" style="float:right;">
<button type="button" style="margin-top:0px" class="btn btn-primary addButton" >Add Questions</button>
</div>
</div>
<input type="submit" name="cat" class="btn btn-primary" value="Submit">
<?=form_close();?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--modal -->
<div class="modal fade" id="rolepop" tabindex="-1" role="basic" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="viewdetails">
<img src="<?=base_url();?>bassets/admin/img/process.gif" class="loader-img">
</div>
</div>
</div>
</div>
<?php $this->load->view('admin/includes/footer');?>
<script type="text/javascript" src="<?=base_url();?>bassets/admin/js/jquery.cookie.min.js"></script>
<script src="<?=base_url();?>bassets/select2/js/select2.js"></script>
<script src="<?=base_url();?>bassets/select2/js/select2-init.js"></script>
<script>
var base_path=$('body').attr('data-path');
sevIndex = $("#quest_count").val();;
$('body').on('click', '.addButton', function() {
var $template = $('#bookTemplatehead'),
$clone = $template
.clone(true)
.removeClass('hide')
.removeAttr('id')
.attr('data-book-index1', sevIndex)
.insertBefore($template);
// Update the name attributes sev_account
// Update the name attributes sev_account
$clone
.find('[id="questions"]').attr('id', 'questions_' + sevIndex ).end()
.find('[id="optionmethods"]').attr('id', 'optionmethods_' + sevIndex ).end()
.find('[id="value1"]').attr('id', 'value1_' + sevIndex ).end()
.find('[id="value2"]').attr('id', 'value2_' + sevIndex ).end()
.find('[id="value3"]').attr('id', 'value3_' + sevIndex ).end()
.find('[id="option"]').attr('id', 'options_' + sevIndex+0).end()
.find('[name="hiddenprimary[]"]').attr('name', 'hiddenprimary['+ sevIndex+']').end()
.find('[name="questions[]"]').attr('name', 'questions['+ sevIndex+']').end()
.find('[name="optionmethods[]"]').attr('name', 'optionmethods['+ sevIndex+']').end()
.find('[name="option[][]"]').attr('name', 'options['+sevIndex+']['+0+']').end()
.find('[id="bookTemplate"]').attr('id', 'bookTemplate_'+sevIndex).end()
.find('[id="addopt"]').attr('id', 'addopt_'+sevIndex).end()
.find('[id="hiddenprimary"]').attr('id', 'hiddenprimary_'+sevIndex).end()
sevIndex++;
})
// Remove button click handler
.on('click', '.removeButton', function() {
var $row = $(this).parents('.form-group1'),
index = $row.attr('data-book-index1');
var rid = $(this).attr("id");
delete_row_minus(rid,$row);
});
function delete_row_minus(rid,$row)
{
if(confirm("Are you sure want to delete this question permanently ...?")){
var url22=base_path+"category/delete_minus_questions";
$.post(url22,{rid:rid,csrf_test_name:$.cookie('csrf_cookie_name')},function(result){
if(result=="1"){
$row.remove();
alert("Successfully Deleted...!");
}else{
alert("Reload your page and try again");
}
});
} else {
return false;
}
}
</script>
<script>
sevIndexx = 0;
$('body').on('click', '.addButton1', function() {
sevIndexx++;
var appendid=$(this).attr('id');
var apid=appendid.split("_");
var rowid=apid[1];
var $template = $('#bookTemplate_'+rowid),
$clone = $template
.clone(true)
.removeClass('hide')
.removeAttr('id')
.attr('data-book-index2', sevIndexx)
.insertBefore($template);
// Update the name attributes sev_account
// Update the name attributes sev_account
$clone
.find('[id="optionsin"]').attr('id', 'options_'+rowid+sevIndexx).end()
.find('[name="optionsin[][]"]').attr('name', 'options['+rowid+']['+sevIndexx+']').end()
})
// Remove button click handler
.on('click', '.removeButton1', function() {
var $row = $(this).parents('.form-group2'),
index = $row.attr('data-book-index2');
$row.remove();
});
</script>
<script>
$(document).ready(function() {
//function to initialize select2
function initializeSelect2(selectElementObj) {
selectElementObj.select2({
width: "100%",
tags: true
});
}
$("#comparefields").each(function() {
initializeSelect2($(this));
});
$("#Documents").each(function() {
initializeSelect2($(this));
});
})
</script>
<script>
$(".optionmethod").on('click',function() {
var id = $(this).attr("id");
var apid=id.split("_");
var idd=apid[1];
var val = $(this).val();
$("#optionmethods_"+idd).val(val);
});
</script>

View File

@ -0,0 +1,125 @@
<?php $this->load->view('admin/includes/header');?>
<div class="page-container">
<?php $this->load->view('admin/includes/sidebar');?>
<!-- start page content -->
<div class="page-content-wrapper">
<div class="page-content">
<div class="page-bar">
<div class="page-title-breadcrumb">
<div class=" pull-left">
<div class="page-title">Category List</div>
</div>
<ol class="breadcrumb page-breadcrumb pull-right">
<li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.html">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li><a class="parent-item" href="#">Category</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li class="active">Category List</li>
</ol>
</div>
</div>
<?php $this->load->view('admin/includes/msg');?>
<div class="row">
<div class="col-md-12">
<div class="card card-topline-orange">
<div class="white-box">
<div class="card card-box">
<div class="card-head">
<header>Category</header>
</div>
<div class="card-body ">
<div class="col-md-6 col-sm-6 col-xs-6" style="float:left">
<div class="btn-group">
<a href="<?=base_url();?>admin/add-category" class="btn btn-info">
Add New <i class="fa fa-plus"></i>
</a>
</div>
</div>
<div class="table-scrollable">
<table class="table table-hover table-checkable order-column full-width" id="example4">
<thead>
<tr>
<th>S no</th>
<th> Name </th>
<th> Icon </th>
<th> Action </th>
</tr>
</thead>
<tbody>
<?php
if(isset($cat)&& $cat->num_rows()>0)
{
$i=1;
foreach($cat->result() as $r)
{
$cmpid=$r->id;
$cmpname=$r->name;
$icon=$r->icon;
?>
<tr class="odd gradeX">
<td><?=$i;?></td>
<td><?=ucwords($cmpname);?></td>
<td><img src="<?=base_url();?>/<?=$icon;?>" width="75px" height="75px"></td>
<td>
<a href="<?=base_url();?>admin/view-category/<?=$cmpid;?>" class="btn btn-primary btn-xs " data-id="<?=$cmpid;?>" data-type="1"> <!--data-type="1" for edit-->
<i class="fa fa-eye"></i>
</a>
<a href="<?=base_url();?>admin/edit-category/<?=$cmpid;?>" class="btn btn-primary btn-xs " data-id="<?=$cmpid;?>" data-type="1"> <!--data-type="1" for edit-->
<i class="fa fa-pencil"></i>
</a>
<a class="btn btn-danger btn-xs cmpeditpop" data-id="<?=$cmpid;?>" data-type="2"> <!--data-type="2" for delete-->
<i class="fa fa-trash-o "></i>
</a>
</td>
</tr>
<?php $i++;} } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--modal -->
<div class="modal fade" id="cmppop" tabindex="-1" role="basic" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="viewdetails">
<img src="<?=base_url();?>bassets/admin/img/process.gif" class="loader-img">
</div>
</div>
</div>
</div>
<?php $this->load->view('admin/includes/footer');?>
<script type="text/javascript" src="<?=base_url();?>bassets/admin/js/jquery.cookie.min.js"></script>
<script>
var base_path=$('body').attr('data-path');
//Common View Edit Specification
$('body').on('click','.cmpeditpop',function(){
//alert("sdadsd");
$('#cmppop').modal('show');
$('.viewdetails').html('<img src='+base_path+'bassets/admin/img/process.gif class="loader-img">');
var type=$(this).attr('data-type');
var id=$(this).attr('data-id');
var url22=base_path+"category/cataction";
$.post(url22,{type:type,id:id,csrf_test_name:$.cookie('csrf_cookie_name')},function(result){
$('.viewdetails').html(result);
});
});
</script>

View File

@ -0,0 +1,124 @@
<link href="<?=base_url();?>bassets/select2/css/select2.css" rel="stylesheet" type="text/css" />
<link href="<?=base_url();?>bassets/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />
<style>
.hearderss{ text-decoration:underline;color:red}
</style>
<?php $this->load->view('admin/includes/header');?>
<div class="page-container">
<?php $this->load->view('admin/includes/sidebar');?>
<!-- start page content -->
<div class="page-content-wrapper">
<div class="page-content">
<div class="page-bar">
<div class="page-title-breadcrumb">
<div class=" pull-left">
<div class="page-title">Category </div>
</div>
<ol class="breadcrumb page-breadcrumb pull-right">
<li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.html">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li><a class="parent-item" href="<?=base_url();?>/admin/category">Category</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li class="active">Category View</li>
</ol>
</div>
</div>
<?php $this->load->view('admin/includes/msg');?>
<div class="row">
<div class="col-md-12">
<div class="card card-topline-orange">
<div class="white-box">
<div class="card card-box">
<div class="card-head">
<header>View Category</header>
</div>
<?php
if(isset($cat)&& $cat->num_rows()>0)
{
$r=$cat->row();
$catid=$r->id;
$catname=$r->name;
$icon=$r->icon;
$short_description=$r->short_description;
}
?>
<div class="card-body ">
<h3 style="font-weight:900;color:#ef7f1a;text-align:center;margin-bottom:10px"><img src="<?=base_url();?>/<?=$icon;?>" ><?=ucwords($catname);?> </h3>
<div class="row" style="margin-top:30px">
<div class="form-group col-md-12">
<h4 for="simpleFormEmail" class="hearderss"> Short Description </h4>
<p> <?=$short_description;?></p>
</div>
<div class="col-md-6">
<h4 for="simpleFormEmail" class="hearderss"> Compariosion Fields </h4>
<?php if(isset($com)&& $com->num_rows()>0)
{ $i=1;
foreach($com->result() as $cd){
$compare=$cd->compare;
$compare_name=$cd->compare_name;
?>
<p style="margin-bottom:5px"> <?=$i." . ".$compare_name;?> </p>
<?php $i++; } } ?>
</div>
<div class="col-md-6">
<h4 for="simpleFormEmail" class="hearderss"> Document Details </h4>
<?php if(isset($doc)&& $doc->num_rows()>0)
{ $i=1;
foreach($doc->result() as $cd){
$document=$cd->document;
$docname=$cd->docname;
?>
<p style="margin-bottom:5px"> <?=$i." . ".$docname;?> </p>
<?php $i++; } } ?>
</div>
<div class="col-md-12">
<h4 for="simpleFormEmail" class="hearderss"> Questions & Options </h4>
<div class="row">
<?php if(isset($quest)&& $quest->num_rows()>0)
{ $i=1;
foreach($quest->result() as $q){
$question=$q->question;
$option_input_type=$q->option_input_type;
$options=$q->options;
?>
<div class="form-group col-md-6">
<h6 style="font-weight:900"> <?=$i." . ".$question;?> </h6>
<?php $j=1;
$spec=explode("|", $options);
foreach($spec as $sp)
{ if($sp!=" "){?>
<p> <?=$sp;?></p> <?php } $j++;} ?>
</div>
<?php $i++; } } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php $this->load->view('admin/includes/footer');?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,76 @@
<?php
if($type==1)
{
if(isset($cmp) && $cmp->num_rows()>0) {
$rm=$cmp->row();
$cmp_id= $rm->id;
$cmp_name= $rm->name;
$logo= $rm->logo;
}?>
<div class="modal-header form-group">
<h4 class="col-md-12 modal-title" style="text-align:center">Edit Company</h4>
</div>
<?=form_open_multipart(base_url().'company/edit_company/'.$cmp_id,array('class'=>'form-horizontal','id'=>'form_add','enctype'=>"multipart/form-data"));?>
<div class="form-body">
<div class="row ">
<div class="col-md-12 form-group">
<div class="col-md-8" style="margin:0px auto;float:none;text-align:left">
<label for="simpleFormEmail" style="text-align:left!important"> Name</label></div>
<div class="col-md-8" style="margin:0px auto;float:none;text-align:center">
<input type="text" name="cmpname" value="<?=$cmp_name;?>" autocomplete="off" class="form-control" data-validation="required" placeholder="Role Name">
</div>
</div>
<div class="col-md-12 form-group">
<div class="col-md-8" style="margin:0px auto;float:none;text-align:left">
<label for="simpleFormEmail" style="text-align:left!important"> Logo</label></div>
<div class="col-md-8" style="margin:0px auto;float:none;text-align:center">
<input type="file" name="Image" autocomplete="off" class="form-control" >
<img src="<?=base_url();?>/<?=$logo;?>" style="width:100px;height:100px" >
</div>
<input type="hidden" name="old_image" value="<?=$logo;?>">
</div>
</div>
</div>
<div class="modal-footer col-md-4" style="margin:0px auto;float:none;text-align:center">
<input type="submit" class="btn btn-primary roleupdate" value="Submit" name="cmp"/>
<button type="button" class="btn dark btn-outline" data-dismiss="modal">Close</button>
</div>
<?=form_close();?>
<?php
}
if($type==2)
{
if(isset($cmp) && $cmp->num_rows()>0) {
$rm=$cmp->row();
$cmp_id= $rm->id;
$cmp_name= $rm->name;
}?>
<div class="modal-header form-group">
<h4 class="col-md-12 modal-title" style="text-align:center">Delete Role</h4>
</div>
<?=form_open_multipart(base_url().'company/delete_company/'.$cmp_id,array('class'=>'form-horizontal','id'=>'form_add','enctype'=>"multipart/form-data"));?>
<div class="form-body">
<div class="row ">
<div class="col-md-12 form-group">
<div class="col-md-8" style="margin:0px auto;float:none;text-align:center">
<h4 style="color:red">Are you sure you want to delete this ?</h4>
</div>
</div>
</div>
</div>
<div class="modal-footer col-md-4" style="margin:0px auto;float:none;text-align:center">
<input type="submit" class="btn btn-primary roleupdate" value="Yes" name="yes"/>
<button type="button" class="btn dark btn-outline" data-dismiss="modal">No</button>
</div>
<?=form_close();?>
<?php
}

View File

@ -0,0 +1,144 @@
<?php $this->load->view('admin/includes/header');?>
<div class="page-container">
<?php $this->load->view('admin/includes/sidebar');?>
<!-- start page content -->
<div class="page-content-wrapper">
<div class="page-content">
<div class="page-bar">
<div class="page-title-breadcrumb">
<div class=" pull-left">
<div class="page-title">Company List</div>
</div>
<ol class="breadcrumb page-breadcrumb pull-right">
<li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.html">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li><a class="parent-item" href="#">Company</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li class="active">Company List</li>
</ol>
</div>
</div>
<?php $this->load->view('admin/includes/msg');?>
<div class="row">
<div class="col-md-7">
<div class="card card-topline-orange">
<div class="white-box">
<div class="card card-box">
<div class="card-head">
<header>Company</header>
</div>
<div class="card-body ">
<div class="table-scrollable">
<table class="table table-hover table-checkable order-column full-width" id="example4">
<thead>
<tr>
<th>S no</th>
<th> Name </th>
<th> Logo </th>
<th> Action </th>
</tr>
</thead>
<tbody>
<?php
if(isset($cmp)&& $cmp->num_rows()>0)
{
$i=1;
foreach($cmp->result() as $r)
{
$cmpid=$r->id;
$cmpname=$r->name;
$logo=$r->logo;
?>
<tr class="odd gradeX">
<td><?=$i;?></td>
<td><?=ucwords($cmpname);?></td>
<td><img src="<?=base_url();?>/<?=$logo;?>" style="width:100px;height:100px" ></td>
<td>
<a class="btn btn-primary btn-xs cmpeditpop" data-id="<?=$cmpid;?>" data-type="1"> <!--data-type="1" for edit-->
<i class="fa fa-pencil"></i>
</a>
<a class="btn btn-danger btn-xs cmpeditpop" data-id="<?=$cmpid;?>" data-type="2"> <!--data-type="2" for delete-->
<i class="fa fa-trash-o "></i>
</a>
</td>
</tr>
<?php $i++;} } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!--add-->
<div class="col-md-5">
<div class="card card-topline-orange">
<div class="white-box">
<div class="card card-box">
<div class="card-head">
<header>Add Company</header>
</div>
<div class="card-body ">
<?=form_open_multipart(base_url().'company/add_company');?>
<div class="form-group">
<label for="simpleFormEmail"> Name</label>
<input type="text" name="cmpname" autocomplete="off" class="form-control" data-validation="required" placeholder="Company Name">
</div>
<div class="form-group ">
<label for="simpleFormEmail"> Logo <span class="required">*</span></label>
<input type="file" name="Image" autocomplete="off" class="form-control" data-validation="required" >
</div>
<input type="submit" name="cmp" class="btn btn-primary" value="Submit">
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--modal -->
<div class="modal fade" id="cmppop" tabindex="-1" role="basic" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="viewdetails">
<img src="<?=base_url();?>bassets/admin/img/process.gif" class="loader-img">
</div>
</div>
</div>
</div>
<?php $this->load->view('admin/includes/footer');?>
<script type="text/javascript" src="<?=base_url();?>bassets/admin/js/jquery.cookie.min.js"></script>
<script>
var base_path=$('body').attr('data-path');
//Common View Edit Specification
$('body').on('click','.cmpeditpop',function(){
//alert("sdadsd");
$('#cmppop').modal('show');
$('.viewdetails').html('<img src='+base_path+'bassets/admin/img/process.gif class="loader-img">');
var type=$(this).attr('data-type');
var id=$(this).attr('data-id');
var url22=base_path+"company/cmpaction";
$.post(url22,{type:type,id:id,csrf_test_name:$.cookie('csrf_cookie_name')},function(result){
$('.viewdetails').html(result);
});
});
</script>

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More