From 9714f3d8cc311f3b75a4727156de2ab33cf3895e Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Wed, 27 Jul 2016 16:28:19 +0200 Subject: Removed redundant whitespace & retab --- classes/file.php | 228 +++++++++++++++--------------- classes/response.php | 166 +++++++++++----------- conf.php | 6 +- css/businessadmin.css | 42 +++--- footer.php | 3 +- header.php | 68 ++++----- include/404.php | 36 ++--- include/about.php | 112 +++++++-------- include/ajax-collapse.php | 4 +- include/assignments-edit.php | 6 +- include/assignments-new.php | 6 +- include/assignments-overview.php | 288 +++++++++++++++++++------------------- include/assignments-view.php | 10 +- include/assignments.php | 6 +- include/clients-edit.php | 6 +- include/clients-new.php | 6 +- include/clients-overview.php | 190 ++++++++++++------------- include/clients-view.php | 6 +- include/clients.php | 6 +- include/contacts-edit.php | 6 +- include/contacts-new.php | 6 +- include/contacts.php | 6 +- include/discounts-edit.php | 6 +- include/discounts-new.php | 6 +- include/discounts-overview.php | 28 ++-- include/discounts.php | 6 +- include/home.php | 2 +- include/offers-edit.php | 6 +- include/offers-new.php | 6 +- include/offers-overview.php | 8 +- include/offers-view.php | 292 +++++++++++++++++++-------------------- include/offers.php | 6 +- include/users-new.php | 6 +- install/index.php | 8 +- install/upgrade.php | 6 +- js/businessadmin.js | 186 ++++++++++++------------- login-ajax.php | 10 +- login.php | 10 +- nav.php | 6 +- 39 files changed, 905 insertions(+), 906 deletions(-) diff --git a/classes/file.php b/classes/file.php index f6019ec..b07064e 100644 --- a/classes/file.php +++ b/classes/file.php @@ -1,22 +1,22 @@ . */ @@ -25,124 +25,124 @@ * An interface to the file table in the database */ class file { - /** - * @var PDO $pdo The PDO class for database communication - * @var int $id The id of the file - * @var string $filename The relative path to the file - */ - protected $pdo, $id, $filename; + /** + * @var PDO $pdo The PDO class for database communication + * @var int $id The id of the file + * @var string $filename The relative path to the file + */ + protected $pdo, $id, $filename; - /** - * Create a new instance - * - * @param PDO $pdo The PDO class, to access the database - * @param int $id The id of the file to fetch - * - * @throws PDOException If something went wrong with the database - * @throws Exception If the file could not be found - */ - public function __construct($pdo, $id) { - $this->pdo = $pdo; + /** + * Create a new instance + * + * @param PDO $pdo The PDO class, to access the database + * @param int $id The id of the file to fetch + * + * @throws PDOException If something went wrong with the database + * @throws Exception If the file could not be found + */ + public function __construct($pdo, $id) { + $this->pdo = $pdo; - $stmt = $this->pdo->prepare("SELECT * FROM `".constants::db_prefix."file` WHERE `id`=?"); - $stmt->execute(array($id)); - if ($stmt->rowCount() == 0) { - throw new Exception("The file with id '$id' could not be found."); - } - $file = $stmt->fetch(PDO::FETCH_ASSOC); + $stmt = $this->pdo->prepare("SELECT * FROM `".constants::db_prefix."file` WHERE `id`=?"); + $stmt->execute(array($id)); + if ($stmt->rowCount() == 0) { + throw new Exception("The file with id '$id' could not be found."); + } + $file = $stmt->fetch(PDO::FETCH_ASSOC); - $this->id = $file['id']; - $this->filename = $file['filename']; - } + $this->id = $file['id']; + $this->filename = $file['filename']; + } - //------------------------------------------------------------------------------ - // Getters and setters - //------------------------------------------------------------------------------ + //------------------------------------------------------------------------------ + // Getters and setters + //------------------------------------------------------------------------------ - /** - * Get the ID of the file - * - * @return int The ID - */ - public function getId() { - return $this->id; - } + /** + * Get the ID of the file + * + * @return int The ID + */ + public function getId() { + return $this->id; + } - /** - * Get the relative filename of the file - * - * @see file::getFilenamePath To get the full internal path to the file - * @see file::getFilenameURI To get the full external path to the file - * - * @return string The filename - */ - public function getFilename() { - return $this->filename; - } + /** + * Get the relative filename of the file + * + * @see file::getFilenamePath To get the full internal path to the file + * @see file::getFilenameURI To get the full external path to the file + * + * @return string The filename + */ + public function getFilename() { + return $this->filename; + } - /** - * Get the full internal path to the file - * - * @see file::getFilename To get the relative filename - * @see file::getFilenameURI To get the full external path to the file - * - * @return string The path - */ - public function getFilenamePath() { - return constants::files_folder . $this->filename; - } + /** + * Get the full internal path to the file + * + * @see file::getFilename To get the relative filename + * @see file::getFilenameURI To get the full external path to the file + * + * @return string The path + */ + public function getFilenamePath() { + return constants::files_folder . $this->filename; + } - /** - * Get the full external path to the file - * - * @see file::getFilename To get the relative filename - * @see file::getFilenamePath To get the full internal path to the file - * - * @return string The URI - */ - public function getFilenameURI() { - return constants::files_folder_external . $this->filename; - } + /** + * Get the full external path to the file + * + * @see file::getFilename To get the relative filename + * @see file::getFilenamePath To get the full internal path to the file + * + * @return string The URI + */ + public function getFilenameURI() { + return constants::files_folder_external . $this->filename; + } - //------------------------------------------------------------------------------ - // Other functions - //------------------------------------------------------------------------------ + //------------------------------------------------------------------------------ + // Other functions + //------------------------------------------------------------------------------ - /** - * Move this file to the trash and delete all records for it - * - * Physically, this moves the file to a trash folder - * Then, the file will be removed from the file table in the database - * Any appendices linking to this file with fileId will have fileId NULL - * Any offers linking to this file with invoice_fileId will have invoice_fileId NULL - * - * @throws PDOException If there's something wrong with the database - * - * @return bool True on success, false on failure - */ - public function delete() { - // Try to move the file to trash - $newname = pathinfo($this->filename, PATHINFO_FILENAME) . '--' . date('Y-m-d.H.i.s.') . pathinfo($this->filename, PATHINFO_EXTENSION); - $newdir = pathinfo($this->getFilenamePath(), PATHINFO_DIRNAME) . '/' . constants::files_folder_trash . '/'; - if (!file_exists($newdir)) { - if (!mkdir($newdir)) { - return false; - } - } - if (!(@rename($this->getFilenamePath(), $newdir . $newname))) { - return false; - } + /** + * Move this file to the trash and delete all records for it + * + * Physically, this moves the file to a trash folder + * Then, the file will be removed from the file table in the database + * Any appendices linking to this file with fileId will have fileId NULL + * Any offers linking to this file with invoice_fileId will have invoice_fileId NULL + * + * @throws PDOException If there's something wrong with the database + * + * @return bool True on success, false on failure + */ + public function delete() { + // Try to move the file to trash + $newname = pathinfo($this->filename, PATHINFO_FILENAME) . '--' . date('Y-m-d.H.i.s.') . pathinfo($this->filename, PATHINFO_EXTENSION); + $newdir = pathinfo($this->getFilenamePath(), PATHINFO_DIRNAME) . '/' . constants::files_folder_trash . '/'; + if (!file_exists($newdir)) { + if (!mkdir($newdir)) { + return false; + } + } + if (!(@rename($this->getFilenamePath(), $newdir . $newname))) { + return false; + } - // Remove offers linked by invoice_fileId - $this->pdo->query("UPDATE `".constants::db_prefix."offer` SET `invoice_fileId`=NULL WHERE `invoice_fileId`={$this->id}"); + // Remove offers linked by invoice_fileId + $this->pdo->query("UPDATE `".constants::db_prefix."offer` SET `invoice_fileId`=NULL WHERE `invoice_fileId`={$this->id}"); - // Remove the record of the file - $stmt = $this->pdo->prepare("DELETE FROM `".constants::db_prefix."file` WHERE `id`=?"); - $stmt->execute(array($this->id)); - if ($stmt->rowCount() == 1) { - return true; - } else { - return false; - } - } -} \ No newline at end of file + // Remove the record of the file + $stmt = $this->pdo->prepare("DELETE FROM `".constants::db_prefix."file` WHERE `id`=?"); + $stmt->execute(array($this->id)); + if ($stmt->rowCount() == 1) { + return true; + } else { + return false; + } + } +} diff --git a/classes/response.php b/classes/response.php index babf5ed..d997c00 100644 --- a/classes/response.php +++ b/classes/response.php @@ -1,22 +1,22 @@ . */ @@ -25,88 +25,88 @@ * Provides a standard to base all responses to be called with AJAX on */ class response { - /** The variable to keep the response in until output */ - private $response; - /** The variable to keep the HTTP response code in until output */ - private $http_response_code; + /** The variable to keep the response in until output */ + private $response; + /** The variable to keep the HTTP response code in until output */ + private $http_response_code; - /** - * Create a new instance - */ - public function __construct() { - $this->response = array(); - $this->http_response_code = 200; - } + /** + * Create a new instance + */ + public function __construct() { + $this->response = array(); + $this->http_response_code = 200; + } - /** - * Set a variable of the response - * - * @param string $name The name of the variable to set - * @param string $value The (new) value for the variable - */ - public function __set($name, $value) { - $this->response[$name] = $value; - } + /** + * Set a variable of the response + * + * @param string $name The name of the variable to set + * @param string $value The (new) value for the variable + */ + public function __set($name, $value) { + $this->response[$name] = $value; + } - /** - * Get a variable of the response - * - * @param string $name The name of the variable to get - * - * @return mixed The value of the variable - */ - public function __get($name) { - return $this->response[$name]; - } + /** + * Get a variable of the response + * + * @param string $name The name of the variable to get + * + * @return mixed The value of the variable + */ + public function __get($name) { + return $this->response[$name]; + } - /** - * Check if a variable of the response is set - * - * @param string $name The name of the variable to check - * - * @return bool True if the variable exists, false otherwise - */ - public function __isset($name) { - return isset($this->response[$name]); - } + /** + * Check if a variable of the response is set + * + * @param string $name The name of the variable to check + * + * @return bool True if the variable exists, false otherwise + */ + public function __isset($name) { + return isset($this->response[$name]); + } - /** - * Unset a variable of the response - * - * @param string $name The variable to unset - */ - public function __unset($name) { - unset($this->response[$name]); - } + /** + * Unset a variable of the response + * + * @param string $name The variable to unset + */ + public function __unset($name) { + unset($this->response[$name]); + } - /** - * Get or set the HTTP response code - * - * If a parameter is provided, it is used as the new HTTP response code, and a bool is returned for success or failure. Otherwise, the current one is returned. - * - * @param int $code The new code - * - * @return int|bool True on successful change, false on unsuccesful change, int when the current code is returned - */ - public function http_response_code($code = null) { - if ($code === null) { - return $this->http_response_code; - } else { - if (http_response_code($code)) { - $this->http_response_code = $code; - return true; - } else { - return false; - } - } - } + /** + * Get or set the HTTP response code + * + * If a parameter is provided, it is used as the new HTTP response code, and a bool is returned for success or failure. Otherwise, the current one is returned. + * + * @param int $code The new code + * + * @return int|bool True on successful change, false on unsuccesful change, int when the current code is returned + */ + public function http_response_code($code = null) { + if ($code === null) { + return $this->http_response_code; + } else { + if (http_response_code($code)) { + $this->http_response_code = $code; + return true; + } else { + return false; + } + } + } - /** - * Output the response in json - * - * @return string The response in json format - */ - public function getJson() { - return json_encode($this->response); - } -} \ No newline at end of file + /** + * Output the response in json + * + * @return string The response in json format + */ + public function getJson() { + return json_encode($this->response); + } +} diff --git a/conf.php b/conf.php index 9c1cffc..4d14829 100644 --- a/conf.php +++ b/conf.php @@ -11,17 +11,17 @@ * * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/css/businessadmin.css b/css/businessadmin.css index 07bf218..e898740 100644 --- a/css/businessadmin.css +++ b/css/businessadmin.css @@ -1,17 +1,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -19,24 +19,24 @@ /* If you change the external URL of the control panel, also change the URLs below: */ @font-face { - font-family: Ubuntu; - src: url('/BusinessAdmin/fonts/Ubuntu-R.ttf'); + font-family: Ubuntu; + src: url('/BusinessAdmin/fonts/Ubuntu-R.ttf'); } @font-face { - font-family: Ubuntu; - font-style: italic; - src: url('/BusinessAdmin/fonts/Ubuntu-RI.ttf'); + font-family: Ubuntu; + font-style: italic; + src: url('/BusinessAdmin/fonts/Ubuntu-RI.ttf'); } @font-face { - font-family: Ubuntu; - font-weight: bold; - src: url('/BusinessAdmin/fonts/Ubuntu-B.ttf'); + font-family: Ubuntu; + font-weight: bold; + src: url('/BusinessAdmin/fonts/Ubuntu-B.ttf'); } @font-face { - font-family: Ubuntu; - font-style: italic; - font-weight: bold; - src: url('/BusinessAdmin/fonts/Ubuntu-BI.ttf'); + font-family: Ubuntu; + font-style: italic; + font-weight: bold; + src: url('/BusinessAdmin/fonts/Ubuntu-BI.ttf'); } /********************** Do not edit below this line **********************/ @@ -101,13 +101,13 @@ td .btn.btn-circle:last-child { } #collapse-menu { - margin-right: 16px; - margin-top: 16px; - float: right; + margin-right: 16px; + margin-top: 16px; + float: right; } @media (max-width: 767px) { - #collapse-menu { - display: none; - } + #collapse-menu { + display: none; + } } diff --git a/footer.php b/footer.php index 9870926..308b1d0 100644 --- a/footer.php +++ b/footer.php @@ -1,3 +1,2 @@ - - \ No newline at end of file + diff --git a/header.php b/header.php index 016ef03..d9bb6e2 100644 --- a/header.php +++ b/header.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -22,45 +22,45 @@ - - - + + + - <?=constants::my_name?> + <?=constants::my_name?> - - - - - - - - - + + + + + + + + + - - + + - - + + - - - - - - - + + + + + + + - - + + - - + + - + diff --git a/include/404.php b/include/404.php index 335ebf7..dc0cff0 100644 --- a/include/404.php +++ b/include/404.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -23,23 +23,23 @@ require('./header.php');
- - - -
-
-
-

404

-

The page you requested could not be found.

-
- -
- -
- + + + +
+
+
+

404

+

The page you requested could not be found.

+
+ +
+ +
+
\ No newline at end of file +?> diff --git a/include/about.php b/include/about.php index 554a80f..e7ab3d4 100644 --- a/include/about.php +++ b/include/about.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -24,25 +24,25 @@ require('./header.php');
- - - -
-
-
-

About

-
- -
+ -
-
-
-
About
-
-

BusinessAdmin is open source software under the GPL 3.0 license.

-

A full version of the license is available here. An excerpt is shown below:

-
BusinessAdmin: administrative software for small companies
+	
+	
+
+
+

About

+
+ +
+ +
+
+
+
About
+
+

BusinessAdmin is open source software under the GPL 3.0 license.

+

A full version of the license is available here. An excerpt is shown below:

+
BusinessAdmin: administrative software for small companies
 Copyright (C) 2015 Camil Staps (ViviSoft)
 
 This program is free software: you can redistribute it and/or modify
@@ -63,43 +63,43 @@ You can contact me, Camil Staps, here:
 Camil Staps
 www.camilstaps.nl
 info@camilstaps.nl
-
-
-
- +
+
+
+ -
-
-
Contact
-
- -

For things related to BusinessAdmin, please use GitHub: camilstaps/BusinessAdmin

-

The BusinessAdmin system was developed by Camil Staps. See my website for contact details.

-
-
-
+
+
+
Contact
+
+ +

For things related to BusinessAdmin, please use GitHub: camilstaps/BusinessAdmin

+

The BusinessAdmin system was developed by Camil Staps. See my website for contact details.

+
+
+
-
-
-
Thanks
-
-

BusinessAdmin was created using:

- -

Many thanks go to the creators and developers of these software packages.

-
-
-
-
- -
- +
+
+
Thanks
+
+

BusinessAdmin was created using:

+ +

Many thanks go to the creators and developers of these software packages.

+
+
+
+
+ +
+
diff --git a/include/ajax-collapse.php b/include/ajax-collapse.php index e49c6fd..402d057 100644 --- a/include/ajax-collapse.php +++ b/include/ajax-collapse.php @@ -1,8 +1,8 @@ . */ diff --git a/include/assignments-new.php b/include/assignments-new.php index 7898a42..405c5fa 100644 --- a/include/assignments-new.php +++ b/include/assignments-new.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/include/assignments-overview.php b/include/assignments-overview.php index ee46928..0e364d1 100644 --- a/include/assignments-overview.php +++ b/include/assignments-overview.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -21,151 +21,151 @@ require_once('./login.php'); ?>
-
-
Overview
-
- - - - - - - - - - - - - getId()}' - data-mixer-order-offer='{$assignment->getOffer()->getId()}' - data-mixer-order-time='{$assignment->getHours()}' - data-mixer-order-price='{$assignment->getPricePerHour()}'> - - - - - - "; - } - if (count($assignments) == 0) { - echo ""; - } - ?> - -
#OfferBriefingTimePriceTools
{$assignment->getId()} - #{$assignment->getOffer()->getId()} to - {$assignment->getOffer()->getContact()->getName()} - ({$assignment->getOffer()->getContact()->getClient()->name}) - - {$assignment->getTitle()}
-

