mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 12:12:48 +01:00
Initial commit
This commit is contained in:
parent
fd521114e8
commit
f38ed06193
1
.gitattributes
vendored
Executable file
1
.gitattributes
vendored
Executable file
@ -0,0 +1 @@
|
||||
* text=auto
|
6
.gitignore
vendored
Executable file
6
.gitignore
vendored
Executable file
@ -0,0 +1,6 @@
|
||||
/bootstrap/compiled.php
|
||||
/vendor
|
||||
composer.phar
|
||||
composer.lock
|
||||
.DS_Store
|
||||
Thumbs.db
|
0
app/commands/.gitkeep
Executable file
0
app/commands/.gitkeep
Executable file
218
app/config/app.php
Executable file
218
app/config/app.php
Executable file
@ -0,0 +1,218 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Debug Mode
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When your application is in debug mode, detailed error messages with
|
||||
| stack traces will be shown on every error that occurs within your
|
||||
| application. If disabled, a simple generic error page is shown.
|
||||
|
|
||||
*/
|
||||
|
||||
'debug' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application URL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This URL is used by the console to properly generate URLs when using
|
||||
| the Artisan command line tool. You should set this to the root of
|
||||
| your application so that it is used when running Artisan tasks.
|
||||
|
|
||||
*/
|
||||
|
||||
'url' => 'http://localhost',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Timezone
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default timezone for your application, which
|
||||
| will be used by the PHP date and date-time functions. We have gone
|
||||
| ahead and set this to a sensible default for you out of the box.
|
||||
|
|
||||
*/
|
||||
|
||||
'timezone' => 'UTC',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Locale Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The application locale determines the default locale that will be used
|
||||
| by the translation service provider. You are free to set this value
|
||||
| to any of the locales which will be supported by the application.
|
||||
|
|
||||
*/
|
||||
|
||||
'locale' => 'en',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This key is used by the Illuminate encrypter service and should be set
|
||||
| to a random, 32 character string, otherwise these encrypted strings
|
||||
| will not be safe. Please do this before deploying an application!
|
||||
|
|
||||
*/
|
||||
|
||||
'key' => 'Zwa83ZM8ZYjEAfHWXl7SvYwVdV9X*oU1',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Autoloaded Service Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The service providers listed here will be automatically loaded on the
|
||||
| request to your application. Feel free to add your own services to
|
||||
| this array to grant expanded functionality to your applications.
|
||||
|
|
||||
*/
|
||||
|
||||
'providers' => array(
|
||||
|
||||
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
|
||||
'Illuminate\Auth\AuthServiceProvider',
|
||||
'Illuminate\Cache\CacheServiceProvider',
|
||||
'Illuminate\Foundation\Providers\CommandCreatorServiceProvider',
|
||||
'Illuminate\Session\CommandsServiceProvider',
|
||||
'Illuminate\Foundation\Providers\ComposerServiceProvider',
|
||||
'Illuminate\Routing\ControllerServiceProvider',
|
||||
'Illuminate\Cookie\CookieServiceProvider',
|
||||
'Illuminate\Database\DatabaseServiceProvider',
|
||||
'Illuminate\Encryption\EncryptionServiceProvider',
|
||||
'Illuminate\Filesystem\FilesystemServiceProvider',
|
||||
'Illuminate\Hashing\HashServiceProvider',
|
||||
'Illuminate\Html\HtmlServiceProvider',
|
||||
'Illuminate\Foundation\Providers\KeyGeneratorServiceProvider',
|
||||
'Illuminate\Log\LogServiceProvider',
|
||||
'Illuminate\Mail\MailServiceProvider',
|
||||
'Illuminate\Foundation\Providers\MaintenanceServiceProvider',
|
||||
'Illuminate\Database\MigrationServiceProvider',
|
||||
'Illuminate\Foundation\Providers\OptimizeServiceProvider',
|
||||
'Illuminate\Pagination\PaginationServiceProvider',
|
||||
'Illuminate\Foundation\Providers\PublisherServiceProvider',
|
||||
'Illuminate\Queue\QueueServiceProvider',
|
||||
'Illuminate\Redis\RedisServiceProvider',
|
||||
'Illuminate\Auth\Reminders\ReminderServiceProvider',
|
||||
'Illuminate\Foundation\Providers\RouteListServiceProvider',
|
||||
'Illuminate\Database\SeedServiceProvider',
|
||||
'Illuminate\Foundation\Providers\ServerServiceProvider',
|
||||
'Illuminate\Session\SessionServiceProvider',
|
||||
'Illuminate\Foundation\Providers\TinkerServiceProvider',
|
||||
'Illuminate\Translation\TranslationServiceProvider',
|
||||
'Illuminate\Validation\ValidationServiceProvider',
|
||||
'Illuminate\View\ViewServiceProvider',
|
||||
'Illuminate\Workbench\WorkbenchServiceProvider',
|
||||
'Basset\BassetServiceProvider',
|
||||
'Bootstrapper\BootstrapperServiceProvider',
|
||||
'Zizaco\Confide\ConfideServiceProvider',
|
||||
'Former\FormerServiceProvider',
|
||||
'Barryvdh\Debugbar\ServiceProvider',
|
||||
'Chumper\Datatable\DatatableServiceProvider',
|
||||
'Intervention\Image\ImageServiceProvider',
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Service Provider Manifest
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The service provider manifest is used by Laravel to lazy load service
|
||||
| providers which are not needed for each request, as well to keep a
|
||||
| list of all of the services. Here, you may set its storage spot.
|
||||
|
|
||||
*/
|
||||
|
||||
'manifest' => storage_path().'/meta',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Class Aliases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This array of class aliases will be registered when this application
|
||||
| is started. However, feel free to register as many as you wish as
|
||||
| the aliases are "lazy" loaded so they don't hinder performance.
|
||||
|
|
||||
*/
|
||||
|
||||
'aliases' => array(
|
||||
|
||||
'App' => 'Illuminate\Support\Facades\App',
|
||||
'Artisan' => 'Illuminate\Support\Facades\Artisan',
|
||||
'Auth' => 'Illuminate\Support\Facades\Auth',
|
||||
'Blade' => 'Illuminate\Support\Facades\Blade',
|
||||
'Cache' => 'Illuminate\Support\Facades\Cache',
|
||||
'ClassLoader' => 'Illuminate\Support\ClassLoader',
|
||||
'Config' => 'Illuminate\Support\Facades\Config',
|
||||
'Controller' => 'Illuminate\Routing\Controllers\Controller',
|
||||
'Cookie' => 'Illuminate\Support\Facades\Cookie',
|
||||
'Crypt' => 'Illuminate\Support\Facades\Crypt',
|
||||
'DB' => 'Illuminate\Support\Facades\DB',
|
||||
'Eloquent' => 'Illuminate\Database\Eloquent\Model',
|
||||
'Event' => 'Illuminate\Support\Facades\Event',
|
||||
'File' => 'Illuminate\Support\Facades\File',
|
||||
//'Form' => 'Illuminate\Support\Facades\Form',
|
||||
'Hash' => 'Illuminate\Support\Facades\Hash',
|
||||
'HTML' => 'Illuminate\Support\Facades\HTML',
|
||||
'Input' => 'Illuminate\Support\Facades\Input',
|
||||
'Lang' => 'Illuminate\Support\Facades\Lang',
|
||||
'Log' => 'Illuminate\Support\Facades\Log',
|
||||
'Mail' => 'Illuminate\Support\Facades\Mail',
|
||||
'Paginator' => 'Illuminate\Support\Facades\Paginator',
|
||||
'Password' => 'Illuminate\Support\Facades\Password',
|
||||
'Queue' => 'Illuminate\Support\Facades\Queue',
|
||||
'Redirect' => 'Illuminate\Support\Facades\Redirect',
|
||||
'Redis' => 'Illuminate\Support\Facades\Redis',
|
||||
'Request' => 'Illuminate\Support\Facades\Request',
|
||||
'Response' => 'Illuminate\Support\Facades\Response',
|
||||
'Route' => 'Illuminate\Support\Facades\Route',
|
||||
'Schema' => 'Illuminate\Support\Facades\Schema',
|
||||
'Seeder' => 'Illuminate\Database\Seeder',
|
||||
'Session' => 'Illuminate\Support\Facades\Session',
|
||||
'Str' => 'Illuminate\Support\Str',
|
||||
'URL' => 'Illuminate\Support\Facades\URL',
|
||||
'Validator' => 'Illuminate\Support\Facades\Validator',
|
||||
'View' => 'Illuminate\Support\Facades\View',
|
||||
'Basset' => 'Basset\Facade',
|
||||
'Alert' => 'Bootstrapper\Alert',
|
||||
'Badge' => 'Bootstrapper\Badge',
|
||||
'Breadcrumb' => 'Bootstrapper\Breadcrumb',
|
||||
'Button' => 'Bootstrapper\Button',
|
||||
'ButtonGroup' => 'Bootstrapper\ButtonGroup',
|
||||
'ButtonToolbar' => 'Bootstrapper\ButtonToolbar',
|
||||
'Carousel' => 'Bootstrapper\Carousel',
|
||||
'DropdownButton' => 'Bootstrapper\DropdownButton',
|
||||
'Form' => 'Bootstrapper\Form',
|
||||
'Helpers' => 'Bootstrapper\Helpers',
|
||||
'Icon' => 'Bootstrapper\Icon',
|
||||
'Image' => 'Bootstrapper\Image',
|
||||
'Label' => 'Bootstrapper\Label',
|
||||
'MediaObject' => 'Bootstrapper\MediaObject',
|
||||
'Navbar' => 'Bootstrapper\Navbar',
|
||||
'Navigation' => 'Bootstrapper\Navigation',
|
||||
'Paginator' => 'Bootstrapper\Paginator',
|
||||
'Progress' => 'Bootstrapper\Progress',
|
||||
'Tabbable' => 'Bootstrapper\Tabbable',
|
||||
'Table' => 'Bootstrapper\Table',
|
||||
'Thumbnail' => 'Bootstrapper\Thumbnail',
|
||||
'Typeahead' => 'Bootstrapper\Typeahead',
|
||||
'Typography' => 'Bootstrapper\Typography',
|
||||
'Confide' => 'Zizaco\Confide\ConfideFacade',
|
||||
'Former' => 'Former\Facades\Former',
|
||||
'Datatable' => 'Chumper\Datatable\Facades\Datatable',
|
||||
'Omnipay' => 'Omnipay\Omnipay',
|
||||
'CreditCard' => 'Omnipay\Common\CreditCard',
|
||||
'Image' => 'Intervention\Image\Facades\Image',
|
||||
),
|
||||
);
|
71
app/config/auth.php
Executable file
71
app/config/auth.php
Executable file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Authentication Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the authentication driver that will be utilized.
|
||||
| This drivers manages the retrieval and authentication of the users
|
||||
| attempting to get access to protected areas of your application.
|
||||
|
|
||||
| Supported: "database", "eloquent"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'eloquent',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Model
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "Eloquent" authentication driver, we need to know which
|
||||
| Eloquent model should be used to retrieve your users. Of course, it
|
||||
| is often just the "User" model but you may use whatever you like.
|
||||
|
|
||||
*/
|
||||
|
||||
'model' => 'User',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "Database" authentication driver, we need to know which
|
||||
| table should be used to retrieve your users. We have chosen a basic
|
||||
| default value but you may easily change it to any table you like.
|
||||
|
|
||||
*/
|
||||
|
||||
'table' => 'users',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reminder Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may set the settings for password reminders, including a view
|
||||
| that should be used as your password reminder e-mail. You will also
|
||||
| be able to set the name of the table that holds the reset tokens.
|
||||
|
|
||||
| The "expire" time is the number of minutes that the reminder should be
|
||||
| considered valid. This security feature keeps tokens short-lived so
|
||||
| they have less time to be guessed. You may change this as needed.
|
||||
|
|
||||
*/
|
||||
|
||||
'reminder' => array(
|
||||
|
||||
'email' => 'emails.auth.reminder',
|
||||
|
||||
'table' => 'password_reminders',
|
||||
|
||||
'expire' => 60,
|
||||
|
||||
),
|
||||
|
||||
);
|
89
app/config/cache.php
Executable file
89
app/config/cache.php
Executable file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Cache Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default cache "driver" that will be used when
|
||||
| using the Caching library. Of course, you may use other drivers any
|
||||
| time you wish. This is the default when another is not specified.
|
||||
|
|
||||
| Supported: "file", "database", "apc", "memcached", "redis", "array"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'file',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| File Cache Location
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "file" cache driver, we need a location where the cache
|
||||
| files may be stored. A sensible default has been specified, but you
|
||||
| are free to change it to any other place on disk that you desire.
|
||||
|
|
||||
*/
|
||||
|
||||
'path' => storage_path().'/cache',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Cache Connection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" cache driver you may specify the connection
|
||||
| that should be used to store the cached items. When this option is
|
||||
| null the default database connection will be utilized for cache.
|
||||
|
|
||||
*/
|
||||
|
||||
'connection' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Cache Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" cache driver we need to know the table that
|
||||
| should be used to store the cached items. A default table name has
|
||||
| been provided but you're free to change it however you deem fit.
|
||||
|
|
||||
*/
|
||||
|
||||
'table' => 'cache',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Memcached Servers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Now you may specify an array of your Memcached servers that should be
|
||||
| used when utilizing the Memcached cache driver. All of the servers
|
||||
| should contain a value for "host", "port", and "weight" options.
|
||||
|
|
||||
*/
|
||||
|
||||
'memcached' => array(
|
||||
|
||||
array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100),
|
||||
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Key Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When utilizing a RAM based store such as APC or Memcached, there might
|
||||
| be other applications utilizing the same cache. So, we'll specify a
|
||||
| value to get prefixed to all our keys so we can avoid collisions.
|
||||
|
|
||||
*/
|
||||
|
||||
'prefix' => 'laravel',
|
||||
|
||||
);
|
18
app/config/compile.php
Executable file
18
app/config/compile.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Additional Compiled Classes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify additional classes to include in the compiled file
|
||||
| generated by the `artisan optimize` command. These should be classes
|
||||
| that are included on basically every request into the application.
|
||||
|
|
||||
*/
|
||||
|
||||
|
||||
|
||||
);
|
124
app/config/database.php
Executable file
124
app/config/database.php
Executable file
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| PDO Fetch Style
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default, database results will be returned as instances of the PHP
|
||||
| stdClass object; however, you may desire to retrieve records in an
|
||||
| array format for simplicity. Here you can tweak the fetch style.
|
||||
|
|
||||
*/
|
||||
|
||||
'fetch' => PDO::FETCH_CLASS,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Database Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for all database work. Of course
|
||||
| you may use many connections at once using the Database library.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => 'mysql',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here are each of the database connections setup for your application.
|
||||
| Of course, examples of configuring each database platform that is
|
||||
| supported by Laravel is shown below to make development simple.
|
||||
|
|
||||
|
|
||||
| All database work in Laravel is done through the PHP PDO facilities
|
||||
| so make sure you have the driver for your particular database of
|
||||
| choice installed on your machine before you begin development.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => array(
|
||||
|
||||
'sqlite' => array(
|
||||
'driver' => 'sqlite',
|
||||
'database' => __DIR__.'/../database/production.sqlite',
|
||||
'prefix' => '',
|
||||
),
|
||||
|
||||
'mysql' => array(
|
||||
'driver' => 'mysql',
|
||||
'host' => 'localhost',
|
||||
'database' => '',
|
||||
'username' => '',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
'collation' => 'utf8_unicode_ci',
|
||||
'prefix' => '',
|
||||
),
|
||||
|
||||
'pgsql' => array(
|
||||
'driver' => 'pgsql',
|
||||
'host' => 'localhost',
|
||||
'database' => 'database',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'schema' => 'public',
|
||||
),
|
||||
|
||||
'sqlsrv' => array(
|
||||
'driver' => 'sqlsrv',
|
||||
'host' => 'localhost',
|
||||
'database' => 'database',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'prefix' => '',
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Repository Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk have not actually be run in the databases.
|
||||
|
|
||||
*/
|
||||
|
||||
'migrations' => 'migrations',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis Databases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Redis is an open source, fast, and advanced key-value store that also
|
||||
| provides a richer set of commands than a typical key-value systems
|
||||
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
||||
|
|
||||
*/
|
||||
|
||||
'redis' => array(
|
||||
|
||||
'cluster' => true,
|
||||
|
||||
'default' => array(
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
'database' => 0,
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
);
|
18
app/config/local/database.php
Executable file
18
app/config/local/database.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'connections' => array(
|
||||
|
||||
'mysql' => array(
|
||||
'driver' => 'mysql',
|
||||
'host' => 'localhost',
|
||||
'database' => 'ninja',
|
||||
'username' => 'ninja',
|
||||
'password' => '1234',
|
||||
'charset' => 'utf8',
|
||||
'collation' => 'utf8_unicode_ci',
|
||||
'prefix' => '',
|
||||
)
|
||||
)
|
||||
);
|
124
app/config/mail.php
Executable file
124
app/config/mail.php
Executable file
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
|
||||
| sending of e-mail. You may specify which one you're using throughout
|
||||
| your application here. By default, Laravel is setup for SMTP mail.
|
||||
|
|
||||
| Supported: "smtp", "mail", "sendmail"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'smtp',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may provide the host address of the SMTP server used by your
|
||||
| applications. A default option is provided that is compatible with
|
||||
| the Postmark mail service, which will provide reliable delivery.
|
||||
|
|
||||
*/
|
||||
|
||||
'host' => '',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Port
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the SMTP port used by your application to delivery e-mails to
|
||||
| users of your application. Like the host we have set this value to
|
||||
| stay compatible with the Postmark e-mail application by default.
|
||||
|
|
||||
*/
|
||||
|
||||
'port' => 587,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global "From" Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may wish for all e-mails sent by your application to be sent from
|
||||
| the same address. Here, you may specify a name and address that is
|
||||
| used globally for all e-mails that are sent by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'from' => array('address' => '', 'name' => ''),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| E-Mail Encryption Protocol
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the encryption protocol that should be used when
|
||||
| the application send e-mail messages. A sensible default using the
|
||||
| transport layer security protocol should provide great security.
|
||||
|
|
||||
*/
|
||||
|
||||
'encryption' => 'tls',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Username
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If your SMTP server requires a username for authentication, you should
|
||||
| set it here. This will get used to authenticate with your server on
|
||||
| connection. You may also set the "password" value below this one.
|
||||
|
|
||||
*/
|
||||
|
||||
'username' => '',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Password
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may set the password required by your SMTP server to send out
|
||||
| messages from your application. This will be given to the server on
|
||||
| connection so that the application will be able to send messages.
|
||||
|
|
||||
*/
|
||||
|
||||
'password' => '',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sendmail System Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "sendmail" driver to send e-mails, we will need to know
|
||||
| the path to where Sendmail lives on this server. A default path has
|
||||
| been provided here, which will work well on most of your systems.
|
||||
|
|
||||
*/
|
||||
|
||||
'sendmail' => '/usr/sbin/sendmail -bs',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail "Pretend"
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When this option is enabled, e-mail will not actually be sent over the
|
||||
| web and will instead be written to your application's logs files so
|
||||
| you may inspect the message. This is great for local development.
|
||||
|
|
||||
*/
|
||||
|
||||
'pretend' => false,
|
||||
|
||||
);
|
0
app/config/packages/.gitkeep
Executable file
0
app/config/packages/.gitkeep
Executable file
14
app/config/packages/anahkiasen/former/Nude.php
Executable file
14
app/config/packages/anahkiasen/former/Nude.php
Executable file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
// HTML markup and classes used by the "Nude" framework for icons
|
||||
'icon' => array(
|
||||
|
||||
'tag' => 'i',
|
||||
'set' => null,
|
||||
'prefix' => 'icon',
|
||||
|
||||
),
|
||||
|
||||
);
|
14
app/config/packages/anahkiasen/former/TwitterBootstrap.php
Executable file
14
app/config/packages/anahkiasen/former/TwitterBootstrap.php
Executable file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
// HTML markup and classes used by Bootstrap for icons
|
||||
'icon' => array(
|
||||
|
||||
'tag' => 'i',
|
||||
'set' => null,
|
||||
'prefix' => 'icon',
|
||||
|
||||
),
|
||||
|
||||
);
|
26
app/config/packages/anahkiasen/former/TwitterBootstrap3.php
Executable file
26
app/config/packages/anahkiasen/former/TwitterBootstrap3.php
Executable file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
// Map Former-supported viewports to Bootstrap 3 equivalents
|
||||
'viewports' => array(
|
||||
'large' => 'lg',
|
||||
'medium' => 'md',
|
||||
'small' => 'sm',
|
||||
'mini' => 'xs',
|
||||
),
|
||||
|
||||
// Width of labels for horizontal forms expressed as viewport => grid columns
|
||||
'labelWidths' => array(
|
||||
'large' => 4,
|
||||
'small' => 4,
|
||||
),
|
||||
|
||||
// HTML markup and classes used by Bootstrap 3 for icons
|
||||
'icon' => array(
|
||||
'tag' => 'span',
|
||||
'set' => 'glyphicon',
|
||||
'prefix' => 'glyphicon',
|
||||
),
|
||||
|
||||
);
|
35
app/config/packages/anahkiasen/former/ZurbFoundation.php
Executable file
35
app/config/packages/anahkiasen/former/ZurbFoundation.php
Executable file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
// Map Former-supported viewports to Foundation 3 equivalents
|
||||
'viewports' => array(
|
||||
|
||||
'large' => '',
|
||||
'medium' => null,
|
||||
'small' => 'mobile-',
|
||||
'mini' => null,
|
||||
|
||||
),
|
||||
|
||||
// Width of labels for horizontal forms expressed as viewport => grid columns
|
||||
'labelWidths' => array(
|
||||
|
||||
'large' => 2,
|
||||
'small' => 4,
|
||||
|
||||
),
|
||||
|
||||
// Classes to be applied to wrapped labels in horizontal forms
|
||||
'wrappedLabelClasses' => array('right','inline'),
|
||||
|
||||
// HTML markup and classes used by Foundation 3 for icons
|
||||
'icon' => array(
|
||||
|
||||
'tag' => 'i',
|
||||
'set' => null,
|
||||
'prefix' => 'fi',
|
||||
|
||||
),
|
||||
|
||||
);
|
36
app/config/packages/anahkiasen/former/ZurbFoundation4.php
Executable file
36
app/config/packages/anahkiasen/former/ZurbFoundation4.php
Executable file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
// Map Former-supported viewports to Foundation 4 equivalents
|
||||
// Foundation 4 also has an experimental "medium" breakpoint
|
||||
// explained at http://foundation.zurb.com/docs/components/grid.html
|
||||
'viewports' => array(
|
||||
|
||||
'large' => 'large',
|
||||
'medium' => null,
|
||||
'small' => 'small',
|
||||
'mini' => null,
|
||||
|
||||
),
|
||||
|
||||
// Width of labels for horizontal forms expressed as viewport => grid columns
|
||||
'labelWidths' => array(
|
||||
|
||||
'small' => 3,
|
||||
|
||||
),
|
||||
|
||||
// Classes to be applied to wrapped labels in horizontal forms
|
||||
'wrappedLabelClasses' => array('right','inline'),
|
||||
|
||||
// HTML markup and classes used by Foundation 4 for icons
|
||||
'icon' => array(
|
||||
|
||||
'tag' => 'i',
|
||||
'set' => 'general',
|
||||
'prefix' => 'foundicon',
|
||||
|
||||
),
|
||||
|
||||
);
|
59
app/config/packages/anahkiasen/former/config.php
Executable file
59
app/config/packages/anahkiasen/former/config.php
Executable file
@ -0,0 +1,59 @@
|
||||
<?php return array(
|
||||
|
||||
// Markup
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Whether labels should be automatically computed from name
|
||||
'automatic_label' => true,
|
||||
|
||||
// The default form type
|
||||
'default_form_type' => 'horizontal',
|
||||
|
||||
// The framework to be used by Former
|
||||
'framework' => 'TwitterBootstrap3',
|
||||
|
||||
// Validation
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Whether Former should fetch errors from Session
|
||||
'fetch_errors' => true,
|
||||
|
||||
// Whether Former should try to apply Validator rules as attributes
|
||||
'live_validation' => true,
|
||||
|
||||
// Whether Former should automatically fetch error messages and
|
||||
// display them next to the matching fields
|
||||
'error_messages' => true,
|
||||
|
||||
// Checkables
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Whether checkboxes should always be present in the POST data,
|
||||
// no matter if you checked them or not
|
||||
'push_checkboxes' => false,
|
||||
|
||||
// The value a checkbox will have in the POST array if unchecked
|
||||
'unchecked_value' => 0,
|
||||
|
||||
// Required fields
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
// The class to be added to required fields
|
||||
'required_class' => 'required',
|
||||
|
||||
// A facultative text to append to the labels of required fields
|
||||
'required_text' => '<sup>*</sup>',
|
||||
|
||||
// Translations
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Where Former should look for translations
|
||||
'translate_from' => 'validation.attributes',
|
||||
|
||||
// An array of attributes to automatically translate
|
||||
'translatable' => array(
|
||||
'help', 'inlineHelp', 'blockHelp',
|
||||
'placeholder', 'data_placeholder',
|
||||
'label'
|
||||
),
|
||||
);
|
19
app/config/packages/ignited/laravel-omnipay/config.php
Executable file
19
app/config/packages/ignited/laravel-omnipay/config.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
// The default gateway to use
|
||||
'default' => 'paypal',
|
||||
|
||||
// Add in each gateway here
|
||||
'gateways' => array(
|
||||
'paypal' => array(
|
||||
'driver' => 'Paypal_Express',
|
||||
'options' => array(
|
||||
'solutionType' => '',
|
||||
'landingPage' => '',
|
||||
'headerImageUrl' => ''
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
0
app/config/packages/zizaco/confide/.gitkeep
Executable file
0
app/config/packages/zizaco/confide/.gitkeep
Executable file
117
app/config/packages/zizaco/confide/config.php
Executable file
117
app/config/packages/zizaco/confide/config.php
Executable file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Login Throttle
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Defines how many login failed tries may be done within
|
||||
| the 'throttle_time_period', which is in minutes.
|
||||
|
|
||||
*/
|
||||
|
||||
'throttle_limit' => 9,
|
||||
'throttle_time_period' => 2,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Login Throttle Field
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Login throttle is done using the remote ip address
|
||||
| and a provided credential. Email and username are likely values.
|
||||
|
|
||||
| Default: email
|
||||
|
|
||||
*/
|
||||
'login_cache_field' => 'email',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Form Views
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The VIEWS used to render forms with Confide methods:
|
||||
| makeLoginForm, makeSignupForm, makeForgotPasswordForm
|
||||
| and makeResetPasswordForm.
|
||||
|
|
||||
| By default, the out of the box confide views are used
|
||||
| but you can create your own forms and replace the view
|
||||
| names here. For example
|
||||
|
|
||||
| // To use app/views/user/signup.blade.php:
|
||||
|
|
||||
| 'signup_form' => 'user.signup'
|
||||
|
|
||||
|
|
||||
*/
|
||||
'login_form' => 'login',
|
||||
'signup_form' => 'confide::signup',
|
||||
'forgot_password_form' => 'confide::forgot_password',
|
||||
'reset_password_form' => 'confide::reset_password',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Email Views
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The VIEWS used to email messages for some Confide events:
|
||||
|
|
||||
| By default, the out of the box confide views are used
|
||||
| but you can create your own forms and replace the view
|
||||
| names here. For example
|
||||
|
|
||||
| // To use app/views/email/confirmation.blade.php:
|
||||
|
|
||||
| 'email_account_confirmation' => 'email.confirmation'
|
||||
|
|
||||
|
|
||||
*/
|
||||
|
||||
'email_reset_password' => 'confide::emails.passwordreset', // with $user and $token.
|
||||
'email_account_confirmation' => 'confide::emails.confirm', // with $user
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Signup (create) Cache
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default you will only can only register once every 2 hours
|
||||
| (120 minutes) because you are not able to receive a registration
|
||||
| email more often then that.
|
||||
|
|
||||
| You can adjust that limitation here, set to 0 for no caching.
|
||||
| Time is in minutes.
|
||||
|
|
||||
|
|
||||
*/
|
||||
'signup_cache' => 120,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Signup E-mail and confirmation (true or false)
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default a signup e-mail will be send by the system, however if you
|
||||
| do not want this to happen, change the line below in false and handle
|
||||
| the confirmation using another technique, for example by using the IPN
|
||||
| from a payment-processor. Very usefull for websites offering products.
|
||||
|
|
||||
| signup_email:
|
||||
| is for the transport of the email, true or false
|
||||
| If you want to use an IPN to trigger the email, then set it to false
|
||||
|
|
||||
| signup_confirm:
|
||||
| is to decide of a member needs to be confirmed before he is able to login
|
||||
| so when you set this to true, then a member has to be confirmed before
|
||||
| he is able to login, so if you want to use an IPN for confirmation, be
|
||||
| sure that the ipn process also changes the confirmed flag in the member
|
||||
| table, otherwise they will not be able to login after the payment.
|
||||
|
|
||||
*/
|
||||
'signup_email' => false,
|
||||
'signup_confirm' => false,
|
||||
|
||||
);
|
60
app/config/queue.php
Executable file
60
app/config/queue.php
Executable file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Queue Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The Laravel queue API supports a variety of back-ends via an unified
|
||||
| API, giving you convenient access to each back-end using the same
|
||||
| syntax for each one. Here you may set the default queue driver.
|
||||
|
|
||||
| Supported: "sync", "beanstalkd", "sqs", "iron"
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => 'sync',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Queue Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the connection information for each server that
|
||||
| is used by your application. A default configuration has been added
|
||||
| for each back-end shipped with Laravel. You are free to add more.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => array(
|
||||
|
||||
'sync' => array(
|
||||
'driver' => 'sync',
|
||||
),
|
||||
|
||||
'beanstalkd' => array(
|
||||
'driver' => 'beanstalkd',
|
||||
'host' => 'localhost',
|
||||
'queue' => 'default',
|
||||
),
|
||||
|
||||
'sqs' => array(
|
||||
'driver' => 'sqs',
|
||||
'key' => 'your-public-key',
|
||||
'secret' => 'your-secret-key',
|
||||
'queue' => 'your-queue-url',
|
||||
'region' => 'us-east-1',
|
||||
),
|
||||
|
||||
'iron' => array(
|
||||
'driver' => 'iron',
|
||||
'project' => 'your-project-id',
|
||||
'token' => 'your-token',
|
||||
'queue' => 'your-queue-name',
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
);
|
125
app/config/session.php
Executable file
125
app/config/session.php
Executable file
@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Session Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default session "driver" that will be used on
|
||||
| requests. By default, we will use the lightweight native driver but
|
||||
| you may specify any of the other wonderful drivers provided here.
|
||||
|
|
||||
| Supported: "native", "cookie", "database", "apc",
|
||||
| "memcached", "redis", "array"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'native',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Lifetime
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the number of minutes that you wish the session
|
||||
| to be allowed to remain idle before it expires. If you want them
|
||||
| to immediately expire when the browser closes, set it to zero.
|
||||
|
|
||||
*/
|
||||
|
||||
'lifetime' => 120,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session File Location
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the native session driver, we need a location where session
|
||||
| files may be stored. A default has been set for you but a different
|
||||
| location may be specified. This is only needed for file sessions.
|
||||
|
|
||||
*/
|
||||
|
||||
'files' => storage_path().'/sessions',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Connection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" session driver, you may specify the database
|
||||
| connection that should be used to manage your sessions. This should
|
||||
| correspond to a connection in your "database" configuration file.
|
||||
|
|
||||
*/
|
||||
|
||||
'connection' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" session driver, you may specify the table we
|
||||
| should use to manage the sessions. Of course, a sensible default is
|
||||
| provided for you; however, you are free to change this as needed.
|
||||
|
|
||||
*/
|
||||
|
||||
'table' => 'sessions',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Sweeping Lottery
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Some session drivers must manually sweep their storage location to get
|
||||
| rid of old sessions from storage. Here are the chances that it will
|
||||
| happen on a given request. By default, the odds are 2 out of 100.
|
||||
|
|
||||
*/
|
||||
|
||||
'lottery' => array(2, 100),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may change the name of the cookie used to identify a session
|
||||
| instance by ID. The name specified here will get used every time a
|
||||
| new session cookie is created by the framework for every driver.
|
||||
|
|
||||
*/
|
||||
|
||||
'cookie' => 'laravel_session',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The session cookie path determines the path for which the cookie will
|
||||
| be regarded as available. Typically, this will be the root path of
|
||||
| your application but you are free to change this when necessary.
|
||||
|
|
||||
*/
|
||||
|
||||
'path' => '/',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Domain
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may change the domain of the cookie used to identify a session
|
||||
| in your application. This will determine which domains the cookie is
|
||||
| available to in your application. A sensible default has been set.
|
||||
|
|
||||
*/
|
||||
|
||||
'domain' => null,
|
||||
|
||||
);
|
20
app/config/testing/cache.php
Executable file
20
app/config/testing/cache.php
Executable file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Cache Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default cache "driver" that will be used when
|
||||
| using the Caching library. Of course, you may use other drivers any
|
||||
| time you wish. This is the default when another is not specified.
|
||||
|
|
||||
| Supported: "file", "database", "apc", "memcached", "redis", "array"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'array',
|
||||
|
||||
);
|
21
app/config/testing/session.php
Executable file
21
app/config/testing/session.php
Executable file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Session Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default session "driver" that will be used on
|
||||
| requests. By default, we will use the lightweight native driver but
|
||||
| you may specify any of the other wonderful drivers provided here.
|
||||
|
|
||||
| Supported: "native", "cookie", "database", "apc",
|
||||
| "memcached", "redis", "array"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'array',
|
||||
|
||||
);
|
31
app/config/view.php
Executable file
31
app/config/view.php
Executable file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| View Storage Paths
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Most templating systems load templates from disk. Here you may specify
|
||||
| an array of paths that should be checked for your views. Of course
|
||||
| the usual Laravel view path has already been registered for you.
|
||||
|
|
||||
*/
|
||||
|
||||
'paths' => array(__DIR__.'/../views'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Pagination View
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This view will be used to render the pagination link output, and can
|
||||
| be easily customized here to show any view you like. A clean view
|
||||
| compatible with Twitter's Bootstrap is given to you by default.
|
||||
|
|
||||
*/
|
||||
|
||||
'pagination' => 'pagination::slider',
|
||||
|
||||
);
|
31
app/config/workbench.php
Executable file
31
app/config/workbench.php
Executable file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Workbench Author Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When you create new packages via the Artisan "workbench" command your
|
||||
| name is needed to generate the composer.json file for your package.
|
||||
| You may specify it now so it is used for all of your workbenches.
|
||||
|
|
||||
*/
|
||||
|
||||
'name' => '',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Workbench Author E-Mail Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Like the option above, your e-mail address is used when generating new
|
||||
| workbench packages. The e-mail is placed in your composer.json file
|
||||
| automatically after the package is created by the workbench tool.
|
||||
|
|
||||
*/
|
||||
|
||||
'email' => '',
|
||||
|
||||
);
|
0
app/controllers/.gitkeep
Executable file
0
app/controllers/.gitkeep
Executable file
418
app/controllers/AccountController.php
Executable file
418
app/controllers/AccountController.php
Executable file
@ -0,0 +1,418 @@
|
||||
<?php
|
||||
|
||||
class AccountController extends \BaseController {
|
||||
|
||||
public function getStarted()
|
||||
{
|
||||
$user = false;
|
||||
|
||||
$guestKey = Input::get('guest_key');
|
||||
|
||||
if ($guestKey)
|
||||
{
|
||||
//$user = User::where('key','=',$guestKey)->firstOrFail();
|
||||
$user = User::where('password', '=', $guestKey)->first();
|
||||
|
||||
if ($user && !$user->is_guest)
|
||||
{
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$user)
|
||||
{
|
||||
$account = new Account;
|
||||
$account->ip = Request::getClientIp();
|
||||
$account->key = str_random(20);
|
||||
$account->save();
|
||||
|
||||
$random = str_random(20);
|
||||
|
||||
$user = new User;
|
||||
$user->username = $random.'@gmail.com';
|
||||
$user->password = $random;
|
||||
$user->email = $random.'@gmail.com';
|
||||
$user->password_confirmation = $random;
|
||||
$account->users()->save($user);
|
||||
}
|
||||
|
||||
Auth::login($user);
|
||||
return Redirect::to('invoices/create');
|
||||
}
|
||||
|
||||
public function showSection($section = ACCOUNT_DETAILS)
|
||||
{
|
||||
if ($section == ACCOUNT_DETAILS)
|
||||
{
|
||||
$account = Account::with('users')->find(Auth::user()->account_id);
|
||||
|
||||
return View::make('accounts.details', array('account' => $account));
|
||||
}
|
||||
else if ($section == ACCOUNT_SETTINGS)
|
||||
{
|
||||
$account = Account::with('account_gateways')->find(Auth::user()->account_id);
|
||||
$gateways = Gateway::all();
|
||||
|
||||
foreach ($gateways as $gateway)
|
||||
{
|
||||
$gateway->fields = Omnipay::create($gateway->provider)->getDefaultParameters();
|
||||
}
|
||||
|
||||
return View::make('accounts.settings', array('account' => $account, 'gateways' => $gateways));
|
||||
}
|
||||
else if ($section == ACCOUNT_IMPORT)
|
||||
{
|
||||
return View::make('accounts.import');
|
||||
}
|
||||
else if ($section == ACCOUNT_EXPORT)
|
||||
{
|
||||
return View::make('accounts.export');
|
||||
}
|
||||
}
|
||||
|
||||
public function doSection($section = ACCOUNT_DETAILS)
|
||||
{
|
||||
if ($section == ACCOUNT_DETAILS)
|
||||
{
|
||||
return AccountController::saveDetails();
|
||||
}
|
||||
else if ($section == ACCOUNT_SETTINGS)
|
||||
{
|
||||
return AccountController::saveSettings();
|
||||
}
|
||||
else if ($section == ACCOUNT_IMPORT)
|
||||
{
|
||||
return AccountController::importFile();
|
||||
}
|
||||
else if ($section == ACCOUNT_MAP)
|
||||
{
|
||||
return AccountController::mapFile();
|
||||
}
|
||||
else if ($section == ACCOUNT_EXPORT)
|
||||
{
|
||||
return AccountController::export();
|
||||
}
|
||||
}
|
||||
|
||||
private function export()
|
||||
{
|
||||
$output = fopen("php://output",'w') or die("Can't open php://output");
|
||||
header("Content-Type:application/csv");
|
||||
header("Content-Disposition:attachment;filename=export.csv");
|
||||
|
||||
$clients = Client::where('account_id','=',Auth::user()->account_id)->get();
|
||||
AccountController::exportData($output, $clients->toArray());
|
||||
|
||||
$contacts = DB::table('contacts')->whereIn('client_id', function($query){
|
||||
$query->select('client_id')->from('clients')->where('account_id','=',Auth::user()->account_id);
|
||||
})->get();
|
||||
AccountController::exportData($output, toArray($contacts));
|
||||
|
||||
$invoices = Invoice::where('account_id','=',Auth::user()->account_id)->get();
|
||||
AccountController::exportData($output, $invoices->toArray());
|
||||
|
||||
$invoiceItems = DB::table('invoice_items')->whereIn('invoice_id', function($query){
|
||||
$query->select('invoice_id')->from('invoices')->where('account_id','=',Auth::user()->account_id);
|
||||
})->get();
|
||||
AccountController::exportData($output, toArray($invoiceItems));
|
||||
|
||||
$payments = Payment::where('account_id','=',Auth::user()->account_id)->get();
|
||||
AccountController::exportData($output, $payments->toArray());
|
||||
|
||||
fclose($output);
|
||||
exit;
|
||||
}
|
||||
|
||||
private function exportData($output, $data)
|
||||
{
|
||||
if (count($data) > 0)
|
||||
{
|
||||
fputcsv($output, array_keys($data[0]));
|
||||
}
|
||||
|
||||
foreach($data as $record)
|
||||
{
|
||||
fputcsv($output, $record);
|
||||
}
|
||||
|
||||
fwrite($output, "\n");
|
||||
}
|
||||
|
||||
private function importFile()
|
||||
{
|
||||
$data = Session::get('data');
|
||||
Session::forget('data');
|
||||
|
||||
$map = Input::get('map');
|
||||
$count = 0;
|
||||
$hasHeaders = Input::get('header_checkbox');
|
||||
|
||||
foreach ($data as $row)
|
||||
{
|
||||
if ($hasHeaders)
|
||||
{
|
||||
$hasHeaders = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
$client = new Client;
|
||||
$client->account_id = Auth::user()->account_id;
|
||||
$contact = new Contact;
|
||||
$count++;
|
||||
|
||||
foreach ($row as $index => $value)
|
||||
{
|
||||
$field = $map[$index];
|
||||
|
||||
if ($field == Client::$fieldName)
|
||||
{
|
||||
$client->name = $value;
|
||||
}
|
||||
else if ($field == Client::$fieldPhone)
|
||||
{
|
||||
$client->work_phone = $value;
|
||||
}
|
||||
else if ($field == Client::$fieldAddress1)
|
||||
{
|
||||
$client->address1 = $value;
|
||||
}
|
||||
else if ($field == Client::$fieldAddress2)
|
||||
{
|
||||
$client->address2 = $value;
|
||||
}
|
||||
else if ($field == Client::$fieldCity)
|
||||
{
|
||||
$client->city = $value;
|
||||
}
|
||||
else if ($field == Client::$fieldState)
|
||||
{
|
||||
$client->state = $value;
|
||||
}
|
||||
else if ($field == Client::$fieldPostalCode)
|
||||
{
|
||||
$client->postal_code = $value;
|
||||
}
|
||||
else if ($field == Client::$fieldNotes)
|
||||
{
|
||||
$client->notes = $value;
|
||||
}
|
||||
else if ($field == Contact::$fieldFirstName)
|
||||
{
|
||||
$contact->first_name = $value;
|
||||
}
|
||||
else if ($field == Contact::$fieldLastName)
|
||||
{
|
||||
$contact->last_name = $value;
|
||||
}
|
||||
else if ($field == Contact::$fieldPhone)
|
||||
{
|
||||
$contact->phone = $value;
|
||||
}
|
||||
else if ($field == Contact::$fieldEmail)
|
||||
{
|
||||
$contact->email = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$client->save();
|
||||
$client->contacts()->save($contact);
|
||||
}
|
||||
|
||||
$message = pluralize('Successfully created ? client', $count);
|
||||
Session::flash('message', $message);
|
||||
return Redirect::to('clients');
|
||||
}
|
||||
|
||||
private function mapFile()
|
||||
{
|
||||
$file = Input::file('file');
|
||||
$name = $file->getRealPath();
|
||||
|
||||
require_once(app_path().'/includes/parsecsv.lib.php');
|
||||
$csv = new parseCSV();
|
||||
$csv->heading = false;
|
||||
$csv->auto($name);
|
||||
|
||||
Session::put('data', $csv->data);
|
||||
|
||||
$headers = false;
|
||||
$hasHeaders = false;
|
||||
$mapped = array();
|
||||
$columns = array('',
|
||||
Client::$fieldName,
|
||||
Client::$fieldPhone,
|
||||
Client::$fieldAddress1,
|
||||
Client::$fieldAddress2,
|
||||
Client::$fieldCity,
|
||||
Client::$fieldState,
|
||||
Client::$fieldPostalCode,
|
||||
Client::$fieldNotes,
|
||||
Contact::$fieldFirstName,
|
||||
Contact::$fieldLastName,
|
||||
Contact::$fieldPhone,
|
||||
Contact::$fieldEmail
|
||||
);
|
||||
|
||||
if (count($csv->data) > 0)
|
||||
{
|
||||
$headers = $csv->data[0];
|
||||
foreach ($headers as $title)
|
||||
{
|
||||
if (strpos(strtolower($title),'name') > 0)
|
||||
{
|
||||
$hasHeaders = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for ($i=0; $i<count($headers); $i++)
|
||||
{
|
||||
$title = strtolower($headers[$i]);
|
||||
$mapped[$i] = '';
|
||||
|
||||
if ($hasHeaders)
|
||||
{
|
||||
$map = array(
|
||||
'first' => Contact::$fieldFirstName,
|
||||
'last' => Contact::$fieldLastName,
|
||||
'email' => Contact::$fieldEmail,
|
||||
'mobile' => Contact::$fieldPhone,
|
||||
'phone' => Client::$fieldPhone,
|
||||
'name' => Client::$fieldName,
|
||||
'address|address1' => Client::$fieldAddress1,
|
||||
'address2' => Client::$fieldAddress2,
|
||||
'city' => Client::$fieldCity,
|
||||
'state' => Client::$fieldState,
|
||||
'zip|postal|code' => Client::$fieldPostalCode,
|
||||
'note' => Client::$fieldNotes,
|
||||
);
|
||||
|
||||
foreach ($map as $search => $column)
|
||||
{
|
||||
foreach(explode("|", $search) as $string)
|
||||
{
|
||||
if (strpos($title, $string) !== false)
|
||||
{
|
||||
$mapped[$i] = $column;
|
||||
break(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'data' => $csv->data,
|
||||
'headers' => $headers,
|
||||
'hasHeaders' => $hasHeaders,
|
||||
'columns' => $columns,
|
||||
'mapped' => $mapped
|
||||
);
|
||||
|
||||
return View::make('accounts.import_map', $data);
|
||||
}
|
||||
|
||||
private function saveSetting()
|
||||
{
|
||||
$gateways = Gateway::all();
|
||||
$rules = array();
|
||||
|
||||
foreach ($gateways as $gateway)
|
||||
{
|
||||
if (!Input::get('gateway_'.$gateway->id))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$fields = Omnipay::create($gateway->provider)->getDefaultParameters();
|
||||
|
||||
foreach ($fields as $field => $details)
|
||||
{
|
||||
if (in_array($field, array('username','password','signature')))
|
||||
{
|
||||
$rules[$gateway->id.'_'.$field] = 'required';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
return Redirect::to('account/settings')
|
||||
->withErrors($validator)
|
||||
->withInput();
|
||||
}
|
||||
else
|
||||
{
|
||||
$account = Account::find(Auth::user()->account_id);
|
||||
|
||||
/* Payment Gateways */
|
||||
$account->account_gateways()->forceDelete();
|
||||
foreach ($gateways as $gateway)
|
||||
{
|
||||
if (!Input::get('gateway_'.$gateway->id))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$accountGateway = new AccountGateway;
|
||||
$accountGateway->gateway_id = $gateway->id;
|
||||
$accountGateway->username = Input::get($gateway->id.'_username');
|
||||
$accountGateway->password = Input::get($gateway->id.'_password');
|
||||
$accountGateway->signature = Input::get($gateway->id.'_signature');
|
||||
$account->account_gateways()->save($accountGateway);
|
||||
}
|
||||
|
||||
Session::flash('message', 'Successfully updated account');
|
||||
return Redirect::to('account/settings');
|
||||
}
|
||||
}
|
||||
|
||||
private function saveDetails()
|
||||
{
|
||||
$rules = array(
|
||||
'name' => 'required',
|
||||
'email' => 'email|required'
|
||||
);
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
return Redirect::to('account/details')
|
||||
->withErrors($validator)
|
||||
->withInput();
|
||||
}
|
||||
else
|
||||
{
|
||||
$account = Account::find(Auth::user()->account_id);
|
||||
$account->name = Input::get('name');
|
||||
$account->address1 = Input::get('address1');
|
||||
$account->address2 = Input::get('address2');
|
||||
$account->city = Input::get('city');
|
||||
$account->state = Input::get('state');
|
||||
$account->postal_code = Input::get('postal_code');
|
||||
$account->save();
|
||||
|
||||
$user = $account->users()->first();
|
||||
$user->first_name = Input::get('first_name');
|
||||
$user->last_name = Input::get('last_name');
|
||||
$user->email = Input::get('email');
|
||||
$user->phone = Input::get('phone');
|
||||
$user->save();
|
||||
|
||||
/* Logo image file */
|
||||
if ($file = Input::file('logo'))
|
||||
{
|
||||
$path = Input::file('logo')->getRealPath();
|
||||
File::delete('logo/' . $account->key . '.jpg');
|
||||
Image::make($path)->resize(150, 100, true, false)->save('logo/' . $account->key . '.jpg');
|
||||
}
|
||||
|
||||
Session::flash('message', 'Successfully updated account');
|
||||
return Redirect::to('account/details');
|
||||
}
|
||||
}
|
||||
}
|
18
app/controllers/BaseController.php
Executable file
18
app/controllers/BaseController.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
class BaseController extends Controller {
|
||||
|
||||
/**
|
||||
* Setup the layout used by the controller.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setupLayout()
|
||||
{
|
||||
if ( ! is_null($this->layout))
|
||||
{
|
||||
$this->layout = View::make($this->layout);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
168
app/controllers/ClientController.php
Executable file
168
app/controllers/ClientController.php
Executable file
@ -0,0 +1,168 @@
|
||||
<?php
|
||||
|
||||
class ClientController extends \BaseController {
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//$clients = Client::orderBy('name')->get();
|
||||
//return View::make('clients.index')->with('clients', $clients);
|
||||
|
||||
return View::make('clients.index');
|
||||
}
|
||||
|
||||
public function getDatatable()
|
||||
{
|
||||
return Datatable::collection(Client::with('contacts')->where('account_id','=',Auth::user()->account_id)->get())
|
||||
->addColumn('name', function($model)
|
||||
{
|
||||
//return $model->name;
|
||||
return link_to('clients/' . $model->id, $model->name);
|
||||
})
|
||||
->addColumn('contact', function($model)
|
||||
{
|
||||
return $model->contacts[0]->fullName();
|
||||
})
|
||||
->addColumn('last_login', function($model)
|
||||
{
|
||||
return $model->contacts[0]->lastLogin();
|
||||
})
|
||||
->addColumn('email', function($model)
|
||||
{
|
||||
//return $model->contacts[0]->email;
|
||||
return HTML::mailto($model->contacts[0]->email, $model->contacts[0]->email);
|
||||
})
|
||||
->addColumn('phone', function($model)
|
||||
{
|
||||
return $model->contacts[0]->phone;
|
||||
})
|
||||
->orderColumns('name')
|
||||
->make();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data = array('client' => null, 'method' => 'POST', 'url' => 'clients', 'title' => 'New');
|
||||
return View::make('clients.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store()
|
||||
{
|
||||
$rules = array(
|
||||
'name' => 'required',
|
||||
'email' => 'email'
|
||||
);
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Redirect::to('clients/create')
|
||||
->withErrors($validator)
|
||||
->withInput(Input::except('password'));
|
||||
} else {
|
||||
$client = new Client;
|
||||
$client->account_id = Auth::user()->account_id;
|
||||
$client->name = Input::get('name');
|
||||
$client->work_phone = Input::get('work_phone');
|
||||
$client->address1 = Input::get('address1');
|
||||
$client->address2 = Input::get('address2');
|
||||
$client->city = Input::get('city');
|
||||
$client->state = Input::get('state');
|
||||
$client->notes = Input::get('notes');
|
||||
$client->postal_code = Input::get('postal_code');
|
||||
$client->save();
|
||||
|
||||
$contact = new Contact;
|
||||
$contact->email = Input::get('email');
|
||||
$contact->first_name = Input::get('first_name');
|
||||
$contact->last_name = Input::get('last_name');
|
||||
$contact->phone = Input::get('phone');
|
||||
$client->contacts()->save($contact);
|
||||
|
||||
Session::flash('message', 'Successfully created client');
|
||||
return Redirect::to('clients/' . $client->id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$client = Client::find($id);
|
||||
return View::make('clients.show')->with('client', $client);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$client = Client::find($id);
|
||||
$data = array('client' => $client, 'method' => 'PUT', 'url' => 'clients/' . $id, 'title' => 'Edit');
|
||||
return View::make('clients.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function update($id)
|
||||
{
|
||||
$rules = array(
|
||||
'name' => 'required'
|
||||
);
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Redirect::to('clients/' . $id . '/edit')
|
||||
->withErrors($validator)
|
||||
->withInput(Input::except('password'));
|
||||
} else {
|
||||
$client = Client::find($id);
|
||||
$client->name = Input::get('name');
|
||||
$client->save();
|
||||
|
||||
Session::flash('message', 'Successfully updated client');
|
||||
return Redirect::to('clients');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$client = Client::find($id);
|
||||
$client->delete();
|
||||
|
||||
// redirect
|
||||
Session::flash('message', 'Successfully deleted the client');
|
||||
return Redirect::to('clients');
|
||||
}
|
||||
}
|
11
app/controllers/HomeController.php
Executable file
11
app/controllers/HomeController.php
Executable file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
class HomeController extends BaseController {
|
||||
|
||||
protected $layout = 'master';
|
||||
|
||||
public function showWelcome()
|
||||
{
|
||||
return View::make('home.index');
|
||||
}
|
||||
}
|
343
app/controllers/InvoiceController.php
Executable file
343
app/controllers/InvoiceController.php
Executable file
@ -0,0 +1,343 @@
|
||||
<?php
|
||||
|
||||
class InvoiceController extends \BaseController {
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//$invoices = Invoice::with('client')->orderBy('created_at', 'DESC')->get();
|
||||
return View::make('invoices.index');
|
||||
}
|
||||
|
||||
public function getDatatable()
|
||||
{
|
||||
return Datatable::collection(Invoice::with('client','invoice_items')->where('account_id','=',Auth::user()->account_id)->get())
|
||||
->addColumn('number', function($model)
|
||||
{
|
||||
return link_to('invoices/' . $model->id . '/edit', $model->number);
|
||||
})
|
||||
->addColumn('client', function($model)
|
||||
{
|
||||
return link_to('clients/' . $model->client->id, $model->client->name);
|
||||
})
|
||||
->addColumn('amount', function($model)
|
||||
{
|
||||
return '$' . money_format('%i', $model->getTotal());
|
||||
})
|
||||
->addColumn('date', function($model)
|
||||
{
|
||||
return $model->created_at->format('m/d/y h:i a');
|
||||
})
|
||||
->orderColumns('number')
|
||||
->make();
|
||||
}
|
||||
|
||||
|
||||
public function view($invoiceKey)
|
||||
{
|
||||
$invoice = Invoice::with('invoice_items', 'client.account.account_gateways')->where('invoice_key', '=', $invoiceKey)->firstOrFail();
|
||||
return View::make('invoices.view')->with('invoice', $invoice);
|
||||
}
|
||||
|
||||
private function createGateway($config)
|
||||
{
|
||||
/*
|
||||
$gateway = Omnipay::create($config->gateway->provider);
|
||||
$gateway->setUsername($config->username);
|
||||
$gateway->setPassword($config->password);
|
||||
$gateway->setSignature($config->signature);
|
||||
*/
|
||||
|
||||
$gateway = Omnipay::create('PayPal_Express');
|
||||
$gateway->setUsername('hillelcoren_api1.gmail.com');
|
||||
$gateway->setPassword('1385044249');
|
||||
$gateway->setSignature('AFcWxV21C7fd0v3bYYYRCpSSRl31AWJs8aLiB19haXzcAicPwo6qC7Hm');
|
||||
|
||||
$gateway->setTestMode(true);
|
||||
$gateway->setSolutionType ("Sole");
|
||||
$gateway->setLandingPage("Billing");
|
||||
//$gateway->headerImageUrl = "";
|
||||
|
||||
return $gateway;
|
||||
}
|
||||
|
||||
private function getPaymentDetails($invoice)
|
||||
{
|
||||
$data = array(
|
||||
'firstName' => 'Bobby',
|
||||
'lastName' => 'Tables',
|
||||
);
|
||||
|
||||
$card = new CreditCard($data);
|
||||
|
||||
return [
|
||||
'amount' => $invoice->getTotal(),
|
||||
'card' => $card,
|
||||
'currency' => 'USD',
|
||||
'returnUrl' => URL::to('complete'),
|
||||
'cancelUrl' => URL::to('/'),
|
||||
];
|
||||
}
|
||||
|
||||
public function show_payment($invoiceKey)
|
||||
{
|
||||
$invoice = Invoice::with('invoice_items', 'client.account.account_gateways.gateway')->where('invoice_key', '=', $invoiceKey)->firstOrFail();
|
||||
//$config = $invoice->client->account->account_gateways[0];
|
||||
|
||||
$gateway = InvoiceController::createGateway(false);
|
||||
|
||||
try
|
||||
{
|
||||
$details = InvoiceController::getPaymentDetails($invoice);
|
||||
$response = $gateway->purchase($details)->send();
|
||||
|
||||
$payment = new Payment;
|
||||
$payment->invoice_id = $invoice->id;
|
||||
$payment->account_id = $invoice->account_id;
|
||||
$payment->transaction_reference = $response->getTransactionReference();
|
||||
$payment->save();
|
||||
|
||||
if ($response->isSuccessful())
|
||||
{
|
||||
|
||||
}
|
||||
else if ($response->isRedirect())
|
||||
{
|
||||
$response->redirect();
|
||||
}
|
||||
else
|
||||
{
|
||||
exit($response->getMessage());
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
exit('Sorry, there was an error processing your payment. Please try again later.<p>'.$e);
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
public function do_payment()
|
||||
{
|
||||
$payerId = Request::query('PayerID');
|
||||
$token = Request::query('token');
|
||||
|
||||
$payment = Payment::with('invoice.invoice_items')->where('transaction_reference','=',$token)->firstOrFail();
|
||||
$gateway = InvoiceController::createGateway(false);
|
||||
|
||||
try
|
||||
{
|
||||
$details = InvoiceController::getPaymentDetails($payment->invoice);
|
||||
$response = $gateway->completePurchase($details)->send();
|
||||
$ref = $response->getTransactionReference();
|
||||
|
||||
if ($response->isSuccessful())
|
||||
{
|
||||
$payment->payer_id = $payerId;
|
||||
$payment->transaction_reference = $ref;
|
||||
$payment->amount = $payment->invoice->getTotal();
|
||||
$payment->save();
|
||||
|
||||
Session::flash('message', 'Successfully applied payment');
|
||||
return Redirect::to('view/' . $payment->invoice->invoice_key);
|
||||
}
|
||||
else
|
||||
{
|
||||
exit($response->getMessage());
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
exit('Sorry, there was an error processing your payment. Please try again later.' . $e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function create($clientId = 0)
|
||||
{
|
||||
$client = null;
|
||||
if ($clientId) {
|
||||
$client = Client::find($clientId);
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'invoice' => null,
|
||||
'method' => 'POST',
|
||||
'url' => 'invoices',
|
||||
'title' => 'New',
|
||||
'client' => $client,
|
||||
'account' => Auth::user()->account,
|
||||
'clients' => Client::where('account_id','=',Auth::user()->account_id)->get());
|
||||
return View::make('invoices.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store()
|
||||
{
|
||||
return InvoiceController::save();
|
||||
}
|
||||
|
||||
private function save($id = null)
|
||||
{
|
||||
$rules = array(
|
||||
'number' => 'required',
|
||||
'client' => 'required',
|
||||
);
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Redirect::to('invoices/create')
|
||||
->withErrors($validator);
|
||||
} else {
|
||||
|
||||
$clientId = Input::get('client');
|
||||
|
||||
if ($clientId == "-1")
|
||||
{
|
||||
$client = new Client;
|
||||
$client->name = Input::get('client_name');
|
||||
$client->account_id = Auth::user()->account_id;
|
||||
$client->save();
|
||||
$clientId = $client->id;
|
||||
|
||||
$contact = new Contact;
|
||||
$contact->email = Input::get('client_email');
|
||||
$client->contacts()->save($contact);
|
||||
}
|
||||
else
|
||||
{
|
||||
$client = Client::with('contacts')->find($clientId);
|
||||
$contact = $client->contacts[0];
|
||||
}
|
||||
|
||||
if ($id) {
|
||||
$invoice = Invoice::find($id);
|
||||
$invoice->invoice_items()->forceDelete();
|
||||
} else {
|
||||
$invoice = new Invoice;
|
||||
$invoice->invoice_key = str_random(20);
|
||||
$invoice->account_id = Auth::user()->account_id;
|
||||
}
|
||||
|
||||
$date = DateTime::createFromFormat('m/d/Y', Input::get('issued_on'));
|
||||
|
||||
$invoice->client_id = $clientId;
|
||||
$invoice->number = Input::get('number');
|
||||
$invoice->discount = Input::get('discount');
|
||||
$invoice->issued_on = $date->format('Y-m-d');
|
||||
$invoice->save();
|
||||
|
||||
$items = json_decode(Input::get('items'));
|
||||
foreach ($items as $item) {
|
||||
|
||||
if (!isset($item->cost) || !isset($item->qty)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$product = new Product;
|
||||
$product->product_key = $item->product_key;
|
||||
$product->notes = $item->notes;
|
||||
$product->cost = $item->cost;
|
||||
$product->save();
|
||||
|
||||
$invoiceItem = new InvoiceItem;
|
||||
$invoiceItem->product_id = $product->id;
|
||||
$invoiceItem->product_key = $item->product_key;
|
||||
$invoiceItem->notes = $item->notes;
|
||||
$invoiceItem->cost = $item->cost;
|
||||
$invoiceItem->qty = $item->qty;
|
||||
|
||||
$invoice->invoice_items()->save($invoiceItem);
|
||||
}
|
||||
|
||||
if (Input::get('send_email_checkBox'))
|
||||
{
|
||||
$data = array('link' => URL::to('view') . '/' . $invoice->invoice_key);
|
||||
Mail::send(array('html'=>'emails.invoice_html','text'=>'emails.invoice_text'), $data, function($message) use ($contact)
|
||||
{
|
||||
$message->from('hillelcoren@gmail.com', 'Hillel Coren');
|
||||
$message->to($contact->email);
|
||||
});
|
||||
|
||||
Session::flash('message', 'Successfully emailed invoice');
|
||||
} else {
|
||||
Session::flash('message', 'Successfully saved invoice');
|
||||
}
|
||||
|
||||
return Redirect::to('invoices/' . $invoice->id . '/edit');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$invoice = Invoice::find($id);
|
||||
return View::make('invoices.show')->with('invoice', $invoice);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$invoice = Invoice::with('client', 'invoice_items')->find($id);
|
||||
|
||||
$data = array(
|
||||
'invoice' => $invoice,
|
||||
'method' => 'PUT',
|
||||
'url' => 'invoices/' . $id,
|
||||
'title' => 'Edit',
|
||||
'account' => Auth::user()->account,
|
||||
'client' => $invoice->client,
|
||||
'clients' => Client::where('account_id','=',Auth::user()->account_id)->get());
|
||||
return View::make('invoices.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function update($id)
|
||||
{
|
||||
return InvoiceController::save($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$invoice = Invoice::find($id);
|
||||
$invoice->delete();
|
||||
|
||||
// redirect
|
||||
Session::flash('message', 'Successfully deleted the invoice');
|
||||
return Redirect::to('invoices');
|
||||
}
|
||||
}
|
33
app/controllers/PaymentController.php
Executable file
33
app/controllers/PaymentController.php
Executable file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
class PaymentController extends \BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return View::make('payments.index');
|
||||
}
|
||||
|
||||
public function getDatatable()
|
||||
{
|
||||
return Datatable::collection(Payment::with('invoice.client')->where('account_id', '=', Auth::user()->account_id)->get())
|
||||
->addColumn('client', function($model)
|
||||
{
|
||||
return link_to('clients/' . $model->invoice->client->id, $model->invoice->client->name);
|
||||
})
|
||||
->addColumn('invoice', function($model)
|
||||
{
|
||||
return link_to('invoices/' . $model->invoice->id . '/edit', $model->invoice->number);
|
||||
})
|
||||
->addColumn('amount', function($model)
|
||||
{
|
||||
return '$' . $model->amount;
|
||||
})
|
||||
->addColumn('date', function($model)
|
||||
{
|
||||
return $model->created_at->format('m/d/y h:i a');
|
||||
})
|
||||
->orderColumns('client')
|
||||
->make();
|
||||
}
|
||||
|
||||
}
|
227
app/controllers/UserController.php
Executable file
227
app/controllers/UserController.php
Executable file
@ -0,0 +1,227 @@
|
||||
<?php
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Confide Controller Template
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the default Confide controller template for controlling user
|
||||
| authentication. Feel free to change to your needs.
|
||||
|
|
||||
*/
|
||||
|
||||
class UserController extends BaseController {
|
||||
|
||||
/**
|
||||
* Displays the form for account creation
|
||||
*
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return View::make(Config::get('confide::signup_form'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores new account
|
||||
*
|
||||
*/
|
||||
public function store()
|
||||
{
|
||||
$user = new User;
|
||||
|
||||
$user->username = Input::get( 'username' );
|
||||
$user->email = Input::get( 'email' );
|
||||
$user->password = Input::get( 'password' );
|
||||
|
||||
// The password confirmation will be removed from model
|
||||
// before saving. This field will be used in Ardent's
|
||||
// auto validation.
|
||||
$user->password_confirmation = Input::get( 'password_confirmation' );
|
||||
|
||||
// Save if valid. Password field will be hashed before save
|
||||
$user->save();
|
||||
|
||||
if ( $user->id )
|
||||
{
|
||||
// Redirect with success message, You may replace "Lang::get(..." for your custom message.
|
||||
return Redirect::action('UserController@login')
|
||||
->with( 'notice', Lang::get('confide::confide.alerts.account_created') );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get validation errors (see Ardent package)
|
||||
$error = $user->errors()->all(':message');
|
||||
|
||||
return Redirect::action('UserController@create')
|
||||
->withInput(Input::except('password'))
|
||||
->with( 'error', $error );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the login form
|
||||
*
|
||||
*/
|
||||
public function login()
|
||||
{
|
||||
if( Confide::user() )
|
||||
{
|
||||
// If user is logged, redirect to internal
|
||||
// page, change it to '/admin', '/dashboard' or something
|
||||
return Redirect::to('/');
|
||||
}
|
||||
else
|
||||
{
|
||||
return View::make(Config::get('confide::login_form'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to do login
|
||||
*
|
||||
*/
|
||||
public function do_login()
|
||||
{
|
||||
$input = array(
|
||||
'email' => Input::get( 'email' ), // May be the username too
|
||||
'username' => Input::get( 'email' ), // so we have to pass both
|
||||
'password' => Input::get( 'password' ),
|
||||
'remember' => Input::get( 'remember' ),
|
||||
);
|
||||
|
||||
// If you wish to only allow login from confirmed users, call logAttempt
|
||||
// with the second parameter as true.
|
||||
// logAttempt will check if the 'email' perhaps is the username.
|
||||
// Get the value from the config file instead of changing the controller
|
||||
if ( Confide::logAttempt( $input, Config::get('confide::signup_confirm') ) )
|
||||
{
|
||||
// Redirect the user to the URL they were trying to access before
|
||||
// caught by the authentication filter IE Redirect::guest('user/login').
|
||||
// Otherwise fallback to '/'
|
||||
// Fix pull #145
|
||||
return Redirect::intended('/'); // change it to '/admin', '/dashboard' or something
|
||||
}
|
||||
else
|
||||
{
|
||||
$user = new User;
|
||||
|
||||
// Check if there was too many login attempts
|
||||
if( Confide::isThrottled( $input ) )
|
||||
{
|
||||
$err_msg = Lang::get('confide::confide.alerts.too_many_attempts');
|
||||
}
|
||||
elseif( $user->checkUserExists( $input ) and ! $user->isConfirmed( $input ) )
|
||||
{
|
||||
$err_msg = Lang::get('confide::confide.alerts.not_confirmed');
|
||||
}
|
||||
else
|
||||
{
|
||||
$err_msg = Lang::get('confide::confide.alerts.wrong_credentials');
|
||||
}
|
||||
|
||||
return Redirect::action('UserController@login')
|
||||
->withInput(Input::except('password'))
|
||||
->with( 'error', $err_msg );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to confirm account with code
|
||||
*
|
||||
* @param string $code
|
||||
*/
|
||||
public function confirm( $code )
|
||||
{
|
||||
if ( Confide::confirm( $code ) )
|
||||
{
|
||||
$notice_msg = Lang::get('confide::confide.alerts.confirmation');
|
||||
return Redirect::action('UserController@login')
|
||||
->with( 'notice', $notice_msg );
|
||||
}
|
||||
else
|
||||
{
|
||||
$error_msg = Lang::get('confide::confide.alerts.wrong_confirmation');
|
||||
return Redirect::action('UserController@login')
|
||||
->with( 'error', $error_msg );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the forgot password form
|
||||
*
|
||||
*/
|
||||
public function forgot_password()
|
||||
{
|
||||
return View::make(Config::get('confide::forgot_password_form'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to send change password link to the given email
|
||||
*
|
||||
*/
|
||||
public function do_forgot_password()
|
||||
{
|
||||
if( Confide::forgotPassword( Input::get( 'email' ) ) )
|
||||
{
|
||||
$notice_msg = Lang::get('confide::confide.alerts.password_forgot');
|
||||
return Redirect::action('UserController@login')
|
||||
->with( 'notice', $notice_msg );
|
||||
}
|
||||
else
|
||||
{
|
||||
$error_msg = Lang::get('confide::confide.alerts.wrong_password_forgot');
|
||||
return Redirect::action('UserController@forgot_password')
|
||||
->withInput()
|
||||
->with( 'error', $error_msg );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the change password form with the given token
|
||||
*
|
||||
*/
|
||||
public function reset_password( $token )
|
||||
{
|
||||
return View::make(Config::get('confide::reset_password_form'))
|
||||
->with('token', $token);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt change password of the user
|
||||
*
|
||||
*/
|
||||
public function do_reset_password()
|
||||
{
|
||||
$input = array(
|
||||
'token'=>Input::get( 'token' ),
|
||||
'password'=>Input::get( 'password' ),
|
||||
'password_confirmation'=>Input::get( 'password_confirmation' ),
|
||||
);
|
||||
|
||||
// By passing an array with the token, password and confirmation
|
||||
if( Confide::resetPassword( $input ) )
|
||||
{
|
||||
$notice_msg = Lang::get('confide::confide.alerts.password_reset');
|
||||
return Redirect::action('UserController@login')
|
||||
->with( 'notice', $notice_msg );
|
||||
}
|
||||
else
|
||||
{
|
||||
$error_msg = Lang::get('confide::confide.alerts.wrong_password_reset');
|
||||
return Redirect::action('UserController@reset_password', array('token'=>$input['token']))
|
||||
->withInput()
|
||||
->with( 'error', $error_msg );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Log the user out of the application.
|
||||
*
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
Confide::logout();
|
||||
|
||||
return Redirect::to('/');
|
||||
}
|
||||
|
||||
}
|
0
app/database/migrations/.gitkeep
Executable file
0
app/database/migrations/.gitkeep
Executable file
218
app/database/migrations/2013_11_05_180133_confide_setup_users_table.php
Executable file
218
app/database/migrations/2013_11_05_180133_confide_setup_users_table.php
Executable file
@ -0,0 +1,218 @@
|
||||
<?php
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class ConfideSetupUsersTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::dropIfExists('account_gateways');
|
||||
Schema::dropIfExists('gateways');
|
||||
Schema::dropIfExists('products');
|
||||
Schema::dropIfExists('invoice_items');
|
||||
Schema::dropIfExists('contacts');
|
||||
Schema::dropIfExists('payments');
|
||||
Schema::dropIfExists('invoices');
|
||||
Schema::dropIfExists('accounts');
|
||||
Schema::dropIfExists('users');
|
||||
Schema::dropIfExists('password_reminders');
|
||||
Schema::dropIfExists('clients');
|
||||
|
||||
Schema::create('accounts', function($t)
|
||||
{
|
||||
$t->increments('id');
|
||||
$t->timestamps();
|
||||
$t->softDeletes();
|
||||
|
||||
$t->string('name');
|
||||
$t->string('ip');
|
||||
$t->string('logo_path');
|
||||
$t->string('key')->unique();
|
||||
|
||||
$t->string('address1');
|
||||
$t->string('address2');
|
||||
$t->string('city');
|
||||
$t->string('state');
|
||||
$t->string('postal_code');
|
||||
$t->integer('country_id');
|
||||
});
|
||||
|
||||
|
||||
Schema::create('gateways', function($t)
|
||||
{
|
||||
$t->increments('id');
|
||||
$t->timestamps();
|
||||
$t->softDeletes();
|
||||
|
||||
$t->string('name');
|
||||
$t->string('provider');
|
||||
});
|
||||
|
||||
Schema::create('account_gateways', function($t)
|
||||
{
|
||||
$t->increments('id');
|
||||
$t->integer('account_id');
|
||||
$t->integer('gateway_id');
|
||||
$t->timestamps();
|
||||
$t->softDeletes();
|
||||
|
||||
$t->string('username');
|
||||
$t->string('password');
|
||||
$t->string('signature');
|
||||
});
|
||||
|
||||
Schema::create('users', function($t)
|
||||
{
|
||||
$t->increments('id');
|
||||
$t->integer('account_id');
|
||||
$t->timestamps();
|
||||
$t->softDeletes();
|
||||
|
||||
$t->string('first_name');
|
||||
$t->string('last_name');
|
||||
$t->string('phone');
|
||||
$t->string('username');
|
||||
$t->string('email');
|
||||
$t->string('password');
|
||||
$t->string('confirmation_code');
|
||||
$t->boolean('is_guest')->default(true);
|
||||
$t->boolean('confirmed')->default(false);
|
||||
|
||||
//$t->foreign('account_id')->references('id')->on('accounts');
|
||||
});
|
||||
|
||||
Schema::create('password_reminders', function($t)
|
||||
{
|
||||
$t->string('email');
|
||||
$t->timestamps();
|
||||
|
||||
$t->string('token');
|
||||
});
|
||||
|
||||
Schema::create('clients', function($t)
|
||||
{
|
||||
$t->increments('id');
|
||||
$t->integer('account_id');
|
||||
$t->timestamps();
|
||||
$t->softDeletes();
|
||||
|
||||
$t->string('name');
|
||||
$t->string('address1');
|
||||
$t->string('address2');
|
||||
$t->string('city');
|
||||
$t->string('state');
|
||||
$t->string('postal_code');
|
||||
$t->integer('country_id');
|
||||
$t->string('work_phone');
|
||||
$t->text('notes');
|
||||
|
||||
//$t->foreign('account_id')->references('id')->on('accounts');
|
||||
});
|
||||
|
||||
Schema::create('contacts', function($t)
|
||||
{
|
||||
$t->increments('id');
|
||||
$t->integer('client_id');
|
||||
$t->timestamps();
|
||||
$t->softDeletes();
|
||||
|
||||
$t->string('first_name');
|
||||
$t->string('last_name');
|
||||
$t->string('email');
|
||||
$t->string('phone');
|
||||
$t->timestamp('last_login');
|
||||
|
||||
//$t->foreign('account_id')->references('id')->on('accounts');
|
||||
});
|
||||
|
||||
|
||||
Schema::create('invoices', function($t)
|
||||
{
|
||||
$t->increments('id');
|
||||
$t->integer('client_id');
|
||||
$t->integer('account_id');
|
||||
$t->timestamps();
|
||||
$t->softDeletes();
|
||||
|
||||
$t->string('invoice_key')->unique();
|
||||
$t->string('number');
|
||||
$t->float('discount');
|
||||
$t->date('issued_on');
|
||||
|
||||
//$t->foreign('account_id')->references('id')->on('accounts');
|
||||
});
|
||||
|
||||
Schema::create('invoice_items', function($t)
|
||||
{
|
||||
$t->increments('id');
|
||||
$t->integer('invoice_id');
|
||||
$t->timestamps();
|
||||
$t->softDeletes();
|
||||
|
||||
$t->integer('product_id');
|
||||
$t->string('product_key');
|
||||
$t->string('notes');
|
||||
$t->decimal('cost', 8, 2);
|
||||
$t->integer('qty');
|
||||
|
||||
//$t->foreign('account_id')->references('id')->on('accounts');
|
||||
});
|
||||
|
||||
Schema::create('products', function($t)
|
||||
{
|
||||
$t->increments('id');
|
||||
$t->integer('account_id');
|
||||
$t->timestamps();
|
||||
$t->softDeletes();
|
||||
|
||||
$t->string('product_key');
|
||||
$t->string('notes');
|
||||
$t->decimal('cost', 8, 2);
|
||||
|
||||
//$t->foreign('account_id')->references('id')->on('accounts');
|
||||
});
|
||||
|
||||
|
||||
|
||||
Schema::create('payments', function($t)
|
||||
{
|
||||
$t->increments('id');
|
||||
$t->integer('invoice_id');
|
||||
$t->integer('account_id');
|
||||
$t->timestamps();
|
||||
$t->softDeletes();
|
||||
|
||||
$t->decimal('amount', 8, 2);
|
||||
$t->string('transaction_reference');
|
||||
$t->string('payer_id');
|
||||
|
||||
//$t->foreign('account_id')->references('id')->on('accounts');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('account_gateways');
|
||||
Schema::dropIfExists('gateways');
|
||||
Schema::dropIfExists('products');
|
||||
Schema::dropIfExists('invoice_items');
|
||||
Schema::dropIfExists('contacts');
|
||||
Schema::dropIfExists('payments');
|
||||
Schema::dropIfExists('invoices');
|
||||
Schema::dropIfExists('clients');
|
||||
Schema::dropIfExists('password_reminders');
|
||||
Schema::dropIfExists('users');
|
||||
Schema::dropIfExists('accounts');
|
||||
}
|
||||
|
||||
}
|
BIN
app/database/production.sqlite
Executable file
BIN
app/database/production.sqlite
Executable file
Binary file not shown.
0
app/database/seeds/.gitkeep
Executable file
0
app/database/seeds/.gitkeep
Executable file
15
app/database/seeds/ConstantsSeeder.php
Executable file
15
app/database/seeds/ConstantsSeeder.php
Executable file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
class ConstantsSeeder extends Seeder
|
||||
{
|
||||
|
||||
public function run()
|
||||
{
|
||||
DB::table('gateways')->delete();
|
||||
|
||||
Gateway::create(array(
|
||||
'name' => 'PayPal Express',
|
||||
'provider' => 'PayPal_Express'
|
||||
));
|
||||
}
|
||||
}
|
18
app/database/seeds/DatabaseSeeder.php
Executable file
18
app/database/seeds/DatabaseSeeder.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
class DatabaseSeeder extends Seeder {
|
||||
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Eloquent::unguard();
|
||||
|
||||
$this->call('UserTableSeeder');
|
||||
$this->call('ConstantsSeeder');
|
||||
}
|
||||
|
||||
}
|
19
app/database/seeds/UserTableSeeder.php
Executable file
19
app/database/seeds/UserTableSeeder.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
class UserTableSeeder extends Seeder
|
||||
{
|
||||
|
||||
public function run()
|
||||
{
|
||||
DB::table('users')->delete();
|
||||
/*
|
||||
User::create(array(
|
||||
'first_name' => 'Hillel',
|
||||
'last_name' => 'Coren',
|
||||
'email' => 'hillelcoren@gmail.com',
|
||||
'password' => Hash::make('1234'),
|
||||
));
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
80
app/filters.php
Executable file
80
app/filters.php
Executable file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application & Route Filters
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Below you will find the "before" and "after" events for the application
|
||||
| which may be used to do any work before or after a request into your
|
||||
| application. Here you may also register your custom route filters.
|
||||
|
|
||||
*/
|
||||
|
||||
App::before(function($request)
|
||||
{
|
||||
//
|
||||
});
|
||||
|
||||
|
||||
App::after(function($request, $response)
|
||||
{
|
||||
//
|
||||
});
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Filters
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following filters are used to verify that the user of the current
|
||||
| session is logged into this application. The "basic" filter easily
|
||||
| integrates HTTP Basic authentication for quick, simple checking.
|
||||
|
|
||||
*/
|
||||
|
||||
Route::filter('auth', function()
|
||||
{
|
||||
if (Auth::guest()) return Redirect::guest('login');
|
||||
});
|
||||
|
||||
|
||||
Route::filter('auth.basic', function()
|
||||
{
|
||||
return Auth::basic();
|
||||
});
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Guest Filter
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The "guest" filter is the counterpart of the authentication filters as
|
||||
| it simply checks that the current user is not logged in. A redirect
|
||||
| response will be issued if they are, which you may freely change.
|
||||
|
|
||||
*/
|
||||
|
||||
Route::filter('guest', function()
|
||||
{
|
||||
if (Auth::check()) return Redirect::to('/');
|
||||
});
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| CSRF Protection Filter
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The CSRF filter is responsible for protecting your application against
|
||||
| cross-site request forgery attacks. If this special token in a user
|
||||
| session does not match the one given in this request, we'll bail.
|
||||
|
|
||||
*/
|
||||
|
||||
Route::filter('csrf', function()
|
||||
{
|
||||
if (Session::token() != Input::get('_token'))
|
||||
{
|
||||
throw new Illuminate\Session\TokenMismatchException;
|
||||
}
|
||||
});
|
695
app/includes/parsecsv.lib.php
Executable file
695
app/includes/parsecsv.lib.php
Executable file
@ -0,0 +1,695 @@
|
||||
<?php
|
||||
|
||||
class parseCSV {
|
||||
|
||||
/*
|
||||
|
||||
Class: parseCSV v0.3.2
|
||||
http://code.google.com/p/parsecsv-for-php/
|
||||
|
||||
|
||||
Fully conforms to the specifications lined out on wikipedia:
|
||||
- http://en.wikipedia.org/wiki/Comma-separated_values
|
||||
|
||||
Based on the concept of Ming Hong Ng's CsvFileParser class:
|
||||
- http://minghong.blogspot.com/2006/07/csv-parser-for-php.html
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2007 Jim Myhrberg (jim@zydev.info).
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
|
||||
Code Examples
|
||||
----------------
|
||||
# general usage
|
||||
$csv = new parseCSV('data.csv');
|
||||
print_r($csv->data);
|
||||
----------------
|
||||
# tab delimited, and encoding conversion
|
||||
$csv = new parseCSV();
|
||||
$csv->encoding('UTF-16', 'UTF-8');
|
||||
$csv->delimiter = "\t";
|
||||
$csv->parse('data.tsv');
|
||||
print_r($csv->data);
|
||||
----------------
|
||||
# auto-detect delimiter character
|
||||
$csv = new parseCSV();
|
||||
$csv->auto('data.csv');
|
||||
print_r($csv->data);
|
||||
----------------
|
||||
# modify data in a csv file
|
||||
$csv = new parseCSV();
|
||||
$csv->sort_by = 'id';
|
||||
$csv->parse('data.csv');
|
||||
# "4" is the value of the "id" column of the CSV row
|
||||
$csv->data[4] = array('firstname' => 'John', 'lastname' => 'Doe', 'email' => 'john@doe.com');
|
||||
$csv->save();
|
||||
----------------
|
||||
# add row/entry to end of CSV file
|
||||
# - only recommended when you know the extact sctructure of the file
|
||||
$csv = new parseCSV();
|
||||
$csv->save('data.csv', array('1986', 'Home', 'Nowhere', ''), true);
|
||||
----------------
|
||||
# convert 2D array to csv data and send headers
|
||||
# to browser to treat output as a file and download it
|
||||
$csv = new parseCSV();
|
||||
$csv->output (true, 'movies.csv', $array);
|
||||
----------------
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Configuration
|
||||
* - set these options with $object->var_name = 'value';
|
||||
*/
|
||||
|
||||
# use first line/entry as field names
|
||||
var $heading = true;
|
||||
|
||||
# override field names
|
||||
var $fields = array();
|
||||
|
||||
# sort entries by this field
|
||||
var $sort_by = null;
|
||||
var $sort_reverse = false;
|
||||
|
||||
# delimiter (comma) and enclosure (double quote)
|
||||
var $delimiter = ',';
|
||||
var $enclosure = '"';
|
||||
|
||||
# basic SQL-like conditions for row matching
|
||||
var $conditions = null;
|
||||
|
||||
# number of rows to ignore from beginning of data
|
||||
var $offset = null;
|
||||
|
||||
# limits the number of returned rows to specified amount
|
||||
var $limit = null;
|
||||
|
||||
# number of rows to analyze when attempting to auto-detect delimiter
|
||||
var $auto_depth = 15;
|
||||
|
||||
# characters to ignore when attempting to auto-detect delimiter
|
||||
var $auto_non_chars = "a-zA-Z0-9\n\r";
|
||||
|
||||
# preferred delimiter characters, only used when all filtering method
|
||||
# returns multiple possible delimiters (happens very rarely)
|
||||
var $auto_preferred = ",;\t.:|";
|
||||
|
||||
# character encoding options
|
||||
var $convert_encoding = false;
|
||||
var $input_encoding = 'ISO-8859-1';
|
||||
var $output_encoding = 'ISO-8859-1';
|
||||
|
||||
# used by unparse(), save(), and output() functions
|
||||
var $linefeed = "\r\n";
|
||||
|
||||
# only used by output() function
|
||||
var $output_delimiter = ',';
|
||||
var $output_filename = 'data.csv';
|
||||
|
||||
|
||||
/**
|
||||
* Internal variables
|
||||
*/
|
||||
|
||||
# current file
|
||||
var $file;
|
||||
|
||||
# loaded file contents
|
||||
var $file_data;
|
||||
|
||||
# array of field values in data parsed
|
||||
var $titles = array();
|
||||
|
||||
# two dimentional array of CSV data
|
||||
var $data = array();
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param input CSV file or string
|
||||
* @return nothing
|
||||
*/
|
||||
function parseCSV ($input = null, $offset = null, $limit = null, $conditions = null) {
|
||||
if ( $offset !== null ) $this->offset = $offset;
|
||||
if ( $limit !== null ) $this->limit = $limit;
|
||||
if ( count($conditions) > 0 ) $this->conditions = $conditions;
|
||||
if ( !empty($input) ) $this->parse($input);
|
||||
}
|
||||
|
||||
|
||||
// ==============================================
|
||||
// ----- [ Main Functions ] ---------------------
|
||||
// ==============================================
|
||||
|
||||
/**
|
||||
* Parse CSV file or string
|
||||
* @param input CSV file or string
|
||||
* @return nothing
|
||||
*/
|
||||
function parse ($input = null, $offset = null, $limit = null, $conditions = null) {
|
||||
if ( !empty($input) ) {
|
||||
if ( $offset !== null ) $this->offset = $offset;
|
||||
if ( $limit !== null ) $this->limit = $limit;
|
||||
if ( count($conditions) > 0 ) $this->conditions = $conditions;
|
||||
if ( is_readable($input) ) {
|
||||
$this->data = $this->parse_file($input);
|
||||
} else {
|
||||
$this->file_data = &$input;
|
||||
$this->data = $this->parse_string();
|
||||
}
|
||||
if ( $this->data === false ) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save changes, or new file and/or data
|
||||
* @param file file to save to
|
||||
* @param data 2D array with data
|
||||
* @param append append current data to end of target CSV if exists
|
||||
* @param fields field names
|
||||
* @return true or false
|
||||
*/
|
||||
function save ($file = null, $data = array(), $append = false, $fields = array()) {
|
||||
if ( empty($file) ) $file = &$this->file;
|
||||
$mode = ( $append ) ? 'at' : 'wt' ;
|
||||
$is_php = ( preg_match('/\.php$/i', $file) ) ? true : false ;
|
||||
return $this->_wfile($file, $this->unparse($data, $fields, $append, $is_php), $mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate CSV based string for output
|
||||
* @param output if true, prints headers and strings to browser
|
||||
* @param filename filename sent to browser in headers if output is true
|
||||
* @param data 2D array with data
|
||||
* @param fields field names
|
||||
* @param delimiter delimiter used to separate data
|
||||
* @return CSV data using delimiter of choice, or default
|
||||
*/
|
||||
function output ($output = true, $filename = null, $data = array(), $fields = array(), $delimiter = null) {
|
||||
if ( empty($filename) ) $filename = $this->output_filename;
|
||||
if ( $delimiter === null ) $delimiter = $this->output_delimiter;
|
||||
$data = $this->unparse($data, $fields, null, null, $delimiter);
|
||||
if ( $output ) {
|
||||
header('Content-type: application/csv');
|
||||
header('Content-Disposition: inline; filename="'.$filename.'"');
|
||||
echo $data;
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert character encoding
|
||||
* @param input input character encoding, uses default if left blank
|
||||
* @param output output character encoding, uses default if left blank
|
||||
* @return nothing
|
||||
*/
|
||||
function encoding ($input = null, $output = null) {
|
||||
$this->convert_encoding = true;
|
||||
if ( $input !== null ) $this->input_encoding = $input;
|
||||
if ( $output !== null ) $this->output_encoding = $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Auto-Detect Delimiter: Find delimiter by analyzing a specific number of
|
||||
* rows to determine most probable delimiter character
|
||||
* @param file local CSV file
|
||||
* @param parse true/false parse file directly
|
||||
* @param search_depth number of rows to analyze
|
||||
* @param preferred preferred delimiter characters
|
||||
* @param enclosure enclosure character, default is double quote (").
|
||||
* @return delimiter character
|
||||
*/
|
||||
function auto ($file = null, $parse = true, $search_depth = null, $preferred = null, $enclosure = null) {
|
||||
|
||||
if ( $file === null ) $file = $this->file;
|
||||
if ( empty($search_depth) ) $search_depth = $this->auto_depth;
|
||||
if ( $enclosure === null ) $enclosure = $this->enclosure;
|
||||
|
||||
if ( $preferred === null ) $preferred = $this->auto_preferred;
|
||||
|
||||
if ( empty($this->file_data) ) {
|
||||
if ( $this->_check_data($file) ) {
|
||||
$data = &$this->file_data;
|
||||
} else return false;
|
||||
} else {
|
||||
$data = &$this->file_data;
|
||||
}
|
||||
|
||||
$chars = array();
|
||||
$strlen = strlen($data);
|
||||
$enclosed = false;
|
||||
$n = 1;
|
||||
$to_end = true;
|
||||
|
||||
// walk specific depth finding posssible delimiter characters
|
||||
for ( $i=0; $i < $strlen; $i++ ) {
|
||||
$ch = $data{$i};
|
||||
$nch = ( isset($data{$i+1}) ) ? $data{$i+1} : false ;
|
||||
$pch = ( isset($data{$i-1}) ) ? $data{$i-1} : false ;
|
||||
|
||||
// open and closing quotes
|
||||
if ( $ch == $enclosure && (!$enclosed || $nch != $enclosure) ) {
|
||||
$enclosed = ( $enclosed ) ? false : true ;
|
||||
|
||||
// inline quotes
|
||||
} elseif ( $ch == $enclosure && $enclosed ) {
|
||||
$i++;
|
||||
|
||||
// end of row
|
||||
} elseif ( ($ch == "\n" && $pch != "\r" || $ch == "\r") && !$enclosed ) {
|
||||
if ( $n >= $search_depth ) {
|
||||
$strlen = 0;
|
||||
$to_end = false;
|
||||
} else {
|
||||
$n++;
|
||||
}
|
||||
|
||||
// count character
|
||||
} elseif (!$enclosed) {
|
||||
if ( !preg_match('/['.preg_quote($this->auto_non_chars, '/').']/i', $ch) ) {
|
||||
if ( !isset($chars[$ch][$n]) ) {
|
||||
$chars[$ch][$n] = 1;
|
||||
} else {
|
||||
$chars[$ch][$n]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// filtering
|
||||
$depth = ( $to_end ) ? $n-1 : $n ;
|
||||
$filtered = array();
|
||||
foreach( $chars as $char => $value ) {
|
||||
if ( $match = $this->_check_count($char, $value, $depth, $preferred) ) {
|
||||
$filtered[$match] = $char;
|
||||
}
|
||||
}
|
||||
|
||||
// capture most probable delimiter
|
||||
ksort($filtered);
|
||||
$delimiter = reset($filtered);
|
||||
$this->delimiter = $delimiter;
|
||||
|
||||
// parse data
|
||||
if ( $parse ) $this->data = $this->parse_string();
|
||||
|
||||
return $delimiter;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ==============================================
|
||||
// ----- [ Core Functions ] ---------------------
|
||||
// ==============================================
|
||||
|
||||
/**
|
||||
* Read file to string and call parse_string()
|
||||
* @param file local CSV file
|
||||
* @return 2D array with CSV data, or false on failure
|
||||
*/
|
||||
function parse_file ($file = null) {
|
||||
if ( $file === null ) $file = $this->file;
|
||||
if ( empty($this->file_data) ) $this->load_data($file);
|
||||
return ( !empty($this->file_data) ) ? $this->parse_string() : false ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse CSV strings to arrays
|
||||
* @param data CSV string
|
||||
* @return 2D array with CSV data, or false on failure
|
||||
*/
|
||||
function parse_string ($data = null) {
|
||||
if ( empty($data) ) {
|
||||
if ( $this->_check_data() ) {
|
||||
$data = &$this->file_data;
|
||||
} else return false;
|
||||
}
|
||||
|
||||
$rows = array();
|
||||
$row = array();
|
||||
$row_count = 0;
|
||||
$current = '';
|
||||
$head = ( !empty($this->fields) ) ? $this->fields : array() ;
|
||||
$col = 0;
|
||||
$enclosed = false;
|
||||
$was_enclosed = false;
|
||||
$strlen = strlen($data);
|
||||
|
||||
// walk through each character
|
||||
for ( $i=0; $i < $strlen; $i++ ) {
|
||||
$ch = $data{$i};
|
||||
$nch = ( isset($data{$i+1}) ) ? $data{$i+1} : false ;
|
||||
$pch = ( isset($data{$i-1}) ) ? $data{$i-1} : false ;
|
||||
|
||||
// open and closing quotes
|
||||
if ( $ch == $this->enclosure && (!$enclosed || $nch != $this->enclosure) ) {
|
||||
$enclosed = ( $enclosed ) ? false : true ;
|
||||
if ( $enclosed ) $was_enclosed = true;
|
||||
|
||||
// inline quotes
|
||||
} elseif ( $ch == $this->enclosure && $enclosed ) {
|
||||
$current .= $ch;
|
||||
$i++;
|
||||
|
||||
// end of field/row
|
||||
} elseif ( ($ch == $this->delimiter || ($ch == "\n" && $pch != "\r") || $ch == "\r") && !$enclosed ) {
|
||||
if ( !$was_enclosed ) $current = trim($current);
|
||||
$key = ( !empty($head[$col]) ) ? $head[$col] : $col ;
|
||||
$row[$key] = $current;
|
||||
$current = '';
|
||||
$col++;
|
||||
|
||||
// end of row
|
||||
if ( $ch == "\n" || $ch == "\r" ) {
|
||||
if ( $this->_validate_offset($row_count) && $this->_validate_row_conditions($row, $this->conditions) ) {
|
||||
if ( $this->heading && empty($head) ) {
|
||||
$head = $row;
|
||||
} elseif ( empty($this->fields) || (!empty($this->fields) && (($this->heading && $row_count > 0) || !$this->heading)) ) {
|
||||
if ( !empty($this->sort_by) && !empty($row[$this->sort_by]) ) {
|
||||
if ( isset($rows[$row[$this->sort_by]]) ) {
|
||||
$rows[$row[$this->sort_by].'_0'] = &$rows[$row[$this->sort_by]];
|
||||
unset($rows[$row[$this->sort_by]]);
|
||||
for ( $sn=1; isset($rows[$row[$this->sort_by].'_'.$sn]); $sn++ ) {}
|
||||
$rows[$row[$this->sort_by].'_'.$sn] = $row;
|
||||
} else $rows[$row[$this->sort_by]] = $row;
|
||||
} else $rows[] = $row;
|
||||
}
|
||||
}
|
||||
$row = array();
|
||||
$col = 0;
|
||||
$row_count++;
|
||||
if ( $this->sort_by === null && $this->limit !== null && count($rows) == $this->limit ) {
|
||||
$i = $strlen;
|
||||
}
|
||||
}
|
||||
|
||||
// append character to current field
|
||||
} else {
|
||||
$current .= $ch;
|
||||
}
|
||||
}
|
||||
$this->titles = $head;
|
||||
if ( !empty($this->sort_by) ) {
|
||||
( $this->sort_reverse ) ? krsort($rows) : ksort($rows) ;
|
||||
if ( $this->offset !== null || $this->limit !== null ) {
|
||||
$rows = array_slice($rows, ($this->offset === null ? 0 : $this->offset) , $this->limit, true);
|
||||
}
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create CSV data from array
|
||||
* @param data 2D array with data
|
||||
* @param fields field names
|
||||
* @param append if true, field names will not be output
|
||||
* @param is_php if a php die() call should be put on the first
|
||||
* line of the file, this is later ignored when read.
|
||||
* @param delimiter field delimiter to use
|
||||
* @return CSV data (text string)
|
||||
*/
|
||||
function unparse ( $data = array(), $fields = array(), $append = false , $is_php = false, $delimiter = null) {
|
||||
if ( !is_array($data) || empty($data) ) $data = &$this->data;
|
||||
if ( !is_array($fields) || empty($fields) ) $fields = &$this->titles;
|
||||
if ( $delimiter === null ) $delimiter = $this->delimiter;
|
||||
|
||||
$string = ( $is_php ) ? "<?php header('Status: 403'); die(' '); ?>".$this->linefeed : '' ;
|
||||
$entry = array();
|
||||
|
||||
// create heading
|
||||
if ( $this->heading && !$append ) {
|
||||
foreach( $fields as $key => $value ) {
|
||||
$entry[] = $this->_enclose_value($value);
|
||||
}
|
||||
$string .= implode($delimiter, $entry).$this->linefeed;
|
||||
$entry = array();
|
||||
}
|
||||
|
||||
// create data
|
||||
foreach( $data as $key => $row ) {
|
||||
foreach( $row as $field => $value ) {
|
||||
$entry[] = $this->_enclose_value($value);
|
||||
}
|
||||
$string .= implode($delimiter, $entry).$this->linefeed;
|
||||
$entry = array();
|
||||
}
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load local file or string
|
||||
* @param input local CSV file
|
||||
* @return true or false
|
||||
*/
|
||||
function load_data ($input = null) {
|
||||
$data = null;
|
||||
$file = null;
|
||||
if ( $input === null ) {
|
||||
$file = $this->file;
|
||||
} elseif ( file_exists($input) ) {
|
||||
$file = $input;
|
||||
} else {
|
||||
$data = $input;
|
||||
}
|
||||
if ( !empty($data) || $data = $this->_rfile($file) ) {
|
||||
if ( $this->file != $file ) $this->file = $file;
|
||||
if ( preg_match('/\.php$/i', $file) && preg_match('/<\?.*?\?>(.*)/ims', $data, $strip) ) {
|
||||
$data = ltrim($strip[1]);
|
||||
}
|
||||
if ( $this->convert_encoding ) $data = iconv($this->input_encoding, $this->output_encoding, $data);
|
||||
if ( substr($data, -1) != "\n" ) $data .= "\n";
|
||||
$this->file_data = &$data;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// ==============================================
|
||||
// ----- [ Internal Functions ] -----------------
|
||||
// ==============================================
|
||||
|
||||
/**
|
||||
* Validate a row against specified conditions
|
||||
* @param row array with values from a row
|
||||
* @param conditions specified conditions that the row must match
|
||||
* @return true of false
|
||||
*/
|
||||
function _validate_row_conditions ($row = array(), $conditions = null) {
|
||||
if ( !empty($row) ) {
|
||||
if ( !empty($conditions) ) {
|
||||
$conditions = (strpos($conditions, ' OR ') !== false) ? explode(' OR ', $conditions) : array($conditions) ;
|
||||
$or = '';
|
||||
foreach( $conditions as $key => $value ) {
|
||||
if ( strpos($value, ' AND ') !== false ) {
|
||||
$value = explode(' AND ', $value);
|
||||
$and = '';
|
||||
foreach( $value as $k => $v ) {
|
||||
$and .= $this->_validate_row_condition($row, $v);
|
||||
}
|
||||
$or .= (strpos($and, '0') !== false) ? '0' : '1' ;
|
||||
} else {
|
||||
$or .= $this->_validate_row_condition($row, $value);
|
||||
}
|
||||
}
|
||||
return (strpos($or, '1') !== false) ? true : false ;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a row against a single condition
|
||||
* @param row array with values from a row
|
||||
* @param condition specified condition that the row must match
|
||||
* @return true of false
|
||||
*/
|
||||
function _validate_row_condition ($row, $condition) {
|
||||
$operators = array(
|
||||
'=', 'equals', 'is',
|
||||
'!=', 'is not',
|
||||
'<', 'is less than',
|
||||
'>', 'is greater than',
|
||||
'<=', 'is less than or equals',
|
||||
'>=', 'is greater than or equals',
|
||||
'contains',
|
||||
'does not contain',
|
||||
);
|
||||
$operators_regex = array();
|
||||
foreach( $operators as $value ) {
|
||||
$operators_regex[] = preg_quote($value, '/');
|
||||
}
|
||||
$operators_regex = implode('|', $operators_regex);
|
||||
if ( preg_match('/^(.+) ('.$operators_regex.') (.+)$/i', trim($condition), $capture) ) {
|
||||
$field = $capture[1];
|
||||
$op = $capture[2];
|
||||
$value = $capture[3];
|
||||
if ( preg_match('/^([\'\"]{1})(.*)([\'\"]{1})$/i', $value, $capture) ) {
|
||||
if ( $capture[1] == $capture[3] ) {
|
||||
$value = $capture[2];
|
||||
$value = str_replace("\\n", "\n", $value);
|
||||
$value = str_replace("\\r", "\r", $value);
|
||||
$value = str_replace("\\t", "\t", $value);
|
||||
$value = stripslashes($value);
|
||||
}
|
||||
}
|
||||
if ( array_key_exists($field, $row) ) {
|
||||
if ( ($op == '=' || $op == 'equals' || $op == 'is') && $row[$field] == $value ) {
|
||||
return '1';
|
||||
} elseif ( ($op == '!=' || $op == 'is not') && $row[$field] != $value ) {
|
||||
return '1';
|
||||
} elseif ( ($op == '<' || $op == 'is less than' ) && $row[$field] < $value ) {
|
||||
return '1';
|
||||
} elseif ( ($op == '>' || $op == 'is greater than') && $row[$field] > $value ) {
|
||||
return '1';
|
||||
} elseif ( ($op == '<=' || $op == 'is less than or equals' ) && $row[$field] <= $value ) {
|
||||
return '1';
|
||||
} elseif ( ($op == '>=' || $op == 'is greater than or equals') && $row[$field] >= $value ) {
|
||||
return '1';
|
||||
} elseif ( $op == 'contains' && preg_match('/'.preg_quote($value, '/').'/i', $row[$field]) ) {
|
||||
return '1';
|
||||
} elseif ( $op == 'does not contain' && !preg_match('/'.preg_quote($value, '/').'/i', $row[$field]) ) {
|
||||
return '1';
|
||||
} else {
|
||||
return '0';
|
||||
}
|
||||
}
|
||||
}
|
||||
return '1';
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates if the row is within the offset or not if sorting is disabled
|
||||
* @param current_row the current row number being processed
|
||||
* @return true of false
|
||||
*/
|
||||
function _validate_offset ($current_row) {
|
||||
if ( $this->sort_by === null && $this->offset !== null && $current_row < $this->offset ) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enclose values if needed
|
||||
* - only used by unparse()
|
||||
* @param value string to process
|
||||
* @return Processed value
|
||||
*/
|
||||
function _enclose_value ($value = null) {
|
||||
if ( $value !== null && $value != '' ) {
|
||||
$delimiter = preg_quote($this->delimiter, '/');
|
||||
$enclosure = preg_quote($this->enclosure, '/');
|
||||
if ( preg_match("/".$delimiter."|".$enclosure."|\n|\r/i", $value) || ($value{0} == ' ' || substr($value, -1) == ' ') ) {
|
||||
$value = str_replace($this->enclosure, $this->enclosure.$this->enclosure, $value);
|
||||
$value = $this->enclosure.$value.$this->enclosure;
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check file data
|
||||
* @param file local filename
|
||||
* @return true or false
|
||||
*/
|
||||
function _check_data ($file = null) {
|
||||
if ( empty($this->file_data) ) {
|
||||
if ( $file === null ) $file = $this->file;
|
||||
return $this->load_data($file);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if passed info might be delimiter
|
||||
* - only used by find_delimiter()
|
||||
* @return special string used for delimiter selection, or false
|
||||
*/
|
||||
function _check_count ($char, $array, $depth, $preferred) {
|
||||
if ( $depth == count($array) ) {
|
||||
$first = null;
|
||||
$equal = null;
|
||||
$almost = false;
|
||||
foreach( $array as $key => $value ) {
|
||||
if ( $first == null ) {
|
||||
$first = $value;
|
||||
} elseif ( $value == $first && $equal !== false) {
|
||||
$equal = true;
|
||||
} elseif ( $value == $first+1 && $equal !== false ) {
|
||||
$equal = true;
|
||||
$almost = true;
|
||||
} else {
|
||||
$equal = false;
|
||||
}
|
||||
}
|
||||
if ( $equal ) {
|
||||
$match = ( $almost ) ? 2 : 1 ;
|
||||
$pref = strpos($preferred, $char);
|
||||
$pref = ( $pref !== false ) ? str_pad($pref, 3, '0', STR_PAD_LEFT) : '999' ;
|
||||
return $pref.$match.'.'.(99999 - str_pad($first, 5, '0', STR_PAD_LEFT));
|
||||
} else return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Read local file
|
||||
* @param file local filename
|
||||
* @return Data from file, or false on failure
|
||||
*/
|
||||
function _rfile ($file = null) {
|
||||
if ( is_readable($file) ) {
|
||||
if ( !($fh = fopen($file, 'r')) ) return false;
|
||||
$data = fread($fh, filesize($file));
|
||||
fclose($fh);
|
||||
return $data;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write to local file
|
||||
* @param file local filename
|
||||
* @param string data to write to file
|
||||
* @param mode fopen() mode
|
||||
* @param lock flock() mode
|
||||
* @return true or false
|
||||
*/
|
||||
function _wfile ($file, $string = '', $mode = 'wb', $lock = 2) {
|
||||
if ( $fp = fopen($file, $mode) ) {
|
||||
flock($fp, $lock);
|
||||
$re = fwrite($fp, $string);
|
||||
$re2 = fclose($fp);
|
||||
if ( $re != false && $re2 != false ) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
20
app/lang/en/pagination.php
Executable file
20
app/lang/en/pagination.php
Executable file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Pagination Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines are used by the paginator library to build
|
||||
| the simple pagination links. You are free to change them to anything
|
||||
| you want to customize your views to better match your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'previous' => '« Previous',
|
||||
|
||||
'next' => 'Next »',
|
||||
|
||||
);
|
22
app/lang/en/reminders.php
Executable file
22
app/lang/en/reminders.php
Executable file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reminder Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines are the default lines which match reasons
|
||||
| that are given by the password broker for a password update attempt
|
||||
| has failed, such as for an invalid token or invalid new password.
|
||||
|
|
||||
*/
|
||||
|
||||
"password" => "Passwords must be six characters and match the confirmation.",
|
||||
|
||||
"user" => "We can't find a user with that e-mail address.",
|
||||
|
||||
"token" => "This password reset token is invalid.",
|
||||
|
||||
);
|
98
app/lang/en/validation.php
Executable file
98
app/lang/en/validation.php
Executable file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Validation Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines contain the default error messages used by
|
||||
| the validator class. Some of these rules have multiple versions such
|
||||
| such as the size rules. Feel free to tweak each of these messages.
|
||||
|
|
||||
*/
|
||||
|
||||
"accepted" => "The :attribute must be accepted.",
|
||||
"active_url" => "The :attribute is not a valid URL.",
|
||||
"after" => "The :attribute must be a date after :date.",
|
||||
"alpha" => "The :attribute may only contain letters.",
|
||||
"alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.",
|
||||
"alpha_num" => "The :attribute may only contain letters and numbers.",
|
||||
"array" => "The :attribute must be an array.",
|
||||
"before" => "The :attribute must be a date before :date.",
|
||||
"between" => array(
|
||||
"numeric" => "The :attribute must be between :min - :max.",
|
||||
"file" => "The :attribute must be between :min - :max kilobytes.",
|
||||
"string" => "The :attribute must be between :min - :max characters.",
|
||||
"array" => "The :attribute must have between :min - :max items.",
|
||||
),
|
||||
"confirmed" => "The :attribute confirmation does not match.",
|
||||
"date" => "The :attribute is not a valid date.",
|
||||
"date_format" => "The :attribute does not match the format :format.",
|
||||
"different" => "The :attribute and :other must be different.",
|
||||
"digits" => "The :attribute must be :digits digits.",
|
||||
"digits_between" => "The :attribute must be between :min and :max digits.",
|
||||
"email" => "The :attribute format is invalid.",
|
||||
"exists" => "The selected :attribute is invalid.",
|
||||
"image" => "The :attribute must be an image.",
|
||||
"in" => "The selected :attribute is invalid.",
|
||||
"integer" => "The :attribute must be an integer.",
|
||||
"ip" => "The :attribute must be a valid IP address.",
|
||||
"max" => array(
|
||||
"numeric" => "The :attribute may not be greater than :max.",
|
||||
"file" => "The :attribute may not be greater than :max kilobytes.",
|
||||
"string" => "The :attribute may not be greater than :max characters.",
|
||||
"array" => "The :attribute may not have more than :max items.",
|
||||
),
|
||||
"mimes" => "The :attribute must be a file of type: :values.",
|
||||
"min" => array(
|
||||
"numeric" => "The :attribute must be at least :min.",
|
||||
"file" => "The :attribute must be at least :min kilobytes.",
|
||||
"string" => "The :attribute must be at least :min characters.",
|
||||
"array" => "The :attribute must have at least :min items.",
|
||||
),
|
||||
"not_in" => "The selected :attribute is invalid.",
|
||||
"numeric" => "The :attribute must be a number.",
|
||||
"regex" => "The :attribute format is invalid.",
|
||||
"required" => "The :attribute field is required.",
|
||||
"required_if" => "The :attribute field is required when :other is :value.",
|
||||
"required_with" => "The :attribute field is required when :values is present.",
|
||||
"required_without" => "The :attribute field is required when :values is not present.",
|
||||
"same" => "The :attribute and :other must match.",
|
||||
"size" => array(
|
||||
"numeric" => "The :attribute must be :size.",
|
||||
"file" => "The :attribute must be :size kilobytes.",
|
||||
"string" => "The :attribute must be :size characters.",
|
||||
"array" => "The :attribute must contain :size items.",
|
||||
),
|
||||
"unique" => "The :attribute has already been taken.",
|
||||
"url" => "The :attribute format is invalid.",
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Custom Validation Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify custom validation messages for attributes using the
|
||||
| convention "attribute.rule" to name the lines. This makes it quick to
|
||||
| specify a specific custom language line for a given attribute rule.
|
||||
|
|
||||
*/
|
||||
|
||||
'custom' => array(),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Custom Validation Attributes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines are used to swap attribute place-holders
|
||||
| with something more reader friendly such as E-Mail Address instead
|
||||
| of "email". This simply helps us make messages a little cleaner.
|
||||
|
|
||||
*/
|
||||
|
||||
'attributes' => array(),
|
||||
|
||||
);
|
63
app/models/Account.php
Executable file
63
app/models/Account.php
Executable file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
class Account extends Eloquent
|
||||
{
|
||||
protected $softDelete = true;
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany('User');
|
||||
}
|
||||
|
||||
public function clients()
|
||||
{
|
||||
return $this->hasMany('Client');
|
||||
}
|
||||
|
||||
public function account_gateways()
|
||||
{
|
||||
return $this->hasMany('AccountGateway');
|
||||
}
|
||||
|
||||
public function isGatewayConfigured($gatewayId = 0)
|
||||
{
|
||||
if ($gatewayId)
|
||||
{
|
||||
return $this->getGatewayConfig($gatewayId) != false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return count($this->account_gateways) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
public function getGatewayConfig($gatewayId)
|
||||
{
|
||||
foreach ($this->account_gateways as $gateway)
|
||||
{
|
||||
if ($gateway->gateway_id == $gatewayId)
|
||||
{
|
||||
return $gateway;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getLogoPath()
|
||||
{
|
||||
return 'logo/' . $this->key . '.jpg';
|
||||
}
|
||||
|
||||
public function getLogoWidth()
|
||||
{
|
||||
list($width, $height) = getimagesize($this->getLogoPath());
|
||||
return $width;
|
||||
}
|
||||
|
||||
public function getLogoHeight()
|
||||
{
|
||||
list($width, $height) = getimagesize($this->getLogoPath());
|
||||
return $height;
|
||||
}
|
||||
}
|
9
app/models/AccountGateway.php
Executable file
9
app/models/AccountGateway.php
Executable file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
class AccountGateway extends Eloquent
|
||||
{
|
||||
public function gateway()
|
||||
{
|
||||
return $this->belongsTo('Gateway');
|
||||
}
|
||||
}
|
30
app/models/Client.php
Executable file
30
app/models/Client.php
Executable file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
class Client extends Eloquent
|
||||
{
|
||||
protected $softDelete = true;
|
||||
|
||||
public static $fieldName = 'Client - Name';
|
||||
public static $fieldPhone = 'Client - Phone';
|
||||
public static $fieldAddress1 = 'Client - Street';
|
||||
public static $fieldAddress2 = 'Client - Apt/Floor';
|
||||
public static $fieldCity = 'Client - City';
|
||||
public static $fieldState = 'Client - State';
|
||||
public static $fieldPostalCode = 'Client - Postal Code';
|
||||
public static $fieldNotes = 'Client - Notes';
|
||||
|
||||
public function account()
|
||||
{
|
||||
return $this->belongsTo('Account');
|
||||
}
|
||||
|
||||
public function invoices()
|
||||
{
|
||||
return $this->hasMany('Invoice');
|
||||
}
|
||||
|
||||
public function contacts()
|
||||
{
|
||||
return $this->hasMany('Contact');
|
||||
}
|
||||
}
|
33
app/models/Contact.php
Executable file
33
app/models/Contact.php
Executable file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
class Contact extends Eloquent
|
||||
{
|
||||
protected $softDelete = true;
|
||||
|
||||
public static $fieldFirstName = 'Contact - First Name';
|
||||
public static $fieldLastName = 'Contact - Last Name';
|
||||
public static $fieldEmail = 'Contact - Email';
|
||||
public static $fieldPhone = 'Contact - Phone';
|
||||
|
||||
public function client()
|
||||
{
|
||||
return $this->belongsTo('Client');
|
||||
}
|
||||
|
||||
public function fullName()
|
||||
{
|
||||
return $this->first_name . ' ' . $this->last_name;
|
||||
}
|
||||
|
||||
public function lastLogin()
|
||||
{
|
||||
if ($this->last_login == '0000-00-00 00:00:00')
|
||||
{
|
||||
return '---';
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->last_login;
|
||||
}
|
||||
}
|
||||
}
|
6
app/models/Gateway.php
Executable file
6
app/models/Gateway.php
Executable file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
class Gateway extends Eloquent
|
||||
{
|
||||
protected $softDelete = true;
|
||||
}
|
28
app/models/Invoice.php
Executable file
28
app/models/Invoice.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
class Invoice extends Eloquent
|
||||
{
|
||||
protected $softDelete = true;
|
||||
|
||||
public function client()
|
||||
{
|
||||
return $this->belongsTo('Client');
|
||||
}
|
||||
|
||||
public function invoice_items()
|
||||
{
|
||||
return $this->hasMany('InvoiceItem');
|
||||
}
|
||||
|
||||
public function getTotal()
|
||||
{
|
||||
$total = 0;
|
||||
|
||||
foreach ($this->invoice_items as $invoiceItem)
|
||||
{
|
||||
$total += $invoiceItem->qty * $invoiceItem->cost;
|
||||
}
|
||||
|
||||
return $total;
|
||||
}
|
||||
}
|
16
app/models/InvoiceItem.php
Executable file
16
app/models/InvoiceItem.php
Executable file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
class InvoiceItem extends Eloquent
|
||||
{
|
||||
protected $softDelete = true;
|
||||
|
||||
public function invoice()
|
||||
{
|
||||
return $this->belongsTo('Invoice');
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return $this->belongsTo('Product');
|
||||
}
|
||||
}
|
11
app/models/Payment.php
Executable file
11
app/models/Payment.php
Executable file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
class Payment extends Eloquent
|
||||
{
|
||||
protected $softDelete = true;
|
||||
|
||||
public function invoice()
|
||||
{
|
||||
return $this->belongsTo('Invoice');
|
||||
}
|
||||
}
|
6
app/models/Product.php
Executable file
6
app/models/Product.php
Executable file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
class Product extends Eloquent
|
||||
{
|
||||
protected $softDelete = true;
|
||||
}
|
71
app/models/User.php
Executable file
71
app/models/User.php
Executable file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Auth\UserInterface;
|
||||
use Illuminate\Auth\Reminders\RemindableInterface;
|
||||
use Zizaco\Confide\ConfideUser;
|
||||
|
||||
class User extends ConfideUser implements UserInterface, RemindableInterface {
|
||||
|
||||
protected $softDelete = true;
|
||||
|
||||
public static $rules = array(
|
||||
/*
|
||||
'username' => 'required|email|unique:users',
|
||||
'email' => 'required|email|unique:users',
|
||||
'password' => 'required|between:4,20|confirmed',
|
||||
'password_confirmation' => 'between:4,20',
|
||||
*/
|
||||
);
|
||||
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'users';
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = array('password');
|
||||
|
||||
|
||||
public function account()
|
||||
{
|
||||
return $this->belongsTo('Account');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the unique identifier for the user.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getAuthIdentifier()
|
||||
{
|
||||
return $this->getKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the password for the user.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAuthPassword()
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the e-mail address where password reminders are sent.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReminderEmail()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
}
|
104
app/routes.php
Executable file
104
app/routes.php
Executable file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register all of the routes for an application.
|
||||
| It's a breeze. Simply tell Laravel the URIs it should respond to
|
||||
| and give it the Closure to execute when that URI is requested.
|
||||
|
|
||||
*/
|
||||
|
||||
Route::get('/', 'HomeController@showWelcome');
|
||||
Route::post('get_started', 'AccountController@getStarted');
|
||||
|
||||
Route::get('view/{invoice_key}', 'InvoiceController@view');
|
||||
Route::get('payment/{invoice_key}', 'InvoiceController@show_payment');
|
||||
Route::get('complete', 'InvoiceController@do_payment');
|
||||
|
||||
|
||||
Route::filter('auth', function()
|
||||
{
|
||||
if (!Auth::check())
|
||||
{
|
||||
return Redirect::to('/');
|
||||
}
|
||||
});
|
||||
|
||||
Route::group(array('before' => 'auth'), function()
|
||||
{
|
||||
Route::get('account/{section?}', 'AccountController@showSection');
|
||||
Route::post('account/{section?}', 'AccountController@doSection');
|
||||
|
||||
Route::resource('clients', 'ClientController');
|
||||
Route::get('api/clients', array('as'=>'api.clients', 'uses'=>'ClientController@getDatatable'));
|
||||
|
||||
Route::resource('invoices', 'InvoiceController');
|
||||
Route::get('api/invoices', array('as'=>'api.invoices', 'uses'=>'InvoiceController@getDatatable'));
|
||||
Route::get('invoices/create/{client_id}', 'InvoiceController@create');
|
||||
|
||||
Route::get('payments', 'PaymentController@index');
|
||||
Route::get('api/payments', array('as'=>'api.payments', 'uses'=>'PaymentController@getDatatable'));
|
||||
|
||||
Route::get('home', function() { return View::make('header'); });
|
||||
Route::get('reports', function() { return View::make('header'); });
|
||||
Route::get('payments/create', function() { return View::make('header'); });
|
||||
});
|
||||
|
||||
// Confide routes
|
||||
//Route::get( 'user/create', 'UserController@create');
|
||||
//Route::post('user', 'UserController@store');
|
||||
Route::get('login', 'UserController@login');
|
||||
Route::post('login', 'UserController@do_login');
|
||||
//Route::get( 'user/confirm/{code}', 'UserController@confirm');
|
||||
//Route::get( 'user/forgot_password', 'UserController@forgot_password');
|
||||
//Route::post('user/forgot_password', 'UserController@do_forgot_password');
|
||||
//Route::get( 'user/reset_password/{token}', 'UserController@reset_password');
|
||||
//Route::post('user/reset_password', 'UserController@do_reset_password');
|
||||
Route::get('logout', 'UserController@logout');
|
||||
|
||||
|
||||
|
||||
|
||||
HTML::macro('nav_link', function($url, $text, $url2 = '') {
|
||||
$class = ( Request::is($url) || Request::is($url.'/*') || Request::is($url2) ) ? ' class="active"' : '';
|
||||
return '<li'.$class.'><a href="'.URL::to($url).'">'.$text.'</a></li>';
|
||||
});
|
||||
|
||||
HTML::macro('menu_link', function($type) {
|
||||
$types = $type.'s';
|
||||
$Type = ucfirst($type);
|
||||
$Types = ucfirst($types);
|
||||
$class = ( Request::is($types) || Request::is($types.'/*')) ? ' active' : '';
|
||||
return '<li class="dropdown '.$class.'">
|
||||
<a href="'.URL::to($types).'" class="dropdown-toggle">'.$Types.'</a>
|
||||
<ul class="dropdown-menu" id="menu1">
|
||||
<!-- <li><a href="'.URL::to($types).'">List '.$Types.'</a></li> -->
|
||||
<li><a href="'.URL::to($types.'/create').'">New '.$Type.'</a></li>
|
||||
</ul>
|
||||
</li>';
|
||||
});
|
||||
|
||||
HTML::macro('image_data', function($imagePath) {
|
||||
return 'data:image/jpeg;base64,' . base64_encode(file_get_contents($imagePath));
|
||||
});
|
||||
|
||||
|
||||
function pluralize($string, $count)
|
||||
{
|
||||
$string = str_replace('?', $count, $string);
|
||||
return $count == 1 ? $string : $string . 's';
|
||||
}
|
||||
|
||||
function toArray($data)
|
||||
{
|
||||
return json_decode(json_encode((array) $data), true);
|
||||
}
|
||||
|
||||
define("ACCOUNT_DETAILS", "details");
|
||||
define("ACCOUNT_SETTINGS", "settings");
|
||||
define("ACCOUNT_IMPORT", "import");
|
||||
define("ACCOUNT_MAP", "import_map");
|
||||
define("ACCOUNT_EXPORT", "export");
|
13
app/start/artisan.php
Executable file
13
app/start/artisan.php
Executable file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register The Artisan Commands
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Each available Artisan command must be registered with the console so
|
||||
| that it is available to be called. We'll register every command so
|
||||
| the console gets access to each of the command object instances.
|
||||
|
|
||||
*/
|
||||
|
83
app/start/global.php
Executable file
83
app/start/global.php
Executable file
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register The Laravel Class Loader
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| In addition to using Composer, you may use the Laravel class loader to
|
||||
| load your controllers and models. This is useful for keeping all of
|
||||
| your classes in the "global" namespace without Composer updating.
|
||||
|
|
||||
*/
|
||||
|
||||
ClassLoader::addDirectories(array(
|
||||
|
||||
app_path().'/commands',
|
||||
app_path().'/controllers',
|
||||
app_path().'/models',
|
||||
app_path().'/database/seeds',
|
||||
|
||||
));
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Error Logger
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here we will configure the error logger setup for the application which
|
||||
| is built on top of the wonderful Monolog library. By default we will
|
||||
| build a rotating log file setup which creates a new file each day.
|
||||
|
|
||||
*/
|
||||
|
||||
$logFile = 'log-'.php_sapi_name().'.txt';
|
||||
|
||||
Log::useDailyFiles(storage_path().'/logs/'.$logFile);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Error Handler
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may handle any errors that occur in your application, including
|
||||
| logging them or displaying custom views for specific errors. You may
|
||||
| even register several error handlers to handle different types of
|
||||
| exceptions. If nothing is returned, the default error view is
|
||||
| shown, which includes a detailed stack trace during debug.
|
||||
|
|
||||
*/
|
||||
|
||||
App::error(function(Exception $exception, $code)
|
||||
{
|
||||
Log::error($exception);
|
||||
});
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Maintenance Mode Handler
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The "down" Artisan command gives you the ability to put an application
|
||||
| into maintenance mode. Here, you will define what is displayed back
|
||||
| to the user if maintenace mode is in effect for this application.
|
||||
|
|
||||
*/
|
||||
|
||||
App::down(function()
|
||||
{
|
||||
return Response::make("Be right back!", 503);
|
||||
});
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Require The Filters File
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Next we will load the filters file for the application. This gives us
|
||||
| a nice separate location to store our route and application filter
|
||||
| definitions instead of putting them all in the main routes file.
|
||||
|
|
||||
*/
|
||||
|
||||
require app_path().'/filters.php';
|
3
app/start/local.php
Executable file
3
app/start/local.php
Executable file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
//
|
1
app/storage/.gitignore
vendored
Executable file
1
app/storage/.gitignore
vendored
Executable file
@ -0,0 +1 @@
|
||||
services.manifest
|
2
app/storage/cache/.gitignore
vendored
Executable file
2
app/storage/cache/.gitignore
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
2
app/storage/logs/.gitignore
vendored
Executable file
2
app/storage/logs/.gitignore
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
2
app/storage/meta/.gitignore
vendored
Executable file
2
app/storage/meta/.gitignore
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
2
app/storage/sessions/.gitignore
vendored
Executable file
2
app/storage/sessions/.gitignore
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
2
app/storage/views/.gitignore
vendored
Executable file
2
app/storage/views/.gitignore
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
17
app/tests/ExampleTest.php
Executable file
17
app/tests/ExampleTest.php
Executable file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
class ExampleTest extends TestCase {
|
||||
|
||||
/**
|
||||
* A basic functional test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBasicExample()
|
||||
{
|
||||
$crawler = $this->client->request('GET', '/');
|
||||
|
||||
$this->assertTrue($this->client->getResponse()->isOk());
|
||||
}
|
||||
|
||||
}
|
19
app/tests/TestCase.php
Executable file
19
app/tests/TestCase.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
class TestCase extends Illuminate\Foundation\Testing\TestCase {
|
||||
|
||||
/**
|
||||
* Creates the application.
|
||||
*
|
||||
* @return Symfony\Component\HttpKernel\HttpKernelInterface
|
||||
*/
|
||||
public function createApplication()
|
||||
{
|
||||
$unitTesting = true;
|
||||
|
||||
$testEnvironment = 'testing';
|
||||
|
||||
return require __DIR__.'/../../bootstrap/start.php';
|
||||
}
|
||||
|
||||
}
|
56
app/views/accounts/details.blade.php
Executable file
56
app/views/accounts/details.blade.php
Executable file
@ -0,0 +1,56 @@
|
||||
@extends('accounts.nav')
|
||||
|
||||
@section('content')
|
||||
@parent
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
#logo {
|
||||
padding-top: 6px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
{{ Former::open_for_files()->addClass('col-md-9 col-md-offset-1')->rules(array(
|
||||
'name' => 'required',
|
||||
'email' => 'email|required'
|
||||
)); }}
|
||||
|
||||
{{ Former::populate($account); }}
|
||||
{{ Former::populateField('first_name', $account->users()->first()->first_name) }}
|
||||
{{ Former::populateField('last_name', $account->users()->first()->last_name) }}
|
||||
@if (!$account->users()->first()->is_guest)
|
||||
{{ Former::populateField('email', $account->users()->first()->email) }}
|
||||
@endif
|
||||
{{ Former::populateField('phone', $account->users()->first()->phone) }}
|
||||
|
||||
{{ Former::legend('Account') }}
|
||||
{{ Former::text('name') }}
|
||||
|
||||
{{ Former::file('logo')->max(2, 'MB')->accept('image')->wrap('test') }}
|
||||
|
||||
@if (file_exists($account->getLogoPath()))
|
||||
<center>
|
||||
{{ HTML::image($account->getLogoPath(), "Logo") }}
|
||||
</center>
|
||||
@endif
|
||||
|
||||
{{ Former::legend('Users') }}
|
||||
{{ Former::text('first_name') }}
|
||||
{{ Former::text('last_name') }}
|
||||
{{ Former::text('email')->label('Email/Username') }}
|
||||
{{ Former::text('phone') }}
|
||||
|
||||
|
||||
{{ Former::legend('Address') }}
|
||||
{{ Former::text('address1')->label('Street') }}
|
||||
{{ Former::text('address2')->label('Apt/Floor') }}
|
||||
{{ Former::text('city') }}
|
||||
{{ Former::text('state') }}
|
||||
{{ Former::text('postal_code') }}
|
||||
|
||||
{{ Former::actions( Button::lg_primary_submit('Save') ) }}
|
||||
{{ Former::close() }}
|
||||
|
||||
|
||||
@stop
|
11
app/views/accounts/export.blade.php
Executable file
11
app/views/accounts/export.blade.php
Executable file
@ -0,0 +1,11 @@
|
||||
@extends('accounts.nav')
|
||||
|
||||
@section('content')
|
||||
@parent
|
||||
|
||||
{{ Former::open()->addClass('col-md-9 col-md-offset-1') }}
|
||||
{{ Former::legend('Export Data') }}
|
||||
{{ Button::lg_primary_submit('Download') }}
|
||||
{{ Former::close() }}
|
||||
|
||||
@stop
|
12
app/views/accounts/import.blade.php
Executable file
12
app/views/accounts/import.blade.php
Executable file
@ -0,0 +1,12 @@
|
||||
@extends('accounts.nav')
|
||||
|
||||
@section('content')
|
||||
@parent
|
||||
|
||||
{{ Former::open_for_files('account/import_map')->addClass('col-md-9 col-md-offset-1') }}
|
||||
{{ Former::legend('Import Clients') }}
|
||||
{{ Former::file('file')->label('Select CSV file') }}
|
||||
{{ Former::actions( Button::lg_primary_submit('Upload') ) }}
|
||||
{{ Former::close() }}
|
||||
|
||||
@stop
|
73
app/views/accounts/import_map.blade.php
Executable file
73
app/views/accounts/import_map.blade.php
Executable file
@ -0,0 +1,73 @@
|
||||
@extends('accounts.nav')
|
||||
|
||||
@section('content')
|
||||
@parent
|
||||
|
||||
{{ Former::open('account/import') }}
|
||||
{{ Former::legend('Import Clients') }}
|
||||
|
||||
@if ($headers)
|
||||
|
||||
<label for="header_checkbox">
|
||||
<input type="checkbox" name="header_checkbox" id="header_checkbox" {{ $hasHeaders ? 'CHECKED' : '' }}> Use first row as headers
|
||||
</label>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Column</th>
|
||||
<th class="col_sample">Sample</th>
|
||||
<th>Import To</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@for ($i=0; $i<count($headers); $i++)
|
||||
<tr>
|
||||
<td>{{ $headers[$i] }}</td>
|
||||
<td class="col_sample">{{ $data[1][$i] }}</td>
|
||||
<td>{{ Former::select('map[' . $i . ']')->options($columns, $mapped[$i], true)->raw() }}</td>
|
||||
</tr>
|
||||
@endfor
|
||||
</table>
|
||||
|
||||
<span id="numClients"></span>
|
||||
@endif
|
||||
|
||||
|
||||
{{ Former::actions( Button::lg_primary_submit('Import'), ' | ', link_to('account/import', 'Cancel') ) }}
|
||||
{{ Former::close() }}
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
|
||||
var numClients = {{ count($data) }};
|
||||
function setSampleShown() {
|
||||
if ($('#header_checkbox').is(':checked')) {
|
||||
$('.col_sample').show();
|
||||
setNumClients(numClients - 1);
|
||||
} else {
|
||||
$('.col_sample').hide();
|
||||
setNumClients(numClients);
|
||||
}
|
||||
}
|
||||
|
||||
function setNumClients(num)
|
||||
{
|
||||
if (num == 1)
|
||||
{
|
||||
$('#numClients').html('1 client will be created');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#numClients').html(num + ' clients will be created');
|
||||
}
|
||||
}
|
||||
|
||||
$('#header_checkbox').click(setSampleShown);
|
||||
setSampleShown();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@stop
|
13
app/views/accounts/nav.blade.php
Executable file
13
app/views/accounts/nav.blade.php
Executable file
@ -0,0 +1,13 @@
|
||||
@extends('header')
|
||||
|
||||
@section('content')
|
||||
|
||||
<ul class="nav nav-tabs nav nav-justified">
|
||||
{{ HTML::nav_link('account/details', 'Details') }}
|
||||
{{ HTML::nav_link('account/settings', 'Settings') }}
|
||||
{{ HTML::nav_link('account/import', 'Import', 'account/import_map') }}
|
||||
{{ HTML::nav_link('account/export', 'Export') }}
|
||||
</ul>
|
||||
<p> </p>
|
||||
|
||||
@stop
|
53
app/views/accounts/settings.blade.php
Executable file
53
app/views/accounts/settings.blade.php
Executable file
@ -0,0 +1,53 @@
|
||||
@extends('accounts.nav')
|
||||
|
||||
@section('content')
|
||||
@parent
|
||||
|
||||
{{ Former::open()->addClass('col-md-9 col-md-offset-1') }}
|
||||
{{ Former::legend('Payment Gateways') }}
|
||||
|
||||
@foreach ($gateways as $gateway)
|
||||
|
||||
{{ Former::checkbox('gateway_'.$gateway->id)->label('')->text($gateway->provider)
|
||||
->check($account->isGatewayConfigured($gateway->id)) }}
|
||||
|
||||
<div id="gateway_{{ $gateway->id }}_div" style="display: none">
|
||||
@foreach ($gateway->fields as $field => $details)
|
||||
@if ($config = $account->getGatewayConfig($gateway->id))
|
||||
{{ Former::populateField($gateway->id.'_'.$field, $config[$field]) }}
|
||||
@endif
|
||||
@if (in_array($field, array('username','password','signature')))
|
||||
{{ Former::text($gateway->id.'_'.$field)->label($field) }}
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@endforeach
|
||||
|
||||
{{ Former::actions( Button::lg_primary_submit('Save') ) }}
|
||||
{{ Former::close() }}
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
|
||||
function setFieldsShown(id) {
|
||||
if ($('#gateway_' + id).is(':checked')) {
|
||||
$('#gateway_' + id + '_div').show();
|
||||
} else {
|
||||
$('#gateway_' + id + '_div').hide();
|
||||
}
|
||||
}
|
||||
|
||||
@foreach ($gateways as $gateway)
|
||||
$('#gateway_{{ $gateway->id }}').click(function() {
|
||||
setFieldsShown('{{ $gateway->id }}');
|
||||
});
|
||||
setFieldsShown('{{ $gateway->id }}');
|
||||
@endforeach
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@stop
|
44
app/views/clients/edit.blade.php
Executable file
44
app/views/clients/edit.blade.php
Executable file
@ -0,0 +1,44 @@
|
||||
@extends('header')
|
||||
|
||||
|
||||
@section('onReady')
|
||||
$('input#name').focus();
|
||||
@stop
|
||||
|
||||
|
||||
@section('content')
|
||||
|
||||
<!--<h3>{{ $title }} Client</h3>-->
|
||||
|
||||
@if ($client)
|
||||
{{ Former::populate($client); }}
|
||||
@endif
|
||||
|
||||
{{ Former::open($url)->addClass('col-md-9 col-md-offset-1')->method($method)->rules(array(
|
||||
'name' => 'required',
|
||||
'email' => 'email'
|
||||
)); }}
|
||||
|
||||
|
||||
{{ Former::legend('Organization') }}
|
||||
{{ Former::text('name') }}
|
||||
{{ Former::text('work_phone')->label('Phone') }}
|
||||
{{ Former::textarea('notes') }}
|
||||
|
||||
{{ Former::legend('Contacts') }}
|
||||
{{ Former::text('first_name') }}
|
||||
{{ Former::text('last_name') }}
|
||||
{{ Former::text('email') }}
|
||||
{{ Former::text('phone') }}
|
||||
|
||||
{{ Former::legend('Address') }}
|
||||
{{ Former::text('address1')->label('Street') }}
|
||||
{{ Former::text('address2')->label('Apt/Floor') }}
|
||||
{{ Former::text('city') }}
|
||||
{{ Former::text('state') }}
|
||||
{{ Former::text('postal_code') }}
|
||||
|
||||
{{ Former::actions()->lg_primary_submit('Save') }}
|
||||
{{ Former::close() }}
|
||||
|
||||
@stop
|
14
app/views/clients/index.blade.php
Executable file
14
app/views/clients/index.blade.php
Executable file
@ -0,0 +1,14 @@
|
||||
@extends('header')
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Button::primary_link(URL::to('clients/create'), 'New Client', array('class' => 'pull-right')) }}
|
||||
|
||||
{{ Datatable::table()
|
||||
->addColumn('Client', 'Contact', 'Last Login', 'Email', 'Phone')
|
||||
->setUrl(route('api.clients'))
|
||||
->setOptions('sPaginationType', 'bootstrap')
|
||||
->setOptions('bFilter', false)
|
||||
->render() }}
|
||||
|
||||
@stop
|
14
app/views/clients/show.blade.php
Executable file
14
app/views/clients/show.blade.php
Executable file
@ -0,0 +1,14 @@
|
||||
@extends('header')
|
||||
|
||||
@section('content')
|
||||
|
||||
<h3>View Client</h3>
|
||||
|
||||
{{ $client->name }}
|
||||
|
||||
<div class="pull-right">
|
||||
{{ Button::link(URL::to('clients/' . $client->id . '/edit'), 'Edit Client') }}
|
||||
{{ Button::primary_link(URL::to('invoices/create/' . $client->id), 'Create Invoice') }}
|
||||
</div>
|
||||
|
||||
@stop
|
13
app/views/emails/auth/reminder.blade.php
Executable file
13
app/views/emails/auth/reminder.blade.php
Executable file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<h2>Password Reset</h2>
|
||||
|
||||
<div>
|
||||
To reset your password, complete this form: {{ URL::to('password/reset', array($token)) }}.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
12
app/views/emails/invoice_html.blade.php
Executable file
12
app/views/emails/invoice_html.blade.php
Executable file
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<h2>New Invoice</h2>
|
||||
|
||||
{{ $link }}
|
||||
|
||||
</body>
|
||||
</html>
|
3
app/views/emails/invoice_text.blade.php
Executable file
3
app/views/emails/invoice_text.blade.php
Executable file
@ -0,0 +1,3 @@
|
||||
New Invoice
|
||||
|
||||
{{ $link }}
|
305
app/views/header.blade.php
Executable file
305
app/views/header.blade.php
Executable file
@ -0,0 +1,305 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>Invoice Ninja</title>
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js" type="text/javascript"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
|
||||
|
||||
|
||||
<!--
|
||||
<script src="{{ asset('js/typeahead.js') }}" type="text/javascript"></script>
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('css/typeahead.js-bootstrap.css') }}"/>
|
||||
-->
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.css') }}"/>
|
||||
<!-- <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap-theme.min.css"> -->
|
||||
|
||||
|
||||
{{-- Basset::show('bootstrapper.css') --}}
|
||||
{{ Basset::show('bootstrapper.js') }}
|
||||
|
||||
|
||||
<script src="{{ asset('js/bootstrap-combobox.js') }}" type="text/javascript"></script>
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap-combobox.css') }}"/>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('css/jquery.dataTables.css') }}">
|
||||
<script type="text/javascript" src="{{ asset('js/jquery.dataTables.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('js/jquery.dataTables.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('js/knockout-3.0.0.js') }}"></script>
|
||||
<script src="{{ asset('js/knockout-sortable.js') }}" type="text/javascript"></script>
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('css/font-awesome.css') }}"/>
|
||||
|
||||
<script src="{{ asset('js/jspdf.source.js') }}" type="text/javascript"></script>
|
||||
<script src="{{ asset('js/jspdf.plugin.split_text_to_size.js') }}" type="text/javascript"></script>
|
||||
|
||||
<script src="{{ asset('js/bootstrap-datepicker.js') }}" type="text/javascript"></script>
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('css/datepicker.css') }}"/>
|
||||
|
||||
<script src="{{ asset('js/script.js') }}" type="text/javascript"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
@yield('onReady')
|
||||
});
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
|
||||
body > div.container {
|
||||
max-width: 850px;
|
||||
}
|
||||
|
||||
label.control-label {
|
||||
font-weight: normal !important;
|
||||
}
|
||||
|
||||
|
||||
.form-actions {
|
||||
margin: 0;
|
||||
background-color: transparent;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/*
|
||||
.form-horizontal {
|
||||
max-width: 750px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
.form-group {
|
||||
width: 50%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
*/
|
||||
|
||||
a.ul {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a.ul:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
/* DataTables and BootStrap */
|
||||
.dataTables_wrapper {
|
||||
padding-top: 16px;
|
||||
}
|
||||
|
||||
table.table thead > tr > th {
|
||||
border-bottom-width: 0px;
|
||||
}
|
||||
|
||||
#DataTables_Table_0_length label {
|
||||
font-weight: normal;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
div.dataTables_paginate.paging_bootstrap {
|
||||
margin-top: -30px;
|
||||
}
|
||||
|
||||
table.table tbody tr.odd {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
table.table tbody tr:hover {
|
||||
background-color: #f0f0f0 !important;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
table.table thead .sorting,
|
||||
table.table thead .sorting_asc,
|
||||
table.table thead .sorting_desc,
|
||||
table.table thead .sorting_asc_disabled,
|
||||
table.table thead .sorting_desc_disabled {
|
||||
cursor: pointer;
|
||||
*cursor: hand;
|
||||
}
|
||||
|
||||
table.table thead .sorting { background: url('images/sort_both.png') no-repeat center right; }
|
||||
table.table thead .sorting_asc { background: url('images/sort_asc.png') no-repeat center right; }
|
||||
table.table thead .sorting_desc { background: url('images/sort_desc.png') no-repeat center right; }
|
||||
|
||||
table.table thead .sorting_asc_disabled { background: url('images/sort_asc_disabled.png') no-repeat center right; }
|
||||
table.table thead .sorting_desc_disabled { background: url('images/sort_desc_disabled.png') no-repeat center right; }
|
||||
*/
|
||||
|
||||
|
||||
/* Hover nav */
|
||||
.sidebar-nav {
|
||||
padding: 9px 0;
|
||||
}
|
||||
|
||||
.dropdown-menu .sub-menu {
|
||||
left: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
visibility: hidden;
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.dropdown-menu li:hover .sub-menu {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.dropdown:hover .dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.nav-tabs .dropdown-menu, .nav-pills .dropdown-menu, .navbar .dropdown-menu {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.navbar .sub-menu:before {
|
||||
border-bottom: 7px solid transparent;
|
||||
border-left: none;
|
||||
border-right: 7px solid rgba(0, 0, 0, 0.2);
|
||||
border-top: 7px solid transparent;
|
||||
left: -7px;
|
||||
top: 10px;
|
||||
}
|
||||
.navbar .sub-menu:after {
|
||||
border-top: 6px solid transparent;
|
||||
border-left: none;
|
||||
border-right: 6px solid #fff;
|
||||
border-bottom: 6px solid transparent;
|
||||
left: 10px;
|
||||
top: 11px;
|
||||
left: -6px;
|
||||
}
|
||||
|
||||
|
||||
.invoice-table {
|
||||
border-style: none !important;
|
||||
}
|
||||
|
||||
table.invoice-table tbody tr:hover {
|
||||
background-color: #FFFFFF !important;
|
||||
}
|
||||
|
||||
.invoice-table td {
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
.invoice-table td input,
|
||||
.invoice-table td textarea {
|
||||
border: none !important;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.invoice-table th {
|
||||
border-top: 1px solid #ddd !important;
|
||||
}
|
||||
|
||||
.invoice-table td.hide-border,
|
||||
.invoice-table th.hide-border {
|
||||
border-style: none !important;
|
||||
}
|
||||
|
||||
.fa-bars {
|
||||
cursor: move !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-46031341-1', 'sketch-out.com');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</script>
|
||||
<div class="container">
|
||||
|
||||
<p/>
|
||||
<div>
|
||||
<span style="font-size:38px">LOGO</span>
|
||||
<div style="float:right;text-align:right">
|
||||
Logged in as Guest (<u>Sign up</u>) | {{ link_to('account/details', 'My Account') }}
|
||||
<p class="text-danger">This is a sample site, the data is erased</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p style="clear: both"/>
|
||||
<nav class="navbar navbar-default" role="navigation">
|
||||
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<!-- <a class="navbar-brand" href="#">Invoice Ninja</a> -->
|
||||
</div>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbar-collapse-1">
|
||||
<ul class="nav navbar-nav" style="font-weight: bold">
|
||||
{{ HTML::nav_link('home', 'Home') }}
|
||||
{{ HTML::menu_link('client') }}
|
||||
{{ HTML::menu_link('invoice') }}
|
||||
{{ HTML::menu_link('payment') }}
|
||||
{{ HTML::nav_link('reports', 'Reports') }}
|
||||
</ul>
|
||||
<form class="navbar-form navbar-right" role="search">
|
||||
<div class="form-group">
|
||||
<input type="text" id="search" class="form-control" placeholder="Search">
|
||||
</div>
|
||||
</form>
|
||||
</div><!-- /.navbar-collapse -->
|
||||
</nav>
|
||||
|
||||
@if (Session::has('message'))
|
||||
<div class="alert alert-info">{{ Session::get('message') }}</div>
|
||||
@endif
|
||||
|
||||
@yield('content')
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
|
||||
@if (Auth::user()->is_guest)
|
||||
if (isStorageSupported()) {
|
||||
localStorage.setItem('guest_key', '{{ Auth::user()->password }}');
|
||||
}
|
||||
@endif
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</html>
|
4
app/views/home/index.blade.php
Executable file
4
app/views/home/index.blade.php
Executable file
@ -0,0 +1,4 @@
|
||||
@extends('master')
|
||||
@section('content')
|
||||
<h2>Hello</h2>
|
||||
@stop
|
411
app/views/invoices/edit.blade.php
Executable file
411
app/views/invoices/edit.blade.php
Executable file
@ -0,0 +1,411 @@
|
||||
@extends('header')
|
||||
|
||||
@section('content')
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<div class=".container">
|
||||
<p> </p>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6 col-sm-10">
|
||||
<div>
|
||||
{{ Former::open($url)->method($method)->addClass('main_form')->rules(array(
|
||||
'number' => 'required',
|
||||
)); }}
|
||||
|
||||
|
||||
<!-- <h3>{{ $title }} Invoice</h3> -->
|
||||
|
||||
@if ($invoice)
|
||||
{{ Former::populate($invoice); }}
|
||||
{{ Former::populateField('issued_on', DateTime::createFromFormat('Y-m-d', $invoice->issued_on)->format('m/d/Y')); }}
|
||||
@else
|
||||
{{ Former::populateField('issued_on', date('m/d/Y')) }}
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{{ Former::select('client')->addOption('', '')->fromQuery($clients, 'name', 'id')->select($client ? $client->id : '')
|
||||
->help('<a class="ul" data-toggle="modal" data-target="#myModal">Create new client</a>'); }}
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{{ Former::text('number') }}
|
||||
{{ Former::text('issued_on') }}
|
||||
{{ Former::text('discount')->data_bind("value: discount, valueUpdate: 'afterkeydown'") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p> </p>
|
||||
</div>
|
||||
<div style="padding-left:16px">
|
||||
<input type="text" name="items" data-bind="value: ko.toJSON(items)" style="display:none"/>
|
||||
<table class="table invoice-table" style="margin-bottom: 0px !important;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="hide-border"></th>
|
||||
<th>Item</th>
|
||||
<th>Description</th>
|
||||
<th>Unit Cost</th>
|
||||
<th>Quantity</th>
|
||||
<th>Line Total</th>
|
||||
<th class="hide-border"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody data-bind="sortable: { data: items, afterMove: onDragged }">
|
||||
<tr data-bind="event: { mouseover: showActions, mouseout: hideActions }" class="sortable-row">
|
||||
<td style="width:50px;" class="hide-border">
|
||||
<i data-bind="click: $parent.addItem, visible: actionsVisible" class="fa fa-plus-circle" style="cursor:pointer" title="Add item"></i>
|
||||
<i data-bind="visible: actionsVisible" class="fa fa-sort"></i>
|
||||
</td>
|
||||
<td style="width:120px">
|
||||
<input data-bind="value: product_key, valueUpdate: 'afterkeydown'" onchange="refreshPDF()"/>
|
||||
</td>
|
||||
<td style="width:300px">
|
||||
<textarea data-bind="value: notes, valueUpdate: 'afterkeydown'" rows="1" cols="60" onchange="refreshPDF()"></textarea>
|
||||
</td>
|
||||
<td style="width:100px">
|
||||
<input data-bind="value: cost, valueUpdate: 'afterkeydown'" style="text-align: right" onchange="refreshPDF()"//>
|
||||
</td>
|
||||
<td style="width:80px">
|
||||
<input data-bind="value: qty, valueUpdate: 'afterkeydown'" style="text-align: right" onchange="refreshPDF()"//>
|
||||
</td>
|
||||
<!--
|
||||
<td style="width:100px">
|
||||
<input data-bind="value: tax, valueUpdate: 'afterkeydown'"/>
|
||||
</td>
|
||||
-->
|
||||
<td style="width:100px;background-color: #FFFFFF;text-align: right">
|
||||
<span data-bind="text: total"></span>
|
||||
</td>
|
||||
<td style="width:20px; cursor:pointer" class="hide-border">
|
||||
<i data-bind="click: $parent.removeItem, visible: actionsVisible() && $parent.items().length > 1" class="fa fa-minus-circle" title="Remove item"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr data-bind="visible: subtotal() != total()">
|
||||
<td colspan="3" class="hide-border"/>
|
||||
<td colspan="2">Subtotal</td>
|
||||
<td style="text-align: right"><span data-bind="text: subtotal"/></td>
|
||||
</tr>
|
||||
<tr data-bind="visible: discount() > 0">
|
||||
<td colspan="3" class="hide-border"/>
|
||||
<td colspan="2">Discount</td>
|
||||
<td style="text-align: right"><span data-bind="text: discounted"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="hide-border"/>
|
||||
<td colspan="2">Invoice Total</td>
|
||||
<td style="text-align: right"><span data-bind="text: total"/></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<input type="checkbox" name="send_email_checkBox" id="send_email_checkBox" value="true" style="display:none"/>
|
||||
|
||||
<p> </p>
|
||||
<div class="form-actions">
|
||||
{{ Button::primary('Download PDF', array('onclick' => 'onDownloadClick()')) }}
|
||||
{{ Button::primary_submit('Save Invoice') }}
|
||||
{{ Button::primary('Send Email', array('onclick' => 'onEmailClick()')) }}
|
||||
</div>
|
||||
<p> </p>
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<!-- <textarea rows="20" cols="120" id="pdfText" onkeyup="runCode()"></textarea> -->
|
||||
<!-- <iframe frameborder="1" width="600" height="600" style="display:block;margin: 0 auto"></iframe> -->
|
||||
<iframe frameborder="1" width="92%" height="600" style="display:block;margin: 0 auto"></iframe>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">New Client</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="min-height:80px">
|
||||
<div class="form-group required">
|
||||
<label for="name" class="control-label col-lg-2 col-sm-4">Name<sup>*</sup></label>
|
||||
<div class="col-lg-10 col-sm-8">
|
||||
<input class="form-control" id="client_name" type="text" name="client_name" onkeypress="nameKeyPress(event)">
|
||||
<span class="help-block" id="nameHelp" style="display: none">Please provide a value</span><span> </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group required">
|
||||
<label for="email" class="control-label col-lg-2 col-sm-4">Email<sup>*</sup></label>
|
||||
<div class="col-lg-10 col-sm-8">
|
||||
<input class="form-control" id="client_email" type="text" name="client_email" onkeypress="nameKeyPress(event)">
|
||||
<span class="help-block" id="emailHelp" style="display: none">Please provide a value</span><span> </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary" onclick="newClient()">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Former::close() }}
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
/*
|
||||
function textarea_height(TextArea, MaxHeight) {
|
||||
textarea = document.getElementById(TextArea);
|
||||
textareaRows = textarea.value.split("\n");
|
||||
if(textareaRows[0] != "undefined" && textareaRows.length < MaxHeight) counter = textareaRows.length;
|
||||
else if(textareaRows.length >= MaxHeight) counter = MaxHeight;
|
||||
else counter = 1;
|
||||
textarea.rows = counter;
|
||||
}
|
||||
*/
|
||||
|
||||
$(function() {
|
||||
|
||||
$('#issued_on').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true
|
||||
}).on('changeDate', function(e) {
|
||||
refreshPDF();
|
||||
});
|
||||
|
||||
var $input = $('select#client');
|
||||
$input.combobox();
|
||||
$('.combobox-container input.form-control').attr('name', 'client_combobox').on('change', function(e) {
|
||||
refreshPDF();
|
||||
});
|
||||
|
||||
@if ($client)
|
||||
$('input#number').focus();
|
||||
@else
|
||||
$('[name="client_combobox"]').focus();
|
||||
@endif
|
||||
|
||||
/*
|
||||
$('#myModal').on('hidden.bs.modal', function () {
|
||||
$('#popup_client_name').val('');
|
||||
})
|
||||
*/
|
||||
|
||||
$('#myModal').on('shown.bs.modal', function () {
|
||||
$('#client_name').focus();
|
||||
})
|
||||
|
||||
$('#number').change(refreshPDF);
|
||||
|
||||
refreshPDF();
|
||||
|
||||
});
|
||||
|
||||
function runCode() {
|
||||
var text = $('#pdfText').val();
|
||||
eval(text);
|
||||
}
|
||||
|
||||
function createInvoiceModel() {
|
||||
var invoice = {
|
||||
number: $('#number').val(),
|
||||
issued_on: $('#issued_on').val(),
|
||||
client: {
|
||||
name: $('[name="client_combobox"]').val()
|
||||
},
|
||||
@if (file_exists($account->getLogoPath()))
|
||||
image: "{{ HTML::image_data($account->getLogoPath()) }}",
|
||||
imageWidth: {{ $account->getLogoWidth() }},
|
||||
imageHeight: {{ $account->getLogoHeight() }},
|
||||
@endif
|
||||
invoice_items: []
|
||||
};
|
||||
|
||||
for(var i=0; i<model.items().length; i++) {
|
||||
var item = model.items()[i];
|
||||
invoice.invoice_items.push({
|
||||
product_key: item.product_key(),
|
||||
notes: item.notes(),
|
||||
cost: item.cost(),
|
||||
qty: item.qty()
|
||||
});
|
||||
}
|
||||
|
||||
return invoice;
|
||||
}
|
||||
|
||||
function refreshPDF() {
|
||||
var invoice = createInvoiceModel();
|
||||
var doc = generatePDF(invoice);
|
||||
var string = doc.output('datauristring');
|
||||
$('iframe').attr('src', string);
|
||||
}
|
||||
|
||||
function onDownloadClick() {
|
||||
var invoice = createInvoiceModel();
|
||||
var doc = generatePDF(invoice);
|
||||
doc.save('Invoice-' + $('#number').val() + '.pdf');
|
||||
}
|
||||
|
||||
function onEmailClick() {
|
||||
if (confirm('Are you sure you want to email this invoice?')) {
|
||||
$('#send_email_checkBox').prop("checked",true);
|
||||
$('.main_form').submit();
|
||||
}
|
||||
}
|
||||
|
||||
function newClient() {
|
||||
var name = $('#client_name').val();
|
||||
var email = $('#client_email').val();
|
||||
if (!name || !email) {
|
||||
if (!name) $('#nameHelp').css( "display", "block" );
|
||||
if (!email) $('#emailHelp').css( "display", "block" );
|
||||
} else {
|
||||
$('.combobox-container input[name=client]').val('-1');
|
||||
$('.combobox-container input.form-control').val(name);
|
||||
$('.combobox-container').addClass('combobox-selected');
|
||||
|
||||
$('#nameHelp').css( "display", "none" );
|
||||
$('#emailHelp').css( "display", "none" );
|
||||
//$('#client_name').val('');
|
||||
$('#myModal').modal('hide');
|
||||
$('input#number').focus();
|
||||
|
||||
refreshPDF();
|
||||
}
|
||||
}
|
||||
|
||||
function nameKeyPress(event) {
|
||||
if (event.keyCode === 13){
|
||||
event.preventDefault();
|
||||
newClient();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function InvoiceModel() {
|
||||
var self = this;
|
||||
self.discount = ko.observable();
|
||||
self.items = ko.observableArray();
|
||||
|
||||
@if ($invoice)
|
||||
self.discount({{ $invoice->discount }});
|
||||
@if (count($invoice->invoice_items) > 0)
|
||||
@foreach ($invoice->invoice_items as $item)
|
||||
var item = new ItemModel();
|
||||
item.product_key("{{ $item->product_key }}");
|
||||
item.notes('{{ str_replace("\n", "\\notes", $item->notes) }}');
|
||||
item.cost("{{ $item->cost }}");
|
||||
item.qty("{{ $item->qty }}");
|
||||
self.items.push(item);
|
||||
@endforeach
|
||||
@else
|
||||
self.items.push(new ItemModel());
|
||||
@endif
|
||||
@else
|
||||
var model1 = new ItemModel();
|
||||
var model2 = new ItemModel();
|
||||
/*
|
||||
model1.item('TEST');
|
||||
model1.notes('Some test text');
|
||||
model1.cost(10);
|
||||
model1.qty(1);
|
||||
*/
|
||||
self.items.push(model1);
|
||||
self.items.push(model2);
|
||||
@endif
|
||||
|
||||
self.removeItem = function(item) {
|
||||
self.items.remove(item);
|
||||
refreshPDF();
|
||||
}
|
||||
|
||||
self.addItem = function() {
|
||||
self.items.push(new ItemModel());
|
||||
}
|
||||
|
||||
this.rawSubtotal = ko.computed(function() {
|
||||
var total = 0;
|
||||
for(var p = 0; p < self.items().length; ++p)
|
||||
{
|
||||
total += self.items()[p].rawTotal();
|
||||
}
|
||||
return total;
|
||||
});
|
||||
|
||||
this.subtotal = ko.computed(function() {
|
||||
var total = self.rawSubtotal();
|
||||
return total > 0 ? formatMoney(total) : '';
|
||||
});
|
||||
|
||||
|
||||
this.discounted = ko.computed(function() {
|
||||
var total = self.rawSubtotal() * (self.discount()/100);
|
||||
return formatMoney(total);
|
||||
});
|
||||
|
||||
this.total = ko.computed(function() {
|
||||
var total = self.rawSubtotal();
|
||||
|
||||
var discount = parseInt(self.discount());
|
||||
if (discount > 0) {
|
||||
total = total * ((100 - discount)/100);
|
||||
}
|
||||
|
||||
return total > 0 ? formatMoney(total) : '';
|
||||
});
|
||||
|
||||
self.onDragged = function(item) {
|
||||
refreshPDF();
|
||||
}
|
||||
}
|
||||
|
||||
function ItemModel() {
|
||||
var self = this;
|
||||
this.product_key = ko.observable('');
|
||||
this.notes = ko.observable('');
|
||||
this.cost = ko.observable();
|
||||
this.qty = ko.observable();
|
||||
this.tax = ko.observable();
|
||||
this.actionsVisible = ko.observable(false);
|
||||
|
||||
this.rawTotal = ko.computed(function() {
|
||||
var cost = parseFloat(self.cost());
|
||||
var qty = parseInt(self.qty());
|
||||
var tax = parseFloat(self.tax());
|
||||
var value = cost * qty;
|
||||
if (self.tax() > 0) {
|
||||
//value = value * ((100 - this.tax())/100);
|
||||
}
|
||||
return value ? value : '';
|
||||
});
|
||||
|
||||
this.total = ko.computed(function() {
|
||||
var total = self.rawTotal();
|
||||
return total ? formatMoney(total) : '';
|
||||
});
|
||||
|
||||
this.hideActions = function() {
|
||||
this.actionsVisible(false);
|
||||
}
|
||||
|
||||
this.showActions = function() {
|
||||
this.actionsVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
window.model = new InvoiceModel();
|
||||
ko.applyBindings(model);
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@stop
|
14
app/views/invoices/index.blade.php
Executable file
14
app/views/invoices/index.blade.php
Executable file
@ -0,0 +1,14 @@
|
||||
@extends('header')
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Button::primary_link(URL::to('invoices/create'), 'New Invoice', array('class' => 'pull-right')) }}
|
||||
|
||||
{{ Datatable::table()
|
||||
->addColumn('Number', 'Client', 'Amount', 'Date')
|
||||
->setUrl(route('api.invoices'))
|
||||
->setOptions('sPaginationType', 'bootstrap')
|
||||
->setOptions('bFilter', false)
|
||||
->render() }}
|
||||
|
||||
@stop
|
0
app/views/invoices/payment.blade.php
Executable file
0
app/views/invoices/payment.blade.php
Executable file
9
app/views/invoices/show.blade.php
Executable file
9
app/views/invoices/show.blade.php
Executable file
@ -0,0 +1,9 @@
|
||||
@extends('header')
|
||||
|
||||
@section('content')
|
||||
|
||||
<h3>View Invoice</h3>
|
||||
|
||||
{{ $invoice->number }} - {{ $invoice->client->name }}
|
||||
|
||||
@stop
|
28
app/views/invoices/view.blade.php
Executable file
28
app/views/invoices/view.blade.php
Executable file
@ -0,0 +1,28 @@
|
||||
@extends('header')
|
||||
|
||||
@section('content')
|
||||
|
||||
@if (true || $invoice->client->account->isGatewayConfigured())
|
||||
{{ Button::primary_link(URL::to('payment/' . $invoice->invoice_key), 'Pay Now', array('class' => 'btn-lg pull-right')) }}
|
||||
<div class="clearfix"></div><p> </p>
|
||||
@endif
|
||||
|
||||
<iframe frameborder="1" width="100%" height="600" style="display:block;margin: 0 auto"></iframe>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
var invoice = {{ $invoice->toJson() }};
|
||||
@if (file_exists($invoice->client->account->getLogoPath()))
|
||||
invoice.image = "{{ HTML::image_data($invoice->client->account->getLogoPath()) }}";
|
||||
invoice.imageWidth = {{ $invoice->client->account->getLogoWidth() }};
|
||||
invoice.imageHeight = {{ $invoice->client->account->getLogoHeight() }};
|
||||
@endif
|
||||
var doc = generatePDF(invoice);
|
||||
var string = doc.output('datauristring');
|
||||
$('iframe').attr('src', string);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@stop
|
106
app/views/login.blade.php
Executable file
106
app/views/login.blade.php
Executable file
@ -0,0 +1,106 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<link rel="shortcut icon" href="../../docs-assets/ico/favicon.png">
|
||||
|
||||
<title></title>
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-top: 40px;
|
||||
padding-bottom: 40px;
|
||||
background-color: #eee !important;
|
||||
}
|
||||
|
||||
.form-signin {
|
||||
max-width: 330px;
|
||||
padding: 15px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.form-signin .form-signin-heading,
|
||||
.form-signin .checkbox {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.form-signin .checkbox {
|
||||
font-weight: normal;
|
||||
}
|
||||
.form-signin .form-control {
|
||||
position: relative;
|
||||
font-size: 16px;
|
||||
height: auto;
|
||||
padding: 10px;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.form-signin .form-control:focus {
|
||||
z-index: 2;
|
||||
}
|
||||
.form-signin input[type="text"] {
|
||||
margin-bottom: -1px;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.form-signin input[type="password"] {
|
||||
margin-bottom: 10px;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js" type="text/javascript"></script>
|
||||
|
||||
{{ Basset::show('bootstrapper.css') }}
|
||||
{{ Basset::show('bootstrapper.js') }}
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
|
||||
{{ Form::open(array('url' => 'login', 'class' => 'form-signin')) }}
|
||||
<h2 class="form-signin-heading">Please sign in</h2>
|
||||
|
||||
<p>
|
||||
{{ $errors->first('email') }}
|
||||
{{ $errors->first('password') }}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{{ Form::text('email', Input::old('email'), array('placeholder' => 'Email address')) }}
|
||||
{{ Form::password('password', array('placeholder' => 'Password')) }}
|
||||
</p>
|
||||
|
||||
<p>{{ Button::primary_submit('Sign In', array('class' => 'btn-lg'))->block() }}</p>
|
||||
|
||||
<!-- if there are login errors, show them here -->
|
||||
@if ( Session::get('error') )
|
||||
<div class="alert alert-error">{{{ Session::get('error') }}}</div>
|
||||
@endif
|
||||
|
||||
@if ( Session::get('notice') )
|
||||
<div class="alert">{{{ Session::get('notice') }}}</div>
|
||||
@endif
|
||||
|
||||
|
||||
{{ Form::close() }}
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
122
app/views/master.blade.php
Executable file
122
app/views/master.blade.php
Executable file
@ -0,0 +1,122 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>Invoice Ninja</title>
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js" type="text/javascript"></script>
|
||||
{{-- Basset::show('bootstrapper.css') --}}
|
||||
{{-- Basset::show('bootstrapper.js') --}}
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.css') }}"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-46031341-1', 'sketch-out.com');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</script>
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Invoice Ninja</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
{{ Form::open(array('url' => 'login', 'class' => 'navbar-form navbar-right')) }}
|
||||
<div class="form-group">
|
||||
{{ Form::text('email', Input::old('email'), array('placeholder' => 'Email')) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::password('password', array('placeholder' => 'Password')) }}
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success">Sign in</button>
|
||||
{{ Form::close() }}
|
||||
</div><!--/.navbar-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Main jumbotron for a primary marketing message or call to action -->
|
||||
<div class="jumbotron">
|
||||
<div class="container">
|
||||
<h1>Hello, world!</h1>
|
||||
<p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
|
||||
<p>
|
||||
{{ Form::open(array('url' => 'get_started')) }}
|
||||
{{ Form::hidden('guest_key') }}
|
||||
{{ Button::lg_primary_submit('Get Started »') }}
|
||||
{{ Form::close() }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<!-- Example row of columns -->
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
|
||||
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<footer>
|
||||
<p>© Company 2013</p>
|
||||
</footer>
|
||||
</div> <!-- /container -->
|
||||
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
|
||||
function isStorageSupported() {
|
||||
try {
|
||||
return 'localStorage' in window && window['localStorage'] !== null;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isStorageSupported()) {
|
||||
$('[name="guest_key"]').val(localStorage.getItem('guest_key'));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</html>
|
12
app/views/payments/index.blade.php
Executable file
12
app/views/payments/index.blade.php
Executable file
@ -0,0 +1,12 @@
|
||||
@extends('header')
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Datatable::table()
|
||||
->addColumn('Client', 'Invoice', 'Amount', 'Date')
|
||||
->setUrl(route('api.payments'))
|
||||
->setOptions('sPaginationType', 'bootstrap')
|
||||
->setOptions('bFilter', false)
|
||||
->render() }}
|
||||
|
||||
@stop
|
74
artisan
Executable file
74
artisan
Executable file
@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register The Auto Loader
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Composer provides a convenient, automatically generated class loader
|
||||
| for our application. We just need to utilize it! We'll require it
|
||||
| into the script here so that we do not have to worry about the
|
||||
| loading of any our classes "manually". Feels great to relax.
|
||||
|
|
||||
*/
|
||||
|
||||
require __DIR__.'/bootstrap/autoload.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Turn On The Lights
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| We need to illuminate PHP development, so let's turn on the lights.
|
||||
| This bootstrap the framework and gets it ready for use, then it
|
||||
| will load up this application so that we can run it and send
|
||||
| the responses back to the browser and delight these users.
|
||||
|
|
||||
*/
|
||||
|
||||
$app = require_once __DIR__.'/bootstrap/start.php';
|
||||
|
||||
$app->boot();
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Load The Artisan Console Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| We'll need to run the script to load and return the Artisan console
|
||||
| application. We keep this in its own script so that we will load
|
||||
| the console application independent of running commands which
|
||||
| will allow us to fire commands from Routes when we want to.
|
||||
|
|
||||
*/
|
||||
|
||||
$artisan = Illuminate\Console\Application::start($app);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Run The Artisan Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When we run the console application, the current CLI command will be
|
||||
| executed in this console and the response sent back to a terminal
|
||||
| or another output device for the developers. Here goes nothing!
|
||||
|
|
||||
*/
|
||||
|
||||
$status = $artisan->run();
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Shutdown The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Once Artisan has finished running. We will fire off the shutdown events
|
||||
| so that any final work may be done by the application before we shut
|
||||
| down the process. This is the last thing to happen to the request.
|
||||
|
|
||||
*/
|
||||
|
||||
$app->shutdown();
|
||||
|
||||
exit($status);
|
75
bootstrap/autoload.php
Executable file
75
bootstrap/autoload.php
Executable file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register The Composer Auto Loader
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Composer provides a convenient, automatically generated class loader
|
||||
| for our application. We just need to utilize it! We'll require it
|
||||
| into the script here so that we do not have to worry about the
|
||||
| loading of any our classes "manually". Feels great to relax.
|
||||
|
|
||||
*/
|
||||
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Include The Compiled Class File
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| To dramatically increase your application's performance, you may use a
|
||||
| compiled class file which contains all of the classes commonly used
|
||||
| by a request. The Artisan "optimize" is used to create this file.
|
||||
|
|
||||
*/
|
||||
|
||||
if (file_exists($compiled = __DIR__.'/compiled.php'))
|
||||
{
|
||||
require $compiled;
|
||||
}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Setup Patchwork UTF-8 Handling
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The Patchwork library provides solid handling of UTF-8 strings as well
|
||||
| as provides replacements for all mb_* and iconv type functions that
|
||||
| are not available by default in PHP. We'll setup this stuff here.
|
||||
|
|
||||
*/
|
||||
|
||||
Patchwork\Utf8\Bootup::initMbstring();
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register The Laravel Auto Loader
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| We register an auto-loader "behind" the Composer loader that can load
|
||||
| model classes on the fly, even if the autoload files have not been
|
||||
| regenerated for the application. We'll add it to the stack here.
|
||||
|
|
||||
*/
|
||||
|
||||
Illuminate\Support\ClassLoader::register();
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register The Workbench Loaders
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The Laravel workbench provides a convenient place to develop packages
|
||||
| when working locally. However we will need to load in the Composer
|
||||
| auto-load files for the packages so that these can be used here.
|
||||
|
|
||||
*/
|
||||
|
||||
if (is_dir($workbench = __DIR__.'/../workbench'))
|
||||
{
|
||||
Illuminate\Workbench\Starter::start($workbench);
|
||||
}
|
57
bootstrap/paths.php
Executable file
57
bootstrap/paths.php
Executable file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here we just defined the path to the application directory. Most likely
|
||||
| you will never need to change this value as the default setup should
|
||||
| work perfectly fine for the vast majority of all our applications.
|
||||
|
|
||||
*/
|
||||
|
||||
'app' => __DIR__.'/../app',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Public Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The public path contains the assets for your web application, such as
|
||||
| your JavaScript and CSS files, and also contains the primary entry
|
||||
| point for web requests into these applications from the outside.
|
||||
|
|
||||
*/
|
||||
|
||||
'public' => __DIR__.'/../public',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Base Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The base path is the root of the Laravel installation. Most likely you
|
||||
| will not need to change this value. But, if for some wild reason it
|
||||
| is necessary you will do so here, just proceed with some caution.
|
||||
|
|
||||
*/
|
||||
|
||||
'base' => __DIR__.'/..',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Storage Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The storage path is used by Laravel to store cached Blade views, logs
|
||||
| and other pieces of information. You may modify the path here when
|
||||
| you want to change the location of this directory for your apps.
|
||||
|
|
||||
*/
|
||||
|
||||
'storage' => __DIR__.'/../app/storage',
|
||||
|
||||
);
|
74
bootstrap/start.php
Executable file
74
bootstrap/start.php
Executable file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Create The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The first thing we will do is create a new Laravel application instance
|
||||
| which serves as the "glue" for all the components of Laravel, and is
|
||||
| the IoC container for the system binding all of the various parts.
|
||||
|
|
||||
*/
|
||||
|
||||
$app = new Illuminate\Foundation\Application;
|
||||
|
||||
$app->redirectIfTrailingSlash();
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Detect The Application Environment
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel takes a dead simple approach to your application environments
|
||||
| so you can just specify a machine name or HTTP host that matches a
|
||||
| given environment, then we will automatically detect it for you.
|
||||
|
|
||||
*/
|
||||
|
||||
$env = $app->detectEnvironment(array(
|
||||
|
||||
'local' => array('precise64'),
|
||||
|
||||
));
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Bind Paths
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here we are binding the paths configured in paths.php to the app. You
|
||||
| should not be changing these here. If you need to change these you
|
||||
| may do so within the paths.php file and they will be bound here.
|
||||
|
|
||||
*/
|
||||
|
||||
$app->bindInstallPaths(require __DIR__.'/paths.php');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Load The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here we will load the Illuminate application. We'll keep this is in a
|
||||
| separate location so we can isolate the creation of an application
|
||||
| from the actual running of the application with a given request.
|
||||
|
|
||||
*/
|
||||
|
||||
$framework = $app['path.base'].'/vendor/laravel/framework/src';
|
||||
|
||||
require $framework.'/Illuminate/Foundation/start.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Return The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This script returns the application instance. The instance is given to
|
||||
| the calling script so we can separate the building of the instances
|
||||
| from the actual running of the application and sending responses.
|
||||
|
|
||||
*/
|
||||
|
||||
return $app;
|
43
composer.json
Executable file
43
composer.json
Executable file
@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "laravel/laravel",
|
||||
"description": "The Laravel Framework.",
|
||||
"keywords": ["framework", "laravel"],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"laravel/framework": "4.0.*",
|
||||
"jasonlewis/basset": "dev-master",
|
||||
"patricktalmadge/bootstrapper": "dev-develop",
|
||||
"zizaco/confide": "2.0.x",
|
||||
"anahkiasen/former": "dev-master",
|
||||
"barryvdh/laravel-debugbar": "dev-master",
|
||||
"chumper/datatable": "dev-master",
|
||||
"omnipay/omnipay": "2.x",
|
||||
"intervention/image": "dev-master"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"app/commands",
|
||||
"app/controllers",
|
||||
"app/models",
|
||||
"app/database/migrations",
|
||||
"app/database/seeds",
|
||||
"app/tests/TestCase.php"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"post-install-cmd": [
|
||||
"php artisan optimize"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"php artisan clear-compiled",
|
||||
"php artisan optimize"
|
||||
],
|
||||
"post-create-project-cmd": [
|
||||
"php artisan key:generate"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist"
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
18
phpunit.xml
Executable file
18
phpunit.xml
Executable file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
bootstrap="bootstrap/autoload.php"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
syntaxCheck="false"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Application Test Suite">
|
||||
<directory>./app/tests/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
</phpunit>
|
8
public/.htaccess
Executable file
8
public/.htaccess
Executable file
@ -0,0 +1,8 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
Options -MultiViews
|
||||
RewriteEngine On
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^ index.php [L]
|
||||
</IfModule>
|
18
public/builds/bootstrapper-5626692bfbb6a53258f4d584d9456841.css
vendored
Executable file
18
public/builds/bootstrapper-5626692bfbb6a53258f4d584d9456841.css
vendored
Executable file
File diff suppressed because one or more lines are too long
9
public/builds/bootstrapper-d6834e94301cc3ab9cc013574d092b61.js
vendored
Executable file
9
public/builds/bootstrapper-d6834e94301cc3ab9cc013574d092b61.js
vendored
Executable file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user