Compare commits

..

1 Commits

Author SHA1 Message Date
RameshT 49b00bd108 Update .husky/pre-commit 2024-08-08 11:30:15 +00:00
9520 changed files with 79881 additions and 1011502 deletions

View File

@ -1,3 +0,0 @@
{
"presets": ["@babel/preset-env"]
}

View File

@ -1,32 +0,0 @@
{
"env": {
"browser": true,
"jquery": true
},
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"plugins": [
"prettier"
],
"extends": [
"eslint:recommended",
"prettier"
],
"rules": {
"prettier/prettier": "error",
"no-undef": "off",
"no-unused-vars": "off"
},
"globals": {
"$": "readonly",
"jQuery": "readonly",
"document": "readonly",
"window": "readonly",
"console": "readonly"
}
}

View File

@ -1,11 +1,6 @@
#!/bin/sh #!/bin/sh
. "$(dirname "$0")/_/husky.sh" . "$(dirname "$0")/_/husky.sh"
# Run JS/CSS checks
.husky/pre-commit-js-css
if [ $? -ne 0 ]; then
echo "JS/CSS checks failed"
exit 1
fi
# Get the list of staged PHP files # Get the list of staged PHP files
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.php$') STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.php$')
@ -62,5 +57,4 @@ for FILE in $STAGED_FILES; do
git add "$FILE" git add "$FILE"
done done
echo "Pre-commit checks completed." echo "Pre-commit checks completed."

View File

@ -1,48 +0,0 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# Get the list of staged JS/CSS files
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(js|jsx|ts|tsx|css|scss)$')
# If there are no staged JS/CSS files, exit
if [ -z "$STAGED_FILES" ]; then
echo "No JS/CSS files staged for commit."
exit 0
fi
# Function to display errors
display_errors() {
local errors="$1"
echo "Errors detected:"
echo "---------------------------------------"
echo "$errors"
echo "---------------------------------------"
}
# Run Prettier
echo "Running Prettier..."
for FILE in $STAGED_FILES; do
npx prettier --write "$FILE"
done
# Run ESLint
echo "Running ESLint..."
ESLINT_ERRORS=0
for FILE in $STAGED_FILES; do
ESLINT_OUTPUT=$(npx eslint "$FILE" 2>&1)
if [ $? -ne 0 ]; then
display_errors "$ESLINT_OUTPUT"
ESLINT_ERRORS=1
fi
done
if [ $ESLINT_ERRORS -ne 0 ]; then
echo "ESLint errors detected. Please fix them before committing."
exit 1
fi
# Add the fixed files back to the staging area
for FILE in $STAGED_FILES; do
git add "$FILE"
done
echo "JS/CSS pre-commit checks completed."

File diff suppressed because one or more lines are too long

View File

@ -1,22 +0,0 @@
# Ignore node_modules directory
node_modules/
# Ignore build directory
build/
# Ignore all minified JavaScript files
*.min.js
# Ignore specific files
public/vendor/jquery.js
public/vendor/bootstrap.js
# Ignore all files in a specific directory
src/vendor/
# Ignore specific file
path/to/specific/file.js
# Ignore all JavaScript files in a specific directory
src/vendor/*.js

View File

@ -1,15 +0,0 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"jsxSingleQuote": true,
"bracketSpacing": true,
"parser": "babel-ts",
"requirePragma": false,
"insertPragma": false,
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "lf",
"embeddedLanguageFormatting": "off"
}

View File

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

View File

@ -1,6 +1,5 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
/* /*
| ------------------------------------------------------------------- | -------------------------------------------------------------------
@ -52,12 +51,12 @@ $autoload['packages'] = array();
| |
| Prototype: | Prototype:
| |
| $autoload['libraries'] = array('database', 'email', 'session'); | $autoload['libraries'] = array('database', 'email', 'session');
| |
| You can also supply an alternative library name to be assigned | You can also supply an alternative library name to be assigned
| in the controller: | in the controller:
| |
| $autoload['libraries'] = array('user_agent' => 'ua'); | $autoload['libraries'] = array('user_agent' => 'ua');
*/ */
$autoload['libraries'] = array('database','form_validation','session','pagination'); $autoload['libraries'] = array('database','form_validation','session','pagination');
@ -72,12 +71,12 @@ $autoload['libraries'] = array('database','form_validation','session','paginatio
| |
| Prototype: | Prototype:
| |
| $autoload['drivers'] = array('cache'); | $autoload['drivers'] = array('cache');
| |
| You can also supply an alternative property name to be assigned in | You can also supply an alternative property name to be assigned in
| the controller: | the controller:
| |
| $autoload['drivers'] = array('cache' => 'cch'); | $autoload['drivers'] = array('cache' => 'cch');
| |
*/ */
$autoload['drivers'] = array(); $autoload['drivers'] = array();
@ -88,7 +87,7 @@ $autoload['drivers'] = array();
| ------------------------------------------------------------------- | -------------------------------------------------------------------
| Prototype: | Prototype:
| |
| $autoload['helper'] = array('url', 'file'); | $autoload['helper'] = array('url', 'file');
*/ */
$autoload['helper'] = array('url','form','text'); $autoload['helper'] = array('url','form','text');
@ -98,7 +97,7 @@ $autoload['helper'] = array('url','form','text');
| ------------------------------------------------------------------- | -------------------------------------------------------------------
| Prototype: | Prototype:
| |
| $autoload['config'] = array('config1', 'config2'); | $autoload['config'] = array('config1', 'config2');
| |
| NOTE: This item is intended for use ONLY if you have created custom | NOTE: This item is intended for use ONLY if you have created custom
| config files. Otherwise, leave it blank. | config files. Otherwise, leave it blank.
@ -112,7 +111,7 @@ $autoload['config'] = array();
| ------------------------------------------------------------------- | -------------------------------------------------------------------
| Prototype: | Prototype:
| |
| $autoload['language'] = array('lang1', 'lang2'); | $autoload['language'] = array('lang1', 'lang2');
| |
| NOTE: Do not include the "_lang" part of your file. For example | NOTE: Do not include the "_lang" part of your file. For example
| "codeigniter_lang.php" would be referenced as array('codeigniter'); | "codeigniter_lang.php" would be referenced as array('codeigniter');
@ -126,11 +125,11 @@ $autoload['language'] = array();
| ------------------------------------------------------------------- | -------------------------------------------------------------------
| Prototype: | Prototype:
| |
| $autoload['model'] = array('first_model', 'second_model'); | $autoload['model'] = array('first_model', 'second_model');
| |
| You can also supply an alternative model name to be assigned | You can also supply an alternative model name to be assigned
| in the controller: | in the controller:
| |
| $autoload['model'] = array('first_model' => 'first'); | $autoload['model'] = array('first_model' => 'first');
*/ */
$autoload['model'] = array(); $autoload['model'] = array();

View File

@ -1,6 +1,5 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -10,7 +9,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
| URL to your CodeIgniter root. Typically this will be your base URL, | URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash: | WITH a trailing slash:
| |
| http://example.com/ | http://example.com/
| |
| WARNING: You MUST set this value! | WARNING: You MUST set this value!
| |
@ -53,7 +52,7 @@ $config['index_page'] = '';
| |
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded! | WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
*/ */
$config['uri_protocol'] = 'REQUEST_URI'; $config['uri_protocol'] = 'REQUEST_URI';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -79,7 +78,7 @@ $config['url_suffix'] = '';
| than english. | than english.
| |
*/ */
$config['language'] = 'english'; $config['language'] = 'english';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -103,7 +102,7 @@ $config['charset'] = 'UTF-8';
| setting this variable to TRUE (boolean). See the user guide for details. | setting this variable to TRUE (boolean). See the user guide for details.
| |
*/ */
$config['enable_hooks'] = false; $config['enable_hooks'] = FALSE;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -127,19 +126,19 @@ $config['subclass_prefix'] = 'MY_';
| Enabling this setting will tell CodeIgniter to look for a Composer | Enabling this setting will tell CodeIgniter to look for a Composer
| package auto-loader script in application/vendor/autoload.php. | package auto-loader script in application/vendor/autoload.php.
| |
| $config['composer_autoload'] = TRUE; | $config['composer_autoload'] = TRUE;
| |
| Or if you have your vendor/ directory located somewhere else, you | Or if you have your vendor/ directory located somewhere else, you
| can opt to set a specific path as well: | can opt to set a specific path as well:
| |
| $config['composer_autoload'] = '/path/to/vendor/autoload.php'; | $config['composer_autoload'] = '/path/to/vendor/autoload.php';
| |
| For more information about Composer, please visit http://getcomposer.org/ | For more information about Composer, please visit http://getcomposer.org/
| |
| Note: This will NOT disable or override the CodeIgniter-specific | Note: This will NOT disable or override the CodeIgniter-specific
| autoloading (application/config/autoload.php) | autoloading (application/config/autoload.php)
*/ */
$config['composer_autoload'] = false; $config['composer_autoload'] = FALSE;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -185,7 +184,7 @@ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
| use segment based URLs. | use segment based URLs.
| |
*/ */
$config['enable_query_strings'] = false; $config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c'; $config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm'; $config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; $config['directory_trigger'] = 'd';
@ -202,7 +201,7 @@ $config['directory_trigger'] = 'd';
| for backwards compatibility purposes! | for backwards compatibility purposes!
| |
*/ */
$config['allow_get_array'] = true; $config['allow_get_array'] = TRUE;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -212,15 +211,15 @@ $config['allow_get_array'] = true;
| You can enable error logging by setting a threshold over zero. The | You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are: | threshold determines what gets logged. Threshold options are:
| |
| 0 = Disables logging, Error logging TURNED OFF | 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors) | 1 = Error Messages (including PHP errors)
| 2 = Debug Messages | 2 = Debug Messages
| 3 = Informational Messages | 3 = Informational Messages
| 4 = All Messages | 4 = All Messages
| |
| You can also pass an array with threshold levels to show individual error types | You can also pass an array with threshold levels to show individual error types
| |
| array(2) = Debug Messages, without Error Messages | array(2) = Debug Messages, without Error Messages
| |
| For a live site you'll usually only enable Errors (1) to be logged otherwise | For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast. | your log files will fill up very fast.
@ -306,15 +305,15 @@ $config['cache_path'] = '';
| Whether to take the URL query string into consideration when generating | Whether to take the URL query string into consideration when generating
| output cache files. Valid options are: | output cache files. Valid options are:
| |
| FALSE = Disabled | FALSE = Disabled
| TRUE = Enabled, take all query parameters into account. | TRUE = Enabled, take all query parameters into account.
| Please be aware that this may result in numerous cache | Please be aware that this may result in numerous cache
| files generated for the same page over and over again. | files generated for the same page over and over again.
| array('q') = Enabled, but only take into account the specified list | array('q') = Enabled, but only take into account the specified list
| of query parameters. | of query parameters.
| |
*/ */
$config['cache_query_string'] = false; $config['cache_query_string'] = FALSE;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -336,49 +335,49 @@ $config['encryption_key'] = '';
| |
| 'sess_driver' | 'sess_driver'
| |
| The storage driver to use: files, database, redis, memcached | The storage driver to use: files, database, redis, memcached
| |
| 'sess_cookie_name' | 'sess_cookie_name'
| |
| The session cookie name, must contain only [0-9a-z_-] characters | The session cookie name, must contain only [0-9a-z_-] characters
| |
| 'sess_samesite' | 'sess_samesite'
| |
| Session cookie SameSite attribute: Lax (default), Strict or None | Session cookie SameSite attribute: Lax (default), Strict or None
| |
| 'sess_expiration' | 'sess_expiration'
| |
| The number of SECONDS you want the session to last. | The number of SECONDS you want the session to last.
| Setting to 0 (zero) means expire when the browser is closed. | Setting to 0 (zero) means expire when the browser is closed.
| |
| 'sess_save_path' | 'sess_save_path'
| |
| The location to save sessions to, driver dependent. | The location to save sessions to, driver dependent.
| |
| For the 'files' driver, it's a path to a writable directory. | For the 'files' driver, it's a path to a writable directory.
| WARNING: Only absolute paths are supported! | WARNING: Only absolute paths are supported!
| |
| For the 'database' driver, it's a table name. | For the 'database' driver, it's a table name.
| Please read up the manual for the format with other session drivers. | Please read up the manual for the format with other session drivers.
| |
| IMPORTANT: You are REQUIRED to set a valid save path! | IMPORTANT: You are REQUIRED to set a valid save path!
| |
| 'sess_match_ip' | 'sess_match_ip'
| |
| Whether to match the user's IP address when reading the session data. | 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 | WARNING: If you're using the database driver, don't forget to update
| your session table's PRIMARY KEY when changing this setting. | your session table's PRIMARY KEY when changing this setting.
| |
| 'sess_time_to_update' | 'sess_time_to_update'
| |
| How many seconds between CI regenerating the session ID. | How many seconds between CI regenerating the session ID.
| |
| 'sess_regenerate_destroy' | 'sess_regenerate_destroy'
| |
| Whether to destroy session data associated with the old session ID | Whether to destroy session data associated with the old session ID
| when auto-regenerating the session ID. When set to FALSE, the data | when auto-regenerating the session ID. When set to FALSE, the data
| will be later deleted by the garbage collector. | will be later deleted by the garbage collector.
| |
| Other session cookie settings are shared with the rest of the application, | Other session cookie settings are shared with the rest of the application,
| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here. | except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
@ -388,10 +387,10 @@ $config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session'; $config['sess_cookie_name'] = 'ci_session';
$config['sess_samesite'] = 'Lax'; $config['sess_samesite'] = 'Lax';
$config['sess_expiration'] = 7200; $config['sess_expiration'] = 7200;
$config['sess_save_path'] = null; $config['sess_save_path'] = NULL;
$config['sess_match_ip'] = false; $config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300; $config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = false; $config['sess_regenerate_destroy'] = FALSE;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -409,12 +408,12 @@ $config['sess_regenerate_destroy'] = false;
| 'cookie_httponly') will also affect sessions. | 'cookie_httponly') will also affect sessions.
| |
*/ */
$config['cookie_prefix'] = ''; $config['cookie_prefix'] = '';
$config['cookie_domain'] = ''; $config['cookie_domain'] = '';
$config['cookie_path'] = '/'; $config['cookie_path'] = '/';
$config['cookie_secure'] = false; $config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = false; $config['cookie_httponly'] = FALSE;
$config['cookie_samesite'] = 'Lax'; $config['cookie_samesite'] = 'Lax';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -428,7 +427,7 @@ $config['cookie_samesite'] = 'Lax';
| for backwards compatibility purposes! | for backwards compatibility purposes!
| |
*/ */
$config['standardize_newlines'] = false; $config['standardize_newlines'] = FALSE;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -442,7 +441,7 @@ $config['standardize_newlines'] = false;
| for backwards compatibility purposes! | for backwards compatibility purposes!
| |
*/ */
$config['global_xss_filtering'] = false; $config['global_xss_filtering'] = FALSE;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -458,11 +457,11 @@ $config['global_xss_filtering'] = false;
| 'csrf_regenerate' = Regenerate token on every submission | 'csrf_regenerate' = Regenerate token on every submission
| 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks | 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks
*/ */
$config['csrf_protection'] = false; $config['csrf_protection'] = FALSE;
$config['csrf_token_name'] = 'csrf_test_name'; $config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name'; $config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200; $config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = true; $config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array(); $config['csrf_exclude_uris'] = array();
/* /*
@ -485,7 +484,7 @@ $config['csrf_exclude_uris'] = array();
| by the output class. Do not 'echo' any values with compression enabled. | by the output class. Do not 'echo' any values with compression enabled.
| |
*/ */
$config['compress_output'] = false; $config['compress_output'] = FALSE;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -512,7 +511,7 @@ $config['time_reference'] = 'local';
| Note: You need to have eval() enabled for this to work. | Note: You need to have eval() enabled for this to work.
| |
*/ */
$config['rewrite_short_tags'] = false; $config['rewrite_short_tags'] = FALSE;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -527,7 +526,7 @@ $config['rewrite_short_tags'] = false;
| You can use both an array or a comma-separated list of proxy addresses, | 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: | as well as specifying whole subnets. Here are a few examples:
| |
| Comma-separated: '10.0.1.200,192.168.5.0/24' | Comma-separated: '10.0.1.200,192.168.5.0/24'
| Array: array('10.0.1.200', '192.168.5.0/24') | Array: array('10.0.1.200', '192.168.5.0/24')
*/ */
$config['proxy_ips'] = ''; $config['proxy_ips'] = '';

View File

@ -1,6 +1,5 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -12,7 +11,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
| of this setting | of this setting
| |
*/ */
defined('SHOW_DEBUG_BACKTRACE') or define('SHOW_DEBUG_BACKTRACE', true); defined('SHOW_DEBUG_BACKTRACE') OR define('SHOW_DEBUG_BACKTRACE', TRUE);
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -27,10 +26,10 @@ defined('SHOW_DEBUG_BACKTRACE') or define('SHOW_DEBUG_BACKTRACE', true);
| always be used to set the mode correctly. | always be used to set the mode correctly.
| |
*/ */
defined('FILE_READ_MODE') or define('FILE_READ_MODE', 0644); defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644);
defined('FILE_WRITE_MODE') or define('FILE_WRITE_MODE', 0666); defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666);
defined('DIR_READ_MODE') or define('DIR_READ_MODE', 0755); defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755);
defined('DIR_WRITE_MODE') or define('DIR_WRITE_MODE', 0755); defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755);
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -40,14 +39,14 @@ defined('DIR_WRITE_MODE') or define('DIR_WRITE_MODE', 0755);
| These modes are used when working with fopen()/popen() | These modes are used when working with fopen()/popen()
| |
*/ */
defined('FOPEN_READ') or define('FOPEN_READ', 'rb'); defined('FOPEN_READ') OR define('FOPEN_READ', 'rb');
defined('FOPEN_READ_WRITE') or define('FOPEN_READ_WRITE', 'r+b'); 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_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_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_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab');
defined('FOPEN_READ_WRITE_CREATE') or define('FOPEN_READ_WRITE_CREATE', 'a+b'); 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_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'); defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -74,13 +73,13 @@ defined('FOPEN_READ_WRITE_CREATE_STRICT') or define('FOPEN_READ_WRITE_CREA
| http://tldp.org/LDP/abs/html/exitcodes.html | http://tldp.org/LDP/abs/html/exitcodes.html
| |
*/ */
defined('EXIT_SUCCESS') or define('EXIT_SUCCESS', 0); // no errors defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors
defined('EXIT_ERROR') or define('EXIT_ERROR', 1); // generic error defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error
defined('EXIT_CONFIG') or define('EXIT_CONFIG', 3); // configuration 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_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_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
defined('EXIT_UNKNOWN_METHOD') or define('EXIT_UNKNOWN_METHOD', 6); // unknown class member 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_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input
defined('EXIT_DATABASE') or define('EXIT_DATABASE', 8); // database error 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_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 defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code

View File

@ -1,39 +1,96 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed');
/** /*
* This file handles the XYZ functionality in the application. | -------------------------------------------------------------------
* @category YourCategory | DATABASE CONNECTIVITY SETTINGS
* @package YourApplication | -------------------------------------------------------------------
* @subpackage YourSubpackage | This file will contain the settings needed to access your database.
* @author Your Name |
* @date YYYY-MM-DD | For complete instructions please consult the 'Database Connection'
* @version 1.0 | page of the User Guide.
*/ |
| -------------------------------------------------------------------
defined('BASEPATH') or exit('No direct script access allowed'); | 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
|
| ['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'; $active_group = 'default';
$query_builder = true; $query_builder = TRUE;
$db['default'] = array( $db['default'] = array(
'dsn' => '', 'dsn' => '',
'hostname' => 'localhost', 'hostname' => 'localhost',
'username' => 'torun', 'username' => 'torun',
'password' => 'thug@NIT20', 'password' => 'thug@NIT20',
'database' => 'google_forms', 'database' => 'google_forms',
'dbdriver' => 'mysqli', 'dbdriver' => 'mysqli',
'dbprefix' => '', 'dbprefix' => '',
'pconnect' => false, 'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'), 'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => false, 'cache_on' => FALSE,
'cachedir' => '', 'cachedir' => '',
'char_set' => 'utf8', 'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci', 'dbcollat' => 'utf8_general_ci',
'swap_pre' => '', 'swap_pre' => '',
'encrypt' => false, 'encrypt' => FALSE,
'compress' => false, 'compress' => FALSE,
'stricton' => false, 'stricton' => FALSE,
'failover' => array(), 'failover' => array(),
'save_queries' => true 'save_queries' => TRUE
); );

View File