{$assignment->getDescription(false)}

-
{$assignment->getHours()}h - ".constants::invoice_valuta."{$assignment->getPricePerHour()} / hr
- {$assignment->getVAT()}% VAT -
- - -
There are no assignments in the database. Why not start with creating one, below?
-
-
+
+
Overview
+
+ + + + + + + + + + + + + getId()}' + data-mixer-order-offer='{$assignment->getOffer()->getId()}' + data-mixer-order-time='{$assignment->getHours()}' + data-mixer-order-price='{$assignment->getPricePerHour()}'> + + + + + + "; + } + if (count($assignments) == 0) { + echo ""; + } + ?> + +
#OfferBriefingTimePriceTools
{$assignment->getId()} + #{$assignment->getOffer()->getId()} to + {$assignment->getOffer()->getContact()->getName()} + ({$assignment->getOffer()->getContact()->getClient()->name}) + + {$assignment->getTitle()}
+

{$assignment->getDescription(false)}

+
{$assignment->getHours()}h + ".constants::invoice_valuta."{$assignment->getPricePerHour()} / hr
+ {$assignment->getVAT()}% VAT +
+ + +
There are no assignments in the database. Why not start with creating one, below?
+
+
-
-
Create new
-
-
-
-
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
- - -
-
-
- -
-
- -
-
+ $('#newAssignment input, #newAssignment button').prop('disabled', false); + $('#newAssignment').data('bootstrapValidator').resetForm(); + } + +
+ diff --git a/include/assignments-view.php b/include/assignments-view.php index f2717b0..0bac039 100644 --- a/include/assignments-view.php +++ b/include/assignments-view.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -36,8 +36,8 @@ $_assignment = new assignment($_pdo, $_id); getId()}' + echo " diff --git a/include/assignments.php b/include/assignments.php index eaa7163..14ed8da 100644 --- a/include/assignments.php +++ b/include/assignments.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/include/clients-edit.php b/include/clients-edit.php index 7d8d6fa..3d92d06 100644 --- a/include/clients-edit.php +++ b/include/clients-edit.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/include/clients-new.php b/include/clients-new.php index e87557e..fe66026 100644 --- a/include/clients-new.php +++ b/include/clients-new.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/include/clients-overview.php b/include/clients-overview.php index 58fad49..860e671 100644 --- a/include/clients-overview.php +++ b/include/clients-overview.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -21,102 +21,102 @@ require_once('./login.php'); ?>
-
-
Overview
-
- - - - - - - - - - id}' - data-mixer-order-name='{$client->name}'> - - - - "; - } - if (count($clients) == 0) { - echo ""; - } - ?> - -
#NameTools
{$client->id} - - {$client->name} - - - - -
There are no clients in the database. Why not start with creating one, on the right?
-
-
+
+
Overview
+
+ + + + + + + + + + id}' + data-mixer-order-name='{$client->name}'> + + + + "; + } + if (count($clients) == 0) { + echo ""; + } + ?> + +
#NameTools
{$client->id} + + {$client->name} + + + + +
There are no clients in the database. Why not start with creating one, on the right?
+
+
-
-
Create new
-
-
-
-
- - -
- -
- -
-
+ // Callback for when form submission encountered an error + function newClientError() { + $('#newClient .ajaxify-response') + .addClass('alert-danger') + .show() + .find('.ajaxify-response-text') + .html('An unknown error occurred. Please contact support.'); + + $('#newClient input, #newClient button').prop('disabled', false); + $('#newClient').data('bootstrapValidator').resetForm(); + } + +
+ diff --git a/include/clients-view.php b/include/clients-view.php index 514e4e4..007d94c 100644 --- a/include/clients-view.php +++ b/include/clients-view.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/include/clients.php b/include/clients.php index b07a7c8..f762859 100644 --- a/include/clients.php +++ b/include/clients.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/include/contacts-edit.php b/include/contacts-edit.php index a5b3bdd..ac924a9 100644 --- a/include/contacts-edit.php +++ b/include/contacts-edit.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/include/contacts-new.php b/include/contacts-new.php index 0a72afb..440e744 100644 --- a/include/contacts-new.php +++ b/include/contacts-new.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/include/contacts.php b/include/contacts.php index 4b35603..09a452f 100644 --- a/include/contacts.php +++ b/include/contacts.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/include/discounts-edit.php b/include/discounts-edit.php index a760e9c..2d64bd9 100644 --- a/include/discounts-edit.php +++ b/include/discounts-edit.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/include/discounts-new.php b/include/discounts-new.php index 8a5f527..b0cfa07 100644 --- a/include/discounts-new.php +++ b/include/discounts-new.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/include/discounts-overview.php b/include/discounts-overview.php index d4d8245..1bf55d6 100644 --- a/include/discounts-overview.php +++ b/include/discounts-overview.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -39,7 +39,7 @@ require_once('./login.php'); $discounts = BusinessAdmin::getDiscounts($_pdo); foreach ($discounts as $discount) { echo " {$discount->getId()} @@ -56,7 +56,7 @@ require_once('./login.php'); {$discount->getVAT()}% VAT - + "; @@ -74,7 +74,7 @@ require_once('./login.php');
Create new
-
@@ -90,30 +90,30 @@ require_once('./login.php');
-
-
-
-
diff --git a/include/discounts.php b/include/discounts.php index 8b160ab..ff2a69a 100644 --- a/include/discounts.php +++ b/include/discounts.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/include/home.php b/include/home.php index a9dca1e..6a25743 100644 --- a/include/home.php +++ b/include/home.php @@ -279,7 +279,7 @@ require('./header.php'); $sort_list = array(); foreach ($offers as $offer) { $temp = array( - 'id' => $offer->getId(), + 'id' => $offer->getId(), 'contact' => $offer->getContact()->getName(), 'assignments' => '', 'assignments_header' => '' diff --git a/include/offers-edit.php b/include/offers-edit.php index 225a18c..7f050c3 100644 --- a/include/offers-edit.php +++ b/include/offers-edit.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/include/offers-new.php b/include/offers-new.php index 0d86293..9c499a8 100644 --- a/include/offers-new.php +++ b/include/offers-new.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/include/offers-overview.php b/include/offers-overview.php index a246190..9eaf25d 100644 --- a/include/offers-overview.php +++ b/include/offers-overview.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -112,7 +112,7 @@ require_once('./login.php');
Create new
-
diff --git a/include/offers-view.php b/include/offers-view.php index 082af35..8f741c2 100644 --- a/include/offers-view.php +++ b/include/offers-view.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -22,152 +22,152 @@ require_once('./login.php'); $_offer = new offer($_pdo, $_id); ?>
-
-
- Timeline -
- -
-
    - $_offer->getId(), - 'contact' => $_offer->getContact()->getName(), - 'assignments' => '', - 'assignments_header' => '' - ); - foreach ($_offer->getAssignments() as $assignment) { - $temp['assignments'] .= "{$assignment->getTitle()}
    (".constants::invoice_valuta."{$assignment->calculate(assignment::SUBTOTAL)} excl. VAT, ".constants::invoice_valuta."{$assignment->calculate(assignment::TOTAL)} incl. VAT)

    {$assignment->getDescription()}

    "; - $temp['assignments_header'] .= "{$assignment->getTitle()}
    (".constants::invoice_valuta."{$assignment->calculate(assignment::SUBTOTAL)} excl. VAT, ".constants::invoice_valuta."{$assignment->calculate(assignment::TOTAL)} incl. VAT)
    "; - } - $list[] = array_merge($temp, array('type' => 'start', 'time' => $_offer->getStartDate(), 'description' => 'Offer started')); - $sort_list[] = $_offer->getStartDate() . $_offer->getId() . 0; - $list[] = array_merge($temp, array('type' => 'end', 'time' => $_offer->getEndDate(), 'description' => 'Offer ended')); - $sort_list[] = $_offer->getEndDate() . $_offer->getId() . 1; - if ($_offer->getInvoiceDate() > 0) { - $list[] = array_merge($temp, array('type' => 'invoice', 'time' => $_offer->getInvoiceDate(), 'description' => 'Invoice sent')); - $sort_list[] = $_offer->getInvoiceDate() . $_offer->getId() . 2; - if ($_offer->getPaymentReceived() > 0) { - $list[] = array_merge($temp, array('type' => 'payment_received', 'time' => $_offer->getPaymentReceived(), 'description' => 'Payment received')); - $sort_list[] = $_offer->getPaymentReceived() . $_offer->getId() . 3; - } - } +
    +
    + Timeline +
    + +
    +
      + time()) { - continue; - } - echo ""; - switch ($item['type']) { - case 'start': echo "
      "; break; - case 'end': echo "
      "; break; - case 'invoice': echo "
      "; break; - case 'payment_received': echo "
      "; break; - } - echo "
      "; - echo "

      #{$item['id']} to {$item['contact']}: {$item['description']}

      ".BusinessAdmin::formatDate($item['time'],false,true,true)."

      "; - switch ($item['type']) { - case 'start': echo "
      {$item['assignments']}
      "; break; - default: echo "
      {$item['assignments_header']}
      "; - } - echo "
      "; - echo ""; - } - ?> -
    -
    - -
    - + $temp = array( + 'id' => $_offer->getId(), + 'contact' => $_offer->getContact()->getName(), + 'assignments' => '', + 'assignments_header' => '' + ); + foreach ($_offer->getAssignments() as $assignment) { + $temp['assignments'] .= "{$assignment->getTitle()}
    (".constants::invoice_valuta."{$assignment->calculate(assignment::SUBTOTAL)} excl. VAT, ".constants::invoice_valuta."{$assignment->calculate(assignment::TOTAL)} incl. VAT)

    {$assignment->getDescription()}

    "; + $temp['assignments_header'] .= "{$assignment->getTitle()}
    (".constants::invoice_valuta."{$assignment->calculate(assignment::SUBTOTAL)} excl. VAT, ".constants::invoice_valuta."{$assignment->calculate(assignment::TOTAL)} incl. VAT)
    "; + } + $list[] = array_merge($temp, array('type' => 'start', 'time' => $_offer->getStartDate(), 'description' => 'Offer started')); + $sort_list[] = $_offer->getStartDate() . $_offer->getId() . 0; + $list[] = array_merge($temp, array('type' => 'end', 'time' => $_offer->getEndDate(), 'description' => 'Offer ended')); + $sort_list[] = $_offer->getEndDate() . $_offer->getId() . 1; + if ($_offer->getInvoiceDate() > 0) { + $list[] = array_merge($temp, array('type' => 'invoice', 'time' => $_offer->getInvoiceDate(), 'description' => 'Invoice sent')); + $sort_list[] = $_offer->getInvoiceDate() . $_offer->getId() . 2; + if ($_offer->getPaymentReceived() > 0) { + $list[] = array_merge($temp, array('type' => 'payment_received', 'time' => $_offer->getPaymentReceived(), 'description' => 'Payment received')); + $sort_list[] = $_offer->getPaymentReceived() . $_offer->getId() . 3; + } + } + + array_multisort($sort_list, SORT_DESC, $list); + $i = 0; + foreach ($list as $item) { + if ($item['time'] > time()) { + continue; + } + echo ""; + switch ($item['type']) { + case 'start': echo "
    "; break; + case 'end': echo "
    "; break; + case 'invoice': echo "
    "; break; + case 'payment_received': echo "
    "; break; + } + echo "
    "; + echo "

    #{$item['id']} to {$item['contact']}: {$item['description']}

    ".BusinessAdmin::formatDate($item['time'],false,true,true)."

    "; + switch ($item['type']) { + case 'start': echo "
    {$item['assignments']}
    "; break; + default: echo "
    {$item['assignments_header']}
    "; + } + echo "
    "; + echo ""; + } + ?> +
+
+ +
+
-
-
Assignments
-
- - - - - - - - - - - - getId()}")); - foreach ($assignments as $assignment) { - echo " - - - - - - "; - } - if (count($assignments) == 0) { - echo ""; - } - ?> - -
#BriefingTimePriceTools
{$assignment->getId()} - {$assignment->getTitle()}
-

{$assignment->getDescription()}

-
{$assignment->getHours()}h - ".constants::invoice_valuta."{$assignment->getPricePerHour()} / hr
- {$assignment->getVAT()}% VAT -
- - -
There are no assignments in the database. Why not start with creating one, below?
-
-
+
+
Assignments
+
+ + + + + + + + + + + + getId()}")); + foreach ($assignments as $assignment) { + echo " + + + + + + "; + } + if (count($assignments) == 0) { + echo ""; + } + ?> + +
#BriefingTimePriceTools
{$assignment->getId()} + {$assignment->getTitle()}
+

{$assignment->getDescription()}

+
{$assignment->getHours()}h + ".constants::invoice_valuta."{$assignment->getPricePerHour()} / hr
+ {$assignment->getVAT()}% VAT +
+ + +
There are no assignments in the database. Why not start with creating one, below?
+
+
-
-
Discounts
-
- - - - - - - - - - - getId()}")); - foreach ($discounts as $discount) { - echo " - - - - - "; - } - if (count($discounts) == 0) { - echo ""; - } - ?> - -
#BriefingValueTools
{$discount->getId()} - {$discount->getTitle()}
-

{$discount->getDescription()}

-
- ".constants::invoice_valuta."{$discount->getValue()} / hr
- {$discount->getVAT()}% VAT -
- - -
There are no discounts in the database. Why not start with creating one, below?
-
-
+
+
Discounts
+
+ + + + + + + + + + + getId()}")); + foreach ($discounts as $discount) { + echo " + + + + + "; + } + if (count($discounts) == 0) { + echo ""; + } + ?> + +
#BriefingValueTools
{$discount->getId()} + {$discount->getTitle()}
+

