diff --git a/createtables.php b/createtables.php
new file mode 100644
index 00000000..5586ec8c
--- /dev/null
+++ b/createtables.php
@@ -0,0 +1,35 @@
+
\ No newline at end of file
diff --git a/footer.php b/footer.php
index 86fba272..ae9a1af4 100644
--- a/footer.php
+++ b/footer.php
@@ -35,7 +35,6 @@
-
diff --git a/header.php b/header.php
index 22b11b58..03ee15ef 100644
--- a/header.php
+++ b/header.php
@@ -42,7 +42,6 @@
-
diff --git a/settings-general.php b/settings-general.php
index 0fba1d06..8f65a104 100644
--- a/settings-general.php
+++ b/settings-general.php
@@ -19,6 +19,8 @@
+
+
diff --git a/setup.php b/setup.php
index 6f410596..52a6f6c8 100644
--- a/setup.php
+++ b/setup.php
@@ -37,10 +37,10 @@ if(isset($_POST['add_database'])){
}
-include("config.php");
-
if(isset($_POST['import_database'])){
+ include("config.php");
+
// Name of the file
$filename = 'db.sql';
// Temporary variable, used to store current query
@@ -58,17 +58,33 @@ if(isset($_POST['import_database'])){
// If it has a semicolon at the end, it's the end of the query
if(substr(trim($line), -1, 1) == ';'){
// Perform the query
- mysqli_query($mysqli,$templine) or print('Error performing query \'' . $templine . '\': ' . mysqli_error() . '
');
+ mysqli_query($mysqli,$templine);
// Reset temp variable to empty
$templine = '';
}
}
- echo "Tables imported successfully";
+
+ //Create Some Data
+
+ mysqli_query($mysqli,"INSERT INTO accounts SET account_name = 'Cash', account_created_at = NOW()");
+
+ mysqli_query($mysqli,"INSERT INTO categories SET category_name = 'Office Supplies', category_type = 'Expense', category_color = 'blue', category_created_at = NOW()");
+ mysqli_query($mysqli,"INSERT INTO categories SET category_name = 'Travel', category_type = 'Expense', category_color = 'red', category_created_at = NOW()");
+ mysqli_query($mysqli,"INSERT INTO categories SET category_name = 'Advertising', category_type = 'Expense', category_color = 'green', category_created_at = NOW()");
+
+ mysqli_query($mysqli,"INSERT INTO categories SET category_name = 'Service', category_type = 'Income', category_color = 'orange', category_created_at = NOW()");
+
+ mysqli_query($mysqli,"INSERT INTO categories SET category_name = 'Cash', category_type = 'Payment Method', category_color = 'purple', category_created_at = NOW()");
+ mysqli_query($mysqli,"INSERT INTO categories SET category_name = 'Check', category_type = 'Payment Method', category_color = 'brown', category_created_at = NOW()");
+
+ mysqli_query($mysqli,"INSERT INTO calendars SET calendar_name = 'Default', calendar_color = 'blue', calendar_created_at = NOW()");
}
if(isset($_POST['add_user'])){
+ include("config.php");
+
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
$password = md5(mysqli_real_escape_string($mysqli,$_POST['password']));
@@ -88,6 +104,8 @@ if(isset($_POST['add_user'])){
if(isset($_POST['add_company_settings'])){
+ include("config.php");
+
$config_company_name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_name']));
$config_company_address = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_address']));
$config_company_city = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_city']));
@@ -96,9 +114,9 @@ if(isset($_POST['add_company_settings'])){
$config_company_phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_phone']));
$config_company_site = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_site']));
- mysqli_query($mysqli,"INSERT INTO settings SET config_company_name = '$config_company_name', config_company_address = '$config_company_address', config_company_city = '$config_company_city', config_company_state = '$config_company_state', config_company_zip = '$config_company_zip', config_company_phone = '$config_company_phone', config_company_site = '$config_company_site'");
+ mysqli_query($mysqli,"INSERT INTO settings SET config_company_name = '$config_company_name', config_company_address = '$config_company_address', config_company_city = '$config_company_city', config_company_state = '$config_company_state', config_company_zip = '$config_company_zip', config_company_phone = '$config_company_phone', config_company_site = '$config_company_site', config_start_page = 'dashboard.php'");
- header("Location: " . $_SERVER["HTTP_REFERER"]);
+ header("login.php");
}
@@ -125,6 +143,7 @@ if(isset($_POST['add_company_settings'])){
+
@@ -279,6 +298,8 @@ if(isset($_POST['add_company_settings'])){
+
+