@ -1,25 +1,24 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
$_doctypes = array( $_doctypes = array(
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">', '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-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-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">', '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">', '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>', 'html5' => '<!DOCTYPE html>',
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">', '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-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">', '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">', '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">', '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">', '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' => '<!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-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">', '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-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-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-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">' '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

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,5 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -12,7 +11,7 @@ defined('BASEPATH') or exit('No direct script access allowed');
| and disable it back when you're done. | and disable it back when you're done.
| |
*/ */
$config['migration_enabled'] = false; $config['migration_enabled'] = FALSE;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -58,7 +57,7 @@ $config['migration_table'] = 'migrations';
| in your code to have the latest migration. | in your code to have the latest migration.
| |
*/ */
$config['migration_auto_latest'] = false; $config['migration_auto_latest'] = FALSE;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -82,4 +81,4 @@ $config['migration_version'] = 0;
| Also, writing permission is required within the migrations path. | Also, writing permission is required within the migrations path.
| |
*/ */
$config['migration_path'] = APPPATH . 'migrations/'; $config['migration_path'] = APPPATH.'migrations/';

View File

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

View File

@ -1,6 +1,5 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
/* /*
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------
@ -10,6 +9,6 @@ defined('BASEPATH') or exit('No direct script access allowed');
| data are displayed when the Profiler is enabled. | data are displayed when the Profiler is enabled.
| Please see the user guide for info: | Please see the user guide for info:
| |
| https://codeigniter.com/userguide3/general/profiling.html | https://codeigniter.com/userguide3/general/profiling.html
| |
*/ */

View File

@ -1,6 +1,5 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
$route['forms'] = 'home/index4'; $route['forms'] = 'home/index4';
@ -9,7 +8,7 @@ $route['responses/view/(:num)'] = 'Response_submit/viewresponse/$1';
$route['publish/(:num)'] = 'forms/preview/$1'; $route['publish/(:num)'] = 'forms/preview/$1';
$route['default_controller'] = 'Form_controller/index_forms'; $route['default_controller'] = 'Form_controller/index_forms';
$route['404_override'] = ''; $route['404_override'] = '';
$route['translate_uri_dashes'] = false; $route['translate_uri_dashes'] = FALSE;
$route['start'] = 'Form_controller/index_forms'; $route['start'] = 'Form_controller/index_forms';
$route['title_desc'] = 'homepage/title'; $route['title_desc'] = 'homepage/title';
$route['forms/delete/(:any)'] = 'Form_controller/delete/$1'; $route['forms/delete/(:any)'] = 'Form_controller/delete/$1';
@ -26,4 +25,3 @@ $route['response_preview/(:num)'] = 'forms/response_preview/$1';
$route['title'] = 'homepage/title'; $route['title'] = 'homepage/title';
$route['total_responses'] = 'Response_submit/index';

View File

@ -1,6 +1,5 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
/* /*
| ------------------------------------------------------------------- | -------------------------------------------------------------------
@ -16,50 +15,50 @@ defined('BASEPATH') or exit('No direct script access allowed');
*/ */
$smileys = array( $smileys = array(
// smiley image name width height alt // smiley image name width height alt
':-)' => array('grin.gif', '19', '19', 'grin'), ':-)' => array('grin.gif', '19', '19', 'grin'),
':lol:' => array('lol.gif', '19', '19', 'LOL'), ':lol:' => array('lol.gif', '19', '19', 'LOL'),
':cheese:' => array('cheese.gif', '19', '19', 'cheese'), ':cheese:' => array('cheese.gif', '19', '19', 'cheese'),
':)' => array('smile.gif', '19', '19', 'smile'), ':)' => array('smile.gif', '19', '19', 'smile'),
';-)' => array('wink.gif', '19', '19', 'wink'), ';-)' => array('wink.gif', '19', '19', 'wink'),
';)' => array('wink.gif', '19', '19', 'wink'), ';)' => array('wink.gif', '19', '19', 'wink'),
':smirk:' => array('smirk.gif', '19', '19', 'smirk'), ':smirk:' => array('smirk.gif', '19', '19', 'smirk'),
':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'),
':-S' => array('confused.gif', '19', '19', 'confused'), ':-S' => array('confused.gif', '19', '19', 'confused'),
':wow:' => array('surprise.gif', '19', '19', 'surprised'), ':wow:' => array('surprise.gif', '19', '19', 'surprised'),
':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'),
':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'),
'%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'),
';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'),
':P' => array('raspberry.gif', '19', '19', 'raspberry'), ':P' => array('raspberry.gif', '19', '19', 'raspberry'),
':blank:' => array('blank.gif', '19', '19', 'blank stare'), ':blank:' => array('blank.gif', '19', '19', 'blank stare'),
':long:' => array('longface.gif', '19', '19', 'long face'), ':long:' => array('longface.gif', '19', '19', 'long face'),
':ohh:' => array('ohh.gif', '19', '19', 'ohh'), ':ohh:' => array('ohh.gif', '19', '19', 'ohh'),
':grrr:' => array('grrr.gif', '19', '19', 'grrr'), ':grrr:' => array('grrr.gif', '19', '19', 'grrr'),
':gulp:' => array('gulp.gif', '19', '19', 'gulp'), ':gulp:' => array('gulp.gif', '19', '19', 'gulp'),
'8-/' => array('ohoh.gif', '19', '19', 'oh oh'), '8-/' => array('ohoh.gif', '19', '19', 'oh oh'),
':down:' => array('downer.gif', '19', '19', 'downer'), ':down:' => array('downer.gif', '19', '19', 'downer'),
':red:' => array('embarrassed.gif', '19', '19', 'red face'), ':red:' => array('embarrassed.gif', '19', '19', 'red face'),
':sick:' => array('sick.gif', '19', '19', 'sick'), ':sick:' => array('sick.gif', '19', '19', 'sick'),
':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'),
':-/' => array('hmm.gif', '19', '19', 'hmmm'), ':-/' => array('hmm.gif', '19', '19', 'hmmm'),
'>:(' => array('mad.gif', '19', '19', 'mad'), '>:(' => array('mad.gif', '19', '19', 'mad'),
':mad:' => array('mad.gif', '19', '19', 'mad'), ':mad:' => array('mad.gif', '19', '19', 'mad'),
'>:-(' => array('angry.gif', '19', '19', 'angry'), '>:-(' => array('angry.gif', '19', '19', 'angry'),
':angry:' => array('angry.gif', '19', '19', 'angry'), ':angry:' => array('angry.gif', '19', '19', 'angry'),
':zip:' => array('zip.gif', '19', '19', 'zipper'), ':zip:' => array('zip.gif', '19', '19', 'zipper'),
':kiss:' => array('kiss.gif', '19', '19', 'kiss'), ':kiss:' => array('kiss.gif', '19', '19', 'kiss'),
':ahhh:' => array('shock.gif', '19', '19', 'shock'), ':ahhh:' => array('shock.gif', '19', '19', 'shock'),
':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'),
':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'),
':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'),
':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'),
':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'),
':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'),
':vampire:' => array('vampire.gif', '19', '19', 'vampire'), ':vampire:' => array('vampire.gif', '19', '19', 'vampire'),
':snake:' => array('snake.gif', '19', '19', 'snake'), ':snake:' => array('snake.gif', '19', '19', 'snake'),
':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'), ':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'),
':question:' => array('question.gif', '19', '19', 'question') ':question:' => array('question.gif', '19', '19', 'question')
); );

View File

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

View File

@ -1,9 +1,11 @@
<?php <?php
// namespace application\controllers; namespace application\controllers;
defined('BASEPATH') or exit('No direct script access allowed'); defined('BASEPATH') or exit('No direct script access allowed');
// use application\models\Form_model;
class Form extends CI_Controller class Form extends CI_Controller
{ {
public function __construct() public function __construct()
@ -13,7 +15,6 @@ class Form extends CI_Controller
} }
public function submit() public function submit()
{ {
if (!$this->session->userdata('logged_in')) { if (!$this->session->userdata('logged_in')) {
// If not logged in, redirect to login page // If not logged in, redirect to login page
redirect('users/login'); redirect('users/login');

View File

@ -1,9 +1,9 @@
<?php <?php
defined('BASEPATH') or exit('No direct script access allowed'); defined('BASEPATH') or exit('No direct script access allowed');
class Form_controller extends CI_Controller class Form_controller extends CI_Controller
{ {
public function index_forms($form_id = null) public function index_forms($form_id = null)
{ {
$this->load->model('Frontend_model'); $this->load->model('Frontend_model');
@ -25,6 +25,7 @@ class Form_controller extends CI_Controller
$form_title = $form['title']; $form_title = $form['title'];
} }
} }
// Fetch data from models // Fetch data from models
$data['total_forms'] = $this->Form_model->get_total_forms($user_id); $data['total_forms'] = $this->Form_model->get_total_forms($user_id);
$data['published_forms'] = $this->Form_model->get_published_forms($user_id); $data['published_forms'] = $this->Form_model->get_published_forms($user_id);
@ -48,13 +49,12 @@ class Form_controller extends CI_Controller
$this->load->model('Frontend_model'); $this->load->model('Frontend_model');
$this->Frontend_model->deleteForm($id); $this->Frontend_model->deleteForm($id);
$this->session->set_flashdata('status', 'Form data deleted successfully'); $this->session->set_flashdata('status', 'Form data deleted successfully');
redirect('home'); redirect('drafts');
} }
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
$this->load->model('Updation_model'); $this->load->model('Updation_model');
$this->load->model('Form_model');
} }
// Load the form for editing // Load the form for editing
@ -63,11 +63,11 @@ class Form_controller extends CI_Controller
$data['form'] = $this->Updation_model->get_form($form_id); $data['form'] = $this->Updation_model->get_form($form_id);
$data['questions'] = $this->Updation_model->get_questions($form_id); $data['questions'] = $this->Updation_model->get_questions($form_id);
$data['options'] = $this->Updation_model->get_options(); $data['options'] = $this->Updation_model->get_options();
$data['is_published'] = $this->Form_model->get_published_value($form_id);
// $this->load->view('templates/header'); // $this->load->view('templates/header');
$this->load->view('edit_form_view', $data); $this->load->view('edit_form_view', $data);
// $this->load->view('templates/footer'); // $this->load->view('templates/footer');
} }
// Save the edited form // Save the edited form
@ -126,4 +126,5 @@ class Form_controller extends CI_Controller
$this->load->view('templates/footer'); $this->load->view('templates/footer');
} }
} }

View File

@ -10,6 +10,9 @@ class Forms extends CI_Controller
// If not logged in, redirect to login page // If not logged in, redirect to login page
redirect('users/login'); redirect('users/login');
} }
// Load the model that handles the form data // Load the model that handles the form data
$this->load->model('preview_model'); $this->load->model('preview_model');
@ -41,13 +44,13 @@ class Forms extends CI_Controller
redirect('users/login/' . $form_id); redirect('users/login/' . $form_id);
} }
// Load the model that handles the form data // Load the model that handles the form data
$this->load->model('preview_model'); $this->load->model('preview_model');
// Fetch the form details // Fetch the form details
$form = $this->preview_model->get_form($form_id); $form = $this->preview_model->get_form($form_id);
// Check if the form is responsive // Check if the form is responsive
if ($form->is_responsive == 0) { if ($form->is_responsive == 0) {
// Pass a message to the view // Pass a message to the view
$data['message'] = "This form is not accepting responses."; $data['message'] = "This form is not accepting responses.";
@ -55,15 +58,15 @@ class Forms extends CI_Controller
return; return;
} }
// Fetch the questions for the form // Fetch the questions for the form
$questions = $this->preview_model->get_questions($form_id); $questions = $this->preview_model->get_questions($form_id);
// Fetch the options for each question // Fetch the options for each question
foreach ($questions as &$question) { foreach ($questions as &$question) {
$question->options = $this->preview_model->get_options($question->id); $question->options = $this->preview_model->get_options($question->id);
} }
// Pass the data to the view // Pass the data to the view
$data['form'] = $form; $data['form'] = $form;
$data['questions'] = $questions; $data['questions'] = $questions;

View File

@ -1,31 +1,35 @@
<?php <?php
defined('BASEPATH') or exit('No direct script access allowed'); defined('BASEPATH') or exit('No direct script access allowed');
class Homepage extends CI_Controller class Homepage extends CI_Controller
{ {
// index2-default
public function home()
{
$this->load->view('Frontend/header');
$this->load->view('Form_controller/index_forms'); // index2-default
$this->load->view('Frontend/footer'); public function home()
} {
$this->load->view('Frontend/header');
$this->load->view('Form_controller/index_forms');
$this->load->view('Frontend/footer');
}
public function design_form()
{
$this->load->view('templates/forms_ui');
}
public function title()
{
$this->load->view('templates/header');
$this->load->view('templates/form_title');
$this->load->view('templates/footer');
}
public function ui_forms()
{
$this->load->view('templates/forms_ui');
}
public function design_form()
{
$this->load->view('templates/forms_ui');
}
public function title()
{
$this->load->view('templates/header');
$this->load->view('templates/form_title');
$this->load->view('templates/footer');
}
public function ui_forms()
{
$this->load->view('templates/forms_ui');
}
} }

View File

