GOWTHAM
This commit is contained in:
parent
b20f16d309
commit
3cf230660a
101
.env
Normal file
101
.env
Normal file
@ -0,0 +1,101 @@
|
||||
#--------------------------------------------------------------------
|
||||
# Example Environment Configuration file
|
||||
#
|
||||
# This file can be used as a starting point for your own
|
||||
# custom .env files, and contains most of the possible settings
|
||||
# available in a default install.
|
||||
#
|
||||
# By default, all of the settings are commented out. If you want
|
||||
# to override the setting, you must un-comment it by removing the '#'
|
||||
# at the beginning of the line.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# ENVIRONMENT
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
CI_ENVIRONMENT = development
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# APP
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
app.baseURL = 'http://localhost/donation/'
|
||||
# app.forceGlobalSecureRequests = false
|
||||
|
||||
# app.sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler'
|
||||
# app.sessionCookieName = 'ci_session'
|
||||
# app.sessionSavePath = NULL
|
||||
# app.sessionMatchIP = false
|
||||
# app.sessionTimeToUpdate = 300
|
||||
# app.sessionRegenerateDestroy = false
|
||||
|
||||
# app.cookiePrefix = ''
|
||||
# app.cookieDomain = ''
|
||||
# app.cookiePath = '/'
|
||||
# app.cookieSecure = false
|
||||
# app.cookieHTTPOnly = false
|
||||
|
||||
# app.CSRFProtection = false
|
||||
# app.CSRFTokenName = 'csrf_test_name'
|
||||
# app.CSRFCookieName = 'csrf_cookie_name'
|
||||
# app.CSRFExpire = 7200
|
||||
# app.CSRFRegenerate = true
|
||||
# app.CSRFExcludeURIs = []
|
||||
|
||||
# app.CSPEnabled = false
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# DATABASE
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
database.default.hostname = localhost
|
||||
database.default.database = donation
|
||||
database.default.username = root
|
||||
database.default.password =
|
||||
database.default.DBDriver = MySQLi
|
||||
|
||||
# database.tests.hostname = localhost
|
||||
# database.tests.database = ci4
|
||||
# database.tests.username = root
|
||||
# database.tests.password = root
|
||||
# database.tests.DBDriver = MySQLi
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# CONTENT SECURITY POLICY
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
# contentsecuritypolicy.reportOnly = false
|
||||
# contentsecuritypolicy.defaultSrc = 'none'
|
||||
# contentsecuritypolicy.scriptSrc = 'self'
|
||||
# contentsecuritypolicy.styleSrc = 'self'
|
||||
# contentsecuritypolicy.imageSrc = 'self'
|
||||
# contentsecuritypolicy.base_uri = null
|
||||
# contentsecuritypolicy.childSrc = null
|
||||
# contentsecuritypolicy.connectSrc = 'self'
|
||||
# contentsecuritypolicy.fontSrc = null
|
||||
# contentsecuritypolicy.formAction = null
|
||||
# contentsecuritypolicy.frameAncestors = null
|
||||
# contentsecuritypolicy.mediaSrc = null
|
||||
# contentsecuritypolicy.objectSrc = null
|
||||
# contentsecuritypolicy.pluginTypes = null
|
||||
# contentsecuritypolicy.reportURI = null
|
||||
# contentsecuritypolicy.sandbox = false
|
||||
# contentsecuritypolicy.upgradeInsecureRequests = false
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# ENCRYPTION
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
# encryption.key =
|
||||
# encryption.driver = OpenSSL
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# HONEYPOT
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
# honeypot.hidden = 'true'
|
||||
# honeypot.label = 'Fill This Field'
|
||||
# honeypot.name = 'honeypot'
|
||||
# honeypot.template = '<label>{label}</label><input type="text" name="{name}" value=""/>'
|
||||
# honeypot.container = '<div style="display:none">{template}</div>'
|
||||
51
.github/workflows/phpunit.yml
vendored
Normal file
51
.github/workflows/phpunit.yml
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
name: PHPUnit
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
main:
|
||||
name: Build and test
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ['7.2', '7.3', '7.4']
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP, with composer and extensions
|
||||
uses: shivammathur/setup-php@master
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
tools: composer, pecl, phpunit
|
||||
extensions: intl, json, mbstring, mysqlnd, xdebug, xml, sqlite3
|
||||
coverage: xdebug
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader
|
||||
# To prevent rate limiting you may need to supply an OAuth token in Settings > Secrets
|
||||
# env:
|
||||
# https://getcomposer.org/doc/articles/troubleshooting.md#api-rate-limit-and-oauth-tokens
|
||||
# COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
|
||||
|
||||
- name: Test with phpunit
|
||||
run: vendor/bin/phpunit --coverage-text
|
||||
48
.htaccess
Normal file
48
.htaccess
Normal file
@ -0,0 +1,48 @@
|
||||
# Disable directory browsing
|
||||
Options All -Indexes
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Rewrite engine
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# Turning on the rewrite engine is necessary for the following rules and features.
|
||||
# FollowSymLinks must be enabled for this to work.
|
||||
<IfModule mod_rewrite.c>
|
||||
Options +FollowSymlinks
|
||||
RewriteEngine On
|
||||
|
||||
# If you installed CodeIgniter in a subfolder, you will need to
|
||||
# change the following line to match the subfolder you need.
|
||||
# http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
|
||||
# RewriteBase /
|
||||
|
||||
# Redirect Trailing Slashes...
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.*)/$ /$1 [L,R=301]
|
||||
|
||||
# Rewrite "www.example.com -> example.com"
|
||||
RewriteCond %{HTTPS} !=on
|
||||
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
|
||||
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
|
||||
|
||||
# Checks to see if the user is attempting to access a valid file,
|
||||
# such as an image or css document, if this isn't true it sends the
|
||||
# request to the front controller, index.php
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA]
|
||||
|
||||
# Ensure Authorization header is passed along
|
||||
RewriteCond %{HTTP:Authorization} .
|
||||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
||||
</IfModule>
|
||||
|
||||
<IfModule !mod_rewrite.c>
|
||||
# If we don't have mod_rewrite installed, all 404's
|
||||
# can be sent to index.php, and everything works as normal.
|
||||
ErrorDocument 404 index.php
|
||||
</IfModule>
|
||||
|
||||
# Disable server signature start
|
||||
ServerSignature Off
|
||||
# Disable server signature end
|
||||
64
README.md
Normal file
64
README.md
Normal file
@ -0,0 +1,64 @@
|
||||
# CodeIgniter 4 Application Starter
|
||||
|
||||
## What is CodeIgniter?
|
||||
|
||||
CodeIgniter is a PHP full-stack web framework that is light, fast, flexible, and secure.
|
||||
More information can be found at the [official site](http://codeigniter.com).
|
||||
|
||||
This repository holds a composer-installable app starter.
|
||||
It has been built from the
|
||||
[development repository](https://github.com/codeigniter4/CodeIgniter4).
|
||||
|
||||
More information about the plans for version 4 can be found in [the announcement](http://forum.codeigniter.com/thread-62615.html) on the forums.
|
||||
|
||||
The user guide corresponding to this version of the framework can be found
|
||||
[here](https://codeigniter4.github.io/userguide/).
|
||||
|
||||
## Installation & updates
|
||||
|
||||
`composer create-project codeigniter4/appstarter` then `composer update` whenever
|
||||
there is a new release of the framework.
|
||||
|
||||
When updating, check the release notes to see if there are any changes you might need to apply
|
||||
to your `app` folder. The affected files can be copied or merged from
|
||||
`vendor/codeigniter4/framework/app`.
|
||||
|
||||
## Setup
|
||||
|
||||
Copy `env` to `.env` and tailor for your app, specifically the baseURL
|
||||
and any database settings.
|
||||
|
||||
## Important Change with index.php
|
||||
|
||||
`index.php` is no longer in the root of the project! It has been moved inside the *public* folder,
|
||||
for better security and separation of components.
|
||||
|
||||
This means that you should configure your web server to "point" to your project's *public* folder, and
|
||||
not to the project root. A better practice would be to configure a virtual host to point there. A poor practice would be to point your web server to the project root and expect to enter *public/...*, as the rest of your logic and the
|
||||
framework are exposed.
|
||||
|
||||
**Please** read the user guide for a better explanation of how CI4 works!
|
||||
The user guide updating and deployment is a bit awkward at the moment, but we are working on it!
|
||||
|
||||
## Repository Management
|
||||
|
||||
We use Github issues, in our main repository, to track **BUGS** and to track approved **DEVELOPMENT** work packages.
|
||||
We use our [forum](http://forum.codeigniter.com) to provide SUPPORT and to discuss
|
||||
FEATURE REQUESTS.
|
||||
|
||||
This repository is a "distribution" one, built by our release preparation script.
|
||||
Problems with it can be raised on our forum, or as issues in the main repository.
|
||||
|
||||
## Server Requirements
|
||||
|
||||
PHP version 7.2 or higher is required, with the following extensions installed:
|
||||
|
||||
- [intl](http://php.net/manual/en/intl.requirements.php)
|
||||
- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library
|
||||
|
||||
Additionally, make sure that the following extensions are enabled in your PHP:
|
||||
|
||||
- json (enabled by default - don't turn it off)
|
||||
- [mbstring](http://php.net/manual/en/mbstring.installation.php)
|
||||
- [mysqlnd](http://php.net/manual/en/mysqlnd.install.php)
|
||||
- xml (enabled by default - don't turn it off)
|
||||
6
app/.htaccess
Normal file
6
app/.htaccess
Normal file
@ -0,0 +1,6 @@
|
||||
<IfModule authz_core_module>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
<IfModule !authz_core_module>
|
||||
Deny from all
|
||||
</IfModule>
|
||||
15
app/Common.php
Normal file
15
app/Common.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The goal of this file is to allow developers a location
|
||||
* where they can overwrite core procedural functions and
|
||||
* replace them with their own. This file is loaded during
|
||||
* the bootstrap process and is called during the frameworks
|
||||
* execution.
|
||||
*
|
||||
* This can be looked at as a `master helper` file that is
|
||||
* loaded early on, and may also contain additional functions
|
||||
* that you'd like to use throughout your entire application
|
||||
*
|
||||
* @link: https://codeigniter4.github.io/CodeIgniter4/
|
||||
*/
|
||||
270
app/Config/App.php
Normal file
270
app/Config/App.php
Normal file
@ -0,0 +1,270 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
class App extends BaseConfig
|
||||
{
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Base Site URL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| URL to your CodeIgniter root. Typically this will be your base URL,
|
||||
| WITH a trailing slash:
|
||||
|
|
||||
| http://example.com/
|
||||
|
|
||||
| If this is not set then CodeIgniter will try guess the protocol, domain
|
||||
| and path to your installation. However, you should always configure this
|
||||
| explicitly and never rely on auto-guessing, especially in production
|
||||
| environments.
|
||||
|
|
||||
*/
|
||||
|
||||
public $baseURL = 'http://localhost/donation/';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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.
|
||||
|
|
||||
*/
|
||||
public $indexPage = 'index.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| URI PROTOCOL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This item determines which getServer 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!
|
||||
*/
|
||||
public $uriProtocol = 'PATH_INFO';
|
||||
// public $uriProtocol = 'REQUEST_URI';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Locale
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The Locale roughly represents the language and location that your visitor
|
||||
| is viewing the site from. It affects the language strings and other
|
||||
| strings (like currency markers, numbers, etc), that your program
|
||||
| should run under for this request.
|
||||
|
|
||||
*/
|
||||
public $defaultLocale = 'en';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Negotiate Locale
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If true, the current Request object will automatically determine the
|
||||
| language to use based on the value of the Accept-Language header.
|
||||
|
|
||||
| If false, no automatic detection will be performed.
|
||||
|
|
||||
*/
|
||||
public $negotiateLocale = false;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Supported Locales
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If $negotiateLocale is true, this array lists the locales supported
|
||||
| by the application in descending order of priority. If no match is
|
||||
| found, the first locale will be used.
|
||||
|
|
||||
*/
|
||||
public $supportedLocales = ['en'];
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Timezone
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The default timezone that will be used in your application to display
|
||||
| dates with the date helper, and can be retrieved through app_timezone()
|
||||
|
|
||||
*/
|
||||
public $appTimezone = 'America/Chicago';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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.
|
||||
|
|
||||
*/
|
||||
public $charset = 'UTF-8';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| URI PROTOCOL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If true, this will force every request made to this application to be
|
||||
| made via a secure connection (HTTPS). If the incoming request is not
|
||||
| secure, the user will be redirected to a secure version of the page
|
||||
| and the HTTP Strict Transport Security header will be set.
|
||||
*/
|
||||
public $forceGlobalSecureRequests = false;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Variables
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| 'sessionDriver'
|
||||
|
|
||||
| The storage driver to use: files, database, redis, memcached
|
||||
| - CodeIgniter\Session\Handlers\FileHandler
|
||||
| - CodeIgniter\Session\Handlers\DatabaseHandler
|
||||
| - CodeIgniter\Session\Handlers\MemcachedHandler
|
||||
| - CodeIgniter\Session\Handlers\RedisHandler
|
||||
|
|
||||
| 'sessionCookieName'
|
||||
|
|
||||
| The session cookie name, must contain only [0-9a-z_-] characters
|
||||
|
|
||||
| 'sessionExpiration'
|
||||
|
|
||||
| The number of SECONDS you want the session to last.
|
||||
| Setting to 0 (zero) means expire when the browser is closed.
|
||||
|
|
||||
| 'sessionSavePath'
|
||||
|
|
||||
| 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!
|
||||
|
|
||||
| 'sessionMatchIP'
|
||||
|
|
||||
| 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.
|
||||
|
|
||||
| 'sessionTimeToUpdate'
|
||||
|
|
||||
| How many seconds between CI regenerating the session ID.
|
||||
|
|
||||
| 'sessionRegenerateDestroy'
|
||||
|
|
||||
| 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.
|
||||
|
|
||||
*/
|
||||
public $sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler';
|
||||
public $sessionCookieName = 'ci_session';
|
||||
public $sessionExpiration = 7200;
|
||||
public $sessionSavePath = WRITEPATH . 'session';
|
||||
public $sessionMatchIP = false;
|
||||
public $sessionTimeToUpdate = 300;
|
||||
public $sessionRegenerateDestroy = false;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cookie Related Variables
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| 'cookiePrefix' = Set a cookie name prefix if you need to avoid collisions
|
||||
| 'cookieDomain' = Set to .your-domain.com for site-wide cookies
|
||||
| 'cookiePath' = Typically will be a forward slash
|
||||
| 'cookieSecure' = Cookie will only be set if a secure HTTPS connection exists.
|
||||
| 'cookieHTTPOnly' = Cookie will only be accessible via HTTP(S) (no javascript)
|
||||
|
|
||||
| Note: These settings (with the exception of 'cookie_prefix' and
|
||||
| 'cookie_httponly') will also affect sessions.
|
||||
|
|
||||
*/
|
||||
public $cookiePrefix = '';
|
||||
public $cookieDomain = '';
|
||||
public $cookiePath = '/';
|
||||
public $cookieSecure = false;
|
||||
public $cookieHTTPOnly = 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')
|
||||
*/
|
||||
public $proxyIPs = '';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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.
|
||||
|
|
||||
| CSRFTokenName = The token name
|
||||
| CSRFHeaderName = The header name
|
||||
| CSRFCookieName = The cookie name
|
||||
| CSRFExpire = The number in seconds the token should expire.
|
||||
| CSRFRegenerate = Regenerate token on every submission
|
||||
| CSRFRedirect = Redirect to previous page with error on failure
|
||||
*/
|
||||
public $CSRFTokenName = 'csrf_test_name';
|
||||
public $CSRFHeaderName = 'X-CSRF-TOKEN';
|
||||
public $CSRFCookieName = 'csrf_cookie_name';
|
||||
public $CSRFExpire = 7200;
|
||||
public $CSRFRegenerate = true;
|
||||
public $CSRFRedirect = true;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Content Security Policy
|
||||
|--------------------------------------------------------------------------
|
||||
| Enables the Response's Content Secure Policy to restrict the sources that
|
||||
| can be used for images, scripts, CSS files, audio, video, etc. If enabled,
|
||||
| the Response object will populate default values for the policy from the
|
||||
| ContentSecurityPolicy.php file. Controllers can always add to those
|
||||
| restrictions at run time.
|
||||
|
|
||||
| For a better understanding of CSP, see these documents:
|
||||
| - http://www.html5rocks.com/en/tutorials/security/content-security-policy/
|
||||
| - http://www.w3.org/TR/CSP/
|
||||
*/
|
||||
public $CSPEnabled = false;
|
||||
}
|
||||
68
app/Config/Autoload.php
Normal file
68
app/Config/Autoload.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Config;
|
||||
|
||||
use CodeIgniter\Config\AutoloadConfig;
|
||||
|
||||
/**
|
||||
* -------------------------------------------------------------------
|
||||
* AUTO-LOADER
|
||||
* -------------------------------------------------------------------
|
||||
* This file defines the namespaces and class maps so the Autoloader
|
||||
* can find the files as needed.
|
||||
*
|
||||
* NOTE: If you use an identical key in $psr4 or $classmap, then
|
||||
* the values in this file will overwrite the framework's values.
|
||||
*/
|
||||
class Autoload extends AutoloadConfig
|
||||
{
|
||||
|
||||
/**
|
||||
* -------------------------------------------------------------------
|
||||
* Namespaces
|
||||
* -------------------------------------------------------------------
|
||||
* This maps the locations of any namespaces in your application to
|
||||
* their location on the file system. These are used by the autoloader
|
||||
* to locate files the first time they have been instantiated.
|
||||
*
|
||||
* The '/app' and '/system' directories are already mapped for you.
|
||||
* you may change the name of the 'App' namespace if you wish,
|
||||
* but this should be done prior to creating any namespaced classes,
|
||||
* else you will need to modify all of those classes for this to work.
|
||||
*
|
||||
* Prototype:
|
||||
*
|
||||
* $psr4 = [
|
||||
* 'CodeIgniter' => SYSTEMPATH,
|
||||
* 'App' => APPPATH
|
||||
* ];
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $psr4 = [
|
||||
APP_NAMESPACE => APPPATH, // For custom app namespace
|
||||
'Config' => APPPATH . 'Config',
|
||||
'Dompdf' => APPPATH . 'ThirdParty/dompdf/src',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* -------------------------------------------------------------------
|
||||
* Class Map
|
||||
* -------------------------------------------------------------------
|
||||
* The class map provides a map of class names and their exact
|
||||
* location on the drive. Classes loaded in this manner will have
|
||||
* slightly faster performance because they will not have to be
|
||||
* searched for within one or more directories as they would if they
|
||||
* were being autoloaded through a namespace.
|
||||
*
|
||||
* Prototype:
|
||||
*
|
||||
* $classmap = [
|
||||
* 'MyClass' => '/path/to/class/file.php'
|
||||
* ];
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $classmap = [];
|
||||
}
|
||||
32
app/Config/Boot/development.php
Normal file
32
app/Config/Boot/development.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| ERROR DISPLAY
|
||||
|--------------------------------------------------------------------------
|
||||
| In development, we want to show as many errors as possible to help
|
||||
| make sure they don't make it to production. And save us hours of
|
||||
| painful debugging.
|
||||
*/
|
||||
error_reporting(-1);
|
||||
ini_set('display_errors', '1');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DEBUG BACKTRACES
|
||||
|--------------------------------------------------------------------------
|
||||
| If true, this constant will tell the error screens to display debug
|
||||
| backtraces along with the other error information. If you would
|
||||
| prefer to not see this, set this value to false.
|
||||
*/
|
||||
defined('SHOW_DEBUG_BACKTRACE') || define('SHOW_DEBUG_BACKTRACE', true);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DEBUG MODE
|
||||
|--------------------------------------------------------------------------
|
||||
| Debug mode is an experimental flag that can allow changes throughout
|
||||
| the system. This will control whether Kint is loaded, and a few other
|
||||
| items. It can always be used within your own application too.
|
||||
*/
|
||||
|
||||
defined('CI_DEBUG') || define('CI_DEBUG', true);
|
||||
22
app/Config/Boot/production.php
Normal file
22
app/Config/Boot/production.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| ERROR DISPLAY
|
||||
|--------------------------------------------------------------------------
|
||||
| Don't show ANY in production environments. Instead, let the system catch
|
||||
| it and display a generic error message.
|
||||
*/
|
||||
ini_set('display_errors', '0');
|
||||
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DEBUG MODE
|
||||
|--------------------------------------------------------------------------
|
||||
| Debug mode is an experimental flag that can allow changes throughout
|
||||
| the system. It's not widely used currently, and may not survive
|
||||
| release of the framework.
|
||||
*/
|
||||
|
||||
defined('CI_DEBUG') || define('CI_DEBUG', false);
|
||||
33
app/Config/Boot/testing.php
Normal file
33
app/Config/Boot/testing.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| ERROR DISPLAY
|
||||
|--------------------------------------------------------------------------
|
||||
| In development, we want to show as many errors as possible to help
|
||||
| make sure they don't make it to production. And save us hours of
|
||||
| painful debugging.
|
||||
*/
|
||||
error_reporting(-1);
|
||||
ini_set('display_errors', '1');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DEBUG BACKTRACES
|
||||
|--------------------------------------------------------------------------
|
||||
| If true, this constant will tell the error screens to display debug
|
||||
| backtraces along with the other error information. If you would
|
||||
| prefer to not see this, set this value to false.
|
||||
*/
|
||||
defined('SHOW_DEBUG_BACKTRACE') || define('SHOW_DEBUG_BACKTRACE', true);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DEBUG MODE
|
||||
|--------------------------------------------------------------------------
|
||||
| Debug mode is an experimental flag that can allow changes throughout
|
||||
| the system. It's not widely used currently, and may not survive
|
||||
| release of the framework.
|
||||
*/
|
||||
|
||||
defined('CI_DEBUG') || define('CI_DEBUG', true);
|
||||
120
app/Config/Cache.php
Normal file
120
app/Config/Cache.php
Normal file
@ -0,0 +1,120 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
class Cache extends BaseConfig
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Primary Handler
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The name of the preferred handler that should be used. If for some reason
|
||||
| it is not available, the $backupHandler will be used in its place.
|
||||
|
|
||||
*/
|
||||
public $handler = 'file';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Backup Handler
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The name of the handler that will be used in case the first one is
|
||||
| unreachable. Often, 'file' is used here since the filesystem is
|
||||
| always available, though that's not always practical for the app.
|
||||
|
|
||||
*/
|
||||
public $backupHandler = 'dummy';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Directory Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The path to where cache files should be stored, if using a file-based
|
||||
| system.
|
||||
|
|
||||
*/
|
||||
public $storePath = WRITEPATH . 'cache/';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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.
|
||||
|
|
||||
*/
|
||||
public $cacheQueryString = false;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Key Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This string is added to all cache item names to help avoid collisions
|
||||
| if you run multiple applications with the same cache engine.
|
||||
|
|
||||
*/
|
||||
public $prefix = '';
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------------
|
||||
| Memcached settings
|
||||
| -------------------------------------------------------------------------
|
||||
| Your Memcached servers can be specified below, if you are using
|
||||
| the Memcached drivers.
|
||||
|
|
||||
| See: https://codeigniter.com/user_guide/libraries/caching.html#memcached
|
||||
|
|
||||
*/
|
||||
public $memcached = [
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 11211,
|
||||
'weight' => 1,
|
||||
'raw' => false,
|
||||
];
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------------
|
||||
| Redis settings
|
||||
| -------------------------------------------------------------------------
|
||||
| Your Redis server can be specified below, if you are using
|
||||
| the Redis or Predis drivers.
|
||||
|
|
||||
*/
|
||||
public $redis = [
|
||||
'host' => '127.0.0.1',
|
||||
'password' => null,
|
||||
'port' => 6379,
|
||||
'timeout' => 0,
|
||||
'database' => 0,
|
||||
];
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Available Cache Handlers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is an array of cache engine alias' and class names. Only engines
|
||||
| that are listed here are allowed to be used.
|
||||
|
|
||||
*/
|
||||
public $validHandlers = [
|
||||
'dummy' => \CodeIgniter\Cache\Handlers\DummyHandler::class,
|
||||
'file' => \CodeIgniter\Cache\Handlers\FileHandler::class,
|
||||
'memcached' => \CodeIgniter\Cache\Handlers\MemcachedHandler::class,
|
||||
'predis' => \CodeIgniter\Cache\Handlers\PredisHandler::class,
|
||||
'redis' => \CodeIgniter\Cache\Handlers\RedisHandler::class,
|
||||
'wincache' => \CodeIgniter\Cache\Handlers\WincacheHandler::class,
|
||||
];
|
||||
}
|
||||
77
app/Config/Constants.php
Normal file
77
app/Config/Constants.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// App Namespace
|
||||
//--------------------------------------------------------------------
|
||||
// This defines the default Namespace that is used throughout
|
||||
// CodeIgniter to refer to the Application directory. Change
|
||||
// this constant to change the namespace that all application
|
||||
// classes should use.
|
||||
//
|
||||
// NOTE: changing this will require manually modifying the
|
||||
// existing namespaces of App\* namespaced-classes.
|
||||
//
|
||||
defined('APP_NAMESPACE') || define('APP_NAMESPACE', 'App');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Composer Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The path that Composer's autoload file is expected to live. By default,
|
||||
| the vendor folder is in the Root directory, but you can customize that here.
|
||||
*/
|
||||
defined('COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . 'vendor/autoload.php');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Timing Constants
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Provide simple ways to work with the myriad of PHP functions that
|
||||
| require information to be in seconds.
|
||||
*/
|
||||
defined('SECOND') || define('SECOND', 1);
|
||||
defined('MINUTE') || define('MINUTE', 60);
|
||||
defined('HOUR') || define('HOUR', 3600);
|
||||
defined('DAY') || define('DAY', 86400);
|
||||
defined('WEEK') || define('WEEK', 604800);
|
||||
defined('MONTH') || define('MONTH', 2592000);
|
||||
defined('YEAR') || define('YEAR', 31536000);
|
||||
defined('DECADE') || define('DECADE', 315360000);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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') || define('EXIT_SUCCESS', 0); // no errors
|
||||
defined('EXIT_ERROR') || define('EXIT_ERROR', 1); // generic error
|
||||
defined('EXIT_CONFIG') || define('EXIT_CONFIG', 3); // configuration error
|
||||
defined('EXIT_UNKNOWN_FILE') || define('EXIT_UNKNOWN_FILE', 4); // file not found
|
||||
defined('EXIT_UNKNOWN_CLASS') || define('EXIT_UNKNOWN_CLASS', 5); // unknown class
|
||||
defined('EXIT_UNKNOWN_METHOD') || define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
|
||||
defined('EXIT_USER_INPUT') || define('EXIT_USER_INPUT', 7); // invalid user input
|
||||
defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // database error
|
||||
defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
|
||||
defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
|
||||
48
app/Config/ContentSecurityPolicy.php
Normal file
48
app/Config/ContentSecurityPolicy.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
/**
|
||||
* Class ContentSecurityPolicyConfig
|
||||
*
|
||||
* Stores the default settings for the ContentSecurityPolicy, if you
|
||||
* choose to use it. The values here will be read in and set as defaults
|
||||
* for the site. If needed, they can be overridden on a page-by-page basis.
|
||||
*
|
||||
* Suggested reference for explanations:
|
||||
* https://www.html5rocks.com/en/tutorials/security/content-security-policy/
|
||||
*
|
||||
* @package Config
|
||||
*/
|
||||
class ContentSecurityPolicy extends BaseConfig
|
||||
{
|
||||
// broadbrush CSP management
|
||||
|
||||
public $reportOnly = false; // default CSP report context
|
||||
public $reportURI = null; // URL to send violation reports to
|
||||
public $upgradeInsecureRequests = false; // toggle for forcing https
|
||||
|
||||
// sources allowed; string or array of strings
|
||||
// Note: once you set a policy to 'none', it cannot be further restricted
|
||||
|
||||
public $defaultSrc = null; // will default to self if not over-ridden
|
||||
public $scriptSrc = 'self';
|
||||
public $styleSrc = 'self';
|
||||
public $imageSrc = 'self';
|
||||
public $baseURI = null; // will default to self if not over-ridden
|
||||
public $childSrc = 'self';
|
||||
public $connectSrc = 'self';
|
||||
public $fontSrc = null;
|
||||
public $formAction = 'self';
|
||||
public $frameAncestors = null;
|
||||
public $mediaSrc = null;
|
||||
public $objectSrc = 'self';
|
||||
public $manifestSrc = null;
|
||||
|
||||
// mime types allowed; string or array of strings
|
||||
public $pluginTypes = null;
|
||||
|
||||
// list of actions allowed; string or array of strings
|
||||
public $sandbox = null;
|
||||
|
||||
}
|
||||
114
app/Config/Database.php
Normal file
114
app/Config/Database.php
Normal file
@ -0,0 +1,114 @@
|
||||
<?php namespace Config;
|
||||
|
||||
/**
|
||||
* Database Configuration
|
||||
*
|
||||
* @package Config
|
||||
*/
|
||||
|
||||
class Database extends \CodeIgniter\Database\Config
|
||||
{
|
||||
/**
|
||||
* The directory that holds the Migrations
|
||||
* and Seeds directories.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $filesPath = APPPATH . 'Database/';
|
||||
|
||||
/**
|
||||
* Lets you choose which connection group to
|
||||
* use if no other is specified.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $defaultGroup = 'default';
|
||||
|
||||
/**
|
||||
* The default database connection.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $default = [
|
||||
'DSN' => '',
|
||||
'hostname' => 'localhost',
|
||||
'username' => '',
|
||||
'password' => '',
|
||||
'database' => '',
|
||||
'DBDriver' => 'MySQLi',
|
||||
'DBPrefix' => '',
|
||||
'pConnect' => false,
|
||||
'DBDebug' => (ENVIRONMENT !== 'production'),
|
||||
'cacheOn' => false,
|
||||
'cacheDir' => '',
|
||||
'charset' => 'utf8',
|
||||
'DBCollat' => 'utf8_general_ci',
|
||||
'swapPre' => '',
|
||||
'encrypt' => false,
|
||||
'compress' => false,
|
||||
'strictOn' => false,
|
||||
'failover' => [],
|
||||
'port' => 3306,
|
||||
];
|
||||
|
||||
/**
|
||||
* This database connection is used when
|
||||
* running PHPUnit database tests.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $tests = [
|
||||
'DSN' => '',
|
||||
'hostname' => '127.0.0.1',
|
||||
'username' => '',
|
||||
'password' => '',
|
||||
'database' => ':memory:',
|
||||
'DBDriver' => 'SQLite3',
|
||||
'DBPrefix' => 'db_', // Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE FOR CI DEVS
|
||||
'pConnect' => false,
|
||||
'DBDebug' => (ENVIRONMENT !== 'production'),
|
||||
'cacheOn' => false,
|
||||
'cacheDir' => '',
|
||||
'charset' => 'utf8',
|
||||
'DBCollat' => 'utf8_general_ci',
|
||||
'swapPre' => '',
|
||||
'encrypt' => false,
|
||||
'compress' => false,
|
||||
'strictOn' => false,
|
||||
'failover' => [],
|
||||
'port' => 3306,
|
||||
];
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Ensure that we always set the database group to 'tests' if
|
||||
// we are currently running an automated test suite, so that
|
||||
// we don't overwrite live data on accident.
|
||||
if (ENVIRONMENT === 'testing')
|
||||
{
|
||||
$this->defaultGroup = 'tests';
|
||||
|
||||
// Under Travis-CI, we can set an ENV var named 'DB_GROUP'
|
||||
// so that we can test against multiple databases.
|
||||
if ($group = getenv('DB'))
|
||||
{
|
||||
if (is_file(TESTPATH . 'travis/Database.php'))
|
||||
{
|
||||
require TESTPATH . 'travis/Database.php';
|
||||
|
||||
if (! empty($dbconfig) && array_key_exists($group, $dbconfig))
|
||||
{
|
||||
$this->tests = $dbconfig[$group];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
}
|
||||
33
app/Config/DocTypes.php
Normal file
33
app/Config/DocTypes.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php namespace Config;
|
||||
|
||||
/**
|
||||
* DocTypes
|
||||
*
|
||||
* @package Config
|
||||
*/
|
||||
|
||||
class DocTypes
|
||||
{
|
||||
public $list =
|
||||
[
|
||||
'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">',
|
||||
];
|
||||
}
|
||||
171
app/Config/Email.php
Normal file
171
app/Config/Email.php
Normal file
@ -0,0 +1,171 @@
|
||||
<?php
|
||||
namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
class Email extends BaseConfig
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $fromEmail;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $fromName;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $recipients;
|
||||
|
||||
/**
|
||||
* The "user agent"
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $userAgent = 'CodeIgniter';
|
||||
|
||||
/**
|
||||
* The mail sending protocol: mail, sendmail, smtp
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $protocol = 'mail';
|
||||
|
||||
/**
|
||||
* The server path to Sendmail.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $mailPath = '/usr/sbin/sendmail';
|
||||
|
||||
/**
|
||||
* SMTP Server Address
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $SMTPHost;
|
||||
|
||||
/**
|
||||
* SMTP Username
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $SMTPUser;
|
||||
|
||||
/**
|
||||
* SMTP Password
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $SMTPPass;
|
||||
|
||||
/**
|
||||
* SMTP Port
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $SMTPPort = 25;
|
||||
|
||||
/**
|
||||
* SMTP Timeout (in seconds)
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $SMTPTimeout = 5;
|
||||
|
||||
/**
|
||||
* Enable persistent SMTP connections
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $SMTPKeepAlive = false;
|
||||
|
||||
/**
|
||||
* SMTP Encryption. Either tls or ssl
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $SMTPCrypto = 'tls';
|
||||
|
||||
/**
|
||||
* Enable word-wrap
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $wordWrap = true;
|
||||
|
||||
/**
|
||||
* Character count to wrap at
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $wrapChars = 76;
|
||||
|
||||
/**
|
||||
* Type of mail, either 'text' or 'html'
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $mailType = 'text';
|
||||
|
||||
/**
|
||||
* Character set (utf-8, iso-8859-1, etc.)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $charset = 'UTF-8';
|
||||
|
||||
/**
|
||||
* Whether to validate the email address
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $validate = false;
|
||||
|
||||
/**
|
||||
* Email Priority. 1 = highest. 5 = lowest. 3 = normal
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $priority = 3;
|
||||
|
||||
/**
|
||||
* Newline character. (Use “\r\n” to comply with RFC 822)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $CRLF = "\r\n";
|
||||
|
||||
/**
|
||||
* Newline character. (Use “\r\n” to comply with RFC 822)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $newline = "\r\n";
|
||||
|
||||
/**
|
||||
* Enable BCC Batch Mode.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $BCCBatchMode = false;
|
||||
|
||||
/**
|
||||
* Number of emails in each BCC batch
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $BCCBatchSize = 200;
|
||||
|
||||
/**
|
||||
* Enable notify message from server
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $DSN = false;
|
||||
|
||||
}
|
||||
36
app/Config/Encryption.php
Normal file
36
app/Config/Encryption.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
/**
|
||||
* Encryption configuration.
|
||||
*
|
||||
* These are the settings used for encryption, if you don't pass a parameter
|
||||
* array to the encrypter for creation/initialization.
|
||||
*/
|
||||
class Encryption extends BaseConfig
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption Key Starter
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If you use the Encryption class you must set an encryption key (seed).
|
||||
| You need to ensure it is long enough for the cipher and mode you plan to use.
|
||||
| See the user guide for more info.
|
||||
*/
|
||||
|
||||
public $key = '';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption driver to use
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| One of the supported drivers, eg 'OpenSSL' or 'Sodium'.
|
||||
| The default driver, if you don't specify one, is 'OpenSSL'.
|
||||
*/
|
||||
public $driver = 'OpenSSL';
|
||||
|
||||
}
|
||||
52
app/Config/Events.php
Normal file
52
app/Config/Events.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Events\Events;
|
||||
use CodeIgniter\Exceptions\FrameworkException;
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------
|
||||
* Application Events
|
||||
* --------------------------------------------------------------------
|
||||
* Events allow you to tap into the execution of the program without
|
||||
* modifying or extending core files. This file provides a central
|
||||
* location to define your events, though they can always be added
|
||||
* at run-time, also, if needed.
|
||||
*
|
||||
* You create code that can execute by subscribing to events with
|
||||
* the 'on()' method. This accepts any form of callable, including
|
||||
* Closures, that will be executed when the event is triggered.
|
||||
*
|
||||
* Example:
|
||||
* Events::on('create', [$myInstance, 'myMethod']);
|
||||
*/
|
||||
|
||||
Events::on('pre_system', function () {
|
||||
if (ENVIRONMENT !== 'testing')
|
||||
{
|
||||
if (ini_get('zlib.output_compression'))
|
||||
{
|
||||
throw FrameworkException::forEnabledZlibOutputCompression();
|
||||
}
|
||||
|
||||
while (ob_get_level() > 0)
|
||||
{
|
||||
ob_end_flush();
|
||||
}
|
||||
|
||||
ob_start(function ($buffer) {
|
||||
return $buffer;
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------
|
||||
* Debug Toolbar Listeners.
|
||||
* --------------------------------------------------------------------
|
||||
* If you delete, they will no longer be collected.
|
||||
*/
|
||||
if (ENVIRONMENT !== 'production')
|
||||
{
|
||||
Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');
|
||||
Services::toolbar()->respond();
|
||||
}
|
||||
});
|
||||
42
app/Config/Exceptions.php
Normal file
42
app/Config/Exceptions.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
/**
|
||||
* Setup how the exception handler works.
|
||||
*
|
||||
* @package Config
|
||||
*/
|
||||
class Exceptions extends BaseConfig
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| LOG EXCEPTIONS?
|
||||
|--------------------------------------------------------------------------
|
||||
| If true, then exceptions will be logged
|
||||
| through Services::Log.
|
||||
|
|
||||
| Default: true
|
||||
*/
|
||||
public $log = true;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DO NOT LOG STATUS CODES
|
||||
|--------------------------------------------------------------------------
|
||||
| Any status codes here will NOT be logged if logging is turned on.
|
||||
| By default, only 404 (Page Not Found) exceptions are ignored.
|
||||
*/
|
||||
public $ignoreCodes = [ 404 ];
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Error Views Path
|
||||
|--------------------------------------------------------------------------
|
||||
| This is the path to the directory that contains the 'cli' and 'html'
|
||||
| directories that hold the views used to generate errors.
|
||||
|
|
||||
| Default: APPPATH.'Views/errors'
|
||||
*/
|
||||
public $errorViewPath = APPPATH . 'Views/errors';
|
||||
}
|
||||
36
app/Config/Filters.php
Normal file
36
app/Config/Filters.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
class Filters extends BaseConfig
|
||||
{
|
||||
// Makes reading things below nicer,
|
||||
// and simpler to change out script that's used.
|
||||
public $aliases = [
|
||||
'csrf' => \CodeIgniter\Filters\CSRF::class,
|
||||
'toolbar' => \CodeIgniter\Filters\DebugToolbar::class,
|
||||
'honeypot' => \CodeIgniter\Filters\Honeypot::class,
|
||||
];
|
||||
|
||||
// Always applied before every request
|
||||
public $globals = [
|
||||
'before' => [
|
||||
//'honeypot'
|
||||
// 'csrf',
|
||||
],
|
||||
'after' => [
|
||||
'toolbar',
|
||||
//'honeypot'
|
||||
],
|
||||
];
|
||||
|
||||
// Works on all of a particular HTTP method
|
||||
// (GET, POST, etc) as BEFORE filters only
|
||||
// like: 'post' => ['CSRF', 'throttle'],
|
||||
public $methods = [];
|
||||
|
||||
// List filter aliases and any before/after uri patterns
|
||||
// that they should run on, like:
|
||||
// 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']],
|
||||
public $filters = [];
|
||||
}
|
||||
6
app/Config/ForeignCharacters.php
Normal file
6
app/Config/ForeignCharacters.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php namespace Config;
|
||||
|
||||
class ForeignCharacters extends \CodeIgniter\Config\ForeignCharacters
|
||||
{
|
||||
|
||||
}
|
||||
85
app/Config/Format.php
Normal file
85
app/Config/Format.php
Normal file
@ -0,0 +1,85 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
class Format extends BaseConfig
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Available Response Formats
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When you perform content negotiation with the request, these are the
|
||||
| available formats that your application supports. This is currently
|
||||
| only used with the API\ResponseTrait. A valid Formatter must exist
|
||||
| for the specified format.
|
||||
|
|
||||
| These formats are only checked when the data passed to the respond()
|
||||
| method is an array.
|
||||
|
|
||||
*/
|
||||
public $supportedResponseFormats = [
|
||||
'application/json',
|
||||
'application/xml', // machine-readable XML
|
||||
'text/xml', // human-readable XML
|
||||
];
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Formatters
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Lists the class to use to format responses with of a particular type.
|
||||
| For each mime type, list the class that should be used. Formatters
|
||||
| can be retrieved through the getFormatter() method.
|
||||
|
|
||||
*/
|
||||
public $formatters = [
|
||||
'application/json' => \CodeIgniter\Format\JSONFormatter::class,
|
||||
'application/xml' => \CodeIgniter\Format\XMLFormatter::class,
|
||||
'text/xml' => \CodeIgniter\Format\XMLFormatter::class,
|
||||
];
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Formatters Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Additional Options to adjust default formatters behaviour.
|
||||
| For each mime type, list the additional options that should be used.
|
||||
|
|
||||
*/
|
||||
public $formatterOptions = [
|
||||
'application/json' => JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES,
|
||||
'application/xml' => 0,
|
||||
'text/xml' => 0,
|
||||
];
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* A Factory method to return the appropriate formatter for the given mime type.
|
||||
*
|
||||
* @param string $mime
|
||||
*
|
||||
* @return \CodeIgniter\Format\FormatterInterface
|
||||
*/
|
||||
public function getFormatter(string $mime)
|
||||
{
|
||||
if (! array_key_exists($mime, $this->formatters))
|
||||
{
|
||||
throw new \InvalidArgumentException('No Formatter defined for mime type: ' . $mime);
|
||||
}
|
||||
|
||||
$class = $this->formatters[$mime];
|
||||
|
||||
if (! class_exists($class))
|
||||
{
|
||||
throw new \BadMethodCallException($class . ' is not a valid Formatter.');
|
||||
}
|
||||
|
||||
return new $class();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
}
|
||||
42
app/Config/Honeypot.php
Normal file
42
app/Config/Honeypot.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
class Honeypot extends BaseConfig
|
||||
{
|
||||
|
||||
/**
|
||||
* Makes Honeypot visible or not to human
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $hidden = true;
|
||||
|
||||
/**
|
||||
* Honeypot Label Content
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $label = 'Fill This Field';
|
||||
|
||||
/**
|
||||
* Honeypot Field Name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name = 'honeypot';
|
||||
|
||||
/**
|
||||
* Honeypot HTML Template
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $template = '<label>{label}</label><input type="text" name="{name}" value=""/>';
|
||||
|
||||
/**
|
||||
* Honeypot container
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $container = '<div style="display:none">{template}</div>';
|
||||
}
|
||||
31
app/Config/Images.php
Normal file
31
app/Config/Images.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
class Images extends BaseConfig
|
||||
{
|
||||
/**
|
||||
* Default handler used if no other handler is specified.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $defaultHandler = 'gd';
|
||||
|
||||
/**
|
||||
* The path to the image library.
|
||||
* Required for ImageMagick, GraphicsMagick, or NetPBM.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $libraryPath = '/usr/local/bin/convert';
|
||||
|
||||
/**
|
||||
* The available handler classes.
|
||||
*
|
||||
* @var \CodeIgniter\Images\Handlers\BaseHandler[]
|
||||
*/
|
||||
public $handlers = [
|
||||
'gd' => \CodeIgniter\Images\Handlers\GDHandler::class,
|
||||
'imagick' => \CodeIgniter\Images\Handlers\ImageMagickHandler::class,
|
||||
];
|
||||
}
|
||||
62
app/Config/Kint.php
Normal file
62
app/Config/Kint.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
use Kint\Renderer\Renderer;
|
||||
|
||||
class Kint extends BaseConfig
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Kint
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| We use Kint's RichRenderer and CLIRenderer. This area contains options
|
||||
| that you can set to customize how Kint works for you.
|
||||
|
|
||||
| For details on these settings, see Kint's docs:
|
||||
| https://kint-php.github.io/kint/
|
||||
|
|
||||
*/
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global Settings
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public $plugins = null;
|
||||
|
||||
public $maxDepth = 6;
|
||||
|
||||
public $displayCalledFrom = true;
|
||||
|
||||
public $expanded = false;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| RichRenderer Settings
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
public $richTheme = 'aante-light.css';
|
||||
|
||||
public $richFolder = false;
|
||||
|
||||
public $richSort = Renderer::SORT_FULL;
|
||||
|
||||
public $richObjectPlugins = null;
|
||||
|
||||
public $richTabPlugins = null;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| CLI Settings
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
public $cliColors = true;
|
||||
|
||||
public $cliForceUTF8 = false;
|
||||
|
||||
public $cliDetectWidth = true;
|
||||
|
||||
public $cliMinWidth = 40;
|
||||
}
|
||||
132
app/Config/Logger.php
Normal file
132
app/Config/Logger.php
Normal file
@ -0,0 +1,132 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
class Logger extends BaseConfig
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Error Logging Threshold
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You can enable error logging by setting a threshold over zero. The
|
||||
| threshold determines what gets logged. Any values below or equal to the
|
||||
| threshold will be logged. Threshold options are:
|
||||
|
|
||||
| 0 = Disables logging, Error logging TURNED OFF
|
||||
| 1 = Emergency Messages - System is unusable
|
||||
| 2 = Alert Messages - Action Must Be Taken Immediately
|
||||
| 3 = Critical Messages - Application component unavailable, unexpected exception.
|
||||
| 4 = Runtime Errors - Don't need immediate action, but should be monitored.
|
||||
| 5 = Warnings - Exceptional occurrences that are not errors.
|
||||
| 6 = Notices - Normal but significant events.
|
||||
| 7 = Info - Interesting events, like user logging in, etc.
|
||||
| 8 = Debug - Detailed debug information.
|
||||
| 9 = All Messages
|
||||
|
|
||||
| You can also pass an array with threshold levels to show individual error types
|
||||
|
|
||||
| array(1, 2, 3, 8) = Emergency, Alert, Critical, and Debug messages
|
||||
|
|
||||
| For a live site you'll usually enable Critical or higher (3) to be logged otherwise
|
||||
| your log files will fill up very fast.
|
||||
|
|
||||
*/
|
||||
public $threshold = 3;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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
|
||||
|
|
||||
*/
|
||||
public $dateFormat = 'Y-m-d H:i:s';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Log Handlers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The logging system supports multiple actions to be taken when something
|
||||
| is logged. This is done by allowing for multiple Handlers, special classes
|
||||
| designed to write the log to their chosen destinations, whether that is
|
||||
| a file on the getServer, a cloud-based service, or even taking actions such
|
||||
| as emailing the dev team.
|
||||
|
|
||||
| Each handler is defined by the class name used for that handler, and it
|
||||
| MUST implement the CodeIgniter\Log\Handlers\HandlerInterface interface.
|
||||
|
|
||||
| The value of each key is an array of configuration items that are sent
|
||||
| to the constructor of each handler. The only required configuration item
|
||||
| is the 'handles' element, which must be an array of integer log levels.
|
||||
| This is most easily handled by using the constants defined in the
|
||||
| Psr\Log\LogLevel class.
|
||||
|
|
||||
| Handlers are executed in the order defined in this array, starting with
|
||||
| the handler on top and continuing down.
|
||||
|
|
||||
*/
|
||||
public $handlers = [
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// File Handler
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
'CodeIgniter\Log\Handlers\FileHandler' => [
|
||||
|
||||
/*
|
||||
* The log levels that this handler will handle.
|
||||
*/
|
||||
'handles' => [
|
||||
'critical',
|
||||
'alert',
|
||||
'emergency',
|
||||
'debug',
|
||||
'error',
|
||||
'info',
|
||||
'notice',
|
||||
'warning',
|
||||
],
|
||||
|
||||
/*
|
||||
* The default filename extension for log files.
|
||||
* An extension of '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 'log'.
|
||||
*/
|
||||
'fileExtension' => '',
|
||||
|
||||
/*
|
||||
* 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.)
|
||||
*/
|
||||
'filePermissions' => 0644,
|
||||
|
||||
/*
|
||||
* Logging Directory Path
|
||||
*
|
||||
* By default, logs are written to WRITEPATH . 'logs/'
|
||||
* Specify a different destination here, if desired.
|
||||
*/
|
||||
'path' => '',
|
||||
],
|
||||
|
||||
/**
|
||||
* The ChromeLoggerHandler requires the use of the Chrome web browser
|
||||
* and the ChromeLogger extension. Uncomment this block to use it.
|
||||
*/
|
||||
// 'CodeIgniter\Log\Handlers\ChromeLoggerHandler' => [
|
||||
// /*
|
||||
// * The log levels that this handler will handle.
|
||||
// */
|
||||
// 'handles' => ['critical', 'alert', 'emergency', 'debug',
|
||||
// 'error', 'info', 'notice', 'warning'],
|
||||
// ]
|
||||
];
|
||||
}
|
||||
50
app/Config/Migrations.php
Normal file
50
app/Config/Migrations.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
class Migrations extends BaseConfig
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable/Disable Migrations
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Migrations are enabled 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.
|
||||
|
|
||||
*/
|
||||
public $enabled = true;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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.
|
||||
|
|
||||
*/
|
||||
public $table = 'migrations';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Timestamp Format
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the format that will be used when creating new migrations
|
||||
| using the cli command:
|
||||
| > php spark migrate:create
|
||||
|
|
||||
| Typical formats:
|
||||
| YmdHis_
|
||||
| Y-m-d-His_
|
||||
| Y_m_d_His_
|
||||
|
|
||||
*/
|
||||
public $timestampFormat = 'Y-m-d-His_';
|
||||
|
||||
}
|
||||
530
app/Config/Mimes.php
Normal file
530
app/Config/Mimes.php
Normal file
@ -0,0 +1,530 @@
|
||||
<?php namespace Config;
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
| MIME TYPES
|
||||
| -------------------------------------------------------------------
|
||||
| This file contains an array of mime types. It is used by the
|
||||
| Upload class to help identify allowed file types.
|
||||
|
|
||||
| When more than one variation for an extension exist (like jpg, jpeg, etc)
|
||||
| the most common one should be first in the array to aid the guess*
|
||||
| methods. The same applies when more than one mime-type exists for a
|
||||
| single extension.
|
||||
|
|
||||
*/
|
||||
class Mimes
|
||||
{
|
||||
/**
|
||||
* Map of extensions to mime types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $mimes = [
|
||||
'hqx' => [
|
||||
'application/mac-binhex40',
|
||||
'application/mac-binhex',
|
||||
'application/x-binhex40',
|
||||
'application/x-mac-binhex40',
|
||||
],
|
||||
'cpt' => 'application/mac-compactpro',
|
||||
'csv' => [
|
||||
'text/csv',
|
||||
'text/x-comma-separated-values',
|
||||
'text/comma-separated-values',
|
||||
'application/octet-stream',
|
||||
'application/vnd.ms-excel',
|
||||
'application/x-csv',
|
||||
'text/x-csv',
|
||||
'application/csv',
|
||||
'application/excel',
|
||||
'application/vnd.msexcel',
|
||||
'text/plain',
|
||||
],
|
||||
'bin' => [
|
||||
'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' => [
|
||||
'application/octet-stream',
|
||||
'application/x-msdownload',
|
||||
],
|
||||
'class' => 'application/octet-stream',
|
||||
'psd' => [
|
||||
'application/x-photoshop',
|
||||
'image/vnd.adobe.photoshop',
|
||||
],
|
||||
'so' => 'application/octet-stream',
|
||||
'sea' => 'application/octet-stream',
|
||||
'dll' => 'application/octet-stream',
|
||||
'oda' => 'application/oda',
|
||||
'pdf' => [
|
||||
'application/pdf',
|
||||
'application/force-download',
|
||||
'application/x-download',
|
||||
'binary/octet-stream',
|
||||
],
|
||||
'ai' => [
|
||||
'application/pdf',
|
||||
'application/postscript',
|
||||
],
|
||||
'eps' => 'application/postscript',
|
||||
'ps' => 'application/postscript',
|
||||
'smi' => 'application/smil',
|
||||
'smil' => 'application/smil',
|
||||
'mif' => 'application/vnd.mif',
|
||||
'xls' => [
|
||||
'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' => [
|
||||
'application/vnd.ms-powerpoint',
|
||||
'application/powerpoint',
|
||||
'application/vnd.ms-office',
|
||||
'application/msword',
|
||||
],
|
||||
'pptx' => [
|
||||
'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' => [
|
||||
'application/x-php',
|
||||
'application/x-httpd-php',
|
||||
'application/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' => [
|
||||
'application/x-javascript',
|
||||
'text/plain',
|
||||
],
|
||||
'swf' => 'application/x-shockwave-flash',
|
||||
'sit' => 'application/x-stuffit',
|
||||
'tar' => 'application/x-tar',
|
||||
'tgz' => [
|
||||
'application/x-tar',
|
||||
'application/x-gzip-compressed',
|
||||
],
|
||||
'z' => 'application/x-compress',
|
||||
'xhtml' => 'application/xhtml+xml',
|
||||
'xht' => 'application/xhtml+xml',
|
||||
'zip' => [
|
||||
'application/x-zip',
|
||||
'application/zip',
|
||||
'application/x-zip-compressed',
|
||||
'application/s-compressed',
|
||||
'multipart/x-zip',
|
||||
],
|
||||
'rar' => [
|
||||
'application/x-rar',
|
||||
'application/rar',
|
||||
'application/x-rar-compressed',
|
||||
],
|
||||
'mid' => 'audio/midi',
|
||||
'midi' => 'audio/midi',
|
||||
'mpga' => 'audio/mpeg',
|
||||
'mp2' => 'audio/mpeg',
|
||||
'mp3' => [
|
||||
'audio/mpeg',
|
||||
'audio/mpg',
|
||||
'audio/mpeg3',
|
||||
'audio/mp3',
|
||||
],
|
||||
'aif' => [
|
||||
'audio/x-aiff',
|
||||
'audio/aiff',
|
||||
],
|
||||
'aiff' => [
|
||||
'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' => [
|
||||
'audio/x-wav',
|
||||
'audio/wave',
|
||||
'audio/wav',
|
||||
],
|
||||
'bmp' => [
|
||||
'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',
|
||||
'jpg' => [
|
||||
'image/jpeg',
|
||||
'image/pjpeg',
|
||||
],
|
||||
'jpeg' => [
|
||||
'image/jpeg',
|
||||
'image/pjpeg',
|
||||
],
|
||||
'jpe' => [
|
||||
'image/jpeg',
|
||||
'image/pjpeg',
|
||||
],
|
||||
'jp2' => [
|
||||
'image/jp2',
|
||||
'video/mj2',
|
||||
'image/jpx',
|
||||
'image/jpm',
|
||||
],
|
||||
'j2k' => [
|
||||
'image/jp2',
|
||||
'video/mj2',
|
||||
'image/jpx',
|
||||
'image/jpm',
|
||||
],
|
||||
'jpf' => [
|
||||
'image/jp2',
|
||||
'video/mj2',
|
||||
'image/jpx',
|
||||
'image/jpm',
|
||||
],
|
||||
'jpg2' => [
|
||||
'image/jp2',
|
||||
'video/mj2',
|
||||
'image/jpx',
|
||||
'image/jpm',
|
||||
],
|
||||
'jpx' => [
|
||||
'image/jp2',
|
||||
'video/mj2',
|
||||
'image/jpx',
|
||||
'image/jpm',
|
||||
],
|
||||
'jpm' => [
|
||||
'image/jp2',
|
||||
'video/mj2',
|
||||
'image/jpx',
|
||||
'image/jpm',
|
||||
],
|
||||
'mj2' => [
|
||||
'image/jp2',
|
||||
'video/mj2',
|
||||
'image/jpx',
|
||||
'image/jpm',
|
||||
],
|
||||
'mjp2' => [
|
||||
'image/jp2',
|
||||
'video/mj2',
|
||||
'image/jpx',
|
||||
'image/jpm',
|
||||
],
|
||||
'png' => [
|
||||
'image/png',
|
||||
'image/x-png',
|
||||
],
|
||||
'tif' => 'image/tiff',
|
||||
'tiff' => 'image/tiff',
|
||||
'css' => [
|
||||
'text/css',
|
||||
'text/plain',
|
||||
],
|
||||
'html' => [
|
||||
'text/html',
|
||||
'text/plain',
|
||||
],
|
||||
'htm' => [
|
||||
'text/html',
|
||||
'text/plain',
|
||||
],
|
||||
'shtml' => [
|
||||
'text/html',
|
||||
'text/plain',
|
||||
],
|
||||
'txt' => 'text/plain',
|
||||
'text' => 'text/plain',
|
||||
'log' => [
|
||||
'text/plain',
|
||||
'text/x-log',
|
||||
],
|
||||
'rtx' => 'text/richtext',
|
||||
'rtf' => 'text/rtf',
|
||||
'xml' => [
|
||||
'application/xml',
|
||||
'text/xml',
|
||||
'text/plain',
|
||||
],
|
||||
'xsl' => [
|
||||
'application/xml',
|
||||
'text/xsl',
|
||||
'text/xml',
|
||||
],
|
||||
'mpeg' => 'video/mpeg',
|
||||
'mpg' => 'video/mpeg',
|
||||
'mpe' => 'video/mpeg',
|
||||
'qt' => 'video/quicktime',
|
||||
'mov' => 'video/quicktime',
|
||||
'avi' => [
|
||||
'video/x-msvideo',
|
||||
'video/msvideo',
|
||||
'video/avi',
|
||||
'application/x-troff-msvideo',
|
||||
],
|
||||
'movie' => 'video/x-sgi-movie',
|
||||
'doc' => [
|
||||
'application/msword',
|
||||
'application/vnd.ms-office',
|
||||
],
|
||||
'docx' => [
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
'application/zip',
|
||||
'application/msword',
|
||||
'application/x-zip',
|
||||
],
|
||||
'dot' => [
|
||||
'application/msword',
|
||||
'application/vnd.ms-office',
|
||||
],
|
||||
'dotx' => [
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
'application/zip',
|
||||
'application/msword',
|
||||
],
|
||||
'xlsx' => [
|
||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
'application/zip',
|
||||
'application/vnd.ms-excel',
|
||||
'application/msword',
|
||||
'application/x-zip',
|
||||
],
|
||||
'word' => [
|
||||
'application/msword',
|
||||
'application/octet-stream',
|
||||
],
|
||||
'xl' => 'application/excel',
|
||||
'eml' => 'message/rfc822',
|
||||
'json' => [
|
||||
'application/json',
|
||||
'text/json',
|
||||
],
|
||||
'pem' => [
|
||||
'application/x-x509-user-cert',
|
||||
'application/x-pem-file',
|
||||
'application/octet-stream',
|
||||
],
|
||||
'p10' => [
|
||||
'application/x-pkcs10',
|
||||
'application/pkcs10',
|
||||
],
|
||||
'p12' => 'application/x-pkcs12',
|
||||
'p7a' => 'application/x-pkcs7-signature',
|
||||
'p7c' => [
|
||||
'application/pkcs7-mime',
|
||||
'application/x-pkcs7-mime',
|
||||
],
|
||||
'p7m' => [
|
||||
'application/pkcs7-mime',
|
||||
'application/x-pkcs7-mime',
|
||||
],
|
||||
'p7r' => 'application/x-pkcs7-certreqresp',
|
||||
'p7s' => 'application/pkcs7-signature',
|
||||
'crt' => [
|
||||
'application/x-x509-ca-cert',
|
||||
'application/x-x509-user-cert',
|
||||
'application/pkix-cert',
|
||||
],
|
||||
'crl' => [
|
||||
'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' => [
|
||||
'application/pkix-cert',
|
||||
'application/x-x509-ca-cert',
|
||||
],
|
||||
'3g2' => 'video/3gpp2',
|
||||
'3gp' => [
|
||||
'video/3gp',
|
||||
'video/3gpp',
|
||||
],
|
||||
'mp4' => 'video/mp4',
|
||||
'm4a' => 'audio/x-m4a',
|
||||
'f4v' => [
|
||||
'video/mp4',
|
||||
'video/x-f4v',
|
||||
],
|
||||
'flv' => 'video/x-flv',
|
||||
'webm' => 'video/webm',
|
||||
'aac' => 'audio/x-acc',
|
||||
'm4u' => 'application/vnd.mpegurl',
|
||||
'm3u' => 'text/plain',
|
||||
'xspf' => 'application/xspf+xml',
|
||||
'vlc' => 'application/videolan',
|
||||
'wmv' => [
|
||||
'video/x-ms-wmv',
|
||||
'video/x-ms-asf',
|
||||
],
|
||||
'au' => 'audio/x-au',
|
||||
'ac3' => 'audio/ac3',
|
||||
'flac' => 'audio/x-flac',
|
||||
'ogg' => [
|
||||
'audio/ogg',
|
||||
'video/ogg',
|
||||
'application/ogg',
|
||||
],
|
||||
'kmz' => [
|
||||
'application/vnd.google-earth.kmz',
|
||||
'application/zip',
|
||||
'application/x-zip',
|
||||
],
|
||||
'kml' => [
|
||||
'application/vnd.google-earth.kml+xml',
|
||||
'application/xml',
|
||||
'text/xml',
|
||||
],
|
||||
'ics' => 'text/calendar',
|
||||
'ical' => 'text/calendar',
|
||||
'zsh' => 'text/x-scriptzsh',
|
||||
'7zip' => [
|
||||
'application/x-compressed',
|
||||
'application/x-zip-compressed',
|
||||
'application/zip',
|
||||
'multipart/x-zip',
|
||||
],
|
||||
'cdr' => [
|
||||
'application/cdr',
|
||||
'application/coreldraw',
|
||||
'application/x-cdr',
|
||||
'application/x-coreldraw',
|
||||
'image/cdr',
|
||||
'image/x-cdr',
|
||||
'zz-application/zz-winassoc-cdr',
|
||||
],
|
||||
'wma' => [
|
||||
'audio/x-ms-wma',
|
||||
'video/x-ms-asf',
|
||||
],
|
||||
'jar' => [
|
||||
'application/java-archive',
|
||||
'application/x-java-application',
|
||||
'application/x-jar',
|
||||
'application/x-compressed',
|
||||
],
|
||||
'svg' => [
|
||||
'image/svg+xml',
|
||||
'application/xml',
|
||||
'text/xml',
|
||||
],
|
||||
'vcf' => 'text/x-vcard',
|
||||
'srt' => [
|
||||
'text/srt',
|
||||
'text/plain',
|
||||
],
|
||||
'vtt' => [
|
||||
'text/vtt',
|
||||
'text/plain',
|
||||
],
|
||||
'ico' => [
|
||||
'image/x-icon',
|
||||
'image/x-ico',
|
||||
'image/vnd.microsoft.icon',
|
||||
],
|
||||
];
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Attempts to determine the best mime type for the given file extension.
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @return string|null The mime type found, or none if unable to determine.
|
||||
*/
|
||||
public static function guessTypeFromExtension(string $extension)
|
||||
{
|
||||
$extension = trim(strtolower($extension), '. ');
|
||||
|
||||
if (! array_key_exists($extension, static::$mimes))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return is_array(static::$mimes[$extension]) ? static::$mimes[$extension][0] : static::$mimes[$extension];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Attempts to determine the best file extension for a given mime type.
|
||||
*
|
||||
* @param string $type
|
||||
* @param string $proposed_extension - default extension (in case there is more than one with the same mime type)
|
||||
*
|
||||
* @return string|null The extension determined, or null if unable to match.
|
||||
*/
|
||||
public static function guessExtensionFromType(string $type, ?string $proposed_extension = null)
|
||||
{
|
||||
$type = trim(strtolower($type), '. ');
|
||||
|
||||
$proposed_extension = trim(strtolower($proposed_extension));
|
||||
|
||||
if (! is_null($proposed_extension) && array_key_exists($proposed_extension, static::$mimes) && in_array($type, is_string(static::$mimes[$proposed_extension]) ? [static::$mimes[$proposed_extension]] : static::$mimes[$proposed_extension]))
|
||||
{
|
||||
return $proposed_extension;
|
||||
}
|
||||
|
||||
foreach (static::$mimes as $ext => $types)
|
||||
{
|
||||
if ((is_string($types) && $types === $type) || (is_array($types) && in_array($type, $types)))
|
||||
{
|
||||
return $ext;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
}
|
||||
45
app/Config/Modules.php
Normal file
45
app/Config/Modules.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Config;
|
||||
|
||||
use CodeIgniter\Modules\Modules as CoreModules;
|
||||
|
||||
class Modules extends CoreModules
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Auto-Discovery Enabled?
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If true, then auto-discovery will happen across all elements listed in
|
||||
| $activeExplorers below. If false, no auto-discovery will happen at all,
|
||||
| giving a slight performance boost.
|
||||
*/
|
||||
public $enabled = true;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Auto-Discovery Within Composer Packages Enabled?
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If true, then auto-discovery will happen across all namespaces loaded
|
||||
| by Composer, as well as the namespaces configured locally.
|
||||
*/
|
||||
public $discoverInComposer = true;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Auto-discover Rules
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Aliases list of all discovery classes that will be active and used during
|
||||
| the current application request.
|
||||
| If it is not listed, only the base application elements will be used.
|
||||
*/
|
||||
public $aliases = [
|
||||
'events',
|
||||
'registrars',
|
||||
'routes',
|
||||
'services',
|
||||
];
|
||||
}
|
||||
35
app/Config/Pager.php
Normal file
35
app/Config/Pager.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
class Pager extends BaseConfig
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Templates
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Pagination links are rendered out using views to configure their
|
||||
| appearance. This array contains aliases and the view names to
|
||||
| use when rendering the links.
|
||||
|
|
||||
| Within each view, the Pager object will be available as $pager,
|
||||
| and the desired group as $pagerGroup;
|
||||
|
|
||||
*/
|
||||
public $templates = [
|
||||
'default_full' => 'CodeIgniter\Pager\Views\default_full',
|
||||
'default_simple' => 'CodeIgniter\Pager\Views\default_simple',
|
||||
'default_head' => 'CodeIgniter\Pager\Views\default_head',
|
||||
];
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Items Per Page
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The default number of results shown in a single page.
|
||||
|
|
||||
*/
|
||||
public $perPage = 20;
|
||||
}
|
||||
77
app/Config/Paths.php
Normal file
77
app/Config/Paths.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?php namespace Config;
|
||||
|
||||
/**
|
||||
* Holds the paths that are used by the system to
|
||||
* locate the main directories, app, system, etc.
|
||||
* Modifying these allows you to re-structure your application,
|
||||
* share a system folder between multiple applications, and more.
|
||||
*
|
||||
* All paths are relative to the project's root folder.
|
||||
*/
|
||||
|
||||
class Paths
|
||||
{
|
||||
/*
|
||||
*---------------------------------------------------------------
|
||||
* SYSTEM FOLDER NAME
|
||||
*---------------------------------------------------------------
|
||||
*
|
||||
* This variable must contain the name of your "system" folder.
|
||||
* Include the path if the folder is not in the same directory
|
||||
* as this file.
|
||||
*/
|
||||
public $systemDirectory = __DIR__ . '/../../vendor/codeigniter4/framework/system';
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------
|
||||
* APPLICATION FOLDER NAME
|
||||
*---------------------------------------------------------------
|
||||
*
|
||||
* If you want this front controller to use a different "app"
|
||||
* folder than the default one you can set its name here. The folder
|
||||
* can also be renamed or relocated anywhere on your getServer. If
|
||||
* you do, use a full getServer path. For more info please see the user guide:
|
||||
* http://codeigniter.com/user_guide/general/managing_apps.html
|
||||
*
|
||||
* NO TRAILING SLASH!
|
||||
*/
|
||||
public $appDirectory = __DIR__ . '/..';
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* WRITABLE DIRECTORY NAME
|
||||
* ---------------------------------------------------------------
|
||||
*
|
||||
* This variable must contain the name of your "writable" directory.
|
||||
* The writable directory allows you to group all directories that
|
||||
* need write permission to a single place that can be tucked away
|
||||
* for maximum security, keeping it out of the app and/or
|
||||
* system directories.
|
||||
*/
|
||||
public $writableDirectory = __DIR__ . '/../../writable';
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* TESTS DIRECTORY NAME
|
||||
* ---------------------------------------------------------------
|
||||
*
|
||||
* This variable must contain the name of your "tests" directory.
|
||||
* The writable directory allows you to group all directories that
|
||||
* need write permission to a single place that can be tucked away
|
||||
* for maximum security, keeping it out of the app and/or
|
||||
* system directories.
|
||||
*/
|
||||
public $testsDirectory = __DIR__ . '/../../tests';
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* VIEW DIRECTORY NAME
|
||||
* ---------------------------------------------------------------
|
||||
*
|
||||
* This variable must contain the name of the directory that
|
||||
* contains the view files used by your application. By
|
||||
* default this is in `app/Views`. This value
|
||||
* is used when no value is provided to `Services::renderer()`.
|
||||
*/
|
||||
public $viewDirectory = __DIR__ . '/../Views';
|
||||
}
|
||||
67
app/Config/Routes.php
Normal file
67
app/Config/Routes.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php namespace Config;
|
||||
|
||||
// Create a new instance of our RouteCollection class.
|
||||
$routes = Services::routes();
|
||||
|
||||
// Load the system's routing file first, so that the app and ENVIRONMENT
|
||||
// can override as needed.
|
||||
if (file_exists(SYSTEMPATH . 'Config/Routes.php'))
|
||||
{
|
||||
require SYSTEMPATH . 'Config/Routes.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------
|
||||
* Router Setup
|
||||
* --------------------------------------------------------------------
|
||||
*/
|
||||
$routes->setDefaultNamespace('App\Controllers');
|
||||
$routes->setDefaultController('Donor_controller');
|
||||
$routes->setDefaultMethod('index');
|
||||
$routes->setTranslateURIDashes(false);
|
||||
$routes->set404Override();
|
||||
$routes->setAutoRoute(true);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------
|
||||
* Route Definitions
|
||||
* --------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
// We get a performance increase by specifying the default
|
||||
// route since we don't have to scan directories.
|
||||
$routes->get('/', 'Donor_controller::index');
|
||||
$routes->match(['get','post'],'register','Donor_controller::register');
|
||||
$routes->match(['get','post'],'login','Donor_controller::login');
|
||||
$routes->match(['get'],'fetch_country','Donor_controller::fetch_country');
|
||||
$routes->match(['get','post'],'fetch_state','Donor_controller::fetch_state');
|
||||
$routes->match(['get','post'],'fetch_city','Donor_controller::fetch_city');
|
||||
|
||||
$routes->match(['get','post'],'receipt','Dashboard::generate_receipts');
|
||||
$routes->match(['get','post'],'transaction','Dashboard::transaction_upload');
|
||||
$routes->match(['get','post'],'donation_data','Dashboard::donation_data_upload');
|
||||
$routes->match(['get','post'],'donor_register','My_controller::donor_register');
|
||||
|
||||
$routes->match(['get'],'fetch_donor_id','Dashboard::fetch_donor_id');
|
||||
$routes->match(['get','post'],'add_donation_cause','Dashboard::add_donation_cause');
|
||||
// $routes->add('register','Donation::register');
|
||||
// $routes->add('list','Donation::edit_view');
|
||||
// $routes->add('store','Home::store');
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------
|
||||
* Additional Routing
|
||||
* --------------------------------------------------------------------
|
||||
*
|
||||
* There will often be times that you need additional routing and you
|
||||
* need it to be able to override any defaults in this file. Environment
|
||||
* based routes is one such time. require() additional route files here
|
||||
* to make that happen.
|
||||
*
|
||||
* You will have access to the $routes object within that file without
|
||||
* needing to reload it.
|
||||
*/
|
||||
if (file_exists(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php'))
|
||||
{
|
||||
require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php';
|
||||
}
|
||||
30
app/Config/Services.php
Normal file
30
app/Config/Services.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Config\Services as CoreServices;
|
||||
|
||||
/**
|
||||
* Services Configuration file.
|
||||
*
|
||||
* Services are simply other classes/libraries that the system uses
|
||||
* to do its job. This is used by CodeIgniter to allow the core of the
|
||||
* framework to be swapped out easily without affecting the usage within
|
||||
* the rest of your application.
|
||||
*
|
||||
* This file holds any application-specific services, or service overrides
|
||||
* that you might need. An example has been included with the general
|
||||
* method format you should use for your service methods. For more examples,
|
||||
* see the core Services file at system/Config/Services.php.
|
||||
*/
|
||||
class Services extends CoreServices
|
||||
{
|
||||
|
||||
// public static function example($getShared = true)
|
||||
// {
|
||||
// if ($getShared)
|
||||
// {
|
||||
// return static::getSharedInstance('example');
|
||||
// }
|
||||
//
|
||||
// return new \CodeIgniter\Example();
|
||||
// }
|
||||
}
|
||||
68
app/Config/Toolbar.php
Normal file
68
app/Config/Toolbar.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
class Toolbar extends BaseConfig
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Debug Toolbar
|
||||
|--------------------------------------------------------------------------
|
||||
| The Debug Toolbar provides a way to see information about the performance
|
||||
| and state of your application during that page display. By default it will
|
||||
| NOT be displayed under production environments, and will only display if
|
||||
| CI_DEBUG is true, since if it's not, there's not much to display anyway.
|
||||
|
|
||||
| toolbarMaxHistory = Number of history files, 0 for none or -1 for unlimited
|
||||
|
|
||||
*/
|
||||
public $collectors = [
|
||||
\CodeIgniter\Debug\Toolbar\Collectors\Timers::class,
|
||||
\CodeIgniter\Debug\Toolbar\Collectors\Database::class,
|
||||
\CodeIgniter\Debug\Toolbar\Collectors\Logs::class,
|
||||
\CodeIgniter\Debug\Toolbar\Collectors\Views::class,
|
||||
// \CodeIgniter\Debug\Toolbar\Collectors\Cache::class,
|
||||
\CodeIgniter\Debug\Toolbar\Collectors\Files::class,
|
||||
\CodeIgniter\Debug\Toolbar\Collectors\Routes::class,
|
||||
\CodeIgniter\Debug\Toolbar\Collectors\Events::class,
|
||||
];
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Max History
|
||||
|--------------------------------------------------------------------------
|
||||
| The Toolbar allows you to view recent requests that have been made to
|
||||
| the application while the toolbar is active. This allows you to quickly
|
||||
| view and compare multiple requests.
|
||||
|
|
||||
| $maxHistory sets a limit on the number of past requests that are stored,
|
||||
| helping to conserve file space used to store them. You can set it to
|
||||
| 0 (zero) to not have any history stored, or -1 for unlimited history.
|
||||
|
|
||||
*/
|
||||
public $maxHistory = 20;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Toolbar Views Path
|
||||
|--------------------------------------------------------------------------
|
||||
| The full path to the the views that are used by the toolbar.
|
||||
| MUST have a trailing slash.
|
||||
|
|
||||
*/
|
||||
public $viewsPath = SYSTEMPATH . 'Debug/Toolbar/Views/';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Max Queries
|
||||
|--------------------------------------------------------------------------
|
||||
| If the Database Collector is enabled, it will log every query that the
|
||||
| the system generates so they can be displayed on the toolbar's timeline
|
||||
| and in the query log. This can lead to memory issues in some instances
|
||||
| with hundreds of queries.
|
||||
|
|
||||
| $maxQueries defines the maximum amount of queries that will be stored.
|
||||
|
|
||||
*/
|
||||
public $maxQueries = 100;
|
||||
}
|
||||
218
app/Config/UserAgents.php
Normal file
218
app/Config/UserAgents.php
Normal file
@ -0,0 +1,218 @@
|
||||
<?php namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
|
||||
class UserAgents extends BaseConfig
|
||||
{
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
| 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.
|
||||
*/
|
||||
public $platforms = [
|
||||
'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.
|
||||
public $browsers = [
|
||||
'OPR' => 'Opera',
|
||||
'Flock' => 'Flock',
|
||||
'Edge' => 'Spartan',
|
||||
'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',
|
||||
'Vivaldi' => 'Vivaldi',
|
||||
];
|
||||
|
||||
public $mobiles = [
|
||||
// legacy array, old values commented out
|
||||
'mobileexplorer' => 'Mobile Explorer',
|
||||
// 'openwave' => 'Open Wave',
|
||||
// 'opera mini' => 'Opera Mini',
|
||||
// 'operamini' => 'Opera Mini',
|
||||
// 'elaine' => 'Palm',
|
||||
'palmsource' => 'Palm',
|
||||
// 'digital paths' => 'Palm',
|
||||
// 'avantgo' => 'Avantgo',
|
||||
// 'xiino' => 'Xiino',
|
||||
'palmscape' => 'Palmscape',
|
||||
// 'nokia' => 'Nokia',
|
||||
// 'ericsson' => 'Ericsson',
|
||||
// 'blackberry' => 'BlackBerry',
|
||||
// 'motorola' => 'Motorola'
|
||||
|
||||
// Phones and Manufacturers
|
||||
'motorola' => 'Motorola',
|
||||
'nokia' => 'Nokia',
|
||||
'palm' => 'Palm',
|
||||
'iphone' => 'Apple iPhone',
|
||||
'ipad' => 'iPad',
|
||||
'ipod' => 'Apple iPod Touch',
|
||||
'sony' => 'Sony Ericsson',
|
||||
'ericsson' => 'Sony Ericsson',
|
||||
'blackberry' => 'BlackBerry',
|
||||
'cocoon' => 'O2 Cocoon',
|
||||
'blazer' => 'Treo',
|
||||
'lg' => 'LG',
|
||||
'amoi' => 'Amoi',
|
||||
'xda' => 'XDA',
|
||||
'mda' => 'MDA',
|
||||
'vario' => 'Vario',
|
||||
'htc' => 'HTC',
|
||||
'samsung' => 'Samsung',
|
||||
'sharp' => 'Sharp',
|
||||
'sie-' => 'Siemens',
|
||||
'alcatel' => 'Alcatel',
|
||||
'benq' => 'BenQ',
|
||||
'ipaq' => 'HP iPaq',
|
||||
'mot-' => 'Motorola',
|
||||
'playstation portable' => 'PlayStation Portable',
|
||||
'playstation 3' => 'PlayStation 3',
|
||||
'playstation vita' => 'PlayStation Vita',
|
||||
'hiptop' => 'Danger Hiptop',
|
||||
'nec-' => 'NEC',
|
||||
'panasonic' => 'Panasonic',
|
||||
'philips' => 'Philips',
|
||||
'sagem' => 'Sagem',
|
||||
'sanyo' => 'Sanyo',
|
||||
'spv' => 'SPV',
|
||||
'zte' => 'ZTE',
|
||||
'sendo' => 'Sendo',
|
||||
'nintendo dsi' => 'Nintendo DSi',
|
||||
'nintendo ds' => 'Nintendo DS',
|
||||
'nintendo 3ds' => 'Nintendo 3DS',
|
||||
'wii' => 'Nintendo Wii',
|
||||
'open web' => 'Open Web',
|
||||
'openweb' => 'OpenWeb',
|
||||
|
||||
// Operating Systems
|
||||
'android' => 'Android',
|
||||
'symbian' => 'Symbian',
|
||||
'SymbianOS' => 'SymbianOS',
|
||||
'elaine' => 'Palm',
|
||||
'series60' => 'Symbian S60',
|
||||
'windows ce' => 'Windows CE',
|
||||
|
||||
// Browsers
|
||||
'obigo' => 'Obigo',
|
||||
'netfront' => 'Netfront Browser',
|
||||
'openwave' => 'Openwave Browser',
|
||||
'mobilexplorer' => 'Mobile Explorer',
|
||||
'operamini' => 'Opera Mini',
|
||||
'opera mini' => 'Opera Mini',
|
||||
'opera mobi' => 'Opera Mobile',
|
||||
'fennec' => 'Firefox Mobile',
|
||||
|
||||
// Other
|
||||
'digital paths' => 'Digital Paths',
|
||||
'avantgo' => 'AvantGo',
|
||||
'xiino' => 'Xiino',
|
||||
'novarra' => 'Novarra Transcoder',
|
||||
'vodafone' => 'Vodafone',
|
||||
'docomo' => 'NTT DoCoMo',
|
||||
'o2' => 'O2',
|
||||
|
||||
// Fallback
|
||||
'mobile' => 'Generic Mobile',
|
||||
'wireless' => 'Generic Mobile',
|
||||
'j2me' => 'Generic Mobile',
|
||||
'midp' => 'Generic Mobile',
|
||||
'cldc' => 'Generic Mobile',
|
||||
'up.link' => 'Generic Mobile',
|
||||
'up.browser' => 'Generic Mobile',
|
||||
'smartphone' => 'Generic Mobile',
|
||||
'cellphone' => 'Generic Mobile',
|
||||
];
|
||||
|
||||
// There are hundreds of bots but these are the most common.
|
||||
public $robots = [
|
||||
'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',
|
||||
];
|
||||
}
|
||||
36
app/Config/Validation.php
Normal file
36
app/Config/Validation.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php namespace Config;
|
||||
|
||||
class Validation
|
||||
{
|
||||
//--------------------------------------------------------------------
|
||||
// Setup
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Stores the classes that contain the
|
||||
* rules that are available.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $ruleSets = [
|
||||
\CodeIgniter\Validation\Rules::class,
|
||||
\CodeIgniter\Validation\FormatRules::class,
|
||||
\CodeIgniter\Validation\FileRules::class,
|
||||
\CodeIgniter\Validation\CreditCardRules::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* Specifies the views that are used to display the
|
||||
* errors.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $templates = [
|
||||
'list' => 'CodeIgniter\Validation\Views\list',
|
||||
'single' => 'CodeIgniter\Validation\Views\single',
|
||||
];
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Rules
|
||||
//--------------------------------------------------------------------
|
||||
}
|
||||
34
app/Config/View.php
Normal file
34
app/Config/View.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php namespace Config;
|
||||
|
||||
class View extends \CodeIgniter\Config\View
|
||||
{
|
||||
/**
|
||||
* When false, the view method will clear the data between each
|
||||
* call. This keeps your data safe and ensures there is no accidental
|
||||
* leaking between calls, so you would need to explicitly pass the data
|
||||
* to each view. You might prefer to have the data stick around between
|
||||
* calls so that it is available to all views. If that is the case,
|
||||
* set $saveData to true.
|
||||
*/
|
||||
public $saveData = true;
|
||||
|
||||
/**
|
||||
* Parser Filters map a filter name with any PHP callable. When the
|
||||
* Parser prepares a variable for display, it will chain it
|
||||
* through the filters in the order defined, inserting any parameters.
|
||||
* To prevent potential abuse, all filters MUST be defined here
|
||||
* in order for them to be available for use within the Parser.
|
||||
*
|
||||
* Examples:
|
||||
* { title|esc(js) }
|
||||
* { created_on|date(Y-m-d)|esc(attr) }
|
||||
*/
|
||||
public $filters = [];
|
||||
|
||||
/**
|
||||
* Parser Plugins provide a way to extend the functionality provided
|
||||
* by the core Parser by creating aliases that will be replaced with
|
||||
* any callable. Can be single or tag pair.
|
||||
*/
|
||||
public $plugins = [];
|
||||
}
|
||||
46
app/Controllers/BaseController.php
Normal file
46
app/Controllers/BaseController.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
namespace App\Controllers;
|
||||
|
||||
/**
|
||||
* Class BaseController
|
||||
*
|
||||
* BaseController provides a convenient place for loading components
|
||||
* and performing functions that are needed by all your controllers.
|
||||
* Extend this class in any new controllers:
|
||||
* class Home extends BaseController
|
||||
*
|
||||
* For security be sure to declare any new methods as protected or private.
|
||||
*
|
||||
* @package CodeIgniter
|
||||
*/
|
||||
|
||||
use CodeIgniter\Controller;
|
||||
|
||||
class BaseController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* An array of helpers to be loaded automatically upon
|
||||
* class instantiation. These helpers will be available
|
||||
* to all other controllers that extend BaseController.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $helpers = [];
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
|
||||
{
|
||||
// Do Not Edit This Line
|
||||
parent::initController($request, $response, $logger);
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Preload any models, libraries, etc, here.
|
||||
//--------------------------------------------------------------------
|
||||
// E.g.:
|
||||
// $this->session = \Config\Services::session();
|
||||
}
|
||||
|
||||
}
|
||||
293
app/Controllers/Dashboard.php
Normal file
293
app/Controllers/Dashboard.php
Normal file
@ -0,0 +1,293 @@
|
||||
<?php namespace App\Controllers;
|
||||
|
||||
use App\Models\Dashboard_model;
|
||||
use App\Models\Receipt_model;
|
||||
use App\Models\Transaction_model;
|
||||
use App\Models\Donation_data_model;
|
||||
use App\Models\My_model;
|
||||
use App\Models\Donation_cause;
|
||||
|
||||
class Dashboard extends BaseController
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->dModel = new Dashboard_model();
|
||||
$this->rModel = new Receipt_model();
|
||||
$this->tModel = new Transaction_model();
|
||||
$this->ddModel = new Donation_data_model();
|
||||
$this->MyModel = new My_model();
|
||||
$this->dcModel = new Donation_cause();
|
||||
}
|
||||
public function index()
|
||||
{
|
||||
|
||||
$data = [];
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
|
||||
$name= session()->get('logged_user');
|
||||
$data['userdata']=$this->dModel->getLoggedInUserData($name);
|
||||
echo view('templates/header',$data);
|
||||
echo view('dashboard');
|
||||
echo view('templates/footer');
|
||||
}
|
||||
public function logout()
|
||||
{
|
||||
session()->remove('logged_user');
|
||||
session()->destroy();
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
public function receipts()
|
||||
{
|
||||
$data = [];
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
|
||||
$name= session()->get('logged_user');
|
||||
$data['donor']=$this->MyModel->fetch_donor_id();
|
||||
echo view('templates/header');
|
||||
echo view('receipts');
|
||||
echo view('templates/footer');
|
||||
}
|
||||
function fetch_donor_id()
|
||||
{
|
||||
|
||||
echo $this->MyModel->fetch_donor_id();
|
||||
|
||||
}
|
||||
|
||||
public function generate_receipts()
|
||||
{
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
$model = new Receipt_model();
|
||||
$receiptData=[
|
||||
'receipt_no' =>$this->request->getVar('receipt_no'),
|
||||
'date' =>$this->request->getVar('date'),
|
||||
'donor_id' =>$this->request->getVar('donor_id'),
|
||||
'amount' =>$this->request->getVar('amount'),
|
||||
'mode_of_receipt' =>$this->request->getVar('mode_of_receipt'),
|
||||
'receipt_details' =>$this->request->getVar('receipt_details'),
|
||||
'cause_name' =>$this->request->getVar('cause_name'),
|
||||
'remarks' =>$this->request->getVar('remarks'),
|
||||
|
||||
|
||||
];
|
||||
$model->save($receiptData);
|
||||
return redirect()->to(base_url().'/Dashboard');
|
||||
}
|
||||
public function all_receipt()
|
||||
{
|
||||
$data = [];
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
|
||||
|
||||
$data['receiptdata']=$this->rModel->all_receipt();
|
||||
echo view('templates/header',$data);
|
||||
echo view('receipts_table');
|
||||
echo view('templates/footer');
|
||||
}
|
||||
|
||||
function edit_receipt($receipt_id)
|
||||
{
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
$model = new Receipt_model();
|
||||
$receipt_data=$model->find($receipt_id);
|
||||
$data= [ 'post'=>$receipt_data ];
|
||||
|
||||
if($this->request->getMethod() == 'post')
|
||||
{
|
||||
$model = new Receipt_model();
|
||||
$_POST['receipt_id'] = $receipt_id;
|
||||
$model->save($_POST);
|
||||
return redirect()->to(base_url()."/Dashboard/all_receipt");
|
||||
}
|
||||
echo view('templates/header',$data);
|
||||
echo view('receipt_edit');
|
||||
echo view('templates/footer');
|
||||
|
||||
}
|
||||
public function transaction()
|
||||
{
|
||||
$data = [];
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
|
||||
$name= session()->get('logged_user');
|
||||
//$data['userdata']=$this->dModel->getLoggedInUserData($name);
|
||||
echo view('templates/header');
|
||||
echo view('transaction_upload');
|
||||
echo view('templates/footer');
|
||||
}
|
||||
public function transaction_upload()
|
||||
{
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
$model = new Transaction_model();
|
||||
$transactionData=[
|
||||
'date' =>$this->request->getVar('date'),
|
||||
'ref_1' =>$this->request->getVar('ref_1'),
|
||||
'ref_2' =>$this->request->getVar('ref_2'),
|
||||
'remarks' =>$this->request->getVar('remarks'),
|
||||
'amount' =>$this->request->getVar('amount'),
|
||||
'donation_ref' =>$this->request->getVar('donation_ref'),
|
||||
|
||||
];
|
||||
$model->save($transactionData);
|
||||
return redirect()->to(base_url().'/Dashboard');
|
||||
}
|
||||
public function all_transaction()
|
||||
{
|
||||
$data = [];
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
|
||||
|
||||
$data['receiptdata']=$this->tModel->all_transaction();
|
||||
echo view('templates/header',$data);
|
||||
echo view('transaction_table');
|
||||
echo view('templates/footer');
|
||||
}
|
||||
function edit_transaction($id)
|
||||
{
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
$model = new Transaction_model();
|
||||
$transaction_data=$model->find($id);
|
||||
$data= [ 'post'=>$transaction_data ];
|
||||
|
||||
if($this->request->getMethod() == 'post')
|
||||
{
|
||||
$model = new Transaction_model();
|
||||
$_POST['id'] = $id;
|
||||
$model->save($_POST);
|
||||
return redirect()->to(base_url()."/Dashboard/all_transaction");
|
||||
}
|
||||
echo view('templates/header',$data);
|
||||
echo view('transaction_edit');
|
||||
echo view('templates/footer');
|
||||
|
||||
}
|
||||
public function donation_data()
|
||||
{
|
||||
$data = [];
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
|
||||
$name= session()->get('logged_user');
|
||||
//$data['userdata']=$this->dModel->getLoggedInUserData($name);
|
||||
echo view('templates/header');
|
||||
echo view('donation_data');
|
||||
echo view('templates/footer');
|
||||
}
|
||||
public function donation_data_upload()
|
||||
{
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
$model = new Donation_data_model();
|
||||
$donationData=[
|
||||
'date' =>$this->request->getVar('date'),
|
||||
'cause_name' =>$this->request->getVar('cause_name'),
|
||||
'amount' =>$this->request->getVar('amount'),
|
||||
'mode_of_payment' =>$this->request->getVar('mode_of_payment'),
|
||||
'ref_1' =>$this->request->getVar('ref_1'),
|
||||
'donation_ref' =>$this->request->getVar('donation_ref'),
|
||||
|
||||
];
|
||||
$model->save($donationData);
|
||||
return redirect()->to(base_url().'/Dashboard');
|
||||
}
|
||||
public function all_donation_data()
|
||||
{
|
||||
$data = [];
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
|
||||
|
||||
$data['donationdata']=$this->ddModel->all_donation_data();
|
||||
echo view('templates/header',$data);
|
||||
echo view('donation_data_table');
|
||||
echo view('templates/footer');
|
||||
}
|
||||
function edit_donation_data($id)
|
||||
{
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
$model = new Donation_data_model();
|
||||
$donation_data=$model->find($id);
|
||||
$data= [ 'post'=>$donation_data ];
|
||||
|
||||
if($this->request->getMethod() == 'post')
|
||||
{
|
||||
$model = new Donation_data_model();
|
||||
$_POST['id'] = $id;
|
||||
$model->save($_POST);
|
||||
return redirect()->to(base_url()."/Dashboard/all_donation_data");
|
||||
}
|
||||
echo view('templates/header',$data);
|
||||
echo view('donation_data_edit');
|
||||
echo view('templates/footer');
|
||||
|
||||
}
|
||||
public function donation_cause()
|
||||
{
|
||||
$data = [];
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
|
||||
$name= session()->get('logged_user');
|
||||
$data['donationcause']=$this->dcModel->all_donation_cause();
|
||||
echo view('templates/header',$data);
|
||||
echo view('add_donation_cause');
|
||||
echo view('templates/footer');
|
||||
}
|
||||
public function add_donation_cause()
|
||||
{
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
$model = new Donation_cause();
|
||||
$donationCause=[
|
||||
|
||||
'cause_name' =>$this->request->getVar('cause_name'),
|
||||
'from_date' =>$this->request->getVar('from_date'),
|
||||
'to_date' =>$this->request->getVar('to_date'),
|
||||
|
||||
];
|
||||
$model->save($donationCause);
|
||||
return $this->donation_cause();
|
||||
|
||||
}
|
||||
}
|
||||
41
app/Controllers/Donation.php
Normal file
41
app/Controllers/Donation.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php namespace App\Controllers;
|
||||
|
||||
use App\Models\Donation_model;
|
||||
|
||||
class Donation extends BaseController
|
||||
{
|
||||
// public function index()
|
||||
// {
|
||||
|
||||
// return view('show');
|
||||
// }
|
||||
public function edit_view()
|
||||
{
|
||||
$model = new Donation_model();
|
||||
|
||||
$data['users_detail'] = $model->orderBy('id', 'DESC')->findAll();
|
||||
|
||||
return view('list', $data);
|
||||
}
|
||||
|
||||
public function test($type,$type2)
|
||||
{
|
||||
echo '<h2>this is a product:'.$type.'and'.$type2.'</h2>';
|
||||
//return view('show');
|
||||
}
|
||||
public function register()
|
||||
{
|
||||
if($this->request->getMethod() == 'post'){
|
||||
$model = new Donation_model();
|
||||
$model->save($_POST);
|
||||
}
|
||||
return view('show');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
}
|
||||
145
app/Controllers/Donor_controller.php
Normal file
145
app/Controllers/Donor_controller.php
Normal file
@ -0,0 +1,145 @@
|
||||
<?php namespace App\Controllers;
|
||||
|
||||
use App\Models\Donor_model;
|
||||
use App\Models\Dashboard_model;
|
||||
|
||||
|
||||
class Donor_controller extends BaseController
|
||||
{
|
||||
public $session;
|
||||
public function __construct()
|
||||
{
|
||||
$this->session = session();
|
||||
$this->Donor_model = new Donor_model();
|
||||
$this->Dashboard_model = new Dashboard_model();
|
||||
}
|
||||
public function index()
|
||||
{
|
||||
$data=[];
|
||||
helper(['form']);
|
||||
|
||||
if($this->request->getmethod() == 'post')
|
||||
{
|
||||
|
||||
$email = $this->request->getVar('email');
|
||||
$password = $this->request->getVar('password');
|
||||
$userdata = $this->Donor_model->verifyEmail($email);
|
||||
if($userdata)
|
||||
{
|
||||
if(password_verify($password, $userdata['password']))
|
||||
{
|
||||
|
||||
$this->session->set('logged_user',$userdata['id']);
|
||||
return redirect()->to(base_url().'/Dashboard');
|
||||
}
|
||||
else{
|
||||
$this->session->setTempdata('error','sorry wrong password entered for the Email',3);
|
||||
return redirect()->to(current_url());
|
||||
}
|
||||
}else
|
||||
{
|
||||
$this->session->setTempdata('error','sorry Email does not existe',3);
|
||||
return redirect()->to(current_url());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
echo view('templates/header',$data);
|
||||
echo view('login');
|
||||
echo view('templates/footer');
|
||||
//return view('donor_registration');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function register()
|
||||
{
|
||||
$data['country']=$this->Dashboard_model->fetch_country();
|
||||
helper(['form']);
|
||||
|
||||
if($this->request->getmethod() == 'post')
|
||||
{
|
||||
// validate
|
||||
$rules=[
|
||||
'name' =>'required|min_length[3]|max_length[20]',
|
||||
'phone' =>'required|min_length[3]|max_length[20]',
|
||||
'email' =>'required|min_length[6]|max_length[50]|valid_email|is_unique[donar_management.email]',
|
||||
'pan' =>'required|min_length[3]|max_length[20]',
|
||||
'address' =>'required|min_length[3]|max_length[20]',
|
||||
'country' =>'required',
|
||||
'state' =>'required',
|
||||
'city' =>'required',
|
||||
'pin_code' =>'required|min_length[6]|max_length[6]',
|
||||
'date_of_birth' =>'required|min_length[3]|max_length[20]',
|
||||
'gender' =>'required|min_length[3]|max_length[20]',
|
||||
'org_name' =>'required|min_length[3]|max_length[20]',
|
||||
'gstin' =>'required|min_length[3]|max_length[20]',
|
||||
'password' =>'required|min_length[8]|max_length[200]',
|
||||
'password_confirm' =>'matches[password]',
|
||||
];
|
||||
|
||||
if(! $this->validate($rules))
|
||||
{
|
||||
$data['validation'] = $this->validator;
|
||||
}else{
|
||||
//store the donor in database
|
||||
$model = new Donor_model();
|
||||
$donorData=[
|
||||
'name' =>$this->request->getVar('name'),
|
||||
'phone' =>$this->request->getVar('phone'),
|
||||
'email' =>$this->request->getVar('email'),
|
||||
'pan' =>$this->request->getVar('pan'),
|
||||
'address' =>$this->request->getVar('address'),
|
||||
'country' =>$this->request->getVar('country'),
|
||||
'state' =>$this->request->getVar('state'),
|
||||
'city' =>$this->request->getVar('city'),
|
||||
'pin_code' =>$this->request->getVar('pin_code'),
|
||||
'date_of_birth' =>$this->request->getVar('date_of_birth'),
|
||||
'gender' =>$this->request->getVar('gender'),
|
||||
'org_name' =>$this->request->getVar('org_name'),
|
||||
'gstin' =>$this->request->getVar('gstin'),
|
||||
'foreign_key' =>$this->request->getVar('email'),
|
||||
'password' =>$this->request->getVar('password'),
|
||||
|
||||
];
|
||||
$model->save($donorData);
|
||||
$session = session();
|
||||
$session ->setFlashdata('success','Successful Registration');
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
}
|
||||
|
||||
echo view('templates/header',$data);
|
||||
echo view('register');
|
||||
echo view('templates/footer');
|
||||
|
||||
}
|
||||
|
||||
function fetch_country()
|
||||
{
|
||||
|
||||
echo $this->Dashboard_model->fetch_country();
|
||||
|
||||
}
|
||||
function fetch_state()
|
||||
{
|
||||
|
||||
if($this->request->getVar('country_id'))
|
||||
{
|
||||
echo $this->Dashboard_model->fetch_state($this->request->getVar('country_id'));
|
||||
}
|
||||
}
|
||||
|
||||
function fetch_city()
|
||||
{
|
||||
if($this->request->getVar('state_id'))
|
||||
{
|
||||
echo $this->Dashboard_model->fetch_city($this->request->getVar('state_id'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
}
|
||||
81
app/Controllers/Home.php
Normal file
81
app/Controllers/Home.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?php namespace App\Controllers;
|
||||
|
||||
use App\Models\Donation_model;
|
||||
|
||||
class Home extends BaseController
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view('donor_registration');
|
||||
}
|
||||
|
||||
// function validation()
|
||||
// {
|
||||
// $donation = new Donation();
|
||||
// echo $donation->test('7777','9999');
|
||||
// }
|
||||
|
||||
public function store()
|
||||
{
|
||||
helper(['form', 'url']);
|
||||
|
||||
$model = new Donation_model();
|
||||
|
||||
$data = [
|
||||
'email' => $this->request->getVar('email'),
|
||||
'name' => $this->request->getVar('name'),
|
||||
'department' => $this->request->getVar('department'),
|
||||
|
||||
];
|
||||
|
||||
$save = $model->insert($data);
|
||||
return redirect()->to( base_url('show') );
|
||||
}
|
||||
|
||||
public function edit($id = null)
|
||||
{
|
||||
$model = new Donation_model();
|
||||
$post = $model->find($id);
|
||||
$data=['post' => $post,];
|
||||
return view('edit_view', $data);
|
||||
//return view('edit_view',['firstci4'=>$this->$model->find($id)]);
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
helper(['form', 'url']);
|
||||
|
||||
$model = new Donation_model();
|
||||
|
||||
$id = $this->request->getVar('id');
|
||||
$data = [
|
||||
'name' => $this->request->getVar('name'),
|
||||
'email' => $this->request->getVar('email'),
|
||||
];
|
||||
$save = $model->update($id,$data);
|
||||
$donation = new Donation();
|
||||
echo $donation->edit_view();
|
||||
//return redirect()->to( base_url('users') );
|
||||
}
|
||||
|
||||
public function userDelete($id = null)
|
||||
{
|
||||
$model = new Donation_model();
|
||||
$data['user'] = $model->where('id', $id)->delete();
|
||||
$donation = new Donation();
|
||||
echo $donation->edit_view();
|
||||
// return redirect()->to( base_url('users') );
|
||||
}
|
||||
public function profile($id = null)
|
||||
{
|
||||
$model = new Donation_model();
|
||||
$post = $model->find($id);
|
||||
$data=['post' => $post,];
|
||||
return view('profile_view', $data);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
}
|
||||
141
app/Controllers/My_controller.php
Normal file
141
app/Controllers/My_controller.php
Normal file
@ -0,0 +1,141 @@
|
||||
<?php namespace App\Controllers;
|
||||
|
||||
use App\Models\My_model;
|
||||
use App\Models\Dashboard_model;
|
||||
|
||||
|
||||
class My_controller extends BaseController
|
||||
{
|
||||
public $session;
|
||||
public function __construct()
|
||||
{
|
||||
$this->session = session();
|
||||
$this->My_model = new My_model();
|
||||
$this->Dashboard_model = new Dashboard_model();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function donor_register()
|
||||
{
|
||||
$data['country']=$this->Dashboard_model->fetch_country();
|
||||
helper(['form']);
|
||||
|
||||
if($this->request->getmethod() == 'post')
|
||||
{
|
||||
// validate
|
||||
$rules=[
|
||||
'name' =>'required|min_length[3]|max_length[20]',
|
||||
'phone' =>'required|min_length[3]|max_length[20]',
|
||||
'email' =>'required|min_length[6]|max_length[50]|valid_email|is_unique[donar_management.email]',
|
||||
'pan' =>'required|min_length[3]|max_length[20]',
|
||||
'address' =>'required|min_length[3]|max_length[20]',
|
||||
'country' =>'required',
|
||||
'state' =>'required',
|
||||
'city' =>'required',
|
||||
'pin_code' =>'required|min_length[6]|max_length[6]',
|
||||
'date_of_birth' =>'required|min_length[3]|max_length[20]',
|
||||
'gender' =>'required|min_length[3]|max_length[20]',
|
||||
'org_name' =>'required|min_length[3]|max_length[20]',
|
||||
'gstin' =>'required|min_length[3]|max_length[20]',
|
||||
|
||||
];
|
||||
|
||||
if(! $this->validate($rules))
|
||||
{
|
||||
$data['validation'] = $this->validator;
|
||||
}else{
|
||||
//store the donor in database
|
||||
$model = new My_model();
|
||||
$donorData=[
|
||||
'name' =>$this->request->getVar('name'),
|
||||
'phone' =>$this->request->getVar('phone'),
|
||||
'email' =>$this->request->getVar('email'),
|
||||
'pan' =>$this->request->getVar('pan'),
|
||||
'address' =>$this->request->getVar('address'),
|
||||
'country' =>$this->request->getVar('country'),
|
||||
'state' =>$this->request->getVar('state'),
|
||||
'city' =>$this->request->getVar('city'),
|
||||
'pin_code' =>$this->request->getVar('pin_code'),
|
||||
'date_of_birth' =>$this->request->getVar('date_of_birth'),
|
||||
'gender' =>$this->request->getVar('gender'),
|
||||
'org_name' =>$this->request->getVar('org_name'),
|
||||
'gstin' =>$this->request->getVar('gstin'),
|
||||
|
||||
|
||||
];
|
||||
$model->save($donorData);
|
||||
$session = session();
|
||||
$session ->setFlashdata('success','Successful Registration');
|
||||
return redirect()->to(base_url().'/Dashboard');
|
||||
}
|
||||
}
|
||||
|
||||
echo view('templates/header',$data);
|
||||
echo view('donor_registration');
|
||||
echo view('templates/footer');
|
||||
|
||||
}
|
||||
|
||||
public function all_donor()
|
||||
{
|
||||
$data = [];
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
|
||||
|
||||
$data['receiptdata']=$this->My_model->all_donor();
|
||||
echo view('templates/header',$data);
|
||||
echo view('donor_table');
|
||||
echo view('templates/footer');
|
||||
}
|
||||
function edit_donor($id)
|
||||
{
|
||||
$model = new My_model();
|
||||
$donor_data=$model->find($id);
|
||||
$data= [ 'post'=>$donor_data ];
|
||||
|
||||
if($this->request->getMethod() == 'post')
|
||||
{
|
||||
$model = new My_model();
|
||||
$_POST['id'] = $id;
|
||||
$model->save($_POST);
|
||||
return redirect()->to(base_url()."/My_controller/all_donor");
|
||||
}
|
||||
echo view('templates/header',$data);
|
||||
echo view('donor_edit');
|
||||
echo view('templates/footer');
|
||||
|
||||
}
|
||||
|
||||
function fetch_country()
|
||||
{
|
||||
|
||||
echo $this->Dashboard_model->fetch_country();
|
||||
|
||||
}
|
||||
function fetch_state()
|
||||
{
|
||||
|
||||
if($this->request->getVar('country_id'))
|
||||
{
|
||||
echo $this->Dashboard_model->fetch_state($this->request->getVar('country_id'));
|
||||
}
|
||||
}
|
||||
|
||||
function fetch_city()
|
||||
{
|
||||
if($this->request->getVar('state_id'))
|
||||
{
|
||||
echo $this->Dashboard_model->fetch_city($this->request->getVar('state_id'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
}
|
||||
18
app/Controllers/UsersRules.php
Normal file
18
app/Controllers/UsersRules.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace App\Validation;
|
||||
use App\Models\Donor_model;
|
||||
class UsersRules
|
||||
{
|
||||
|
||||
|
||||
public function validateDonor(string $str,string $fields,array $data)
|
||||
{
|
||||
$model = new Donor_model();
|
||||
$Donor = $model->where('email',$data['email'])
|
||||
->first();
|
||||
if($Donor)
|
||||
return false;
|
||||
return password_verify($data['password'],$Donor['password']);
|
||||
}
|
||||
|
||||
}
|
||||
20
app/Controllers/admin/Donation.php
Normal file
20
app/Controllers/admin/Donation.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php namespace App\Controllers;
|
||||
|
||||
class Donation extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
return view('show');
|
||||
}
|
||||
|
||||
|
||||
public function test($type,$type2)
|
||||
{
|
||||
echo '<h2>this is a product:'.$type.'and'.$type2.'</h2>';
|
||||
//return view('show');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
}
|
||||
0
app/Database/Migrations/.gitkeep
Normal file
0
app/Database/Migrations/.gitkeep
Normal file
0
app/Database/Seeds/.gitkeep
Normal file
0
app/Database/Seeds/.gitkeep
Normal file
0
app/Filters/.gitkeep
Normal file
0
app/Filters/.gitkeep
Normal file
0
app/Helpers/.gitkeep
Normal file
0
app/Helpers/.gitkeep
Normal file
0
app/Language/.gitkeep
Normal file
0
app/Language/.gitkeep
Normal file
4
app/Language/en/Validation.php
Normal file
4
app/Language/en/Validation.php
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
// override core en language system validation or define your own en language validation message
|
||||
return [];
|
||||
0
app/Libraries/.gitkeep
Normal file
0
app/Libraries/.gitkeep
Normal file
0
app/Models/.gitkeep
Normal file
0
app/Models/.gitkeep
Normal file
62
app/Models/Dashboard_model.php
Normal file
62
app/Models/Dashboard_model.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class Dashboard_model extends Model
|
||||
{
|
||||
public function getLoggedInUserData($id)
|
||||
{
|
||||
$builder = $this->db->table('user_management');
|
||||
$builder->where('id',$id);
|
||||
$result = $builder->get();
|
||||
if(count($result->getResultArray()) ==1)
|
||||
{
|
||||
return $result->getRow();
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
function fetch_country()
|
||||
{
|
||||
|
||||
$builder = $this->db->table('country');
|
||||
$query = $builder->get();
|
||||
//print_r($query);die();
|
||||
$output = '<option value="">Select Country</option>';
|
||||
foreach($query->getResult() as $row)
|
||||
{
|
||||
$output .= '<option value="'.$row->country_id.'">'.$row->country_name.'</option>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
function fetch_state($country_id)
|
||||
{
|
||||
|
||||
$builder = $this->db->table('state');
|
||||
$builder->where('country_id',$country_id);
|
||||
$query = $builder->get();
|
||||
//print_r($query);die();
|
||||
$output = '<option value="">Select State</option>';
|
||||
foreach($query->getResult() as $row)
|
||||
{
|
||||
$output .= '<option value="'.$row->state_id.'">'.$row->state_name.'</option>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
function fetch_city($state_id)
|
||||
{
|
||||
|
||||
$builder = $this->db->table('city');
|
||||
$builder->where('state_id',$state_id);
|
||||
$query = $builder->get();
|
||||
//print_r($query);die();
|
||||
$output = '<option value="">Select city</option>';
|
||||
foreach($query->getResult() as $row)
|
||||
{
|
||||
$output .= '<option value="'.$row->city_id.'">'.$row->city_name.'</option>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
37
app/Models/Donation_cause.php
Normal file
37
app/Models/Donation_cause.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class Donation_cause extends Model
|
||||
{
|
||||
protected $table = 'donation_cause';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $allowedFields = ['cause_name', 'from_date','to_date'];
|
||||
|
||||
|
||||
|
||||
function all_donation_cause()
|
||||
{
|
||||
|
||||
$builder = $this->db->table('donation_cause');
|
||||
$result = $builder->get();
|
||||
$output = $result->getResultArray();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// protected $returnType = 'array';
|
||||
// protected $useSoftDeletes = true;
|
||||
|
||||
|
||||
|
||||
// protected $useTimestamps = false;
|
||||
// protected $createdField = 'created_at';
|
||||
// protected $updatedField = 'updated_at';
|
||||
// protected $deletedField = 'deleted_at';
|
||||
|
||||
// protected $validationRules = [];
|
||||
// protected $validationMessages = [];
|
||||
// protected $skipValidation = false;
|
||||
}
|
||||
37
app/Models/Donation_data_model.php
Normal file
37
app/Models/Donation_data_model.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class Donation_data_model extends Model
|
||||
{
|
||||
protected $table = 'donation_data';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $allowedFields = ['date', 'cause_name','amount','mode_of_payment', 'ref_1','donation_ref'];
|
||||
|
||||
|
||||
|
||||
function all_donation_data()
|
||||
{
|
||||
|
||||
$builder = $this->db->table('donation_data');
|
||||
$result = $builder->get();
|
||||
$output = $result->getResultArray();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// protected $returnType = 'array';
|
||||
// protected $useSoftDeletes = true;
|
||||
|
||||
|
||||
|
||||
// protected $useTimestamps = false;
|
||||
// protected $createdField = 'created_at';
|
||||
// protected $updatedField = 'updated_at';
|
||||
// protected $deletedField = 'deleted_at';
|
||||
|
||||
// protected $validationRules = [];
|
||||
// protected $validationMessages = [];
|
||||
// protected $skipValidation = false;
|
||||
}
|
||||
25
app/Models/Donation_model.php
Normal file
25
app/Models/Donation_model.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class Donation_model extends Model
|
||||
{
|
||||
protected $table = 'firstci4';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $allowedFields = ['name', 'email','department'];
|
||||
|
||||
// protected $returnType = 'array';
|
||||
// protected $useSoftDeletes = true;
|
||||
|
||||
|
||||
|
||||
// protected $useTimestamps = false;
|
||||
// protected $createdField = 'created_at';
|
||||
// protected $updatedField = 'updated_at';
|
||||
// protected $deletedField = 'deleted_at';
|
||||
|
||||
// protected $validationRules = [];
|
||||
// protected $validationMessages = [];
|
||||
// protected $skipValidation = false;
|
||||
}
|
||||
60
app/Models/Donor_model.php
Normal file
60
app/Models/Donor_model.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class Donor_model extends Model
|
||||
{
|
||||
protected $table = 'user_management';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $allowedFields = ['name', 'phone','email','pan', 'address','country','state','city','pin_code','date_of_birth','gender', 'org_name','gstin','foreign_key', 'password','updated_at'];
|
||||
|
||||
protected $beforeInsert = ['beforeInsert'];
|
||||
protected $beforeUpdate = ['beforeUpdate'];
|
||||
|
||||
protected function beforeInsert(array $data){
|
||||
$data= $this->passwordHash($data);
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function beforeUpdate(array $data){
|
||||
$data= $this->passwordHash($data);
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function passwordHash(array $data)
|
||||
{
|
||||
if(isset($data['data']['password']))
|
||||
$data['data']['password'] = password_hash($data['data']['password'],PASSWORD_DEFAULT);
|
||||
return $data;
|
||||
}
|
||||
public function verifyEmail($email)
|
||||
{
|
||||
|
||||
$builder = $this->db->table('user_management');
|
||||
$builder -> select("id,phone,email,password");
|
||||
$builder -> where('email',$email);
|
||||
$result = $builder->get();
|
||||
if(count($result->getResultArray()) ==1)
|
||||
{
|
||||
return $result->getRowArray();
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// protected $returnType = 'array';
|
||||
// protected $useSoftDeletes = true;
|
||||
|
||||
|
||||
|
||||
// protected $useTimestamps = false;
|
||||
// protected $createdField = 'created_at';
|
||||
// protected $updatedField = 'updated_at';
|
||||
// protected $deletedField = 'deleted_at';
|
||||
|
||||
// protected $validationRules = [];
|
||||
// protected $validationMessages = [];
|
||||
// protected $skipValidation = false;
|
||||
}
|
||||
48
app/Models/My_model.php
Normal file
48
app/Models/My_model.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class My_model extends Model
|
||||
{
|
||||
protected $table = 'donar_management';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $allowedFields = ['name', 'phone','email','pan', 'address','country','state','city','pin_code','date_of_birth','gender', 'org_name','gstin','updated_at'];
|
||||
|
||||
|
||||
function all_donor()
|
||||
{
|
||||
|
||||
$builder = $this->db->table('donar_management');
|
||||
$result = $builder->get();
|
||||
$output = $result->getResultArray();
|
||||
return $output;
|
||||
}
|
||||
function fetch_donor_id()
|
||||
{
|
||||
|
||||
$builder = $this->db->table('donar_management');
|
||||
$query = $builder->get();
|
||||
//print_r($query);die();
|
||||
$output = '<option value="">Select Donor Id</option>';
|
||||
foreach($query->getResult() as $row)
|
||||
{
|
||||
$output .= '<option value="'.$row->id.'">'.$row->name.'</option>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
// protected $returnType = 'array';
|
||||
// protected $useSoftDeletes = true;
|
||||
|
||||
|
||||
|
||||
// protected $useTimestamps = false;
|
||||
// protected $createdField = 'created_at';
|
||||
// protected $updatedField = 'updated_at';
|
||||
// protected $deletedField = 'deleted_at';
|
||||
|
||||
// protected $validationRules = [];
|
||||
// protected $validationMessages = [];
|
||||
// protected $skipValidation = false;
|
||||
}
|
||||
37
app/Models/Receipt_model.php
Normal file
37
app/Models/Receipt_model.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class Receipt_model extends Model
|
||||
{
|
||||
protected $table = 'receipts';
|
||||
protected $primaryKey = 'receipt_id';
|
||||
|
||||
protected $allowedFields = ['receipt_no', 'date','donor_id','amount', 'mode_of_receipt','receipt_details','cause_name', 'remarks'];
|
||||
|
||||
|
||||
|
||||
function all_receipt()
|
||||
{
|
||||
|
||||
$builder = $this->db->table('receipts');
|
||||
$result = $builder->get();
|
||||
$output = $result->getResultArray();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// protected $returnType = 'array';
|
||||
// protected $useSoftDeletes = true;
|
||||
|
||||
|
||||
|
||||
// protected $useTimestamps = false;
|
||||
// protected $createdField = 'created_at';
|
||||
// protected $updatedField = 'updated_at';
|
||||
// protected $deletedField = 'deleted_at';
|
||||
|
||||
// protected $validationRules = [];
|
||||
// protected $validationMessages = [];
|
||||
// protected $skipValidation = false;
|
||||
}
|
||||
37
app/Models/Transaction_model.php
Normal file
37
app/Models/Transaction_model.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class Transaction_model extends Model
|
||||
{
|
||||
protected $table = 'transactions_uploads';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $allowedFields = ['date', 'ref_1','ref_2','remarks', 'amount','donation_ref'];
|
||||
|
||||
|
||||
|
||||
function all_transaction()
|
||||
{
|
||||
|
||||
$builder = $this->db->table('transactions_uploads');
|
||||
$result = $builder->get();
|
||||
$output = $result->getResultArray();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// protected $returnType = 'array';
|
||||
// protected $useSoftDeletes = true;
|
||||
|
||||
|
||||
|
||||
// protected $useTimestamps = false;
|
||||
// protected $createdField = 'created_at';
|
||||
// protected $updatedField = 'updated_at';
|
||||
// protected $deletedField = 'deleted_at';
|
||||
|
||||
// protected $validationRules = [];
|
||||
// protected $validationMessages = [];
|
||||
// protected $skipValidation = false;
|
||||
}
|
||||
0
app/ThirdParty/.gitkeep
vendored
Normal file
0
app/ThirdParty/.gitkeep
vendored
Normal file
19
app/Validation/UsersRules.php
Normal file
19
app/Validation/UsersRules.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace App\Validation;
|
||||
use App\Models\Donor_model;
|
||||
class UsersRules
|
||||
{
|
||||
|
||||
|
||||
public function validateDonor(string $str , string $fields ,array $data)
|
||||
{
|
||||
$model = new Donor_model();
|
||||
$user = $model->where('email',$data['email'])
|
||||
->first();
|
||||
if(!$Donor)
|
||||
return false;
|
||||
|
||||
return password_verify($data['password'],$user['password']);
|
||||
}
|
||||
|
||||
}
|
||||
87
app/Views/add_donation_cause.php
Normal file
87
app/Views/add_donation_cause.php
Normal file
@ -0,0 +1,87 @@
|
||||
<div class="container">
|
||||
|
||||
<div class="container register-form">
|
||||
</br>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Donation Cause</h2>
|
||||
</div></div></br>
|
||||
<div class="form">
|
||||
|
||||
<div class="form-content">
|
||||
<form id="cause_form" method="post" action="" >
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="CAUSE NAME" name="cause_name" value=""/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control date-input" placeholder="FROM*" name="from_date" id="txtDate" value=""/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="TO*" name="to_date" id="txtDate2" value=""/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3"></div><div class="col-md-8">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</br></br>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Donation Cause List</h2>
|
||||
</div></div></br>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<table class="table" id="cause_table">
|
||||
<tr>
|
||||
|
||||
<th> Cause Name</th>
|
||||
<th> From Date</th>
|
||||
<th> To Date</th>
|
||||
<th> Action</th>
|
||||
|
||||
</tr>
|
||||
<?php foreach ($donationcause as $row)
|
||||
{ ?>
|
||||
<tr>
|
||||
<td><?php echo $row['cause_name'];?></td>
|
||||
<td><?php echo $row['from_date'];?></td>
|
||||
<td><?php echo $row['to_date'];?></td>
|
||||
|
||||
<td><a href="<?= base_url() ?>/Dashboard/edit_donation_data/<?php echo $row['id'];?>">Edit</a></td>
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
14
app/Views/dashboard.php
Normal file
14
app/Views/dashboard.php
Normal file
@ -0,0 +1,14 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<h1>Welcome , <?= ucfirst($userdata->name);?> </h1></br>
|
||||
<h4>Mobile:<?= $userdata->phone;?></h4></br>
|
||||
<h4>Email :<?= $userdata->email;?></h4></br>
|
||||
<h4>Organization Name :<?= $userdata->org_name;?></h4></br>
|
||||
<h4></h4></br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
59
app/Views/donation_data.php
Normal file
59
app/Views/donation_data.php
Normal file
@ -0,0 +1,59 @@
|
||||
<div class="container">
|
||||
|
||||
<div class="container register-form">
|
||||
</br>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Transaction upload</h2>
|
||||
</div></div></br>
|
||||
<div class="form">
|
||||
|
||||
<div class="form-content">
|
||||
<form class="" method="post" action="<?= base_url()."/donation_data"; ?>" >
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value=""/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="AMOUNT" name="amount" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="CAUSE NAME" name="cause_name" value=""/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="PAYMENT MODE" name="mode_of_payment" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="REF 1" name="ref_1" value=""/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Donation Referal" name="donation_ref" value=""/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div><div class="col-md-8">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
59
app/Views/donation_data_edit.php
Normal file
59
app/Views/donation_data_edit.php
Normal file
@ -0,0 +1,59 @@
|
||||
<div class="container">
|
||||
|
||||
<div class="container register-form">
|
||||
</br>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Donation Data Edit</h2>
|
||||
</div></div></br>
|
||||
<div class="form">
|
||||
|
||||
<div class="form-content">
|
||||
<form class="" method="post" action="" >
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value="<?= $post['date'] ?>"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="AMOUNT" name="amount" value="<?= $post['amount'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="CAUSE NAME" name="cause_name" value="<?= $post['cause_name'] ?>"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="PAYMENT MODE" name="mode_of_payment" value="<?= $post['mode_of_payment'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="REF 1" name="ref_1" value="<?= $post['ref_1'] ?>"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Donation Referal" name="donation_ref" value="<?= $post['donation_ref'] ?>"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div><div class="col-md-8">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
40
app/Views/donation_data_table.php
Normal file
40
app/Views/donation_data_table.php
Normal file
@ -0,0 +1,40 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Donation Data</h2>
|
||||
</div></div></br>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th> Donation Date</th>
|
||||
<th> Cause Name</th>
|
||||
<th> Amount</th>
|
||||
<th> Payment Mode</th>
|
||||
<th> Referance 1</th>
|
||||
<th> Donation Ref</th>
|
||||
<th> Action</th>
|
||||
|
||||
</tr>
|
||||
<?php foreach ($donationdata as $row)
|
||||
{ ?>
|
||||
<tr>
|
||||
<td><?php echo $row['date'];?></td>
|
||||
<td><?php echo $row['cause_name'];?></td>
|
||||
<td><?php echo $row['amount'];?></td>
|
||||
<td><?php echo $row['mode_of_payment'];?></td>
|
||||
<td><?php echo $row['ref_1'];?></td>
|
||||
<td><?php echo $row['donation_ref'];?></td>
|
||||
<td><a href="<?= base_url() ?>/Dashboard/edit_donation_data/<?php echo $row['id'];?>">Edit</a></td>
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
150
app/Views/donor_edit.php
Normal file
150
app/Views/donor_edit.php
Normal file
@ -0,0 +1,150 @@
|
||||
|
||||
<div class="container">
|
||||
|
||||
|
||||
|
||||
<h3> REGISTER </h3>
|
||||
|
||||
<form class="" method="post" action="" >
|
||||
<div class="">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Name</h4></label>
|
||||
<input type="text" class="form-control" name="name" id = "name" value="<?= $post['name'] ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Mobile</h4></label>
|
||||
<input type="text" class="form-control" name="phone" id="phone" value="<?= $post['phone'] ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Email</h4></label>
|
||||
<input type="text" class="form-control" name="email" id="email" value="<?= $post['email'] ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>PAN No</h4></label>
|
||||
<input type="text" class="form-control" name="pan" id="pan" value="<?= $post['pan'] ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Address</h4></label>
|
||||
<input type="text" class="form-control" name="address" id="address" value="<?= $post['address'] ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="password2"><h4>Country</h4></label>
|
||||
<select name="country" id="country0" class="form-control ">
|
||||
<option value="<?=$post['country'] ?>"><?=$post['country'] ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="password2"><h4>State</h4></label>
|
||||
<select name="state" id="state0" class="form-control ">
|
||||
<option value="<?=$post['state'] ?>"><?=$post['state'] ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="password2"><h4>City</h4></label>
|
||||
<select name="city" id="city0" class="form-control ">
|
||||
<option value="<?=$post['city'] ?>"><?=$post['city'] ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="password2"><h4>Pin Code</h4></label>
|
||||
<input type="text" class="form-control" name="pin_code" id="pin_code" value="<?= $post['pin_code'] ?>">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Date of Birth</h4></label>
|
||||
<input type="text" class="form-control" name="date_of_birth" id="txtDate" value="<?= $post['date_of_birth'] ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Gender</h4></label>
|
||||
<select class="form-control" name="gender" required>
|
||||
<option value="<?= $post['gender'] ?>"><?= $post['gender'] ?></option>
|
||||
<option value="Male">Male</option>
|
||||
<option value="Female">Female</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Org Name</h4></label>
|
||||
<input type="text" class="form-control" name="org_name" id="org_name" value="<?= $post['org_name'] ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>GSTIN</h4></label>
|
||||
<input type="text" class="form-control" name="gstin" id="gstin" value="<?= $post['gstin'] ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</br>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<button type="submit" class="btn btn-primary">Update</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div></div>
|
||||
156
app/Views/donor_registration.php
Normal file
156
app/Views/donor_registration.php
Normal file
@ -0,0 +1,156 @@
|
||||
|
||||
<div class="container">
|
||||
|
||||
|
||||
|
||||
<h3> REGISTER </h3>
|
||||
|
||||
<form class="" method="post" action="<?= base_url()."/donor_register"; ?>" >
|
||||
<div class="">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Name</h4></label>
|
||||
<input type="text" class="form-control" name="name" id = "name" value="<?= set_value('name') ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Mobile</h4></label>
|
||||
<input type="text" class="form-control" name="phone" id="phone" value="<?= set_value('phone') ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Email</h4></label>
|
||||
<input type="text" class="form-control" name="email" id="email" value="<?= set_value('email') ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>PAN No</h4></label>
|
||||
<input type="text" class="form-control" name="pan" id="pan" value="<?= set_value('pan') ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Address</h4></label>
|
||||
<input type="text" class="form-control" name="address" id="address" placeholder="Flat No,Area" value="<?= set_value('address') ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="password2"><h4>Country</h4></label>
|
||||
<select name="country" id="country0" class="form-control ">
|
||||
<option value="">Select Country</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="password2"><h4>State</h4></label>
|
||||
<select name="state" id="state0" class="form-control ">
|
||||
<option value="">Select State</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="password2"><h4>City</h4></label>
|
||||
<select name="city" id="city0" class="form-control ">
|
||||
<option value="">Select City</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="password2"><h4>Pin Code</h4></label>
|
||||
<input type="text" class="form-control" name="pin_code" id="pin_code" >
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Date of Birth</h4></label>
|
||||
<input type="text" class="form-control" name="date_of_birth" id="txtDate" placeholder="dd/mm/yyyy" value="<?= set_value('date_of_birth') ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Gender</h4></label>
|
||||
<select class="form-control" name="gender" required>
|
||||
<option value="">select Gender</option>
|
||||
<option value="Male">Male</option>
|
||||
<option value="Female">Female</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Org Name</h4></label>
|
||||
<input type="text" class="form-control" name="org_name" id="org_name" value="<?= set_value('org_name') ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>GSTIN</h4></label>
|
||||
<input type="text" class="form-control" name="gstin" id="gstin" value="<?= set_value('gstin') ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</br>
|
||||
|
||||
<?php if(isset($validation)): ?>
|
||||
<div class="col-12">
|
||||
<div class="alert alert-danger" role="aler">
|
||||
<?= $validation->listErrors() ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<button type="submit" class="btn btn-primary">Register</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div></div>
|
||||
45
app/Views/donor_table.php
Normal file
45
app/Views/donor_table.php
Normal file
@ -0,0 +1,45 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Donors List</h2>
|
||||
</div></div></br>
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th> Name</th>
|
||||
<th> Phone</th>
|
||||
<th> Email</th>
|
||||
<th> Pan </th>
|
||||
<th> Address</th>
|
||||
<th> DOB</th>
|
||||
<th> Gender</th>
|
||||
<th> Org Name</th>
|
||||
<th> GSTIN</th>
|
||||
<th> Action</th>
|
||||
|
||||
</tr>
|
||||
<?php foreach ($receiptdata as $row)
|
||||
{ ?>
|
||||
<tr>
|
||||
<td><?php echo $row['name'];?></td>
|
||||
<td><?php echo $row['phone'];?></td>
|
||||
<td><?php echo $row['email'];?></td>
|
||||
<td><?php echo $row['pan'];?></td>
|
||||
<td><?php echo $row['address'];?></td>
|
||||
<td><?php echo $row['date_of_birth'];?></td>
|
||||
<td><?php echo $row['gender'];?></td>
|
||||
<td><?php echo $row['org_name'];?></td>
|
||||
<td><?php echo $row['gstin'];?></td>
|
||||
<td><a href="<?= base_url() ?>/My_controller/edit_donor/<?php echo $row['id'];?>">Edit</a></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
9
app/Views/edit_view.php
Normal file
9
app/Views/edit_view.php
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
<form method="post" action="<?= base_url(); ?>/Home/update">
|
||||
<input type="hidden" name="id" value="<?= $post['id']; ?>">
|
||||
<input type="text" name="name" value="<?= $post['name']; ?>">
|
||||
<input type="text" name="email" value="<?= $post['email']; ?>">
|
||||
<input type="submit" value="update">
|
||||
</form>
|
||||
|
||||
|
||||
6
app/Views/errors/cli/error_404.php
Normal file
6
app/Views/errors/cli/error_404.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
use CodeIgniter\CLI\CLI;
|
||||
|
||||
CLI::error('ERROR: ' . $code);
|
||||
CLI::write($message);
|
||||
CLI::newLine();
|
||||
17
app/Views/errors/cli/error_exception.php
Normal file
17
app/Views/errors/cli/error_exception.php
Normal file
@ -0,0 +1,17 @@
|
||||
An uncaught Exception was encountered
|
||||
|
||||
Type: <?= get_class($exception), "\n"; ?>
|
||||
Message: <?= $message, "\n"; ?>
|
||||
Filename: <?= $exception->getFile(), "\n"; ?>
|
||||
Line Number: <?= $exception->getLine(); ?>
|
||||
|
||||
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === true): ?>
|
||||
|
||||
Backtrace:
|
||||
<?php foreach ($exception->getTrace() as $error): ?>
|
||||
<?php if (isset($error['file'])): ?>
|
||||
<?= trim('-' . $error['line'] . ' - ' . $error['file'] . '::' . $error['function']) . "\n" ?>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
|
||||
<?php endif ?>
|
||||
5
app/Views/errors/cli/production.php
Normal file
5
app/Views/errors/cli/production.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
// On the CLI, we still want errors in productions
|
||||
// so just use the exception template.
|
||||
include __DIR__ . '/error_exception.php';
|
||||
177
app/Views/errors/html/debug.css
Normal file
177
app/Views/errors/html/debug.css
Normal file
@ -0,0 +1,177 @@
|
||||
body {
|
||||
height: 100%;
|
||||
background: #fafafa;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
color: #777;
|
||||
font-weight: 300;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
h1 {
|
||||
font-weight: lighter;
|
||||
letter-spacing: 0.8;
|
||||
font-size: 3rem;
|
||||
color: #222;
|
||||
margin: 0;
|
||||
}
|
||||
h1.headline {
|
||||
margin-top: 20%;
|
||||
font-size: 5rem;
|
||||
}
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
p.lead {
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
.container {
|
||||
max-width: 75rem;
|
||||
margin: 0 auto;
|
||||
padding: 1rem;
|
||||
}
|
||||
.header {
|
||||
background: #85271f;
|
||||
color: #fff;
|
||||
}
|
||||
.header h1 {
|
||||
color: #fff;
|
||||
}
|
||||
.header p {
|
||||
font-size: 1.2rem;
|
||||
margin: 0;
|
||||
line-height: 2.5;
|
||||
}
|
||||
.header a {
|
||||
color: rgba(255,255,255,0.5);
|
||||
margin-left: 2rem;
|
||||
display: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
.header:hover a {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.footer .container {
|
||||
border-top: 1px solid #e7e7e7;
|
||||
margin-top: 1rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.source {
|
||||
background: #333;
|
||||
color: #c7c7c7;
|
||||
padding: 0.5em 1em;
|
||||
border-radius: 5px;
|
||||
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
||||
margin: 0;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.source span.line {
|
||||
line-height: 1.4;
|
||||
}
|
||||
.source span.line .number {
|
||||
color: #666;
|
||||
}
|
||||
.source .line .highlight {
|
||||
display: block;
|
||||
background: #555;
|
||||
color: #fff;
|
||||
}
|
||||
.source span.highlight .number {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
list-style: none;
|
||||
list-style-position: inside;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
.tabs li {
|
||||
display: inline;
|
||||
}
|
||||
.tabs a:link,
|
||||
.tabs a:visited {
|
||||
padding: 0rem 1rem;
|
||||
line-height: 2.7;
|
||||
text-decoration: none;
|
||||
color: #a7a7a7;
|
||||
background: #f1f1f1;
|
||||
border: 1px solid #e7e7e7;
|
||||
border-bottom: 0;
|
||||
border-top-left-radius: 5px;
|
||||
border-top-right-radius: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
.tabs a:hover {
|
||||
background: #e7e7e7;
|
||||
border-color: #e1e1e1;
|
||||
}
|
||||
.tabs a.active {
|
||||
background: #fff;
|
||||
}
|
||||
.tab-content {
|
||||
background: #fff;
|
||||
border: 1px solid #efefef;
|
||||
}
|
||||
.content {
|
||||
padding: 1rem;
|
||||
}
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.alert {
|
||||
margin-top: 2rem;
|
||||
display: block;
|
||||
text-align: center;
|
||||
line-height: 3.0;
|
||||
background: #d9edf7;
|
||||
border: 1px solid #bcdff1;
|
||||
border-radius: 5px;
|
||||
color: #31708f;
|
||||
}
|
||||
ul, ol {
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
th {
|
||||
text-align: left;
|
||||
border-bottom: 1px solid #e7e7e7;
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
td {
|
||||
padding: 0.2rem 0.5rem 0.2rem 0;
|
||||
}
|
||||
tr:hover td {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
td pre {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.trace a {
|
||||
color: inherit;
|
||||
}
|
||||
.trace table {
|
||||
width: auto;
|
||||
}
|
||||
.trace tr td:first-child {
|
||||
min-width: 5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
.trace td {
|
||||
background: #e7e7e7;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
.trace td pre {
|
||||
margin: 0;
|
||||
}
|
||||
.args {
|
||||
display: none;
|
||||
}
|
||||
127
app/Views/errors/html/debug.js
Normal file
127
app/Views/errors/html/debug.js
Normal file
@ -0,0 +1,127 @@
|
||||
//--------------------------------------------------------------------
|
||||
// Tabs
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
var tabLinks = new Array();
|
||||
var contentDivs = new Array();
|
||||
|
||||
function init ()
|
||||
{
|
||||
|
||||
// Grab the tab links and content divs from the page
|
||||
var tabListItems = document.getElementById('tabs').childNodes;
|
||||
console.log(tabListItems);
|
||||
for (var i = 0; i < tabListItems.length; i ++)
|
||||
{
|
||||
if (tabListItems[i].nodeName == "LI")
|
||||
{
|
||||
var tabLink = getFirstChildWithTagName(tabListItems[i], 'A');
|
||||
var id = getHash(tabLink.getAttribute('href'));
|
||||
tabLinks[id] = tabLink;
|
||||
contentDivs[id] = document.getElementById(id);
|
||||
}
|
||||
}
|
||||
|
||||
// Assign onclick events to the tab links, and
|
||||
// highlight the first tab
|
||||
var i = 0;
|
||||
|
||||
for (var id in tabLinks)
|
||||
{
|
||||
tabLinks[id].onclick = showTab;
|
||||
tabLinks[id].onfocus = function () { this.blur() };
|
||||
if (i == 0)
|
||||
{
|
||||
tabLinks[id].className = 'active';
|
||||
}
|
||||
i ++;
|
||||
}
|
||||
|
||||
// Hide all content divs except the first
|
||||
var i = 0;
|
||||
|
||||
for (var id in contentDivs)
|
||||
{
|
||||
if (i != 0)
|
||||
{
|
||||
console.log(contentDivs[id]);
|
||||
contentDivs[id].className = 'content hide';
|
||||
}
|
||||
i ++;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
function showTab ()
|
||||
{
|
||||
var selectedId = getHash(this.getAttribute('href'));
|
||||
|
||||
// Highlight the selected tab, and dim all others.
|
||||
// Also show the selected content div, and hide all others.
|
||||
for (var id in contentDivs)
|
||||
{
|
||||
if (id == selectedId)
|
||||
{
|
||||
tabLinks[id].className = 'active';
|
||||
contentDivs[id].className = 'content';
|
||||
}
|
||||
else
|
||||
{
|
||||
tabLinks[id].className = '';
|
||||
contentDivs[id].className = 'content hide';
|
||||
}
|
||||
}
|
||||
|
||||
// Stop the browser following the link
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
function getFirstChildWithTagName (element, tagName)
|
||||
{
|
||||
for (var i = 0; i < element.childNodes.length; i ++)
|
||||
{
|
||||
if (element.childNodes[i].nodeName == tagName)
|
||||
{
|
||||
return element.childNodes[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
function getHash (url)
|
||||
{
|
||||
var hashPos = url.lastIndexOf('#');
|
||||
return url.substring(hashPos + 1);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
function toggle (elem)
|
||||
{
|
||||
elem = document.getElementById(elem);
|
||||
|
||||
if (elem.style && elem.style['display'])
|
||||
{
|
||||
// Only works with the "style" attr
|
||||
var disp = elem.style['display'];
|
||||
}
|
||||
else if (elem.currentStyle)
|
||||
{
|
||||
// For MSIE, naturally
|
||||
var disp = elem.currentStyle['display'];
|
||||
}
|
||||
else if (window.getComputedStyle)
|
||||
{
|
||||
// For most other browsers
|
||||
var disp = document.defaultView.getComputedStyle(elem, null).getPropertyValue('display');
|
||||
}
|
||||
|
||||
// Toggle the state of the "display" style
|
||||
elem.style.display = disp == 'block' ? 'none' : 'block';
|
||||
|
||||
return false;
|
||||
}
|
||||
84
app/Views/errors/html/error_404.php
Normal file
84
app/Views/errors/html/error_404.php
Normal file
@ -0,0 +1,84 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>404 Page Not Found</title>
|
||||
|
||||
<style>
|
||||
div.logo {
|
||||
height: 200px;
|
||||
width: 155px;
|
||||
display: inline-block;
|
||||
opacity: 0.08;
|
||||
position: absolute;
|
||||
top: 2rem;
|
||||
left: 50%;
|
||||
margin-left: -73px;
|
||||
}
|
||||
body {
|
||||
height: 100%;
|
||||
background: #fafafa;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
color: #777;
|
||||
font-weight: 300;
|
||||
}
|
||||
h1 {
|
||||
font-weight: lighter;
|
||||
letter-spacing: 0.8;
|
||||
font-size: 3rem;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
color: #222;
|
||||
}
|
||||
.wrap {
|
||||
max-width: 1024px;
|
||||
margin: 5rem auto;
|
||||
padding: 2rem;
|
||||
background: #fff;
|
||||
text-align: center;
|
||||
border: 1px solid #efefef;
|
||||
border-radius: 0.5rem;
|
||||
position: relative;
|
||||
}
|
||||
pre {
|
||||
white-space: normal;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
code {
|
||||
background: #fafafa;
|
||||
border: 1px solid #efefef;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 5px;
|
||||
display: block;
|
||||
}
|
||||
p {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
.footer {
|
||||
margin-top: 2rem;
|
||||
border-top: 1px solid #efefef;
|
||||
padding: 1em 2em 0 2em;
|
||||
font-size: 85%;
|
||||
color: #999;
|
||||
}
|
||||
a:active,
|
||||
a:link,
|
||||
a:visited {
|
||||
color: #dd4814;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<h1>404 - File Not Found</h1>
|
||||
|
||||
<p>
|
||||
<?php if (! empty($message) && $message !== '(null)') : ?>
|
||||
<?= esc($message) ?>
|
||||
<?php else : ?>
|
||||
Sorry! Cannot seem to find the page you were looking for.
|
||||
<?php endif ?>
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
401
app/Views/errors/html/error_exception.php
Normal file
401
app/Views/errors/html/error_exception.php
Normal file
@ -0,0 +1,401 @@
|
||||
<?php $error_id = uniqid('error', true); ?>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="robots" content="noindex">
|
||||
|
||||
<title><?= htmlspecialchars($title, ENT_SUBSTITUTE, 'UTF-8') ?></title>
|
||||
<style type="text/css">
|
||||
<?= preg_replace('#[\r\n\t ]+#', ' ', file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'debug.css')) ?>
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
<?= file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'debug.js') ?>
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
|
||||
<!-- Header -->
|
||||
<div class="header">
|
||||
<div class="container">
|
||||
<h1><?= htmlspecialchars($title, ENT_SUBSTITUTE, 'UTF-8'), ($exception->getCode() ? ' #' . $exception->getCode() : '') ?></h1>
|
||||
<p>
|
||||
<?= $exception->getMessage() ?>
|
||||
<a href="https://www.google.com/search?q=<?= urlencode($title . ' ' . preg_replace('#\'.*\'|".*"#Us', '', $exception->getMessage())) ?>"
|
||||
rel="noreferrer" target="_blank">search →</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Source -->
|
||||
<div class="container">
|
||||
<p><b><?= static::cleanPath($file, $line) ?></b> at line <b><?= $line ?></b></p>
|
||||
|
||||
<?php if (is_file($file)) : ?>
|
||||
<div class="source">
|
||||
<?= static::highlightFile($file, $line, 15); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<ul class="tabs" id="tabs">
|
||||
<li><a href="#backtrace">Backtrace</a></li>
|
||||
<li><a href="#server">Server</a></li>
|
||||
<li><a href="#request">Request</a></li>
|
||||
<li><a href="#response">Response</a></li>
|
||||
<li><a href="#files">Files</a></li>
|
||||
<li><a href="#memory">Memory</a></li>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<!-- Backtrace -->
|
||||
<div class="content" id="backtrace">
|
||||
|
||||
<ol class="trace">
|
||||
<?php foreach ($trace as $index => $row) : ?>
|
||||
|
||||
<li>
|
||||
<p>
|
||||
<!-- Trace info -->
|
||||
<?php if (isset($row['file']) && is_file($row['file'])) :?>
|
||||
<?php
|
||||
if (isset($row['function']) && in_array($row['function'], ['include', 'include_once', 'require', 'require_once']))
|
||||
{
|
||||
echo $row['function'] . ' ' . static::cleanPath($row['file']);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo static::cleanPath($row['file']) . ' : ' . $row['line'];
|
||||
}
|
||||
?>
|
||||
<?php else : ?>
|
||||
{PHP internal code}
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Class/Method -->
|
||||
<?php if (isset($row['class'])) : ?>
|
||||
— <?= $row['class'] . $row['type'] . $row['function'] ?>
|
||||
<?php if (! empty($row['args'])) : ?>
|
||||
<?php $args_id = $error_id . 'args' . $index ?>
|
||||
( <a href="#" onclick="return toggle('<?= $args_id ?>');">arguments</a> )
|
||||
<div class="args" id="<?= $args_id ?>">
|
||||
<table cellspacing="0">
|
||||
|
||||
<?php
|
||||
$params = null;
|
||||
// Reflection by name is not available for closure function
|
||||
if (substr( $row['function'], -1 ) !== '}')
|
||||
{
|
||||
$mirror = isset( $row['class'] ) ? new \ReflectionMethod( $row['class'], $row['function'] ) : new \ReflectionFunction( $row['function'] );
|
||||
$params = $mirror->getParameters();
|
||||
}
|
||||
foreach ($row['args'] as $key => $value) : ?>
|
||||
<tr>
|
||||
<td><code><?= htmlspecialchars(isset($params[$key]) ? '$' . $params[$key]->name : "#$key", ENT_SUBSTITUTE, 'UTF-8') ?></code></td>
|
||||
<td><pre><?= print_r($value, true) ?></pre></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
()
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (! isset($row['class']) && isset($row['function'])) : ?>
|
||||
— <?= $row['function'] ?>()
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
<!-- Source? -->
|
||||
<?php if (isset($row['file']) && is_file($row['file']) && isset($row['class'])) : ?>
|
||||
<div class="source">
|
||||
<?= static::highlightFile($row['file'], $row['line']) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Server -->
|
||||
<div class="content" id="server">
|
||||
<?php foreach (['_SERVER', '_SESSION'] as $var) : ?>
|
||||
<?php if (empty($GLOBALS[$var]) || ! is_array($GLOBALS[$var]))
|
||||
{
|
||||
continue;
|
||||
} ?>
|
||||
|
||||
<h3>$<?= $var ?></h3>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Key</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($GLOBALS[$var] as $key => $value) : ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($key, ENT_IGNORE, 'UTF-8') ?></td>
|
||||
<td>
|
||||
<?php if (is_string($value)) : ?>
|
||||
<?= htmlspecialchars($value, ENT_SUBSTITUTE, 'UTF-8') ?>
|
||||
<?php else: ?>
|
||||
<?= '<pre>' . print_r($value, true) ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php endforeach ?>
|
||||
|
||||
<!-- Constants -->
|
||||
<?php $constants = get_defined_constants(true); ?>
|
||||
<?php if (! empty($constants['user'])) : ?>
|
||||
<h3>Constants</h3>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Key</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($constants['user'] as $key => $value) : ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($key, ENT_IGNORE, 'UTF-8') ?></td>
|
||||
<td>
|
||||
<?php if (! is_array($value) && ! is_object($value)) : ?>
|
||||
<?= htmlspecialchars($value, ENT_SUBSTITUTE, 'UTF-8') ?>
|
||||
<?php else: ?>
|
||||
<?= '<pre>' . print_r($value, true) ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<!-- Request -->
|
||||
<div class="content" id="request">
|
||||
<?php $request = \Config\Services::request(); ?>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 10em">Path</td>
|
||||
<td><?= $request->uri ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>HTTP Method</td>
|
||||
<td><?= $request->getMethod(true) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IP Address</td>
|
||||
<td><?= $request->getIPAddress() ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 10em">Is AJAX Request?</td>
|
||||
<td><?= $request->isAJAX() ? 'yes' : 'no' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Is CLI Request?</td>
|
||||
<td><?= $request->isCLI() ? 'yes' : 'no' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Is Secure Request?</td>
|
||||
<td><?= $request->isSecure() ? 'yes' : 'no' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>User Agent</td>
|
||||
<td><?= $request->getUserAgent()->getAgentString() ?></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<?php $empty = true; ?>
|
||||
<?php foreach (['_GET', '_POST', '_COOKIE'] as $var) : ?>
|
||||
<?php if (empty($GLOBALS[$var]) || ! is_array($GLOBALS[$var]))
|
||||
{
|
||||
continue;
|
||||
} ?>
|
||||
|
||||
<?php $empty = false; ?>
|
||||
|
||||
<h3>$<?= $var ?></h3>
|
||||
|
||||
<table style="width: 100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Key</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($GLOBALS[$var] as $key => $value) : ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($key, ENT_IGNORE, 'UTF-8') ?></td>
|
||||
<td>
|
||||
<?php if (! is_array($value) && ! is_object($value)) : ?>
|
||||
<?= htmlspecialchars($value, ENT_SUBSTITUTE, 'UTF-8') ?>
|
||||
<?php else: ?>
|
||||
<?= '<pre>' . print_r($value, true) ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php endforeach ?>
|
||||
|
||||
<?php if ($empty) : ?>
|
||||
|
||||
<div class="alert">
|
||||
No $_GET, $_POST, or $_COOKIE Information to show.
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $headers = $request->getHeaders(); ?>
|
||||
<?php if (! empty($headers)) : ?>
|
||||
|
||||
<h3>Headers</h3>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Header</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($headers as $value) : ?>
|
||||
<?php if (empty($value))
|
||||
{
|
||||
continue;
|
||||
} ?>
|
||||
<?php if (! is_array($value))
|
||||
{
|
||||
$value = [$value];
|
||||
} ?>
|
||||
<?php foreach ($value as $h) : ?>
|
||||
<tr>
|
||||
<td><?= esc($h->getName(), 'html') ?></td>
|
||||
<td><?= esc($h->getValueLine(), 'html') ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<!-- Response -->
|
||||
<?php
|
||||
$response = \Config\Services::response();
|
||||
$response->setStatusCode(http_response_code());
|
||||
?>
|
||||
<div class="content" id="response">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 15em">Response Status</td>
|
||||
<td><?= $response->getStatusCode() . ' - ' . $response->getReason() ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php $headers = $response->getHeaders(); ?>
|
||||
<?php if (! empty($headers)) : ?>
|
||||
<?php natsort($headers) ?>
|
||||
|
||||
<h3>Headers</h3>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Header</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($headers as $name => $value) : ?>
|
||||
<tr>
|
||||
<td><?= esc($name, 'html') ?></td>
|
||||
<td><?= esc($response->getHeaderLine($name), 'html') ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<!-- Files -->
|
||||
<div class="content" id="files">
|
||||
<?php $files = get_included_files(); ?>
|
||||
|
||||
<ol>
|
||||
<?php foreach ($files as $file) :?>
|
||||
<li><?= htmlspecialchars( static::cleanPath($file), ENT_SUBSTITUTE, 'UTF-8') ?></li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<!-- Memory -->
|
||||
<div class="content" id="memory">
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Memory Usage</td>
|
||||
<td><?= static::describeMemory(memory_get_usage(true)) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 12em">Peak Memory Usage:</td>
|
||||
<td><?= static::describeMemory(memory_get_peak_usage(true)) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Memory Limit:</td>
|
||||
<td><?= ini_get('memory_limit') ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div> <!-- /tab-content -->
|
||||
|
||||
</div> <!-- /container -->
|
||||
|
||||
<div class="footer">
|
||||
<div class="container">
|
||||
|
||||
<p>
|
||||
Displayed at <?= date('H:i:sa') ?> —
|
||||
PHP: <?= phpversion() ?> —
|
||||
CodeIgniter: <?= \CodeIgniter\CodeIgniter::CI_VERSION ?>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
25
app/Views/errors/html/production.php
Normal file
25
app/Views/errors/html/production.php
Normal file
@ -0,0 +1,25 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="robots" content="noindex">
|
||||
|
||||
<title>Whoops!</title>
|
||||
|
||||
<style type="text/css">
|
||||
<?= preg_replace('#[\r\n\t ]+#', ' ', file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'debug.css')) ?>
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container text-center">
|
||||
|
||||
<h1 class="headline">Whoops!</h1>
|
||||
|
||||
<p class="lead">We seem to have hit a snag. Please try again later...</p>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
26
app/Views/list.php
Normal file
26
app/Views/list.php
Normal file
@ -0,0 +1,26 @@
|
||||
<table border="1" align="center">
|
||||
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Email</td>
|
||||
|
||||
<td>Action</td>
|
||||
</tr>
|
||||
<?php
|
||||
foreach($users_detail as $value){
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $value['name']; ?></td>
|
||||
<td><?= $value['email']; ?></td>
|
||||
|
||||
<td><a href="<?= base_url(); ?>/Home/edit/<?= $value['id']; ?>">Edit</a>
|
||||
<a href="<?= base_url(); ?>/Home/userDelete/<?= $value['id']; ?>">Delete</a>
|
||||
<a href="<?= base_url(); ?>/Home/profile/<?= $value['id']; ?>">private view</a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</br>
|
||||
</br>
|
||||
<button><a href="<?= base_url()."/register"; ?>" >HOME</a></button>
|
||||
50
app/Views/login.php
Normal file
50
app/Views/login.php
Normal file
@ -0,0 +1,50 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm8- offset-sm-2 col-md-6 offset-md-3 mt-5 pt-3 pb-3 bg-white from-wrapper">
|
||||
<div class="container">
|
||||
|
||||
<h3> LOGIN </h3>
|
||||
|
||||
<form class="" method="post" action="<?= base_url()."/"; ?>">
|
||||
<?php if(session()->get('success')): ?>
|
||||
<div class="alert alert-success" role="alert">
|
||||
<?= session()->get('success')?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="form-group">
|
||||
<lable for="email">EMAIL ID</lable>
|
||||
<input type="text" class="form-group" name="email" id="email" value="<?= set_value('email') ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<lable for="password">PASSWORD</lable>
|
||||
<input type="password" class="form-group" name="password" id="password" value="">
|
||||
</div>
|
||||
<?php if(isset($validation)): ?>
|
||||
<div class="col-12">
|
||||
<div class="alert alert-danger" >
|
||||
<?= $validation->listErrors() ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if(session()->getTempdata('error')):?>
|
||||
<div class="col-12">
|
||||
<div class="alert alert-danger" >
|
||||
<?= session()->getTempdata('error'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class="row">
|
||||
<div class="col-12 clo-sm-4">
|
||||
<button type="submit" class="btn btn-primary">Login</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 clo-sm-8 text-right">
|
||||
<a href="<?= base_url()."/register"; ?>">Don't have an account yet?</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
9
app/Views/profile_view.php
Normal file
9
app/Views/profile_view.php
Normal file
@ -0,0 +1,9 @@
|
||||
<body>
|
||||
<lable>
|
||||
<h2><?= $post['id']; ?></h2></br>
|
||||
<h2><?= $post['name']; ?></h2></br>
|
||||
<h2><?= $post['email']; ?></h2></br>
|
||||
|
||||
|
||||
</lable>
|
||||
</body>
|
||||
71
app/Views/receipt_edit.php
Normal file
71
app/Views/receipt_edit.php
Normal file
@ -0,0 +1,71 @@
|
||||
<div class="container">
|
||||
|
||||
<div class="container register-form">
|
||||
</br>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>EDIT RECEIPTS</h2>
|
||||
</div></div></br>
|
||||
<div class="form">
|
||||
|
||||
<div class="form-content">
|
||||
<form class="" method="post" action="" >
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="RECEIPT NUMBER" name="receipt_no" value="<?= $post['receipt_no'] ?>"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<select name="donor_id" id="donor_id" class="form-control ">
|
||||
<option value="<?= $post['donor_id'] ?>">Select Donor Id</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value="<?= $post['date'] ?>"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="AMOUNT" name="amount" value="<?= $post['amount'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<select class="form-control" name="mode_of_receipt" required>
|
||||
<option value="<?= $post['mode_of_receipt'] ?>">MODE OF RECEIPT</option>
|
||||
<option value="Case">Case</option>
|
||||
<option value="Check">Check</option>
|
||||
<option value="Card">Card</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="CAUSE NAME" name="cause_name" value="<?= $post['cause_name'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="RECEIPT DETAILS" name="receipt_details" value="<?= $post['receipt_details'] ?>"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="REMARKS" name="remarks" value="<?= $post['remarks'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div><div class="col-md-8">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
70
app/Views/receipts.php
Normal file
70
app/Views/receipts.php
Normal file
@ -0,0 +1,70 @@
|
||||
<div class="container">
|
||||
|
||||
<div class="container register-form">
|
||||
</br>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>GENERATE RECEIPTS</h2>
|
||||
</div></div></br>
|
||||
<div class="form">
|
||||
|
||||
<div class="form-content">
|
||||
<form class="" method="post" action="<?= base_url()."/receipt"; ?>" >
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="RECEIPT NUMBER" name="receipt_no" value=""/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<select name="donor_id" id="donor_id" class="form-control ">
|
||||
<option value="">Select Donor Id</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value=""/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="AMOUNT" name="amount" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<select class="form-control" name="mode_of_receipt" required>
|
||||
<option value="">MODE OF RECEIPT</option>
|
||||
<option value="Case">Case</option>
|
||||
<option value="Check">Check</option>
|
||||
<option value="Card">Card</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="CAUSE NAME" name="cause_name" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="RECEIPT DETAILS" name="receipt_details" value=""/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="REMARKS" name="remarks" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div><div class="col-md-8">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
41
app/Views/receipts_table.php
Normal file
41
app/Views/receipts_table.php
Normal file
@ -0,0 +1,41 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>ALL RECEIPTS</h2>
|
||||
</div></div></br>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th> Receipt No</th>
|
||||
<th> Date</th>
|
||||
<th> Donor Id</th>
|
||||
<th> Amount</th>
|
||||
<th> Mode</th>
|
||||
<th> Details</th>
|
||||
<th> Cause</th>
|
||||
<th> Action</th>
|
||||
|
||||
</tr>
|
||||
<?php foreach ($receiptdata as $row)
|
||||
{ ?>
|
||||
<tr>
|
||||
<td><?php echo $row['receipt_no'];?></td>
|
||||
<td><?php echo $row['date'];?></td>
|
||||
<td><?php echo $row['donor_id'];?></td>
|
||||
<td><?php echo $row['amount'];?></td>
|
||||
<td><?php echo $row['mode_of_receipt'];?></td>
|
||||
<td><?php echo $row['receipt_details'];?></td>
|
||||
<td><?php echo $row['cause_name'];?></td>
|
||||
<td><a href="<?= base_url() ?>/Dashboard/edit_receipt/<?php echo $row['receipt_id'];?>">Edit</a></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
145
app/Views/register.php
Normal file
145
app/Views/register.php
Normal file
@ -0,0 +1,145 @@
|
||||
|
||||
<div class="container">
|
||||
|
||||
|
||||
|
||||
<h3> REGISTER </h3>
|
||||
|
||||
<form class="" method="post" action="<?= base_url()."/register"; ?>" >
|
||||
<div class="">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Name</h4></label>
|
||||
<input type="text" class="form-control" name="name" id = "name" value="<?= set_value('name') ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Mobile</h4></label>
|
||||
<input type="text" class="form-control" name="phone" id="phone" value="<?= set_value('phone') ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Email</h4></label>
|
||||
<input type="text" class="form-control" name="email" id="email" value="<?= set_value('email') ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>PAN No</h4></label>
|
||||
<input type="text" class="form-control" name="pan" id="pan" value="<?= set_value('pan') ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-xs-12">
|
||||
<label for="first_name"><h4>Address</h4></label>
|
||||
<input type="text" class="form-control" name="address" id="address" placeholder="Flat no , Area" value="<?= set_value('address') ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="password2"><h4>Country</h4></label>
|
||||
<select name="country" id="country0" class="form-control ">
|
||||
<option value="">Select Country</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="password2"><h4>State</h4></label>
|
||||
<select name="state" id="state0" class="form-control ">
|
||||
<option value="">Select State</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="password2"><h4>City</h4></label>
|
||||
<select name="city" id="city0" class="form-control ">
|
||||
<option value="">Select City</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="password2"><h4>Pin Code</h4></label>
|
||||
<input type="text" class="form-control" name="pin_code" id="pin_code" >
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Date of Birth</h4></label>
|
||||
<input type="text" class="form-control" name="date_of_birth" id="txtDate" placeholder="dd/mm/yyyy" value="<?= set_value('date_of_birth') ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Gender</h4></label>
|
||||
<select class="form-control" name="gender" required>
|
||||
<option value="">select Gender</option>
|
||||
<option value="Male">Male</option>
|
||||
<option value="Female">Female</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Org Name</h4></label>
|
||||
<input type="text" class="form-control" name="org_name" id="org_name" value="<?= set_value('org_name') ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>GSTIN</h4></label>
|
||||
<input type="text" class="form-control" name="gstin" id="gstin" value="<?= set_value('gstin') ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Password</h4></label>
|
||||
<input type="text" class="form-control" name="password" id="password" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="first_name"><h4>Confirm Password</h4></label>
|
||||
<input type="text" class="form-control" name="password_confirm" id="password_confirm" value="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</br>
|
||||
|
||||
<?php if(isset($validation)): ?>
|
||||
<div class="col-12">
|
||||
<div class="alert alert-danger" role="aler">
|
||||
<?= $validation->listErrors() ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="row">
|
||||
<div class="col-12 clo-sm-4">
|
||||
<button type="submit" class="btn btn-primary">Register</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 clo-sm-8 text-right">
|
||||
<a href="<?= base_url()."/"; ?>">Already have an account</a>
|
||||
</div>
|
||||
</form>
|
||||
</div></div>
|
||||
|
||||
53
app/Views/show.php
Normal file
53
app/Views/show.php
Normal file
@ -0,0 +1,53 @@
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
||||
|
||||
<title>Form Validation</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<form method="post" action="<?= base_url()."/register"; ?>">
|
||||
<lable>POSTS</lable>
|
||||
<input type="text" name="name"></br>
|
||||
<lable>POSTID</lable>
|
||||
<input type="text" name="email"></br>
|
||||
<input type="submit" value="create">
|
||||
</form>
|
||||
<button><a href="<?= base_url()."/list"; ?>" >LIST</a></button></br>
|
||||
</div>
|
||||
<div class="container">
|
||||
<h1>Form Validation</h1>
|
||||
<form method="post" action="<?= base_url()."/store"; ?>">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputname">Name</label>
|
||||
<input type="text" name="name" class="form-control" id="exampleInputPassword1" placeholder="Name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Email address</label>
|
||||
<input type="text" name="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
|
||||
<small id="emailHelp" name="department" class="form-text text-muted">We'll never share your email with anyone else.</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="exampleInputdept1">Department</label>
|
||||
<input type="text" name="department" class="form-control" id="exampleInputPassword1" placeholder="Department">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Optional JavaScript -->
|
||||
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
||||
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
2
app/Views/templates/footer.php
Normal file
2
app/Views/templates/footer.php
Normal file
@ -0,0 +1,2 @@
|
||||
</body>
|
||||
</html>
|
||||
556
app/Views/templates/header.php
Normal file
556
app/Views/templates/header.php
Normal file
@ -0,0 +1,556 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<style>
|
||||
input[type="date"]::-webkit-datetime-edit, input[type="date"]::-webkit-inner-spin-button, input[type="date"]::-webkit-clear-button
|
||||
{
|
||||
color: #fff;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
input[type="date"]::-webkit-datetime-edit-year-field{
|
||||
position: absolute !important;
|
||||
border-left:1px solid #8c8c8c;
|
||||
padding: 2px;
|
||||
color:#000;
|
||||
left: 56px;
|
||||
}
|
||||
|
||||
input[type="date"]::-webkit-datetime-edit-month-field{
|
||||
position: absolute !important;
|
||||
border-left:1px solid #8c8c8c;
|
||||
padding: 2px;
|
||||
color:#000;
|
||||
left: 26px;
|
||||
}
|
||||
|
||||
|
||||
input[type="date"]::-webkit-datetime-edit-day-field{
|
||||
position: absolute !important;
|
||||
color:#000;
|
||||
padding: 2px;
|
||||
left: 4px;
|
||||
|
||||
}
|
||||
.my_navbar{
|
||||
height : 50px;
|
||||
}
|
||||
.nav_right{
|
||||
float: right;
|
||||
}
|
||||
.nav-side-menu {
|
||||
overflow: auto;
|
||||
font-family: verdana;
|
||||
font-size: 13px;
|
||||
font-weight: 200;
|
||||
background-color: #2e353d;
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
width: 250px;
|
||||
height: 100%;
|
||||
color: #e1ffff;
|
||||
}
|
||||
.nav-side-menu .brand {
|
||||
background-color: #23282e;
|
||||
line-height: 50px;
|
||||
display: block;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
.nav-side-menu .toggle-btn {
|
||||
display: none;
|
||||
}
|
||||
.nav-side-menu ul,
|
||||
.nav-side-menu li {
|
||||
list-style: none;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
line-height: 35px;
|
||||
cursor: pointer;
|
||||
/*
|
||||
.collapsed{
|
||||
.arrow:before{
|
||||
font-family: FontAwesome;
|
||||
content: "\f053";
|
||||
display: inline-block;
|
||||
padding-left:10px;
|
||||
padding-right: 10px;
|
||||
vertical-align: middle;
|
||||
float:right;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
.nav-side-menu ul :not(collapsed) .arrow:before,
|
||||
.nav-side-menu li :not(collapsed) .arrow:before {
|
||||
font-family: FontAwesome;
|
||||
content: "\f078";
|
||||
display: inline-block;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
vertical-align: middle;
|
||||
float: right;
|
||||
}
|
||||
.nav-side-menu ul .active,
|
||||
.nav-side-menu li .active {
|
||||
border-left: 3px solid #d19b3d;
|
||||
background-color: #4f5b69;
|
||||
}
|
||||
.nav-side-menu ul .sub-menu li.active,
|
||||
.nav-side-menu li .sub-menu li.active {
|
||||
color: #d19b3d;
|
||||
}
|
||||
|
||||
.nav-side-menu ul .sub-menu li.active a,
|
||||
.nav-side-menu li .sub-menu li.active a {
|
||||
color: #d19b3d;
|
||||
}
|
||||
.nav-side-menu ul .sub-menu li,
|
||||
.nav-side-menu li .sub-menu li {
|
||||
background-color: #181c20;
|
||||
border: none;
|
||||
line-height: 28px;
|
||||
border-bottom: 1px solid #23282e;
|
||||
margin-left: 0px;
|
||||
}
|
||||
.nav-side-menu ul .sub-menu li:hover,
|
||||
.nav-side-menu li .sub-menu li:hover {
|
||||
background-color: #020203;
|
||||
}
|
||||
.nav-side-menu ul .sub-menu li:before,
|
||||
.nav-side-menu li .sub-menu li:before {
|
||||
font-family: Fontawesome;
|
||||
content: "\f105";
|
||||
display: inline-block;
|
||||
padding-left: 20px;
|
||||
padding-right: 10px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.nav-side-menu li {
|
||||
padding-left: 0px;
|
||||
border-left: 3px solid #2e353d;
|
||||
border-bottom: 1px solid #23282e;
|
||||
}
|
||||
.nav-side-menu li a {
|
||||
text-decoration: none;
|
||||
color: #e1ffff;
|
||||
}
|
||||
.nav-side-menu li a i {
|
||||
padding-left: 10px;
|
||||
width: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
.nav-side-menu li:hover {
|
||||
border-left: 3px solid #d19b3d;
|
||||
background-color: #4f5b69;
|
||||
-webkit-transition: all 1s ease;
|
||||
-moz-transition: all 1s ease;
|
||||
-o-transition: all 1s ease;
|
||||
-ms-transition: all 1s ease;
|
||||
transition: all 1s ease;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.nav-side-menu {
|
||||
position: relative;
|
||||
width: 80%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.nav-side-menu .toggle-btn {
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 10px;
|
||||
z-index: 10 !important;
|
||||
padding: 3px;
|
||||
background-color: #ffffff;
|
||||
color: #000;
|
||||
width: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
.brand {
|
||||
text-align: left !important;
|
||||
font-size: 22px;
|
||||
padding-left: 20px;
|
||||
line-height: 50px !important;
|
||||
}
|
||||
}
|
||||
@media (min-width: 767px) {
|
||||
.nav-side-menu .menu-list .menu-content {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
body {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.nav-side-menu ul .sub-menu ul .sub-line li.active,
|
||||
.nav-side-menu li .sub-menu li .sub-line li.active {
|
||||
color: #d19b3d;
|
||||
}
|
||||
|
||||
.nav-side-menu ul .sub-menu li .sub-line li.active a,
|
||||
.nav-side-menu li .sub-menu li .sub-line li.active a {
|
||||
color: #d19b3d;
|
||||
}
|
||||
.nav-side-menu ul .sub-menu li .sub-line li,
|
||||
.nav-side-menu li .sub-menu li .sub-line li {
|
||||
background-color: #181c20;
|
||||
border: none;
|
||||
line-height: 28px;
|
||||
border-bottom: 1px solid #23282e;
|
||||
margin-left: 0px;
|
||||
}
|
||||
.nav-side-menu ul .sub-menu li .sub-line li:hover,
|
||||
.nav-side-menu li .sub-menu li .sub-line li:hover {
|
||||
background-color: #020203;
|
||||
}
|
||||
.nav-side-menu ul .sub-menu li .sub-line li:before,
|
||||
.nav-side-menu li .sub-menu li .sub-line li:before {
|
||||
font-family: FontAwesome;
|
||||
content: "\f105";
|
||||
display: inline-block;
|
||||
padding-left: 100px;
|
||||
padding-right: 10px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.nav-side-menu .sub-menu li {
|
||||
padding-left: 20px;
|
||||
border-left: 3px solid #2e353d;
|
||||
border-bottom: 1px solid #23282e;
|
||||
}
|
||||
.nav-side-menu .sub-menu li a {
|
||||
text-decoration: none;
|
||||
color: #e1ffff;
|
||||
}
|
||||
.sub-menu li a i {
|
||||
padding-left: 10px;
|
||||
width: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
.nav-side-menu li .sub-menu li:hover {
|
||||
border-left: 3px solid #d19b3d;
|
||||
background-color: #4f5b69;
|
||||
-webkit-transition: all 1s ease;
|
||||
-moz-transition: all 1s ease;
|
||||
-o-transition: all 1s ease;
|
||||
-ms-transition: all 1s ease;
|
||||
transition: all 1s ease;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.nav-side-menu .sub-menu {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.nav-side-menu .sub-menu .toggle-btn {
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 10px;
|
||||
z-index: 10 !important;
|
||||
padding: 3px;
|
||||
background-color: #ffffff;
|
||||
color: #000;
|
||||
width: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sub-line ul .sub-press li.active,
|
||||
.sub-line li .sub-press li.active {
|
||||
color: #d19b3d;
|
||||
}
|
||||
|
||||
.sub-line ul .sub-press li.active a,
|
||||
.sub-line li .sub-press li.active a {
|
||||
color: #d19b3d;
|
||||
}
|
||||
.sub-line ul .sub-press li,
|
||||
.sub-line li .sub-press li {
|
||||
background-color: #181c20;
|
||||
border: none;
|
||||
line-height: 28px;
|
||||
border-bottom: 1px solid #23282e;
|
||||
margin-left: 0px;
|
||||
}
|
||||
.sub-line ul .sub-press li:hover,
|
||||
.sub-line li .sub-press li:hover {
|
||||
background-color: #020203;
|
||||
}
|
||||
.sub-line ul .sub-press li:before,
|
||||
.sub-line li .sub-press li:before {
|
||||
font-family: Arial;
|
||||
content: "\f105";
|
||||
display: inline-block;
|
||||
padding-left: 50px;
|
||||
padding-right: 10px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.sub-line li {
|
||||
padding-left: 20px;
|
||||
border-left: 3px solid #2e353d;
|
||||
border-bottom: 1px solid #23282e;
|
||||
}
|
||||
.sub-line li a {
|
||||
text-decoration: none;
|
||||
color: #e1ffff;
|
||||
}
|
||||
.sub-line li a i {
|
||||
padding-left: 50px;
|
||||
width: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
.sub-line li:hover {
|
||||
border-left: 3px solid #d19b3d;
|
||||
background-color: #4f5b69;
|
||||
-webkit-transition: all 1s ease;
|
||||
-moz-transition: all 1s ease;
|
||||
-o-transition: all 1s ease;
|
||||
-ms-transition: all 1s ease;
|
||||
transition: all 1s ease;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.sub-line {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.sub-line .toggle-btn {
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 10px;
|
||||
z-index: 10 !important;
|
||||
padding: 3px;
|
||||
background-color: #ffffff;
|
||||
color: #000;
|
||||
width: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
<!--- nav left ---->
|
||||
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
|
||||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
<!------ Include the above in your HEAD tag ---------->
|
||||
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
|
||||
<!--- nav left end ---->
|
||||
|
||||
<!-- Bootstrap DatePicker -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker.css" type="text/css" />
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#txtDate').datepicker({
|
||||
format: "dd/mm/yyyy"
|
||||
});
|
||||
});
|
||||
$(function () {
|
||||
$('#txtDate2').datepicker({
|
||||
format: "dd/mm/yyyy"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- Bootstrap DatePicker End-->
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#cause_form").submit(function(){
|
||||
var formData = new FormData($(this)[0]);
|
||||
$.ajax({
|
||||
url: '<?= base_url(); ?>/add_donation_cause',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
async: false,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: function (data) {
|
||||
$("#cause_form")[0].reset();
|
||||
$(".cause_table").load(window.location + " .cause_table");
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
|
||||
$.ajax({
|
||||
url:"<?= base_url(); ?>/fetch_country",
|
||||
method:"GET",
|
||||
data:{},
|
||||
success:function(data)
|
||||
{
|
||||
$('#country0').html(data);
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url:"<?= base_url(); ?>/fetch_donor_id",
|
||||
method:"GET",
|
||||
data:{},
|
||||
success:function(data)
|
||||
{
|
||||
$('#donor_id').html(data);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
//fetch state and sity values
|
||||
$('#country0').change(function(){
|
||||
|
||||
var country_id = $('#country0').val();
|
||||
|
||||
if(country_id != '')
|
||||
{
|
||||
|
||||
$.ajax({
|
||||
url:"<?= base_url(); ?>/fetch_state",
|
||||
method:"POST",
|
||||
data:{country_id:country_id},
|
||||
success:function(data)
|
||||
{
|
||||
$('#state0').html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#state0').html('<option value="">Select State</option>');
|
||||
}
|
||||
});
|
||||
|
||||
$('#state0').change(function(){
|
||||
var state_id = $('#state0').val();
|
||||
if(state_id != '')
|
||||
{
|
||||
$.ajax({
|
||||
url:"<?= base_url(); ?>/fetch_city",
|
||||
method:"POST",
|
||||
data:{state_id:state_id},
|
||||
success:function(data)
|
||||
{
|
||||
$('#city0').html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#city0').html('<option value="">Select City</option>');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<nav class=" navbar my_navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
|
||||
<a class="navbar-brand" href="<?= base_url(); ?> ">Donation</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<?php if(session()->has('logged_user')): ?>
|
||||
<div class="nav_right">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link " href="#">Edit</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?= base_url() ?>/dashboard/logout">Logout <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?= base_url(); ?>">Login <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?= base_url()."/register"; ?>">Register</a>
|
||||
</li>
|
||||
<?php endif;?>
|
||||
</ul></div>
|
||||
|
||||
</nav>
|
||||
<?php if(session()->has('logged_user')): ?>
|
||||
<div class="nav-side-menu">
|
||||
<div class="brand">DONATION</div>
|
||||
<i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"></i>
|
||||
|
||||
<div class="menu-list">
|
||||
|
||||
<ul id="menu-content" class="menu-content collapse out">
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="fa fa-dashboard fa-lg"></i><a href="<?= base_url() ?>/dashboard"> Dashboard</a>
|
||||
</a>
|
||||
</li>
|
||||
<li data-toggle="collapse" data-target="#new" class="collapsed">
|
||||
<a href="#"><i class="fa fa-user fa-lg"></i> Donor Management <span class="arrow"></span></a>
|
||||
</li>
|
||||
<ul class="sub-menu collapse" id="new">
|
||||
<li><a href="<?= base_url() ?>/My_controller/all_donor">View Donors</a></li>
|
||||
<li><a href="<?= base_url() ?>/My_controller/donor_register">Add New Donor</a>s</li>
|
||||
</ul>
|
||||
|
||||
<li data-toggle="collapse" data-target="#products" class="collapsed">
|
||||
<a href="#"><i class="fa fa-book fa-lg"></i> Receipts <span class="arrow"></span></a>
|
||||
</li>
|
||||
<ul class="sub-menu collapse" id="products">
|
||||
|
||||
<li><a href="<?= base_url() ?>/dashboard/all_receipt">All Receipts</a></li>
|
||||
<li><a href="<?= base_url() ?>/dashboard/receipts">Generate Receipts</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<li data-toggle="collapse" data-target="#service" class="collapsed">
|
||||
<a href="#"><i class="fa fa-newspaper-o fa-lg"></i> Transaction <span class="arrow"></span></a>
|
||||
</li>
|
||||
<ul class="sub-menu collapse" id="service">
|
||||
<li><a href="<?= base_url() ?>/dashboard/all_transaction">All Transaction</a></li>
|
||||
<li><a href="<?= base_url() ?>/dashboard/transaction">Upload Transaction</a></li>
|
||||
|
||||
</ul>
|
||||
<li data-toggle="collapse" data-target="#donation_data" class="collapsed">
|
||||
<a href="#"><i class="fa fa-money fa-lg"></i> Donation Data <span class="arrow"></span></a>
|
||||
</li>
|
||||
<ul class="sub-menu collapse" id="donation_data">
|
||||
<li><a href="<?= base_url() ?>/dashboard/all_donation_data">Donation Data List</a></li>
|
||||
<li><a href="<?= base_url() ?>/dashboard/donation_data">Add Donation Data</a></li>
|
||||
|
||||
</ul>
|
||||
<li data-toggle="collapse" data-target="#donation_cause" class="collapsed">
|
||||
<a href="#"><i class="fa fa-pencil-square-o fa-lg"></i>Donation Cause <span class="arrow"></span></a>
|
||||
</li>
|
||||
<ul class="sub-menu collapse" id="donation_cause">
|
||||
<li><a href="<?= base_url() ?>/dashboard/donation_cause">Add/Edit Donation Cause</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="fa fa-user fa-lg"></i> Profile</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?= base_url() ?>/dashboard/logout">Logout <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
59
app/Views/transaction_edit.php
Normal file
59
app/Views/transaction_edit.php
Normal file
@ -0,0 +1,59 @@
|
||||
<div class="container">
|
||||
|
||||
<div class="container register-form">
|
||||
</br>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Transaction Edit</h2>
|
||||
</div></div></br>
|
||||
<div class="form">
|
||||
|
||||
<div class="form-content">
|
||||
<form class="" method="post" action="" >
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value="<?= $post['date'] ?>"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Referal 2" name="ref_2" value="<?= $post['ref_2'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Referal 1" name="ref_1" value="<?= $post['ref_1'] ?>"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Remarks" name="remarks" value="<?= $post['remarks'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Amount" name="amount" value="<?= $post['amount'] ?>"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Donation Referal" name="donation_ref" value="<?= $post['donation_ref'] ?>"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div><div class="col-md-8">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
40
app/Views/transaction_table.php
Normal file
40
app/Views/transaction_table.php
Normal file
@ -0,0 +1,40 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>ALL TRANSACTIONS</h2>
|
||||
</div></div></br>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th> Transaction Date</th>
|
||||
<th> Reference 1</th>
|
||||
<th> Reference 1</th>
|
||||
<th> Remarks</th>
|
||||
<th> Amount</th>
|
||||
<th> Donation Ref</th>
|
||||
<th> dAction</th>
|
||||
|
||||
</tr>
|
||||
<?php foreach ($receiptdata as $row)
|
||||
{ ?>
|
||||
<tr>
|
||||
<td><?php echo $row['date'];?></td>
|
||||
<td><?php echo $row['ref_1'];?></td>
|
||||
<td><?php echo $row['ref_2'];?></td>
|
||||
<td><?php echo $row['remarks'];?></td>
|
||||
<td><?php echo $row['amount'];?></td>
|
||||
<td><?php echo $row['donation_ref'];?></td>
|
||||
<td><a href="<?= base_url() ?>/Dashboard/edit_transaction/<?php echo $row['id'];?>">Edit</a></td>
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
65
app/Views/transaction_upload.php
Normal file
65
app/Views/transaction_upload.php
Normal file
@ -0,0 +1,65 @@
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="container register-form">
|
||||
</br>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Transaction upload</h2>
|
||||
</div></div></br>
|
||||
<div class="form">
|
||||
|
||||
<div class="form-content">
|
||||
<form class="" method="post" action="<?= base_url()."/transaction"; ?>" >
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="dd/mm/yyyy" id="txtDate" name="date" value=""/>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Referal 2" name="ref_2" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Referal 1" name="ref_1" value=""/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Remarks" name="remarks" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Amount" name="amount" value=""/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Donation Referal" name="donation_ref" value=""/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div><div class="col-md-8">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
324
app/Views/welcome_message.php
Normal file
324
app/Views/welcome_message.php
Normal file
File diff suppressed because one or more lines are too long
11
app/index.html
Normal file
11
app/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
163
builds
Normal file
163
builds
Normal file
@ -0,0 +1,163 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
define('LATEST_RELEASE', '^4.0');
|
||||
define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------
|
||||
* Stability Toggle
|
||||
* --------------------------------------------------------------------
|
||||
* Use this script to toggle the CodeIgniter dependency between the
|
||||
* latest stable release and the most recent development update.
|
||||
*
|
||||
* Usage: php builds [release|development]
|
||||
*/
|
||||
|
||||
// Determine the requested stability
|
||||
if (empty($argv[1]) || ! in_array($argv[1], ['release', 'development']))
|
||||
{
|
||||
echo 'Usage: php builds [release|development]' . PHP_EOL;
|
||||
exit;
|
||||
}
|
||||
|
||||
$dev = $argv[1] == 'development';
|
||||
$modified = [];
|
||||
|
||||
/* Locate each file and update it for the requested stability */
|
||||
|
||||
// Composer.json
|
||||
$file = __DIR__ . DIRECTORY_SEPARATOR . 'composer.json';
|
||||
|
||||
if (is_file($file))
|
||||
{
|
||||
// Make sure we can read it
|
||||
if ($contents = file_get_contents($file))
|
||||
{
|
||||
if ($array = json_decode($contents, true))
|
||||
{
|
||||
// Development
|
||||
if ($dev)
|
||||
{
|
||||
// Set 'minimum-stability'
|
||||
$array['minimum-stability'] = 'dev';
|
||||
$array['prefer-stable'] = true;
|
||||
|
||||
// Make sure the repo is configured
|
||||
if (! isset($array['repositories']))
|
||||
{
|
||||
$array['repositories'] = [];
|
||||
}
|
||||
|
||||
// Check for the CodeIgniter repo
|
||||
$found = false;
|
||||
foreach ($array['repositories'] as $repository)
|
||||
{
|
||||
if ($repository['url'] == GITHUB_URL)
|
||||
{
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Add the repo if it was not found
|
||||
if (! $found)
|
||||
{
|
||||
$array['repositories'][] = [
|
||||
'type' => 'vcs',
|
||||
'url' => GITHUB_URL,
|
||||
];
|
||||
}
|
||||
|
||||
// Define the "require"
|
||||
$array['require']['codeigniter4/codeigniter4'] = 'dev-develop';
|
||||
unset($array['require']['codeigniter4/framework']);
|
||||
}
|
||||
|
||||
// Release
|
||||
else
|
||||
{
|
||||
// Clear 'minimum-stability'
|
||||
unset($array['minimum-stability']);
|
||||
|
||||
// If the repo is configured then clear it
|
||||
if (isset($array['repositories']))
|
||||
{
|
||||
// Check for the CodeIgniter repo
|
||||
foreach ($array['repositories'] as $i => $repository)
|
||||
{
|
||||
if ($repository['url'] == GITHUB_URL)
|
||||
{
|
||||
unset($array['repositories'][$i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (empty($array['repositories']))
|
||||
{
|
||||
unset($array['repositories']);
|
||||
}
|
||||
}
|
||||
|
||||
// Define the "require"
|
||||
$array['require']['codeigniter4/framework'] = LATEST_RELEASE;
|
||||
unset($array['require']['codeigniter4/codeigniter4']);
|
||||
}
|
||||
|
||||
// Write out a new composer.json
|
||||
file_put_contents($file, json_encode($array, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES) . PHP_EOL);
|
||||
$modified[] = $file;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Warning: Unable to decode composer.json! Skipping...' . PHP_EOL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Warning: Unable to read composer.json! Skipping...' . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
// Paths config and PHPUnit XMLs
|
||||
$files = [
|
||||
__DIR__ . DIRECTORY_SEPARATOR . 'app/Config/Paths.php',
|
||||
__DIR__ . DIRECTORY_SEPARATOR . 'phpunit.xml.dist',
|
||||
__DIR__ . DIRECTORY_SEPARATOR . 'phpunit.xml',
|
||||
];
|
||||
|
||||
foreach ($files as $file)
|
||||
{
|
||||
if (is_file($file))
|
||||
{
|
||||
$contents = file_get_contents($file);
|
||||
|
||||
// Development
|
||||
if ($dev)
|
||||
{
|
||||
$contents = str_replace('vendor/codeigniter4/framework', 'vendor/codeigniter4/codeigniter4', $contents);
|
||||
}
|
||||
|
||||
// Release
|
||||
else
|
||||
{
|
||||
$contents = str_replace('vendor/codeigniter4/codeigniter4', 'vendor/codeigniter4/framework', $contents);
|
||||
}
|
||||
|
||||
file_put_contents($file, $contents);
|
||||
$modified[] = $file;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($modified))
|
||||
{
|
||||
echo 'No files modified' . PHP_EOL;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'The following files were modified:' . PHP_EOL;
|
||||
foreach ($modified as $file)
|
||||
{
|
||||
echo " * {$file}" . PHP_EOL;
|
||||
}
|
||||
echo 'Run `composer update` to sync changes with your vendor folder' . PHP_EOL;
|
||||
}
|
||||
33
composer.json
Normal file
33
composer.json
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "codeigniter4/appstarter",
|
||||
"type": "project",
|
||||
"description": "CodeIgniter4 starter app",
|
||||
"homepage": "https://codeigniter.com",
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"codeigniter4/framework": "^4",
|
||||
"dompdf/dompdf": "^0.8.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"fzaninotto/faker": "^1.9@dev",
|
||||
"mikey179/vfsstream": "1.6.*",
|
||||
"phpunit/phpunit": "^8.5"
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Tests\\Support\\": "tests/_support"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"post-update-cmd": [
|
||||
"@composer dump-autoload"
|
||||
],
|
||||
"test": "phpunit"
|
||||
},
|
||||
"support": {
|
||||
"forum": "http://forum.codeigniter.com/",
|
||||
"source": "https://github.com/codeigniter4/CodeIgniter4",
|
||||
"slack": "https://codeigniterchat.slack.com"
|
||||
}
|
||||
}
|
||||
2144
composer.lock
generated
Normal file
2144
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
101
env
Normal file
101
env
Normal file
@ -0,0 +1,101 @@
|
||||
#--------------------------------------------------------------------
|
||||
# Example Environment Configuration file
|
||||
#
|
||||
# This file can be used as a starting point for your own
|
||||
# custom .env files, and contains most of the possible settings
|
||||
# available in a default install.
|
||||
#
|
||||
# By default, all of the settings are commented out. If you want
|
||||
# to override the setting, you must un-comment it by removing the '#'
|
||||
# at the beginning of the line.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# ENVIRONMENT
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
#CI_ENVIRONMENT = production
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# APP
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
#app.baseURL = ''
|
||||
# app.forceGlobalSecureRequests = false
|
||||
|
||||
# app.sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler'
|
||||
# app.sessionCookieName = 'ci_session'
|
||||
# app.sessionSavePath = NULL
|
||||
# app.sessionMatchIP = false
|
||||
# app.sessionTimeToUpdate = 300
|
||||
# app.sessionRegenerateDestroy = false
|
||||
|
||||
# app.cookiePrefix = ''
|
||||
# app.cookieDomain = ''
|
||||
# app.cookiePath = '/'
|
||||
# app.cookieSecure = false
|
||||
# app.cookieHTTPOnly = false
|
||||
|
||||
# app.CSRFProtection = false
|
||||
# app.CSRFTokenName = 'csrf_test_name'
|
||||
# app.CSRFCookieName = 'csrf_cookie_name'
|
||||
# app.CSRFExpire = 7200
|
||||
# app.CSRFRegenerate = true
|
||||
# app.CSRFExcludeURIs = []
|
||||
|
||||
# app.CSPEnabled = false
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# DATABASE
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
# database.default.hostname = localhost
|
||||
# database.default.database = ci4
|
||||
# database.default.username = root
|
||||
# database.default.password = root
|
||||
# database.default.DBDriver = MySQLi
|
||||
|
||||
# database.tests.hostname = localhost
|
||||
# database.tests.database = ci4
|
||||
# database.tests.username = root
|
||||
# database.tests.password = root
|
||||
# database.tests.DBDriver = MySQLi
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# CONTENT SECURITY POLICY
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
# contentsecuritypolicy.reportOnly = false
|
||||
# contentsecuritypolicy.defaultSrc = 'none'
|
||||
# contentsecuritypolicy.scriptSrc = 'self'
|
||||
# contentsecuritypolicy.styleSrc = 'self'
|
||||
# contentsecuritypolicy.imageSrc = 'self'
|
||||
# contentsecuritypolicy.base_uri = null
|
||||
# contentsecuritypolicy.childSrc = null
|
||||
# contentsecuritypolicy.connectSrc = 'self'
|
||||
# contentsecuritypolicy.fontSrc = null
|
||||
# contentsecuritypolicy.formAction = null
|
||||
# contentsecuritypolicy.frameAncestors = null
|
||||
# contentsecuritypolicy.mediaSrc = null
|
||||
# contentsecuritypolicy.objectSrc = null
|
||||
# contentsecuritypolicy.pluginTypes = null
|
||||
# contentsecuritypolicy.reportURI = null
|
||||
# contentsecuritypolicy.sandbox = false
|
||||
# contentsecuritypolicy.upgradeInsecureRequests = false
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# ENCRYPTION
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
# encryption.key =
|
||||
# encryption.driver = OpenSSL
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# HONEYPOT
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
# honeypot.hidden = 'true'
|
||||
# honeypot.label = 'Fill This Field'
|
||||
# honeypot.name = 'honeypot'
|
||||
# honeypot.template = '<label>{label}</label><input type="text" name="{name}" value=""/>'
|
||||
# honeypot.container = '<div style="display:none">{template}</div>'
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user