Initial import of Din Beste Hjelper site

CodeIgniter 3 app for dinbestehjelper.no. Excludes vendor/, local backup
folders (new/, archive/, archived/) and DB dumps (*.sql) via .gitignore.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P16ttGUge8zj91dm6WrmEb
This commit is contained in:
Astral04
2026-08-04 12:52:43 +00:00
co-authored by Claude Opus 4.8
commit 4e1a69c8d4
542 changed files with 214158 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+135
View File
@@ -0,0 +1,135 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| AUTO-LOADER
| -------------------------------------------------------------------
| This file specifies which systems should be loaded by default.
|
| In order to keep the framework as light-weight as possible only the
| absolute minimal resources are loaded by default. For example,
| the database is not connected to automatically since no assumption
| is made regarding whether you intend to use it. This file lets
| you globally define which systems you would like loaded with every
| request.
|
| -------------------------------------------------------------------
| Instructions
| -------------------------------------------------------------------
|
| These are the things you can load automatically:
|
| 1. Packages
| 2. Libraries
| 3. Drivers
| 4. Helper files
| 5. Custom config files
| 6. Language files
| 7. Models
|
*/
/*
| -------------------------------------------------------------------
| Auto-load Packages
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/
$autoload['packages'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in system/libraries/ or your
| application/libraries/ directory, with the addition of the
| 'database' library, which is somewhat of a special case.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'email', 'session');
|
| You can also supply an alternative library name to be assigned
| in the controller:
|
| $autoload['libraries'] = array('user_agent' => 'ua');
*/
$autoload['libraries'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Drivers
| -------------------------------------------------------------------
| These classes are located in system/libraries/ or in your
| application/libraries/ directory, but are also placed inside their
| own subdirectory and they extend the CI_Driver_Library class. They
| offer multiple interchangeable driver options.
|
| Prototype:
|
| $autoload['drivers'] = array('cache');
|
| You can also supply an alternative property name to be assigned in
| the controller:
|
| $autoload['drivers'] = array('cache' => 'cch');
|
*/
$autoload['drivers'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Helper Files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Config files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['config'] = array('config1', 'config2');
|
| NOTE: This item is intended for use ONLY if you have created custom
| config files. Otherwise, leave it blank.
|
*/
$autoload['config'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Language files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['language'] = array('lang1', 'lang2');
|
| NOTE: Do not include the "_lang" part of your file. For example
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/
$autoload['language'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Models
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['model'] = array('first_model', 'second_model');
|
| You can also supply an alternative model name to be assigned
| in the controller:
|
| $autoload['model'] = array('first_model' => 'first');
*/
$autoload['model'] = array();
+538
View File
@@ -0,0 +1,538 @@
<?php
ob_start();
session_start();
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| WARNING: You MUST set this value!
|
| If it is not set, then CodeIgniter will try to guess the protocol and
| path to your installation, but due to security concerns the hostname will
| be set to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise.
| The auto-detection mechanism exists only for convenience during
| development and MUST NOT be used in production!
|
| If you need to allow multiple domains, remember that this file is still
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = 'http://hjelp.astral04.com/';
//$config['base_url'] = 'http://localhost/dinbestehjelper_no/';
//$config['base_url'] = 'http://172.16.114.229/studio_beve/';
//$config['base_url'] = 'http://192.168.1.24/studio_beve/';
define('SITEURL', $config['base_url']);
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = '';
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of 'REQUEST_URI' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
| 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
| 'PATH_INFO' Uses $_SERVER['PATH_INFO']
|
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
*/
$config['uri_protocol'] = 'REQUEST_URI';
/*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| https://codeigniter.com/userguide3/general/urls.html
|
| Note: This option is ignored for CLI requests.
*/
$config['url_suffix'] = '';
/*
|--------------------------------------------------------------------------
| Default Language
|--------------------------------------------------------------------------
|
| This determines which set of language files should be used. Make sure
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language'] = 'english';
/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
| See http://php.net/htmlspecialchars for a list of supported charsets.
|
*/
$config['charset'] = 'UTF-8';
/*
|--------------------------------------------------------------------------
| Enable/Disable System Hooks
|--------------------------------------------------------------------------
|
| If you would like to use the 'hooks' feature you must enable it by
| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = FALSE;
/*
|--------------------------------------------------------------------------
| Class Extension Prefix
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
| native libraries. For more information please see the user guide:
|
| https://codeigniter.com/userguide3/general/core_classes.html
| https://codeigniter.com/userguide3/general/creating_libraries.html
|
*/
$config['subclass_prefix'] = 'MY_';
/*
|--------------------------------------------------------------------------
| Composer auto-loading
|--------------------------------------------------------------------------
|
| Enabling this setting will tell CodeIgniter to look for a Composer
| package auto-loader script in application/vendor/autoload.php.
|
| $config['composer_autoload'] = TRUE;
|
| Or if you have your vendor/ directory located somewhere else, you
| can opt to set a specific path as well:
|
| $config['composer_autoload'] = '/path/to/vendor/autoload.php';
|
| For more information about Composer, please visit http://getcomposer.org/
|
| Note: This will NOT disable or override the CodeIgniter-specific
| autoloading (application/config/autoload.php)
*/
$config['composer_autoload'] = FALSE;
/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify which characters are permitted within your URLs.
| When someone tries to submit a URL with disallowed characters they will
| get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| The configured value is actually a regular expression character group
| and it will be executed as: ! preg_match('/^[<permitted_uri_chars>]+$/i
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
/*
|--------------------------------------------------------------------------
| Enable Query Strings
|--------------------------------------------------------------------------
|
| By default CodeIgniter uses search-engine friendly segment based URLs:
| example.com/who/what/where/
|
| You can optionally enable standard query string based URLs:
| example.com?who=me&what=something&where=here
|
| Options are: TRUE or FALSE (boolean)
|
| The other items let you set the query string 'words' that will
| invoke your controllers and its functions:
| example.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd';
/*
|--------------------------------------------------------------------------
| Allow $_GET array
|--------------------------------------------------------------------------
|
| By default CodeIgniter enables access to the $_GET array. If for some
| reason you would like to disable it, set 'allow_get_array' to FALSE.
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['allow_get_array'] = TRUE;
/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
|
| You can also pass an array with threshold levels to show individual error types
|
| array(2) = Debug Messages, without Error Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 0;
/*
|--------------------------------------------------------------------------
| Error Logging Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/logs/ directory. Use a full server path with trailing slash.
|
*/
$config['log_path'] = '';
/*
|--------------------------------------------------------------------------
| Log File Extension
|--------------------------------------------------------------------------
|
| The default filename extension for log files. The default 'php' allows for
| protecting the log files via basic scripting, when they are to be stored
| under a publicly accessible directory.
|
| Note: Leaving it blank will default to 'php'.
|
*/
$config['log_file_extension'] = '';
/*
|--------------------------------------------------------------------------
| Log File Permissions
|--------------------------------------------------------------------------
|
| The file system permissions to be applied on newly created log files.
|
| IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal
| integer notation (i.e. 0700, 0644, etc.)
*/
$config['log_file_permissions'] = 0644;
/*
|--------------------------------------------------------------------------
| Date Format for Logs
|--------------------------------------------------------------------------
|
| Each item that is logged has an associated date. You can use PHP date
| codes to set your own date formatting
|
*/
$config['log_date_format'] = 'Y-m-d H:i:s';
/*
|--------------------------------------------------------------------------
| Error Views Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/views/errors/ directory. Use a full server path with trailing slash.
|
*/
$config['error_views_path'] = '';
/*
|--------------------------------------------------------------------------
| Cache Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/cache/ directory. Use a full server path with trailing slash.
|
*/
$config['cache_path'] = '';
/*
|--------------------------------------------------------------------------
| Cache Include Query String
|--------------------------------------------------------------------------
|
| Whether to take the URL query string into consideration when generating
| output cache files. Valid options are:
|
| FALSE = Disabled
| TRUE = Enabled, take all query parameters into account.
| Please be aware that this may result in numerous cache
| files generated for the same page over and over again.
| array('q') = Enabled, but only take into account the specified list
| of query parameters.
|
*/
$config['cache_query_string'] = FALSE;
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| If you use the Encryption class, you must set an encryption key.
| See the user guide for more info.
|
| https://codeigniter.com/userguide3/libraries/encryption.html
|
*/
$config['encryption_key'] = '';
/*
|--------------------------------------------------------------------------
| Session Variables
|--------------------------------------------------------------------------
|
| 'sess_driver'
|
| The storage driver to use: files, database, redis, memcached
|
| 'sess_cookie_name'
|
| The session cookie name, must contain only [0-9a-z_-] characters
|
| 'sess_samesite'
|
| Session cookie SameSite attribute: Lax (default), Strict or None
|
| 'sess_expiration'
|
| The number of SECONDS you want the session to last.
| Setting to 0 (zero) means expire when the browser is closed.
|
| 'sess_save_path'
|
| The location to save sessions to, driver dependent.
|
| For the 'files' driver, it's a path to a writable directory.
| WARNING: Only absolute paths are supported!
|
| For the 'database' driver, it's a table name.
| Please read up the manual for the format with other session drivers.
|
| IMPORTANT: You are REQUIRED to set a valid save path!
|
| 'sess_match_ip'
|
| Whether to match the user's IP address when reading the session data.
|
| WARNING: If you're using the database driver, don't forget to update
| your session table's PRIMARY KEY when changing this setting.
|
| 'sess_time_to_update'
|
| How many seconds between CI regenerating the session ID.
|
| 'sess_regenerate_destroy'
|
| Whether to destroy session data associated with the old session ID
| when auto-regenerating the session ID. When set to FALSE, the data
| will be later deleted by the garbage collector.
|
| Other session cookie settings are shared with the rest of the application,
| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
|
*/
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_samesite'] = 'Lax';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a cookie name prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path' = Typically will be a forward slash
| 'cookie_secure' = Cookie will only be set if a secure HTTPS connection exists.
| 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript)
| 'cookie_samesite' = Cookie's samesite attribute (Lax, Strict or None)
|
| Note: These settings (with the exception of 'cookie_prefix' and
| 'cookie_httponly') will also affect sessions.
|
*/
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
$config['cookie_samesite'] = 'Lax';
/*
|--------------------------------------------------------------------------
| Standardize newlines
|--------------------------------------------------------------------------
|
| Determines whether to standardize newline characters in input data,
| meaning to replace \r\n, \r, \n occurrences with the PHP_EOL value.
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['standardize_newlines'] = FALSE;
/*
|--------------------------------------------------------------------------
| Global XSS Filtering
|--------------------------------------------------------------------------
|
| Determines whether the XSS filter is always active when GET, POST or
| COOKIE data is encountered
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['global_xss_filtering'] = FALSE;
/*
|--------------------------------------------------------------------------
| Cross Site Request Forgery
|--------------------------------------------------------------------------
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
| checked on a submitted form. If you are accepting user data, it is strongly
| recommended CSRF protection be enabled.
|
| 'csrf_token_name' = The token name
| 'csrf_cookie_name' = The cookie name
| 'csrf_expire' = The number in seconds the token should expire.
| 'csrf_regenerate' = Regenerate token on every submission
| 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks
*/
$config['csrf_protection'] = FALSE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array();
/*
|--------------------------------------------------------------------------
| Output Compression
|--------------------------------------------------------------------------
|
| Enables Gzip output compression for faster page loads. When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
| Only used if zlib.output_compression is turned off in your php.ini.
| Please do not use it together with httpd-level output compression.
|
| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
| even be a line of whitespace at the end of one of your scripts. For
| compression to work, nothing can be sent before the output buffer is called
| by the output class. Do not 'echo' any values with compression enabled.
|
*/
$config['compress_output'] = FALSE;
/*
|--------------------------------------------------------------------------
| Master Time Reference
|--------------------------------------------------------------------------
|
| Options are 'local' or any PHP supported timezone. This preference tells
| the system whether to use your server's local time as the master 'now'
| reference, or convert it to the configured one timezone. See the 'date
| helper' page of the user guide for information regarding date handling.
|
*/
$config['time_reference'] = 'local';
/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files. Options are TRUE or FALSE (boolean)
|
| Note: You need to have eval() enabled for this to work.
|
*/
$config['rewrite_short_tags'] = FALSE;
/*
|--------------------------------------------------------------------------
| Reverse Proxy IPs
|--------------------------------------------------------------------------
|
| If your server is behind a reverse proxy, you must whitelist the proxy
| IP addresses from which CodeIgniter should trust headers such as
| HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
| the visitor's IP address.
|
| You can use both an array or a comma-separated list of proxy addresses,
| as well as specifying whole subnets. Here are a few examples:
|
| Comma-separated: '10.0.1.200,192.168.5.0/24'
| Array: array('10.0.1.200', '192.168.5.0/24')
*/
$config['proxy_ips'] = '';
+85
View File
@@ -0,0 +1,85 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Display Debug backtrace
|--------------------------------------------------------------------------
|
| If set to TRUE, a backtrace will be displayed along with php errors. If
| error_reporting is disabled, the backtrace will not display, regardless
| of this setting
|
*/
defined('SHOW_DEBUG_BACKTRACE') OR define('SHOW_DEBUG_BACKTRACE', TRUE);
/*
|--------------------------------------------------------------------------
| File and Directory Modes
|--------------------------------------------------------------------------
|
| These prefs are used when checking and setting modes when working
| with the file system. The defaults are fine on servers with proper
| security, but you may wish (or even need) to change the values in
| certain environments (Apache running a separate process for each
| user, PHP under CGI with Apache suEXEC, etc.). Octal values should
| always be used to set the mode correctly.
|
*/
defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644);
defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666);
defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755);
defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755);
/*
|--------------------------------------------------------------------------
| File Stream Modes
|--------------------------------------------------------------------------
|
| These modes are used when working with fopen()/popen()
|
*/
defined('FOPEN_READ') OR define('FOPEN_READ', 'rb');
defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b');
defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
defined('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab');
defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
/*
|--------------------------------------------------------------------------
| Exit Status Codes
|--------------------------------------------------------------------------
|
| Used to indicate the conditions under which the script is exit()ing.
| While there is no universal standard for error codes, there are some
| broad conventions. Three such conventions are mentioned below, for
| those who wish to make use of them. The CodeIgniter defaults were
| chosen for the least overlap with these conventions, while still
| leaving room for others to be defined in future versions and user
| applications.
|
| The three main conventions used for determining exit status codes
| are as follows:
|
| Standard C/C++ Library (stdlibc):
| http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
| (This link also contains other GNU-specific conventions)
| BSD sysexits.h:
| http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
| Bash scripting:
| http://tldp.org/LDP/abs/html/exitcodes.html
|
*/
defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors
defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error
defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error
defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found
defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input
defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error
defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
+99
View File
@@ -0,0 +1,99 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
| ['dsn'] The full DSN string describe a connection to the database.
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database driver. e.g.: mysqli.
| Currently supported:
| cubrid, ibase, mssql, mysql, mysqli, oci8,
| odbc, pdo, postgre, sqlite, sqlite3, sqlsrv
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Query Builder class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
| ['cachedir'] The path to the folder where cache files should be stored
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
| NOTE: For MySQL and MySQLi databases, this setting is only used
| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
| (and in table creation queries made with DB Forge).
| There is an incompatibility in PHP with mysql_real_escape_string() which
| can make your site vulnerable to SQL injection if you are using a
| multi-byte character set and are running versions lower than these.
| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
| ['encrypt'] Whether or not to use an encrypted connection.
|
| 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE
| 'mysqli' and 'pdo/mysql' drivers accept an array with the following options:
|
| 'ssl_key' - Path to the private key file
| 'ssl_cert' - Path to the public key certificate file
| 'ssl_ca' - Path to the certificate authority file
| 'ssl_capath' - Path to a directory containing trusted CA certificates in PEM format
| 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':')
| 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not
|
| ['compress'] Whether or not to use client compression (MySQL only)
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
| ['ssl_options'] Used to set various SSL options that can be used when making SSL connections.
| ['failover'] array - A array with 0 or more data for connections if the main should fail.
| ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries.
| NOTE: Disabling this will also effectively disable both
| $this->db->last_query() and profiling of DB queries.
| When you run a query, with this setting set to TRUE (default),
| CodeIgniter will store the SQL statement for debugging purposes.
| However, this may cause high memory usage, especially if you run
| a lot of SQL queries ... disable this to avoid that problem.
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $query_builder variables lets you determine whether or not to load
| the query builder class.
*/
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
//'username' => 'root',
'username' => 'dflqplal_website',
//'password' => '',
'password' => 'azN@aEGL54sn',
//'database' => 'dinbestehjelper',
'database' => 'dflqplal_dinbestehjelper',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
+24
View File
@@ -0,0 +1,24 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$_doctypes = array(
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
'xhtml-basic11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">',
'html5' => '<!DOCTYPE html>',
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
'mathml1' => '<!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd">',
'mathml2' => '<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">',
'svg10' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">',
'svg11' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',
'svg11-basic' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">',
'svg11-tiny' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">',
'xhtml-math-svg-xh' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
'xhtml-math-svg-sh' => '<!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
'xhtml-rdfa-1' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">',
'xhtml-rdfa-2' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">'
);
+114
View File
@@ -0,0 +1,114 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| Foreign Characters
| -------------------------------------------------------------------
| This file contains an array of foreign characters for transliteration
| conversion used by the Text helper
|
*/
$foreign_characters = array(
'/ä|æ|ǽ/' => 'ae',
'/ö|œ/' => 'oe',
'/ü/' => 'ue',
'/Ä/' => 'Ae',
'/Ü/' => 'Ue',
'/Ö/' => 'Oe',
'/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά|Ả|Ạ|Ầ|Ẫ|Ẩ|Ậ|Ằ|Ắ|Ẵ|Ẳ|Ặ|А/' => 'A',
'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά|ả|ạ|ầ|ấ|ẫ|ẩ|ậ|ằ|ắ|ẵ|ẳ|ặ|а/' => 'a',
'/Б/' => 'B',
'/б/' => 'b',
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
'/ç|ć|ĉ|ċ|č/' => 'c',
'/Д|Δ/' => 'D',
'/д|δ/' => 'd',
'/Ð|Ď|Đ/' => 'Dj',
'/ð|ď|đ/' => 'dj',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ|Ẽ|Ẻ|Ẹ|Ề|Ế|Ễ|Ể|Ệ|Е|Э/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε|ẽ|ẻ|ẹ|ề|ế|ễ|ể|ệ|е|э/' => 'e',
'/Ф/' => 'F',
'/ф/' => 'f',
'/Ĝ|Ğ|Ġ|Ģ|Γ|Г|Ґ/' => 'G',
'/ĝ|ğ|ġ|ģ|γ|г|ґ/' => 'g',
'/Ĥ|Ħ/' => 'H',
'/ĥ|ħ/' => 'h',
'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ|Ỉ|Ị|И|Ы/' => 'I',
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ|ỉ|ị|и|ы|ї/' => 'i',
'/Ĵ/' => 'J',
'/ĵ/' => 'j',
'/Θ/' => 'TH',
'/θ/' => 'th',
'/Ķ|Κ|К/' => 'K',
'/ķ|κ|к/' => 'k',
'/Ĺ|Ļ|Ľ|Ŀ|Ł|Λ|Л/' => 'L',
'/ĺ|ļ|ľ|ŀ|ł|λ|л/' => 'l',
'/М/' => 'M',
'/м/' => 'm',
'/Ñ|Ń|Ņ|Ň|Ν|Н/' => 'N',
'/ñ|ń|ņ|ň|ʼn|ν|н/' => 'n',
'/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|Ο|Ό|Ω|Ώ|Ỏ|Ọ|Ồ|Ố|Ỗ|Ổ|Ộ|Ờ|Ớ|Ỡ|Ở|Ợ|О/' => 'O',
'/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|ο|ό|ω|ώ|ỏ|ọ|ồ|ố|ỗ|ổ|ộ|ờ|ớ|ỡ|ở|ợ|о/' => 'o',
'/П/' => 'P',
'/п/' => 'p',
'/Ŕ|Ŗ|Ř|Ρ|Р/' => 'R',
'/ŕ|ŗ|ř|ρ|р/' => 'r',
'/Ś|Ŝ|Ş|Ș|Š|Σ|С/' => 'S',
'/ś|ŝ|ş|ș|š|ſ|σ|ς|с/' => 's',
'/Ț|Ţ|Ť|Ŧ|Τ|Т/' => 'T',
'/ț|ţ|ť|ŧ|τ|т/' => 't',
'/Þ|þ/' => 'th',
'/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự|У/' => 'U',
'/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự|у/' => 'u',
'/Ƴ|Ɏ|Ỵ|Ẏ|Ӳ|Ӯ|Ў|Ý|Ÿ|Ŷ|Υ|Ύ|Ϋ|Ỳ|Ỹ|Ỷ|Ỵ|Й/' => 'Y',
'/ẙ|ʏ|ƴ|ɏ|ỵ|ẏ|ӳ|ӯ|ў|ý|ÿ|ŷ|ỳ|ỹ|ỷ|ỵ|й/' => 'y',
'/В/' => 'V',
'/в/' => 'v',
'/Ŵ/' => 'W',
'/ŵ/' => 'w',
'/Φ/' => 'F',
'/φ/' => 'f',
'/Χ/' => 'CH',
'/χ/' => 'ch',
'/Ź|Ż|Ž|Ζ|З/' => 'Z',
'/ź|ż|ž|ζ|з/' => 'z',
'/Æ|Ǽ/' => 'AE',
'/ß/' => 'ss',
'/IJ/' => 'IJ',
'/ij/' => 'ij',
'/Œ/' => 'OE',
'/ƒ/' => 'f',
'/Ξ/' => 'KS',
'/ξ/' => 'ks',
'/Π/' => 'P',
'/π/' => 'p',
'/Β/' => 'V',
'/β/' => 'v',
'/Μ/' => 'M',
'/μ/' => 'm',
'/Ψ/' => 'PS',
'/ψ/' => 'ps',
'/Ё/' => 'Yo',
'/ё/' => 'yo',
'/Є/' => 'Ye',
'/є/' => 'ye',
'/Ї/' => 'Yi',
'/Ж/' => 'Zh',
'/ж/' => 'zh',
'/Х/' => 'Kh',
'/х/' => 'kh',
'/Ц/' => 'Ts',
'/ц/' => 'ts',
'/Ч/' => 'Ch',
'/ч/' => 'ch',
'/Ш/' => 'Sh',
'/ш/' => 'sh',
'/Щ/' => 'Shch',
'/щ/' => 'shch',
'/Ъ|ъ|Ь|ь/' => '',
'/Ю/' => 'Yu',
'/ю/' => 'yu',
'/Я/' => 'Ya',
'/я/' => 'ya'
);
+13
View File
@@ -0,0 +1,13 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Hooks
| -------------------------------------------------------------------------
| This file lets you define "hooks" to extend CI without hacking the core
| files. Please see the user guide for info:
|
| https://codeigniter.com/userguide3/general/hooks.html
|
*/
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+19
View File
@@ -0,0 +1,19 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Memcached settings
| -------------------------------------------------------------------------
| Your Memcached servers can be specified below.
|
| See: https://codeigniter.com/userguide3/libraries/caching.html#memcached
|
*/
$config = array(
'default' => array(
'hostname' => '127.0.0.1',
'port' => '11211',
'weight' => '1',
),
);
+84
View File
@@ -0,0 +1,84 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Enable/Disable Migrations
|--------------------------------------------------------------------------
|
| Migrations are disabled by default for security reasons.
| You should enable migrations whenever you intend to do a schema migration
| and disable it back when you're done.
|
*/
$config['migration_enabled'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migration Type
|--------------------------------------------------------------------------
|
| Migration file names may be based on a sequential identifier or on
| a timestamp. Options are:
|
| 'sequential' = Sequential migration naming (001_add_blog.php)
| 'timestamp' = Timestamp migration naming (20121031104401_add_blog.php)
| Use timestamp format YYYYMMDDHHIISS.
|
| Note: If this configuration value is missing the Migration library
| defaults to 'sequential' for backward compatibility with CI2.
|
*/
$config['migration_type'] = 'timestamp';
/*
|--------------------------------------------------------------------------
| Migrations table
|--------------------------------------------------------------------------
|
| This is the name of the table that will store the current migrations state.
| When migrations runs it will store in a database table which migration
| level the system is at. It then compares the migration level in this
| table to the $config['migration_version'] if they are not the same it
| will migrate up. This must be set.
|
*/
$config['migration_table'] = 'migrations';
/*
|--------------------------------------------------------------------------
| Auto Migrate To Latest
|--------------------------------------------------------------------------
|
| If this is set to TRUE when you load the migrations class and have
| $config['migration_enabled'] set to TRUE the system will auto migrate
| to your latest migration (whatever $config['migration_version'] is
| set to). This way you do not have to call migrations anywhere else
| in your code to have the latest migration.
|
*/
$config['migration_auto_latest'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migrations version
|--------------------------------------------------------------------------
|
| This is used to set migration version that the file system should be on.
| If you run $this->migration->current() this is the version that schema will
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 0;
/*
|--------------------------------------------------------------------------
| Migrations Path
|--------------------------------------------------------------------------
|
| Path to your migrations folder.
| Typically, it will be within your application path.
| Also, writing permission is required within the migrations path.
|
*/
$config['migration_path'] = APPPATH.'migrations/';
+186
View File
@@ -0,0 +1,186 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| MIME TYPES
| -------------------------------------------------------------------
| This file contains an array of mime types. It is used by the
| Upload class to help identify allowed file types.
|
*/
return array(
'hqx' => array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'),
'cpt' => 'application/mac-compactpro',
'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain'),
'bin' => array('application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'),
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => array('application/octet-stream', 'application/x-msdownload'),
'class' => 'application/octet-stream',
'psd' => array('application/x-photoshop', 'image/vnd.adobe.photoshop'),
'so' => 'application/octet-stream',
'sea' => 'application/octet-stream',
'dll' => 'application/octet-stream',
'oda' => 'application/oda',
'pdf' => array('application/pdf', 'application/force-download', 'application/x-download', 'binary/octet-stream'),
'ai' => array('application/pdf', 'application/postscript'),
'eps' => 'application/postscript',
'ps' => 'application/postscript',
'smi' => 'application/smil',
'smil' => 'application/smil',
'mif' => 'application/vnd.mif',
'xls' => array('application/vnd.ms-excel', 'application/msexcel', 'application/x-msexcel', 'application/x-ms-excel', 'application/x-excel', 'application/x-dos_ms_excel', 'application/xls', 'application/x-xls', 'application/excel', 'application/download', 'application/vnd.ms-office', 'application/msword'),
'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint', 'application/vnd.ms-office', 'application/msword'),
'pptx' => array('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/x-zip', 'application/zip'),
'wbxml' => 'application/wbxml',
'wmlc' => 'application/wmlc',
'dcr' => 'application/x-director',
'dir' => 'application/x-director',
'dxr' => 'application/x-director',
'dvi' => 'application/x-dvi',
'gtar' => 'application/x-gtar',
'gz' => 'application/x-gzip',
'gzip' => 'application/x-gzip',
'php' => array('application/x-httpd-php', 'application/php', 'application/x-php', 'text/php', 'text/x-php', 'application/x-httpd-php-source'),
'php4' => 'application/x-httpd-php',
'php3' => 'application/x-httpd-php',
'phtml' => 'application/x-httpd-php',
'phps' => 'application/x-httpd-php-source',
'js' => array('application/x-javascript', 'text/plain'),
'swf' => 'application/x-shockwave-flash',
'sit' => 'application/x-stuffit',
'tar' => 'application/x-tar',
'tgz' => array('application/x-tar', 'application/x-gzip-compressed'),
'z' => 'application/x-compress',
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed', 'application/s-compressed', 'multipart/x-zip'),
'rar' => array('application/x-rar', 'application/rar', 'application/x-rar-compressed'),
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mpga' => 'audio/mpeg',
'mp2' => 'audio/mpeg',
'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
'aif' => array('audio/x-aiff', 'audio/aiff'),
'aiff' => array('audio/x-aiff', 'audio/aiff'),
'aifc' => 'audio/x-aiff',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
'rpm' => 'audio/x-pn-realaudio-plugin',
'ra' => 'audio/x-realaudio',
'rv' => 'video/vnd.rn-realvideo',
'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'),
'bmp' => array('image/bmp', 'image/x-bmp', 'image/x-bitmap', 'image/x-xbitmap', 'image/x-win-bitmap', 'image/x-windows-bmp', 'image/ms-bmp', 'image/x-ms-bmp', 'application/bmp', 'application/x-bmp', 'application/x-win-bitmap'),
'gif' => 'image/gif',
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg' => array('image/jpeg', 'image/pjpeg'),
'jpe' => array('image/jpeg', 'image/pjpeg'),
'jp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'j2k' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpf' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpg2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpx' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'jpm' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'mj2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'mjp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'png' => array('image/png', 'image/x-png'),
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'heic' => 'image/heic',
'heif' => 'image/heif',
'css' => array('text/css', 'text/plain'),
'html' => array('text/html', 'text/plain'),
'htm' => array('text/html', 'text/plain'),
'shtml' => array('text/html', 'text/plain'),
'txt' => 'text/plain',
'text' => 'text/plain',
'log' => array('text/plain', 'text/x-log'),
'rtx' => 'text/richtext',
'rtf' => 'text/rtf',
'xml' => array('application/xml', 'text/xml', 'text/plain'),
'xsl' => array('application/xml', 'text/xsl', 'text/xml'),
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',
'avi' => array('video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'),
'movie' => 'video/x-sgi-movie',
'doc' => array('application/msword', 'application/vnd.ms-office'),
'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', 'application/x-zip'),
'dot' => array('application/msword', 'application/vnd.ms-office'),
'dotx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword'),
'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/vnd.ms-excel', 'application/msword', 'application/x-zip'),
'word' => array('application/msword', 'application/octet-stream'),
'xl' => 'application/excel',
'eml' => 'message/rfc822',
'json' => array('application/json', 'text/json'),
'pem' => array('application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'),
'p10' => array('application/x-pkcs10', 'application/pkcs10'),
'p12' => 'application/x-pkcs12',
'p7a' => 'application/x-pkcs7-signature',
'p7c' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
'p7m' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
'p7r' => 'application/x-pkcs7-certreqresp',
'p7s' => 'application/pkcs7-signature',
'crt' => array('application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert'),
'crl' => array('application/pkix-crl', 'application/pkcs-crl'),
'der' => 'application/x-x509-ca-cert',
'kdb' => 'application/octet-stream',
'pgp' => 'application/pgp',
'gpg' => 'application/gpg-keys',
'sst' => 'application/octet-stream',
'csr' => 'application/octet-stream',
'rsa' => 'application/x-pkcs7',
'cer' => array('application/pkix-cert', 'application/x-x509-ca-cert'),
'3g2' => 'video/3gpp2',
'3gp' => array('video/3gp', 'video/3gpp'),
'mp4' => 'video/mp4',
'm4a' => 'audio/x-m4a',
'f4v' => array('video/mp4', 'video/x-f4v'),
'flv' => 'video/x-flv',
'webm' => 'video/webm',
'aac' => array('audio/x-aac', 'audio/aac'),
'm4u' => 'application/vnd.mpegurl',
'm3u' => 'text/plain',
'xspf' => 'application/xspf+xml',
'vlc' => 'application/videolan',
'wmv' => array('video/x-ms-wmv', 'video/x-ms-asf'),
'au' => 'audio/x-au',
'ac3' => 'audio/ac3',
'flac' => 'audio/x-flac',
'ogg' => array('audio/ogg', 'video/ogg', 'application/ogg'),
'kmz' => array('application/vnd.google-earth.kmz', 'application/zip', 'application/x-zip'),
'kml' => array('application/vnd.google-earth.kml+xml', 'application/xml', 'text/xml'),
'ics' => 'text/calendar',
'ical' => 'text/calendar',
'zsh' => 'text/x-scriptzsh',
'7z' => array('application/x-7z-compressed', 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
'7zip' => array('application/x-7z-compressed', 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
'cdr' => array('application/cdr', 'application/coreldraw', 'application/x-cdr', 'application/x-coreldraw', 'image/cdr', 'image/x-cdr', 'zz-application/zz-winassoc-cdr'),
'wma' => array('audio/x-ms-wma', 'video/x-ms-asf'),
'jar' => array('application/java-archive', 'application/x-java-application', 'application/x-jar', 'application/x-compressed'),
'svg' => array('image/svg+xml', 'image/svg', 'application/xml', 'text/xml'),
'vcf' => 'text/x-vcard',
'srt' => array('text/srt', 'text/plain'),
'vtt' => array('text/vtt', 'text/plain'),
'ico' => array('image/x-icon', 'image/x-ico', 'image/vnd.microsoft.icon'),
'odc' => 'application/vnd.oasis.opendocument.chart',
'otc' => 'application/vnd.oasis.opendocument.chart-template',
'odf' => 'application/vnd.oasis.opendocument.formula',
'otf' => 'application/vnd.oasis.opendocument.formula-template',
'odg' => 'application/vnd.oasis.opendocument.graphics',
'otg' => 'application/vnd.oasis.opendocument.graphics-template',
'odi' => 'application/vnd.oasis.opendocument.image',
'oti' => 'application/vnd.oasis.opendocument.image-template',
'odp' => 'application/vnd.oasis.opendocument.presentation',
'otp' => 'application/vnd.oasis.opendocument.presentation-template',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
'odt' => 'application/vnd.oasis.opendocument.text',
'odm' => 'application/vnd.oasis.opendocument.text-master',
'ott' => 'application/vnd.oasis.opendocument.text-template',
'oth' => 'application/vnd.oasis.opendocument.text-web'
);
+14
View File
@@ -0,0 +1,14 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Profiler Sections
| -------------------------------------------------------------------------
| This file lets you determine whether or not various sections of Profiler
| data are displayed when the Profiler is enabled.
| Please see the user guide for info:
|
| https://codeigniter.com/userguide3/general/profiling.html
|
*/
+122
View File
@@ -0,0 +1,122 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
| example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
| https://codeigniter.com/userguide3/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There are three reserved routes:
|
| $route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
| $route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router which controller/method to use if those
| provided in the URL cannot be matched to a valid route.
|
| $route['translate_uri_dashes'] = FALSE;
|
| This is not exactly a route, but allows you to automatically route
| controller and method names that contain dashes. '-' isn't a valid
| class or method name character, so it requires translation.
| When you set this option to TRUE, it will replace ALL dashes in the
| controller and method URI segments.
|
| Examples: my-controller/index -> my_controller/index
| my-controller/my-method -> my_controller/my_method
*/
//public pages
$route['default_controller'] = 'pages/index';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
$route['home'] = 'pages/index';
$route['dashboard'] = 'admin/dashboard';
$route['ledigestilling/maler'] = 'pages/ledigestilling';
$route['profile'] = 'pages/profile';
$route['log-monitor'] = 'Pages/log_monitor';
$route['booking'] = 'pages/booking';
$route['booking-finished'] = 'pages/booking_finished';
$route['quotation-finished'] = 'pages/quotation_finished';
$route['email-verification'] = 'pages/email_verification';
$route['ajax'] = 'pages/ajax';
$route['module-management'] = 'ModuleManagement/index';
$route['booking-process'] = 'pages/booking_process';
//admin portal
$route['login'] = 'Login/index';
$route['users'] = 'admin/users';
$route['user-management'] = 'UserManagement/index';
$route['add-new-user'] = 'UserManagement/add_new_user';
$route['modify-user/(:any)'] = 'UserManagement/modify_user/$1';
$route['user-process'] = 'UserManagement/user_process';
$route['services'] = 'admin/services';
$route['services/add-service'] = 'admin/add_service';
$route['services/update-service/(:any)'] = 'admin/update_service/$1';
$route['services/service-process'] = 'admin/service_process';
$route['groups'] = 'admin/groups';
$route['groups/add-group'] = 'admin/add_group';
$route['groups/update-group/(:any)'] = 'admin/update_group/$1';
$route['groups/group-process'] = 'admin/group_process';
$route['bookings'] = 'admin/bookings';
$route['bookings/add-booking'] = 'admin/add_booking';
$route['bookings/update-booking/(:any)'] = 'admin/update_booking/$1';
$route['bookings/booking-process'] = 'admin/booking_process';
$route['water-channel'] = 'pages/water_channel';
$route['painting'] = 'pages/painting';
$route['carefree-vacation'] = 'pages/carefree_vacation';
$route['polishing'] = 'pages/polishing';
+109
View File
@@ -0,0 +1,109 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
| example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
| https://codeigniter.com/userguide3/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There are three reserved routes:
|
| $route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
| $route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router which controller/method to use if those
| provided in the URL cannot be matched to a valid route.
|
| $route['translate_uri_dashes'] = FALSE;
|
| This is not exactly a route, but allows you to automatically route
| controller and method names that contain dashes. '-' isn't a valid
| class or method name character, so it requires translation.
| When you set this option to TRUE, it will replace ALL dashes in the
| controller and method URI segments.
|
| Examples: my-controller/index -> my_controller/index
| my-controller/my-method -> my_controller/my_method
*/
//public pages
$route['default_controller'] = 'pages/index';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
$route['home'] = 'pages/index';
$route['(:any)/barber'] = 'pages/barber/$1';
$route['(:any)/beauty'] = 'pages/beauty/$1';
$route['(:any)/booking/(:any)'] = 'pages/booking/$1/$2';
$route['(:any)/booking-finished/(:any)'] = 'pages/booking_finished/$1/$2';
$route['email-verification'] = 'pages/email_verification';
$route['ajax'] = 'pages/ajax';
//admin portal
$route['login'] = 'admin/login';
$route['users'] = 'admin/users';
$route['create-user'] = 'admin/create_user';
$route['update-user'] = 'admin/update_user';
$route['user-process'] = 'admin/user_process';
$route['services'] = 'admin/services';
$route['add-service'] = 'admin/add_service';
$route['update-service'] = 'admin/update_service';
$route['service-process'] = 'admin/service_process';
$route['workers'] = 'admin/workers';
$route['add-worker'] = 'admin/add_worker';
$route['update-worker'] = 'admin/update_worker';
$route['worker-process'] = 'admin/worker_process';
$route['booking-process'] = 'pages/booking_process';
+121
View File
@@ -0,0 +1,121 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
| example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
| https://codeigniter.com/userguide3/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There are three reserved routes:
|
| $route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
| $route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router which controller/method to use if those
| provided in the URL cannot be matched to a valid route.
|
| $route['translate_uri_dashes'] = FALSE;
|
| This is not exactly a route, but allows you to automatically route
| controller and method names that contain dashes. '-' isn't a valid
| class or method name character, so it requires translation.
| When you set this option to TRUE, it will replace ALL dashes in the
| controller and method URI segments.
|
| Examples: my-controller/index -> my_controller/index
| my-controller/my-method -> my_controller/my_method
*/
//public pages
$route['default_controller'] = 'pages/index';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
$route['home'] = 'pages/index';
$route['dashboard'] = 'admin/dashboard';
$route['profile'] = 'pages/profile';
$route['log-monitor'] = 'Pages/log_monitor';
$route['booking'] = 'pages/booking';
$route['booking-finished'] = 'pages/booking_finished';
$route['quotation-finished'] = 'pages/quotation_finished';
$route['email-verification'] = 'pages/email_verification';
$route['ajax'] = 'pages/ajax';
$route['module-management'] = 'ModuleManagement/index';
$route['booking-process'] = 'pages/booking_process';
//admin portal
$route['login'] = 'Login/index';
$route['users'] = 'admin/users';
$route['user-management'] = 'UserManagement/index';
$route['add-new-user'] = 'UserManagement/add_new_user';
$route['modify-user/(:any)'] = 'UserManagement/modify_user/$1';
$route['user-process'] = 'UserManagement/user_process';
$route['services'] = 'admin/services';
$route['services/add-service'] = 'admin/add_service';
$route['services/update-service/(:any)'] = 'admin/update_service/$1';
$route['services/service-process'] = 'admin/service_process';
$route['groups'] = 'admin/groups';
$route['groups/add-group'] = 'admin/add_group';
$route['groups/update-group/(:any)'] = 'admin/update_group/$1';
$route['groups/group-process'] = 'admin/group_process';
$route['bookings'] = 'admin/bookings';
$route['bookings/add-booking'] = 'admin/add_booking';
$route['bookings/update-booking/(:any)'] = 'admin/update_booking/$1';
$route['bookings/booking-process'] = 'admin/booking_process';
$route['water-channel'] = 'pages/water_channel';
$route['painting'] = 'pages/painting';
$route['carefree-vacation'] = 'pages/carefree_vacation';
$route['polishing'] = 'pages/polishing';
+64
View File
@@ -0,0 +1,64 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| SMILEYS
| -------------------------------------------------------------------
| This file contains an array of smileys for use with the emoticon helper.
| Individual images can be used to replace multiple smileys. For example:
| :-) and :) use the same image replacement.
|
| Please see user guide for more info:
| https://codeigniter.com/userguide3/helpers/smiley_helper.html
|
*/
$smileys = array(
// smiley image name width height alt
':-)' => array('grin.gif', '19', '19', 'grin'),
':lol:' => array('lol.gif', '19', '19', 'LOL'),
':cheese:' => array('cheese.gif', '19', '19', 'cheese'),
':)' => array('smile.gif', '19', '19', 'smile'),
';-)' => array('wink.gif', '19', '19', 'wink'),
';)' => array('wink.gif', '19', '19', 'wink'),
':smirk:' => array('smirk.gif', '19', '19', 'smirk'),
':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'),
':-S' => array('confused.gif', '19', '19', 'confused'),
':wow:' => array('surprise.gif', '19', '19', 'surprised'),
':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'),
':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'),
'%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'),
';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'),
':P' => array('raspberry.gif', '19', '19', 'raspberry'),
':blank:' => array('blank.gif', '19', '19', 'blank stare'),
':long:' => array('longface.gif', '19', '19', 'long face'),
':ohh:' => array('ohh.gif', '19', '19', 'ohh'),
':grrr:' => array('grrr.gif', '19', '19', 'grrr'),
':gulp:' => array('gulp.gif', '19', '19', 'gulp'),
'8-/' => array('ohoh.gif', '19', '19', 'oh oh'),
':down:' => array('downer.gif', '19', '19', 'downer'),
':red:' => array('embarrassed.gif', '19', '19', 'red face'),
':sick:' => array('sick.gif', '19', '19', 'sick'),
':shut:' => array('shuteye.gif', '19', '19', 'shut eye'),
':-/' => array('hmm.gif', '19', '19', 'hmmm'),
'>:(' => array('mad.gif', '19', '19', 'mad'),
':mad:' => array('mad.gif', '19', '19', 'mad'),
'>:-(' => array('angry.gif', '19', '19', 'angry'),
':angry:' => array('angry.gif', '19', '19', 'angry'),
':zip:' => array('zip.gif', '19', '19', 'zipper'),
':kiss:' => array('kiss.gif', '19', '19', 'kiss'),
':ahhh:' => array('shock.gif', '19', '19', 'shock'),
':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'),
':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'),
':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'),
':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'),
':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'),
':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'),
':vampire:' => array('vampire.gif', '19', '19', 'vampire'),
':snake:' => array('snake.gif', '19', '19', 'snake'),
':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'),
':question:' => array('question.gif', '19', '19', 'question')
);
+222
View File
@@ -0,0 +1,222 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| USER AGENT TYPES
| -------------------------------------------------------------------
| This file contains four arrays of user agent data. It is used by the
| User Agent Class to help identify browser, platform, robot, and
| mobile device data. The array keys are used to identify the device
| and the array values are used to set the actual name of the item.
*/
$platforms = array(
'windows nt 10.0' => 'Windows 10',
'windows nt 6.3' => 'Windows 8.1',
'windows nt 6.2' => 'Windows 8',
'windows nt 6.1' => 'Windows 7',
'windows nt 6.0' => 'Windows Vista',
'windows nt 5.2' => 'Windows 2003',
'windows nt 5.1' => 'Windows XP',
'windows nt 5.0' => 'Windows 2000',
'windows nt 4.0' => 'Windows NT 4.0',
'winnt4.0' => 'Windows NT 4.0',
'winnt 4.0' => 'Windows NT',
'winnt' => 'Windows NT',
'windows 98' => 'Windows 98',
'win98' => 'Windows 98',
'windows 95' => 'Windows 95',
'win95' => 'Windows 95',
'windows phone' => 'Windows Phone',
'windows' => 'Unknown Windows OS',
'android' => 'Android',
'blackberry' => 'BlackBerry',
'iphone' => 'iOS',
'ipad' => 'iOS',
'ipod' => 'iOS',
'os x' => 'Mac OS X',
'ppc mac' => 'Power PC Mac',
'freebsd' => 'FreeBSD',
'ppc' => 'Macintosh',
'linux' => 'Linux',
'debian' => 'Debian',
'sunos' => 'Sun Solaris',
'beos' => 'BeOS',
'apachebench' => 'ApacheBench',
'aix' => 'AIX',
'irix' => 'Irix',
'osf' => 'DEC OSF',
'hp-ux' => 'HP-UX',
'netbsd' => 'NetBSD',
'bsdi' => 'BSDi',
'openbsd' => 'OpenBSD',
'gnu' => 'GNU/Linux',
'unix' => 'Unknown Unix OS',
'symbian' => 'Symbian OS'
);
// The order of this array should NOT be changed. Many browsers return
// multiple browser types so we want to identify the sub-type first.
$browsers = array(
'OPR' => 'Opera',
'Flock' => 'Flock',
'Edge' => 'Edge',
'Chrome' => 'Chrome',
// Opera 10+ always reports Opera/9.80 and appends Version/<real version> to the user agent string
'Opera.*?Version' => 'Opera',
'Opera' => 'Opera',
'MSIE' => 'Internet Explorer',
'Internet Explorer' => 'Internet Explorer',
'Trident.* rv' => 'Internet Explorer',
'Shiira' => 'Shiira',
'Firefox' => 'Firefox',
'Chimera' => 'Chimera',
'Phoenix' => 'Phoenix',
'Firebird' => 'Firebird',
'Camino' => 'Camino',
'Netscape' => 'Netscape',
'OmniWeb' => 'OmniWeb',
'Safari' => 'Safari',
'Mozilla' => 'Mozilla',
'Konqueror' => 'Konqueror',
'icab' => 'iCab',
'Lynx' => 'Lynx',
'Links' => 'Links',
'hotjava' => 'HotJava',
'amaya' => 'Amaya',
'IBrowse' => 'IBrowse',
'Maxthon' => 'Maxthon',
'Ubuntu' => 'Ubuntu Web Browser'
);
$mobiles = array(
// legacy array, old values commented out
'mobileexplorer' => 'Mobile Explorer',
// 'openwave' => 'Open Wave',
// 'opera mini' => 'Opera Mini',
// 'operamini' => 'Opera Mini',
// 'elaine' => 'Palm',
'palmsource' => 'Palm',
// 'digital paths' => 'Palm',
// 'avantgo' => 'Avantgo',
// 'xiino' => 'Xiino',
'palmscape' => 'Palmscape',
// 'nokia' => 'Nokia',
// 'ericsson' => 'Ericsson',
// 'blackberry' => 'BlackBerry',
// 'motorola' => 'Motorola'
// Phones and Manufacturers
'motorola' => 'Motorola',
'nokia' => 'Nokia',
'nexus' => 'Nexus',
'palm' => 'Palm',
'iphone' => 'Apple iPhone',
'ipad' => 'iPad',
'ipod' => 'Apple iPod Touch',
'sony' => 'Sony Ericsson',
'ericsson' => 'Sony Ericsson',
'blackberry' => 'BlackBerry',
'cocoon' => 'O2 Cocoon',
'blazer' => 'Treo',
'lg' => 'LG',
'amoi' => 'Amoi',
'xda' => 'XDA',
'mda' => 'MDA',
'vario' => 'Vario',
'htc' => 'HTC',
'samsung' => 'Samsung',
'sharp' => 'Sharp',
'sie-' => 'Siemens',
'alcatel' => 'Alcatel',
'benq' => 'BenQ',
'ipaq' => 'HP iPaq',
'mot-' => 'Motorola',
'playstation portable' => 'PlayStation Portable',
'playstation 3' => 'PlayStation 3',
'playstation vita' => 'PlayStation Vita',
'hiptop' => 'Danger Hiptop',
'nec-' => 'NEC',
'panasonic' => 'Panasonic',
'philips' => 'Philips',
'sagem' => 'Sagem',
'sanyo' => 'Sanyo',
'spv' => 'SPV',
'zte' => 'ZTE',
'sendo' => 'Sendo',
'nintendo dsi' => 'Nintendo DSi',
'nintendo ds' => 'Nintendo DS',
'nintendo 3ds' => 'Nintendo 3DS',
'wii' => 'Nintendo Wii',
'open web' => 'Open Web',
'openweb' => 'OpenWeb',
'meizu' => 'Meizu',
'huawei' => 'Huawei',
'xiaomi' => 'Xiaomi',
'oppo' => 'Oppo',
'vivo' => 'Vivo',
'infinix' => 'Infinix',
// Operating Systems
'android' => 'Android',
'symbian' => 'Symbian',
'SymbianOS' => 'SymbianOS',
'elaine' => 'Palm',
'series60' => 'Symbian S60',
'windows ce' => 'Windows CE',
// Browsers
'obigo' => 'Obigo',
'netfront' => 'Netfront Browser',
'openwave' => 'Openwave Browser',
'mobilexplorer' => 'Mobile Explorer',
'operamini' => 'Opera Mini',
'opera mini' => 'Opera Mini',
'opera mobi' => 'Opera Mobile',
'fennec' => 'Firefox Mobile',
// Other
'digital paths' => 'Digital Paths',
'avantgo' => 'AvantGo',
'xiino' => 'Xiino',
'novarra' => 'Novarra Transcoder',
'vodafone' => 'Vodafone',
'docomo' => 'NTT DoCoMo',
'o2' => 'O2',
// Fallback
'mobile' => 'Generic Mobile',
'wireless' => 'Generic Mobile',
'j2me' => 'Generic Mobile',
'midp' => 'Generic Mobile',
'cldc' => 'Generic Mobile',
'up.link' => 'Generic Mobile',
'up.browser' => 'Generic Mobile',
'smartphone' => 'Generic Mobile',
'cellphone' => 'Generic Mobile'
);
// There are hundreds of bots but these are the most common.
$robots = array(
'googlebot' => 'Googlebot',
'msnbot' => 'MSNBot',
'baiduspider' => 'Baiduspider',
'bingbot' => 'Bing',
'slurp' => 'Inktomi Slurp',
'yahoo' => 'Yahoo',
'ask jeeves' => 'Ask Jeeves',
'fastcrawler' => 'FastCrawler',
'infoseek' => 'InfoSeek Robot 1.0',
'lycos' => 'Lycos',
'yandex' => 'YandexBot',
'mediapartners-google' => 'MediaPartners Google',
'CRAZYWEBCRAWLER' => 'Crazy Webcrawler',
'adsbot-google' => 'AdsBot Google',
'feedfetcher-google' => 'Feedfetcher Google',
'curious george' => 'Curious George',
'ia_archiver' => 'Alexa Crawler',
'MJ12bot' => 'Majestic-12',
'Uptimebot' => 'Uptimebot',
'UptimeRobot' => 'UptimeRobot'
);
+744
View File
@@ -0,0 +1,744 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Admin extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see https://codeigniter.com/userguide3/general/urls.html
*/
public function dashboard(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['pageTitle'] = 'Vezérlőpult';
$data['message'] = '';
$data['message_class'] = '';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$this->load->view('admin/dashboard', $data);
}
else{
header("Location:".SITEURL."login");
}
}
public function services(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['pageTitle'] = 'Szolgáltatások';
$data['message'] = '';
$data['message_class'] = '';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$data['results'] = $this->Service_model->getAllServices();
$this->load->view('admin/services', $data);
}
else{
header("Location:".SITEURL."login");
}
}
public function add_service(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['pageTitle'] = 'Szolgáltatás hozzáadás';
$data['message'] = '';
$data['message_class'] = '';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$this->load->view('admin/add-service', $data);
}
else{
header("Location:".SITEURL."login");
}
}
public function update_service($service_id){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['pageTitle'] = 'Szolgáltatás módosítása (#'.$service_id.')';
$data['message'] = '';
$data['message_class'] = '';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$data['selectedItem'] = $this->Service_model->getServiceById($service_id);
$this->load->view('admin/update-service', $data);
}
else{
header("Location:".SITEURL."login");
}
}
public function service_process(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$this->load->model('Log_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['pageTitle'] = '';
$data['message'] = '';
$data['message_class'] = '';
if(isset($_GET['delete-service'])){
$selected_service = $this->Service_model->getServiceById($_GET['delete-service']);
$serviceArray = array(
'is_deleted' => '1'
);
$this->Service_model->updateService($_GET['delete-service'], $serviceArray);
$this->Log_model->addLog('services', $data['currentUser']->username.' törölte a(z) '.$_GET['delete-service'].' számú szolgáltatást ('.$selected_service->service_name_hu.')', $data['currentUser']->username);
}
if(isset($_POST['addNewService'])){
$serviceArray = array(
'main_category' => $_POST['main_category'],
'main_category_description' => $_POST['main_category_description'],
'service_category' => $_POST['service_category'],
'service_name' => $_POST['service_name'],
'service_description' => $_POST['service_description'],
'service_price' => $_POST['service_price'],
'service_time' => $_POST['service_time'],
'is_enabled' => $_POST['is_enabled']
);
$this->Log_model->addLog('services', $data['currentUser']->username.' hozzáadta a(z) '.$_POST['service_name'].' szolgáltatást ('.implode(',',$serviceArray).')', $data['currentUser']->username);
$this->Service_model->createService($serviceArray);
}
if(isset($_POST['updateService'])){
$serviceArray = array(
'main_category' => $_POST['main_category'],
'main_category_description' => $_POST['main_category_description'],
'service_category' => $_POST['service_category'],
'service_name' => $_POST['service_name'],
'service_description' => $_POST['service_description'],
'service_price' => $_POST['service_price'],
'service_time' => $_POST['service_time'],
'is_enabled' => $_POST['is_enabled']
);
$this->Log_model->addLog('services', $data['currentUser']->username.' módosította a(z) '.$_POST['service_name'].' szolgáltatást ('.implode(',',$serviceArray).')', $data['currentUser']->username);
$this->Service_model->updateService($_POST['service_id'], $serviceArray);
}
header('Location:'.SITEURL.'services');
$this->load->view('admin/service-process', $data);
}
}
public function groups(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Group_model');
$this->load->model('Service_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['pageTitle'] = 'Csoportok';
$data['message'] = '';
$data['message_class'] = '';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$data['results'] = $this->Group_model->getAllGroups();
$this->load->view('admin/groups', $data);
}
else{
header("Location:".SITEURL."login");
}
}
public function add_group(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Group_model');
$this->load->model('Service_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['pageTitle'] = 'Csoport hozzáadása';
$data['message'] = '';
$data['message_class'] = '';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$data['services'] = $this->Service_model->getAllServiceByServiceType();
$this->load->view('admin/add-group', $data);
}
else{
header("Location:".SITEURL."login");
}
}
public function update_group($group_id){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Group_model');
$this->load->model('Service_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['pageTitle'] = 'Csoport módosítása (#'.$group_id.')';
$data['message'] = '';
$data['message_class'] = '';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$data['selectedItem'] = $this->Group_model->getGroupById($group_id);
$data['services'] = $this->Service_model->getAllServiceByServiceType();
$this->load->view('admin/update-group', $data);
}
else{
header("Location:".SITEURL."login");
}
}
public function group_process(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Group_model');
$this->load->model('Service_model');
$this->load->model('Log_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['pageTitle'] = '';
$data['message'] = '';
$data['message_class'] = '';
if(isset($_GET['delete-group'])){
$selected_group = $this->Group_model->getGroupById($_GET['delete-group']);
$groupArray = array(
'is_deleted' => '1'
);
$this->Service_model->updateGroup($_GET['group-group'], $groupArray);
$this->Log_model->addLog('groups', $data['currentUser']->username.' törölte a(z) '.$_GET['delete-group'].' számú csoportot ('.$selected_group->group_group.')', $data['currentUser']->username);
}
if(isset($_POST['addNewGroup'])){
$data['group_profile_img'] = '';
if($_FILES["group_profile_img"]["tmp_name"] != ''){
$target_dir = getcwd()."/assets/img/";
$target_file = $target_dir . 'group_'.str_replace(' ','_', $_POST['group_name']);
$imageFileType = strtolower(pathinfo(basename($_FILES["group_profile_img"]["name"]),PATHINFO_EXTENSION));
if (move_uploaded_file($_FILES["group_profile_img"]["tmp_name"], $target_file.'.'.$imageFileType)) {
$data['message'] = 'A profilkép sikeresen feltöltve!';
$data['message_class'] = 'successMessage';
$data['group_profile_img'] = 'group_'.str_replace(' ','_', $_POST['group_name']).'.'.$imageFileType;
} else {
$data['message'] = 'Hiba a feltöltés közben!';
$data['message_class'] = 'errorMessage';
}
}
$skillsArray = array();
$services = $this->Service_model->getAllServiceByServiceType();
if(is_array($services)){
foreach($services as $serviceItem){
if(isset($_POST['skill_'.$serviceItem->service_id]) && $_POST['skill_'.$serviceItem->service_id] == '1'){
$skillsArray[] = $serviceItem->service_id;
}
}
}
$groupArray = array(
'group_name' => $_POST['group_name'],
'group_info' => $_POST['group_info'],
'group_profile_img' => $data['group_profile_img'],
'skills' => implode(',', $skillsArray),
'is_active' => $_POST['is_active'],
'group_notes' => $_POST['group_notes']
);
$this->Log_model->addLog('groups', $data['currentUser']->username.' létrehozta a(z) '.$_POST['group_name'].' nevű csoportot ('.implode(',',$groupArray).')', $data['currentUser']->username);
$groupArray['skills'] = serialize($skillsArray);
$this->Group_model->createGroup($groupArray);
}
if(isset($_POST['updateGroup'])){
$data['group_profile_img'] = '';
$skillsArray = array();
$services = $this->Service_model->getAllServiceByServiceType();
if(is_array($services)){
foreach($services as $serviceItem){
if(isset($_POST['skill_'.$serviceItem->service_id]) && $_POST['skill_'.$serviceItem->service_id] == '1'){
$skillsArray[] = $serviceItem->service_id;
}
}
}
$groupArray = array(
'group_name' => $_POST['group_name'],
'group_info' => $_POST['group_info'],
'group_profile_img' => $data['group_profile_img'],
'skills' => implode(',', $skillsArray),
'is_active' => $_POST['is_active'],
'group_notes' => $_POST['group_notes']
);
$this->Log_model->addLog('groups', $data['currentUser']->username.' módosította a(z) '.$_POST['group_name'].' nevű csoportot ('.implode(',',$groupArray).')', $data['currentUser']->username);
$groupArray['skills'] = serialize($skillsArray);
$this->Group_model->updateGroup($_POST['group_id'], $groupArray);
if($_FILES["group_profile_img"]["tmp_name"] != ''){
$target_dir = getcwd()."/assets/img/";
$target_file = $target_dir . 'group_'.str_replace(' ','_', $_POST['group_name']);
$imageFileType = strtolower(pathinfo(basename($_FILES["group_profile_img"]["name"]),PATHINFO_EXTENSION));
if (move_uploaded_file($_FILES["group_profile_img"]["tmp_name"], $target_file.'.'.$imageFileType)) {
$data['message'] = 'A profilkép sikeresen feltöltve!';
$data['message_class'] = 'successMessage';
$data['group_profile_img'] = 'group_'.str_replace(' ','_', $_POST['group_name']).'.'.$imageFileType;
$groupArray = array(
'group_profile_img' => $data['group_profile_img']
);
$this->Log_model->addLog('groups', $data['currentUser']->username.' profilképet állított be a(z) '.$_POST['group_name'].' nevű csoporthoz', $data['currentUser']->username);
$this->Group_model->updateGroup($_POST['group_id'], $groupArray);
} else {
$data['message'] = 'Hiba a feltöltés közben!';
$data['message_class'] = 'errorMessage';
}
}
}
header("Location:".SITEURL."groups");
$this->load->view('admin/group-process', $data);
}
}
public function bookings(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['pageTitle'] = 'Foglalások';
$data['message'] = '';
$data['message_class'] = '';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$data['results'] = $this->Service_model->getActualBookings();
$this->load->view('admin/bookings', $data);
}
else{
header("Location:".SITEURL."login");
}
}
public function add_booking(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$this->load->model('Group_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['pageTitle'] = 'Foglalás hozzáadása';
$data['message'] = '';
$data['message_class'] = '';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$available_services = $this->Service_model->getAvailableServices();
$serviceFile = fopen("load_services.json", "w") or die("Unable to open file!");
fwrite($serviceFile, json_encode($available_services));
fclose($serviceFile);
$data['workgroups'] = $this->Group_model->getAllGroups();
$this->load->view('admin/add-booking', $data);
}
else{
header("Location:".SITEURL."login");
}
}
public function update_booking($booking_id){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$this->load->model('Module_model');
$this->load->model('Group_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['pageTitle'] = 'Foglalás módosítása (#'.$booking_id.')';
$data['message'] = '';
$data['message_class'] = '';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$available_services = $this->Service_model->getAvailableServices();
$serviceFile = fopen("load_services.json", "w") or die("Unable to open file!");
fwrite($serviceFile, json_encode($available_services));
fclose($serviceFile);
$data['workgroups'] = $this->Group_model->getAllGroups();
$data['selectedItem'] = $this->Service_model->getBookingById($booking_id);
$this->load->view('admin/update-booking', $data);
}
else{
header("Location:".SITEURL."login");
}
}
public function booking_process(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$this->load->model('Log_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['pageTitle'] = '';
$data['message'] = '';
$data['message_class'] = '';
if(isset($_GET['delete-booking'])){
$selectedBooking = $this->Service_model->getBookingById($_GET['delete-booking']);
$this->Service_model->deleteBooking($_GET['delete-booking']);
$this->Log_model->addLog('bookings', $data['currentUser']->username.' törölte a(z) '.$_GET['delete-booking'].' számú foglalást ('.$selectedBooking->guest_name.', '.$selectedBooking->guest_email.', '.$selectedBooking->guest_phone.', '.$selectedBooking->booking_date.', '.$selectedBooking->booking_start_time.', '.$selectedBooking->booking_finish_time.', '.$selectedBooking->service_ids.')', $data['currentUser']->username);
header('Location:'.SITEURL.'bookings');
}
if(isset($_POST['addNewBookingManual'])){
$booking_date = new DateTime(date('Y-m-d', strtotime($_POST['booking_date'])));
$end_booking_date = new DateTime(date('Y-m-d', strtotime($_POST['end_booking_date'])));
$diff = $booking_date->diff($end_booking_date);
$selectedServiceArray = array();
if($_POST['service_ids'] != ''){
$selectedServiceArray = explode(',', $_POST['service_ids']);
}
if($_POST['booking_date'] != $_POST['end_booking_date'] && $booking_date <= $end_booking_date){
for($index = 0; $index <= $diff->days; $index++){
$selectedDate = date('Y-m-d', strtotime($_POST['booking_date']. ' + '.$index.' days'));
$bookingArray = array(
'guest_name' => $_POST['guest_name'],
'guest_email' => $_POST['guest_email'],
'guest_phone' => $_POST['guest_phone'],
'group_id' => $_POST['group_id'],
'booking_date' => $selectedDate,
'booking_start_time' => $_POST['booking_start_time'],
'booking_finish_time' => $_POST['booking_finish_time'],
'service_ids' => serialize($selectedServiceArray),
'guest_confirmed' => '0',
'guest_confirm_code' => '1234',
);
$this->Service_model->createBooking($bookingArray);
}
}
else{
$bookingArray = array(
'guest_name' => $_POST['guest_name'],
'guest_email' => $_POST['guest_email'],
'guest_phone' => $_POST['guest_phone'],
'group_id' => $_POST['group_id'],
'booking_date' => $_POST['booking_date'],
'booking_start_time' => $_POST['booking_start_time'],
'booking_finish_time' => $_POST['booking_finish_time'],
'service_ids' => serialize($selectedServiceArray),
'guest_confirmed' => '0',
'guest_confirm_code' => '1234',
);
$this->Log_model->addLog('bookings', $data['currentUser']->username.' létrehoza a(z) '.$_POST['guest_name'].' nevű vendég foglalást ('.implode(', ', $bookingArray).')', $data['currentUser']->username);
$this->Service_model->createBooking($bookingArray);
}
if($_POST['send_notification']){
$worker = $this->Service_model->getWorkerById($bookingArray['worker_id']);
$services = unserialize($bookingArray['service_ids']);
$serviceArray = array();
$emailArray = array();
if(is_array($services)){
foreach($services as $serviceItem){
$selectedService = $this->Service_model->getServiceById($serviceItem);
if(is_object($selectedService)){
$serviceArray[] = $selectedService;
}
}
}
$content = '';
$content = 'Kjære gjest,<br />';
$content .= 'Takk for din bestilling!<br />';
$content .= '<br />';
$content .= '<table>';
$content .= '<tr><td>Navn: </td><td>'.$bookingArray['guest_name'].'</td></tr>';
$content .= '<tr><td>E-post: </td><td>'.$bookingArray['guest_email'].'</td></tr>';
$content .= '<tr><td>Telefon: </td><td>'.$bookingArray['guest_phone'].'</td></tr>';
$content .= '<tr><td>Arbeider: </td><td>'.$worker->worker_name.'</td></tr>';
$content .= '<tr><td>Dato: </td><td>'.$bookingArray['booking_date'].'</td></tr>';
$content .= '<tr><td>Tid: </td><td>'.$bookingArray['booking_start_time'].' - '.$bookingArray['booking_finish_time'].'</td></tr>';
$content .= '<tr><td>Tjenester: </td><td><table>';
$totalServicePrice = 0;
foreach($serviceArray as $serviceArrayItem){
$totalServicePrice += $serviceArrayItem->service_price;
$content .= '<tr><td>'.$serviceArrayItem->service_name_no.'</td><td>'.$serviceArrayItem->service_price.' kr</td></tr>';
}
$content .= '</table></td>';
$content .= '<tr><td>Totalpris: </td><td><strong>'.$totalServicePrice.' kr</strong></td></tr>';
$content .= '</table>';
$content .= '<br /> STUDIOBEVE';
$this->Log_model->addLog('bookings', $data['currentUser']->username.' új foglalásról norvég nyelvű értesítést küldött a(z) '.$bookingArray['guest_email'].' email címre ('.implode(', ', $bookingArray).')', $data['currentUser']->username);
$emailItem = array(
'addressee_email' => $bookingArray['guest_email'],
'addressee_name' => $bookingArray['guest_name'],
'subject' => '[dinbestehjelper] Your booking has arrived',
'content' => $content,
'attachments' => array()
);
$emailArray[] = $emailItem;
$this->User_model->sendEmail($emailArray);
}
header('Location:'.SITEURL.'bookings');
}
if(isset($_POST['updateBookingManual'])){
$booking_date = new DateTime(date('Y-m-d', strtotime($_POST['booking_date'])));
$end_booking_date = new DateTime(date('Y-m-d', strtotime($_POST['end_booking_date'])));
$diff = $booking_date->diff($end_booking_date);
$selectedServiceArray = array();
if($_POST['service_ids'] != ''){
$selectedServiceArray = explode(',', $_POST['service_ids']);
}
if($_POST['booking_date'] != $_POST['end_booking_date'] && $booking_date <= $end_booking_date){
for($index = 0; $index <= $diff->days; $index++){
$selectedDate = date('Y-m-d', strtotime($_POST['booking_date']. ' + '.$index.' days'));
$bookingArray = array(
'guest_name' => $_POST['guest_name'],
'guest_email' => $_POST['guest_email'],
'guest_phone' => $_POST['guest_phone'],
'worker_id' => $_POST['worker_id'],
'booking_date' => $selectedDate,
'booking_start_time' => $_POST['booking_start_time'],
'booking_finish_time' => $_POST['booking_finish_time'],
'service_ids' => serialize($selectedServiceArray),
'guest_confirmed' => '0',
'guest_confirm_code' => '1234'
);
$this->Service_model->createBooking($bookingArray);
}
}
else{
$bookingArray = array(
'guest_name' => $_POST['guest_name'],
'guest_email' => $_POST['guest_email'],
'guest_phone' => $_POST['guest_phone'],
'group_id' => $_POST['group_id'],
'booking_date' => $_POST['booking_date'],
'booking_start_time' => $_POST['booking_start_time'],
'booking_finish_time' => $_POST['booking_finish_time'],
'service_ids' => serialize($selectedServiceArray),
'guest_confirmed' => '0',
'guest_confirm_code' => '1234'
);
$this->Service_model->updateBooking($_POST['booking_id'], $bookingArray);
$this->Log_model->addLog('bookings', $data['currentUser']->username.' módosította a foglalását a(z) '.$bookingArray['guest_name'].' nevű vendégnek ('.implode(', ', $bookingArray).')', $data['currentUser']->username);
}
if($_POST['send_notification']){
$workgroup = $this->Service_model->getWorkerById($bookingArray['group_id']);
$services = unserialize($bookingArray['service_ids']);
$serviceArray = array();
$emailArray = array();
if(is_array($services)){
foreach($services as $serviceItem){
$selectedService = $this->Service_model->getServiceById($serviceItem);
if(is_object($selectedService)){
$serviceArray[] = $selectedService;
}
}
}
$content = '';
$email_subject ='[studiobeve] Din reservasjon er endret';
$content = 'Kjære gjest,<br />';
$content .= 'Vi vil gjerne informere deg om at din reservasjon er endret.<br />';
$content .= '<br />';
$content .= '<table>';
$content .= '<tr><td>Navn: </td><td>'.$bookingArray['guest_name'].'</td></tr>';
$content .= '<tr><td>E-post: </td><td>'.$bookingArray['guest_email'].'</td></tr>';
$content .= '<tr><td>Telefon: </td><td>'.$bookingArray['guest_phone'].'</td></tr>';
$content .= '<tr><td>Arbeider: </td><td>'.$worker->worker_name.'</td></tr>';
$content .= '<tr><td>Dato: </td><td>'.$bookingArray['booking_date'].'</td></tr>';
$content .= '<tr><td>Tid: </td><td>'.$bookingArray['booking_start_time'].' - '.$bookingArray['booking_finish_time'].'</td></tr>';
$content .= '<tr><td>Tjenester: </td><td><table>';
$totalServicePrice = 0;
foreach($serviceArray as $serviceArrayItem){
$totalServicePrice += $serviceArrayItem->service_price;
$content .= '<tr><td>'.$serviceArrayItem->service_name_no.'</td><td>'.$serviceArrayItem->service_price.' kr</td></tr>';
}
$content .= '</table></td>';
$content .= '<tr><td>Totalpris: </td><td><strong>'.$totalServicePrice.' kr</strong></td></tr>';
$content .= '</table>';
$content .= '<br /> STUDIOBEVE';
$this->Log_model->addLog('bookings', $data['currentUser']->username.' foglalás módosításról norvég nyelvű értesítést küldött a(z) '.$bookingArray['guest_email'].' email címre ('.implode(', ', $bookingArray).')', $data['currentUser']->username);
$emailItem = array(
'addressee_email' => $bookingArray['guest_email'],
'addressee_name' => $bookingArray['guest_name'],
'subject' => $email_subject,
'content' => $content,
'attachments' => array()
);
$emailArray[] = $emailItem;
$this->User_model->sendEmail($emailArray);
}
header('Location:'.SITEURL.'bookings');
}
$this->load->view('admin/booking-process', $data);
}
}
}
+95
View File
@@ -0,0 +1,95 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Login extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see https://codeigniter.com/user_guide/general/urls.html
*/
public function index(){
$this->load->helper('url');
$this->load->helper('cookie');
$this->load->model('User_model');
$this->load->model('Log_model');
$data['message'] = '';
$data['message_class'] = '';
$data['username'] = '';
$data['password'] = '';
if(isset($_GET['logout']) && isset($_SESSION['username'])){
$this->Log_model->addLog('logout', 'Sikeres kijelentkezés - '.$_SESSION['username'],$_SESSION['username']);
unset($_SESSION['username']);
unset($_SESSION['password']);
$data['message'] = 'Sikeres kijelentkezés!';
$data['message_class'] = 'success';
}
elseif(isset($_POST['sendLogin'])){
if($this->User_model->userCanLogin($_POST['username'], $_POST['password'])){
if($_POST['remember'] == 'on'){
$cookie = array(
'name' => 'username',
'value' => $_POST['username'],
'expire' => '300',
'secure' => TRUE
);
$this->input->set_cookie($cookie);
$cookie = array(
'name' => 'password',
'value' => $_POST['password'],
'expire' => '300',
'secure' => TRUE
);
$this->input->set_cookie($cookie);
}
else{
delete_cookie("username");
delete_cookie("password");
}
$this->Log_model->addLog('login', 'Sikeres bejelentkezés - '.$_POST['username'],$_POST['username']);
$_SESSION['username'] = $_POST['username'];
$_SESSION['password'] = $_POST['password'];
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
header('location:'.base_url().'dashboard');
}
else{
$this->Log_model->addLog('login', 'Sikertelen bejelentkezési kísérlet - '.$_POST['username'].' / '.$_POST['password'],$_POST['username']);
$data['message'] = 'Sikertelen bejelentkezés!';
$data['message_class'] = 'error';
}
}
$data['username'] = get_cookie('username');
$data['password'] = get_cookie('password');
$data['pageTitle'] = 'Bejelentkezés';
$this->load->view('login',$data);
}
}
?>
@@ -0,0 +1,182 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class ModuleManagement extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see https://codeigniter.com/user_guide/general/urls.html
*/
public function index()
{
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Log_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
//check module is available for user
$currentModule = $this->Module_model->getModuleBySlug('module-management');
if($this->User_model->is_user_admin($_SESSION['username']) || $this->Module_model->is_module_available($currentModule->module_id, $data['currentUser']->user_id)){
$data['users'] = $this->User_model->getAllUser();
$data['modules'] = $this->Module_model->getAllModule();
$data['privileges'] = $this->User_model->getAllUserGroup();
if(isset($_POST['updatePermission'])){
//set user privileges
foreach($data['modules'] as $moduleItem){
$moduleUserArray = array();
foreach($data['users'] as $userItem){
if($_POST['module_'.$moduleItem->module_id.'_user_'.$userItem->user_id]){
$moduleUserArray[] = $userItem->user_id;
}
}
if(is_array($moduleUserArray)){
$this->Module_model->updateModule('permission_ids', $moduleItem->module_id, $moduleUserArray);
$usernames = array();
foreach($moduleUserArray as $moduleUserItem){
$usernames[] = $this->User_model->getUserById($moduleUserItem)->username;
}
if(!empty($usernames)){
$this->Log_model->addLog('change_module_privileges', 'Módosult a '.$moduleItem->module_name.' felhasználó szintű jogosultság kiosztás('.implode(', ', $usernames).') felhasználókra', $_SESSION['username']);
}
else{
$this->Log_model->addLog('change_module_privileges', 'Módosult a '.$moduleItem->module_name.' felhasználó szintű jogosultság kiosztása, jelenleg nincs megosztva', $_SESSION['username']);
}
}
}
//set group privilegies
foreach($data['modules'] as $moduleItem){
$moduleGroupArray = array();
foreach($data['privileges'] as $groupItem){
if($_POST['module_'.$moduleItem->module_id.'_group_'.$groupItem->permission_id]){
$moduleGroupArray[] = $groupItem->permission_id;
}
}
if(is_array($moduleGroupArray)){
$this->Module_model->updateModule('permission_group_ids',$moduleItem->module_id, $moduleGroupArray);
$groupNames = array();
foreach($moduleGroupArray as $moduleGroupItem){
$groupNames[] = $this->User_model->getpermissionById($moduleGroupItem)->permission_name;
}
if(!empty($groupNames)){
$this->Log_model->addLog('change_module_privileges', 'Módosult a '.$moduleItem->module_name.' csoport szintű jogosultság kiosztás ('.(implode(', ',$groupNames)).') csoportokra', $_SESSION['username']);
}
else{
$this->Log_model->addLog('change_module_privileges', 'Módosult a '.$moduleItem->module_name.' csoport szintű jogosultság kiosztása, jelenleg nincs megosztva', $_SESSION['username']);
}
}
}
}
//usersPrivilegesView
$userIndex = 1;
if(is_array($data['users'])){
$data['usersPrivilegesView'] = '';
foreach($data['users'] as $userItem){
$data['usersPrivilegesView'] .= '<tr>';
$data['usersPrivilegesView'] .= '<td>'.$userIndex.'.</td>';
$data['usersPrivilegesView'] .= '<td style="text-align:left;max-width:auto;">'.$userItem->fullname.'</td>';
$data['usersPrivilegesView'] .= '<td style="text-align:left;max-width:auto;">'.$userItem->username.'</td>';
if(is_array($data['modules'])){
foreach($data['modules'] as $moduleItem){
if($userItem->permission_slug == 'admin'){
$data['usersPrivilegesView'] .= '<td><input type="hidden" name="module_'.$moduleItem->module_id.'_user_'.$userItem->user_id.'" value="0"><input type="checkbox" name="module_'.$moduleItem->module_id.'_user_'.$userItem->user_id.'" value="1" checked disabled/></td>';
}
else{
$data['usersPrivilegesView'] .= '<td><input type="hidden" name="module_'.$moduleItem->module_id.'_user_'.$userItem->user_id.'" value="0"><input type="checkbox" name="module_'.$moduleItem->module_id.'_user_'.$userItem->user_id.'" value="1" ';
$data['usersPrivilegesView'] .= $this->Module_model->is_userId_available_in_module($moduleItem->module_id, $userItem->user_id)?'checked':'';
$data['usersPrivilegesView'] .= '/></td>';
}
}
}
$userIndex++;
$data['usersPrivilegesView'] .= '</tr>';
}
}
//groupModuleView
$groupIndex = 1;
foreach($data['privileges'] as $privilegeItem){
if($privilegeItem->permission_slug == 'admin'){
$data['groupModuleView'] = '<tr>';
$data['groupModuleView'] .= '<td>'.$groupIndex.'.</td>';
$data['groupModuleView'] .= '<td style="text-align:left;max-width:auto;">'.$privilegeItem->permission_name.'</td>';
if(is_array($data['modules'])){
foreach($data['modules'] as $moduleItem){
$data['groupModuleView'] .= '<td><input type="hidden" name="module_'.$moduleItem->module_id.'_group_'.$privilegeItem->permission_id.'" value="0"><input type="checkbox" name="module_'.$moduleItem->module_id.'_group_'.$privilegeItem->permission_id.'" value="1" checked disabled/></td>';
}
}
$groupIndex++;
$data['groupModuleView'] .= '</tr>';
}
else{
$data['groupModuleView'] .= '<tr>';
$data['groupModuleView'] .= '<td>'.$groupIndex.'.</td>';
$data['groupModuleView'] .= '<td style="text-align:left;max-width:auto;">'.$privilegeItem->permission_name.'</td>';
if(is_array($data['modules'])){
foreach($data['modules'] as $moduleItem){
$data['groupModuleView'] .= '<td><input type="hidden" name="module_'.$moduleItem->module_id.'_group_'.$privilegeItem->permission_id.'" value="0"><input type="checkbox" name="module_'.$moduleItem->module_id.'_group_'.$privilegeItem->permission_id.'" value="1" ';
$data['groupModuleView'] .= $this->Module_model->is_groupId_available_in_module($moduleItem->module_id,$privilegeItem->permission_id)?' checked':'';
$data['groupModuleView'] .= '/></td>';
}
}
$groupIndex++;
$data['groupModuleView'] .= '</tr>';
}
}
//get available modules for menu
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$this->load->view('modules/module-management/module-management', $data);
}
else{
header('Location:'.site_url().'404-page-not-found');
}
}
else{
header("Location:".SITEURL."login");
}
}
}
+792
View File
@@ -0,0 +1,792 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Pages extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see https://codeigniter.com/userguide3/general/urls.html
*/
public function index(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['services'] = $this->Service_model->getAllServiceByServiceType();
$data['pageTitle'] = '';
$this->load->view('pages/home', $data);
}
public function booking(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
//$data['services'] = $this->Service_model->getAllServiceByServiceType();
$cleaningService = array('1');
$data['cleaningServices'] = $this->Service_model->getAllServiceByGroups($cleaningService);
/*echo '<pre>';
print_r($data['cleaningServices']);
echo '</pre>';*/
$carService = array('2,3,4,5, 6,11');
$data['carServices'] = $this->Service_model->getAllServiceByGroups($carService);
$helphandService = array('7');
$data['helphandServices'] = $this->Service_model->getAllServiceByGroups($helphandService);
$gardenService = array('8');
$data['gardenServices'] = $this->Service_model->getAllServiceByGroups($gardenService);
$houseService = array('9');
$data['houseServices'] = $this->Service_model->getAllServiceByGroups($houseService);
$buildService = array('10');
$data['buildServices'] = $this->Service_model->getAllServiceByGroups($buildService);
$data['serviceGroups'] = $this->Service_model->getServiceGroups();
$data['workgroups'] = $this->Group_model->getAllActiveGroups();
$data['activeWorkgroup'] = $this->Group_model->getAvailableGroup('2024-08-25', '1');
$this->load->view('pages/booking', $data);
}
public function booking_finished(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
$this->load->view('pages/booking-finished', $data);
}
public function quotation_finished(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
$this->load->view('pages/quotation-finished', $data);
}
public function water_channel(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
$data['services'] = $this->Service_model->getAllServiceByServiceType();
$this->load->view('pages/water-channel', $data);
}
public function painting(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
$data['services'] = $this->Service_model->getAllServiceByServiceType();
$this->load->view('pages/painting', $data);
}
public function carefree_vacation(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
$data['services'] = $this->Service_model->getAllServiceByServiceType();
$this->load->view('pages/carefree-vacation', $data);
}
public function polishing(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
$data['services'] = $this->Service_model->getAllServiceByServiceType();
$this->load->view('pages/polishing', $data);
}
public function ledigestilling(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
$data['services'] = $this->Service_model->getAllServiceByServiceType();
$this->load->view('pages/ledigestilling', $data);
}
public function email_verification(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$this->load->model('Log_model');
$data['pageTitle'] = '';
$this->load->view('pages/email-verification', $data);
}
public function ajax(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$this->load->model('Group_model');
$this->load->model('Log_model');
$data['pageTitle'] = '';
if(isset($_POST['action']) && $_POST['action'] == 'calculate_service_length' && isset($_POST['service_ids'])){
if($_POST['service_ids'] != ''){
$explodedServiceIds = explode(',', $_POST['service_ids']);
$totalLength = '00:00:00';
if(!empty($explodedServiceIds)){
foreach($explodedServiceIds as $explodedServiceIdItem){
$currentService = $this->Service_model->getServiceById($explodedServiceIdItem);
$time = $totalLength;
$time2 = $currentService->service_time;
$secs = strtotime($time2)-strtotime("00:00:00");
$addedTotal = date("H:i:s",strtotime($time)+$secs);
$totalLength = $addedTotal;
}
}
echo $totalLength;
}
}
if(isset($_POST['action']) && $_POST['action'] == 'getAvailableTimeOptions' && isset($_POST['selectedDate'])){
$results = $this->Service_model->getAvailableTimes($_POST['group_id'], $_POST['selectedDate'], $_POST['servicelength']);
$rowIndex = 1;
if(is_array($results)){
foreach($results as $resultIem){
?>
<option value="<?php echo $resultIem;?>"><?php echo date('H:i', strtotime($resultIem));?></option>
<?php
$rowIndex++;
}
}
else{
echo 0;
}
}
if(isset($_POST['action']) && $_POST['action'] == 'getAvailableGroup' && isset($_POST['service_category'])){
if($_POST['service_category'] != 0){
$selectedGroup = $this->Group_model->getAvailableGroup($_POST['booking_date'], $_POST['service_category']);
echo $selectedGroup->group_id;
}
else{
echo 0;
}
}
if(isset($_POST['action']) && $_POST['action'] == 'isTimeAvailable' && isset($_POST['selectedDate'])){
$results = $this->Service_model->getAvailableTimes($_POST['group_id'], $_POST['selectedDate'], $_POST['servicelength']);
$timeIsAvailable = 0;
if(is_array($results)){
foreach($results as $resultIem){
if(date('H:i:s', strtotime($resultIem)) == $_POST['selectedTime']){
$timeIsAvailable = 1;
}
}
echo $timeIsAvailable;
}
else{
echo 0;
}
}
if(isset($_POST['action']) && $_POST['action'] == 'getAvailableTimes' && isset($_POST['selectedDate'])){
$results = $this->Service_model->getAvailableTimes($_POST['group_id'], $_POST['selectedDate'], $_POST['servicelength'].':00');
$rowIndex = 1;
if(!empty($results)){
foreach($results as $resultIem){
?>
<div class="availableBookingTime" id="bookingTime_<?php echo $rowIndex;?>" onclick="setSelectedTime('<?php echo $resultIem;?>', '<?php echo $rowIndex;?>')"><span><?php echo date('H:i', strtotime($resultIem));?></span></div>
<?php
$rowIndex++;
}
}
else{
echo 0;
}
}
if(isset($_POST['action']) && $_POST['action'] == 'getSelectedGroup'){
$result = $this->Group_model->getGroupById($_POST['group_id']);
if(is_object($result)){
?>
<div class="serviceBookingprofileImage" style="background-image:url('<?php echo SITEURL.'assets/img/'.$result->group_profile_img;?>');"></div>
<div class="serviceBookingprofileName"><?php echo $result->group_name;?></div>
<?php
}
else{
echo 0;
}
}
if(isset($_POST['action']) && $_POST['action'] == 'changeUserStatus' && isset($_POST['user_id']) && isset($_POST['newValue']) && isset($_POST['operator'])){
$data['currentUser'] = $this->User_model->getUserById($_POST['user_id']);
$userArray = array(
'is_enabled' => $_POST['newValue']
);
$this->User_model->updateUser($_POST['user_id'], $userArray);
$this->Log_model->addLog('change_user_status', $data['currentUser']->username.' státusza változott - '.($_POST['newValue']?'aktív':'letiltva').' állapotra', $_POST['operator']);
}
if(isset($_POST['action']) && $_POST['action'] == 'checkUser'){
echo $this->User_model->isUsernameAvailable($_POST['username']);
}
if(isset($_POST['action']) && $_POST['action'] == 'refreshLogMonitor'){
$logInfoArray = $this->Log_model->getAllLoginfo();
$logrow = '';
foreach($logInfoArray as $logInfoItem){
$logDateTime = new datetime($logInfoItem->event_datetime);
$logrow .= date_format($logDateTime,"Y-m-d H:i").'&nbsp; '.$logInfoItem->username.'&nbsp; '.$logInfoItem->event_content.'&#13;';
}
echo $logrow;
}
$this->load->view('pages/ajax', $data);
}
public function booking_process(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
$data['subpage'] = '';
if(isset($_POST['sendFormCarefreeVacation'])){
$bookingArray = array(
'name' => $_POST['name'],
'address' => $_POST['address'],
'email' => $_POST['email'],
'phonenumber' => $_POST['phonenumber'],
'type_of_building' => $_POST['type_of_building'],
'blomstervanning_enebolig' => $_POST['blomstervanning_Enebolig'],
'postinntak_enebolig' => $_POST['Postinntak_Enebolig'],
'number_of_worker' => $_POST['number_of_worker'],
'user_notes' => $_POST['user_notes']
);
$content = '';
$content = 'Kjære Partner,<br /><br />';
$content .= 'Vi har mottatt din forespørsel om tilbud. Her er opplysningene du oppga.<br />';
$content .= '<br />';
$content .= '<table>';
$content .= '<tr><td>Service: </td><td>Sorgløs ferie</td></tr>';
$content .= '<tr><td>Navn: </td><td>'.$bookingArray['name'].'</td></tr>';
$content .= '<tr><td>E-post: </td><td>'.$bookingArray['email'].'</td></tr>';
$content .= '<tr><td>Telefon: </td><td>'.$bookingArray['phonenumber'].'</td></tr>';
$content .= '<tr><td>Adresse: </td><td>'.$bookingArray['address'].'</td></tr>';
$content .= '<tr><td>Bygningstype: </td><td>'.$bookingArray['type_of_building'].'</td></tr>';
$content .= '<tr><td>Enebolig: </td><td>'.($bookingArray['blomstervanning_enebolig']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Postinntak: </td><td>'.($bookingArray['postinntak_enebolig']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Hvor mange ganger skal vi totalt komme: </td><td>'.$bookingArray['number_of_worker'].'</td></tr>';
$content .= '<tr><td>Utfyllende kommentarer: </td><td>'.$bookingArray['user_notes'].'</td></tr>';
$content .= '</table>';
$content .= '<br /> DIN BESTE HJELPER<br />';
$content .= '<br /> Dersom du ønsker å avbestille, kan du gjøre det i en melding på Instagram, Facebook eller til følgende e-post timebestilling@dinbestehjelper.no';
$emailItem = array(
'addressee_email' => $bookingArray['email'],
'addressee_name' => $bookingArray['name'],
'subject' => '[dinbestehjelper] Din timebestilling har kommet',
'content' => $content,
'attachments' => array()
);
$emailArray[] = $emailItem;
$this->User_model->sendEmail($emailArray);
header('Location:'.SITEURL.'quotation-finished/');
}
if(isset($_POST['sendFormPainting'])){
$bookingArray = array(
'name' => $_POST['name'],
'address' => $_POST['address'],
'email' => $_POST['email'],
'phonenumber' => $_POST['phonenumber'],
'type_of_building' => $_POST['type_of_building'],
'year_of_construction' => $_POST['year_of_construction'],
'home_inhabited' => $_POST['home_inhabited'],
'painting_on_plastered_surfaces' => $_POST['painting_on_plastered_surfaces'],
'wall_paint_on_a_plasterboard_surface' => $_POST['wall_paint_on_a_plasterboard_surface'],
'floor_area' => $_POST['floor_area'],
'ceiling_height' => $_POST['ceiling_height'],
'user_notes' => $_POST['user_notes']
);
$content = '';
$content = 'Kjære Partner,<br /><br />';
$content .= 'Vi har mottatt din forespørsel om tilbud. Her er opplysningene du oppga.<br />';
$content .= '<br />';
$content .= '<table>';
$content .= '<tr><td>Service: </td><td>Malerarbeid</td></tr>';
$content .= '<tr><td>Navn: </td><td>'.$bookingArray['name'].'</td></tr>';
$content .= '<tr><td>E-post: </td><td>'.$bookingArray['email'].'</td></tr>';
$content .= '<tr><td>Telefon: </td><td>'.$bookingArray['phonenumber'].'</td></tr>';
$content .= '<tr><td>Adresse: </td><td>'.$bookingArray['address'].'</td></tr>';
$content .= '<tr><td>Bygningstype: </td><td>'.$bookingArray['type_of_building'].'</td></tr>';
$content .= '<tr><td>Byggeår: </td><td>'.($bookingArray['year_of_construction']).'</td></tr>';
$content .= '<tr><td>Er boligen bebodd under byggearbeidene? </td><td>'.($bookingArray['home_inhabited']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Maling på pussede overflater? </td><td>'.($bookingArray['painting_on_plastered_surfaces']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Veggmaling på gipsplateoverflate? </td><td>'.($bookingArray['wall_paint_on_a_plasterboard_surface']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Gulvareal i rommet som skal males: </td><td>'.$bookingArray['floor_area'].' m2</td></tr>';
$content .= '<tr><td>Takhøyde: </td><td>'.$bookingArray['ceiling_height'].' m</td></tr>';
$content .= '<tr><td>Utfyllende kommentarer: </td><td>'.$bookingArray['user_notes'].'</td></tr>';
$content .= '</table>';
$content .= '<br /> DIN BESTE HJELPER<br />';
$content .= '<br /> Dersom du ønsker å avbestille, kan du gjøre det i en melding på Instagram, Facebook eller til følgende e-post timebestilling@dinbestehjelper.no';
$emailItem = array(
'addressee_email' => $bookingArray['email'],
'addressee_name' => $bookingArray['name'],
'subject' => '[dinbestehjelper] Din timebestilling har kommet',
'content' => $content,
'attachments' => array()
);
$emailArray[] = $emailItem;
$this->User_model->sendEmail($emailArray);
header('Location:'.SITEURL.'quotation-finished/');
}
if(isset($_POST['sendFormPolishing'])){
$serviceArray = $this->Service_model->getAllServiceByServiceType();
$bookingArray = array(
'name' => $_POST['name'],
'address' => $_POST['address'],
'email' => $_POST['email'],
'phonenumber' => $_POST['phonenumber'],
'merke' => $_POST['merke'],
'type_of_car' => $_POST['type_of_car'],
'farge' => $_POST['farge'],
'arsmodell' => $_POST['Arsmodell'],
'user_notes' => $_POST['user_notes']
);
$content = '';
$content = 'Kjære Partner,<br /><br />';
$content .= 'Vi har mottatt din forespørsel om tilbud. Her er opplysningene du oppga.<br />';
$content .= '<br />';
$content .= '1. Vi behandler opplysningene du oppga så raskt som mulig.<br />';
$content .= '2. Vi kontakter deg per e-post eller sms, for å avtale tidspunkt.<br />';
$content .= '3. Vi kommer til avtalt tid for å besiktige stedet/oppgaven.<br />';
$content .= '4. Deretter gir vi et tilbud per e-post.<br />';
$content .= '5. Hvis du godtar det, begynner arbeidet så raskt som mulig.<br />';
$content .= '<br />Opplysninger:<br />';
$content .= '<table>';
$content .= '<tr><td>Service: </td><td>Full polering</td></tr>';
$content .= '<tr><td>Navn: </td><td>'.$bookingArray['name'].'</td></tr>';
$content .= '<tr><td>E-post: </td><td>'.$bookingArray['email'].'</td></tr>';
$content .= '<tr><td>Telefon: </td><td>'.$bookingArray['phonenumber'].'</td></tr>';
$content .= '<tr><td>Adresse: </td><td>'.$bookingArray['address'].'</td></tr>';
$content .= '<tr><td>Merke: </td><td>'.$bookingArray['merke'].'</td></tr>';
$content .= '<tr><td>Type of car: </td><td>'.($bookingArray['type_of_car']).'</td></tr>';
$content .= '<tr><td>Farge: </td><td>'.($bookingArray['farge']).'</td></tr>';
$content .= '<tr><td>Arsmodell: </td><td>'.($bookingArray['arsmodell']).'</td></tr>';
$content .= '<tr><td>Utfyllende kommentarer: </td><td>'.$bookingArray['user_notes'].'</td></tr>';
$content .= '</table>';
$content .= '<br /> DIN BESTE HJELPER<br />';
$content .= '<br /> Dersom du ønsker å avbestille, kan du gjøre det i en melding på Instagram, Facebook eller til følgende e-post timebestilling@dinbestehjelper.no';
$emailItem = array(
'addressee_email' => $bookingArray['email'],
'addressee_name' => $bookingArray['name'],
'subject' => '[dinbestehjelper] Din timebestilling har kommet',
'content' => $content,
'attachments' => array()
);
$emailArray[] = $emailItem;
$this->User_model->sendEmail($emailArray);
header('Location:'.SITEURL.'quotation-finished/');
}
if(isset($_POST['sendFormWaterChannel'])){
$formArray = array(
'name' => $_POST['name'],
'address' => $_POST['address'],
'email' => $_POST['email'],
'phonenumber' => $_POST['phonenumber'],
'type_of_building' => $_POST['type_of_building'],
'year_of_construction' => $_POST['year_of_construction'],
'home_inhabited' => $_POST['home_inhabited'],
'demolition_of_old_system' => $_POST['demolition_of_old_system'],
'installation_of_new_system' => $_POST['installation_of_new_system'],
'installation_of_water_in_kitchen' => $_POST['installation_of_water_in_kitchen'],
'installation_of_water_in_the_bathroom' => $_POST['installation_of_water_in_the_bathroom'],
'connection_of_washbasin' => $_POST['connection_of_washbasin'],
'replacement_of_toilet' => $_POST['replacement_of_toilet'],
'installation_of_connection_for_household' => $_POST['installation_of_connection_for_household'],
'connecting_a_dishwasher' => $_POST['connecting_a_dishwasher'],
'connection_of_washing_machine' => $_POST['connection_of_washing_machine'],
'connection_of_dryer' => $_POST['connection_of_dryer'],
'installation_of_a_garden_tap' => $_POST['installation_of_a_garden_tap'],
'installation_of_water_purification' => $_POST['installation_of_water_purification'],
'user_notes' => $_POST['user_notes']
);
$content = '';
$content = 'Kjære Partner,<br /><br />';
$content .= 'Vi har mottatt din forespørsel om tilbud. Her er opplysningene du oppga.<br />';
$content .= '<br />';
$content .= '<table>';
$content .= '<tr><td>Service: </td><td>Rørleggerarbeid</td></tr>';
$content .= '<tr><td>Navn: </td><td>'.$bookingArray['name'].'</td></tr>';
$content .= '<tr><td>E-post: </td><td>'.$bookingArray['email'].'</td></tr>';
$content .= '<tr><td>Telefon: </td><td>'.$bookingArray['phonenumber'].'</td></tr>';
$content .= '<tr><td>Adresse: </td><td>'.$bookingArray['address'].'</td></tr>';
$content .= '<tr><td>Bygningstype: </td><td>'.$bookingArray['type_of_building'].'</td></tr>';
$content .= '<tr><td>Byggeår: </td><td>'.($bookingArray['year_of_construction']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Er boligen bebodd under byggearbeidene?: </td><td>'.($bookingArray['home_inhabited']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Rivning av gammelt system (komplett til vannmåler): </td><td>'.($bookingArray['demolition_of_old_system']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Installasjon av nytt system (fra måler): </td><td>'.($bookingArray['installation_of_new_system']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Installasjon av vann og avløp i kjøkken: </td><td>'.($bookingArray['installation_of_water_in_kitchen']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Installasjon av vann og avløp på bad: </td><td>'.($bookingArray['installation_of_water_in_the_bathroom']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Tilkobling av servant, badekar, dusj: </td><td>'.($bookingArray['connection_of_washbasin']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Utskifting av toalett, håndvask, nyinstallasjon: </td><td>'.($bookingArray['replacement_of_toilet']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Installasjon av tilkobling for husholdningsapparater: </td><td>'.($bookingArray['installation_of_connection_for_household']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Tilkobling av oppvaskmaskin: </td><td>'.($bookingArray['connecting_a_dishwasher']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Tilkobling av vaskemaskin: </td><td>'.($bookingArray['connection_of_washing_machine']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Tilkobling av tørketrommel: </td><td>'.($bookingArray['connection_of_dryer']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Installasjon av hagekran: </td><td>'.($bookingArray['installation_of_a_garden_tap']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Installasjon av vannrenseutstyr: </td><td>'.($bookingArray['installation_of_water_purification']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Utfyllende kommentarer: </td><td>'.$bookingArray['user_notes'].'</td></tr>';
$content .= '</table>';
$content .= '<br /> DIN BESTE HJELPER<br />';
$content .= '<br /> Dersom du ønsker å avbestille, kan du gjøre det i en melding på Instagram, Facebook eller til følgende e-post timebestilling@dinbestehjelper.no';
$emailItem = array(
'addressee_email' => $bookingArray['email'],
'addressee_name' => $bookingArray['name'],
'subject' => '[dinbestehjelper] Din timebestilling har kommet',
'content' => $content,
'attachments' => array()
);
$emailArray[] = $emailItem;
$this->User_model->sendEmail($emailArray);
header('Location:'.SITEURL.'quotation-finished/');
}
if(isset($_POST['sendBooking'])){
//calculate finish time
$serviceStartTime = date("H:i:s", strtotime($_POST['booking_start_time']));
$serviceLengthTime = date("H:i:s", strtotime($_POST['servicelength']));
$secs = strtotime($serviceLengthTime)-strtotime("00:00:00");
$serviceFinishTime = date("H:i:s",strtotime($serviceStartTime)+$secs);
$data['services'] = $this->Service_model->getAllServiceByServiceType();
$data['workgroups'] = $this->Group_model->getAllGroups();
$selectedServiceArray = array();
//find selected services
if(is_array($data['services'])){
foreach($data['services'] as $serviceItem){
if(isset($_POST['service_'.$serviceItem->service_id])){
if($_POST['service_'.$serviceItem->service_id]){
$selectedServiceArray[] = array(
'service_id' => $serviceItem->service_id,
'quantity' => $_POST['quantity_'.$serviceItem->service_id]
);
}
}
}
}
$bookingArray = array(
'guest_name' => $_POST['guest_name'],
'guest_email' => $_POST['guest_email'],
'guest_phone' => $_POST['guest_phone'],
'guest_addresse' => $_POST['guest_addresse'],
'guest_car_reg_number' => $_POST['guest_car_reg_number'],
'guest_car_type' => $_POST['guest_car_type'],
'group_id' => $_POST['group_id'],
'booking_date' => $_POST['booking_date'],
'booking_start_time' => $_POST['booking_start_time'],
'booking_finish_time' => $serviceFinishTime,
'service_ids' => serialize($selectedServiceArray),
'guest_confirmed' => '0',
'total_price' => $_POST['totalPrice'],
'guest_confirm_code' => '1234',
);
$this->Service_model->createBooking($bookingArray);
$group = $this->Group_model->getGroupById($bookingArray['group_id']);
$services = unserialize($bookingArray['service_ids']);
$serviceArray = array();
$emailArray = array();
if(is_array($services)){
foreach($services as $serviceItem){
$selectedService = $this->Service_model->getServiceById($serviceItem['service_id']);
if(is_object($selectedService)){
$tmpService = (array)$selectedService;
$tmpService['quantity'] = $serviceItem['quantity'];
$serviceArray[] = (object)$tmpService;
}
}
}
$content = '';
$content = 'Kjære Bestiller,<br /><br />';
$content .= 'Takk for din bestilling. Her er opplysningene du oppga.<br />';
$content .= '<br />';
$content .= '<table>';
$content .= '<tr><td>Navn: </td><td>'.$bookingArray['guest_name'].'</td></tr>';
$content .= '<tr><td>E-post: </td><td>'.$bookingArray['guest_email'].'</td></tr>';
$content .= '<tr><td>Telefon: </td><td>'.$bookingArray['guest_phone'].'</td></tr>';
$content .= '<tr><td>Adresse: </td><td>'.$bookingArray['guest_addresse'].'</td></tr>';
if($bookingArray['guest_car_reg_number'] != ''){
$content .= '<tr><td>Registreringsnummer: </td><td>'.$bookingArray['guest_car_reg_number'].'</td></tr>';
}
if($bookingArray['guest_car_type'] != ''){
$content .= '<tr><td>Bilmerke: </td><td>'.$bookingArray['guest_car_type'].'</td></tr>';
}
$content .= '<tr><td>Dato: </td><td>'.$bookingArray['booking_date'].'</td></tr>';
$content .= '<tr><td>Tid: </td><td>'.$bookingArray['booking_start_time'].' - '.$bookingArray['booking_finish_time'].'</td></tr>';
$content .= '<tr><td>Tjenester: </td><td><table>';
$totalServicePrice = 0;
foreach($serviceArray as $serviceArrayItem){
$totalServicePrice += $serviceArrayItem->service_price;
$content .= '<tr><td>'.$serviceArrayItem->service_name.'</td><td>('.$serviceArrayItem->quantity.' x '.$serviceArrayItem->service_price.' kr) '.$serviceArrayItem->quantity*$serviceArrayItem->service_price.' kr</td></tr>';
}
$content .= '</table></td>';
$content .= '<tr><td>Totalpris: </td><td><strong>'.$bookingArray['total_price'].' kr</strong></td></tr>';
$content .= '</table>';
$content .= '<br /> DIN BESTE HJELPER<br />';
$content .= '<br /> Dersom du ønsker å avbestille, kan du gjøre det i en melding på Instagram, Facebook eller til følgende e-post timebestilling@dinbestehjelper.no';
$emailItem = array(
'addressee_email' => $bookingArray['guest_email'],
'addressee_name' => $bookingArray['guest_name'],
'subject' => '[dinbestehjelper] Din timebestilling har kommet',
'content' => $content,
'attachments' => array()
);
$emailArray[] = $emailItem;
$this->User_model->sendEmail($emailArray);
header('Location:'.SITEURL.'booking-finished/');
}
$this->load->view('pages/booking-process', $data);
}
public function profile(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Log_model');
$this->load->model('Module_model');
$data['message'] = '';
$data['message_class'] = '';
$data['fullname'] = '';
$data['password'] = '';
$data['profile_img_url'] = '';
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['message'] = '';
$data['message_class'] = '';
$data['pageTitle'] = 'Profil szerkesztése';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
if(isset($_POST["storeProfile"])) {
if($_POST['fullname'] != $data['currentUser']->fullname){
$userArray = array(
'fullname' => $_POST['fullname']
);
$this->User_model->updateUser($data['currentUser']->user_id, $userArray);
$this->Log_model->addLog('profile', 'A felhasználó módosította a teljes nevét: '.$data['currentUser']->fullname.' => '.$_POST['fullname'],$_SESSION['username']);
}
if($_POST['password'] != ''){
$userArray = array(
'password' => hash('sha256', $_POST['password'])
);
$this->User_model->updateUser($data['currentUser']->user_id, $userArray);
$this->Log_model->addLog('profile', 'A felhasználó módosította a jelszavát',$_SESSION['username']);
}
//upload profile image
if($_FILES["profile_img"]["tmp_name"] != ''){
$target_dir = getcwd()."/assets/img/profiles/";
$target_file = $target_dir . str_replace('.','_', str_replace('@','_',$_SESSION['username']));
$imageFileType = strtolower(pathinfo(basename($_FILES["profile_img"]["name"]),PATHINFO_EXTENSION));
if (move_uploaded_file($_FILES["profile_img"]["tmp_name"], $target_file.'.'.$imageFileType)) {
$data['message'] = 'A profilkép sikeresen feltöltve!';
$data['message_class'] = 'successMessage';
$data['profile_img_url'] = 'assets/img/profiles/'.str_replace('.','_', str_replace('@','_',$_SESSION['username'])).'.'.$imageFileType;
$userArray = array(
'profile_img_url' => $data['profile_img_url']
);
$this->User_model->updateUser($data['currentUser']->user_id, $userArray);
$this->Log_model->addLog('profile', 'A felhasználó lecserélte a profilképét ',$_SESSION['username']);
} else {
$data['message'] = 'Hiba a feltöltés közben!';
$data['message_class'] = 'errorMessage';
}
}
$data['message'] = 'A profil sikeresen módosítva!';
$data['message_class'] = 'successMessage';
}
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$this->load->view('pages/profile', $data);
}
else{
header("Location:".SITEURL."login");
}
}
public function log_monitor(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Log_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['message'] = '';
$data['message_class'] = '';
$data['pageTitle'] = 'Rendszermonitor';
$data['logInfoLink'] = '';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$selectedModule = $this->Module_model->getModuleBySlug('log-monitor');
if($this->Module_model->is_module_available($selectedModule->module_id, $data['currentUser']->user_id)){
if(isset($_POST['exportToFile'])){
$logInfoArray = $this->Log_model->getAllLoginfo();
$logrow = '';
$logTxt = fopen(getcwd()."/documents/loginfo.csv", "w") or die("Hiba a fájl mentésekor!");
$row = '"Esemény ideje";'.'"Esemény típusa";'.'"Felhasználónév";"Bejegyzés tartalma";'.PHP_EOL;
$string_encoded = iconv( mb_detect_encoding( $row ), 'ISO-8859-2', $row );
fwrite($logTxt, $string_encoded);
foreach($logInfoArray as $logInfoItem){
$logDateTime = new datetime($logInfoItem->event_datetime);
$row = date_format($logDateTime,"Y-m-d H:i").';"'.$logInfoItem->event_type.'";"'.$logInfoItem->username.'";"'.$logInfoItem->event_content.'";'.PHP_EOL;
$string_encoded = iconv( mb_detect_encoding( $row ), 'ISO-8859-2', $row );
fwrite($logTxt, $string_encoded);
}
fclose($logTxt);
$data['logInfoLink'] = '<a href="'.base_url().'documents/loginfo.csv'.'" target="_blank">A loginfo.csv fájl letöltése</a>';
}
$this->load->view('log-monitor', $data);
}
else{
header("Location:".SITEURL."home");
}
}
else{
header("Location:".SITEURL."login");
}
}
}
+782
View File
@@ -0,0 +1,782 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Pages extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see https://codeigniter.com/userguide3/general/urls.html
*/
public function index(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['services'] = $this->Service_model->getAllServiceByServiceType();
$data['pageTitle'] = '';
$this->load->view('pages/home', $data);
}
public function booking(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
//$data['services'] = $this->Service_model->getAllServiceByServiceType();
$cleaningService = array('1');
$data['cleaningServices'] = $this->Service_model->getAllServiceByGroups($cleaningService);
/*echo '<pre>';
print_r($data['cleaningServices']);
echo '</pre>';*/
$carService = array('2,3,4,5, 6,11');
$data['carServices'] = $this->Service_model->getAllServiceByGroups($carService);
$helphandService = array('7');
$data['helphandServices'] = $this->Service_model->getAllServiceByGroups($helphandService);
$gardenService = array('8');
$data['gardenServices'] = $this->Service_model->getAllServiceByGroups($gardenService);
$houseService = array('9');
$data['houseServices'] = $this->Service_model->getAllServiceByGroups($houseService);
$buildService = array('10');
$data['buildServices'] = $this->Service_model->getAllServiceByGroups($buildService);
$data['serviceGroups'] = $this->Service_model->getServiceGroups();
$data['workgroups'] = $this->Group_model->getAllActiveGroups();
$data['activeWorkgroup'] = $this->Group_model->getAvailableGroup('2024-08-25', '1');
$this->load->view('pages/booking', $data);
}
public function booking_finished(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
$this->load->view('pages/booking-finished', $data);
}
public function quotation_finished(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
$this->load->view('pages/quotation-finished', $data);
}
public function water_channel(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
$data['services'] = $this->Service_model->getAllServiceByServiceType();
$this->load->view('pages/water-channel', $data);
}
public function painting(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
$data['services'] = $this->Service_model->getAllServiceByServiceType();
$this->load->view('pages/painting', $data);
}
public function carefree_vacation(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
$data['services'] = $this->Service_model->getAllServiceByServiceType();
$this->load->view('pages/carefree-vacation', $data);
}
public function polishing(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
$data['services'] = $this->Service_model->getAllServiceByServiceType();
$this->load->view('pages/polishing', $data);
}
public function email_verification(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$this->load->model('Log_model');
$data['pageTitle'] = '';
$this->load->view('pages/email-verification', $data);
}
public function ajax(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$this->load->model('Group_model');
$this->load->model('Log_model');
$data['pageTitle'] = '';
if(isset($_POST['action']) && $_POST['action'] == 'calculate_service_length' && isset($_POST['service_ids'])){
if($_POST['service_ids'] != ''){
$explodedServiceIds = explode(',', $_POST['service_ids']);
$totalLength = '00:00:00';
if(!empty($explodedServiceIds)){
foreach($explodedServiceIds as $explodedServiceIdItem){
$currentService = $this->Service_model->getServiceById($explodedServiceIdItem);
$time = $totalLength;
$time2 = $currentService->service_time;
$secs = strtotime($time2)-strtotime("00:00:00");
$addedTotal = date("H:i:s",strtotime($time)+$secs);
$totalLength = $addedTotal;
}
}
echo $totalLength;
}
}
if(isset($_POST['action']) && $_POST['action'] == 'getAvailableTimeOptions' && isset($_POST['selectedDate'])){
$results = $this->Service_model->getAvailableTimes($_POST['group_id'], $_POST['selectedDate'], $_POST['servicelength']);
$rowIndex = 1;
if(is_array($results)){
foreach($results as $resultIem){
?>
<option value="<?php echo $resultIem;?>"><?php echo date('H:i', strtotime($resultIem));?></option>
<?php
$rowIndex++;
}
}
else{
echo 0;
}
}
if(isset($_POST['action']) && $_POST['action'] == 'getAvailableGroup' && isset($_POST['service_category'])){
if($_POST['service_category'] != 0){
$selectedGroup = $this->Group_model->getAvailableGroup($_POST['booking_date'], $_POST['service_category']);
echo $selectedGroup->group_id;
}
else{
echo 0;
}
}
if(isset($_POST['action']) && $_POST['action'] == 'isTimeAvailable' && isset($_POST['selectedDate'])){
$results = $this->Service_model->getAvailableTimes($_POST['group_id'], $_POST['selectedDate'], $_POST['servicelength']);
$timeIsAvailable = 0;
if(is_array($results)){
foreach($results as $resultIem){
if(date('H:i:s', strtotime($resultIem)) == $_POST['selectedTime']){
$timeIsAvailable = 1;
}
}
echo $timeIsAvailable;
}
else{
echo 0;
}
}
if(isset($_POST['action']) && $_POST['action'] == 'getAvailableTimes' && isset($_POST['selectedDate'])){
$results = $this->Service_model->getAvailableTimes($_POST['group_id'], $_POST['selectedDate'], $_POST['servicelength'].':00');
$rowIndex = 1;
if(!empty($results)){
foreach($results as $resultIem){
?>
<div class="availableBookingTime" id="bookingTime_<?php echo $rowIndex;?>" onclick="setSelectedTime('<?php echo $resultIem;?>', '<?php echo $rowIndex;?>')"><span><?php echo date('H:i', strtotime($resultIem));?></span></div>
<?php
$rowIndex++;
}
}
else{
echo 0;
}
}
if(isset($_POST['action']) && $_POST['action'] == 'getSelectedGroup'){
$result = $this->Group_model->getGroupById($_POST['group_id']);
if(is_object($result)){
?>
<div class="serviceBookingprofileImage" style="background-image:url('<?php echo SITEURL.'assets/img/'.$result->group_profile_img;?>');"></div>
<div class="serviceBookingprofileName"><?php echo $result->group_name;?></div>
<?php
}
else{
echo 0;
}
}
if(isset($_POST['action']) && $_POST['action'] == 'changeUserStatus' && isset($_POST['user_id']) && isset($_POST['newValue']) && isset($_POST['operator'])){
$data['currentUser'] = $this->User_model->getUserById($_POST['user_id']);
$userArray = array(
'is_enabled' => $_POST['newValue']
);
$this->User_model->updateUser($_POST['user_id'], $userArray);
$this->Log_model->addLog('change_user_status', $data['currentUser']->username.' státusza változott - '.($_POST['newValue']?'aktív':'letiltva').' állapotra', $_POST['operator']);
}
if(isset($_POST['action']) && $_POST['action'] == 'checkUser'){
echo $this->User_model->isUsernameAvailable($_POST['username']);
}
if(isset($_POST['action']) && $_POST['action'] == 'refreshLogMonitor'){
$logInfoArray = $this->Log_model->getAllLoginfo();
$logrow = '';
foreach($logInfoArray as $logInfoItem){
$logDateTime = new datetime($logInfoItem->event_datetime);
$logrow .= date_format($logDateTime,"Y-m-d H:i").'&nbsp; '.$logInfoItem->username.'&nbsp; '.$logInfoItem->event_content.'&#13;';
}
echo $logrow;
}
$this->load->view('pages/ajax', $data);
}
public function booking_process(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Service_model');
$data['pageTitle'] = '';
$data['subpage'] = '';
if(isset($_POST['sendFormCarefreeVacation'])){
$bookingArray = array(
'name' => $_POST['name'],
'address' => $_POST['address'],
'email' => $_POST['email'],
'phonenumber' => $_POST['phonenumber'],
'type_of_building' => $_POST['type_of_building'],
'blomstervanning_enebolig' => $_POST['blomstervanning_Enebolig'],
'postinntak_enebolig' => $_POST['Postinntak_Enebolig'],
'number_of_worker' => $_POST['number_of_worker'],
'user_notes' => $_POST['user_notes']
);
$content = '';
$content = 'Kjære Partner,<br /><br />';
$content .= 'Vi har mottatt din forespørsel om tilbud. Her er opplysningene du oppga.<br />';
$content .= '<br />';
$content .= '<table>';
$content .= '<tr><td>Service: </td><td>Sorgløs ferie</td></tr>';
$content .= '<tr><td>Navn: </td><td>'.$bookingArray['name'].'</td></tr>';
$content .= '<tr><td>E-post: </td><td>'.$bookingArray['email'].'</td></tr>';
$content .= '<tr><td>Telefon: </td><td>'.$bookingArray['phonenumber'].'</td></tr>';
$content .= '<tr><td>Adresse: </td><td>'.$bookingArray['address'].'</td></tr>';
$content .= '<tr><td>Bygningstype: </td><td>'.$bookingArray['type_of_building'].'</td></tr>';
$content .= '<tr><td>Enebolig: </td><td>'.($bookingArray['blomstervanning_enebolig']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Postinntak: </td><td>'.($bookingArray['postinntak_enebolig']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Hvor mange ganger skal vi totalt komme: </td><td>'.$bookingArray['number_of_worker'].'</td></tr>';
$content .= '<tr><td>Utfyllende kommentarer: </td><td>'.$bookingArray['user_notes'].'</td></tr>';
$content .= '</table>';
$content .= '<br /> DIN BESTE HJELPER<br />';
$content .= '<br /> Dersom du ønsker å avbestille, kan du gjøre det i en melding på Instagram, Facebook eller til følgende e-post timebestilling@dinbestehjelper.no';
$emailItem = array(
'addressee_email' => $bookingArray['email'],
'addressee_name' => $bookingArray['name'],
'subject' => '[dinbestehjelper] Din timebestilling har kommet',
'content' => $content,
'attachments' => array()
);
$emailArray[] = $emailItem;
$this->User_model->sendEmail($emailArray);
header('Location:'.SITEURL.'quotation-finished/');
}
if(isset($_POST['sendFormPainting'])){
$bookingArray = array(
'name' => $_POST['name'],
'address' => $_POST['address'],
'email' => $_POST['email'],
'phonenumber' => $_POST['phonenumber'],
'type_of_building' => $_POST['type_of_building'],
'year_of_construction' => $_POST['year_of_construction'],
'home_inhabited' => $_POST['home_inhabited'],
'painting_on_plastered_surfaces' => $_POST['painting_on_plastered_surfaces'],
'wall_paint_on_a_plasterboard_surface' => $_POST['wall_paint_on_a_plasterboard_surface'],
'floor_area' => $_POST['floor_area'],
'ceiling_height' => $_POST['ceiling_height'],
'user_notes' => $_POST['user_notes']
);
$content = '';
$content = 'Kjære Partner,<br /><br />';
$content .= 'Vi har mottatt din forespørsel om tilbud. Her er opplysningene du oppga.<br />';
$content .= '<br />';
$content .= '<table>';
$content .= '<tr><td>Service: </td><td>Malerarbeid</td></tr>';
$content .= '<tr><td>Navn: </td><td>'.$bookingArray['name'].'</td></tr>';
$content .= '<tr><td>E-post: </td><td>'.$bookingArray['email'].'</td></tr>';
$content .= '<tr><td>Telefon: </td><td>'.$bookingArray['phonenumber'].'</td></tr>';
$content .= '<tr><td>Adresse: </td><td>'.$bookingArray['address'].'</td></tr>';
$content .= '<tr><td>Bygningstype: </td><td>'.$bookingArray['type_of_building'].'</td></tr>';
$content .= '<tr><td>Byggeår: </td><td>'.($bookingArray['year_of_construction']).'</td></tr>';
$content .= '<tr><td>Er boligen bebodd under byggearbeidene? </td><td>'.($bookingArray['home_inhabited']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Maling på pussede overflater? </td><td>'.($bookingArray['painting_on_plastered_surfaces']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Veggmaling på gipsplateoverflate? </td><td>'.($bookingArray['wall_paint_on_a_plasterboard_surface']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Gulvareal i rommet som skal males: </td><td>'.$bookingArray['floor_area'].' m2</td></tr>';
$content .= '<tr><td>Takhøyde: </td><td>'.$bookingArray['ceiling_height'].' m</td></tr>';
$content .= '<tr><td>Utfyllende kommentarer: </td><td>'.$bookingArray['user_notes'].'</td></tr>';
$content .= '</table>';
$content .= '<br /> DIN BESTE HJELPER<br />';
$content .= '<br /> Dersom du ønsker å avbestille, kan du gjøre det i en melding på Instagram, Facebook eller til følgende e-post timebestilling@dinbestehjelper.no';
$emailItem = array(
'addressee_email' => $bookingArray['email'],
'addressee_name' => $bookingArray['name'],
'subject' => '[dinbestehjelper] Din timebestilling har kommet',
'content' => $content,
'attachments' => array()
);
$emailArray[] = $emailItem;
$this->User_model->sendEmail($emailArray);
header('Location:'.SITEURL.'quotation-finished/');
}
if(isset($_POST['sendFormPolishing'])){
$serviceArray = $this->Service_model->getAllServiceByServiceType();
$bookingArray = array(
'name' => $_POST['name'],
'address' => $_POST['address'],
'email' => $_POST['email'],
'phonenumber' => $_POST['phonenumber'],
'merke' => $_POST['merke'],
'type_of_car' => $_POST['type_of_car'],
'farge' => $_POST['farge'],
'arsmodell' => $_POST['Arsmodell'],
'user_notes' => $_POST['user_notes']
);
$content = '';
$content = 'Kjære Partner,<br /><br />';
$content .= 'Vi har mottatt din forespørsel om tilbud. Her er opplysningene du oppga.<br />';
$content .= '<br />';
$content .= '1. Vi behandler opplysningene du oppga så raskt som mulig.<br />';
$content .= '2. Vi kontakter deg per e-post eller sms, for å avtale tidspunkt.<br />';
$content .= '3. Vi kommer til avtalt tid for å besiktige stedet/oppgaven.<br />';
$content .= '4. Deretter gir vi et tilbud per e-post.<br />';
$content .= '5. Hvis du godtar det, begynner arbeidet så raskt som mulig.<br />';
$content .= '<br />Opplysninger:<br />';
$content .= '<table>';
$content .= '<tr><td>Service: </td><td>Full polering</td></tr>';
$content .= '<tr><td>Navn: </td><td>'.$bookingArray['name'].'</td></tr>';
$content .= '<tr><td>E-post: </td><td>'.$bookingArray['email'].'</td></tr>';
$content .= '<tr><td>Telefon: </td><td>'.$bookingArray['phonenumber'].'</td></tr>';
$content .= '<tr><td>Adresse: </td><td>'.$bookingArray['address'].'</td></tr>';
$content .= '<tr><td>Merke: </td><td>'.$bookingArray['merke'].'</td></tr>';
$content .= '<tr><td>Type of car: </td><td>'.($bookingArray['type_of_car']).'</td></tr>';
$content .= '<tr><td>Farge: </td><td>'.($bookingArray['farge']).'</td></tr>';
$content .= '<tr><td>Arsmodell: </td><td>'.($bookingArray['arsmodell']).'</td></tr>';
$content .= '<tr><td>Utfyllende kommentarer: </td><td>'.$bookingArray['user_notes'].'</td></tr>';
$content .= '</table>';
$content .= '<br /> DIN BESTE HJELPER<br />';
$content .= '<br /> Dersom du ønsker å avbestille, kan du gjøre det i en melding på Instagram, Facebook eller til følgende e-post timebestilling@dinbestehjelper.no';
$emailItem = array(
'addressee_email' => $bookingArray['email'],
'addressee_name' => $bookingArray['name'],
'subject' => '[dinbestehjelper] Din timebestilling har kommet',
'content' => $content,
'attachments' => array()
);
$emailArray[] = $emailItem;
$this->User_model->sendEmail($emailArray);
header('Location:'.SITEURL.'quotation-finished/');
}
if(isset($_POST['sendFormWaterChannel'])){
$formArray = array(
'name' => $_POST['name'],
'address' => $_POST['address'],
'email' => $_POST['email'],
'phonenumber' => $_POST['phonenumber'],
'type_of_building' => $_POST['type_of_building'],
'year_of_construction' => $_POST['year_of_construction'],
'home_inhabited' => $_POST['home_inhabited'],
'demolition_of_old_system' => $_POST['demolition_of_old_system'],
'installation_of_new_system' => $_POST['installation_of_new_system'],
'installation_of_water_in_kitchen' => $_POST['installation_of_water_in_kitchen'],
'installation_of_water_in_the_bathroom' => $_POST['installation_of_water_in_the_bathroom'],
'connection_of_washbasin' => $_POST['connection_of_washbasin'],
'replacement_of_toilet' => $_POST['replacement_of_toilet'],
'installation_of_connection_for_household' => $_POST['installation_of_connection_for_household'],
'connecting_a_dishwasher' => $_POST['connecting_a_dishwasher'],
'connection_of_washing_machine' => $_POST['connection_of_washing_machine'],
'connection_of_dryer' => $_POST['connection_of_dryer'],
'installation_of_a_garden_tap' => $_POST['installation_of_a_garden_tap'],
'installation_of_water_purification' => $_POST['installation_of_water_purification'],
'user_notes' => $_POST['user_notes']
);
$content = '';
$content = 'Kjære Partner,<br /><br />';
$content .= 'Vi har mottatt din forespørsel om tilbud. Her er opplysningene du oppga.<br />';
$content .= '<br />';
$content .= '<table>';
$content .= '<tr><td>Service: </td><td>Rørleggerarbeid</td></tr>';
$content .= '<tr><td>Navn: </td><td>'.$bookingArray['name'].'</td></tr>';
$content .= '<tr><td>E-post: </td><td>'.$bookingArray['email'].'</td></tr>';
$content .= '<tr><td>Telefon: </td><td>'.$bookingArray['phonenumber'].'</td></tr>';
$content .= '<tr><td>Adresse: </td><td>'.$bookingArray['address'].'</td></tr>';
$content .= '<tr><td>Bygningstype: </td><td>'.$bookingArray['type_of_building'].'</td></tr>';
$content .= '<tr><td>Byggeår: </td><td>'.($bookingArray['year_of_construction']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Er boligen bebodd under byggearbeidene?: </td><td>'.($bookingArray['home_inhabited']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Rivning av gammelt system (komplett til vannmåler): </td><td>'.($bookingArray['demolition_of_old_system']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Installasjon av nytt system (fra måler): </td><td>'.($bookingArray['installation_of_new_system']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Installasjon av vann og avløp i kjøkken: </td><td>'.($bookingArray['installation_of_water_in_kitchen']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Installasjon av vann og avløp på bad: </td><td>'.($bookingArray['installation_of_water_in_the_bathroom']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Tilkobling av servant, badekar, dusj: </td><td>'.($bookingArray['connection_of_washbasin']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Utskifting av toalett, håndvask, nyinstallasjon: </td><td>'.($bookingArray['replacement_of_toilet']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Installasjon av tilkobling for husholdningsapparater: </td><td>'.($bookingArray['installation_of_connection_for_household']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Tilkobling av oppvaskmaskin: </td><td>'.($bookingArray['connecting_a_dishwasher']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Tilkobling av vaskemaskin: </td><td>'.($bookingArray['connection_of_washing_machine']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Tilkobling av tørketrommel: </td><td>'.($bookingArray['connection_of_dryer']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Installasjon av hagekran: </td><td>'.($bookingArray['installation_of_a_garden_tap']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Installasjon av vannrenseutstyr: </td><td>'.($bookingArray['installation_of_water_purification']?'Ja':'Nei').'</td></tr>';
$content .= '<tr><td>Utfyllende kommentarer: </td><td>'.$bookingArray['user_notes'].'</td></tr>';
$content .= '</table>';
$content .= '<br /> DIN BESTE HJELPER<br />';
$content .= '<br /> Dersom du ønsker å avbestille, kan du gjøre det i en melding på Instagram, Facebook eller til følgende e-post timebestilling@dinbestehjelper.no';
$emailItem = array(
'addressee_email' => $bookingArray['email'],
'addressee_name' => $bookingArray['name'],
'subject' => '[dinbestehjelper] Din timebestilling har kommet',
'content' => $content,
'attachments' => array()
);
$emailArray[] = $emailItem;
$this->User_model->sendEmail($emailArray);
header('Location:'.SITEURL.'quotation-finished/');
}
if(isset($_POST['sendBooking'])){
//calculate finish time
$serviceStartTime = date("H:i:s", strtotime($_POST['booking_start_time']));
$serviceLengthTime = date("H:i:s", strtotime($_POST['servicelength']));
$secs = strtotime($serviceLengthTime)-strtotime("00:00:00");
$serviceFinishTime = date("H:i:s",strtotime($serviceStartTime)+$secs);
$data['services'] = $this->Service_model->getAllServiceByServiceType();
$data['workgroups'] = $this->Group_model->getAllGroups();
$selectedServiceArray = array();
//find selected services
if(is_array($data['services'])){
foreach($data['services'] as $serviceItem){
if(isset($_POST['service_'.$serviceItem->service_id])){
if($_POST['service_'.$serviceItem->service_id]){
$selectedServiceArray[] = array(
'service_id' => $serviceItem->service_id,
'quantity' => $_POST['quantity_'.$serviceItem->service_id]
);
}
}
}
}
$bookingArray = array(
'guest_name' => $_POST['guest_name'],
'guest_email' => $_POST['guest_email'],
'guest_phone' => $_POST['guest_phone'],
'guest_addresse' => $_POST['guest_addresse'],
'guest_car_reg_number' => $_POST['guest_car_reg_number'],
'guest_car_type' => $_POST['guest_car_type'],
'group_id' => $_POST['group_id'],
'booking_date' => $_POST['booking_date'],
'booking_start_time' => $_POST['booking_start_time'],
'booking_finish_time' => $serviceFinishTime,
'service_ids' => serialize($selectedServiceArray),
'guest_confirmed' => '0',
'total_price' => $_POST['totalPrice'],
'guest_confirm_code' => '1234',
);
$this->Service_model->createBooking($bookingArray);
$group = $this->Group_model->getGroupById($bookingArray['group_id']);
$services = unserialize($bookingArray['service_ids']);
$serviceArray = array();
$emailArray = array();
if(is_array($services)){
foreach($services as $serviceItem){
$selectedService = $this->Service_model->getServiceById($serviceItem['service_id']);
if(is_object($selectedService)){
$tmpService = (array)$selectedService;
$tmpService['quantity'] = $serviceItem['quantity'];
$serviceArray[] = (object)$tmpService;
}
}
}
$content = '';
$content = 'Kjære Bestiller,<br /><br />';
$content .= 'Takk for din bestilling. Her er opplysningene du oppga.<br />';
$content .= '<br />';
$content .= '<table>';
$content .= '<tr><td>Navn: </td><td>'.$bookingArray['guest_name'].'</td></tr>';
$content .= '<tr><td>E-post: </td><td>'.$bookingArray['guest_email'].'</td></tr>';
$content .= '<tr><td>Telefon: </td><td>'.$bookingArray['guest_phone'].'</td></tr>';
$content .= '<tr><td>Adresse: </td><td>'.$bookingArray['guest_addresse'].'</td></tr>';
if($bookingArray['guest_car_reg_number'] != ''){
$content .= '<tr><td>Registreringsnummer: </td><td>'.$bookingArray['guest_car_reg_number'].'</td></tr>';
}
if($bookingArray['guest_car_type'] != ''){
$content .= '<tr><td>Bilmerke: </td><td>'.$bookingArray['guest_car_type'].'</td></tr>';
}
$content .= '<tr><td>Dato: </td><td>'.$bookingArray['booking_date'].'</td></tr>';
$content .= '<tr><td>Tid: </td><td>'.$bookingArray['booking_start_time'].' - '.$bookingArray['booking_finish_time'].'</td></tr>';
$content .= '<tr><td>Tjenester: </td><td><table>';
$totalServicePrice = 0;
foreach($serviceArray as $serviceArrayItem){
$totalServicePrice += $serviceArrayItem->service_price;
$content .= '<tr><td>'.$serviceArrayItem->service_name.'</td><td>('.$serviceArrayItem->quantity.' x '.$serviceArrayItem->service_price.' kr) '.$serviceArrayItem->quantity*$serviceArrayItem->service_price.' kr</td></tr>';
}
$content .= '</table></td>';
$content .= '<tr><td>Totalpris: </td><td><strong>'.$bookingArray['total_price'].' kr</strong></td></tr>';
$content .= '</table>';
$content .= '<br /> DIN BESTE HJELPER<br />';
$content .= '<br /> Dersom du ønsker å avbestille, kan du gjøre det i en melding på Instagram, Facebook eller til følgende e-post timebestilling@dinbestehjelper.no';
$emailItem = array(
'addressee_email' => $bookingArray['guest_email'],
'addressee_name' => $bookingArray['guest_name'],
'subject' => '[dinbestehjelper] Din timebestilling har kommet',
'content' => $content,
'attachments' => array()
);
$emailArray[] = $emailItem;
$this->User_model->sendEmail($emailArray);
header('Location:'.SITEURL.'booking-finished/');
}
$this->load->view('pages/booking-process', $data);
}
public function profile(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Log_model');
$this->load->model('Module_model');
$data['message'] = '';
$data['message_class'] = '';
$data['fullname'] = '';
$data['password'] = '';
$data['profile_img_url'] = '';
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['message'] = '';
$data['message_class'] = '';
$data['pageTitle'] = 'Profil szerkesztése';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
if(isset($_POST["storeProfile"])) {
if($_POST['fullname'] != $data['currentUser']->fullname){
$userArray = array(
'fullname' => $_POST['fullname']
);
$this->User_model->updateUser($data['currentUser']->user_id, $userArray);
$this->Log_model->addLog('profile', 'A felhasználó módosította a teljes nevét: '.$data['currentUser']->fullname.' => '.$_POST['fullname'],$_SESSION['username']);
}
if($_POST['password'] != ''){
$userArray = array(
'password' => hash('sha256', $_POST['password'])
);
$this->User_model->updateUser($data['currentUser']->user_id, $userArray);
$this->Log_model->addLog('profile', 'A felhasználó módosította a jelszavát',$_SESSION['username']);
}
//upload profile image
if($_FILES["profile_img"]["tmp_name"] != ''){
$target_dir = getcwd()."/assets/img/profiles/";
$target_file = $target_dir . str_replace('.','_', str_replace('@','_',$_SESSION['username']));
$imageFileType = strtolower(pathinfo(basename($_FILES["profile_img"]["name"]),PATHINFO_EXTENSION));
if (move_uploaded_file($_FILES["profile_img"]["tmp_name"], $target_file.'.'.$imageFileType)) {
$data['message'] = 'A profilkép sikeresen feltöltve!';
$data['message_class'] = 'successMessage';
$data['profile_img_url'] = 'assets/img/profiles/'.str_replace('.','_', str_replace('@','_',$_SESSION['username'])).'.'.$imageFileType;
$userArray = array(
'profile_img_url' => $data['profile_img_url']
);
$this->User_model->updateUser($data['currentUser']->user_id, $userArray);
$this->Log_model->addLog('profile', 'A felhasználó lecserélte a profilképét ',$_SESSION['username']);
} else {
$data['message'] = 'Hiba a feltöltés közben!';
$data['message_class'] = 'errorMessage';
}
}
$data['message'] = 'A profil sikeresen módosítva!';
$data['message_class'] = 'successMessage';
}
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$this->load->view('pages/profile', $data);
}
else{
header("Location:".SITEURL."login");
}
}
public function log_monitor(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Log_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['message'] = '';
$data['message_class'] = '';
$data['pageTitle'] = 'Rendszermonitor';
$data['logInfoLink'] = '';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$selectedModule = $this->Module_model->getModuleBySlug('log-monitor');
if($this->Module_model->is_module_available($selectedModule->module_id, $data['currentUser']->user_id)){
if(isset($_POST['exportToFile'])){
$logInfoArray = $this->Log_model->getAllLoginfo();
$logrow = '';
$logTxt = fopen(getcwd()."/documents/loginfo.csv", "w") or die("Hiba a fájl mentésekor!");
$row = '"Esemény ideje";'.'"Esemény típusa";'.'"Felhasználónév";"Bejegyzés tartalma";'.PHP_EOL;
$string_encoded = iconv( mb_detect_encoding( $row ), 'ISO-8859-2', $row );
fwrite($logTxt, $string_encoded);
foreach($logInfoArray as $logInfoItem){
$logDateTime = new datetime($logInfoItem->event_datetime);
$row = date_format($logDateTime,"Y-m-d H:i").';"'.$logInfoItem->event_type.'";"'.$logInfoItem->username.'";"'.$logInfoItem->event_content.'";'.PHP_EOL;
$string_encoded = iconv( mb_detect_encoding( $row ), 'ISO-8859-2', $row );
fwrite($logTxt, $string_encoded);
}
fclose($logTxt);
$data['logInfoLink'] = '<a href="'.base_url().'documents/loginfo.csv'.'" target="_blank">A loginfo.csv fájl letöltése</a>';
}
$this->load->view('log-monitor', $data);
}
else{
header("Location:".SITEURL."home");
}
}
else{
header("Location:".SITEURL."login");
}
}
}
+233
View File
@@ -0,0 +1,233 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class UserManagement extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see https://codeigniter.com/user_guide/general/urls.html
*/
public function index(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Log_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['activeModules'] = $this->Module_model->getModulesByPermissionSlug($data['currentUser']->permission_slug);
$data['message'] = '';
$data['message_class'] = '';
$data['pageTitle'] = 'Felhasználó kezelése';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$selectedModule = $this->Module_model->getModuleBySlug('user-management');
if($this->Module_model->user_can_access_this_module($selectedModule->module_slug, $data['currentUser']->user_id) || $data['currentUser']->permission_slug == 'admin'){
//delete user
if(isset($_GET['delete-user'])){
$selectedUser = $this->User_model->getUserById($_GET['delete-user']);
$this->Log_model->addLog('users', $data['currentUser']->username.' törölte a(z) '.$selectedUser->username.' felhasználót', $data['currentUser']->username);
$this->User_model->deleteUser($_GET['delete-user']);
header('Location:'.site_url().'user-management');
}
$data['users'] = $this->User_model->getAllUser();
$this->load->view('pages/user-management',$data);
}
else{
header("Location:".SITEURL."dashboard");
}
}
else{
header("Location:".SITEURL."login");
}
}
public function add_new_user(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Log_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['activeModules'] = $this->Module_model->getModulesByPermissionSlug($data['currentUser']->permission_slug);
$data['message'] = '';
$data['message_class'] = '';
$data['pageTitle'] = 'Felhasználó létrehozása';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$selectedModule = $this->Module_model->getModuleBySlug('user-management');
if($this->Module_model->user_can_access_this_module($selectedModule->module_slug, $data['currentUser']->user_id) || $data['currentUser']->permission_slug == 'admin'){
$data['permissions'] = $this->User_model->getAllUserPermission();
$this->load->view('pages/add-new-user',$data);
}
else{
header("Location:".SITEURL."home");
}
}
else{
header("Location:".SITEURL."login");
}
}
public function modify_user($user_id=''){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Log_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['activeModules'] = $this->Module_model->getModulesByPermissionSlug($data['currentUser']->permission_slug);
$data['message'] = '';
$data['message_class'] = '';
$data['pageTitle'] = 'Felhasználók';
if($this->User_model->is_user_admin($_SESSION['username'])){
$data['activeModules'] = $this->Module_model->getAllModule();
}
else{
$data['activeModules'] = $this->Module_model->getUserModules($data['currentUser']->user_id);
}
$selectedModule = $this->Module_model->getModuleBySlug('user-management');
if($this->Module_model->user_can_access_this_module($selectedModule->module_slug, $data['currentUser']->user_id) || $data['currentUser']->permission_slug == 'admin'){
$data['selectedUser'] = $this->User_model->getUserById($user_id);
$data['permissions'] = $this->User_model->getAllUserPermission();
$this->load->view('pages/modify-user',$data);
}
else{
header("Location:".SITEURL."home");
}
}
else{
header("Location:".SITEURL."login");
}
}
public function user_process(){
$this->load->helper('url');
$this->load->model('User_model');
$this->load->model('Log_model');
$this->load->model('Module_model');
if(isset($_SESSION['username'])){
$data['currentUser'] = $this->User_model->getUserByUsername($_SESSION['username']);
$data['activeModules'] = $this->Module_model->getModulesByPermissionSlug($data['currentUser']->permission_slug);
$data['message'] = '';
$data['message_class'] = '';
$data['pageTitle'] = 'Felhasználók';
$selectedModule = $this->Module_model->getModuleBySlug('user-management');
if($this->Module_model->user_can_access_this_module($selectedModule->module_slug, $data['currentUser']->user_id) || $data['currentUser']->permission_slug == 'admin'){
//update user
if(isset($_POST['updateUser'])){
$userArray = array(
'username' => $_POST['username'],
'fullname' => $_POST['fullname'],
'permission_slug' => $_POST['permission_slug'],
'is_enabled' => $_POST['is_enabled'],
'user_notes' => $_POST['user_notes']
);
if($_POST['password'] != ''){
$userArray['password'] = $_POST['password'];
}
$this->User_model->updateUser($_POST['user_id'], $userArray);
$userArray['permission_slug'] = $this->User_model->getPermissionBySlug($userArray['permission_slug'])->permission_name;
if($_POST['password'] != ''){
$userArray['password'] = '****';
}
$userArray['is_enabled'] = $userArray['is_enabled']?'aktív':'letiltva';
$userArray['user_notes'] = $userArray['user_notes'] != ''?$userArray['user_notes']:'nincs megjegyzés';
$this->Log_model->addLog('users', $data['currentUser']->username.' módosította a(z) '.$_POST['username'].' adatait ('.implode(', ', $userArray).')', $data['currentUser']->username);
}
//add new user
if(isset($_POST['addNewUser'])){
$userArray = array(
'username' => $_POST['username'],
'password' => $_POST['password'],
'fullname' => $_POST['fullname'],
'permission_slug' => $_POST['permission_slug'],
'is_enabled' => $_POST['is_enabled'],
'user_notes' => $_POST['user_notes']
);
$this->User_model->addNewUser($userArray);
$userArray['permission_id'] = $this->User_model->getpermissionBySlug($userArray['permission_slug'])->permission_slug;
$userArray['is_enabled'] = $userArray['is_enabled']?'aktív':'letiltva';
$userArray['user_notes'] = $userArray['user_notes'] != ''?$userArray['user_notes']:'nincs megjegyzés';
$userArray['password'] = '****';
$this->Log_model->addLog('users', $data['currentUser']->username.' létrehoza a(z) '.$_POST['username'].' felhasználót ('.implode(', ', $userArray).')', $data['currentUser']->username);
}
header("Location:".SITEURL."user-management");
//$this->load->view('pages/user-process',$data);
}
else{
header("Location:".SITEURL."home");
}
}
else{
header("Location:".SITEURL."login");
}
}
}
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+228
View File
@@ -0,0 +1,228 @@
<?php
class Group_model extends CI_Model {
function __construct(){
parent::__construct();
}
public function createGroup($groupArray){
$this->load->database();
$query = $this->db->query("INSERT INTO workgroups(
group_name,
group_info,
skills,
group_notes,
is_active
) VALUES(
'".$groupArray['group_name']."',
'".$groupArray['group_info']."',
'".$groupArray['skills']."',
'".$groupArray['group_notes']."',
'".$groupArray['is_active']."'
);");
}
public function getAllGroups(){
$this->load->database();
$this->load->model('Group_model');
$this->load->model('Service_model');
$query = $this->db->query('SELECT * FROM workgroups ORDER BY group_name DESC;');
if($query->num_rows() > 0){
$resultArray = array();
foreach($query->result() as $resultItem){
$resultItemTmp = (array)$resultItem;
if($resultItem->skills != ''){
$serviceArray = array();
$serviceIds = unserialize($resultItem->skills);
foreach($serviceIds as $serviceItem){
$serviceArray[] = $this->Service_model->getServiceById($serviceItem);
}
$resultItemTmp['skillList'] = $serviceArray;
}
$resultArray[] = (object)$resultItemTmp;
}
return $resultArray;
}
else{
return 0;
}
}
public function getAllActiveGroups(){
$this->load->database();
$this->load->model('Group_model');
$this->load->model('Service_model');
$query = $this->db->query('SELECT * FROM workgroups WHERE is_active = "1" && is_deleted != "1" ORDER BY group_id ASC;');
if($query->num_rows() > 0){
$resultArray = array();
foreach($query->result() as $resultItem){
$resultItemTmp = (array)$resultItem;
if($resultItem->skills != ''){
$serviceArray = array();
$serviceIds = unserialize($resultItem->skills);
foreach($serviceIds as $serviceItem){
$serviceArray[] = $this->Service_model->getServiceById($serviceItem);
}
$resultItemTmp['skillList'] = $serviceArray;
}
$resultArray[] = (object)$resultItemTmp;
}
return $resultArray;
}
else{
return 0;
}
}
public function getGroupById($group_id){
$this->load->database();
$query = $this->db->query('SELECT * FROM workgroups WHERE group_id = "'.$group_id.'" LIMIT 1;');
if($query->num_rows() == 1){
return $query->result()[0];
}
else{
return 0;
}
}
public function updateGroup($group_id, $groupArray){
$this->load->database();
foreach($groupArray as $propertyKey => $propertyValue){
$query = $this->db->query("UPDATE workgroups SET ".$propertyKey." = '".$propertyValue."' WHERE group_id = '".$group_id."';");
}
}
public function availableGroupsByServiceId($serviceCategory){
$this->load->database();
$this->load->model('Group_model');
$this->load->model('Service_model');
$groupArray = array();
$activeGroups = $this->Group_model->getAllActiveGroups();
$selectedServiceCategory = 0;
if(is_array($activeGroups)){
foreach($activeGroups as $activeGroupItem){
$serviceIds = unserialize($activeGroupItem->skills);
foreach($serviceIds as $serviceIdItem){
$selectedService = $this->Service_model->getServiceById($serviceIdItem);
$selectedServiceCategory = $selectedService->service_group;
if($selectedServiceCategory == $serviceCategory){
$groupArray[] = $activeGroupItem->group_id;
}
}
}
}
return $groupArray;
}
public function getAvailableGroup($bookingDate, $serviceCategory){
$this->load->database();
$this->load->model('Group_model');
$activeServiceGroupArray = $this->Group_model->availableGroupsByServiceId($serviceCategory);
$activeServiceGroupString = '';
if(!empty($activeServiceGroupArray)){
$arrayIndex = 1;
$collectedServiceGroupArrayTmp = array();
foreach($activeServiceGroupArray as $activeServiceGroupArrayItem){
if($arrayIndex != sizeof($activeServiceGroupArray)){
if(!in_array($activeServiceGroupArrayItem, $collectedServiceGroupArrayTmp)){
$collectedServiceGroupArrayTmp[] = $activeServiceGroupArrayItem;
}
}
else{
if(!in_array($activeServiceGroupArrayItem, $collectedServiceGroupArrayTmp)){
$collectedServiceGroupArrayTmp[] = $activeServiceGroupArrayItem;
}
}
$arrayIndex++;
}
}
$activeServiceGroupString .= implode(', ', $collectedServiceGroupArrayTmp);
$query = $this->db->query('
SELECT * FROM
(SELECT
results.group_id,
SEC_TO_TIME( SUM( TIME_TO_SEC( TIME(results.difference) ) ) ) AS diff FROM
(SELECT
booking_id,
guest_name,
guest_email,
guest_phone,
bookings.group_id,
booking_date,
booking_start_time,
booking_finish_time,
service_ids,
guest_confirmed,
guest_confirm_code,
group_name,
group_info,
group_profile_img,
skills,
group_notes,
is_active,
is_deleted,
TIMEDIFF(booking_finish_time, booking_start_time) AS difference
FROM bookings JOIN workgroups ON bookings.group_id = workgroups.group_id
WHERE is_active = 1 AND is_deleted = 0
AND booking_date = "'.$bookingDate.'"
AND bookings.group_id IN ('.$activeServiceGroupString.')
) as results
GROUP BY results.group_id
ORDER BY SEC_TO_TIME( SUM( TIME_TO_SEC( TIME(results.difference) ) ) ) DESC
) AS groupedResults
JOIN workgroups ON groupedResults.group_id = workgroups.group_id
;');
if($query->num_rows() > 0){
return $query->result()[0];
}
else{
$activeGroups = $this->Group_model->getAllActiveGroups();
$firstGroup = $activeGroups[0];
return $firstGroup;
}
return $isServiceActive;
}
}
?>
+24
View File
@@ -0,0 +1,24 @@
<?php
class Log_model extends CI_Model {
function __construct(){
parent::__construct();
}
public function addLog($eventType, $eventContent, $username=""){
$this->load->database();
$query = $this->db->query("INSERT INTO system_log(event_type, event_content, username) VALUES('".$eventType."','".$eventContent."','".$username."');");
}
public function getAllLoginfo(){
$this->load->database();
$query = $this->db->query('SELECT * FROM system_log ORDER BY event_datetime DESC;');
return $query->result();
}
}
?>
+252
View File
@@ -0,0 +1,252 @@
<?php
class Module_model extends CI_Model {
function __construct(){
parent::__construct();
}
public function getAllModule(){
$this->load->database();
$query = $this->db->query('SELECT * FROM modules ORDER BY module_name ASC');
return $query->result();
}
public function getModuleById($module_id){
$this->load->database();
$query = $this->db->query('SELECT * FROM modules WHERE module_id = "'.$module_id.'" LIMIT 1;');
return $query->result()[0];
}
public function getModuleBySlug($module_slug){
$this->load->database();
$query = $this->db->query('SELECT * FROM modules WHERE module_slug = "'.$module_slug.'" LIMIT 1;');
return $query->result()[0];
}
public function getUserModules($userId){
$this->load->database();
$this->load->model('User_model');
$currentUser = $this->User_model->getUserById($userId);
$query = $this->db->query('SELECT * FROM modules');
$all_module = $query->result();
$activeModules = array();
$activeModuleIds = array();
foreach($all_module as $moduleItem){
//check groupmodules
$moduleGroupIds = unserialize($moduleItem->permission_group_ids);
$moduleUserIds = unserialize($moduleItem->permission_ids);
if(!empty($moduleItem->permission_ids)){
}
//check group ids
if(is_array($moduleGroupIds)){
if(in_array($currentUser->permission_id, $moduleGroupIds)){
if(!in_array($moduleItem->module_id, $activeModuleIds)){
$activeModules[] = $moduleItem;
$activeModuleIds[] = $moduleItem->module_id;
}
}
}
//check user_ids
if(is_array($moduleUserIds)){
if(in_array($currentUser->user_id, $moduleUserIds)){
if(!in_array($moduleItem->module_id, $activeModuleIds)){
$activeModules[] = $moduleItem;
$activeModuleIds[] = $moduleItem->module_id;
}
}
}
}
return $activeModules;
}
public function is_module_available($module_id, $userId){
$this->load->database();
$this->load->model('User_model');
$currentModule = $this->getModuleById($module_id);
$currentUser = $this->User_model->getUserById($userId);
$moduleGroupIds = unserialize($currentModule->permission_group_ids);
$moduleUserIds = unserialize($currentModule->permission_ids);
$moduleIsOk = 0;
//if($currentUser->permission_slug == 'admin' && $module_id != '5'){
if($currentUser->permission_slug == 'admin'){
$moduleIsOk = 1;
}
//check groupmodules
if(is_array($moduleGroupIds)){
if(in_array($currentUser->permission_id, $moduleGroupIds)){
$moduleIsOk = 1;
}
}
//check user_ids
if(is_array($moduleUserIds)){
if(in_array($currentUser->user_id, $moduleUserIds)){
$moduleIsOk = 1;
}
}
if($moduleIsOk){
return 1;
}
else{
return 0;
}
}
public function is_userId_available_in_module($module_id, $userId){
$this->load->database();
$this->load->model('User_model');
$currentModule = $this->getModuleById($module_id);
$userIds = unserialize($currentModule->permission_ids);
if(is_array($userIds)){
if(in_array($userId, $userIds)){
return 1;
}
}
}
public function is_groupId_available_in_module($module_id, $groupId){
$this->load->database();
$this->load->model('User_model');
$currentModule = $this->getModuleById($module_id);
$moduleGroupIds = unserialize($currentModule->permission_group_ids);
if(is_array($moduleGroupIds)){
if(in_array($groupId, $moduleGroupIds)){
return 1;
}
}
}
public function updateModule($fieldName, $module_id, $moduleUserArray){
$this->load->database();
if(!empty($moduleUserArray)){
$query = $this->db->query("UPDATE modules SET ".$fieldName." ='".serialize($moduleUserArray)."' WHERE module_id = '".$module_id."';");
}
else{
$query = $this->db->query("UPDATE modules SET ".$fieldName." ='' WHERE module_id = '".$module_id."';");
}
}
public function getModulesByPermissionSlug($permissionSlug){
$this->load->database();
$this->load->model('Module_model');
$selectedPermission = $this->Module_model->getPermissionBySlug($permissionSlug);
$query = $this->db->query('SELECT * FROM modules;');
$results = $query->result();
$resultArray = array();
foreach($results as $resultItem){
$permissionIdsArray = explode(',', $resultItem->permission_ids);
if(in_array($selectedPermission->permission_id, $permissionIdsArray)){
$resultArray[] = $resultItem;
}
}
return $resultArray;
}
public function getPermissionBySlug($permissionSlug){
$this->load->database();
$query = $this->db->query('SELECT * FROM permissions WHERE permission_slug = "'.$permissionSlug.'";');
if($query->num_rows() == 1){
return $query->result()[0];
}
else{
return 0;
}
}
public function user_can_access_this_module($moduleSlug, $userId){
$this->load->database();
$this->load->model('User_model');
$selectedUser = $this->User_model->getUserById($userId);
$query = $this->db->query('SELECT * FROM modules WHERE module_slug = "'.$moduleSlug.'" LIMIT 1;');
if($query->num_rows() == 1){
$result = $query->result()[0];
$permissionArray = explode(',', $result->permission_ids);
if(in_array($selectedUser->permission_id, $permissionArray)){
return 1;
}
else{
return 0;
}
}
else{
return 0;
}
}
}
?>
+660
View File
@@ -0,0 +1,660 @@
<?php
class Service_model extends CI_Model {
function __construct(){
parent::__construct();
}
public function createService($serviceArray){
$this->load->database();
$query = $this->db->query('INSERT INTO services (
main_category,
main_category_description,
service_category,
service_name,
service_description,
service_price,
service_time,
is_enabled
) VALUES(
"'.$serviceArray['main_category'].'",
"'.$serviceArray['main_category_description'].'",
"'.$serviceArray['service_category'].'",
"'.$serviceArray['service_name'].'",
"'.$serviceArray['service_description'].'",
"'.$serviceArray['service_price'].'",
"'.$serviceArray['service_time'].'",
"'.$serviceArray['is_enabled'].'"
);');
}
public function updateService($service_id, $serviceArray){
$this->load->database();
foreach($serviceArray as $propertyKey => $propertyValue){
$query = $this->db->query('UPDATE services SET '.$propertyKey.' = "'.$propertyValue.'" WHERE service_id = "'.$service_id.'";');
}
}
public function updateBooking($booking_id, $bookingArray){
$this->load->database();
foreach($bookingArray as $propertyKey => $propertyValue){
$query = $this->db->query("UPDATE bookings SET ".$propertyKey." = '".$propertyValue."' WHERE booking_id = '".$booking_id."';");
}
}
public function getAllServiceByServiceType(){
$this->load->database();
$this->load->model('Group_model');
$query = $this->db->query('SELECT * FROM services WHERE is_public = "1" AND is_deleted != "1" ORDER BY list_order_nr ASC;');
$serviceArray = array();
if($query->num_rows() > 0){
foreach($query->result() as $resultItem){
$isServiceAvailable = $this->Service_model->iServiceAvailable($resultItem->service_id);
$resultItemTmp = array(
'service_id' => $resultItem->service_id,
'main_category' => $resultItem->main_category,
'main_category_description' => $resultItem->main_category_description,
'service_category' => $resultItem->service_category,
'service_name' => $resultItem->service_name,
'service_description' => $resultItem->service_description,
'service_group' => $resultItem->service_group,
'service_price' => $resultItem->service_price,
'service_time' => $resultItem->service_time,
'is_enabled' => $resultItem->is_enabled,
'is_public' => $resultItem->is_public,
'is_service_available' => $isServiceAvailable,
'target_url' => $resultItem->target_url
);
$serviceArray[] = (object)$resultItemTmp;
}
}
return $serviceArray;
}
public function getServiceById($service_id){
$this->load->database();
$this->load->model('Group_model');
$this->load->model('Service_model');
$query = $this->db->query('SELECT * FROM services WHERE service_id = "'.$service_id.'" LIMIT 1;');
if($query->num_rows() > 0){
$resultItem = $query->result()[0];
return $resultItem;
}
else{
return 0;
}
}
public function getAllServices(){
$this->load->database();
$query = $this->db->query('SELECT * FROM services WHERE is_deleted != "1" ORDER BY service_name ASC;');
if($query->num_rows() > 0){
foreach($query->result() as $resultItem){
$isServiceAvailable = $this->Service_model->iServiceAvailable($resultItem->service_id);
$resultItemTmp = array(
'service_id' => $resultItem->service_id,
'main_category' => $resultItem->main_category,
'main_category_description' => $resultItem->main_category_description,
'service_category' => $resultItem->service_category,
'service_name' => $resultItem->service_name,
'service_description' => $resultItem->service_description,
'service_price' => $resultItem->service_price,
'service_time' => $resultItem->service_time,
'is_enabled' => $resultItem->is_enabled,
'is_public' => $resultItem->is_public,
'is_service_available' => $isServiceAvailable,
'target_url' => $resultItem->target_url
);
$serviceArray[] = (object)$resultItemTmp;
}
return $serviceArray;
}
else{
return 0;
}
}
public function getAvailableServices(){
$this->load->database();
$query = $this->db->query('SELECT * FROM services WHERE is_enabled = "1" AND is_deleted != "1" ORDER BY service_name ASC;');
if($query->num_rows() > 0){
$serviceArray = array();
foreach($query->result() as $resultItem){
$serviceTmp = array(
'service_name' => $resultItem->service_name,
'service_id' => $resultItem->service_id,
'service_group' => $resultItem->service_group
);
$serviceArray[] = (object)$serviceTmp;
}
return $serviceArray;
}
}
public function getAllServiceByGroups($serviceGroupArray){
$this->load->database();
$serviceGroupArrayString = implode(',', $serviceGroupArray);
$query = $this->db->query('SELECT * FROM services
WHERE
is_deleted != "1" AND
is_public = "1" AND
service_group IN ('.$serviceGroupArrayString.')
ORDER BY service_id ASC;');
$serviceArray = array();
if($query->num_rows() > 0){
foreach($query->result() as $resultItem){
$isServiceAvailable = $this->Service_model->iServiceAvailable($resultItem->service_id);
$resultItemTmp = array(
'service_id' => $resultItem->service_id,
'main_category' => $resultItem->main_category,
'main_category_description' => $resultItem->main_category_description,
'service_category' => $resultItem->service_category,
'service_name' => $resultItem->service_name,
'service_description' => $resultItem->service_description,
'service_group' => $resultItem->service_group,
'is_extra' => $resultItem->is_extra,
'is_car' => $resultItem->is_car,
'service_price' => $resultItem->service_price,
'service_time' => $resultItem->service_time,
'is_enabled' => $resultItem->is_enabled,
'is_public' => $resultItem->is_public,
'is_service_available' => $isServiceAvailable,
'target_url' => $resultItem->target_url
);
$serviceArray[] = (object)$resultItemTmp;
}
}
return $serviceArray;
}
public function deleteBooking($booking_id){
$this->load->database();
$query = $this->db->query('DELETE FROM bookings WHERE booking_id = "'.$booking_id.'";');
}
public function getAllBookings(){
$this->load->database();
$this->load->model('Service_model');
$query = $this->db->query('SELECT * FROM bookings ORDER BY booking_date DESC, booking_start_time ASC;');
if($query->num_rows() > 0){
$resultsArray = array();
foreach($query->result() as $resultItem){
$resultTmp = (array)$resultItem;
$groupObjectsArray = array();
if($resultTmp['group_ids'] != ''){
$selectedGroups = explode(',', $resultTmp['group_ids']);
if(is_array($selectedGroups)){
foreach($selectedGroups as $selectedGroupItem){
$selectedGroup = $this->Group_model->getGroupById($selectedGroupItem);
$groupObjectsArray[] = $selectedGroup;
}
}
}
$resultTmp['workgroups'] = $groupObjectsArray;
if($resultTmp['service_ids'] != ''){
$servicesArray = unserialize($resultTmp['service_ids']);
if(is_array($servicesArray)){
$services = array();
foreach($servicesArray as $servicesArrayItem){
$selectedService = $this->Service_model->getServiceById($servicesArrayItem);
$services[] = (object)array(
'service_name' => $selectedService->service_name,
'service_price' => $selectedService->service_price,
'service_time' => $selectedService->service_time
);
}
$resultTmp['services'] = $services;
}
else{
$resultTmp['services'] = array();
}
}
else{
$resultTmp['services'] = array();
}
$resultsArray[] = (object)$resultTmp;
}
return $resultsArray;
}
else{
return 0;
}
}
public function getActualBookings(){
$this->load->database();
$this->load->model('Service_model');
$query = $this->db->query('SELECT * FROM bookings JOIN workgroups ON bookings.group_id = workgroups.group_id WHERE booking_date >= CURDATE() ORDER BY booking_date DESC, booking_start_time ASC;');
if($query->num_rows() > 0){
$resultsArray = array();
foreach($query->result() as $resultItem){
$resultTmp = (array)$resultItem;
if($resultTmp['service_ids'] != ''){
$servicesArray = unserialize($resultTmp['service_ids']);
if(is_array($servicesArray)){
$services = array();
foreach($servicesArray as $servicesArrayItem){
$selectedService = $this->Service_model->getServiceById($servicesArrayItem['service_id']);
$services[] = (object)array(
'service_name' => $selectedService->service_name,
'service_price' => $selectedService->service_price,
'service_time' => $selectedService->service_time,
'quantity' => $servicesArrayItem['quantity']
);
}
$resultTmp['services'] = $services;
}
else{
$resultTmp['services'] = array();
}
}
else{
$resultTmp['services'] = array();
}
$resultsArray[] = (object)$resultTmp;
}
return $resultsArray;
}
else{
return 0;
}
}
public function getBookingById($booking_id){
$this->load->database();
$this->load->model('Service_model');
$query = $this->db->query('SELECT * FROM bookings WHERE booking_id = "'.$booking_id.'" LIMIT 1;');
if($query->num_rows() > 0){
$resultTmp = (array)$resultItem;
if($resultTmp['service_ids'] != ''){
$servicesArray = unserialize($resultTmp['service_ids']);
if(is_array($servicesArray)){
$services = array();
foreach($servicesArray as $servicesArrayItem){
$selectedService = $this->Service_model->getServiceById($servicesArrayItem['service_id']);
$services[] = (object)array(
'service_name' => $selectedService->service_name,
'service_price' => $selectedService->service_price,
'service_time' => $selectedService->service_time,
'quantity' => $servicesArrayItem['quantity']
);
}
$resultTmp['services'] = $services;
}
else{
$resultTmp['services'] = array();
}
}
else{
$resultTmp['services'] = array();
}
$resultsArray = (object)$resultTmp;
return $resultsArray;
}
else{
return 0;
}
}
public function getWorkgroupById($group_id){
$this->load->database();
$query = $this->db->query('SELECT * FROM workgroups WHERE group_id = "'.$group_id.'" LIMIT 1;');
if($query->num_rows() > 0){
return $query->result()[0];
}
else{
return 0;
}
}
public function getAvailableTimes($group_id, $selectedDate, $servicelength){
$this->load->database();
$serviceLengthDateTime = new DateTime($selectedDate.' '.$servicelength);
$service_length_time = strtotime($servicelength);
$availableTimeArray = array();
$selectedDayName = date('D', strtotime($selectedDate));
$dayStartTime = new DateTime($selectedDate.' 09:00');
$finishTime = new DateTime($selectedDate.' 18:01');
if($selectedDayName == 'Sun'){
return array();
}
elseif($selectedDayName == 'Sat'){
$finishTime = new DateTime($selectedDate.' 16:01');
}
else{
//finish time - selected service length
$finishTime = new DateTime($selectedDate.' 18:01');
}
$today=date_create(date('Y-m-d'));
$selectedDay=date_create($selectedDate);
$dateDiff=date_diff($today,$selectedDay);
$tmpDateStart = date_create(date('2024-02-29'));
$tmpDateEnd = date_create(date('2024-03-07'));
$datelength = new DateTime($servicelength);
$diff = $datelength->diff($finishTime);
//max time for start
$maxTime = $diff->h.':'.$diff->i.':00';
$hours = (intval($diff->h)-9)*4+1;
$mins = floor(intval($diff->i) / 15);
$loopSteps = intval($hours) + intval($mins);
for($periodIndex = 1; $periodIndex <= $loopSteps; $periodIndex++){
$minutes_to_add_start = $periodIndex*15;
$minutes_to_add_end = ($periodIndex+1)*15;
$startTime = new DateTime($selectedDate.' 08:45');
$endTime = new DateTime($selectedDate.' 08:45');
$startTime->add(new DateInterval('PT' . $minutes_to_add_start . 'M'));
$endTime->add(new DateInterval('PT' . $minutes_to_add_end . 'M'));
$maxTimeObject = new DateTime($maxTime);
$tz = new DateTimeZone('Europe/Budapest');
$addStartTimeAndLength = new DateTime($selectedDate.' '.$startTime->format('H:i:00'), $tz);
$addStartTimeAndLength->add(new DateInterval('PT' . intval($serviceLengthDateTime->format('H')) . 'H'));
$addStartTimeAndLength->add(new DateInterval('PT' . intval($serviceLengthDateTime->format('i')) . 'M'));
$currentStartTime = $startTime->format('H:i:00');
$currentEndTime = $endTime->format('H:i:00');
/*
echo '<< ';
print_r($serviceLengthDateTime->format('H:i:00'));
echo ' / ';
print_r($currentStartTime);
echo ' / ';
print_r($addStartTimeAndLength->format('H:i:00'));
echo ' >>';
*/
$query = $this->db->query('SELECT * FROM bookings WHERE booking_date = "'.$selectedDate.'" AND group_id = "'.$group_id.'" AND (
(TIME(booking_start_time) >= CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) <= CAST("'.$currentEndTime.'" AS TIME)) OR
(TIME(booking_start_time) <= CAST("'.$addStartTimeAndLength->format('H:i:00').'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME)) OR
(TIME(booking_start_time) >= CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_start_time) <= CAST("'.$currentEndTime.'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME)) OR
(TIME(booking_start_time) <= CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME)
AND TIME(booking_start_time) <= CAST("'.$currentStartTime.'" AS TIME)) OR
(TIME(booking_start_time) <= CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) <= CAST("'.$currentEndTime.'" AS TIME)
AND TIME(booking_finish_time) >= CAST("'.$currentStartTime.'" AS TIME)) OR
(TIME(booking_start_time) <= CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME))
);
');
/*
$query = $this->db->query('SELECT * FROM bookings WHERE booking_date = "'.$selectedDate.'" AND group_id = "'.$group_id.'" AND (
(TIME(booking_start_time) > CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) < CAST("'.$currentEndTime.'" AS TIME)) OR
(TIME(booking_start_time) < CAST("'.$addStartTimeAndLength->format('H:i:00').'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME)) OR
(TIME(booking_start_time) > CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_start_time) < CAST("'.$currentEndTime.'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME)) OR
(TIME(booking_start_time) < CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME)
AND TIME(booking_start_time) < CAST("'.$currentStartTime.'" AS TIME)) OR
(TIME(booking_start_time) < CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) < CAST("'.$currentEndTime.'" AS TIME)
AND TIME(booking_finish_time) > CAST("'.$currentStartTime.'" AS TIME)) OR
(TIME(booking_start_time) < CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME))
);
');
*/
$now = strtotime(date('H:i:s')) + 60*60;
$timezone = 'Europe/Budapest';
$todayStartTime = strtotime($currentStartTime.' '.$timezone);
$minDiff = ($todayStartTime - $now) / 60;
if($dateDiff->format("%R%a") == 0 && $minDiff > 0){
if($query->num_rows() == 0){
$availableTimeArray[] = $currentStartTime;
}
}
elseif($dateDiff->format("%R%a") >= 0 && ($selectedDay < $tmpDateStart || $selectedDay > $tmpDateEnd) && $dateDiff->format("%R%a") != 0){
if($query->num_rows() == 0){
$availableTimeArray[] = $currentStartTime;
}
}
}
return $availableTimeArray;
}
public function createBooking($bookingArray){
$this->load->database();
$query = $this->db->query("INSERT INTO bookings (
guest_name,
guest_email,
guest_phone,
guest_addresse,
guest_car_reg_number,
guest_car_type,
group_id,
booking_date,
booking_start_time,
booking_finish_time,
service_ids,
guest_confirmed,
guest_confirm_code
) VALUES(
'".$bookingArray['guest_name']."',
'".$bookingArray['guest_email']."',
'".$bookingArray['guest_phone']."',
'".$bookingArray['guest_addresse']."',
'".$bookingArray['guest_car_reg_number']."',
'".$bookingArray['guest_car_type']."',
'".$bookingArray['group_id']."',
'".$bookingArray['booking_date']."',
'".$bookingArray['booking_start_time']."',
'".$bookingArray['booking_finish_time']."',
'".$bookingArray['service_ids']."',
'".$bookingArray['guest_confirmed']."',
'".$bookingArray['guest_confirm_code']."'
);");
}
public function iServiceAvailable($service_id){
$this->load->database();
$this->load->model('Group_model');
$isServiceActive = 0;
$selectedService = $this->Service_model->getServiceById($service_id);
$activeGroups = $this->Group_model->getAllActiveGroups();
if(is_array($activeGroups)){
foreach($activeGroups as $activeGroupItem){
$serviceIds = unserialize($activeGroupItem->skills);
if(in_array($service_id, $serviceIds) && $selectedService->is_enabled){
$isServiceActive = 1;
}
}
}
return $isServiceActive;
}
public function getServiceGroups(){
$this->load->database();
$this->load->model('Group_model');
$this->load->model('Service_model');
$services = $this->Service_model->getAvailableServices();
$serviceArray = array();
if(is_array($services)){
foreach($services as $serviceItem){
if(!in_array($serviceItem->service_group, $serviceArray)){
$serviceArray[] = $serviceItem->service_group;
}
}
}
return $serviceArray;
}
}
?>
@@ -0,0 +1,668 @@
<?php
class Service_model extends CI_Model {
function __construct(){
parent::__construct();
}
public function createService($serviceArray){
$this->load->database();
$query = $this->db->query('INSERT INTO services (
main_category,
main_category_description,
service_category,
service_name,
service_description,
service_price,
service_time,
is_enabled
) VALUES(
"'.$serviceArray['main_category'].'",
"'.$serviceArray['main_category_description'].'",
"'.$serviceArray['service_category'].'",
"'.$serviceArray['service_name'].'",
"'.$serviceArray['service_description'].'",
"'.$serviceArray['service_price'].'",
"'.$serviceArray['service_time'].'",
"'.$serviceArray['is_enabled'].'"
);');
}
public function updateService($service_id, $serviceArray){
$this->load->database();
foreach($serviceArray as $propertyKey => $propertyValue){
$query = $this->db->query('UPDATE services SET '.$propertyKey.' = "'.$propertyValue.'" WHERE service_id = "'.$service_id.'";');
}
}
public function updateBooking($booking_id, $bookingArray){
$this->load->database();
foreach($bookingArray as $propertyKey => $propertyValue){
$query = $this->db->query("UPDATE bookings SET ".$propertyKey." = '".$propertyValue."' WHERE booking_id = '".$booking_id."';");
}
}
public function getAllServiceByServiceType(){
$this->load->database();
$this->load->model('Group_model');
$query = $this->db->query('SELECT * FROM services WHERE is_public = "1" AND is_deleted != "1" ORDER BY list_order_nr ASC;');
$serviceArray = array();
if($query->num_rows() > 0){
foreach($query->result() as $resultItem){
$isServiceAvailable = $this->Service_model->iServiceAvailable($resultItem->service_id);
$resultItemTmp = array(
'service_id' => $resultItem->service_id,
'main_category' => $resultItem->main_category,
'main_category_description' => $resultItem->main_category_description,
'service_category' => $resultItem->service_category,
'service_name' => $resultItem->service_name,
'service_description' => $resultItem->service_description,
'service_group' => $resultItem->service_group,
'service_price' => $resultItem->service_price,
'service_time' => $resultItem->service_time,
'is_enabled' => $resultItem->is_enabled,
'is_public' => $resultItem->is_public,
'is_service_available' => $isServiceAvailable,
'target_url' => $resultItem->target_url
);
$serviceArray[] = (object)$resultItemTmp;
}
}
return $serviceArray;
}
public function getServiceById($service_id){
$this->load->database();
$this->load->model('Group_model');
$this->load->model('Service_model');
$query = $this->db->query('SELECT * FROM services WHERE service_id = "'.$service_id.'" LIMIT 1;');
if($query->num_rows() > 0){
$resultItem = $query->result()[0];
return $resultItem;
}
else{
return 0;
}
}
public function getAllServices(){
$this->load->database();
$query = $this->db->query('SELECT * FROM services WHERE is_deleted != "1" ORDER BY service_name ASC;');
if($query->num_rows() > 0){
foreach($query->result() as $resultItem){
$isServiceAvailable = $this->Service_model->iServiceAvailable($resultItem->service_id);
$resultItemTmp = array(
'service_id' => $resultItem->service_id,
'main_category' => $resultItem->main_category,
'main_category_description' => $resultItem->main_category_description,
'service_category' => $resultItem->service_category,
'service_name' => $resultItem->service_name,
'service_description' => $resultItem->service_description,
'service_price' => $resultItem->service_price,
'service_time' => $resultItem->service_time,
'is_enabled' => $resultItem->is_enabled,
'is_public' => $resultItem->is_public,
'is_service_available' => $isServiceAvailable,
'target_url' => $resultItem->target_url
);
$serviceArray[] = (object)$resultItemTmp;
}
return $serviceArray;
}
else{
return 0;
}
}
public function getAvailableServices(){
$this->load->database();
$query = $this->db->query('SELECT * FROM services WHERE is_enabled = "1" AND is_deleted != "1" ORDER BY service_name ASC;');
if($query->num_rows() > 0){
$serviceArray = array();
foreach($query->result() as $resultItem){
$serviceTmp = array(
'service_name' => $resultItem->service_name,
'service_id' => $resultItem->service_id,
'service_group' => $resultItem->service_group
);
$serviceArray[] = (object)$serviceTmp;
}
return $serviceArray;
}
}
public function getAllServiceByGroups($serviceGroupArray){
$this->load->database();
$serviceGroupArrayString = implode(',', $serviceGroupArray);
$query = $this->db->query('SELECT * FROM services
WHERE
is_deleted != "1" AND
is_public = "1" AND
service_group IN ('.$serviceGroupArrayString.')
ORDER BY service_id ASC;');
$serviceArray = array();
if($query->num_rows() > 0){
foreach($query->result() as $resultItem){
$isServiceAvailable = $this->Service_model->iServiceAvailable($resultItem->service_id);
$resultItemTmp = array(
'service_id' => $resultItem->service_id,
'main_category' => $resultItem->main_category,
'main_category_description' => $resultItem->main_category_description,
'service_category' => $resultItem->service_category,
'service_name' => $resultItem->service_name,
'service_description' => $resultItem->service_description,
'service_group' => $resultItem->service_group,
'is_extra' => $resultItem->is_extra,
'is_car' => $resultItem->is_car,
'service_price' => $resultItem->service_price,
'service_time' => $resultItem->service_time,
'is_enabled' => $resultItem->is_enabled,
'is_public' => $resultItem->is_public,
'is_service_available' => $isServiceAvailable,
'target_url' => $resultItem->target_url
);
$serviceArray[] = (object)$resultItemTmp;
}
}
return $serviceArray;
}
public function deleteBooking($booking_id){
$this->load->database();
$query = $this->db->query('DELETE FROM bookings WHERE booking_id = "'.$booking_id.'";');
}
public function getAllBookings(){
$this->load->database();
$this->load->model('Service_model');
$query = $this->db->query('SELECT * FROM bookings ORDER BY booking_date DESC, booking_start_time ASC;');
if($query->num_rows() > 0){
$resultsArray = array();
foreach($query->result() as $resultItem){
$resultTmp = (array)$resultItem;
$groupObjectsArray = array();
if($resultTmp['group_ids'] != ''){
$selectedGroups = explode(',', $resultTmp['group_ids']);
if(is_array($selectedGroups)){
foreach($selectedGroups as $selectedGroupItem){
$selectedGroup = $this->Group_model->getGroupById($selectedGroupItem);
$groupObjectsArray[] = $selectedGroup;
}
}
}
$resultTmp['workgroups'] = $groupObjectsArray;
if($resultTmp['service_ids'] != ''){
$servicesArray = unserialize($resultTmp['service_ids']);
if(is_array($servicesArray)){
$services = array();
foreach($servicesArray as $servicesArrayItem){
$selectedService = $this->Service_model->getServiceById($servicesArrayItem);
$services[] = (object)array(
'service_name' => $selectedService->service_name,
'service_price' => $selectedService->service_price,
'service_time' => $selectedService->service_time
);
}
$resultTmp['services'] = $services;
}
else{
$resultTmp['services'] = array();
}
}
else{
$resultTmp['services'] = array();
}
$resultsArray[] = (object)$resultTmp;
}
return $resultsArray;
}
else{
return 0;
}
}
public function getActualBookings(){
$this->load->database();
$this->load->model('Service_model');
$query = $this->db->query('SELECT * FROM bookings JOIN workgroups ON bookings.group_id = workgroups.group_id WHERE booking_date >= CURDATE() ORDER BY booking_date DESC, booking_start_time ASC;');
if($query->num_rows() > 0){
$resultsArray = array();
foreach($query->result() as $resultItem){
$resultTmp = (array)$resultItem;
if($resultTmp['service_ids'] != ''){
$servicesArray = unserialize($resultTmp['service_ids']);
if(is_array($servicesArray)){
$services = array();
foreach($servicesArray as $servicesArrayItem){
$selectedService = $this->Service_model->getServiceById($servicesArrayItem['service_id']);
$services[] = (object)array(
'service_name' => $selectedService->service_name,
'service_price' => $selectedService->service_price,
'service_time' => $selectedService->service_time,
'quantity' => $servicesArrayItem['quantity']
);
}
$resultTmp['services'] = $services;
}
else{
$resultTmp['services'] = array();
}
}
else{
$resultTmp['services'] = array();
}
$resultsArray[] = (object)$resultTmp;
}
return $resultsArray;
}
else{
return 0;
}
}
public function getBookingById($booking_id){
$this->load->database();
$this->load->model('Service_model');
$query = $this->db->query('SELECT * FROM bookings WHERE booking_id = "'.$booking_id.'" LIMIT 1;');
if($query->num_rows() > 0){
$resultTmp = (array)$resultItem;
if($resultTmp['service_ids'] != ''){
$servicesArray = unserialize($resultTmp['service_ids']);
if(is_array($servicesArray)){
$services = array();
foreach($servicesArray as $servicesArrayItem){
$selectedService = $this->Service_model->getServiceById($servicesArrayItem['service_id']);
$services[] = (object)array(
'service_name' => $selectedService->service_name,
'service_price' => $selectedService->service_price,
'service_time' => $selectedService->service_time,
'quantity' => $servicesArrayItem['quantity']
);
}
$resultTmp['services'] = $services;
}
else{
$resultTmp['services'] = array();
}
}
else{
$resultTmp['services'] = array();
}
$resultsArray = (object)$resultTmp;
return $resultsArray;
}
else{
return 0;
}
}
public function getWorkgroupById($group_id){
$this->load->database();
$query = $this->db->query('SELECT * FROM workgroups WHERE group_id = "'.$group_id.'" LIMIT 1;');
if($query->num_rows() > 0){
return $query->result()[0];
}
else{
return 0;
}
}
public function getAvailableTimes($group_id, $selectedDate, $servicelength){
$this->load->database();
$serviceLengthDateTime = new DateTime($selectedDate.' '.$servicelength);
$service_length_time = strtotime($servicelength);
$availableTimeArray = array();
$selectedDayName = date('D', strtotime($selectedDate));
$dayStartTime = new DateTime($selectedDate.' 09:00');
$finishTime = new DateTime($selectedDate.' 18:01');
if($selectedDayName == 'Sun'){
return array();
}
elseif($selectedDayName == 'Sat'){
$finishTime = new DateTime($selectedDate.' 18:01');
}
else{
//finish time - selected service length
$finishTime = new DateTime($selectedDate.' 18:01');
}
$today=date_create(date('Y-m-d'));
$selectedDay=date_create($selectedDate);
$dateDiff=date_diff($today,$selectedDay);
$tmpDateStart = date_create(date('2024-02-29'));
$tmpDateEnd = date_create(date('2024-03-07'));
$datelength = new DateTime($servicelength);
$diff = $datelength->diff($finishTime);
//max time for start
$maxTime = $diff->h.':'.$diff->i.':00';
$hours = (intval($diff->h)-9)*4+1;
$mins = floor(intval($diff->i) / 15);
$loopSteps = intval($hours) + intval($mins);
for($periodIndex = 1; $periodIndex <= $loopSteps; $periodIndex++){
$minutes_to_add_start = $periodIndex*15;
$minutes_to_add_end = ($periodIndex+1)*15;
$startTime = new DateTime($selectedDate.' 08:45');
$endTime = new DateTime($selectedDate.' 08:45');
$startTime->add(new DateInterval('PT' . $minutes_to_add_start . 'M'));
$endTime->add(new DateInterval('PT' . $minutes_to_add_end . 'M'));
$maxTimeObject = new DateTime($maxTime);
$tz = new DateTimeZone('Europe/Budapest');
$addStartTimeAndLength = new DateTime($selectedDate.' '.$startTime->format('H:i:00'), $tz);
$addStartTimeAndLength->add(new DateInterval('PT' . intval($serviceLengthDateTime->format('H')) . 'H'));
$addStartTimeAndLength->add(new DateInterval('PT' . intval($serviceLengthDateTime->format('i')) . 'M'));
$currentStartTime = $startTime->format('H:i:00');
$currentEndTime = $endTime->format('H:i:00');
/*
echo '<< ';
print_r($serviceLengthDateTime->format('H:i:00'));
echo ' / ';
print_r($currentStartTime);
echo ' / ';
print_r($addStartTimeAndLength->format('H:i:00'));
echo ' >>';
*/
/*
$query = $this->db->query('SELECT * FROM bookings WHERE booking_date = "'.$selectedDate.'" AND group_id = "'.$group_id.'" AND (
(TIME(booking_start_time) >= CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) <= CAST("'.$currentEndTime.'" AS TIME)) OR
(TIME(booking_start_time) <= CAST("'.$addStartTimeAndLength->format('H:i:00').'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME)) OR
(TIME(booking_start_time) >= CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_start_time) <= CAST("'.$currentEndTime.'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME)) OR
(TIME(booking_start_time) <= CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME)
AND TIME(booking_start_time) <= CAST("'.$currentStartTime.'" AS TIME)) OR
(TIME(booking_start_time) <= CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) <= CAST("'.$currentEndTime.'" AS TIME)
AND TIME(booking_finish_time) >= CAST("'.$currentStartTime.'" AS TIME)) OR
(TIME(booking_start_time) <= CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME))
);
');
*/
$query = $this->db->query('SELECT * FROM bookings WHERE booking_date = "'.$selectedDate.'" AND group_id = "'.$group_id.'" AND (
/*start later and finish before*/
(TIME(booking_start_time) > CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) < CAST("'.$currentEndTime.'" AS TIME)) OR
/*check if not end service until next booking*/
(TIME(booking_start_time) < CAST("'.$addStartTimeAndLength->format('H:i:00').'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME)) OR
/*start later and finish later*/
(TIME(booking_start_time) > CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_start_time) < CAST("'.$currentEndTime.'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME)) OR
/*start before and finish before*/
(TIME(booking_start_time) < CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME)
AND TIME(booking_start_time) < CAST("'.$currentStartTime.'" AS TIME)) OR
/**/
(TIME(booking_start_time) < CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) < CAST("'.$currentEndTime.'" AS TIME)
AND TIME(booking_finish_time) > CAST("'.$currentStartTime.'" AS TIME)) OR
/**/
(TIME(booking_start_time) < CAST("'.$currentStartTime.'" AS TIME) AND TIME(booking_finish_time) >= CAST("'.$currentEndTime.'" AS TIME))
);
');
$now = strtotime(date('H:i:s')) + 60*60;
$timezone = 'Europe/Budapest';
$todayStartTime = strtotime($currentStartTime.' '.$timezone);
$minDiff = ($todayStartTime - $now) / 60;
if($dateDiff->format("%R%a") == 0 && $minDiff > 0){
if($query->num_rows() == 0){
$availableTimeArray[] = $currentStartTime;
}
}
elseif($dateDiff->format("%R%a") >= 0 && ($selectedDay < $tmpDateStart || $selectedDay > $tmpDateEnd) && $dateDiff->format("%R%a") != 0){
if($query->num_rows() == 0){
$availableTimeArray[] = $currentStartTime;
}
}
}
return $availableTimeArray;
}
public function createBooking($bookingArray){
$this->load->database();
$query = $this->db->query("INSERT INTO bookings (
guest_name,
guest_email,
guest_phone,
guest_addresse,
guest_car_reg_number,
guest_car_type,
group_id,
booking_date,
booking_start_time,
booking_finish_time,
service_ids,
guest_confirmed,
guest_confirm_code
) VALUES(
'".$bookingArray['guest_name']."',
'".$bookingArray['guest_email']."',
'".$bookingArray['guest_phone']."',
'".$bookingArray['guest_addresse']."',
'".$bookingArray['guest_car_reg_number']."',
'".$bookingArray['guest_car_type']."',
'".$bookingArray['group_id']."',
'".$bookingArray['booking_date']."',
'".$bookingArray['booking_start_time']."',
'".$bookingArray['booking_finish_time']."',
'".$bookingArray['service_ids']."',
'".$bookingArray['guest_confirmed']."',
'".$bookingArray['guest_confirm_code']."'
);");
}
public function iServiceAvailable($service_id){
$this->load->database();
$this->load->model('Group_model');
$isServiceActive = 0;
$selectedService = $this->Service_model->getServiceById($service_id);
$activeGroups = $this->Group_model->getAllActiveGroups();
if(is_array($activeGroups)){
foreach($activeGroups as $activeGroupItem){
$serviceIds = unserialize($activeGroupItem->skills);
if(in_array($service_id, $serviceIds) && $selectedService->is_enabled){
$isServiceActive = 1;
}
}
}
return $isServiceActive;
}
public function getServiceGroups(){
$this->load->database();
$this->load->model('Group_model');
$this->load->model('Service_model');
$services = $this->Service_model->getAvailableServices();
$serviceArray = array();
if(is_array($services)){
foreach($services as $serviceItem){
if(!in_array($serviceItem->service_group, $serviceArray)){
$serviceArray[] = $serviceItem->service_group;
}
}
}
return $serviceArray;
}
}
?>
+221
View File
@@ -0,0 +1,221 @@
<?php
require getcwd().'/vendor/autoload.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
class User_model extends CI_Model {
function __construct(){
parent::__construct();
}
public function userCanLogin($username, $password){
$this->load->database();
$query = $this->db->query('SELECT * FROM users WHERE username = "'.$username.'" AND password = "'.hash('sha256', $password).'" AND is_enabled = 1 LIMIT 1');
if($query->num_rows() == 1){
return 1;
}
else{
return 0;
}
}
public function getAllUser(){
$this->load->database();
$query = $this->db->query('SELECT * FROM users JOIN permissions ON users.permission_slug = permissions.permission_slug ORDER BY fullname ASC');
$userResults = $query->result();
foreach($userResults as $userResultItem){
if($userResultItem->profile_img_url == ''){
$userResultItem->profile_img_url = base_url().'img/default_profile.jpg';
}
}
return $userResults;
}
public function getUserByUsername($username){
$this->load->database();
$query = $this->db->query('SELECT * FROM users JOIN permissions ON users.permission_slug = permissions.permission_slug WHERE username = "'.$username.'" LIMIT 1');
if($query->num_rows() == 1){
if($query->result()[0]->profile_img_url == ''){
$query->result()[0]->profile_img_url = base_url().'img/default_profile.jpg';
}
return $query->result()[0];
}
else{
return 0;
}
}
public function getAllUserPermission(){
$this->load->database();
$query = $this->db->query('SELECT * FROM permissions;');
if($query->num_rows() > 0){
return $query->result();
}
else{
return 0;
}
}
public function getUserById($userId){
$this->load->database();
$query = $this->db->query('SELECT * FROM users JOIN permissions ON users.permission_slug = permissions.permission_slug WHERE user_id = "'.$userId.'" LIMIT 1');
if($query->num_rows() == 1){
if($query->result()[0]->profile_img_url == ''){
$query->result()[0]->profile_img_url = base_url().'img/default_profile.jpg';
}
return $query->result()[0];
}
else{
return 0;
}
}
public function deleteUser($userId){
$this->load->database();
$query = $this->db->query('DELETE FROM users WHERE user_id = "'.$userId.'";');
}
public function isUsernameAvailable($username){
$this->load->database();
$query = $this->db->query('SELECT * FROM users WHERE username = "'.$username.'";');
if($query->num_rows() == 1){
return 0;
}
else{
return 1;
}
}
public function updateUser($userId, $userArray){
$this->load->database();
foreach($userArray as $propertyKey => $propertyValue){
$query = $this->db->query('UPDATE users SET '.$propertyKey.' = "'.$propertyValue.'" WHERE user_id = "'.$userId.'";');
}
}
public function addNewUser($userArray){
$this->load->database();
if(!is_object($this->getUserByUsername($userArray['username']))){
$query = $this->db->query('INSERT INTO users (username, password, fullname, permission_slug, is_enabled, user_notes) VALUES("'.$userArray['username'].'", "'.hash('sha256', $userArray['password']).'", "'.$userArray['fullname'].'", "'.$userArray['permission_slug'].'", "'.$userArray['is_enabled'].'", "'.$userArray['user_notes'].'");');
return 1;
}
else{
return 0;
}
}
public function getAllUserGroup(){
$this->load->database();
$query = $this->db->query('SELECT * FROM permissions ORDER BY permission_name ASC;');
return $query->result();
}
public function getPermissionById($groupId){
$this->load->database();
$query = $this->db->query('SELECT * FROM permissions WHERE permission_id = "'.$groupId.'" LIMIT 1;');
return $query->result()[0];
}
public function getPermissionBySlug($permission_slug){
$this->load->database();
$query = $this->db->query('SELECT * FROM permissions WHERE permission_slug = "'.$permission_slug.'" LIMIT 1;');
return $query->result()[0];
}
public function sendEmail($addressList){
// Import PHPMailer classes into the global namespace
// These must be at the top of your script, not inside a function
if(!empty($addressList)){
foreach($addressList as $addressListItem){
// Instantiation and passing `true` enables exceptions
$mail = new PHPMailer(false);
$mail->SMTPDebug = false;
$mail->do_debug = 1;
try {
//Server settings
$mail->CharSet = 'UTF-8';
//$mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output
$mail->isSMTP(); //Send using SMTP
$mail->Host = 'mail.absolutesolution.hu'; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication
$mail->Username = 'timebestilling@dinbestehjelper.no'; //SMTP username
$mail->Password = 'sudvym-1jydZe-wewtic'; //SMTP password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
$mail->Port = 465; //TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above
//Recipients
$mail->setFrom('timebestilling@dinbestehjelper.no', '[dinbestehjelper]');
$mail->addAddress($addressListItem['addressee_email'], $addressListItem['addressee_name']); // Add a recipient
//$mail->addAddress('ellen@example.com'); // Name is optional
//$mail->addReplyTo('info@example.com', 'Information');
$mail->addCC('timebestilling@dinbestehjelper.no');
//$mail->addBCC('bcc@example.com');
// Attachments
if(is_array($addressListItem['attachments'])){
$attachments = $addressListItem['attachments'];
foreach($attachments as $attachmentsItem){
$mail->addAttachment(getcwd().'/documents/'.$attachmentsItem); // Add attachments
}
}
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
// Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = $addressListItem['subject'];
ob_start();
$body = ob_get_clean();
$body .= $addressListItem['content'];
$mail->Body = $body;
//$mail->AltBody = strip_tags($answer_message);
$mail->send();
echo 'Üzenet elküldve';
//header('location:'.base_url().'quotation-finished/');
} catch (Exception $e) {
//header('location:'.base_url().'manage-applicants/?email-sent=false&error='.$mail->ErrorInfo);
echo "Üzenetküldési hiba. Mailer Error: {$mail->ErrorInfo}";
}
}
}
}
public function is_user_admin($username){
$this->load->database();
$query = $this->db->query('SELECT * FROM users JOIN permissions ON users.permission_slug = permissions.permission_slug WHERE username = "'.$username.'" LIMIT 1');
if($query->num_rows() == 1){
if($query->result()[0]->permission_slug == 'admin'){
return 1;
}
else{
return 0;
}
}
else{
return 0;
}
}
}
?>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+6
View File
@@ -0,0 +1,6 @@
<?php
include(getcwd().'/application/views/includes/skeleton-top.php');
include(getcwd().'/application/views/admin/includes/add-booking-form.php');
include(getcwd().'/application/views/includes/skeleton-bottom.php');
?>
+6
View File
@@ -0,0 +1,6 @@
<?php
include(getcwd().'/application/views/includes/skeleton-top.php');
include(getcwd().'/application/views/admin/includes/add-group-form.php');
include(getcwd().'/application/views/includes/skeleton-bottom.php');
?>
+6
View File
@@ -0,0 +1,6 @@
<?php
include(getcwd().'/application/views/includes/skeleton-top.php');
include(getcwd().'/application/views/admin/includes/add-service-form.php');
include(getcwd().'/application/views/includes/skeleton-bottom.php');
?>
+5
View File
@@ -0,0 +1,5 @@
<?php
include(getcwd().'/application/views/includes/skeleton-top.php');
include(getcwd().'/application/views/admin/includes/bookings-form.php');
include(getcwd().'/application/views/includes/skeleton-bottom.php');
?>
+6
View File
@@ -0,0 +1,6 @@
<?php
include(getcwd().'/application/views/includes/skeleton-top.php');
include(getcwd().'/application/views/admin/includes/dashboard-form.php');
include(getcwd().'/application/views/includes/skeleton-bottom.php');
?>
+6
View File
@@ -0,0 +1,6 @@
<?php
include(getcwd().'/application/views/includes/skeleton-top.php');
include(getcwd().'/application/views/admin/includes/groups-form.php');
include(getcwd().'/application/views/includes/skeleton-bottom.php');
?>
@@ -0,0 +1,187 @@
<div class="mainContentContainer" style="top:100px">
<div class="pageTitle"><?php echo $pageTitle;?></div>
<form method="post" action="<?php echo base_url();?>bookings/booking-process">
<input type="hidden" name="servicelength" id="servicelength" value="00:00:00">
<div class="formRow">
<label class="formTitle">Vendég neve</label>
<input type="text" class="formInputBox" name="guest_name" value="">
</div>
<div class="formRow">
<label class="formTitle">Email</label>
<input type="text" class="formInputBox" name="guest_email" value="">
</div>
<div class="formRow">
<label class="formTitle">Telefon</label>
<input type="text" class="formInputBox" name="guest_phone" value="">
</div>
<div class="formRow">
<label class="formTitle">Csoport</label>
<select class="formDropdownBox" style="padding:0;" name="group_id" id="group_id">
<?php
foreach($workgroups as $workgroupItem){
echo '<option value="'.$workgroupItem->group_id.'">'.$workgroupItem->group_name.'</option>';
}
?>
</select>
</div>
<div class="formRow">
<label class="formTitle">Kezdő dátum</label>
<input type="date" class="formInputBox" name="booking_date" id="booking_date" value="<?php echo date('Y-m-d');?>">
</div>
<div class="formRow">
<label class="formTitle">Záró dátum</label>
<input type="date" class="formInputBox" name="end_booking_date" id="end_booking_date" value="<?php echo date('Y-m-d');?>">
</div>
<div class="formRow">
<label class="formTitle">Egész nap szabadnap</label>
<select class="formDropdownBox" style="padding:0;" name="free_day" id="free_day">
<option value="1">igen</option>
<option value="0" selected>nem</option>
</select>
</div>
<div class="formRow">
<label class="formTitle">Szolgáltatás(ok)</label>
<input type="text"
class="flexdatalist formInputBox"
data-data="<?php echo SITEURL;?>load_services.json"
data-search-in="service_name"
data-visible-properties='["service_name"]'
data-selection-required="true"
data-value-property="service_id"
data-text-property="{service_name}"
data-min-length="0"
multiple="multiple"
name="service_ids"
id="serviceList" style="background-color:white;">
</div>
<div class="formRow">
<label class="formTitle">Kezdő időpont</label>
<select class="formDropdownBox" style="padding:0;" name="booking_start_time" id="booking_start_time">
</select>
</div>
<div class="formRow">
<label class="formTitle">Záró időpont</label>
<input type="time" class="formInputBox" name="booking_finish_time" id="booking_finish_time" value="">
</div>
<div class="formRow">
<label class="formTitle">Értesítés küldése</label>
<select class="formDropdownBox" style="padding:0;" name="send_notification">
<option value="1">igen</option>
<option value="0" selected>nem</option>
</select>
</div>
<div class="formRow">
<input type="submit" class="submitButton" name="addNewBookingManual" value="Hozzáadás">
<a href="<?php echo base_url();?>bookings" class="cancelButton" >Mégsem</a>
</div>
</form>
</div>
<script>
$(document).ready(function(){
getAvaliableTimesOfTheDay();
$('#free_day').change(function(){
if($('#free_day').val() == '1'){
$('#booking_start_time').html('<option value="09:00:00">09:00:00</option>');
$('#booking_start_time').val('09:00:00');
$('#booking_finish_time').val('18:00:00');
$('#serviceList').val('');
}
else{
getAvaliableTimesOfTheDay();
}
});
$('#booking_date').change(function(){
if($('#free_day').val() != '1'){
$('#end_booking_date').val($('#booking_date').val());
getAvaliableTimesOfTheDay();
$("#booking_start_time option:first").attr('selected', true);
}
});
$('#booking_start_time').change(function(){
//getAvaliableTimesOfTheDay();
if($('#free_day').val() != '1'){
calculateServiceEndTime();
}
});
$('#serviceList').change(function(){
$.ajax({
url: '<?php echo base_url();?>ajax',
type: 'POST',
data: {
action:'calculate_service_length',
service_ids: $('#serviceList').val()
},
error: function() {
},
//dataType: 'json',
success: function(data) {
},
}).done(function(result){
$('#servicelength').val(result);
if($('#free_day').val() != '1'){
getAvaliableTimesOfTheDay();
calculateServiceEndTime();
}
});
});
$('#group_id').change(function(){
if($('#free_day').val() != '1'){
getAvaliableTimesOfTheDay();
}
});
});
function getAvaliableTimesOfTheDay(){
var selectedDate = $('#booking_date').val();
$.ajax({
url: '<?php echo base_url();?>ajax',
type: 'POST',
data: {
action:'getAvailableTimeOptions',
group_id:$('#group_id').val(),
servicelength:$('#servicelength').val(),
selectedDate:selectedDate
},
error: function() {
},
//dataType: 'json',
success: function(data) {
},
}).done(function(result){
if(result != 0){
$('#booking_start_time').html(result);
calculateServiceEndTime();
}
else{
$('#booking_start_time').html('<option value="">Nincs erre a napra szabad időpont!</option>');
}
});
}
function calculateServiceEndTime(){
var selectedTotalTime = $('#booking_start_time').val();
const selectedServiceDatetime = new Date('<?php echo date('Y-m-d');?> ' + $('#servicelength').val());
//console.log($('#servicelength').val());
var subTotalTimeHours = moment.utc(selectedTotalTime,'HH:mm').add(selectedServiceDatetime.getHours(),'hour').format('HH:mm');
var subTotalTimeMinutes = moment.utc(subTotalTimeHours,'HH:mm').add(selectedServiceDatetime.getMinutes(),'minutes').format('HH:mm');
//console.log(subTotalTimeMinutes);
$('#booking_finish_time').val(subTotalTimeMinutes);
}
</script>
@@ -0,0 +1,52 @@
<div class="mainContentContainer" style="top:100px">
<div class="pageTitle"><?php echo $pageTitle;?></div>
<form method="post" action="<?php echo base_url();?>groups/group-process" enctype="multipart/form-data">
<div class="formRow">
<label class="formTitle">Név</label>
<input type="text" class="formInputBox" name="group_name" value="">
</div>
<div class="formRow">
<label class="formTitle">Profilkép</label>
<input type="file" class="formInputBox" name="group_profile_img" value="">
</div>
<div class="formRow">
<label class="formTitle">Leírás</label>
<input type="text" class="formInputBox" name="group_info" value="">
</div>
<div class="formRow">
<label class="formTitle">Képességek</label>
<div class="skillContainer">
<?php
if(is_array($services)){
foreach($services as $serviceItem){
if($serviceItem->service_category != ''){
echo '<div class="skillItem"><div class="skillCheckBoxContainer"><input type="hidden" name="skill_'.$serviceItem->service_id.'" value="0"><input type="checkbox" name="skill_'.$serviceItem->service_id.'" id="skill_'.$serviceItem->service_id.'" value="1"></div><label class="skillLabel" for="skill_'.$serviceItem->service_id.'">'.$serviceItem->service_name.' <br />('.$serviceItem->service_category.')</label></div>';
}
else{
echo '<div class="skillItem"><div class="skillCheckBoxContainer"><input type="hidden" name="skill_'.$serviceItem->service_id.'" value="0"><input type="checkbox" name="skill_'.$serviceItem->service_id.'" id="skill_'.$serviceItem->service_id.'" value="1"></div><label class="skillLabel" for="skill_'.$serviceItem->service_id.'">'.$serviceItem->service_name.'</label></div>';
}
}
}
?>
</div>
</div>
<div class="formRow">
<label class="formTitle">Aktív</label>
<select class="formDropdownBox" style="padding:0;" name="is_active">
<option value="1" selected>igen</option>
<option value="0">nem</option>
</select>
</div>
<div class="formRow">
<label class="formTitle">Megjegyzés</label>
<input type="text" class="formInputBox" name="group_notes" value="">
</div>
<div class="formRow">
<input type="submit" class="submitButton" name="addNewGroup" value="Hozzáadás">
<a href="<?php echo base_url();?>groups" class="cancelButton">Mégsem</a>
</div>
</form>
</div>
@@ -0,0 +1,53 @@
<div class="mainContentContainer" style="top:100px">
<div class="pageTitle"><?php echo $pageTitle;?></div>
<form method="post" action="<?php echo base_url();?>services/service-process">
<div class="formRow">
<label class="formTitle">Fő kategória</label>
<input type="text" class="formInputBox" name="main_category" value="">
</div>
<div class="formRow">
<label class="formTitle">Fő kategória leírás</label>
<input type="text" class="formInputBox" name="main_category_description" value="">
</div>
<div class="formRow">
<label class="formTitle">Kategória</label>
<input type="text" class="formInputBox" name="service_category" value="">
</div>
<div class="formRow">
<label class="formTitle">Megnevezés</label>
<input type="text" class="formInputBox" name="service_name" value="">
</div>
<div class="formRow">
<label class="formTitle">Leírás</label>
<input type="text" class="formInputBox" name="service_description" value="">
</div>
<div class="formRow">
<label class="formTitle">Szolgáltatás ára</label>
<input type="number" class="formInputBox" name="service_price" value="">
</div>
<div class="formRow">
<label class="formTitle">Szolgáltatás időtartama</label>
<input type="time" class="formInputBox" name="service_time" value="">
</div>
<div class="formRow">
<label class="formTitle">Aktív</label>
<select class="formDropdownBox" style="padding:0;" name="is_enabled">
<option value="1" selected>igen</option>
<option value="0">nem</option>
</select>
</div>
<div class="formRow">
<label class="formTitle">Nyilvános</label>
<select class="formDropdownBox" style="padding:0;" name="is_public">
<option value="1" selected>igen</option>
<option value="0">nem</option>
</select>
</div>
<div class="formRow">
<input type="submit" class="submitButton" name="addNewService" value="Hozzáadás">
<a href="<?php echo base_url();?>services" class="cancelButton">Mégsem</a>
</div>
</form>
</div>
@@ -0,0 +1,72 @@
<div class="mainContentContainer" style="top:100px">
<div class="pageTitle"><?php echo $pageTitle;?></div>
<div class="form-row">
<a href="<?php echo SITEURL;?>bookings/add-booking" class="submitBtn">Új foglalás</a>
</div>
<div class="form-row">
<table class="tableClass">
<tr>
<td></td>
<td>#</td>
<td>Vendég neve</td>
<td>Email</td>
<td>Telefon</td>
<td>Csoport</td>
<td>Foglalási dátum</td>
<td>Szolg. kezdete</td>
<td>Szolg. vége</td>
<td>Szolgáltatások</td>
</tr>
<?php
if(is_array($results)){
foreach($results as $resultItem){
?>
<tr>
<td>
<a href="<?php echo SITEURL;?>bookings/update-booking/<?php echo $resultItem->booking_id ;?>"><i class="fas fa-edit"></i></a>
| <a href="<?php echo site_url().'bookings/booking-process?delete-booking='.$resultItem->booking_id;?>"><i class="fas fa-trash-alt" style="font-size: 14px;color:#585858;"></i></a>
</td>
<td>#<?php echo $resultItem->booking_id;?></td>
<td><?php echo $resultItem->guest_name;?></td>
<td><?php echo $resultItem->guest_email;?></td>
<td><?php echo $resultItem->guest_phone;?></td>
<td><?php echo $resultItem->group_name;?></td>
<td style="min-width:85px;"><?php echo $resultItem->booking_date;?></td>
<td><?php echo $resultItem->booking_start_time;?></td>
<td><?php echo $resultItem->booking_finish_time;?></td>
<td><?php
if(!empty($resultItem->services)){
echo '<table class="tableInTable">';
echo '<tr>';
echo '<td>Szolgáltalás neve</td>';
echo '<td>Mennyiség</td>';
echo '<td>Ár</td>';
echo '<td>Időtartam</td>';
echo '</tr>';
foreach($resultItem->services as $serviceItem){
echo '<tr>';
echo '<td>'.$serviceItem->service_name.'</td>';
echo '<td>'.$serviceItem->quantity.'</td>';
echo '<td>'.$serviceItem->service_price.'</td>';
echo '<td>'.$serviceItem->service_time.'</td>';
echo '</tr>';
}
echo '</table>';
}
?></td>
</tr>
<?php
}
}
else{
echo '<tr>';
echo '<td colspan="10">Nincs bejegyzett foglalás</td>';
echo '</tr>';
}
?>
</table>
</div>
</div>
@@ -0,0 +1,81 @@
<div class="mainContentContainer" style="top:100px">
<div class="pageTitle"><?php echo $pageTitle;?></div>
<script src="<?php echo SITEURL;?>assets/js/calendar.js" defer></script>
<div class="contianer">
<div class="calendar">
<div class="calendar-header">
<span class="month-picker" id="month-picker"> May </span>
<div class="year-picker" id="year-picker">
<span class="year-change" id="pre-year">
<pre><</pre>
</span>
<span id="year">2020 </span>
<span class="year-change" id="next-year">
<pre>></pre>
</span>
</div>
</div>
<div class="calendar-body">
<div class="calendar-week-days">
<div>V</div>
<div>H</div>
<div>K</div>
<div>Sze</div>
<div>CS</div>
<div>P</div>
<div>Szo</div>
</div>
<div class="calendar-days">
</div>
</div>
<div class="calendar-footer">
</div>
<div class="date-time-formate">
<div class="day-text-formate">MA</div>
<div class="date-time-value">
<div class="time-formate">01:41:20</div>
<div class="date-formate">2022 - march - 03</div>
</div>
</div>
<div class="month-list"></div>
</div>
<div class="calendarContent"></div>
</div>
</div>
<script>
$(document).ready(function(){
});
function hasEventDay(year, monthNumber, dayNumber){
var month = monthNumber+1 > 9 ? (monthNumber+1) : '0' + (monthNumber+1);
var day = dayNumber > 9 ? dayNumber : '0' + dayNumber;
var selectedDate = year +'-'+ month +'-'+ day;
//console.log(selectedDate);
var status = 0;
$.ajax({
url: '<?php echo SITEURL;?>ajax',
type: 'POST',
data: {
action:'dayHasEvent',
dayDate: selectedDate
},
error: function() {
},
//dataType: 'json',
success: function(data) {
status = data;
return status;
console.log(status);
},
}).done(function(result){
});
return status;
}
</script>
@@ -0,0 +1,53 @@
<div class="mainContentContainer" style="top:100px">
<div class="pageTitle"><?php echo $pageTitle;?></div>
<div class="form-row">
<a href="<?php echo SITEURL;?>groups/add-group" class="submitBtn">Új csoport</a>
</div>
<div class="form-row">
<table class="tableClass">
<tr>
<td></td>
<td>#</td>
<td>Profilkép</td>
<td>Név</td>
<td>Leírás</td>
<td>Képességek</td>
<td>Aktív</td>
</tr>
<?php
$skillList = '';
if(is_array($results)){
foreach($results as $resultItem){
$skillList = '<div>';
if(is_array($resultItem->skillList)){
foreach($resultItem->skillList as $skillListItem){
$skillList .= '<div>'.$skillListItem->service_name.' / '.$skillListItem->service_category.' (#'.$skillListItem->service_id.')</div>';
}
}
$skillList .= '</div>';
?>
<tr>
<td>
<a href="<?php echo SITEURL;?>groups/update-group/<?php echo $resultItem->group_id;?>"><i class="fas fa-edit"></i></a>
| <a href="<?php echo site_url().'groups/group-process?delete-group='.$resultItem->group_id;?>"><i class="fas fa-trash-alt" style="font-size: 14px;color:#585858;"></i></a>
</td>
<td>#<?php echo $resultItem->group_id;?></td>
<td><img src="<?php echo SITEURL.'assets/img/'.$resultItem->group_profile_img;?>" style="width:50px;margin:0;" /></td>
<td><?php echo $resultItem->group_name;?></td>
<td><?php echo $resultItem->group_info;?></td>
<td><?php echo $skillList;?></td>
<td><?php echo $resultItem->is_active?'igen':'nem';?></td>
</tr>
<?php
}
}
else{
echo '<tr>';
echo '<td colspan="10">Nincs találat</td>';
echo '</tr>';
}
?>
</table>
</div>
</div>
@@ -0,0 +1,55 @@
<div class="mainContentContainer" style="top:100px">
<div class="pageTitle"><?php echo $pageTitle;?></div>
<div class="form-row">
<a href="<?php echo SITEURL;?>services/add-service" class="submitBtn">Új szolgáltatás</a>
</div>
<div class="form-row">
<table class="tableClass">
<tr>
<td style="min-width:55px;"></td>
<td>#</td>
<td>Fő kategória</td>
<td>Fő kategória leírás</td>
<td>Kategória</td>
<td>Megnevezés</td>
<td>Leírás</td>
<td>Ár</td>
<td>Időtartam</td>
<td>Nyilvános</td>
<td>Elérhető</td>
<td>Státusz</td>
</tr>
<?php
if(is_array($results)){
foreach($results as $resultItem){
?>
<tr>
<td>
<a href="<?php echo SITEURL;?>services/update-service/<?php echo $resultItem->service_id;?>"><i class="fas fa-edit"></i></a>
| <a href="<?php echo site_url().'services/service-process?delete-service='.$resultItem->service_id;?>"><i class="fas fa-trash-alt" style="font-size: 14px;color:#585858;"></i></a>
</td>
<td>#<?php echo $resultItem->service_id;?></td>
<td><?php echo $resultItem->main_category;?></td>
<td><?php echo $resultItem->main_category_description;?></td>
<td><?php echo $resultItem->service_category;?></td>
<td><?php echo $resultItem->service_name;?></td>
<td><?php echo $resultItem->service_description;?></td>
<td><?php echo $resultItem->service_price;?></td>
<td><?php echo $resultItem->service_time;?></td>
<td><?php echo $resultItem->is_public?'igen':'nem';?></td>
<td><?php echo $resultItem->is_service_available?'igen':'nem';?></td>
<td><?php echo $resultItem->is_enabled?'aktív':'inaktív';?></td>
</tr>
<?php
}
}
else{
echo '<tr>';
echo '<td colspan="10">Nincs találat</td>';
echo '</tr>';
}
?>
</table>
</div>
</div>
@@ -0,0 +1,211 @@
<div class="mainContentContainer" style="top:100px">
<div class="pageTitle"><?php echo $pageTitle;?></div>
<form method="post" action="<?php echo base_url();?>bookings/booking-process">
<input type="hidden" name="servicelength" id="servicelength" value="00:00:00">
<input type="hidden" name="booking_id" value="<?php echo $selectedItem->booking_id;?>">
<div class="formRow">
<label class="formTitle">Vendég neve</label>
<input type="text" class="formInputBox" name="guest_name" value="<?php echo $selectedItem->guest_name;?>">
</div>
<div class="formRow">
<label class="formTitle">Email</label>
<input type="text" class="formInputBox" name="guest_email" value="<?php echo $selectedItem->guest_email;?>">
</div>
<div class="formRow">
<label class="formTitle">Telefon</label>
<input type="text" class="formInputBox" name="guest_phone" value="<?php echo $selectedItem->guest_phone;?>">
</div>
<div class="formRow">
<label class="formTitle">Csoport</label>
<select class="formDropdownBox" style="padding:0;" name="group_id" id="group_id">
<?php
foreach($workgroups as $workgroupItem){
echo '<option value="'.$workgroupItem->group_id.'" '.($workgroupItem->group_id == $selectedItem->group_id?'selected':'').'>'.$workgroupItem->group_name.'</option>';
}
?>
</select>
</div>
<div class="formRow">
<label class="formTitle">Kezdő dátum</label>
<input type="date" class="formInputBox" name="booking_date" id="booking_date" value="<?php echo $selectedItem->booking_date;?>">
</div>
<div class="formRow">
<label class="formTitle">Záró dátum</label>
<input type="date" class="formInputBox" name="end_booking_date" id="end_booking_date" value="<?php echo $selectedItem->booking_date;?>">
</div>
<div class="formRow">
<label class="formTitle">Egész nap szabadnap</label>
<select class="formDropdownBox" style="padding:0;" name="free_day" id="free_day">
<option value="1">igen</option>
<option value="0" selected>nem</option>
</select>
</div>
<div class="formRow">
<label class="formTitle">Szolgáltatás(ok)</label>
<input type="text"
class="flexdatalist formInputBox"
data-data="<?php echo SITEURL;?>load_services.json"
data-search-in="service_name"
data-visible-properties='["service_name"]'
data-selection-required="true"
data-value-property="service_id"
data-text-property="{service_name}"
data-min-length="1"
multiple="multiple"
name="service_ids"
value="<?php
if($selectedItem->service_ids != ''){
$services = unserialize($selectedItem->service_ids);
echo implode(',',$services);
}
?>"
id="serviceList" required style="background-color:white;">
</div>
<div class="formRow">
<label class="formTitle">Kezdő időpont</label>
<input type="time" class="formInputBox" name="booking_start_time" id="booking_start_time" value="<?php echo $selectedItem->booking_start_time;?>">
</div>
<div class="formRow">
<label class="formTitle">Záró időpont</label>
<input type="time" class="formInputBox" name="booking_finish_time" id="booking_finish_time" value="<?php echo $selectedItem->booking_finish_time;?>">
</div>
<div class="formRow">
<label class="formTitle">Értesítés küldése</label>
<select class="formDropdownBox" style="padding:0;" name="send_notification">
<option value="1">igen</option>
<option value="0" selected>nem</option>
</select>
</div>
<div class="formRow">
<input type="submit" class="submitButton" name="updateBookingManual" value="Módosítás">
<a href="<?php echo base_url();?>bookings" class="cancelButton" >Mégsem</a>
</div>
</form>
</div>
<script>
$(document).ready(function(){
//getAvaliableTimesOfTheDay();
$('#free_day').change(function(){
if($('#free_day').val() == '1'){
$('#booking_start_time').html('<option value="10:00:00">10:00:00</option>');
$('#booking_start_time').val('10:00:00');
$('#booking_finish_time').val('18:00:00');
$('#serviceList').val('');
}
else{
getAvaliableTimesOfTheDay();
}
});
$('#booking_date').change(function(){
if($('#free_day').val() != '1'){
$('#end_booking_date').val($('#booking_date').val());
getAvaliableTimesOfTheDay();
$("#booking_start_time option:first").attr('selected', true);
}
});
$('#booking_start_time').change(function(){
if($('#free_day').val() != '1'){
$.ajax({
url: '<?php echo base_url();?>ajax',
type: 'POST',
data: {
action:'calculate_service_length',
service_ids: $('#serviceList').val()
},
error: function() {
},
//dataType: 'json',
success: function(data) {
},
}).done(function(result){
$('#servicelength').val(result);
if($('#free_day').val() != '1'){
getAvaliableTimesOfTheDay();
calculateServiceEndTime();
}
});
}
});
$('#serviceList').change(function(){
$.ajax({
url: '<?php echo base_url();?>ajax',
type: 'POST',
data: {
action:'calculate_service_length',
service_ids: $('#serviceList').val()
},
error: function() {
},
//dataType: 'json',
success: function(data) {
},
}).done(function(result){
$('#servicelength').val(result);
if($('#free_day').val() != '1'){
getAvaliableTimesOfTheDay();
calculateServiceEndTime();
}
});
});
$('#group_id').change(function(){
if($('#free_day').val() != '1'){
getAvaliableTimesOfTheDay();
}
});
});
function getAvaliableTimesOfTheDay(){
var selectedDate = $('#booking_date').val();
$.ajax({
url: '<?php echo base_url();?>ajax',
type: 'POST',
data: {
action:'getAvailableTimeOptions',
worker_id:$('#worker_id').val(),
servicelength:$('#servicelength').val(),
selectedDate:selectedDate
},
error: function() {
},
//dataType: 'json',
success: function(data) {
},
}).done(function(result){
if(result != 0){
$('#booking_start_time').html(result);
calculateServiceEndTime();
}
else{
$('#booking_start_time').html('<option value="">Nincs erre a napra szabad időpont!</option>');
}
});
}
function calculateServiceEndTime(){
var selectedTotalTime = $('#booking_start_time').val();
const selectedServiceDatetime = new Date('<?php echo date('Y-m-d');?> ' + $('#servicelength').val());
//console.log($('#servicelength').val());
var subTotalTimeHours = moment.utc(selectedTotalTime,'HH:mm').add(selectedServiceDatetime.getHours(),'hour').format('HH:mm');
var subTotalTimeMinutes = moment.utc(subTotalTimeHours,'HH:mm').add(selectedServiceDatetime.getMinutes(),'minutes').format('HH:mm');
//console.log(subTotalTimeMinutes);
$('#booking_finish_time').val(subTotalTimeMinutes);
}
</script>
@@ -0,0 +1,57 @@
<div class="mainContentContainer" style="top:100px">
<div class="pageTitle"><?php echo $pageTitle;?></div>
<form method="post" action="<?php echo base_url();?>groups/group-process" enctype="multipart/form-data">
<input type="hidden" name ="group_id" value="<?php echo $selectedItem->group_id;?>">
<div class="formRow">
<label class="formTitle">Név</label>
<input type="text" class="formInputBox" name="group_name" value="<?php echo $selectedItem->group_name;?>">
</div>
<div class="formRow">
<img src="<?php echo SITEURL.'assets/img/groups/'.$selectedItem->group_profile_img;?>" width="100px">
</div>
<div class="formRow">
<label class="formTitle">Profilkép</label>
<input type="file" class="formInputBox" name="group_profile_img">
</div>
<div class="formRow">
<label class="formTitle">Leírás</label>
<input type="text" class="formInputBox" name="group_info" value="<?php echo $selectedItem->group_info;?>">
</div>
<div class="formRow">
<label class="formTitle">Képességek</label>
<div class="skillContainer">
<?php
$selectedServiceArray = unserialize($selectedItem->skills);
if(is_array($services)){
foreach($services as $serviceItem){
if($serviceItem->service_category != ''){
echo '<div class="skillItem"><div class="skillCheckBoxContainer"><input type="hidden" name="skill_'.$serviceItem->service_id.'" value="0"><input type="checkbox" name="skill_'.$serviceItem->service_id.'" id="skill_'.$serviceItem->service_id.'" value="1" '.(in_array($serviceItem->service_id, $selectedServiceArray)?'checked':'').'></div><label class="skillLabel" for="skill_'.$serviceItem->service_id.'">'.$serviceItem->service_name.' <br />('.$serviceItem->service_category.')</label></div>';
}
else{
echo '<div class="skillItem"><div class="skillCheckBoxContainer"><input type="hidden" name="skill_'.$serviceItem->service_id.'" value="0"><input type="checkbox" name="skill_'.$serviceItem->service_id.'" id="skill_'.$serviceItem->service_id.'" value="1" '.(in_array($serviceItem->service_id, $selectedServiceArray)?'checked':'').'></div><label class="skillLabel" for="skill_'.$serviceItem->service_id.'">'.$serviceItem->service_name.'</label></div>';
}
}
}
?>
</div>
</div>
<div class="formRow">
<label class="formTitle">Aktív</label>
<select class="formDropdownBox" style="padding:0;" name="is_active">
<option value="1" <?php echo $selectedItem->is_active?'selected':'';?>>igen</option>
<option value="0" <?php echo !$selectedItem->is_active?'selected':'';?>>nem</option>
</select>
</div>
<div class="formRow">
<label class="formTitle">Megjegyzés</label>
<input type="text" class="formInputBox" name="group_notes" value="<?php echo $selectedItem->group_notes;?>">
</div>
<div class="formRow">
<input type="submit" class="submitButton" name="updateGroup" value="Módosítás">
<a href="<?php echo base_url();?>groups" class="cancelButton">Mégsem</a>
</div>
</form>
</div>
@@ -0,0 +1,54 @@
<div class="mainContentContainer" style="top:100px">
<div class="pageTitle"><?php echo $pageTitle;?></div>
<form method="post" action="<?php echo base_url();?>services/service-process">
<input type="hidden" name ="service_id" value="<?php echo $selectedItem->service_id;?>">
<div class="formRow">
<label class="formTitle">Fő kategória</label>
<input type="text" class="formInputBox" name="main_category" value="<?php echo $selectedItem->main_category;?>">
</div>
<div class="formRow">
<label class="formTitle">Fő kategória leírás</label>
<input type="text" class="formInputBox" name="main_category_description" value="<?php echo $selectedItem->main_category_description;?>">
</div>
<div class="formRow">
<label class="formTitle">Kategória</label>
<input type="text" class="formInputBox" name="service_category" value="<?php echo $selectedItem->service_category;?>">
</div>
<div class="formRow">
<label class="formTitle">Megnevezés</label>
<input type="text" class="formInputBox" name="service_name" value="<?php echo $selectedItem->service_name;?>">
</div>
<div class="formRow">
<label class="formTitle">Leírás</label>
<input type="text" class="formInputBox" name="service_description" value="<?php echo $selectedItem->service_description;?>">
</div>
<div class="formRow">
<label class="formTitle">Szolgáltatás ára</label>
<input type="number" class="formInputBox" name="service_price" value="<?php echo $selectedItem->service_price;?>">
</div>
<div class="formRow">
<label class="formTitle">Szolgáltatás időtartama</label>
<input type="time" class="formInputBox" name="service_time" value="<?php echo $selectedItem->service_time;?>">
</div>
<div class="formRow">
<label class="formTitle">Aktív</label>
<select class="formDropdownBox" style="padding:0;" name="is_enabled">
<option value="1" <?php echo $selectedItem->is_enabled?'selected':'';?>>igen</option>
<option value="0" <?php echo !$selectedItem->is_enabled?'selected':'';?>>nem</option>
</select>
</div>
<div class="formRow">
<label class="formTitle">Nyilvános</label>
<select class="formDropdownBox" style="padding:0;" name="is_public">
<option value="1" <?php echo $selectedItem->is_public?'selected':'';?>>igen</option>
<option value="0" <?php echo !$selectedItem->is_public?'selected':'';?>>nem</option>
</select>
</div>
<div class="formRow">
<input type="submit" class="submitButton" name="updateService" value="Módosítás">
<a href="<?php echo base_url();?>services" class="cancelButton" >Mégsem</a>
</div>
</form>
</div>
+6
View File
@@ -0,0 +1,6 @@
<?php
include(getcwd().'/application/views/includes/skeleton-top.php');
include(getcwd().'/application/views/admin/includes/services-form.php');
include(getcwd().'/application/views/includes/skeleton-bottom.php');
?>
@@ -0,0 +1,5 @@
<?php
include(getcwd().'/application/views/includes/skeleton-top.php');
include(getcwd().'/application/views/admin/includes/update-booking-form.php');
include(getcwd().'/application/views/includes/skeleton-bottom.php');
?>
+6
View File
@@ -0,0 +1,6 @@
<?php
include(getcwd().'/application/views/includes/skeleton-top.php');
include(getcwd().'/application/views/admin/includes/update-group-form.php');
include(getcwd().'/application/views/includes/skeleton-bottom.php');
?>
@@ -0,0 +1,6 @@
<?php
include(getcwd().'/application/views/includes/skeleton-top.php');
include(getcwd().'/application/views/admin/includes/update-service-form.php');
include(getcwd().'/application/views/includes/skeleton-bottom.php');
?>
+33
View File
@@ -0,0 +1,33 @@
<div class="logo-container">
<img src="<?php echo SITEURL;?>img/logo.png" width="100%">
</div>
<div class="siteName"></div>
<div class="main-container" style="background-color:#e8e4f8;">
<div class="login-container">
<div class="login-row">
<?php
if(isset($message)){
echo '<div class="message '.$message_class.'">'.$message.'</div>';
}
?>
</div>
<form method="post" action="<?php echo site_url().'login'?>">
<div class="login-row">
<label class="login-labels"><i class="fas fa-user-tie"></i></label><input type="text" class="loginform-text username" placeholder="Felhasználó név" name="username" id="username" value="<?php echo $username;?>">
</div>
<div class="login-row">
<label class="login-labels"><i class="fas fa-key"></i></label><input type="password" class="loginform-text password" placeholder="Jelszó" name="password" id="password" value="<?php echo $password;?>">
</div>
<div class="login-row">
<input type="hidden" name="remember" value="off">
<input type="checkbox" name="remember" id="remember" <?php echo $username!=''?' checked':'';?>><label for="remember" style="display:inline-block; text-align:left;margin-left:10px;margin-top:10px;cursor:pointer;">Jelszó megjegyzése</label>
</div>
<div class="login-row">
<input type="submit" class="button login" value="Bejelentkezés" name="sendLogin">
</div>
</form>
</div>
</div>
<div class="loginSubText"></div>
View File
View File
@@ -0,0 +1,8 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
echo "\nERROR: ",
$heading,
"\n\n",
$message,
"\n\n";
@@ -0,0 +1,8 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
echo "\nDatabase error: ",
$heading,
"\n\n",
$message,
"\n\n";
@@ -0,0 +1,21 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
An uncaught Exception was encountered
Type: <?php echo get_class($exception), "\n"; ?>
Message: <?php echo $message, "\n"; ?>
Filename: <?php echo $exception->getFile(), "\n"; ?>
Line Number: <?php echo $exception->getLine(); ?>
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?>
Backtrace:
<?php foreach ($exception->getTrace() as $error): ?>
<?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?>
File: <?php echo $error['file'], "\n"; ?>
Line: <?php echo $error['line'], "\n"; ?>
Function: <?php echo $error['function'], "\n\n"; ?>
<?php endif ?>
<?php endforeach ?>
<?php endif ?>
@@ -0,0 +1,8 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
echo "\nERROR: ",
$heading,
"\n\n",
$message,
"\n\n";
@@ -0,0 +1,21 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
A PHP Error was encountered
Severity: <?php echo $severity, "\n"; ?>
Message: <?php echo $message, "\n"; ?>
Filename: <?php echo $filepath, "\n"; ?>
Line Number: <?php echo $line; ?>
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?>
Backtrace:
<?php foreach (debug_backtrace() as $error): ?>
<?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?>
File: <?php echo $error['file'], "\n"; ?>
Line: <?php echo $error['line'], "\n"; ?>
Function: <?php echo $error['function'], "\n\n"; ?>
<?php endif ?>
<?php endforeach ?>
<?php endif ?>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
@@ -0,0 +1,64 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>404 Page Not Found</title>
<style type="text/css">
::selection { background-color: #E13300; color: white; }
::-moz-selection { background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
box-shadow: 0 0 8px #D0D0D0;
}
p {
margin: 12px 15px 12px 15px;
}
</style>
</head>
<body>
<div id="container">
<h1><?php echo $heading; ?></h1>
<?php echo $message; ?>
</div>
</body>
</html>
@@ -0,0 +1,64 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Database Error</title>
<style type="text/css">
::selection { background-color: #E13300; color: white; }
::-moz-selection { background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
box-shadow: 0 0 8px #D0D0D0;
}
p {
margin: 12px 15px 12px 15px;
}
</style>
</head>
<body>
<div id="container">
<h1><?php echo $heading; ?></h1>
<?php echo $message; ?>
</div>
</body>
</html>
@@ -0,0 +1,32 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>An uncaught Exception was encountered</h4>
<p>Type: <?php echo get_class($exception); ?></p>
<p>Message: <?php echo $message; ?></p>
<p>Filename: <?php echo $exception->getFile(); ?></p>
<p>Line Number: <?php echo $exception->getLine(); ?></p>
<?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 ?>
<?php endif ?>
</div>
@@ -0,0 +1,64 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
<style type="text/css">
::selection { background-color: #E13300; color: white; }
::-moz-selection { background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
box-shadow: 0 0 8px #D0D0D0;
}
p {
margin: 12px 15px 12px 15px;
}
</style>
</head>
<body>
<div id="container">
<h1><?php echo $heading; ?></h1>
<?php echo $message; ?>
</div>
</body>
</html>
@@ -0,0 +1,33 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: <?php echo $severity; ?></p>
<p>Message: <?php echo $message; ?></p>
<p>Filename: <?php echo $filepath; ?></p>
<p>Line Number: <?php echo $line; ?></p>
<?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 ?>
<?php endforeach ?>
<?php endif ?>
</div>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
@@ -0,0 +1,100 @@
<form method="post" action="<?php echo base_url();?>user-process">
<div class="formRow">
<label class="formTitle">Felhasználónév</label>
<div style="position:relative;display:inline;">
<input type="text" class="formInputBox" name="username" id="username" value="" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" required><div class="userIsAvailableBox"><i class="far fa-check-circle success" id="userIsAvailable" style="display:none;" title="A felhasználónév elérhető!"></i><i class="far fa-times-circle error" id="userIsNotAvailable" title="A felhasználónév már foglalt!" style="display:none;"></i></div>
</div>
</div>
<div class="formRow">
<label class="formTitle">Teljes név</label>
<input type="text" class="formInputBox" name="fullname" value="" required>
</div>
<div class="formRow">
<label class="formTitle">Jelszó</label>
<div style="position:relative;display:inline;">
<input type="password" class="formInputBox" name="password" id="user-password" value="" required><div class="viewPasswordBox"><i class="far fa-eye-slash"></i><i class="far fa-eye" style="display:none;"></i></div>
</div>
</div>
<div class="formRow">
<label class="formTitle">Jogosultsági szint</label>
<select class="formDropdownBox" name="permission_slug">
<?php
foreach($permissions as $permissionItem){
echo '<option value="'.$permissionItem->permission_slug.'">'.$permissionItem->permission_name.'</option>';
}
?>
</select>
</div>
<div class="formRow">
<label class="formTitle">Státusz</label>
<select class="formDropdownBox" name="is_enabled">
<option value="1" selected>Aktív</option>
<option value="0">Letiltva</option>
</select>
</div>
<div class="formRow">
<label class="formTitle">Megjegyzés</label>
<textarea class="formTextarea" name="user_notes"></textarea>
</div>
<div class="formRow">
<input type="submit" class="submitButton" name="addNewUser" id="addNewUser" value="Hozzáadás">
<a href="<?php echo base_url();?>user-management" class="cancelButton" >Mégsem</a>
</div>
</form>
<script>
$(document).ready(function(){
$('.viewPasswordBox').click(function(){
if($('.fa-eye-slash').is(":visible")){
$('.fa-eye').show();
$('.fa-eye-slash').hide();
$('#user-password').prop("type", "text");
}
else{
$('.fa-eye').hide();
$('.fa-eye-slash').show();
$('#user-password').prop("type", "password");
}
});
$('#username').focusout(function(){
if($('#username').val().length == 0){
$('#userIsNotAvailable').hide();
$('#userIsAvailable').hide();
}
});
$('#username').keyup(function(){
$.ajax({
url: '<?php echo base_url();?>ajax',
type: 'POST',
data: {
action:'checkUser',
username: $('#username').val()
},
error: function() {
},
//dataType: 'json',
success: function(data) {
},
}).done(function(result){
if(result == 1){
$('#userIsNotAvailable').hide();
$('#userIsAvailable').show();
$('#addNewUser').prop('disabled', false);
}
else{
$('#addNewUser').prop('disabled', true);
$('#userIsNotAvailable').show();
$('#userIsAvailable').hide();
}
});
});
});
</script>
@@ -0,0 +1 @@
<div class="copyrightText" style="padding:5px;z-index:100;">&#169; 2024. Az alkalmazás szerzői jogvédelem alatt áll. </div>
+67
View File
@@ -0,0 +1,67 @@
<footer id="footer">
<div class="container footer-div">
<div class="footer-bal">
<div class="contact-block">
<!--img src="../images/logo_white.png" class="footer-logo"-->
<ul>
<li class="companyname"><span>Studio Beve AS</span></li>
<li><span>Innherredsveien 92.<br> 7043 Trondheim, Norway</span></li>
<li><span>Organisation number: 932 941 619</span></li>
<li><span><a href="mailto:info@studiobeve.no">info@studiobeve.no</a></span></li>
</ul>
</div>
<ul class="icons">
<li><a href="https://www.facebook.com/bevelash/" class="icon brands fa-facebook-f"><span class="label">Facebook</span></a></li>
<li><a href="https://www.instagram.com/beve_barber" class="icon brands fa-instagram"><span class="label">LinkedIn</span></a></li>
</ul>
</div>
<div class="footer-jobb">
<a href="https://www.google.com/maps/place/Innherredsveien+92,+7043+Trondheim,+Norway/@63.4369352,10.4350889,17z/data=!4m6!3m5!1s0x466d3199df480755:0xc8a07a1d27083152!8m2!3d63.4373339!4d10.4353781!16s%2Fg%2F11h26_1cnn?entry=ttu" target="_blank"><img src="images/map.jpg"> </a>
</div>
</div>
<div class="copyright">
&copy; Studio Beve - All rights reserved.
</div>
</footer>
+61
View File
@@ -0,0 +1,61 @@
<?php
$this->load->helper('url');
?>
<head>
<!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=AW-11436951713"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-11436951713'); </script>
<!-- Google tag (gtag.js)-->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-RFSYQ1T73M"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-RFSYQ1T73M');
</script>
<title>Din Beste Hjelper AS</title>
<meta charset="utf-8" />
<!--
<meta property="fb:app_id" content="285150047390571">
<meta property="og:site_name" content="Studio Beve">
<meta property="og:image" content="<?php echo SITEURL?>assets/img/studiobeve_facebook.jpg"/>
<meta property="og:title" content="Studio Beve" />
<meta property="og:description" content="Vippestylist, make up artist, PMU-artist" />
<meta property="og:url" content="<?php echo SITEURL;?>" />
<meta property="og:type" content="website" />
-->
<meta name="description" content="Skjeggtrimming, Barneklipp, Skjeggfarging, Herreklipp, Skinfade Herreklipp, Voks, Beard Trimming, Child Haircut, Beard Dying, Traditional Shave, Men's Haircut, Skinfade, Wax, herrefrisør, Trondheim, hårklipp, haircut, barber, barberer, Mens hairdresser, Voksing, Sminke, Vippeextensions, Pudderbryn, PMU-Tatovering, Øyenbrynstyling, Vippestyling, Powder Brows, permanent, PMU Makeup, Makeup, Wax, Eyelash Extension, Eyebrow styling, Eyelash Styling, Wedding makeup, Brow lamination, Lash dying, Brow forming, Henna dying, Lash lift, Naturlig sminke, Bryllupssminke, Laminering, Henna farging, Vippeløft, Forming av bryn, Farging av vipper, Trondheim">
<link rel="icon" type="image/x-icon" href="<?php echo base_url();?>assets/img/favicon/favicon.ico" />
<link rel="icon" type="image/png" href="<?php echo base_url();?>assets/img/favicon/favicon.png" />
<link rel="icon" type="image/gif" href="<?php echo base_url();?>assets/img/favicon/favicon.gif" />
<!-- Opera Speed Dial Favicon -->
<link rel="icon" type="image/png" href="<?php echo base_url();?>assets/img/favicon/speeddial-160px.png" />
<!-- For iPhone 4 Retina display: -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php echo base_url();?>assets/img/favicon/apple-touch-icon-114x114-precomposed.png">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<script src="<?php echo base_url();?>assets/js/jquery/jquery.js"></script>
<link rel="stylesheet" href="<?php echo SITEURL;?>assets/js/jquery/jquery-ui.css">
<link rel="stylesheet" href="<?php echo SITEURL;?>assets/js/jquery/jquery-ui.theme.css">
<script src="<?php echo base_url();?>assets/js/jquery/jquery-ui.js"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
<link rel="stylesheet" href="<?php echo base_url();?>assets/css/main.css" />
<noscript><link rel="stylesheet" href="<?php echo base_url();?>assets/css/noscript.css" /></noscript>
<link href="https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Open+Sans:ital,wght@0,700;0,800;1,700;1,800&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<script src="https://momentjs.com/downloads/moment-with-locales.js"></script>
<script src="<?php echo base_url();?>assets/js/jquery.flexdatalist.min.js"></script>
<link href="<?php echo base_url();?>assets/js/jquery.flexdatalist.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Open+Sans:ital,wght@0,700;0,800;1,700;1,800&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/style.css">
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/responsive.css">
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/modules.css">
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/calendar.css">
<script src="<?php echo base_url();?>assets/js/script.js"></script>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
</head>
+48
View File
@@ -0,0 +1,48 @@
<div class="siteHeaderContainer">
<div class="welcomeText" style="text-transform:uppercase;">DIN BESTE HJELPER AS - Adminisztráció</div>
<div class="mobileMenu">
<div class="dropdown-mobile">
<button class="dropbtn-mobile"><i class="fas fa-bars" id="hambiMenu"></i></button>
<div class="dropdown-content-mobile">
<a href="<?php echo base_url();?>dashboard">Vezérlőpult</a>
<?php
if(is_array($activeModules)){
foreach($activeModules as $activeModuleItem){
echo '<a href="'.base_url().$activeModuleItem->module_root_url.'">'.$activeModuleItem->module_name.'</a>';
}
}
?>
</div>
</div>
</div>
<div class="desktopMenu">
<div class="dropdown-desktop">
<button class="dropbtn-desktop">Vezérlőpult</button>
<div class="dropdown-content-desktop">
<a href="<?php echo base_url();?>dashboard">Vezérlőpult</a>
<?php
if(is_array($activeModules)){
foreach($activeModules as $activeModuleItem){
echo '<a href="'.base_url().$activeModuleItem->module_root_url.'">'.$activeModuleItem->module_name.'</a>';
}
}
?>
</div>
</div>
</div>
<!--<div class="headerLogo"></div>-->
<div class="infoBar"><?php echo $currentUser->username.' - '.$currentUser->fullname.' ['.$currentUser->permission_name.']';?></div>
<div class="profileMenu">
<div class="dropdown-profile">
<button class="dropbtn-profile" style="background-image:url('<?php echo site_url().$currentUser->profile_img_url;?>');" title="Bejelentkezve: <?php echo $currentUser->fullname;?>"></button>
<div class="dropdown-content-profile">
<a href="<?php echo base_url();?>profile">Profil szerkesztése</a>
<a href="<?php echo base_url();?>login?logout=true">Kijelentkezés</a>
</div>
</div>
</div>
</div>
@@ -0,0 +1,41 @@
<div class="formRow">
<form method = "post" action="">
<input type="submit" name="exportToFile" class="submitButton" value="Exportálás">
</form>
<div class="loginfoFile"><?php echo $logInfoLink;?></div>
</div>
<div class='console' style="height:420px;">
<div class='console-inner' style="height:410px;">
<div id="outputs">
</div>
<div class='output-cmd'><textarea autofocus class='console-input' id='console-input' placeholder="" style="height:410px;"></textarea></div>
</div>
</div>
<script>
$(document).ready(function(){
refreshLogMonitor();
setInterval("refreshLogMonitor();",5000);
});
function refreshLogMonitor(){
$.ajax({
url: '<?php echo base_url();?>ajax',
type: 'POST',
data: {
action:'refreshLogMonitor' },
error: function() {
//$('#info').html('<p>An error has occurred</p>');
},
//dataType: 'json',
success: function(data) {
},
}).done(function(result){
//console.log(result);
$('#console-input').html(result);
});
}
</script>
+33
View File
@@ -0,0 +1,33 @@
<div class="logo-container">
<img class="header-logo" src="<?php echo SITEURL;?>assets/img/logo.png">
</div>
<div class="siteName"></div>
<div class="main-container">
<div class="login-container">
<div class="login-row">
<?php
if(isset($message)){
echo '<div class="message '.$message_class.'">'.$message.'</div>';
}
?>
</div>
<form method="post" action="<?php echo site_url().'login'?>">
<div class="login-row">
<label class="login-labels"><i class="fas fa-user-tie"></i></label><input type="text" class="loginform-text username" placeholder="Felhasználó név" name="username" id="username" value="<?php echo $username;?>">
</div>
<div class="login-row">
<label class="login-labels"><i class="fas fa-key"></i></label><input type="password" class="loginform-text password" placeholder="Jelszó" name="password" id="password" value="<?php echo $password;?>">
</div>
<div class="login-row">
<input type="hidden" name="remember" value="off">
<input type="checkbox" name="remember" id="remember" <?php echo $username!=''?' checked':'';?>><label for="remember" style="display:inline-block; text-align:left;margin-left:10px;margin-top:10px;cursor:pointer;">Jelszó megjegyzése</label>
</div>
<div class="login-row">
<input type="submit" class="button login" value="Bejelentkezés" name="sendLogin">
</div>
</form>
</div>
</div>
<div class="loginSubText"></div>
@@ -0,0 +1,6 @@
<header>
<img class="header-logo" src="<?php echo base_url();?>assets/img/logo.png">
<!--h1>Erat ut Sapien, mus curae, morbi dictum duis<br />
aenean auctor at Dictum.</h1>
<p>Etiam quis viverra lorem, in semper lorem. Sed nisl arcu euismod sit amet nisi euismod sed cursus arcu elementum ipsum arcu vivamus quis venenatis orci lorem ipsum et magna feugiat veroeros aliquam. Lorem ipsum dolor sit amet nullam dolore.</p-->
</header>
@@ -0,0 +1,14 @@
<?php
include(getcwd().'/application/views/includes/main-footer.php');
?>
</div>
</div>
<script src="<?php echo SITEURL;?>assets/js/jquery.min.js"></script>
<script src="<?php echo SITEURL;?>assets/js/jquery.dropotron.min.js"></script>
<script src="<?php echo SITEURL;?>assets/js/browser.min.js"></script>
<script src="<?php echo SITEURL;?>assets/js/breakpoints.min.js"></script>
<script src="<?php echo SITEURL;?>assets/js/util.js"></script>
<script src="<?php echo SITEURL;?>assets/js/main.js"></script>
</body>
</html>
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<?php
include(getcwd().'/application/views/includes/head.php');
?>
<body class="is-preload">
<!-- Wrapper -->
<div id="wrapper">
<!-- Header -->
<!-- Menu -->
<!-- Main -->
<div id="main">
<div class="inner">
<?php
include(getcwd().'/application/views/includes/main-header.php');
?>
@@ -0,0 +1,70 @@
<?php
if(isset($selectedUser)){
?>
<form method="post" action="<?php echo base_url();?>user-process">
<input type="hidden" name="user_id" value="<?php echo $selectedUser->user_id;?>"/>
<div class="formRow">
<label class="formTitle">Felhasználónév</label>
<input type="text" class="formInputBox" name="username" value="<?php echo $selectedUser->username;?>" readonly>
</div>
<div class="formRow">
<label class="formTitle">Teljes név</label>
<input type="text" class="formInputBox" name="fullname" value="<?php echo $selectedUser->fullname;?>">
</div>
<div class="formRow">
<label class="formTitle">Jelszó</label>
<div style="position:relative;display:inline;">
<input type="password" class="formInputBox" name="password" id="user-password" value=""><div class="viewPasswordBox"><i class="far fa-eye-slash"></i><i class="far fa-eye" style="display:none;"></i></div>
</div>
</div>
<div class="formRow">
<label class="formTitle">Jogosultsági szint</label>
<select class="formDropdownBox" name="permission_slug">
<?php
foreach($permissions as $permissionItem){
echo '<option value="'.$permissionItem->permission_slug.'" '.($selectedUser->permission_slug == $permissionItem->permission_slug?'selected':'').'>'.$permissionItem->permission_name.'</option>';
}
?>
</select>
</div>
<div class="formRow">
<label class="formTitle">Státusz</label>
<select class="formDropdownBox" name="is_enabled">
<option value="1" <?php echo $selectedUser->is_enabled? 'selected':''; ?>>Aktív</option>
<option value="0" <?php echo !$selectedUser->is_enabled? 'selected':''; ?>>Letiltva</option>
</select>
</div>
<div class="formRow">
<label class="formTitle">Megjegyzés</label>
<textarea class="formTextarea" name="user_notes"><?php echo $selectedUser->user_notes;?></textarea>
</div>
<div class="formRow">
<input type="submit" class="submitButton" name="updateUser" value="Mentés">
<a href="<?php echo base_url();?>user-management" class="cancelButton" >Mégsem</a>
</div>
</form>
<?php
}
?>
<script>
$(document).ready(function(){
$('.viewPasswordBox').click(function(){
if($('.fa-eye-slash').is(":visible")){
$('.fa-eye').show();
$('.fa-eye-slash').hide();
$('#user-password').prop("type", "text");
}
else{
$('.fa-eye').hide();
$('.fa-eye-slash').show();
$('#user-password').prop("type", "password");
}
});
});
</script>
@@ -0,0 +1,75 @@
<div class="tableContainer">
<form method="post" action="">
<div class="tableTitle">Felhasználó szintű jogosultságok</div>
<!--<input type="text" class="formInputBox" style="margin-bottom:20px;padding:5px;font-size:15px;color:gray;max-width:350px;" onfocus="this.value=''" onfocusout="this.value='felhasználó keresés...'" value="felhasználó keresés...">-->
<table class="tableClass">
<tr class="tableHeader" style="position: sticky;">
<td>#</td>
<td style="text-align:left">Név</td>
<td style="text-align:left;width:270px;">Felhasználói név</td>
<?php
foreach($modules as $moduleItem){
echo '<td>'.$moduleItem->module_name.'</td>';
}
?>
</tr>
<?php
echo $usersPrivilegesView;
?>
</table>
<div class="tableTitle">Csoport szintű jogosultságok</div>
<table class="tableClass">
<tr class="tableHeader" style="position: sticky; top: 87px;">
<td>#</td>
<td style="text-align:left">Csoport szint</td>
<?php
foreach($modules as $moduleItem){
echo '<td>'.$moduleItem->module_name.'</td>';
}
?>
</tr>
<?php
echo $groupModuleView;
?>
</table>
<input type="submit" name="updatePermission" class="submitButton" value="Mentés">
</form>
<button style="
display: none;
position: fixed;
bottom: 20px;
right: 30px;
z-index: 99;
border: none;
outline: none;
background-color: #222260;
color: white;
cursor: pointer;
padding: 15px;
border-radius: 10px;
font-size: 18px"
class="goToTopButton" onclick="topFunction()" id="myTopBtn" title="Go to top">Ugrás az oldal tetejére</button>
</div>
<script>
//go to top button
let myTopBtn = document.getElementById("myTopBtn");
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
myTopBtn.style.display = "block";
} else {
myTopBtn.style.display = "none";
}
}
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>
@@ -0,0 +1,38 @@
<?php
if(isset($currentUser)){
?>
<div class="login-row">
<?php
if(isset($message)){
echo '<div class="'.$message_class.'">'.$message.'</div>';
}
?>
</div>
<form method="post" action="<?php echo base_url();?>profile" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?php echo $currentUser->user_id;?>"/>
<div class="formRow">
<label class="formTitle">Felhasználónév</label>
<input type="text" class="formInputBox" value="<?php echo $currentUser->username;?>" readonly style="color: lightgray;">
</div>
<div class="formRow">
<label class="formTitle">Teljes név</label>
<input type="text" class="formInputBox" name="fullname" value="<?php echo $currentUser->fullname;?>" required>
</div>
<div class="formRow">
<label class="formTitle">Jelszó (Ha üresen marad, akkor nem változik)</label>
<input type="password" class="formInputBox" name="password" value="">
</div>
<div class="formRow">
<label class="formTitle">Profil kép feltöltése</label>
<input type="file" name="profile_img" id="profile_img">
</div>
<div class="formRow">
<input type="submit" class="submitButton" name="storeProfile" value="Mentés">
<a href="<?php echo base_url();?>home" class="cancelButton" >Mégsem</a>
</div>
</form>
<?php
}
?>
@@ -0,0 +1,47 @@
<footer class="section footer-classic context-dark" id="contact-us">
<div class="decorative-word"><span>d</span><span>i</span><span>n</span><span>b</span><span>e</span><span>s</span><span>t</span><span>e</span><span>h</span><span>e</span><span>l</span><span>p</span><span>e</span><span>r</span></div>
<div class="container">
<div class="row row-70 flex-column-reverse flex-xl-row">
<div class="col-xl-12">
<div class="row row-40">
<div class="col-sm-12 col-xl-4">
<h2 class="title-section">Kontakt</h2>
<p class="footer-text">Tjenestene våre er tilgjengelige i Trondheim <br /> og omegn. <br />Organisasjonsnummer: 933 573 702</p>
<p class="footer-link-2"><a class="link-body" href="mailto:info@dinbjestehelper.no">info@dinbjestehelper.no</a></p>
<ul class="social-list">
<li><a class="link-white" href="https://www.facebook.com/dinbestehjelper"><span class="icon icon-sm fa fa-facebook"></span></a></li>
<li><a class="link-white" href="https://www.instagram.com/dinbestehjelper/"><span class="icon icon-sm fa fa-instagram"></span></a></li>
</ul>
</div>
<div class="col-sm-12 col-xl-8 inset-left-xl" style="max-width: 100%;">
<img src="<?php echo SITEURL;?>assets/img/map.jpg">
</div>
</div>
<p class="rights"><span>&copy;&nbsp; </span><span class="copyright-year"></span><span>&nbsp;</span><span>dinbestehelper</span><span>.&nbsp;</span><span>Alle rettigheter forbeholdt</span></p>
</div>
</div>
</div>
</footer>
@@ -0,0 +1,52 @@
<?php
$this->load->helper('url');
header('Access-Control-Allow-Origin: *');
?>
<head>
<!-- Start cookieyes banner --> <script id="cookieyes" type="text/javascript" src="https://cdn-cookieyes.com/client_data/61820bf37e70b1f433220722/script.js"></script> <!-- End cookieyes banner -->
<title>Din Beste Hjelper AS</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" href="<?php echo SITEURL;?>assets/img/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700%7CMontserrat:300,400,500,700,800,900%7CQuicksand:700">
<link rel="stylesheet" href="<?php echo SITEURL;?>assets/css/fontawesome-all.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
<script src="<?php echo SITEURL;?>assets/js/jquery/jquery.js"></script>
<link rel="stylesheet" href="<?php echo SITEURL;?>assets/js/jquery/jquery-ui.css">
<link rel="stylesheet" href="<?php echo SITEURL;?>assets/css/bootstrap.css">
<link rel="stylesheet" href="<?php echo SITEURL;?>assets/css/fonts.css">
<link rel="stylesheet" href="<?php echo SITEURL;?>assets/css/main.css">
<link rel="stylesheet" href="<?php echo SITEURL;?>assets/css/style.css">
<link rel="stylesheet" href="<?php echo SITEURL;?>assets/css/responsive.css">
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/calendar.css">
<!-- Meta Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '1022633592888217');
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=1022633592888217&ev=PageView&noscript=1"
/></noscript>
<!-- End Meta Pixel Code -->
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-MQSMS5BT');</script>
<!-- End Google Tag Manager -->
</head>
@@ -0,0 +1,124 @@
<header class="section page-header">
<!--RD Navbar-->
<div class="rd-navbar-wrap">
<nav class="rd-navbar rd-navbar-classic"
data-layout="rd-navbar-fixed" data-sm-layout="rd-navbar-fixed" data-md-layout="rd-navbar-fixed" data-md-device-layout="rd-navbar-fixed" data-lg-layout="rd-navbar-static" data-lg-device-layout="rd-navbar-static" data-xl-layout="rd-navbar-static" data-xl-device-layout="rd-navbar-static" data-lg-stick-up-offset="46px" data-xl-stick-up-offset="46px" data-xxl-stick-up-offset="46px" data-lg-stick-up="true" data-xl-stick-up="true" data-xxl-stick-up="true">
<div class="rd-navbar-collapse-toggle rd-navbar-fixed-element-1" data-rd-navbar-toggle=".rd-navbar-collapse"><span></span></div>
<div class="rd-navbar-aside-outer rd-navbar-collapse bg-gray-700">
<div class="rd-navbar-aside">
<ul class="list-inline list-inline-md">
<li>
<!--div class="unit unit-spacing-xs align-items-center">
<div class="unit-left"></div>
<div class="unit-body"><a class="link-contact link-white rendeles-gomb" href="tel:#">BESTILL TIME</a></div>
</div-->
</li>
<li>
<div class="unit unit-spacing-xs align-items-center">
<div class="unit-left"><a class="link-white" href="https://www.facebook.com/dinbestehjelper"><span class="icon fa fa-facebook"></span></a></div>
<div class="unit-left"><a class="link-white" href="https://www.instagram.com/dinbestehjelper/"><span class="icon fa fa-instagram"></span></a></div>
</div>
</li>
</ul>
</div>
</div>
<div class="rd-navbar-main-outer">
<div class="rd-navbar-main">
<!--RD Navbar Panel-->
<div class="rd-navbar-panel">
<!--RD Navbar Toggle-->
<button class="rd-navbar-toggle" data-rd-navbar-toggle=".rd-navbar-nav-wrap"><span></span></button>
<!--RD Navbar Brand-->
<div class="rd-navbar-brand">
<!--Brand--><a class="brand" href="<?php echo SITEURL;?>"><img class="brand-logo-dark" src="<?php echo SITEURL;?>assets/img/logo-default.png" alt="" width="84" height="17"/><img class="brand-logo-light" src="<?php echo SITEURL;?>assets/img/logo-default.png" alt="" width="84" height="17"/></a>
</div>
<div class="mobilos-foglalas-menupont">
<a href="<?php echo SITEURL;?>booking">BESTILL TIME</a>
</div>
</div>
<div class="rd-navbar-main-element">
<div class="rd-navbar-nav-wrap">
<ul class="rd-navbar-nav">
<li class="rd-nav-item active"><a class="rd-nav-link" href="<?php echo SITEURL;?>#home">Forside</a>
</li>
<li class="rd-nav-item"><a class="rd-nav-link" href="<?php echo SITEURL;?>#about">Om Oss</a>
</li>
<li class="rd-nav-item"><a class="rd-nav-link" href="<?php echo SITEURL;?>#our-services">Tjenester</a>
</li>
<li class="rd-nav-item"><a class="rd-nav-link" href="<?php echo SITEURL;?>#pricelist">Priser</a>
</li>
<li class="rd-nav-item"><a class="rd-nav-link" href="<?php echo SITEURL;?>#contact-us">Kontakt</a>
</li>
<li class="rd-nav-item"><a class="rd-nav-link" href="<?php echo SITEURL;?>booking" >Bestill Time</a>
</li>
</ul>
</div>
</div>
<!--RD Navbar Search-->
<!--div class="rd-navbar-contact"><a class="link-contact link-white" href="tel:#">BESTILL TIME</a></div-->
</div>
</div>
</nav>
</div>
</header>
@@ -0,0 +1,123 @@
<header class="section page-header">
<!--RD Navbar-->
<div class="rd-navbar-wrap">
<nav class="rd-navbar rd-navbar-classic" data-layout="rd-navbar-fixed" data-sm-layout="rd-navbar-fixed" data-md-layout="rd-navbar-fixed" data-md-device-layout="rd-navbar-fixed" data-lg-layout="rd-navbar-static" data-lg-device-layout="rd-navbar-static" data-xl-layout="rd-navbar-static" data-xl-device-layout="rd-navbar-static" data-lg-stick-up-offset="46px" data-xl-stick-up-offset="46px" data-xxl-stick-up-offset="46px" data-lg-stick-up="true" data-xl-stick-up="true" data-xxl-stick-up="true">
<div class="rd-navbar-collapse-toggle rd-navbar-fixed-element-1" data-rd-navbar-toggle=".rd-navbar-collapse"><span></span></div>
<div class="rd-navbar-aside-outer rd-navbar-collapse bg-gray-700">
<div class="rd-navbar-aside">
<ul class="list-inline list-inline-md">
<li>
<!--div class="unit unit-spacing-xs align-items-center">
<div class="unit-left"></div>
<div class="unit-body"><a class="link-contact link-white rendeles-gomb" href="tel:#">BESTILL TIME</a></div>
</div-->
</li>
<li>
<div class="unit unit-spacing-xs align-items-center">
<div class="unit-left"><a class="link-white" href="https://www.facebook.com/dinbestehjelper"><span class="icon fa fa-facebook"></span></a></div>
<div class="unit-left"><a class="link-white" href="https://www.instagram.com/dinbestehjelper/"><span class="icon fa fa-instagram"></span></a></div>
</div>
</li>
</ul>
</div>
</div>
<div class="rd-navbar-main-outer">
<div class="rd-navbar-main">
<!--RD Navbar Panel-->
<div class="rd-navbar-panel">
<!--RD Navbar Toggle-->
<button class="rd-navbar-toggle" data-rd-navbar-toggle=".rd-navbar-nav-wrap"><span></span></button>
<!--RD Navbar Brand-->
<div class="rd-navbar-brand">
<!--Brand--><a class="brand" href="<?php echo SITEURL;?>"><img class="brand-logo-dark" src="<?php echo SITEURL;?>assets/img/logo-default.png" alt="" width="84" height="17"/><img class="brand-logo-light" src="<?php echo SITEURL;?>assets/img/logo-default.png" alt="" width="84" height="17"/></a>
</div>
<div class="mobilos-foglalas-menupont">
<a href="<?php echo SITEURL;?>booking">BESTILL TIME</a>
</div>
</div>
<div class="rd-navbar-main-element">
<div class="rd-navbar-nav-wrap">
<ul class="rd-navbar-nav">
<li class="rd-nav-item active"><a class="rd-nav-link" href="<?php echo SITEURL;?>#home">Forside</a>
</li>
<li class="rd-nav-item"><a class="rd-nav-link" href="<?php echo SITEURL;?>#about">Om Oss</a>
</li>
<li class="rd-nav-item"><a class="rd-nav-link" href="<?php echo SITEURL;?>#our-services">Tjenester</a>
</li>
<li class="rd-nav-item"><a class="rd-nav-link" href="<?php echo SITEURL;?>#pricelist">Priser</a>
</li>
<li class="rd-nav-item"><a class="rd-nav-link" href="<?php echo SITEURL;?>#contact-us">Kontakt</a>
</li>
<li class="rd-nav-item"><a class="rd-nav-link" href="<?php echo SITEURL;?>booking" >Bestill Time</a>
</li>
</ul>
</div>
</div>
<!--RD Navbar Search-->
<!--div class="rd-navbar-contact"><a class="link-contact link-white" href="tel:#">BESTILL TIME</a></div-->
</div>
</div>
</nav>
</div>
</header>
@@ -0,0 +1,34 @@
<?php
include(getcwd().'/application/views/includes/public-footer.php');
?>
</div>
<!--
-->
<div class="snackbars" id="form-output-global"></div>
<!--coded by Starlight-->
<script src="<?php echo SITEURL;?>assets/js/core.min.js"></script>
<script src="<?php echo SITEURL;?>assets/js/main.js"></script>
<script src="<?php echo SITEURL;?>assets/js/jquery/jquery-ui.js"></script>
<script src="https://momentjs.com/downloads/moment-with-locales.js"></script>
<script src="<?php echo SITEURL;?>assets/js/script.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Run this only on ledigestilling page
if (window.location.pathname.includes('ledigestilling')) {
const navbar = document.querySelector('.rd-navbar.rd-navbar-classic');
if (!navbar) return;
navbar.classList.add('rd-navbar--is-stuck');
window.addEventListener('scroll', function() {
navbar.classList.add('rd-navbar--is-stuck');
}, { passive: true });
}
});
</script>
</body>
</html>

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