@ -1,9 +1,7 @@
<?php <?php
class New_form extends CI_Controller class New_form extends CI_Controller
{ {
public function create_form() public function create_form() {
{
if (!$this->session->userdata('logged_in')) { if (!$this->session->userdata('logged_in')) {
// If not logged in, redirect to login page // If not logged in, redirect to login page
redirect('users/login'); redirect('users/login');
@ -13,7 +11,7 @@ class New_form extends CI_Controller
$this->form_validation->set_rules('title', 'Title', 'required'); $this->form_validation->set_rules('title', 'Title', 'required');
$this->form_validation->set_rules('description', 'Description', 'required'); $this->form_validation->set_rules('description', 'Description', 'required');
if ($this->form_validation->run() === false) { if ($this->form_validation->run() === FALSE) {
$this->load->view('templates/header'); $this->load->view('templates/header');
$this->load->view('templates/form_title', $data); $this->load->view('templates/form_title', $data);
$this->load->view('templates/footer'); $this->load->view('templates/footer');
@ -25,4 +23,7 @@ class New_form extends CI_Controller
redirect('form/view/' . $form_id); redirect('form/view/' . $form_id);
} }
} }
} }
?>

View File

@ -1,19 +1,22 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed'); class New_form_controller extends CI_Controller {
class New_form_controller extends CI_Controller public function submit_form() {
{
public function submit_form()
{
if (!$this->session->userdata('logged_in')) { if (!$this->session->userdata('logged_in')) {
// If not logged in, redirect to login page // If not logged in, redirect to login page
echo json_encode(['status' => 'error', 'message' => 'User not logged in']); echo json_encode(['status' => 'error', 'message' => 'User not logged in']);
return; return;
}// Decode the formData from the POST request$formData = $this->input->post('formData'); }
// Check if form_id is set in session$formId = $this->session->userdata('form_id');
// Decode the formData from the POST request
$formData = $this->input->post('formData');
// Check if form_id is set in session
$formId = $this->session->userdata('form_id');
if ($formId) { if ($formId) {
// Load the model and save form data$this->load->model('new_form_model'); // Load the model and save form data
$this->load->model('new_form_model');
$saveStatus = $this->new_form_model->save_form_data($formId, $formData); $saveStatus = $this->new_form_model->save_form_data($formId, $formData);
if ($saveStatus) { if ($saveStatus) {
@ -26,3 +29,4 @@ class New_form_controller extends CI_Controller
} }
} }
} }
?>

View File

@ -1,12 +1,10 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed'); class Publish_controller extends CI_Controller {
class Publish_controller extends CI_Controller
{
// Method to publish a form // Method to publish a form
public function publish_form($form_id) public function publish_form($form_id) {
{
// Generate a unique link // Generate a unique link
if (!$this->session->userdata('logged_in')) { if (!$this->session->userdata('logged_in')) {
// If not logged in, redirect to login page // If not logged in, redirect to login page
@ -25,8 +23,7 @@ class Publish_controller extends CI_Controller
} }
// Method to list published forms of a user // Method to list published forms of a user
public function list_user_published_forms() public function list_user_published_forms() {
{
if (!$this->session->userdata('logged_in')) { if (!$this->session->userdata('logged_in')) {
// If not logged in, redirect to login page // If not logged in, redirect to login page
redirect('users/login'); redirect('users/login');
@ -42,8 +39,7 @@ class Publish_controller extends CI_Controller
// Method to unpublish a form // Method to unpublish a form
public function unpublish_form($form_id) public function unpublish_form($form_id) {
{
if (!$this->session->userdata('logged_in')) { if (!$this->session->userdata('logged_in')) {
// If not logged in, redirect to login page // If not logged in, redirect to login page
redirect('users/login'); redirect('users/login');
@ -55,8 +51,7 @@ class Publish_controller extends CI_Controller
// redirect('published_forms'); // redirect('published_forms');
} }
public function toggle_responsive($form_id) public function toggle_responsive($form_id) {
{
if (!$this->session->userdata('logged_in')) { if (!$this->session->userdata('logged_in')) {
redirect('users/login'); redirect('users/login');
} }
@ -81,4 +76,6 @@ class Publish_controller extends CI_Controller
echo json_encode(['success' => false, 'message' => 'Failed to update']); echo json_encode(['success' => false, 'message' => 'Failed to update']);
} }
} }
} }

View File

@ -1,9 +1,7 @@
<?php <?php
class Response_submit extends CI_Controller {
class Response_submit extends CI_Controller public function view($form_id) {
{
public function view($form_id)
{
$this->load->model('Response_model'); $this->load->model('Response_model');
$data['form'] = $this->Response_model->get_form($form_id); $data['form'] = $this->Response_model->get_form($form_id);
@ -19,8 +17,7 @@ class Response_submit extends CI_Controller
redirect('responses/' . $form_id); redirect('responses/' . $form_id);
} }
public function view_responses($form_id) public function view_responses($form_id) {
{
$this->load->model('Response_model'); $this->load->model('Response_model');
$data['form'] = $this->Response_model->get_form($form_id); $data['form'] = $this->Response_model->get_form($form_id);
@ -32,8 +29,7 @@ class Response_submit extends CI_Controller
} }
public function submit_form() public function submit_form() {
{
$this->load->model('Response_model'); $this->load->model('Response_model');
$responses = $this->input->post('responses'); $responses = $this->input->post('responses');
$user_id = $this->session->userdata('user_id'); // Assuming user_id is stored in session $user_id = $this->session->userdata('user_id'); // Assuming user_id is stored in session
@ -56,7 +52,7 @@ class Response_submit extends CI_Controller
} else { } else {
$answered_text = $response['options']; $answered_text = $response['options'];
} }
} elseif (isset($response['answered_text'])) { } else if (isset($response['answered_text'])) {
$answered_text = $response['answered_text']; $answered_text = $response['answered_text'];
} }
@ -74,99 +70,60 @@ class Response_submit extends CI_Controller
} }
// Method to list responses for a form // Method to list responses for a form
public function list_responses($form_id) public function list_responses($form_id) {
{ $this->load->model('Response_model');
$this->load->model('Response_model'); $data['form'] = $this->Response_model->get_form($form_id);
$data['form'] = $this->Response_model->get_form($form_id); $data['responses'] = $this->Response_model->get_responses($form_id);
$data['responses'] = $this->Response_model->get_responses($form_id);
$this->load->view('Frontend/header'); $this->load->view('Frontend/header');
$this->load->view('responses_list_view', $data); $this->load->view('responses_list_view', $data);
$this->load->view('Frontend/footer'); $this->load->view('Frontend/footer');
}
// Method to view questions and answers for a specific response
public function viewresponse($response_id)
{
$this->load->model('Response_model');
$data['response'] = $this->Response_model->get_response($response_id);
$data['form'] = $this->Response_model->get_form_by_response($response_id); // Get form details
$data['questions_and_answers'] = $this->Response_model->get_questions_and_answers($response_id);
$this->load->view('templates/header');
$this->load->view('response_details_view', $data);
$this->load->view('templates/footer');
}
public function summary($form_id)
{
$this->load->model('Form_model');
$this->load->model('Response_model');
// Check if the user is logged in
if (!$this->session->userdata('logged_in')) {
redirect('users/login');
} }
// Fetch form details // Method to view questions and answers for a specific response
$form = $this->Form_model->get_form_by_id($form_id); public function viewresponse($response_id) {
if (!$form) { $this->load->model('Response_model');
show_404(); $data['response'] = $this->Response_model->get_response($response_id);
$data['form'] = $this->Response_model->get_form_by_response($response_id); // Get form details
$data['questions_and_answers'] = $this->Response_model->get_questions_and_answers($response_id);
$this->load->view('templates/header');
$this->load->view('response_details_view', $data);
$this->load->view('templates/footer');
} }
// Fetch summary data public function summary($form_id)
$summary_data = $this->Response_model->get_summary_data($form_id); {
$this->load->model('Form_model');
$this->load->model('Response_model');
$data['form'] = $form; // Check if the user is logged in
$data['summary_data'] = $summary_data; if (!$this->session->userdata('logged_in')) {
redirect('users/login');
$this->load->view('Forms/summary', $data);
} }
// Fetch form details
public function __construct() $form = $this->Form_model->get_form_by_id($form_id);
{ if (!$form) {
parent::__construct(); show_404();
$this->load->model('response_model');
} }
public function index() // Fetch summary data
{ $summary_data = $this->Response_model->get_summary_data($form_id);
$data['responses'] = $this->response_model->get_responses_with_details();
$this->load->view('templates/header'); $data['form'] = $form;
$this->load->view('allresponse_details_view', $data); $data['summary_data'] = $summary_data;
$this->load->view('templates/footer');
} $this->load->view('templates/header');
public function response_summary() $this->load->view('Forms/summary', $data);
{ $this->load->view('templates/footer');
$data['forms'] = $this->Response_model->get_forms(); }
$this->load->view('templates/header');
$this->load->view('responses/response_summary', $data);
$this->load->view('templates/footer');
}
public function response_summary_by_form($form_id)
{
$responses = $this->Response_model->get_response_summary_by_form($form_id);
$data = $this->prepare_data($responses);
$data['form_id'] = $form_id;
$this->load->view('templates/header');
$this->load->view('responses/summary', $data);
$this->load->view('templates/footer');
}
private function prepare_data($responses)
{
$data = [];
foreach ($responses as $response) {
$question_text = $response->question_text;
if (!isset($data[$question_text])) {
$data[$question_text] = ['type' => $response->question_type, 'answers' => []];
}
$data[$question_text]['answers'][] = $response->answer_text;
}
return $data;
}
} }

View File

@ -1,5 +1,4 @@
<?php <?php
class Users extends CI_Controller class Users extends CI_Controller
{ {
//signup user //signup user
@ -11,7 +10,7 @@ class Users extends CI_Controller
$this->form_validation->set_rules('password', 'Password', 'required'); $this->form_validation->set_rules('password', 'Password', 'required');
$this->form_validation->set_rules('password2', 'Confirm Passsword', 'matches[password]'); $this->form_validation->set_rules('password2', 'Confirm Passsword', 'matches[password]');
if ($this->form_validation->run() === false) { if ($this->form_validation->run() === FALSE) {
$this->load->view('templates/header'); $this->load->view('templates/header');
$this->load->view('users/register', $data); $this->load->view('users/register', $data);
$this->load->view('templates/footer'); $this->load->view('templates/footer');
@ -26,6 +25,7 @@ class Users extends CI_Controller
$this->session->set_flashdata('user_registered', 'You are now registered and can log in'); $this->session->set_flashdata('user_registered', 'You are now registered and can log in');
redirect('start'); redirect('start');
} }
} }
@ -38,7 +38,7 @@ class Users extends CI_Controller
$this->form_validation->set_rules('username', 'Username', 'required'); $this->form_validation->set_rules('username', 'Username', 'required');
$this->form_validation->set_rules('password', 'Password', 'required'); $this->form_validation->set_rules('password', 'Password', 'required');
if ($this->form_validation->run() === false) { if ($this->form_validation->run() === FALSE) {
$this->load->view('templates/header'); $this->load->view('templates/header');
$this->load->view('users/login', $data); $this->load->view('users/login', $data);
$this->load->view('templates/footer'); $this->load->view('templates/footer');
@ -85,6 +85,7 @@ class Users extends CI_Controller
$this->session->set_flashdata('user_loggedout', 'You are now logged out'); $this->session->set_flashdata('user_loggedout', 'You are now logged out');
redirect('users/login'); redirect('users/login');
} }
// check if username exists // check if username exists
public function check_username_exists($username) public function check_username_exists($username)
@ -121,3 +122,6 @@ class Users extends CI_Controller
// } // }
// } // }
} }
?>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,10 +1,8 @@
<?php <?php
class Create_model extends CI_Model {
class Create_model extends CI_Model public function details() {
{
public function details()
{
// Retrieve user_id from session // Retrieve user_id from session
$user_id = $this->session->userdata('user_id'); $user_id = $this->session->userdata('user_id');
@ -22,6 +20,8 @@ class Create_model extends CI_Model
$formId = $this->db->insert_id(); $formId = $this->db->insert_id();
$this->session->set_userdata('form_id', $formId); $this->session->set_userdata('form_id', $formId);
return $formId; return $formId;
} }
} }
?>

View File

@ -1,22 +1,9 @@
<?php <?php
defined('BASEPATH') or exit('No direct script access allowed'); defined('BASEPATH') or exit('No direct script access allowed');
class Form_model extends CI_Model class Form_model extends CI_Model
{ {
public function get_published_value($form_id)
{
$this->db->select('is_published');
$this->db->from('forms'); // Adjust 'forms' to your table name
$this->db->where('id', $form_id);
$query = $this->db->get();
if ($query->num_rows() > 0) {
return $query->row()->is_published;
} else {
return null; // or 0 or another default value if you prefer
}
}
// Function to get form details by ID // Function to get form details by ID
public function get_form_by_id($form_id) public function get_form_by_id($form_id)
{ {
@ -26,16 +13,14 @@ class Form_model extends CI_Model
return $query->row(); return $query->row();
} }
// Get the total number of forms // Get the total number of forms
public function get_total_forms($user_id) public function get_total_forms($user_id) {
{
// Ensure user_id is passed as a parameter and used in the query // Ensure user_id is passed as a parameter and used in the query
$this->db->where('user_id', $user_id); $this->db->where('user_id', $user_id);
return $this->db->count_all_results('forms'); // Use count_all_results to ensure WHERE conditions are applied return $this->db->count_all_results('forms'); // Use count_all_results to ensure WHERE conditions are applied
} }
// Function to count published forms // Function to count published forms
public function get_published_forms($user_id) public function get_published_forms($user_id) {
{
// Ensure user_id and is_published are passed as parameters and used in the query // Ensure user_id and is_published are passed as parameters and used in the query
$this->db->where('user_id', $user_id); $this->db->where('user_id', $user_id);
$this->db->where('is_published', 1); $this->db->where('is_published', 1);
@ -80,7 +65,7 @@ class Form_model extends CI_Model
$this->db->trans_complete(); $this->db->trans_complete();
if ($this->db->trans_status() === false) { if ($this->db->trans_status() === FALSE) {
return false; return false;
} else { } else {
return true; return true;

View File

@ -1,10 +1,8 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed'); class Frontend_model extends CI_Model {
class Frontend_model extends CI_Model
{
public function getforms() public function getforms()
{ {
// Get the user_id from session // Get the user_id from session
@ -23,21 +21,21 @@ class Frontend_model extends CI_Model
return $query->result(); // Return the result as an array of objects return $query->result(); // Return the result as an array of objects
} }
public function deleteForm($id) public function deleteForm($id){
{
return $this->db->delete('forms', ['id' => $id]); return $this->db->delete('forms', ['id' => $id]);
} }
public function getFormById($form_id) public function getFormById($form_id)
{ {
$query = $this->db->get_where('forms', ['id' => $form_id]); $query = $this->db->get_where('forms', ['id' => $form_id]);
return $query->row_array(); return $query->row_array();
} }
public function getforms_draft($user_id) public function getforms_draft($user_id) {
{ $this->db->where('is_published', 0);
$this->db->where('is_published', 0); $this->db->where('user_id', $user_id);
$this->db->where('user_id', $user_id); $this->db->order_by('created_at', 'DESC');
$this->db->order_by('created_at', 'DESC'); $query = $this->db->get('forms');
$query = $this->db->get('forms'); return $query->result();
return $query->result(); }
}
} }

View File

@ -1,9 +1,7 @@
<?php <?php
class New_form_model extends CI_Model {
class New_form_model extends CI_Model public function save_form_data($formId, $formData) {
{
public function save_form_data($formId, $formData)
{
if (!$formId || !isset($formData['questions'])) { if (!$formId || !isset($formData['questions'])) {
return false; // Handle error if formId is not valid or questions are missing return false; // Handle error if formId is not valid or questions are missing
} }
@ -38,4 +36,7 @@ class New_form_model extends CI_Model
return true; // Return true indicating success return true; // Return true indicating success
} }
} }
?>

View File

@ -1,25 +1,22 @@
<?php <?php
class preview_model extends CI_Model {
class preview_model extends CI_Model public function get_form($form_id) {
{
public function get_form($form_id)
{
$this->db->where('id', $form_id); $this->db->where('id', $form_id);
$query = $this->db->get('forms'); $query = $this->db->get('forms');
return $query->row(); return $query->row();
} }
public function get_questions($form_id) public function get_questions($form_id) {
{
$this->db->where('form_id', $form_id); $this->db->where('form_id', $form_id);
$query = $this->db->get('questions'); $query = $this->db->get('questions');
return $query->result(); // Ensure this returns objects with the 'is_required' field return $query->result(); // Ensure this returns objects with the 'is_required' field
} }
public function get_options($question_id) public function get_options($question_id) {
{
$this->db->where('question_id', $question_id); $this->db->where('question_id', $question_id);
$query = $this->db->get('options'); $query = $this->db->get('options');
return $query->result(); // Ensure this returns the options related to the question return $query->result(); // Ensure this returns the options related to the question
} }
} }

View File

@ -1,21 +1,19 @@
<?php <?php
class Publish_model extends CI_Model {
// Method to update form details including is_published status
public function update_form($form_id, $data) {
$this->db->where('id', $form_id);
return $this->db->update('forms', $data);
}
// Method to retrieve published forms by user
public function get_published_forms_by_user($user_id) {
$this->db->where('user_id', $user_id);
$this->db->where('is_published', 1);
$this->db->order_by('id', 'DESC'); // Order by id column, most recent first
$query = $this->db->get('forms');
return $query->result();
}
class Publish_model extends CI_Model
{
// Method to update form details including is_published status
public function update_form($form_id, $data)
{
$this->db->where('id', $form_id);
return $this->db->update('forms', $data);
}
// Method to retrieve published forms by user
public function get_published_forms_by_user($user_id)
{
$this->db->where('user_id', $user_id);
$this->db->where('is_published', 1);
$this->db->order_by('id', 'DESC'); // Order by id column, most recent first
$query = $this->db->get('forms');
return $query->result();
}
} }

View File

@ -1,15 +1,12 @@
<?php <?php
class Response_model extends CI_Model class Response_model extends CI_Model
{ {
public function __construct() public function __construct() {
{
$this->load->database(); $this->load->database();
} }
// Get the total number of responses // Get the total number of responses
public function get_total_responses($user_id) public function get_total_responses($user_id) {
{
// Join the responses table with the forms table // Join the responses table with the forms table
$this->db->select('responses.id'); $this->db->select('responses.id');
$this->db->from('responses'); $this->db->from('responses');
@ -171,58 +168,5 @@ class Response_model extends CI_Model
return $summary_data; return $summary_data;
} }
public function get_responses_with_details()
{
// Fetch responses with form title, submission time, and user email
$this->db->select('responses.id as response_id, forms.title as form_title, responses.submitted_at, users.email');
$this->db->from('responses');
$this->db->join('forms', 'responses.form_id = forms.id');
$this->db->join('users', 'responses.user_id = users.id');
$this->db->order_by('responses.submitted_at', 'DESC');
$responses_query = $this->db->get();
$responses = $responses_query->result();
$response_details = [];
foreach ($responses as $response) {
// Fetch questions and answers for each response
$this->db->select('questions.text, response_answers.answered_text');
$this->db->from('response_answers');
$this->db->join('questions', 'response_answers.question_id = questions.id');
$this->db->where('response_answers.response_id', $response->response_id);
$questions_query = $this->db->get();
$questions_and_answers = $questions_query->result();
if (!isset($response_details[$response->form_title])) {
$response_details[$response->form_title] = [];
}
$response_details[$response->form_title][] = [
'submitted_at' => $response->submitted_at,
'email' => $response->email,
'questions_and_answers' => $questions_and_answers
];
}
return $response_details;
}
public function get_response_summary_by_form($form_id)
{
$this->db->select('questions.text as question_text, answers.text as answer_text, questions.type as question_type');
$this->db->from('responses');
$this->db->join('answers', 'responses.id = answers.response_id');
$this->db->join('questions', 'answers.question_id = questions.id');
$this->db->where('responses.form_id', $form_id);
$query = $this->db->get();
return $query->result();
}
public function get_forms()
{
$this->db->select('id, title');
$this->db->from('forms');
$query = $this->db->get();
return $query->result();
}
} }

View File

@ -1,7 +1,7 @@
<?php <?php
class Updation_model extends CI_Model class Updation_model extends CI_Model
{ {
public function get_form($form_id) public function get_form($form_id)
{ {
$this->db->where('id', $form_id); $this->db->where('id', $form_id);
@ -9,7 +9,6 @@ class Updation_model extends CI_Model
return $query->row_array(); return $query->row_array();
} }
public function get_questions($form_id) public function get_questions($form_id)
{ {
$this->db->where('form_id', $form_id); $this->db->where('form_id', $form_id);
@ -91,4 +90,8 @@ class Updation_model extends CI_Model
$this->db->delete('options'); $this->db->delete('options');
} }
} }
} }
?>

View File

@ -1,48 +1,49 @@
<?php <?php
class User_model extends CI_Model{
public function register($enc_password){
$data = array(
'email'=> $this->input->post('email'),
'username'=> $this->input->post('username'),
'password'=> $enc_password
);
class User_model extends CI_Model return $this->db->insert('users', $data);
{
public function register($enc_password)
{
$data = array(
'email' => $this->input->post('email'),
'username' => $this->input->post('username'),
'password' => $enc_password
);
return $this->db->insert('users', $data);
} }
public function login($username, $password) public function login($username,$password){
{ $this->db->where('username',$username);
$this->db->where('username', $username); $this->db->where('password',$password);
$this->db->where('password', $password);
$result = $this->db->get('users'); $result = $this->db->get('users');
if ($result->num_rows() == 1) { if($result->num_rows()==1){
return $result->row(0)->id; return $result->row(0)->id;
} else { }
return false; else{
} return false;
}
} }
public function check_username_exists($username) public function check_username_exists($username){
{ $query = $this->db->get_where('users',array('username'=>$username));
$query = $this->db->get_where('users', array('username' => $username)); if(empty($query->row_array())){
if (empty($query->row_array())) { return true;
return true;
} else {
return false;
}
}
public function check_email_exists($email)
{
$query = $this->db->get_where('users', array('email' => $email));
if (empty($query->row_array())) {
return true;
} else {
return false;
}
} }
else{
return false;
} }
}
public function check_email_exists($email){
$query = $this->db->get_where('users',array('email'=>$email));
if(empty($query->row_array())){
return true;
}
else{
return false;
}
}
}
?>

View File

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

View File

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

View File

@ -28,16 +28,16 @@
</div> </div>
<div class="card-body"> <div class="card-body">
<div id="charts"> <div id="charts">
<?php foreach ($summary_data as $question) : ?> <?php foreach ($summary_data as $question): ?>
<h5><?php echo $question['text']; ?></h5> <h5><?php echo $question['text']; ?></h5>
<?php if (is_array($question['answers'])) : ?> <?php if (is_array($question['answers'])): ?>
<div class="chart-container"> <div class="chart-container">
<canvas id="chart-<?php echo $question['question_id']; ?>"></canvas> <canvas id="chart-<?php echo $question['question_id']; ?>"></canvas>
</div> </div>
<?php else : ?> <?php else: ?>
<div class="short-answer"> <div class="short-answer">
<ul> <ul>
<?php foreach ($question['answers'] as $answer) : ?> <?php foreach ($question['answers'] as $answer): ?>
<li><?php echo $answer; ?></li> <li><?php echo $answer; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>

View File

@ -21,7 +21,7 @@
<div class="col-md-12 mt-4"> <div class="col-md-12 mt-4">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<?php if ($this->session->flashdata('status')) : ?> <?php if ($this->session->flashdata('status')): ?>
<div class="alert alert-success"> <div class="alert alert-success">
<?= $this->session->flashdata('status'); ?> <?= $this->session->flashdata('status'); ?>
</div> </div>
@ -32,7 +32,7 @@
<table id="basetable1" class="table table-bordered"> <table id="basetable1" class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>Serial No.</th> <th>Drafts</th>
<th>Title</th> <th>Title</th>
<th>Created On</th> <th>Created On</th>
<th>Edit</th> <th>Edit</th>
@ -43,7 +43,7 @@
<tbody> <tbody>
<?php <?php
$serialNumber = 1; // Initialize the counter variable $serialNumber = 1; // Initialize the counter variable
foreach ($forms as $row) : ?> foreach ($forms as $row): ?>
<tr> <tr>
<td><?php echo $serialNumber++; ?></td> <td><?php echo $serialNumber++; ?></td>
<td class="title-column"><?php echo $row->title; ?></td> <td class="title-column"><?php echo $row->title; ?></td>

View File

@ -1,18 +1,12 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<!-- Other head elements --> <!-- Other head elements -->
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form List</title> <title>Form List</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<!-- <link rel="stylesheet" href="styles.css"> --> <!-- <link rel="stylesheet" href="styles.css"> -->
<link rel="stylesheet" href=" < ?php echo base_url(); ?>assets/css/header_styles.css">
<style> <style>
/* CSS styles */ /* CSS styles */
.title-column { .title-column {
@ -41,20 +35,15 @@
} }
.card-title { .card-title {
color: rgb(103, 58, 183); color: rgb(103, 58, 183); /* Match the color theme */
/* Match the color theme */
margin-bottom: 10px; margin-bottom: 10px;
font-size: 20px; font-size: 20px; /* Increase the font size of the title */
/* Increase the font size of the title */ font-weight: bold; /* Make the title bold */
font-weight: bold;
/* Make the title bold */
} }
.card-text { .card-text {
font-size: 28px; font-size: 28px; /* Increase the font size */
/* Increase the font size */ font-weight: bold; /* Make the text bold */
font-weight: bold;
/* Make the text bold */
} }
.card-text.green { .card-text.green {
@ -76,56 +65,16 @@
.card-text.purple { .card-text.purple {
color: #6f42c1; color: #6f42c1;
} }
.btn-icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 25px;
height: 25px;
/* background-color: rgb(103, 58, 183); */
border-radius: 4px;
color: white;
text-decoration: none;
font-size: 16px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
margin: 0 5px;
position: relative;
}
.btn-icon:hover {
background-color: rgba(255, 255, 255, 0.2);
transform: scale(1.1);
box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}
.btn-icon.disabled {
background-color: #ccc;
color: #888;
cursor: not-allowed;
box-shadow: none;
pointer-events: none;
}
.btn-icon.disabled:hover {
background-color: #ccc;
transform: none;
}
</style> </style>
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="card card-stats"> <div class="card card-stats">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">Total Forms Created</h5> <h5 class="card-title">Total Forms Created</h5>
<p class="card-text" id="total-forms"> <p class="card-text" id="total-forms"><?php echo $total_forms; ?></p>
<?php echo $total_forms; ?>
</p>
</div> </div>
</div> </div>
</div> </div>
@ -133,8 +82,7 @@
<div class="card card-stats"> <div class="card card-stats">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">Published Forms</h5> <h5 class="card-title">Published Forms</h5>
<p class="card-text" id="published-forms"> <p class="card-text" id="published-forms"><?php echo $published_forms; ?></p>
<?php echo $published_forms; ?></p>
</div> </div>
</div> </div>
</div> </div>
@ -142,8 +90,7 @@
<div class="card card-stats"> <div class="card card-stats">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">Responses Submitted</h5> <h5 class="card-title">Responses Submitted</h5>
<p class="card-text" id="total-responses"> <p class="card-text" id="total-responses"><?php echo $total_responses; ?></p>
<?php echo $total_responses; ?></p>
</div> </div>
</div> </div>
</div> </div>
@ -154,10 +101,10 @@
<div class="col-md-12 mt-4 "> <div class="col-md-12 mt-4 ">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<?php if ($this->session->flashdata('status')) : ?> <?php if ($this->session->flashdata('status')): ?>
<div class="alert alert-success"> <div class="alert alert-success">
<?= $this->session->flashdata('status'); ?> <?= $this->session->flashdata('status'); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<h3>List of Forms</h3> <h3>List of Forms</h3>
</div> </div>
@ -166,69 +113,34 @@
<table id="basetable1" class="table table-bordered"> <table id="basetable1" class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>Serial No.</th> <th>Forms</th>
<th>Title</th> <th>Title</th>
<th>Description</th> <th>Description</th>
<th>Created On</th> <th>Created On</th>
<th>Status</th> <th>Status</th>
<th>Actions</th>
<th>Responses</th> <th>Responses</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
$serialNumber = 1; // Initialize the counter variable $serialNumber = 1; // Initialize the counter variable
foreach ($forms as $row) : ?> foreach ($forms as $row): ?>
<tr <tr class="<?php echo ($row->is_published ? '' : 'draft-row'); ?>">
class="<?php echo($row->is_published ? '' : 'draft-row'); ?>"> <td><?php echo $serialNumber++; ?></td>
<td><?php echo $serialNumber++; ?> <td class="title-column">
</td> <a href="<?php echo base_url('publish/' . $row->id); ?>"><?php echo $row->title; ?></a>
<td class="title-column"> </td>
<a <td><?php echo $row->description; ?></td>
href="<?php echo base_url('publish/' . $row->id); ?>"><?php echo $row->title; ?></a> <td><?php echo $row->created_at; ?></td>
</td> <td style="color: <?php echo ($row->is_published ? '#006400' : 'red'); ?>;">
<td><?php echo $row->description; ?> <?php echo ($row->is_published ? 'Published' : 'Draft'); ?>
</td> </td>
<td><?php echo $row->created_at; ?> <td>
</td> <a href="<?php echo base_url('responses/' . $row->id); ?>">
<td <i class="fas fa-eye"></i> <!-- Eye icon -->
style="color: <?php echo($row->is_published ? '#006400' : 'red'); ?>;"> </a>
<?php echo($row->is_published ? 'Published' : 'Draft'); ?> </td>
</td> </tr>
<td>
<?php if ($row->is_published == 0) : ?>
<!-- Buttons are enabled -->
<a href="<?php echo base_url('edit/' . $row->id); ?>"
class="btn-icon" title="Edit">
<i class="fas fa-edit"></i> <!-- For Font Awesome -->
</a>
<a href="<?php echo base_url('forms/delete/' . $row->id); ?>"
class="btn-icon" title="Delete">
<i class="fas fa-trash"></i> <!-- For Font Awesome -->
</a>
<?php else : ?>
<!-- Buttons are disabled -->
<span class="btn-icon disabled" title="Edit">
<i class="fas fa-edit"></i> <!-- For Font Awesome -->
</span>
<a href="<?php echo base_url('forms/delete/' . $row->id); ?>"
class="btn-icon" title="Delete">
<i class="fas fa-trash"></i> <!-- For Font Awesome -->
</a>
<?php endif; ?>
</td>
<td>
<a
href="<?php echo base_url('responses/' . $row->id); ?>">
<i class="fas fa-eye"></i> <!-- Eye icon -->
</a>
</td>
</tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>
@ -237,8 +149,3 @@
</div> </div>
</div> </div>
</div> </div>
<script>
document.getElementById('total-responses').parentNode.addEventListener('click', function() {
window.location.href = 'total_responses';
});
</script>

View File

@ -1,135 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Response Details</title>
<link rel="stylesheet" href="https://bootswatch.com/3/flatly/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.11.5/css/jquery.dataTables.min.css">
<style>
.question-label {
display: inline;
margin-bottom: 11px;
padding: 0;
border: none;
background: none;
}
.form-section {
border: 2px solid #ddd; /* Thicker border */
border-radius: 5px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Box shadow */
padding: 15px;
background: #fff;
margin-bottom: 15px;
transition: transform 0.3s, box-shadow 0.3s;
}
.form-section:hover {
transform: scale(1.02); /* Pop-out effect */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Enhanced box shadow on hover */
}
#scroll-up-btn {
position: fixed;
bottom: 20px;
right: 20px;
display: none;
z-index: 9999; /* Ensure it's above other content */
background-color: #007bff; /* Button color */
color: #fff; /* Text color */
border: none;
border-radius: 50%; /* Rounded button */
width: 50px;
height: 50px;
text-align: center;
line-height: 50px; /* Center text vertically */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Box shadow */
font-size: 20px; /* Font size */
}
#scroll-up-btn:hover {
background-color: #0056b3; /* Darker color on hover */
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
padding: 5px 10px;
margin: 0 2px;
border: 2px solid #007bff; /* Thicker border for pagination */
border-radius: 3px;
background-color: #f8f9fa;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
background-color: #007bff;
color: #fff;
}
table.dataTable thead th {
border-bottom: 2px solid #007bff; /* Thicker border for table header */
}
table.dataTable tbody td, table.dataTable thead th {
border: 2px solid #007bff; /* Thicker border for table cells */
}
.response-count {
font-weight: bold;
}
</style>
</head>
<body>
<div class="container">
<?php foreach ($responses as $form_title => $form_responses) : ?>
<div class="form-section">
<h2><?php echo $form_title; ?></h2>
<p class="response-count">Number of responses: <span><?php echo count($form_responses); ?></span></p> <!-- Display response count -->
<table class="table table-bordered" id="responses-table">
<thead>
<tr>
<th>Question</th>
<th>Answers</th>
</tr>
</thead>
<tbody>
<?php
$all_questions = [];
foreach ($form_responses as $response) {
foreach ($response['questions_and_answers'] as $qa) {
if (!isset($all_questions[$qa->text])) {
$all_questions[$qa->text] = [];
}
$all_questions[$qa->text][] = $qa->answered_text;
}
}
?>
<?php foreach ($all_questions as $question => $answers) : ?>
<tr>
<td><?php echo $question; ?></td>
<td><?php echo implode(", ", $answers); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endforeach; ?>
</div>
<button id="scroll-up-btn" class="btn"></button>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.11.5/js/jquery.dataTables.min.js"></script>
<script>
$(document).ready(function() {
$('#responses-table').DataTable();
var scrollUpBtn = document.getElementById('scroll-up-btn');
window.addEventListener('scroll', function() {
if (window.scrollY > 200) {
scrollUpBtn.style.display = 'block';
} else {
scrollUpBtn.style.display = 'none';
}
});
scrollUpBtn.addEventListener('click', function() {
window.scrollTo({ top: 0, behavior: 'smooth' });
});
});
</script>
</body>
</html>

View File

@ -15,198 +15,198 @@
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script> <script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
<!-- Add SweetAlert CSS and JS --> <!-- Add SweetAlert CSS and JS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
</head> </head>
<body> <body>
<style> <style>
.custom-select { .custom-select {
width: 220px; width: 220px;
height: 44px; height: 44px;
display: block; display: block;
padding: -20px 15px; padding: -20px 15px;
font-size: 15px; font-size: 15px;
line-height: 1.42857143; line-height: 1.42857143;
background-color: #ffffff; background-color: #ffffff;
background-image: none; background-image: none;
border: 1px solid #dce4ec; border: 1px solid #dce4ec;
border-radius: 4px; border-radius: 4px;
} }
</style>
</style>
<!-- Navbar --> <!-- Navbar -->
<nav class="navbar navbar-custom"> <nav class="navbar navbar-custom">
<div class="container"> <div class="container">
<?php if ($this->session->userdata('logged_in')) : ?> <?php if ($this->session->userdata('logged_in')): ?>
<div class="navbar-header"> <div class="navbar-header">
<a class="navbar-brand" href="<?php echo base_url(); ?>">Google Forms</a> <a class="navbar-brand" href="<?php echo base_url(); ?>">Google Forms</a>
</div>
<?php endif; ?>
<div id="navbar" class="navbar-collapse">
<ul class="nav navbar-nav">
<?php if ($this->session->userdata('logged_in')) : ?>
<li><a href="<?php echo base_url(); ?>published_forms">Published Forms</a></li>
<?php endif; ?>
</ul>
<ul class="nav navbar-nav navbar-right">
<?php if (!$this->session->userdata('logged_in')) : ?>
<li><a href="<?php echo base_url(); ?>users/login">Login</a></li>
<li><a href="<?php echo base_url(); ?>users/register">Register</a></li>
<?php endif; ?>
<?php if ($this->session->userdata('logged_in')) : ?>
<li><a href="<?php echo base_url(); ?>homepage/title">Create Form</a></li>
<li><a href="<?php echo base_url(); ?>users/logout">Logout</a></li>
<?php endif; ?>
</ul>
</div> </div>
<?php endif; ?>
<div id="navbar" class="navbar-collapse">
<ul class="nav navbar-nav">
<?php if ($this->session->userdata('logged_in')): ?>
<li><a href="<?php echo base_url(); ?>published_forms">Published Forms</a></li>
<li><a href="<?php echo base_url(); ?>drafts">Drafts</a></li>
<?php endif; ?>
</ul>
<ul class="nav navbar-nav navbar-right">
<?php if (!$this->session->userdata('logged_in')): ?>
<li><a href="<?php echo base_url(); ?>users/login">Login</a></li>
<li><a href="<?php echo base_url(); ?>users/register">Register</a></li>
<?php endif; ?>
<?php if ($this->session->userdata('logged_in')): ?>
<li><a href="<?php echo base_url(); ?>homepage/title">Create Form</a></li>
<li><a href="<?php echo base_url(); ?>users/logout">Logout</a></li>
<?php endif; ?>
</ul>
</div> </div>
</nav> </div>
</nav>
<!-- Alert Messages --> <!-- Alert Messages -->
<div class="container"> <div class="container">
<?php if ($this->session->flashdata('user_registered')) : ?> <?php if ($this->session->flashdata('user_registered')): ?>
<p class="alert alert-success"><?php echo $this->session->flashdata('user_registered'); ?></p> <p class="alert alert-success"><?php echo $this->session->flashdata('user_registered'); ?></p>
<?php endif; ?> <?php endif; ?>
<?php if ($this->session->flashdata('login_failed')) : ?> <?php if ($this->session->flashdata('login_failed')): ?>
<p class="alert alert-danger"><?php echo $this->session->flashdata('login_failed'); ?></p> <p class="alert alert-danger"><?php echo $this->session->flashdata('login_failed'); ?></p>
<?php endif; ?> <?php endif; ?>
<?php if ($this->session->flashdata('user_loggedin')) : ?> <?php if ($this->session->flashdata('user_loggedin')): ?>
<p class="alert alert-success"><?php echo $this->session->flashdata('user_loggedin'); ?></p> <p class="alert alert-success"><?php echo $this->session->flashdata('user_loggedin'); ?></p>
<?php endif; ?> <?php endif; ?>
<?php if ($this->session->flashdata('user_loggedout')) : ?> <?php if ($this->session->flashdata('user_loggedout')): ?>
<p class="alert alert-success"><?php echo $this->session->flashdata('user_loggedout'); ?></p> <p class="alert alert-success"><?php echo $this->session->flashdata('user_loggedout'); ?></p>
<?php endif; ?> <?php endif; ?>
</div> </div>
<!-- Form Editor --> <!-- Form Editor -->
<div class="container"> <div class="container">
<!-- Your flash messages and other content --> <!-- Your flash messages and other content -->
<!-- Form Editor --> <!-- Form Editor -->
<div class="container"> <div class="container">
<!-- Your flash messages and other content --> <!-- Your flash messages and other content -->
<!-- Form Editor --> <!-- Form Editor -->
<div class="container"> <div class="container">
<div class="form-header"> <div class="form-header">
<input type="text" id="form-title" class="form-control form-title" value="<?php echo $form['title']; ?>"> <input type="text" id="form-title" class="form-control form-title" value="<?php echo $form['title']; ?>">
<input type="text" id="form-description" class="form-control form-description" value="<?php echo $form['description']; ?>"> <input type="text" id="form-description" class="form-control form-description" value="<?php echo $form['description']; ?>">
<button id="add-section-btn" class="btn btn-primary">+</button> <button id="add-section-btn" class="btn btn-primary">+</button>
</div>
<div id="form-container">
<?php foreach ($questions as $question): ?>
<div class="form-section" data-index="<?php echo $question['id']; ?>" data-type="<?php echo $question['type']; ?>">
<div class="header-row">
<input type="text" class="form-control untitled-question" placeholder="Untitled Question" rows="1" value="<?php echo $question['text']; ?>">
<select class="custom-select question-type">
<option value="short-answer" <?php echo $question['type'] == 'short-answer' ? 'selected' : ''; ?>>Short Answer</option>
<option value="paragraph" <?php echo $question['type'] == 'paragraph' ? 'selected' : ''; ?>>Paragraph</option>
<option value="multiple-choice" <?php echo $question['type'] == 'multiple-choice' ? 'selected' : ''; ?>>Multiple Choice</option>
<option value="checkboxes" <?php echo $question['type'] == 'checkboxes' ? 'selected' : ''; ?>>Checkboxes</option>
<option value="dropdown" <?php echo $question['type'] == 'dropdown' ? 'selected' : ''; ?>>Dropdown</option>
</select>
<label class="toggle-switch">
<input type="checkbox" class="required-toggle" <?php echo $question['is_required'] ? 'checked' : ''; ?>>
<span class="slider"></span>
</label>
<span class="delete-section-icon"><i class="fas fa-trash-alt"></i></span>
</div>
<div class="options-container">
<?php
$this->db->where('question_id', $question['id']);
$options = $this->db->get('options')->result_array();
foreach ($options as $option):
$iconClass = ($question['type'] === 'multiple-choice' || $question['type'] === 'dropdown') ? 'fa-circle' : 'fa-square';
?>
<div class="option">
<i class="fas <?php echo $iconClass; ?> icon-transparent"></i>
<input type="text" class="form-control option-label" value="<?php echo $option['option_text']; ?>">
<span class="delete-option-icon">&times;</span>
</div> </div>
<div id="form-container"> <?php endforeach; ?>
<?php foreach ($questions as $question) : ?> </div>
<div class="form-section" data-index="<?php echo $question['id']; ?>" data-type="<?php echo $question['type']; ?>"> <?php if ($question['type'] === 'multiple-choice' || $question['type'] === 'checkboxes' || $question['type'] === 'dropdown'): ?>
<div class="header-row"> <button class="btn btn-primary add-option-btn">Add Option</button>
<input type="text" class="form-control untitled-question" placeholder="Untitled Question" rows="1" value="<?php echo $question['text']; ?>"> <?php endif; ?>
<select class="custom-select question-type"> </div>
<option value="short-answer" <?php echo $question['type'] == 'short-answer' ? 'selected' : ''; ?>>Short Answer</option> <?php endforeach; ?>
<option value="paragraph" <?php echo $question['type'] == 'paragraph' ? 'selected' : ''; ?>>Paragraph</option>
<option value="multiple-choice" <?php echo $question['type'] == 'multiple-choice' ? 'selected' : ''; ?>>Multiple Choice</option>
<option value="checkboxes" <?php echo $question['type'] == 'checkboxes' ? 'selected' : ''; ?>>Checkboxes</option>
<option value="dropdown" <?php echo $question['type'] == 'dropdown' ? 'selected' : ''; ?>>Dropdown</option>
</select>
<label class="toggle-switch">
<input type="checkbox" class="required-toggle" <?php echo $question['is_required'] ? 'checked' : ''; ?>>
<span class="slider"></span>
</label>
<span class="delete-section-icon"><i class="fas fa-trash-alt"></i></span>
</div>
<div class="options-container">
<?php
$this->db->where('question_id', $question['id']);
$options = $this->db->get('options')->result_array();
foreach ($options as $option) :
$iconClass = ($question['type'] === 'multiple-choice' || $question['type'] === 'dropdown') ? 'fa-circle' : 'fa-square';
?>
<div class="option">
<i class="fas <?php echo $iconClass; ?> icon-transparent"></i>
<input type="text" class="form-control option-label" value="<?php echo $option['option_text']; ?>">
<span class="delete-option-icon">&times;</span>
</div>
<?php endforeach; ?>
</div>
<?php if ($question['type'] === 'multiple-choice' || $question['type'] === 'checkboxes' || $question['type'] === 'dropdown') : ?>
<button class="btn btn-primary add-option-btn">Add Option</button>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div> </div>
<button id="submit-btn" class="btn btn-success btn-custom">Submit</button> <button id="submit-btn" class="btn btn-success btn-custom">Submit</button>
</div> </div>
<script src="<?php echo base_url('assets/js/jquery.min.js'); ?>"></script> <script src="<?php echo base_url('assets/js/jquery.min.js'); ?>"></script>
<script src="<?php echo base_url('assets/js/bootstrap.min.js'); ?>"></script> <script src="<?php echo base_url('assets/js/bootstrap.min.js'); ?>"></script>
<script src="<?php echo base_url('assets/js/jquery-ui.js'); ?>"></script> <script src="<?php echo base_url('assets/js/jquery-ui.js'); ?>"></script>
<script> <script>
$(document).ready(function() { $(document).ready(function () {
var base_url = '<?php echo base_url(); ?>'; var base_url = '<?php echo base_url(); ?>';
var activeSection = null; var activeSection = null;
$('#form-container').sortable({ $('#form-container').sortable({
placeholder: 'ui-state-highlight', placeholder: 'ui-state-highlight',
start: function(event, ui) { start: function (event, ui) {
ui.placeholder.height(ui.item.height()); ui.placeholder.height(ui.item.height());
}, },
stop: function(event, ui) { stop: function (event, ui) {
positionAddSectionButton(); positionAddSectionButton();
} }
}); });
function positionAddSectionButton() {
if (activeSection) {
var position = activeSection.position();
var buttonWidth = $('#add-section-btn').outerWidth();
var buttonHeight = $('#add-section-btn').outerHeight();
function positionAddSectionButton() { $('#add-section-btn').css({
if (activeSection) { position: 'absolute',
var position = activeSection.position(); left: position.left - buttonWidth - 47 + 'px',
var buttonWidth = $('#add-section-btn').outerWidth(); top: position.top + activeSection.height() / 2 - buttonHeight / 2 + 'px'
var buttonHeight = $('#add-section-btn').outerHeight(); });
}
}
$('#add-section-btn').css({ function appendNewOption(section, questionType) {
position: 'absolute', var iconClass = "";
left: position.left - buttonWidth - 47 + 'px', if (questionType === "multiple-choice") {
top: position.top + activeSection.height() / 2 - buttonHeight / 2 + 'px' iconClass = "fa-circle";
}); } else if (questionType === "checkboxes") {
} iconClass = "fa-square";
} } else if (questionType === "dropdown") {
iconClass = "fa-circle";
}
function appendNewOption(section, questionType) { var optionHtml = `
var iconClass = "";
if (questionType === "multiple-choice") {
iconClass = "fa-circle";
} else if (questionType === "checkboxes") {
iconClass = "fa-square";
} else if (questionType === "dropdown") {
iconClass = "fa-circle";
}
var optionHtml = `
<div class="option"> <div class="option">
<i class="fas ${iconClass} icon-transparent"></i> <i class="fas ${iconClass} icon-transparent"></i>
<input type="text" class="form-control option-label" placeholder="Option"> <input type="text" class="form-control option-label" placeholder="Option">
<span class="delete-option-icon">&times;</span> <span class="delete-option-icon">&times;</span>
</div> </div>
`; `;
section.find('.options-container').append(optionHtml); section.find('.options-container').append(optionHtml);
} }
// Add section button functionality // Add section button functionality
$('#add-section-btn').on('click', function() { $('#add-section-btn').on('click', function () {
createFormSection(); createFormSection();
$('.form-section').removeClass('active'); $('.form-section').removeClass('active');
activeSection = $('.form-section').last(); activeSection = $('.form-section').last();
activeSection.addClass('active'); activeSection.addClass('active');
positionAddSectionButton(); positionAddSectionButton();
}); });
function createFormSection() { function createFormSection() {
var sectionHtml = ` var sectionHtml = `
<div class="form-section" data-type=""> <div class="form-section" data-type="">
<div class="header-row"> <div class="header-row">
<input type="text" class="form-control untitled-question" placeholder="Untitled Question" rows="1"> <input type="text" class="form-control untitled-question" placeholder="Untitled Question" rows="1">
@ -227,206 +227,193 @@
<button class="btn btn-primary add-option-btn">Add Option</button> <button class="btn btn-primary add-option-btn">Add Option</button>
</div> </div>
`; `;
$('#form-container').append(sectionHtml); $('#form-container').append(sectionHtml);
var newSection = $('.form-section').last(); var newSection = $('.form-section').last();
newSection.find('.question-type').on('change', function() { newSection.find('.question-type').on('change', function() {
var selectedType = $(this).val(); var selectedType = $(this).val();
var optionsContainer = newSection.find('.options-container'); var optionsContainer = newSection.find('.options-container');
optionsContainer.empty(); // Clear previous options optionsContainer.empty(); // Clear previous options
if (selectedType === 'multiple-choice' || selectedType === 'checkboxes' || selectedType === 'dropdown') { if (selectedType === 'multiple-choice' || selectedType === 'checkboxes' || selectedType === 'dropdown') {
appendNewOption(newSection, selectedType); appendNewOption(newSection, selectedType);
newSection.find('.add-option-btn').show(); newSection.find('.add-option-btn').show();
} else if (selectedType === 'short-answer') { } else if (selectedType === 'short-answer') {
optionsContainer.append('<input type="text" class="form-control" placeholder="Short answer text">'); optionsContainer.append('<input type="text" class="form-control" placeholder="Short answer text">');
newSection.find('.add-option-btn').hide(); newSection.find('.add-option-btn').hide();
} else if (selectedType === 'paragraph') { } else if (selectedType === 'paragraph') {
optionsContainer.append('<textarea class="form-control" placeholder="Paragraph text"></textarea>'); optionsContainer.append('<textarea class="form-control" placeholder="Paragraph text"></textarea>');
newSection.find('.add-option-btn').hide(); newSection.find('.add-option-btn').hide();
} else { } else {
newSection.find('.add-option-btn').hide(); newSection.find('.add-option-btn').hide();
} }
}); });
// Initially hide add option button // Initially hide add option button
newSection.find('.add-option-btn').hide(); newSection.find('.add-option-btn').hide();
newSection.on('click', function() { newSection.on('click', function () {
$('.form-section').removeClass('active'); $('.form-section').removeClass('active');
$(this).addClass('active'); $(this).addClass('active');
activeSection = $(this); activeSection = $(this);
positionAddSectionButton(); positionAddSectionButton();
}); });
positionAddSectionButton(); positionAddSectionButton();
} }
$('.question-type').on('change', function() { $('.question-type').on('change', function() {
var section = $(this).closest('.form-section'); var section = $(this).closest('.form-section');
var selectedType = $(this).val(); var selectedType = $(this).val();
var optionsContainer = section.find('.options-container'); var optionsContainer = section.find('.options-container');
optionsContainer.empty(); // Clear previous options optionsContainer.empty(); // Clear previous options
if (selectedType === 'multiple-choice' || selectedType === 'checkboxes' || selectedType === 'dropdown') { if (selectedType === 'multiple-choice' || selectedType === 'checkboxes' || selectedType === 'dropdown') {
appendNewOption(section, selectedType); appendNewOption(section, selectedType);
if (!section.find('.add-option-btn').length) { if (!section.find('.add-option-btn').length) {
section.append('<button class="btn btn-primary add-option-btn">Add Option</button>'); section.append('<button class="btn btn-primary add-option-btn">Add Option</button>');
} }
section.find('.add-option-btn').show(); section.find('.add-option-btn').show();
} else if (selectedType === 'short-answer') { } else if (selectedType === 'short-answer') {
optionsContainer.append('<input type="text" class="form-control" placeholder="Short answer text">'); optionsContainer.append('<input type="text" class="form-control" placeholder="Short answer text">');
section.find('.add-option-btn').hide(); section.find('.add-option-btn').hide();
} else if (selectedType === 'paragraph') { } else if (selectedType === 'paragraph') {
optionsContainer.append('<textarea class="form-control" placeholder="Paragraph text"></textarea>'); optionsContainer.append('<textarea class="form-control" placeholder="Paragraph text"></textarea>');
section.find('.add-option-btn').hide(); section.find('.add-option-btn').hide();
} else { } else {
section.find('.add-option-btn').hide(); section.find('.add-option-btn').hide();
}
});
$(document).on('click', '.add-option-btn', function () {
var $section = $(this).closest('.form-section');
var questionType = $section.find('.question-type').val();
appendNewOption($section, questionType);
});
$(document).on('click', '.delete-section-icon', function () {
$(this).closest('.form-section').remove();
activeSection = null;
positionAddSectionButton();
});
$(document).on('click', '.delete-option-icon', function () {
$(this).closest('.option').remove();
});
$('.form-section').each(function () {
$(this).on('click', function () {
$('.form-section').removeClass('active');
$(this).addClass('active');
activeSection = $(this);
positionAddSectionButton();
});
});
$(window).on('resize', function () {
positionAddSectionButton();
});
// positionAddSectionButton();
$(document).ready(function () {
var base_url = '<?php echo base_url(); ?>';
$('#submit-btn').on('click', function () {
var formData = collectFormData();
formData['form_id'] = <?php echo $form['id']; ?>;
let validation = validateFormData(formData);
if (!validation.isValid) {
alert(validation.message);
return;
}
$.ajax({
url: base_url + 'Form_controller/update_form',
type: 'POST',
data: { formData: formData },
dataType: 'JSON',
success: function (response) {
if (response.status === 'success') {
Swal.fire({
title: 'Success!',
text: 'Form updated successfully!',
icon: 'success',
confirmButtonText: 'OK'
}).then((result) => {
if (result.isConfirmed) {
window.location.href = base_url + 'drafts';
} }
}); });
} else {
$(document).on('click', '.add-option-btn', function() { Swal.fire({
var $section = $(this).closest('.form-section'); title: 'Error!',
var questionType = $section.find('.question-type').val(); text: response.message,
appendNewOption($section, questionType); icon: 'error',
confirmButtonText: 'OK'
}); });
}
$(document).on('click', '.delete-section-icon', function() { },
$(this).closest('.form-section').remove(); error: function (error) {
activeSection = null; Swal.fire({
positionAddSectionButton(); title: 'Error!',
}); text: 'Error updating form!',
icon: 'error',
$(document).on('click', '.delete-option-icon', function() { confirmButtonText: 'OK'
$(this).closest('.option').remove();
});
$('.form-section').each(function() {
$(this).on('click', function() {
$('.form-section').removeClass('active');
$(this).addClass('active');
activeSection = $(this);
positionAddSectionButton();
});
});
$(window).on('resize', function() {
positionAddSectionButton();
});
// positionAddSectionButton();
$(document).ready(function() {
var base_url = '<?php echo base_url(); ?>';
$('#submit-btn').on('click', function() {
var formData = collectFormData();
formData['form_id'] = <?php echo $form['id']; ?>;
let validation = validateFormData(formData);
if (!validation.isValid) {
alert(validation.message);
return;
}
$.ajax({
url: base_url + 'Form_controller/update_form',
type: 'POST',
data: {
formData: formData
},
dataType: 'JSON',
success: function(response) {
if (response.status === 'success') {
Swal.fire({
title: 'Success!',
text: 'Form updated successfully!',
icon: 'success',
confirmButtonText: 'OK'
}).then((result) => {
if (result.isConfirmed) {
window.location.href = base_url + 'drafts';
}
});
} else {
Swal.fire({
title: 'Error!',
text: response.message,
icon: 'error',
confirmButtonText: 'OK'
});
}
},
error: function(error) {
Swal.fire({
title: 'Error!',
text: 'Error updating form!',
icon: 'error',
confirmButtonText: 'OK'
});
console.log(error);
}
});
});
// Collect form data function
function collectFormData() {
var formData = {
title: $('#form-title').val(),
description: $('#form-description').val(),
questions: []
};
$('.form-section').each(function() {
var questionData = {
id: $(this).data('index'),
text: $(this).find('.untitled-question').val(),
type: $(this).find('.custom-select').val(),
required: $(this).find('.required-toggle').is(':checked') ? 1 : 0,
options: []
};
$(this).find('.option-label').each(function() {
questionData.options.push($(this).val());
});
formData.questions.push(questionData);
});
return formData;
}
function validateFormData(formData) {
for (let question of formData.questions) {
if (!question.text.trim()) {
return {
isValid: false,
message: 'All questions must have text.'
};
}
if ((question.type === 'multiple-choice' || question.type === 'checkboxes' || question.type === 'dropdown') && question.options.length === 0) {
return {
isValid: false,
message: 'All options-based questions must have at least one option.'
};
}
for (let option of question.options) {
if (!option.trim()) {
return {
isValid: false,
message: 'All options must have text.'
};
}
}
}
return {
isValid: true
};
}
});
// Initialize
}); });
</script> console.log(error);
}
});
});
// Collect form data function
function collectFormData() {
var formData = {
title: $('#form-title').val(),
description: $('#form-description').val(),
questions: []
};
$('.form-section').each(function () {
var questionData = {
id: $(this).data('index'),
text: $(this).find('.untitled-question').val(),
type: $(this).find('.custom-select').val(),
required: $(this).find('.required-toggle').is(':checked') ? 1 : 0,
options: []
};
$(this).find('.option-label').each(function () {
questionData.options.push($(this).val());
});
formData.questions.push(questionData);
});
return formData;
}
function validateFormData(formData) {
for (let question of formData.questions) {
if (!question.text.trim()) {
return { isValid: false, message: 'All questions must have text.' };
}
if ((question.type === 'multiple-choice' || question.type === 'checkboxes' || question.type === 'dropdown') && question.options.length === 0) {
return { isValid: false, message: 'All options-based questions must have at least one option.' };
}
for (let option of question.options) {
if (!option.trim()) {
return { isValid: false, message: 'All options must have text.' };
}
}
}
return { isValid: true };
}
});
// Initialize
});
</script>
</body> </body>
</html> </html>

View File

@ -1,9 +1,8 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
echo "\nERROR: ", echo "\nERROR: ",
$heading, $heading,
"\n\n", "\n\n",
$message, $message,
"\n\n"; "\n\n";

View File

@ -1,9 +1,8 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
echo "\nDatabase error: ", echo "\nDatabase error: ",
$heading, $heading,
"\n\n", "\n\n",
$message, $message,
"\n\n"; "\n\n";

View File

@ -1,4 +1,4 @@
<?php defined('BASEPATH') or exit('No direct script access allowed'); ?> <?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
An uncaught Exception was encountered An uncaught Exception was encountered
@ -7,14 +7,15 @@ Message: <?php echo $message, "\n"; ?>
Filename: <?php echo $exception->getFile(), "\n"; ?> Filename: <?php echo $exception->getFile(), "\n"; ?>
Line Number: <?php echo $exception->getLine(); ?> Line Number: <?php echo $exception->getLine(); ?>
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === true) : ?> <?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?>
Backtrace: Backtrace:
<?php foreach ($exception->getTrace() as $error) : ?> <?php foreach ($exception->getTrace() as $error): ?>
<?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0) : ?> <?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?>
File: <?php echo $error['file'], "\n"; ?> File: <?php echo $error['file'], "\n"; ?>
Line: <?php echo $error['line'], "\n"; ?> Line: <?php echo $error['line'], "\n"; ?>
Function: <?php echo $error['function'], "\n\n"; ?> Function: <?php echo $error['function'], "\n\n"; ?>
<?php endif ?> <?php endif ?>
<?php endforeach ?> <?php endforeach ?>
<?php endif ?> <?php endif ?>

View File

@ -1,9 +1,8 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
echo "\nERROR: ", echo "\nERROR: ",
$heading, $heading,
"\n\n", "\n\n",
$message, $message,
"\n\n"; "\n\n";

View File

@ -1,4 +1,4 @@
<?php defined('BASEPATH') or exit('No direct script access allowed'); ?> <?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
A PHP Error was encountered A PHP Error was encountered
@ -7,14 +7,15 @@ Message: <?php echo $message, "\n"; ?>
Filename: <?php echo $filepath, "\n"; ?> Filename: <?php echo $filepath, "\n"; ?>
Line Number: <?php echo $line; ?> Line Number: <?php echo $line; ?>
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === true) : ?> <?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?>
Backtrace: Backtrace:
<?php foreach (debug_backtrace() as $error) : ?> <?php foreach (debug_backtrace() as $error): ?>
<?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0) : ?> <?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?>
File: <?php echo $error['file'], "\n"; ?> File: <?php echo $error['file'], "\n"; ?>
Line: <?php echo $error['line'], "\n"; ?> Line: <?php echo $error['line'], "\n"; ?>
Function: <?php echo $error['function'], "\n\n"; ?> Function: <?php echo $error['function'], "\n\n"; ?>
<?php endif ?> <?php endif ?>
<?php endforeach ?> <?php endforeach ?>
<?php endif ?> <?php endif ?>

View File

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

View File

@ -1,5 +1,5 @@
<?php <?php
defined('BASEPATH') or exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html> ?><!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@ -11,54 +11,54 @@ defined('BASEPATH') or exit('No direct script access allowed');
::-moz-selection { background-color: #E13300; color: white; } ::-moz-selection { background-color: #E13300; color: white; }
body { body {
background-color: #fff; background-color: #fff;
margin: 40px; margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif; font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155; color: #4F5155;
} }
a { a {
color: #003399; color: #003399;
background-color: transparent; background-color: transparent;
font-weight: normal; font-weight: normal;
} }
h1 { h1 {
color: #444; color: #444;
background-color: transparent; background-color: transparent;
border-bottom: 1px solid #D0D0D0; border-bottom: 1px solid #D0D0D0;
font-size: 19px; font-size: 19px;
font-weight: normal; font-weight: normal;
margin: 0 0 14px 0; margin: 0 0 14px 0;
padding: 14px 15px 10px 15px; padding: 14px 15px 10px 15px;
} }
code { code {
font-family: Consolas, Monaco, Courier New, Courier, monospace; font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px; font-size: 12px;
background-color: #f9f9f9; background-color: #f9f9f9;
border: 1px solid #D0D0D0; border: 1px solid #D0D0D0;
color: #002166; color: #002166;
display: block; display: block;
margin: 14px 0 14px 0; margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px; padding: 12px 10px 12px 10px;
} }
#container { #container {
margin: 10px; margin: 10px;
border: 1px solid #D0D0D0; border: 1px solid #D0D0D0;
box-shadow: 0 0 8px #D0D0D0; box-shadow: 0 0 8px #D0D0D0;
} }
p { p {
margin: 12px 15px 12px 15px; margin: 12px 15px 12px 15px;
} }
</style> </style>
</head> </head>
<body> <body>
<div id="container"> <div id="container">
<h1><?php echo $heading; ?></h1> <h1><?php echo $heading; ?></h1>
<?php echo $message; ?> <?php echo $message; ?>
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,5 +1,5 @@
<?php <?php
defined('BASEPATH') or exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html> ?><!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@ -11,54 +11,54 @@ defined('BASEPATH') or exit('No direct script access allowed');
::-moz-selection { background-color: #E13300; color: white; } ::-moz-selection { background-color: #E13300; color: white; }
body { body {
background-color: #fff; background-color: #fff;
margin: 40px; margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif; font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155; color: #4F5155;
} }
a { a {
color: #003399; color: #003399;
background-color: transparent; background-color: transparent;
font-weight: normal; font-weight: normal;
} }
h1 { h1 {
color: #444; color: #444;
background-color: transparent; background-color: transparent;
border-bottom: 1px solid #D0D0D0; border-bottom: 1px solid #D0D0D0;
font-size: 19px; font-size: 19px;
font-weight: normal; font-weight: normal;
margin: 0 0 14px 0; margin: 0 0 14px 0;
padding: 14px 15px 10px 15px; padding: 14px 15px 10px 15px;
} }
code { code {
font-family: Consolas, Monaco, Courier New, Courier, monospace; font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px; font-size: 12px;
background-color: #f9f9f9; background-color: #f9f9f9;
border: 1px solid #D0D0D0; border: 1px solid #D0D0D0;
color: #002166; color: #002166;
display: block; display: block;
margin: 14px 0 14px 0; margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px; padding: 12px 10px 12px 10px;
} }
#container { #container {
margin: 10px; margin: 10px;
border: 1px solid #D0D0D0; border: 1px solid #D0D0D0;
box-shadow: 0 0 8px #D0D0D0; box-shadow: 0 0 8px #D0D0D0;
} }
p { p {
margin: 12px 15px 12px 15px; margin: 12px 15px 12px 15px;
} }
</style> </style>
</head> </head>
<body> <body>
<div id="container"> <div id="container">
<h1><?php echo $heading; ?></h1> <h1><?php echo $heading; ?></h1>
<?php echo $message; ?> <?php echo $message; ?>
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,5 +1,5 @@
<?php <?php
defined('BASEPATH') or exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
?> ?>
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
@ -11,18 +11,21 @@ defined('BASEPATH') or exit('No direct script access allowed');
<p>Filename: <?php echo $exception->getFile(); ?></p> <p>Filename: <?php echo $exception->getFile(); ?></p>
<p>Line Number: <?php echo $exception->getLine(); ?></p> <p>Line Number: <?php echo $exception->getLine(); ?></p>
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === true) : ?> <?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?>
<p>Backtrace:</p>
<?php foreach ($exception->getTrace() as $error) : ?>
<?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0) : ?>
<p style="margin-left:10px">
File: <?php echo $error['file']; ?><br />
Line: <?php echo $error['line']; ?><br />
Function: <?php echo $error['function']; ?>
</p>
<?php endif ?>
<?php endforeach ?> <p>Backtrace:</p>
<?php foreach ($exception->getTrace() as $error): ?>
<?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?>
<p style="margin-left:10px">
File: <?php echo $error['file']; ?><br />
Line: <?php echo $error['line']; ?><br />
Function: <?php echo $error['function']; ?>
</p>
<?php endif ?>
<?php endforeach ?>
<?php endif ?> <?php endif ?>

