"; fwrite($myfile, $txt); fclose($myfile); include("config.php"); // Name of the file $filename = 'db.sql'; // Temporary variable, used to store current query $templine = ''; // Read in entire file $lines = file($filename); // Loop through each line foreach ($lines as $line){ // Skip it if it's a comment if(substr($line, 0, 2) == '--' || $line == '') continue; // Add this line to the current segment $templine .= $line; // 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); // Reset temp variable to empty $templine = ''; } } $_SESSION['alert_message'] = "Database successfully added"; header("Location: setup.php?user"); } 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'])); if($_FILES['file']['tmp_name']!='') { $path = "uploads/users/"; $path = $path . time() . basename( $_FILES['file']['name']); $file_name = basename($path); move_uploaded_file($_FILES['file']['tmp_name'], $path); } mysqli_query($mysqli,"INSERT INTO users SET name = '$name', email = '$email', password = '$password', avatar = '$path', created_at = NOW()"); $user_id = mysqli_insert_id($mysqli); $_SESSION['alert_message'] = "User added"; header("Location: setup.php?company"); } 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'])); $config_company_state = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_state'])); $config_company_zip = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_zip'])); $config_company_phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_phone'])); $config_company_phone = preg_replace("/[^0-9]/", '',$config_company_phone); $config_company_site = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_site'])); $config_api_key = keygen(); mysqli_query($mysqli,"INSERT INTO companies SET company_name = '$config_company_name', company_created_at = NOW()"); $company_id = mysqli_insert_id($mysqli); mysqli_query($mysqli,"INSERT INTO user_companies SET user_id = $user_id, company_id = $company_id"); mysqli_query($mysqli,"INSERT INTO settings SET company_id = $company_id, 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', config_invoice_prefix = 'INV-', config_invoice_next_number = 1, config_invoice_overdue_reminders = '1,3,7', config_quote_prefix = 'QUO-', config_quote_next_number = 1, config_api_key = '$config_api_key', config_recurring_auto_send_invoice = 1, config_default_net_terms = 7, config_send_invoice_reminders = 0"); //Create Some Data mysqli_query($mysqli,"INSERT INTO accounts SET account_name = 'Cash', account_created_at = NOW(), company_id = $company_id"); mysqli_query($mysqli,"INSERT INTO categories SET category_name = 'Office Supplies', category_type = 'Expense', category_color = 'blue', category_created_at = NOW(), company_id = $company_id"); mysqli_query($mysqli,"INSERT INTO categories SET category_name = 'Travel', category_type = 'Expense', category_color = 'red', category_created_at = NOW(), company_id = $company_id"); mysqli_query($mysqli,"INSERT INTO categories SET category_name = 'Advertising', category_type = 'Expense', category_color = 'green', category_created_at = NOW(), company_id = $company_id"); mysqli_query($mysqli,"INSERT INTO categories SET category_name = 'Service', category_type = 'Income', category_color = 'orange', category_created_at = NOW(), company_id = $company_id"); mysqli_query($mysqli,"INSERT INTO categories SET category_name = 'Cash', category_type = 'Payment Method', category_color = 'purple', category_created_at = NOW(), company_id = $company_id"); mysqli_query($mysqli,"INSERT INTO categories SET category_name = 'Check', category_type = 'Payment Method', category_color = 'brown', category_created_at = NOW(), company_id = $company_id"); mysqli_query($mysqli,"INSERT INTO calendars SET calendar_name = 'Default', calendar_color = 'blue', calendar_created_at = NOW(), company_id = $company_id"); header("Location: login.php"); } ?> Install CRM
Setup Database

Create your first user

Company Settings

Start Install

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

This process will accomplish the following

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

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. An API Key will be auto generated, and can be changed at a later date. 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