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'])){ + +
Company Settings
@@ -312,7 +333,7 @@ if(isset($_POST['add_company_settings'])){
- $state_name) { ?> @@ -355,7 +376,31 @@ if(isset($_POST['add_company_settings'])){ - Install +
+
+
Start Install
+
+
+

Click on the install button to start the install process, you must create a database before starting

+

This process will accomplish the following

+
    +
  • Create a config.php
  • +
  • Creates the following expense cataegories (Office Supplies, Advertising, Travel)
  • +
  • Created the following payment methods (Cash, Check)
  • +
  • Creates an account named Cash
  • +
  • Creates an income +
+

After install add cron.php to your cron and set it to run once everyday at 12AM. This is so recurring invoices will automatically be sent out and created. This will also trigger late payment reminders, along with alerts such as domains expiration, etc.

+

An API is present to allow integration with other third pary apps. To activate the API you must enter an api key under settings. The API will give you the following capabilities

+
    +
  • Address book XML for VOIP Phones
  • +
  • Caller ID Lookup
  • +
  • Get List of Emails in CSV to export to a mailing list
  • +
  • Get Balance, can be useful for customer's to get balances by phone
  • +
+
Install
+
+
@@ -382,6 +427,7 @@ if(isset($_POST['add_company_settings'])){ +