View File

@ -1,5 +1,5 @@
<?php <?php
defined('BASEPATH') or exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html> ?><!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@ -11,54 +11,54 @@ defined('BASEPATH') or exit('No direct script access allowed');
::-moz-selection { background-color: #E13300; color: white; } ::-moz-selection { background-color: #E13300; color: white; }
body { body {
background-color: #fff; background-color: #fff;
margin: 40px; margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif; font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155; color: #4F5155;
} }
a { a {
color: #003399; color: #003399;
background-color: transparent; background-color: transparent;
font-weight: normal; font-weight: normal;
} }
h1 { h1 {
color: #444; color: #444;
background-color: transparent; background-color: transparent;
border-bottom: 1px solid #D0D0D0; border-bottom: 1px solid #D0D0D0;
font-size: 19px; font-size: 19px;
font-weight: normal; font-weight: normal;
margin: 0 0 14px 0; margin: 0 0 14px 0;
padding: 14px 15px 10px 15px; padding: 14px 15px 10px 15px;
} }
code { code {
font-family: Consolas, Monaco, Courier New, Courier, monospace; font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px; font-size: 12px;
background-color: #f9f9f9; background-color: #f9f9f9;
border: 1px solid #D0D0D0; border: 1px solid #D0D0D0;
color: #002166; color: #002166;
display: block; display: block;
margin: 14px 0 14px 0; margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px; padding: 12px 10px 12px 10px;
} }
#container { #container {
margin: 10px; margin: 10px;
border: 1px solid #D0D0D0; border: 1px solid #D0D0D0;
box-shadow: 0 0 8px #D0D0D0; box-shadow: 0 0 8px #D0D0D0;
} }
p { p {
margin: 12px 15px 12px 15px; margin: 12px 15px 12px 15px;
} }
</style> </style>
</head> </head>
<body> <body>
<div id="container"> <div id="container">
<h1><?php echo $heading; ?></h1> <h1><?php echo $heading; ?></h1>
<?php echo $message; ?> <?php echo $message; ?>
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,5 +1,5 @@
<?php <?php
defined('BASEPATH') or exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
?> ?>
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
@ -11,19 +11,22 @@ defined('BASEPATH') or exit('No direct script access allowed');
<p>Filename: <?php echo $filepath; ?></p> <p>Filename: <?php echo $filepath; ?></p>
<p>Line Number: <?php echo $line; ?></p> <p>Line Number: <?php echo $line; ?></p>
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === true) : ?> <?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?>
<p>Backtrace:</p>
<?php foreach (debug_backtrace() as $error) : ?>
<?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0) : ?>
<p style="margin-left:10px">
File: <?php echo $error['file'] ?><br />
Line: <?php echo $error['line'] ?><br />
Function: <?php echo $error['function'] ?>
</p>
<?php endif ?> <p>Backtrace:</p>
<?php foreach (debug_backtrace() as $error): ?>
<?php endforeach ?> <?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?>
<p style="margin-left:10px">
File: <?php echo $error['file'] ?><br />
Line: <?php echo $error['line'] ?><br />
Function: <?php echo $error['function'] ?>
</p>
<?php endif ?>
<?php endforeach ?>
<?php endif ?> <?php endif ?>

