aboutsummaryrefslogtreecommitdiff
path: root/install/index.php
diff options
context:
space:
mode:
authorCamil Staps2016-07-27 16:48:53 +0200
committerCamil Staps2016-07-27 17:08:12 +0200
commit21455bfd1004c4a3153050ac5995b8dc680c2042 (patch)
treeb448f9d94cd9b6addb6d6b391001c418243cc13d /install/index.php
parentRemoved error reporting (diff)
Class names start with a capital
Diffstat (limited to 'install/index.php')
-rw-r--r--install/index.php40
1 files changed, 20 insertions, 20 deletions
diff --git a/install/index.php b/install/index.php
index 3873ce3..26812c3 100644
--- a/install/index.php
+++ b/install/index.php
@@ -21,7 +21,7 @@ require('../conf.php');
if (isset($_GET['create_tables'])) {
try {
- $_pdo->query("CREATE TABLE IF NOT EXISTS `".constants::db_prefix."assignment` (
+ $_pdo->query("CREATE TABLE IF NOT EXISTS `".Constants::db_prefix."assignment` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`offerId` smallint(5) unsigned NOT NULL,
`title` tinytext NOT NULL,
@@ -34,14 +34,14 @@ if (isset($_GET['create_tables'])) {
KEY `offerId` (`offerId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1");
- $_pdo->query("CREATE TABLE IF NOT EXISTS `".constants::db_prefix."client` (
+ $_pdo->query("CREATE TABLE IF NOT EXISTS `".Constants::db_prefix."client` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`name` tinytext NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`(255))
) ENGINE=InnoDB DEFAULT CHARSET=latin1");
- $_pdo->query("CREATE TABLE IF NOT EXISTS `".constants::db_prefix."contact` (
+ $_pdo->query("CREATE TABLE IF NOT EXISTS `".Constants::db_prefix."contact` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`clientId` smallint(5) unsigned NOT NULL,
`name` tinytext NOT NULL,
@@ -57,7 +57,7 @@ if (isset($_GET['create_tables'])) {
KEY `clientId` (`clientId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1");
- $_pdo->query("CREATE TABLE IF NOT EXISTS `".constants::db_prefix."discount` (
+ $_pdo->query("CREATE TABLE IF NOT EXISTS `".Constants::db_prefix."discount` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`offerId` smallint(5) unsigned NOT NULL,
`title` tinytext NOT NULL,
@@ -67,14 +67,14 @@ if (isset($_GET['create_tables'])) {
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;");
- $_pdo->query("CREATE TABLE IF NOT EXISTS `".constants::db_prefix."file` (
+ $_pdo->query("CREATE TABLE IF NOT EXISTS `".Constants::db_prefix."file` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`filename` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `filename` (`filename`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1");
- $_pdo->query("CREATE TABLE IF NOT EXISTS `".constants::db_prefix."offer` (
+ $_pdo->query("CREATE TABLE IF NOT EXISTS `".Constants::db_prefix."offer` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`contactId` smallint(5) unsigned NOT NULL,
`start_date` date NOT NULL,
@@ -96,25 +96,25 @@ if (isset($_GET['create_tables'])) {
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;");
- $_pdo->query("CREATE TABLE IF NOT EXISTS `".constants::db_prefix."user` (
+ $_pdo->query("CREATE TABLE IF NOT EXISTS `".Constants::db_prefix."user` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(24) NOT NULL,
`password` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;");
- $_pdo->query("ALTER TABLE `".constants::db_prefix."assignment`
- ADD CONSTRAINT `assignment_ibfk_1` FOREIGN KEY (`offerId`) REFERENCES `".constants::db_prefix."offer` (`id`)");
+ $_pdo->query("ALTER TABLE `".Constants::db_prefix."assignment`
+ ADD CONSTRAINT `assignment_ibfk_1` FOREIGN KEY (`offerId`) REFERENCES `".Constants::db_prefix."offer` (`id`)");
- $_pdo->query("ALTER TABLE `".constants::db_prefix."contact`
- ADD CONSTRAINT `contact_ibfk_1` FOREIGN KEY (`clientId`) REFERENCES `".constants::db_prefix."client` (`id`)");
+ $_pdo->query("ALTER TABLE `".Constants::db_prefix."contact`
+ ADD CONSTRAINT `contact_ibfk_1` FOREIGN KEY (`clientId`) REFERENCES `".Constants::db_prefix."client` (`id`)");
- $_pdo->query("ALTER TABLE `".constants::db_prefix."discount`
- ADD CONSTRAINT `discount_ibfk_1` FOREIGN KEY (`offerId`) REFERENCES `".constants::db_prefix."offer` (`id`);");
+ $_pdo->query("ALTER TABLE `".Constants::db_prefix."discount`
+ ADD CONSTRAINT `discount_ibfk_1` FOREIGN KEY (`offerId`) REFERENCES `".Constants::db_prefix."offer` (`id`);");
- $_pdo->query("ALTER TABLE `".constants::db_prefix."offer`
- ADD CONSTRAINT `offer_ibfk_1` FOREIGN KEY (`invoice_fileId`) REFERENCES `".constants::db_prefix."file` (`id`),
- ADD CONSTRAINT `offer_ibfk_2` FOREIGN KEY (`contactId`) REFERENCES `".constants::db_prefix."contact` (`id`)");
+ $_pdo->query("ALTER TABLE `".Constants::db_prefix."offer`
+ ADD CONSTRAINT `offer_ibfk_1` FOREIGN KEY (`invoice_fileId`) REFERENCES `".Constants::db_prefix."file` (`id`),
+ ADD CONSTRAINT `offer_ibfk_2` FOREIGN KEY (`contactId`) REFERENCES `".Constants::db_prefix."contact` (`id`)");
$_pdo->query("ALTER TABLE `payment`
ADD CONSTRAINT `payment_ibfk_1` FOREIGN KEY (`offerId`) REFERENCES `offer` (`id`);");
@@ -129,11 +129,11 @@ if (isset($_GET['create_tables'])) {
}
if (isset($_GET['create_folders'])) {
- if (!mkdir(constants::files_folder)) {
- echo "Creating folder `" . constants::files_folder . "` failed.<br/>";
+ if (!mkdir(Constants::files_folder)) {
+ echo "Creating folder `" . Constants::files_folder . "` failed.<br/>";
}
- if (!mkdir(constants::files_folder . constants::files_folder_trash)) {
- echo "Creating folder `" . constants::files_folder_trash . "` failed.<br/>";
+ if (!mkdir(Constants::files_folder . Constants::files_folder_trash)) {
+ echo "Creating folder `" . Constants::files_folder_trash . "` failed.<br/>";
}
}