{$discount->getDescription()}

+
+ ".constants::invoice_valuta."{$discount->getValue()} / hr
+ {$discount->getVAT()}% VAT +
+ + +
There are no discounts in the database. Why not start with creating one, below?
+
+
diff --git a/include/offers.php b/include/offers.php index 1aa871a..81781ba 100644 --- a/include/offers.php +++ b/include/offers.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/include/users-new.php b/include/users-new.php index 5d86a83..d32e201 100644 --- a/include/users-new.php +++ b/include/users-new.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/install/index.php b/install/index.php index f565696..3873ce3 100644 --- a/install/index.php +++ b/install/index.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -95,7 +95,7 @@ if (isset($_GET['create_tables'])) { `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;"); - + $_pdo->query("CREATE TABLE IF NOT EXISTS `".constants::db_prefix."user` ( `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(24) NOT NULL, diff --git a/install/upgrade.php b/install/upgrade.php index 78f5dff..0643ff5 100644 --- a/install/upgrade.php +++ b/install/upgrade.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/js/businessadmin.js b/js/businessadmin.js index a82be81..e5da52e 100644 --- a/js/businessadmin.js +++ b/js/businessadmin.js @@ -1,17 +1,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -21,101 +21,101 @@ $(document).ready(function(){ // The input elements should have data attributes containing all necessary information $('.bootstrapValidator').bootstrapValidator({ feedbackIcons: { - valid: 'glyphicon glyphicon-ok', - invalid: 'glyphicon glyphicon-remove', - validating: 'glyphicon glyphicon-refresh' - } - }); + valid: 'glyphicon glyphicon-ok', + invalid: 'glyphicon glyphicon-remove', + validating: 'glyphicon glyphicon-refresh' + } + }); - // Use the plugin form (to ajax-ify forms) for all forms with class ajaxify - $('.ajaxify').each(function(){ - var options = jQuery.extend( - {dataType: 'json'}, - $(this).data('ajaxify-options') - ); - if (options.success != undefined) - options.success = window[options.success]; - if (options.error != undefined) - options.error = window[options.error]; - if (options.beforeSubmit != undefined) - options.beforeSubmit = window[options.beforeSubmit]; - $(this).ajaxForm(options); - }); + // Use the plugin form (to ajax-ify forms) for all forms with class ajaxify + $('.ajaxify').each(function(){ + var options = jQuery.extend( + {dataType: 'json'}, + $(this).data('ajaxify-options') + ); + if (options.success != undefined) + options.success = window[options.success]; + if (options.error != undefined) + options.error = window[options.error]; + if (options.beforeSubmit != undefined) + options.beforeSubmit = window[options.beforeSubmit]; + $(this).ajaxForm(options); + }); - // Use the plugin X-editable for .editable elements - // Editables are disabled by default - $('.editable').editable().editable('disable'); - // Open the editable on double click - $('.editable').dblclick(function(){ - if ($(this).hasClass('editable-disabled')) { - $(this).editable('enable').editable('show').editable('activate'); - } - // Disable the editable again when it's hidden - }).on('hidden', function(e, reason){ - $(this).editable('disable'); - }).click(function(e){ - e.preventDefault(); - }); + // Use the plugin X-editable for .editable elements + // Editables are disabled by default + $('.editable').editable().editable('disable'); + // Open the editable on double click + $('.editable').dblclick(function(){ + if ($(this).hasClass('editable-disabled')) { + $(this).editable('enable').editable('show').editable('activate'); + } + // Disable the editable again when it's hidden + }).on('hidden', function(e, reason){ + $(this).editable('disable'); + }).click(function(e){ + e.preventDefault(); + }); - // Use the bootstrap-select plugin on all selects - $('select').selectpicker(); + // Use the bootstrap-select plugin on all selects + $('select').selectpicker(); - // Use the MixItUp plugin for sorting tables - $('.mixitup').mixItUp({ - animation: { - duration: 200, - effects: 'fade' - }, - layout: { - display: 'table-row' - } - }); - $('.mixitup .mixitup-sort').click(function(){ - var mapping = { - desc: 'asc', - asc: 'desc' - } - $(this).data('sort', $(this).data('sort').replace(/asc|desc/gi, function(m){ return mapping[m]; })); - $(this).closest('.mixitup').mixItUp('sort', $(this).data('sort')); - var sorting = $(this).data('sort').substring($(this).data('sort').indexOf(':') + 1); - - $(this).parent().find('.mixitup-sort').removeClass('active sorting_asc sorting_desc').addClass('sorting'); - $(this).addClass('active sorting_' + sorting).removeClass('sorting'); - }); + // Use the MixItUp plugin for sorting tables + $('.mixitup').mixItUp({ + animation: { + duration: 200, + effects: 'fade' + }, + layout: { + display: 'table-row' + } + }); + $('.mixitup .mixitup-sort').click(function(){ + var mapping = { + desc: 'asc', + asc: 'desc' + } + $(this).data('sort', $(this).data('sort').replace(/asc|desc/gi, function(m){ return mapping[m]; })); + $(this).closest('.mixitup').mixItUp('sort', $(this).data('sort')); + var sorting = $(this).data('sort').substring($(this).data('sort').indexOf(':') + 1); - // Collapse menu - var collapsed = false; - $('#collapse-menu').click(function(e, p){ - var animation = 200; - if (typeof p != 'undefined' && p.load) - animation = 0; + $(this).parent().find('.mixitup-sort').removeClass('active sorting_asc sorting_desc').addClass('sorting'); + $(this).addClass('active sorting_' + sorting).removeClass('sorting'); + }); - if (!collapsed) - $('.nav-title').finish().hide(); - $('.sidebar').animate({ - width: collapsed ? 250 : 50 - }, animation); - $('#page-wrapper').animate({ - marginLeft: collapsed ? 250 : 50 - }, animation); - if (collapsed) - $('.nav-title').finish().delay(animation).queue(function(){$(this).show()}); - $(this).find('i.fa').removeClass('fa-caret-square-o-left fa-caret-square-o-right').addClass('fa-caret-square-o-' + (collapsed ? 'left' : 'right')); - collapsed = !collapsed; + // Collapse menu + var collapsed = false; + $('#collapse-menu').click(function(e, p){ + var animation = 200; + if (typeof p != 'undefined' && p.load) + animation = 0; - $.ajax({ - url: const_url_external + 'ajax/collapse', - method: 'GET', - crossDomain: true, - cache: false, - xhrFields: { - withCredentials: true - }, - data: { - setting: collapsed - } - }); + if (!collapsed) + $('.nav-title').finish().hide(); + $('.sidebar').animate({ + width: collapsed ? 250 : 50 + }, animation); + $('#page-wrapper').animate({ + marginLeft: collapsed ? 250 : 50 + }, animation); + if (collapsed) + $('.nav-title').finish().delay(animation).queue(function(){$(this).show()}); + $(this).find('i.fa').removeClass('fa-caret-square-o-left fa-caret-square-o-right').addClass('fa-caret-square-o-' + (collapsed ? 'left' : 'right')); + collapsed = !collapsed; - return true; - }); -}); \ No newline at end of file + $.ajax({ + url: const_url_external + 'ajax/collapse', + method: 'GET', + crossDomain: true, + cache: false, + xhrFields: { + withCredentials: true + }, + data: { + setting: collapsed + } + }); + + return true; + }); +}); diff --git a/login-ajax.php b/login-ajax.php index beb2f66..cf9eb1b 100644 --- a/login-ajax.php +++ b/login-ajax.php @@ -1,28 +1,28 @@ . */ diff --git a/login.php b/login.php index d21fe79..40801b3 100644 --- a/login.php +++ b/login.php @@ -1,28 +1,28 @@ . */ diff --git a/nav.php b/nav.php index caeb6e5..c671838 100644 --- a/nav.php +++ b/nav.php @@ -2,17 +2,17 @@ /** * BusinessAdmin: administrative software for small companies * Copyright (C) 2015 Camil Staps (ViviSoft) - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -- cgit v1.2.3