View File

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

View File

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

View File

@ -16,42 +16,42 @@
<h4><?php echo $form->description; ?></h4> <h4><?php echo $form->description; ?></h4>
</div> </div>
<?php foreach ($questions as $question) : ?> <?php foreach ($questions as $question): ?>
<div class="form-section"> <div class="form-section">
<div class="question-section"> <div class="question-section">
<p class="question-label"><?php echo $question->text; ?></p> <p class="question-label"><?php echo $question->text; ?></p>
</div> </div>
<?php if ($question->type == 'multiple-choice') : ?> <?php if ($question->type == 'multiple-choice'): ?>
<div class="options-container"> <div class="options-container">
<?php foreach ($question->options as $option) : ?> <?php foreach ($question->options as $option): ?>
<div class="option"> <div class="option">
<input type="radio" name="option-<?php echo $question->id; ?>" disabled> <input type="radio" name="option-<?php echo $question->id; ?>" disabled>
<label><?php echo $option->option_text; ?></label> <label><?php echo $option->option_text; ?></label>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php elseif ($question->type == 'checkboxes') : ?> <?php elseif ($question->type == 'checkboxes'): ?>
<div class="options-container"> <div class="options-container">
<?php foreach ($question->options as $option) : ?> <?php foreach ($question->options as $option): ?>
<div class="option"> <div class="option">
<input type="checkbox" name="option-<?php echo $question->id; ?>" disabled> <input type="checkbox" name="option-<?php echo $question->id; ?>" disabled>
<label><?php echo $option->option_text; ?></label> <label><?php echo $option->option_text; ?></label>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php elseif ($question->type == 'short-answer') : ?> <?php elseif ($question->type == 'short-answer'): ?>
<div class="options-container"> <div class="options-container">
<input type="text" class="form-control" placeholder="Short answer text" disabled> <input type="text" class="form-control" placeholder="Short answer text" disabled>
</div> </div>
<?php elseif ($question->type == 'paragraph') : ?> <?php elseif ($question->type == 'paragraph'): ?>
<div class="options-container"> <div class="options-container">
<textarea class="form-control" placeholder="Paragraph text" disabled></textarea> <textarea class="form-control" placeholder="Paragraph text" disabled></textarea>
</div> </div>
<?php elseif ($question->type == 'dropdown') : ?> <?php elseif ($question->type == 'dropdown'): ?>
<div class="options-container"> <div class="options-container">
<select class="form-control" disabled> <select class="form-control" disabled>
<?php foreach ($question->options as $option) : ?> <?php foreach ($question->options as $option): ?>
<option><?php echo $option->option_text; ?></option> <option><?php echo $option->option_text; ?></option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
@ -59,7 +59,7 @@
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<a href="<?php echo base_url('Publish_controller/publish_form/' . $form->id); ?>" class="btn btn-success">Publish</a> <a href="<?php echo base_url('Publish_controller/publish_form/'.$form->id); ?>" class="btn btn-success">Publish</a>
<br> <br>
</div> </div>
</body> </body>

View File

@ -35,42 +35,42 @@
<br> <br>
<h4><?php echo $form->description; ?></h4> <h4><?php echo $form->description; ?></h4>
</div> </div>
<?php foreach ($questions as $question) : ?> <?php foreach ($questions as $question): ?>
<div class="form-section"> <div class="form-section">
<div class="question-section"> <div class="question-section">
<p class="question-label"><?php echo $question->text; ?></p> <p class="question-label"><?php echo $question->text; ?></p>
</div> </div>
<?php if ($question->type == 'multiple-choice') : ?> <?php if ($question->type == 'multiple-choice'): ?>
<div class="options-container"> <div class="options-container">
<?php foreach ($question->options as $option) : ?> <?php foreach ($question->options as $option): ?>
<div class="option"> <div class="option">
<input type="radio" name="option-<?php echo $question->id; ?>" disabled> <input type="radio" name="option-<?php echo $question->id; ?>" disabled>
<label><?php echo $option->option_text; ?></label> <label><?php echo $option->option_text; ?></label>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php elseif ($question->type == 'checkboxes') : ?> <?php elseif ($question->type == 'checkboxes'): ?>
<div class="options-container"> <div class="options-container">
<?php foreach ($question->options as $option) : ?> <?php foreach ($question->options as $option): ?>
<div class="option"> <div class="option">
<input type="checkbox" name="option-<?php echo $question->id; ?>" disabled> <input type="checkbox" name="option-<?php echo $question->id; ?>" disabled>
<label><?php echo $option->option_text; ?></label> <label><?php echo $option->option_text; ?></label>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php elseif ($question->type == 'short-answer') : ?> <?php elseif ($question->type == 'short-answer'): ?>
<div class="options-container"> <div class="options-container">
<input type="text" class="form-control" placeholder="Short answer text" disabled> <input type="text" class="form-control" placeholder="Short answer text" disabled>
</div> </div>
<?php elseif ($question->type == 'paragraph') : ?> <?php elseif ($question->type == 'paragraph'): ?>
<div class="options-container"> <div class="options-container">
<textarea class="form-control" placeholder="Paragraph text" disabled></textarea> <textarea class="form-control" placeholder="Paragraph text" disabled></textarea>
</div> </div>
<?php elseif ($question->type == 'dropdown') : ?> <?php elseif ($question->type == 'dropdown'): ?>
<div class="options-container"> <div class="options-container">
<select class="form-control" disabled> <select class="form-control" disabled>
<?php foreach ($question->options as $option) : ?> <?php foreach ($question->options as $option): ?>
<option><?php echo $option->option_text; ?></option> <option><?php echo $option->option_text; ?></option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>

View File

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

View File

@ -3,7 +3,7 @@
<div class="col-md-12 mt-4"> <div class="col-md-12 mt-4">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<?php if ($this->session->flashdata('status')) : ?> <?php if ($this->session->flashdata('status')): ?>
<div class="alert alert-success"> <div class="alert alert-success">
<?= $this->session->flashdata('status'); ?> <?= $this->session->flashdata('status'); ?>
</div> </div>
@ -15,7 +15,7 @@
<table id="basetable1" class="table table-bordered"> <table id="basetable1" class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>Serial No.</th> <th>Responses</th>
<th>Title</th> <th>Title</th>
<th>Response Link</th> <th>Response Link</th>
<th>Status</th> <th>Status</th>
@ -24,7 +24,7 @@
</thead> </thead>
<tbody> <tbody>
<?php $serialNumber = 1; <?php $serialNumber = 1;
foreach ($forms as $row) : ?> foreach ($forms as $row): ?>
<tr> <tr>
<td><?php echo $serialNumber++; ?></td> <td><?php echo $serialNumber++; ?></td>
<td class="title-column"><?php echo $row->title; ?></td> <td class="title-column"><?php echo $row->title; ?></td>

View File

@ -46,7 +46,7 @@ padding-left: 0; /* Ensure no padding is affecting alignment */
<p class="submitted-at">Submitted At: <?php echo $response->submitted_at; ?></p> <p class="submitted-at">Submitted At: <?php echo $response->submitted_at; ?></p>
<p class="user-email">User Email: <?php echo $response->email; ?></p> <p class="user-email">User Email: <?php echo $response->email; ?></p>
</div> </div>
<?php foreach ($questions_and_answers as $question) : ?> <?php foreach ($questions_and_answers as $question): ?>
<div class="form-section"> <div class="form-section">
<div class="question-section"> <div class="question-section">
<p class="form-control question-label"><?php echo $question->question_text; ?></p> <p class="form-control question-label"><?php echo $question->question_text; ?></p>

View File

@ -106,41 +106,41 @@
<h4><?php echo $form->description; ?></h4> <h4><?php echo $form->description; ?></h4>
</div> --> </div> -->
<?php if (isset($message)) : ?> <?php if (isset($message)): ?>
<div id="popup-message" class="popup-message"> <div id="popup-message" class="popup-message">
<p><?php echo $message; ?></p> <p><?php echo $message; ?></p>
<button onclick="closePopup()">Close</button> <button onclick="closePopup()">Close</button>
</div> </div>
<?php else : ?> <?php else: ?>
<form action="<?php echo base_url('response_submit/submit_form'); ?>" method="post" onsubmit="return validateForm();"> <form action="<?php echo base_url('response_submit/submit_form'); ?>" method="post" onsubmit="return validateForm();">
<input type="hidden" name="form_id" value="<?php echo $form->id; ?>"> <input type="hidden" name="form_id" value="<?php echo $form->id; ?>">
<div class="form-section"> <div class="form-section">
<?php foreach ($questions as $question) : ?> <?php foreach ($questions as $question): ?>
<div class="question-container" data-required="<?php echo $question->is_required; ?>" data-type="<?php echo $question->type; ?>"> <div class="question-container" data-required="<?php echo $question->is_required; ?>" data-type="<?php echo $question->type; ?>">
<input type="hidden" name="responses[<?php echo $question->id; ?>][question_id]" value="<?php echo $question->id; ?>"> <input type="hidden" name="responses[<?php echo $question->id; ?>][question_id]" value="<?php echo $question->id; ?>">
<input type="hidden" name="responses[<?php echo $question->id; ?>][form_id]" value="<?php echo $form->id; ?>"> <input type="hidden" name="responses[<?php echo $question->id; ?>][form_id]" value="<?php echo $form->id; ?>">
<label class="<?php echo $question->is_required ? 'required-field' : ''; ?>"><?php echo $question->text; ?></label> <label class="<?php echo $question->is_required ? 'required-field' : ''; ?>"><?php echo $question->text; ?></label>
<?php if ($question->type == 'multiple-choice') : ?> <?php if ($question->type == 'multiple-choice'): ?>
<?php foreach ($question->options as $option) : ?> <?php foreach ($question->options as $option): ?>
<div class="option"> <div class="option">
<input type="radio" name="responses[<?php echo $question->id; ?>][options][]" value="<?php echo $option->option_text; ?>"> <input type="radio" name="responses[<?php echo $question->id; ?>][options][]" value="<?php echo $option->option_text; ?>">
<label><?php echo $option->option_text; ?></label> <label><?php echo $option->option_text; ?></label>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<?php elseif ($question->type == 'checkboxes') : ?> <?php elseif ($question->type == 'checkboxes'): ?>
<?php foreach ($question->options as $option) : ?> <?php foreach ($question->options as $option): ?>
<div class="option"> <div class="option">
<input type="checkbox" name="responses[<?php echo $question->id; ?>][options][]" value="<?php echo $option->option_text; ?>"> <input type="checkbox" name="responses[<?php echo $question->id; ?>][options][]" value="<?php echo $option->option_text; ?>">
<label><?php echo $option->option_text; ?></label> <label><?php echo $option->option_text; ?></label>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<?php elseif ($question->type == 'short-answer') : ?> <?php elseif ($question->type == 'short-answer'): ?>
<input type="text" class="form-control" name="responses[<?php echo $question->id; ?>][answered_text]" placeholder="Short answer text"> <input type="text" class="form-control" name="responses[<?php echo $question->id; ?>][answered_text]" placeholder="Short answer text">
<?php elseif ($question->type == 'paragraph') : ?> <?php elseif ($question->type == 'paragraph'): ?>
<textarea class="form-control" name="responses[<?php echo $question->id; ?>][answered_text]" placeholder="Paragraph text"></textarea> <textarea class="form-control" name="responses[<?php echo $question->id; ?>][answered_text]" placeholder="Paragraph text"></textarea>
<?php elseif ($question->type == 'dropdown') : ?> <?php elseif ($question->type == 'dropdown'): ?>
<select class="form-control" name="responses[<?php echo $question->id; ?>][answered_text]"> <select class="form-control" name="responses[<?php echo $question->id; ?>][answered_text]">
<?php foreach ($question->options as $option) : ?> <?php foreach ($question->options as $option): ?>
<option value="<?php echo $option->option_text; ?>"><?php echo $option->option_text; ?></option> <option value="<?php echo $option->option_text; ?>"><?php echo $option->option_text; ?></option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>

View File

@ -1,17 +0,0 @@
<div class="container">
<h2>Select a form to view summary</h2>
<?php foreach ($forms as $form) : ?>
<div class="form-section" data-form-id="<?php echo $form->id; ?>">
<h3><?php echo $form->title; ?></h3>
</div>
<?php endforeach; ?>
</div>
<script>
document.querySelectorAll('.form-section').forEach(function(section) {
section.addEventListener('click', function() {
var formId = this.getAttribute('data-form-id');
window.location.href = '<?php echo base_url('response_submit/response_summary_by_form/'); ?>' + formId;
});
});
</script>

View File

@ -1,38 +0,0 @@
<div class="container">
<h2>Summary for Form <?php echo $form_id; ?></h2>
<?php foreach ($data as $question => $info) : ?>
<div class="chart-container">
<h3><?php echo $question; ?></h3>
<canvas id="chart-<?php echo md5($question); ?>" width="400" height="400"></canvas>
</div>
<script>
var ctx = document.getElementById('chart-<?php echo md5($question); ?>').getContext('2d');
var labels = <?php echo json_encode(array_unique($info['answers'])); ?>;
var counts = labels.map(label => {
return <?php echo json_encode(array_count_values($info['answers'])); ?>[label];
});
var chartData = {
labels: labels,
datasets: [{
data: counts,
backgroundColor: labels.map(() => 'rgba(54, 162, 235, 0.2)'),
borderColor: labels.map(() => 'rgba(54, 162, 235, 1)'),
borderWidth: 1
}]
};
var chartType = '<?php echo ($info['type'] == 'checkbox') ? 'bar' : 'pie'; ?>';
new Chart(ctx, {
type: chartType,
data: chartData,
options: {
responsive: true,
maintainAspectRatio: false
}
});
</script>
<?php endforeach; ?>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>

View File

@ -18,7 +18,7 @@
<div class="col-md-12 mt-4"> <div class="col-md-12 mt-4">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<?php if ($this->session->flashdata('status')) : ?> <?php if ($this->session->flashdata('status')): ?>
<div class="alert alert-success"> <div class="alert alert-success">
<?= $this->session->flashdata('status'); ?> <?= $this->session->flashdata('status'); ?>
</div> </div>
@ -36,7 +36,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($responses as $response) : ?> <?php foreach ($responses as $response): ?>
<tr> <tr>
<td class="username-column"><?php echo $response->username; ?></td> <td class="username-column"><?php echo $response->username; ?></td>
<td><?php echo $response->submitted_at; ?></td> <td><?php echo $response->submitted_at; ?></td>

View File

@ -19,16 +19,16 @@
<style> <style>
.navbar-custom .navbar-brand, .navbar-custom .navbar-brand,
.navbar-custom .navbar-nav .nav-link { .navbar-custom .navbar-nav .nav-link {
color: white !important; color: white !important; /* Forces the text color to be white */
text-decoration: none !important; text-decoration: none !important; /* Ensures no underline */
background: none !important; background: none !important; /* Ensures no background color */
} }
.navbar-custom .navbar-brand:hover, .navbar-custom .navbar-brand:hover,
.navbar-custom .navbar-nav .nav-link:hover { .navbar-custom .navbar-nav .nav-link:hover {
color: white !important; color: white !important; /* Keeps text color white on hover */
text-decoration: none !important; text-decoration: none !important; /* Ensures no underline on hover */
background: none !important; background: none !important; /* Ensures no background color on hover */
} }
.title-column { .title-column {
color: darkblue; color: darkblue;
@ -114,7 +114,7 @@
<nav class="navbar navbar-inverse" style="background-color: rgb(103, 58, 183);"> <nav class="navbar navbar-inverse" style="background-color: rgb(103, 58, 183);">
<div class="container" style="background-color: rgb(103, 58, 183);"> <div class="container" style="background-color: rgb(103, 58, 183);">
<?php if ($this->session->userdata('logged_in')) : ?> <?php if ($this->session->userdata('logged_in')): ?>
<div class="navbar-header"> <div class="navbar-header">
<a class="navbar-brand" href="<?php echo base_url(); ?>">Google Forms</a> <a class="navbar-brand" href="<?php echo base_url(); ?>">Google Forms</a>
</div> </div>
@ -122,18 +122,18 @@
<div id="navbar"> <div id="navbar">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<?php if ($this->session->userdata('logged_in')) : ?> <?php if ($this->session->userdata('logged_in')): ?>
<li><a href="<?php echo base_url(); ?>published_forms">Published Forms</a></li> <li><a href="<?php echo base_url(); ?>published_forms">Published Forms</a></li>
<!-- <li><a href="<?php echo base_url(); ?>drafts">Drafts</a></li> --> <li><a href="<?php echo base_url(); ?>drafts">Drafts</a></li>
<?php endif; ?> <?php endif; ?>
</ul> </ul>
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<?php if (!$this->session->userdata('logged_in')) : ?> <?php if (!$this->session->userdata('logged_in')): ?>
<li><a href="<?php echo base_url(); ?>users/login">Login</a></li> <li><a href="<?php echo base_url(); ?>users/login">Login</a></li>
<li><a href="<?php echo base_url(); ?>users/register">Register</a></li> <li><a href="<?php echo base_url(); ?>users/register">Register</a></li>
<?php endif; ?> <?php endif; ?>
<?php if ($this->session->userdata('logged_in')) : ?> <?php if ($this->session->userdata('logged_in')): ?>
<li><a href="<?php echo base_url(); ?>title">Create Form</a></li> <li><a href="<?php echo base_url(); ?>title">Create Form</a></li>
<li><a href="<?php echo base_url(); ?>users/logout">Logout</a></li> <li><a href="<?php echo base_url(); ?>users/logout">Logout</a></li>
<?php endif; ?> <?php endif; ?>
@ -142,19 +142,19 @@
</div> </div>
</nav> </nav>
<div class="container"> <div class="container">
<?php if ($this->session->flashdata('user_registered')) : ?> <?php if ($this->session->flashdata('user_registered')): ?>
<p class="alert alert-success flash-message" id="flash-user-registered"><?php echo $this->session->flashdata('user_registered'); ?></p> <p class="alert alert-success flash-message" id="flash-user-registered"><?php echo $this->session->flashdata('user_registered'); ?></p>
<?php endif; ?> <?php endif; ?>
<?php if ($this->session->flashdata('login_failed')) : ?> <?php if ($this->session->flashdata('login_failed')): ?>
<p class="alert alert-danger flash-message" id="flash-login-failed"><?php echo $this->session->flashdata('login_failed'); ?></p> <p class="alert alert-danger flash-message" id="flash-login-failed"><?php echo $this->session->flashdata('login_failed'); ?></p>
<?php endif; ?> <?php endif; ?>
<?php if ($this->session->flashdata('user_loggedin')) : ?> <?php if ($this->session->flashdata('user_loggedin')): ?>
<p class="alert alert-success flash-message" id="flash-user-loggedin"><?php echo $this->session->flashdata('user_loggedin'); ?></p> <p class="alert alert-success flash-message" id="flash-user-loggedin"><?php echo $this->session->flashdata('user_loggedin'); ?></p>
<?php endif; ?> <?php endif; ?>
<?php if ($this->session->flashdata('user_loggedout')) : ?> <?php if ($this->session->flashdata('user_loggedout')): ?>
<p class="alert alert-success flash-message" id="flash-user-loggedout"><?php echo $this->session->flashdata('user_loggedout'); ?></p> <p class="alert alert-success flash-message" id="flash-user-loggedout"><?php echo $this->session->flashdata('user_loggedout'); ?></p>
<?php endif; ?> <?php endif; ?>
</div> </div>

View File

@ -1,4 +1,4 @@
<?php echo form_open('users/login/' . $form_id); ?> <?php echo form_open('users/login/'.$form_id); ?>
<div class="row"> <div class="row">
<div class="col-md-4 col-md-offset-4"> <div class="col-md-4 col-md-offset-4">
<h1 class="text-center"><?= $title; ?></h1> <h1 class="text-center"><?= $title; ?></h1>

View File

@ -1,99 +1,99 @@
<?php <?php
defined('BASEPATH') or exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html> ?><!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Welcome to CodeIgniter</title> <title>Welcome to CodeIgniter</title>
<style type="text/css"> <style type="text/css">
::selection { background-color: #E13300; color: white; } ::selection { background-color: #E13300; color: white; }
::-moz-selection { background-color: #E13300; color: white; } ::-moz-selection { background-color: #E13300; color: white; }
body { body {
background-color: #fff; background-color: #fff;
margin: 40px; margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif; font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155; color: #4F5155;
} }
a { a {
color: #003399; color: #003399;
background-color: transparent; background-color: transparent;
font-weight: normal; font-weight: normal;
text-decoration: none; text-decoration: none;
} }
a:hover { a:hover {
color: #97310e; color: #97310e;
} }
h1 { h1 {
color: #444; color: #444;
background-color: transparent; background-color: transparent;
border-bottom: 1px solid #D0D0D0; border-bottom: 1px solid #D0D0D0;
font-size: 19px; font-size: 19px;
font-weight: normal; font-weight: normal;
margin: 0 0 14px 0; margin: 0 0 14px 0;
padding: 14px 15px 10px 15px; padding: 14px 15px 10px 15px;
} }
code { code {
font-family: Consolas, Monaco, Courier New, Courier, monospace; font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px; font-size: 12px;
background-color: #f9f9f9; background-color: #f9f9f9;
border: 1px solid #D0D0D0; border: 1px solid #D0D0D0;
color: #002166; color: #002166;
display: block; display: block;
margin: 14px 0 14px 0; margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px; padding: 12px 10px 12px 10px;
} }
#body { #body {
margin: 0 15px 0 15px; margin: 0 15px 0 15px;
min-height: 96px; min-height: 96px;
} }
p { p {
margin: 0 0 10px; margin: 0 0 10px;
padding:0; padding:0;
} }
p.footer { p.footer {
text-align: right; text-align: right;
font-size: 11px; font-size: 11px;
border-top: 1px solid #D0D0D0; border-top: 1px solid #D0D0D0;
line-height: 32px; line-height: 32px;
padding: 0 10px 0 10px; padding: 0 10px 0 10px;
margin: 20px 0 0 0; margin: 20px 0 0 0;
} }
#container { #container {
margin: 10px; margin: 10px;
border: 1px solid #D0D0D0; border: 1px solid #D0D0D0;
box-shadow: 0 0 8px #D0D0D0; box-shadow: 0 0 8px #D0D0D0;
} }
</style> </style>
</head> </head>
<body> <body>
<div id="container"> <div id="container">
<h1>Welcome to CodeIgniter!</h1> <h1>Welcome to CodeIgniter!</h1>
<div id="body"> <div id="body">
<p>The page you are looking at is being generated dynamically by CodeIgniter.</p> <p>The page you are looking at is being generated dynamically by CodeIgniter.</p>
<p>If you would like to edit this page you'll find it located at:</p> <p>If you would like to edit this page you'll find it located at:</p>
<code>application/views/welcome_message.php</code> <code>application/views/welcome_message.php</code>
<p>The corresponding controller for this page is found at:</p> <p>The corresponding controller for this page is found at:</p>
<code>application/controllers/Welcome.php</code> <code>application/controllers/Welcome.php</code>
<p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="userguide3/">User Guide</a>.</p> <p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="userguide3/">User Guide</a>.</p>
</div> </div>
<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds. <?php echo (ENVIRONMENT === 'development') ? 'CodeIgniter Version <strong>' . CI_VERSION . '</strong>' : '' ?></p> <p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds. <?php echo (ENVIRONMENT === 'development') ? 'CodeIgniter Version <strong>' . CI_VERSION . '</strong>' : '' ?></p>
</div> </div>
</body> </body>

4646
assets/css/all.min.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,74 +1,76 @@
.form-header { .form-header {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-bottom: 10px; margin-bottom: 10px;
margin-top: -56px; margin-top: -56px;
} }
.form-title, .form-title,
.form-description { .form-description {
border: none; border: none;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
margin-bottom: 10px; margin-bottom: 10px;
padding-left: 0; padding-left: 0;
padding-right: 0; padding-right: 0;
width: 100%; width: 100%;
} }
.form-title:focus, .form-title:focus,
.form-description:focus { .form-description:focus {
box-shadow: none; box-shadow: none;
outline: none; outline: none;
border-bottom: 1px solid #007bff; border-bottom: 1px solid #007bff;
} }
.option { .option {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 5px; /* Space between options */ margin-bottom: 5px; /* Space between options */
} }
.option i.icon-transparent { .option i.icon-transparent {
opacity: 0.5; /* Make the icon transparent */ opacity: 0.5; /* Make the icon transparent */
margin-right: 10px; /* Space between icon and option box */ margin-right: 10px; /* Space between icon and option box */
font-size: 10px; /* Adjust icon size here */ font-size: 10px; /* Adjust icon size here */
} }
.option .form-control.option-label { .option .form-control.option-label {
flex: 1; /* Ensure the input field takes up the remaining space */ flex: 1; /* Ensure the input field takes up the remaining space */
} }
.option .delete-option-icon { .option .delete-option-icon {
margin-left: 10px; /* Space between option box and delete icon */ margin-left: 10px; /* Space between option box and delete icon */
cursor: pointer; /* Show pointer cursor on hover */ cursor: pointer; /* Show pointer cursor on hover */
} }
.option .form-control.option-label { .option .form-control.option-label {
width: 44%; /* Adjust the percentage as needed */ width: 44%; /* Adjust the percentage as needed */
flex: none; /* Ensure it doesn't automatically adjust its size based on the parent container */ flex: none; /* Ensure it doesn't automatically adjust its size based on the parent container */
} }
/* Style for the submit button */ /* Style for the submit button */
#submit-btn { #submit-btn {
display: block; display: block;
margin: 6px auto 30px 0; /* Top, Right, Bottom, Left Margin */ margin: 6px auto 30px 0; /* Top, Right, Bottom, Left Margin */
padding: 10px 20px; /* Adjust padding for button size */ padding: 10px 20px; /* Adjust padding for button size */
background-color: rgb(103, 58, 183); /* Button color */ background-color: rgb(103, 58, 183); /* Button color */
border-color: rgb(103, 58, 183); /* Border color */ border-color: rgb(103, 58, 183); /* Border color */
color: white; /* Text color */ color: white; /* Text color */
text-align: center; /* Center text inside the button */ text-align: center; /* Center text inside the button */
float: left; /* Align button to the left */ float: left; /* Align button to the left */
} }
/* Style for the container */ /* Style for the container */
.container { .container {
padding-bottom: 2px; /* Space between container content and bottom of the page */ padding-bottom: 2px; /* Space between container content and bottom of the page */
padding-top: none; padding-top: none;
} }
/* Optional: Adding padding to body */ /* Optional: Adding padding to body */
body { body {
padding-bottom: 10px; /* Space between page content and bottom of the viewport */ padding-bottom: 10px; /* Space between page content and bottom of the viewport */
} }
#add-section-btn { #add-section-btn {
position: relative; /* Position relative to its normal position */ position: relative; /* Position relative to its normal position */
left: -350px; /* Move 20px to the right from its normal position */ left: -350px; /* Move 20px to the right from its normal position */
top: 80px; /* Move 10px down from its normal position */ top: 80px; /* Move 10px down from its normal position */
} }

View File

@ -1,86 +1,85 @@
body { body {
background-color: rgb(240, 235, 248); background-color: rgb(240, 235, 248);
} }
.container { .container {
position: relative; position: relative;
} }
.btn-success { .btn-success {
position: relative; position: relative;
left: 250px; left: 250px;
top: -10px; top: -10px;
margin-bottom: 20px; margin-bottom: 20px;
} }
.form-header { .form-header {
/* position: absolute; */ /* position: absolute; */
left: 13px; left: 13px;
text-align: left; text-align: left;
} }
.container { .container {
margin-top: 30px; margin-top: 30px;
} }
.form-header { .form-header {
background-color: white; background-color: white;
padding: 20px; padding: 20px;
margin-left: 240px; margin-left: 240px;
border-radius: 10px 10px 0 0; border-radius: 10px 10px 0 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
border-top: 10px solid rgb(103, 58, 183); border-top: 10px solid rgb(103, 58, 183);
width: 56%; width: 56%;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin-bottom: 20px; margin-bottom: 20px;
} }
.form-header h2, .form-header h2, .form-header h4 {
.form-header h4 { margin: 0;
margin: 0; text-align: left;
text-align: left;
} }
.form-header h4 { .form-header h4 {
color: rgba(0, 0, 0, 0.5); color: rgba(0, 0, 0, 0.5);
} }
.form-section { .form-section {
background-color: white; background-color: white;
margin-bottom: 30px; margin-bottom: 30px;
border-radius: 10px; border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
padding: 20px; padding: 20px;
} }
.question-section { .question-section {
margin-bottom: 10px; margin-bottom: 10px;
} }
.question-label { .question-label {
font-weight: bold; font-weight: bold;
} }
.options-container { .options-container {
margin-top: 10px; margin-top: 10px;
} }
.option { .option {
margin-bottom: 10px; margin-bottom: 10px;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.option input[type='checkbox'] { .option input[type="checkbox"] {
margin-right: 10px; margin-right: 10px;
width: 16px; /* Adjust size of checkbox */ width: 16px; /* Adjust size of checkbox */
height: 16px; /* Adjust size of checkbox */ height: 16px; /* Adjust size of checkbox */
} }
.option input[type='radio'] { .option input[type="radio"] {
margin-right: 10px; margin-right: 10px;
width: 16px; /* Adjust size of radio button */ width: 16px; /* Adjust size of radio button */
height: 16px; /* Adjust size of radio button */ height: 16px; /* Adjust size of radio button */
} }
.option label { .option label {
margin: 0; margin: 0;
} }
.btn-success { .btn-success {
margin-top: 20px; margin-top: 20px;
position: relative; position: relative;
left: 247px; left: 247px;
background-color: rgb(103, 58, 183); background-color: rgb(103, 58, 183);
border-color: rgb(103, 58, 183); border-color: rgb(103, 58, 183);
color: white; color: white;
} }

View File

@ -1,57 +1,61 @@
.navbar-container { .navbar-container {
max-width: 100%; max-width: 100%;
margin: 0 auto; margin: 0 auto;
padding: 0 15px; padding: 0 15px;
} }
/* Navbar styles */ /* Navbar styles */
.navbar-custom { .navbar-custom {
background-color: rgb(103, 58, 183); background-color: rgb(103, 58, 183);
border-radius: 0; border-radius: 0;
height: 70px; height: 70px;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0; padding: 0;
} }
/* Brand styling */ /* Brand styling */
.navbar-custom .navbar-brand { .navbar-custom .navbar-brand {
color: #fff; color: #fff;
font-size: 19px; font-size: 19px;
margin-right: 20px; margin-right: 20px;
padding: 15px 10px; padding: 15px 10px;
} }
.navbar-custom .navbar-nav { .navbar-custom .navbar-nav {
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: -17px; margin-left: -17px;
padding: 0; padding: 0;
flex: 1; flex: 1;
} }
.navbar-custom .navbar-nav li { .navbar-custom .navbar-nav li {
margin: 0 10px; margin: 0 10px;
} }
.navbar-custom .navbar-nav li a { .navbar-custom .navbar-nav li a {
color: #fff; color: #fff;
background-color: transparent; background-color: transparent;
font-size: 15px; font-size: 15px;
height: 70px; height: 70px;
padding: 15px 10px; padding: 15px 10px;
transition: none; transition: none;
} }
.navbar-custom .navbar-nav.navbar-right { .navbar-custom .navbar-nav.navbar-right {
margin-left: auto; margin-left: auto;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.navbar-custom .navbar-nav.navbar-right li { .navbar-custom .navbar-nav.navbar-right li {
margin: 0 10px; margin: 0 10px;
} }
#add-section-btn { #add-section-btn {
position: absolute; position: absolute;
} }

View File

@ -1,137 +1,140 @@
body { body {
background-color: rgb(240, 235, 248); background-color: rgb(240, 235, 248);
margin: 0; /* Remove default margin */ margin: 0; /* Remove default margin */
padding: 0; /* Remove default padding */ padding: 0; /* Remove default padding */
font-family: Arial, sans-serif; /* Ensure a consistent font */ font-family: Arial, sans-serif; /* Ensure a consistent font */
} }
.container { .container {
margin-top: 10px; margin-top: 10px;
padding: 0 10px; /* Add padding for smaller screens */ padding: 0 10px; /* Add padding for smaller screens */
} }
.form-section { .form-section {
background-color: white; background-color: white;
width: 56%; width: 56%;
max-width: 100%; /* Ensure it doesn't exceed the container width */ max-width: 100%; /* Ensure it doesn't exceed the container width */
margin-bottom: 30px; margin-bottom: 30px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
padding: 20px; padding: 20px;
position: relative; position: relative;
align-items: center; align-items: center;
border-radius: 10px; border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
} }
.form-header { .form-header {
background-color: white; background-color: white;
padding: 20px; padding: 20px;
margin-bottom: 10px; margin-bottom: 10px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
border-radius: 10px 10px 0 0; border-radius: 10px 10px 0 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
align-items: left; align-items: left;
position: relative; position: relative;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-top: 10px solid rgb(103, 58, 183); border-top: 10px solid rgb(103, 58, 183);
width: 56%; width: 56%;
max-width: 100%; /* Ensure it doesn't exceed the container width */ max-width: 100%; /* Ensure it doesn't exceed the container width */
} }
.form-section h2 { .form-section h2 {
text-align: center; text-align: center;
margin-bottom: 30px; margin-bottom: 30px;
} }
.form-section .question-section { .form-section .question-section {
margin-bottom: 20px; margin-bottom: 20px;
} }
/* Navbar custom styles */ /* Navbar custom styles */
.navbar-custom { .navbar-custom {
background-color: rgb(103, 58, 183); background-color: rgb(103, 58, 183);
color: white; color: white;
border-radius: none; border-radius: none;
width: 100%; /* Ensure full width */ width: 100%; /* Ensure full width */
display: flex; display: flex;
justify-content: space-between; /* Space items apart */ justify-content: space-between; /* Space items apart */
padding: 10px; padding: 10px;
box-sizing: border-box; box-sizing: border-box;
flex-wrap: wrap; /* Allow items to wrap on smaller screens */ flex-wrap: wrap; /* Allow items to wrap on smaller screens */
} }
.navbar-custom .navbar-brand, .navbar-custom .navbar-brand,
.navbar-custom .navbar-nav > li > a { .navbar-custom .navbar-nav > li > a {
color: white; color: white;
font-size: 16px; font-size: 16px;
transition: color 0.3s ease; transition: color 0.3s ease;
padding: 10px; padding: 10px;
text-align: center; /* Center text */ text-align: center; /* Center text */
flex: 1; /* Allow items to grow/shrink to fill space */ flex: 1; /* Allow items to grow/shrink to fill space */
} }
#submit-btn { #submit-btn {
margin-top: 20px; margin-top: 20px;
float: left; float: left;
clear: both; clear: both;
width: 100%; /* Make submit button full width */ width: 100%; /* Make submit button full width */
} }
/* Utility classes */ /* Utility classes */
.text-center { .text-center {
text-align: center; text-align: center;
} }
.margin-bottom-20 { .margin-bottom-20 {
margin-bottom: 20px; margin-bottom: 20px;
} }
.padding-10 { .padding-10 {
padding: 10px; padding: 10px;
} }
.post-date { .post-date{
background: #f4f4f4; background: #f4f4f4;
padding: 4px; padding: 4px;
margin: 3px 0; margin: 3px 0;
display: block; display: block;
} }
.post-thumb { .post-thumb{
width: 100%; width: 100%;
} }
.pagination-link { .pagination-link{
margin: 30px 0; margin: 30px 0;
} }
.pagination-links strong { .pagination-links strong{
padding: 8px 13px; padding: 8px 13px;
margin: 5px; margin: 5px;
background: #f4f4f4; background: #f4f4f4;
border: 1px #ccc solid; border: 1px #ccc solid;
} }
a.pagination-link { a.pagination-link{
padding: 8px 13px; padding: 8px 13px;
margin: 5px; margin: 5px;
background: #f4f4f4; background: #f4f4f4;
border: 1px #ccc solid; border: 1px #ccc solid;
} }
.cat-delete { .cat-delete{
display: inline; display: inline;
} }
#basetable1 { #basetable1 {
border: 1px solid #3333336c; /* Darker border color */ border: 1px solid #3333336c; /* Darker border color */
} }
#basetable1 th, #basetable1 th, #basetable1 td {
#basetable1 td { border: 1px solid #3333336c; /* Darker border color for table cells */
border: 1px solid #3333336c; /* Darker border color for table cells */
} }

1808
assets/css/jquery-ui.css vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,65 +1,57 @@
body { body { background-color: rgb(240, 235, 248); }
background-color: rgb(240, 235, 248); .container { margin-top: 30px; }
}
.container {
margin-top: 30px;
}
.form-header { .form-header {
background-color: white; background-color: white;
padding: 20px; padding: 20px;
margin-left: 240px; margin-left: 240px;
border-radius: 10px 10px 0 0; border-radius: 10px 10px 0 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
border-top: 10px solid rgb(103, 58, 183); border-top: 10px solid rgb(103, 58, 183);
width: 56%; width: 56%;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin-bottom: 20px; margin-bottom: 20px;
}
.form-header h2 {
margin: 0;
}
.form-header h4 {
color: rgba(0, 0, 0, 0.5);
} }
.form-header h2 { margin: 0; }
.form-header h4 { color: rgba(0, 0, 0, 0.5); }
.form-section { .form-section {
background-color: white; background-color: white;
width: 56%; width: 56%;
margin-left: 240px; margin-left: 240px;
padding: 20px; padding: 20px;
border-radius: 10px; border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin-bottom: 30px; margin-bottom: 30px;
} }
.question-container { .question-container {
border: 1px solid #ddd; border: 1px solid #ddd;
padding: 15px; padding: 15px;
border-radius: 5px; border-radius: 5px;
background-color: #f9f9f9; background-color: #f9f9f9;
margin-bottom: 20px; margin-bottom: 20px;
} }
.option { .option {
margin-bottom: 10px; margin-bottom: 10px;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.option input[type='radio'], .option input[type="radio"],
.option input[type='checkbox'] { .option input[type="checkbox"] {
margin-right: 10px; margin-right: 10px;
} }
.required-field::after { .required-field::after {
content: '*'; content: '*';
color: red; color: red;
margin-left: 5px; margin-left: 5px;
} }
.form-section { .form-section {
background-color: white; background-color: white;
margin-bottom: 30px; margin-bottom: 30px;
border-radius: 10px; border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
padding: 20px; padding: 20px;
} }
.question-container { .question-container {
margin-bottom: 20px; margin-bottom: 20px;
} }

View File

@ -1,239 +1,247 @@
body { body {
background-color: rgb(240, 235, 248); background-color: rgb(240, 235, 248);
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
} }
.form-section h2 { .form-section h2 {
text-align: center; text-align: center;
margin-bottom: 30px; margin-bottom: 30px;
} }
.form-section .question-section { .form-section .question-section {
margin-bottom: 20px; margin-bottom: 20px;
} }
/* Navbar custom styles */ /* Navbar custom styles */
.container { .container {
position: relative; position: relative;
margin-top: 30px; margin-top: 30px;
}
.form_container_top {
box-sizing: border-box;
margin-top: 10px;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: 400;
line-height: 100%;
width: 100%;
border: none;
outline: none;
border-bottom: 1px solid #f4f4f9;
color: black;
height: 20px;
} }
.form_container_top{
box-sizing: border-box;
margin-top: 10px;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: 400;
line-height: 100%;
width: 100%;
border: none;
outline: none;
border-bottom: 1px solid #f4f4f9;
color: black;
height: 20px;
}
/* Form header styles */ /* Form header styles */
.form-header { .form-header {
background-color: white; background-color: white;
padding: 20px; padding: 20px;
margin-bottom: 10px; margin-bottom: 10px;
margin-left: 240px; margin-left: 240px;
border-radius: 10px 10px 0 0; border-radius: 10px 10px 0 0;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
position: relative; position: relative;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-top: 10px solid rgb(103, 58, 183); border-top: 10px solid rgb(103, 58, 183);
width: 56%; width: 56%;
} }
.form-header h2 { .form-header h2 {
flex: 1; flex: 1;
text-align: center; text-align: center;
margin: 0; margin: 0;
} }
#preview-btn { #preview-btn {
margin-right: 10px; margin-right: 10px;
background-color: rgb(103, 58, 183); background-color: rgb(103, 58, 183);
border-color: #007bff; border-color: #007bff;
border-radius: 100%; border-radius: 100%;
width: 33px; width: 33px;
height: 33px; height: 33px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
#preview-btn i { #preview-btn i {
margin-right: 0; margin-right: 0;
font-size: 1.5em; font-size: 1.5em;
} }
#add-section-btn { #add-section-btn {
position: absolute; position: absolute;
left: -60px; left: -60px;
top: 24px; top: 24px;
z-index: 1000; z-index: 1000;
border-radius: 50%; border-radius: 50%;
background-color: rgb(103, 58, 183); background-color: rgb(103, 58, 183);
} }
.form-section { .form-section {
background-color: white; background-color: white;
width: 56%; width: 56%;
margin-bottom: 30px; margin-bottom: 30px;
margin-left: 240px; margin-left: 240px;
padding: 20px; padding: 20px;
position: relative; position: relative;
align-items: center; align-items: center;
border-radius: 10px; border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transition: transform 0.3s; transition: transform 0.3s;
} }
.form-section.active { .form-section.active {
border-left: 6px solid rgb(66, 133, 244); border-left: 6px solid rgb(66, 133, 244);
transform: scale(1.02); transform: scale(1.02);
} }
.header-row { .header-row {
display: flex; display: flex;
align-items: baseline; align-items: baseline;
position: relative; position: relative;
} }
.untitled-question { .untitled-question {
flex: 1; flex: 1;
margin-right: 10px; margin-right: 10px;
width: calc(100% - 230px); width: calc(100% - 230px);
} }
.custom-select { .custom-select {
width: 220px; width: 220px;
height: 39px; height: 39px;
display: block; display: block;
padding: -20px 15px; padding: -20px 15px;
font-size: 15px; font-size: 15px;
line-height: 1.42857143; line-height: 1.42857143;
background-color: #ffffff; background-color: #ffffff;
background-image: none; background-image: none;
border: 1px solid #dce4ec; border: 1px solid #dce4ec;
border-radius: 4px; border-radius: 4px;
} }
.delete-section-icon { .delete-section-icon {
flex: 0.1; flex: 0.1;
cursor: pointer; cursor: pointer;
color: grey; color: grey;
font-size: 1.1em; font-size: 1.1em;
margin-left: 10px; margin-left: 10px;
} }
.options-container { .options-container {
margin-top: 20px; margin-top: 20px;
} }
.options-container select { .options-container select {
list-style-type: none; list-style-type: none;
} }
.form-section textarea { .form-section textarea {
margin-top: 20px; margin-top: 20px;
} }
.option { .option {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 5px; margin-bottom: 5px;
} }
.option input[type='radio'], .option input[type="radio"],
.option input[type='checkbox'] { .option input[type="checkbox"] {
margin-right: 10px; margin-right: 10px;
} }
.option .delete-option-icon { .option .delete-option-icon {
margin-left: 10px; margin-left: 10px;
cursor: pointer; cursor: pointer;
color: grey; color: grey;
font-size: 1.5em; font-size: 1.5em;
} }
.option-label { .option-label {
width: 42%; width: 42%;
text-align: left; text-align: left;
} }
.add-option-btn { .add-option-btn {
background-color: rgb(66, 133, 244); background-color: rgb(66, 133, 244);
/* color: rgb(66, 133, 244); */ /* color: rgb(66, 133, 244); */
margin-top: 11px; margin-top: 11px;
font-size: 0.8em; font-size: 0.8em;
} }
.ui-state-highlight { .ui-state-highlight {
background-color: transparent !important; background-color: transparent !important;
border: none !important; border: none !important;
margin-bottom: 10px; margin-bottom: 10px;
border-radius: 10px; border-radius: 10px;
width: 56%; width: 56%;
margin-left: 240px; margin-left: 240px;
} }
.toggle-switch { .toggle-switch {
position: relative; position: relative;
display: inline-block; display: inline-block;
width: 34px; width: 34px;
height: 20px; height: 20px;
margin-left: 10px; margin-left: 10px;
} }
.toggle-switch input { .toggle-switch input {
opacity: 0; opacity: 0;
width: 0; width: 0;
height: 0; height: 0;
} }
.slider { .slider {
position: absolute; position: absolute;
cursor: pointer; cursor: pointer;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
background-color: #ccc; background-color: #ccc;
transition: 0.4s; transition: .4s;
border-radius: 34px; border-radius: 34px;
} }
.slider:before { .slider:before {
position: absolute; position: absolute;
content: ''; content: "";
height: 14px; height: 14px;
width: 14px; width: 14px;
left: 3px; left: 3px;
bottom: 3px; bottom: 3px;
background-color: white; background-color: white;
transition: 0.4s; transition: .4s;
border-radius: 50%; border-radius: 50%;
} }
input:checked + .slider { input:checked + .slider {
background-color: rgb(103, 58, 183); background-color: rgb(103, 58, 183);
} }
input:checked + .slider:before { input:checked + .slider:before {
transform: translateX(14px); transform: translateX(14px);
} }
.body_header_bg { .body_header_bg{
background-color: rgb(240, 235, 248); background-color: rgb(240,235,248);
} }
table a:not(.btn) { table a:not(.btn) {
color: blue !important; color: blue !important;
} }
table a:not(.btn):hover { table a:not(.btn):hover {
color: darkblue !important; color: darkblue !important;
} }
/* .btn-success { /* .btn-success {
color: #ffffff; color: #ffffff;
@ -241,31 +249,32 @@ table a:not(.btn):hover {
border-color: rgb(103, 58, 183); border-color: rgb(103, 58, 183);
} */ } */
.btn-custom { .btn-custom {
margin-top: 20px; margin-top: 20px;
position: relative; position: relative;
left: 240px; left: 240px;
background-color: rgb(103, 58, 183); background-color: rgb(103, 58, 183);
border-color: rgb(103, 58, 183); border-color: rgb(103, 58, 183);
color: white; color: white;
} }
/* Assuming you have a stylesheet named styles.css */ /* Assuming you have a stylesheet named styles.css */
.btn.btn-primary.btn-block { .btn.btn-primary.btn-block {
margin-top: 20px; margin-top: 20px;
position: relative; position: relative;
background-color: rgb(103, 58, 183); background-color: rgb(103, 58, 183);
border-color: rgb(103, 58, 183); border-color: rgb(103, 58, 183);
color: white; color: white;
} }
.flash-message { .flash-message {
opacity: 1; opacity: 1;
transition: opacity 1s ease-out; transition: opacity 1s ease-out;
position: relative; position: relative;
margin-bottom: 15px; margin-bottom: 15px;
} }
.error-message { .error-message {
color: red; color: red;
font-size: 0.875em; font-size: 0.875em;
margin-top: 5px; margin-top: 5px;
display: none; display: none;
} }

View File

@ -1,220 +1,220 @@
body { body {
background-color: rgb(240, 235, 248); background-color: rgb(240, 235, 248);
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
} }
.container { .container {
position: relative; position: relative;
margin-top: 30px; margin-top: 30px;
} }
.form_container_top { .form_container_top {
box-sizing: border-box; box-sizing: border-box;
margin-top: 10px; margin-top: 10px;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
font-size: 13px; font-size: 13px;
font-weight: 400; font-weight: 400;
line-height: 100%; line-height: 100%;
width: 100%; width: 100%;
border: none; border: none;
outline: none; outline: none;
border-bottom: 1px solid #f4f4f9; border-bottom: 1px solid #f4f4f9;
color: black; color: black;
height: 20px; height: 20px;
} }
.form-header { .form-header {
background-color: white; background-color: white;
padding: 20px; padding: 20px;
margin-bottom: 10px; margin-bottom: 10px;
margin-left: 240px; margin-left: 240px;
border-radius: 10px 10px 0 0; border-radius: 10px 10px 0 0;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
position: relative; position: relative;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-top: 10px solid rgb(103, 58, 183); border-top: 10px solid rgb(103, 58, 183);
width: 56%; width: 56%;
} }
.form-header h2 { .form-header h2 {
flex: 1; flex: 1;
text-align: center; text-align: center;
margin: 0; margin: 0;
} }
#preview-btn { #preview-btn {
margin-right: 10px; margin-right: 10px;
background-color: rgb(103, 58, 183); background-color: rgb(103, 58, 183);
border-color: #007bff; border-color: #007bff;
border-radius: 50%; border-radius: 50%;
width: 33px; width: 33px;
height: 33px; height: 33px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
#preview-btn i { #preview-btn i {
font-size: 1.5em; font-size: 1.5em;
color: white; color: white;
} }
#add-section-btn { #add-section-btn {
position: absolute; position: absolute;
left: -60px; left: -60px;
top: 24px; top: 24px;
z-index: 1000; z-index: 1000;
border-radius: 50%; border-radius: 50%;
background-color: rgb(103, 58, 183); background-color: rgb(103, 58, 183);
color: white; color: white;
width: 40px; width: 40px;
height: 40px; height: 40px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: 1.5em; font-size: 1.5em;
cursor: pointer; cursor: pointer;
} }
.form-section { .form-section {
background-color: white; background-color: white;
width: 56%; width: 56%;
margin-bottom: 30px; margin-bottom: 30px;
margin-left: 240px; margin-left: 240px;
padding: 20px; padding: 20px;
position: relative; position: relative;
border-radius: 10px; border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transition: transform 0.3s; transition: transform 0.3s;
} }
.form-section.active { .form-section.active {
border-left: 6px solid rgb(66, 133, 244); border-left: 6px solid rgb(66, 133, 244);
transform: scale(1.02); transform: scale(1.02);
} }
.header-row { .header-row {
display: flex; display: flex;
align-items: center; align-items: center;
position: relative; position: relative;
} }
.untitled-question { .untitled-question {
flex: 1; flex: 1;
margin-right: 10px; margin-right: 10px;
width: calc(100% - 230px); width: calc(100% - 230px);
} }
.custom-select { .custom-select {
width: 220px; width: 220px;
} }
.delete-section-icon { .delete-section-icon {
cursor: pointer; cursor: pointer;
color: grey; color: grey;
font-size: 1.1em; font-size: 1.1em;
} }
.options-container { .options-container {
margin-top: 20px; margin-top: 20px;
} }
.options-container select { .options-container select {
list-style-type: none; list-style-type: none;
} }
.form-section textarea { .form-section textarea {
margin-top: 20px; margin-top: 20px;
} }
.option { .option {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 5px; margin-bottom: 5px;
} }
.option input[type='radio'], .option input[type="radio"],
.option input[type='checkbox'] { .option input[type="checkbox"] {
margin-right: 10px; margin-right: 10px;
} }
.option .delete-option-icon { .option .delete-option-icon {
margin-left: 10px; margin-left: 10px;
cursor: pointer; cursor: pointer;
color: grey; color: grey;
font-size: 1.5em; font-size: 1.5em;
} }
.option-label { .option-label {
width: 42%; width: 42%;
text-align: left; text-align: left;
} }
.add-option-btn { .add-option-btn {
background-color: #f0f0f0; background-color: #f0f0f0;
color: #333; color: #333;
margin-top: 11px; margin-top: 11px;
font-size: 0.9em; font-size: 0.9em;
} }
.ui-state-highlight { .ui-state-highlight {
background-color: transparent !important; background-color: transparent !important;
border: none !important; border: none !important;
margin-bottom: 10px; margin-bottom: 10px;
border-radius: 10px; border-radius: 10px;
width: 56%; width: 56%;
margin-left: 240px; margin-left: 240px;
} }
/* Toggle Switch CSS */ /* Toggle Switch CSS */
.toggle-switch { .toggle-switch {
position: relative; position: relative;
display: inline-block; display: inline-block;
width: 34px; width: 34px;
height: 20px; height: 20px;
margin-left: 10px; margin-left: 10px;
} }
.toggle-switch input { .toggle-switch input {
opacity: 0; opacity: 0;
width: 0; width: 0;
height: 0; height: 0;
} }
.slider { .slider {
position: absolute; position: absolute;
cursor: pointer; cursor: pointer;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
background-color: #ccc; background-color: #ccc;
transition: 0.4s; transition: .4s;
border-radius: 34px; border-radius: 34px;
} }
.slider:before { .slider:before {
position: absolute; position: absolute;
content: ''; content: "";
height: 14px; height: 14px;
width: 14px; width: 14px;
left: 3px; left: 3px;
bottom: 3px; bottom: 3px;
background-color: white; background-color: white;
transition: 0.4s; transition: .4s;
border-radius: 50%; border-radius: 50%;
} }
input:checked + .slider { input:checked + .slider {
background-color: rgb(103, 58, 183); background-color: rgb(103, 58, 183);
} }
input:checked + .slider:before { input:checked + .slider:before {
transform: translateX(14px); transform: translateX(14px);
} }
.body_header_bg { .body_header_bg {
background-color: rgb(240, 235, 248); background-color: rgb(240, 235, 248);
} }

View File

@ -1,50 +0,0 @@
// src/index.js
// Example function to add two numbers
function add(a, b) {
return a + b
}
// Example usage of the add function
const result = add(5, 10)
console.log('The result is:', result)
// Example object with properties
const person = {
name: 'John Doe',
age: 30,
greet: function () {
console.log(
`Hello, my name is ${this.name} and I am ${this.age} years old.`
)
},
}
// Call the greet method
person.greet()
// Example of an arrow function
const multiply = (x, y) => x * y
console.log('The product is:', multiply(4, 5))
// Example of a variable declared with let
let count = 0
for (let i = 0; i < 5; i++) {
count += i
}
console.log('The count is:', count)
// Example of a variable declared with const
const message = 'This is a constant message.'
console.log(message)
// Example of a function with default parameters
function greet(name = 'Guest') {
console.log(`Welcome, ${name}!`)
}
// Call the function with and without arguments
greet('Alice')
greet()

View File

@ -1,8 +1,8 @@
$(document).ready(function () { $(document).ready(function() {
var base_url = '<?php echo base_url(); ?>'; var base_url = '<?php echo base_url(); ?>';
// Add section button functionality // Add section button functionality
$('#add-section-btn').on('click', function () { $('#add-section-btn').on('click', function() {
var sectionHtml = ` var sectionHtml = `
<div class="form-section" data-type=""> <div class="form-section" data-type="">
<div class="header-row"> <div class="header-row">
@ -21,12 +21,14 @@ $(document).ready(function () {
<span class="delete-section-icon"><i class="fas fa-trash-alt"></i></span> <span class="delete-section-icon"><i class="fas fa-trash-alt"></i></span>
</div> </div>
<div class="options-container"></div> <div class="options-container"></div>
<button class="btn btn-secondary add-option-btn" style="display: none;">Add Option</button></div> <button class="btn btn-secondary add-option-btn" style="display: none;">Add Option</button>
`; $('#form-container').append(sectionHtml); </div>
`;
$('#form-container').append(sectionHtml);
}); });
// Add option button functionality // Add option button functionality
$(document).on('click', '.add-option-btn', function () { $(document).on('click', '.add-option-btn', function() {
var optionHtml = ` var optionHtml = `
<div class="option"> <div class="option">
<input type="text" class="form-control option-label" placeholder="Option"> <input type="text" class="form-control option-label" placeholder="Option">
@ -37,17 +39,17 @@ $(document).ready(function () {
}); });
// Delete option functionality // Delete option functionality
$(document).on('click', '.delete-option-icon', function () { $(document).on('click', '.delete-option-icon', function() {
$(this).parent().remove(); $(this).parent().remove();
}); });
// Delete section functionality // Delete section functionality
$(document).on('click', '.delete-section-icon', function () { $(document).on('click', '.delete-section-icon', function() {
$(this).closest('.form-section').remove(); $(this).closest('.form-section').remove();
}); });
// Show/Hide "Add Option" button based on question type // Show/Hide "Add Option" button based on question type
$(document).on('change', '.custom-select', function () { $(document).on('change', '.custom-select', function() {
var type = $(this).val(); var type = $(this).val();
var $section = $(this).closest('.form-section'); var $section = $(this).closest('.form-section');
if (type === 'multiple-choice' || type === 'checkboxes' || type === 'dropdown') { if (type === 'multiple-choice' || type === 'checkboxes' || type === 'dropdown') {
@ -58,9 +60,9 @@ $(document).ready(function () {
}).trigger('change'); // Trigger change to apply to existing sections }).trigger('change'); // Trigger change to apply to existing sections
// Submit button functionality // Submit button functionality
$('#submit-btn').on('click', function () { $('#submit-btn').on('click', function() {
var formData = collectFormData(); var formData = collectFormData();
formData['form_id'] = <? php echo $form['id']; ?>; formData['form_id'] = <?php echo $form['id']; ?>;
let validation = validateFormData(formData); let validation = validateFormData(formData);
if (!validation.isValid) { if (!validation.isValid) {
@ -73,7 +75,7 @@ $(document).ready(function () {
type: 'POST', type: 'POST',
data: { formData: formData }, data: { formData: formData },
dataType: 'JSON', dataType: 'JSON',
success: function (response) { success: function(response) {
if (response.status === 'success') { if (response.status === 'success') {
alert('Form updated successfully!'); alert('Form updated successfully!');
window.location.href = base_url + 'Form_controller/index_forms_draft'; window.location.href = base_url + 'Form_controller/index_forms_draft';
@ -81,7 +83,7 @@ $(document).ready(function () {
alert(response.message); alert(response.message);
} }
}, },
error: function (error) { error: function(error) {
alert('Error updating form!'); alert('Error updating form!');
console.log(error); console.log(error);
} }
@ -96,7 +98,7 @@ $(document).ready(function () {
questions: [] questions: []
}; };
$('.form-section').each(function () { $('.form-section').each(function() {
var questionData = { var questionData = {
id: $(this).data('index'), id: $(this).data('index'),
text: $(this).find('.untitled-question').val(), text: $(this).find('.untitled-question').val(),
@ -105,7 +107,7 @@ $(document).ready(function () {
options: [] options: []
}; };
$(this).find('.option-label').each(function () { $(this).find('.option-label').each(function() {
questionData.options.push($(this).val()); questionData.options.push($(this).val());
}); });

38887
assets/js/jquery-ui.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +1,32 @@
$(document).ready(function () { $(document).ready(function() {
let index = 1 let index = 1;
let activeSection = null let activeSection = null;
function addOption(type, container) { function addOption(type, container) {
// let optionIndex = container.children().length + 1; // let optionIndex = container.children().length + 1;
let optionHtml let optionHtml;
if (type === 'multiple-choice' || type === 'checkboxes') { if (type === 'multiple-choice' || type === 'checkboxes') {
optionHtml = ` optionHtml = `
<div class="option"> <div class="option">
<input type="${type === 'multiple-choice' ? 'radio' : 'checkbox'}" disabled> <input type="${type === 'multiple-choice' ? 'radio' : 'checkbox'}" disabled>
<input type="text" class="form-control option-label" > <input type="text" class="form-control option-label" >
<span class="delete-option-icon">&times;</span> <span class="delete-option-icon">&times;</span>
</div> </div>
` `;
} else if (type === 'dropdown') { }
optionHtml = ` else if (type === 'dropdown') {
optionHtml = `
<div class="option"> <div class="option">
<input type="text" class="form-control option-label"> <input type="text" class="form-control option-label">
<span class="delete-option-icon">&times;</span> <span class="delete-option-icon">&times;</span>
</div> </div>
` `;
} }
container.append(optionHtml) container.append(optionHtml);
} }
function createFormSection() { function createFormSection() {
let newSection = ` let newSection = `
<div class="form-section" data-index="${index}"> <div class="form-section" data-index="${index}">
<div class="header-row"> <div class="header-row">
${index === 1 ? '<div class="violet-border"></div>' : ''} ${index === 1 ? '<div class="violet-border"></div>' : ''}
@ -44,101 +45,89 @@ $(document).ready(function () {
</div> </div>
<div class="options-container"></div> <div class="options-container"></div>
</div> </div>
` `;
$('#form-container').append(newSection) $('#form-container').append(newSection);
index++ index++;
positionAddSectionButton() positionAddSectionButton();
}
function positionAddSectionButton() {
if (activeSection) {
let position = activeSection.position()
let buttonWidth = $('#add-section-btn').outerWidth()
let buttonHeight = $('#add-section-btn').outerHeight()
$('#add-section-btn').css({
position: 'absolute',
left: position.left - buttonWidth - 47 + 'px',
top:
position.top + activeSection.height() / 2 - buttonHeight / 2 + 'px',
})
} }
}
$('#add-section-btn').on('click', function () { function positionAddSectionButton() {
createFormSection() if (activeSection) {
$('.form-section').removeClass('active') let position = activeSection.position();
activeSection = $('.form-section').last() let buttonWidth = $('#add-section-btn').outerWidth();
activeSection.addClass('active') let buttonHeight = $('#add-section-btn').outerHeight();
positionAddSectionButton()
})
$(document).on('change', '.custom-select', function () { $('#add-section-btn').css({
let type = $(this).val() position: 'absolute',
let container = $(this).closest('.form-section').find('.options-container') left: position.left - buttonWidth - 47 + 'px',
container.empty() top: position.top + activeSection.height() / 2 - buttonHeight / 2 + 'px'
$(this).closest('.form-section').find('.add-option-btn').remove() });
}
if (type === 'short-answer') {
container.append(
'<input type="text" class="form-control" disabled placeholder="Short answer text">'
)
} else if (type === 'paragraph') {
container.append(
'<textarea class="form-control" disabled placeholder="Paragraph text"></textarea>'
)
} else {
addOption(type, container)
$(this)
.closest('.form-section')
.append(
'<button class="btn btn-secondary add-option-btn">Add Option</button>'
)
} }
})
$(document).on('click', '.add-option-btn', function () { $('#add-section-btn').on('click', function() {
let type = $(this).closest('.form-section').find('.custom-select').val() createFormSection();
let container = $(this).closest('.form-section').find('.options-container') $('.form-section').removeClass('active');
addOption(type, container) activeSection = $('.form-section').last();
}) activeSection.addClass('active');
positionAddSectionButton();
});
$(document).on('click', '.delete-section-icon', function () { $(document).on('change', '.custom-select', function() {
let section = $(this).closest('.form-section') let type = $(this).val();
let prevSection = section.prev('.form-section') let container = $(this).closest('.form-section').find('.options-container');
let nextSection = section.next('.form-section') container.empty();
section.remove() $(this).closest('.form-section').find('.add-option-btn').remove();
if (section.hasClass('active')) {
activeSection = null
}
if (prevSection.length > 0) {
prevSection
.find('.delete-section-icon')
.appendTo(prevSection.find('.form-section'))
activeSection = prevSection
row
} else if (nextSection.length > 0) {
nextSection
.find('.delete-section-icon')
.appendTo(nextSection.find('.form-header'))
activeSection = nextSection
}
positionAddSectionButton()
})
$(document).on('click', '.delete-option-icon', function () { if (type === 'short-answer') {
let option = $(this).closest('.option') container.append('<input type="text" class="form-control" disabled placeholder="Short answer text">');
let container = option.closest('.options-container') } else if (type === 'paragraph') {
option.remove() container.append('<textarea class="form-control" disabled placeholder="Paragraph text"></textarea>');
}) } else {
addOption(type, container);
$(this).closest('.form-section').append('<button class="btn btn-secondary add-option-btn">Add Option</button>');
}
});
$(document).on('click', '.required-toggle', function () { $(document).on('click', '.add-option-btn', function() {
$(this).closest('.form-section').toggleClass('required') let type = $(this).closest('.form-section').find('.custom-select').val();
}) let container = $(this).closest('.form-section').find('.options-container');
addOption(type, container);
});
$('#preview-btn').on('click', function () { $(document).on('click', '.delete-section-icon', function() {
let previewWindow = window.open('', '_blank') let section = $(this).closest('.form-section');
let previewContent = ` let prevSection = section.prev('.form-section');
let nextSection = section.next('.form-section');
section.remove();
if (section.hasClass('active')) {
activeSection = null;
}
if (prevSection.length > 0) {
prevSection.find('.delete-section-icon').appendTo(prevSection.find('.form-section'));
activeSection = prevSection;row
}
else if (nextSection.length > 0) {
nextSection.find('.delete-section-icon').appendTo(nextSection.find('.form-header'));
activeSection = nextSection;
}
positionAddSectionButton();
});
$(document).on('click', '.delete-option-icon', function() {
let option = $(this).closest('.option');
let container = option.closest('.options-container');
option.remove();
});
$(document).on('click', '.required-toggle', function() {
$(this).closest('.form-section').toggleClass('required');
});
$('#preview-btn').on('click', function() {
let previewWindow = window.open('', '_blank');
let previewContent = `
<html> <html>
<head> <head>
<title>Form Preview</title> <title>Form Preview</title>
@ -157,189 +146,174 @@ $(document).ready(function () {
<div class="form-header"> <div class="form-header">
<h3>Form Preview</h3> <h3>Form Preview</h3>
</div> </div>
` `;
$('.form-section').each(function () { $('.form-section').each(function() {
previewContent += '<div class="form-section">' previewContent += '<div class="form-section">';
previewContent += '<div class="question-section">' previewContent += '<div class="question-section">';
previewContent += previewContent += '<div class="question-label">' + $(this).find('.untitled-question').val() + '</div>';
'<div class="question-label">' + previewContent += '</div>';
$(this).find('.untitled-question').val() + let type = $(this).find('.custom-select').val();
'</div>' let optionsContainer = $(this).find('.options-container');
previewContent += '</div>'
let type = $(this).find('.custom-select').val()
let optionsContainer = $(this).find('.options-container')
if (type === 'multiple-choice') { if (type === 'multiple-choice') {
optionsContainer.find('.option').each(function () { optionsContainer.find('.option').each(function() {
previewContent += ` previewContent += `
<div class="option"> <div class="option">
<input type="radio" name="option-${index}"> <input type="radio" name="option-${index}">
<label>${$(this).find('.option-label').val()}</label> <label>${$(this).find('.option-label').val()}</label>
</div> </div>
` `;
}) });
} else if (type === 'checkboxes') { } else if (type === 'checkboxes') {
optionsContainer.find('.option').each(function () { optionsContainer.find('.option').each(function() {
previewContent += ` previewContent += `
<div class="option"> <div class="option">
<input type="checkbox"> <input type="checkbox">
<label>${$(this).find('.option-label').val()}</label> <label>${$(this).find('.option-label').val()}</label>
</div> </div>
` `;
}) });
} else if (type === 'short-answer') { } else if (type === 'short-answer') {
previewContent += previewContent += '<input type="text" class="form-control" placeholder="Short answer text">';
'<input type="text" class="form-control" placeholder="Short answer text">' } else if (type === 'paragraph') {
} else if (type === 'paragraph') { previewContent += '<textarea class="form-control" placeholder="Paragraph text"></textarea>';
previewContent += } else if (type === 'dropdown') {
'<textarea class="form-control" placeholder="Paragraph text"></textarea>' let dropdownHtml = '<select class="form-control">';
} else if (type === 'dropdown') { optionsContainer.find('.option .option-label').each(function() {
let dropdownHtml = '<select class="form-control">' dropdownHtml += `<option>${$(this).val()}</option>`;
optionsContainer.find('.option .option-label').each(function () { });
dropdownHtml += `<option>${$(this).val()}</option>` dropdownHtml += '</select>';
}) previewContent += dropdownHtml;
dropdownHtml += '</select>' }
previewContent += dropdownHtml previewContent += '</div>';
} });
previewContent += '</div>' previewContent += `
})
previewContent += `
</div> </div>
</body> </body>
</html> </html>
` `;
previewWindow.document.write(previewContent) previewWindow.document.write(previewContent);
previewWindow.document.close() previewWindow.document.close();
}) });
$(document).on('click', '.form-section', function () { $(document).on('click', '.form-section', function() {
$('.form-section').removeClass('active') $('.form-section').removeClass('active');
$(this).addClass('active') $(this).addClass('active');
activeSection = $(this) activeSection = $(this);
positionAddSectionButton() positionAddSectionButton();
}) });
$('#form-container').sortable({ $('#form-container').sortable({
placeholder: 'ui-state-highlight', placeholder: 'ui-state-highlight',
start: function (event, ui) { start: function (event, ui) {
ui.placeholder.height(ui.item.height()) ui.placeholder.height(ui.item.height());
}, },
stop: function (event, ui) { stop: function (event, ui) {
positionAddSectionButton() positionAddSectionButton();
}, }
}) });
function collectFormData() { function collectFormData() {
var formData = { var formData = {
questions: [], questions: []
};
$('.form-section').each(function() {
var questionType = $(this).find('.custom-select').val();
var questionData = {
text: $(this).find('.untitled-question').val(),
type: questionType,
is_required: $(this).find('.required-toggle').is(':checked'),
options: []
};
// Only add options if the question type supports them
if (questionType === 'multiple-choice' || questionType === 'checkboxes' || questionType === 'dropdown') {
$(this).find('.option-label').each(function() {
questionData.options.push($(this).val());
});
}
formData.questions.push(questionData);
});
console.log(formData);
return formData;
} }
$('.form-section').each(function () {
var questionType = $(this).find('.custom-select').val()
var questionData = {
text: $(this).find('.untitled-question').val(),
type: questionType,
is_required: $(this).find('.required-toggle').is(':checked'),
options: [],
}
// Only add options if the question type supports them function validateFormData(formData) {
if ( for (let question of formData.questions) {
questionType === 'multiple-choice' || if (!question.text.trim()) {
questionType === 'checkboxes' || return { isValid: false, message: 'All questions must have text.' };
questionType === 'dropdown' }
) { if ((question.type === 'multiple-choice' || question.type === 'checkboxes' || question.type === 'dropdown') && question.options.length === 0) {
$(this) return { isValid: false, message: 'All options-based questions must have at least one option.' };
.find('.option-label') }
.each(function () { for (let option of question.options) {
questionData.options.push($(this).val()) if (!option.trim()) {
}) return { isValid: false, message: 'All options must have text.' };
} }
}
formData.questions.push(questionData)
})
console.log(formData)
return formData
}
function validateFormData(formData) {
for (let question of formData.questions) {
if (!question.text.trim()) {
return { isValid: false, message: 'All questions must have text.' }
}
if (
(question.type === 'multiple-choice' ||
question.type === 'checkboxes' ||
question.type === 'dropdown') &&
question.options.length === 0
) {
return {
isValid: false,
message: 'All options-based questions must have at least one option.',
} }
} return { isValid: true };
for (let option of question.options) {
if (!option.trim()) {
return { isValid: false, message: 'All options must have text.' }
}
}
} }
return { isValid: true } $('#submit-btn').on('click', function() {
} let formData = collectFormData();
$('#submit-btn').on('click', function () { console.log(formData);
let formData = collectFormData()
console.log(formData)
let validation = validateFormData(formData) let validation = validateFormData(formData);
if (!validation.isValid) { if (!validation.isValid) {
alert(validation.message) alert(validation.message);
return return;
}
$.ajax({
url: base_url + 'New_form_controller/submit_form',
type: 'POST',
data: { formData: formData },
dataType: 'JSON',
success: function (response) {
if (response.status === 'success') {
Swal.fire({
title: 'Success!',
text: 'Form submitted successfully!',
icon: 'success',
confirmButtonText: 'OK',
}).then((result) => {
window.location.href = base_url
})
} else {
Swal.fire({
title: 'Error!',
text: response.message,
icon: 'error',
confirmButtonText: 'OK',
})
console.log(response)
} }
},
error: function (error) {
Swal.fire({
title: 'Error!',
text: 'Error submitting form!',
icon: 'error',
confirmButtonText: 'OK',
width: '400px',
height: '300px',
padding: 'auto',
}).then((result) => {
if (result.isConfirmed) {
window.location.href = home
}
})
console.log(error)
},
})
})
$('#form-container').disableSelection() $.ajax({
}) url: base_url + 'New_form_controller/submit_form',
type: 'POST',
data: { formData: formData },
dataType: 'JSON',
success: function(response) {
if (response.status === 'success') {
Swal.fire({
title: 'Success!',
text: 'Form submitted successfully!',
icon: 'success',
confirmButtonText: 'OK'
}).then((result) => {
window.location.href = base_url;
});
} else {
Swal.fire({
title: 'Error!',
text: response.message,
icon: 'error',
confirmButtonText: 'OK'
});
console.log(response);
}
},
error: function(error) {
Swal.fire({
title: 'Error!',
text: 'Error submitting form!',
icon: 'error',
confirmButtonText: 'OK',
width: '400px',
height: '300px',
padding: 'auto',
}).then((result) => {
if (result.isConfirmed) {
window.location.href = home;
}
});
console.log(error);
}
});
});
$('#form-container').disableSelection();
});

View File

@ -1,34 +1,33 @@
$(document).ready(function () { $(document).ready(function () {
let index = 1 let index = 1
let activeSection = null let activeSection = null
function addOption(type, container) { function addOption(type, container) {
let optionHtml let optionHtml
if (type === 'multiple-choice' || type === 'checkboxes') { if (type === 'multiple-choice' || type === 'checkboxes') {
optionHtml = ` optionHtml = `
<div class="option"> <div class="option">
<input type="${type === 'multiple-choice' ? 'radio' : 'checkbox'}" disabled> <input type="${type === 'multiple-choice' ? 'radio' : 'checkbox'}" disabled>
<input type="text" class="form-control option-label"> <input type="text" class="form-control option-label">
<span class="delete-option-icon">&times;</span> <span class="delete-option-icon">&times;</span>
</div> </div>
` `
} else if (type === 'dropdown') { } else if (type === 'dropdown') {
optionHtml = ` optionHtml = `
<div class="option"> <div class="option">
<input type="text" class="form-control option-label"> <input type="text" class="form-control option-label">
<span class="delete-option-icon">&times;</span> <span class="delete-option-icon">&times;</span>
</div> </div>
` `
} }
container.append(optionHtml) container.append(optionHtml)
} }
function createFormSection() { function createFormSection() {
let newSection = ` let newSection = `
<div class="form-section" data-index="${index}"> <div class="form-section" data-index="${index}">
<div class="header-row"> <div class="header-row">
${index === 1 ? '<div class="violet-border"></div>' : ''} ${index === 1 ? '<div class="violet-border"></div>' : ''}
<textarea class="form-control untitled-question" placeholder="Untitled Question" rows="1"></textarea> <textarea class="form-control untitled-question" placeholder="Untitled Question" rows="1"></textarea>
<select class="custom-select"> <select class="custom-select">

File diff suppressed because it is too large Load Diff

View File

@ -1,36 +1,35 @@
{ {
"description": "The CodeIgniter framework", "description": "The CodeIgniter framework",
"name": "codeigniter/framework", "name": "codeigniter/framework",
"type": "project", "type": "project",
"homepage": "https://codeigniter.com", "homepage": "https://codeigniter.com",
"license": "MIT", "license": "MIT",
"support": { "support": {
"forum": "http://forum.codeigniter.com/", "forum": "http://forum.codeigniter.com/",
"wiki": "https://github.com/bcit-ci/CodeIgniter/wiki", "wiki": "https://github.com/bcit-ci/CodeIgniter/wiki",
"slack": "https://codeigniterchat.slack.com", "slack": "https://codeigniterchat.slack.com",
"source": "https://github.com/bcit-ci/CodeIgniter" "source": "https://github.com/bcit-ci/CodeIgniter"
}, },
"require": { "require": {
"php": ">=5.3.7" "php": ">=5.3.7"
}, },
"suggest": { "suggest": {
"paragonie/random_compat": "Provides better randomness in PHP 5.x" "paragonie/random_compat": "Provides better randomness in PHP 5.x"
}, },
"scripts": { "scripts": {
"test:coverage": [ "test:coverage": [
"@putenv XDEBUG_MODE=coverage", "@putenv XDEBUG_MODE=coverage",
"phpunit --color=always --coverage-text --configuration tests/travis/sqlite.phpunit.xml" "phpunit --color=always --coverage-text --configuration tests/travis/sqlite.phpunit.xml"
], ],
"post-install-cmd": [ "post-install-cmd": [
"sed -i s/name{0}/name[0]/ vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/vfsStream.php" "sed -i s/name{0}/name[0]/ vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/vfsStream.php"
], ],
"post-update-cmd": [ "post-update-cmd": [
"sed -i s/name{0}/name[0]/ vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/vfsStream.php" "sed -i s/name{0}/name[0]/ vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/vfsStream.php"
] ]
}, },
"require-dev": { "require-dev": {
"mikey179/vfsstream": "1.6.*", "mikey179/vfsstream": "1.6.*",
"phpunit/phpunit": "4.* || 5.* || 9.*", "phpunit/phpunit": "4.* || 5.* || 9.*"
"squizlabs/php_codesniffer": "^3.5" }
}
} }

1721
composer.lock generated

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