Fixed adding new company

This commit is contained in:
johnnyq 2022-05-07 15:42:17 -04:00
parent cb22db5d65
commit 463fcdbe4f
2 changed files with 6 additions and 3 deletions

View File

@ -11,6 +11,9 @@
<!-- Page Content -->
<h1>Blank Page</h1>
<hr>
<p>This is a great starting point for new custom pages.</p>
<p>This is a great starting point for new custom pages.
<?php echo CURRENT_DATABASE_VERSION; ?>
</p>
<?php include("footer.php"); ?>

View File

@ -465,7 +465,7 @@ if(isset($_POST['add_company'])){
$company_id = mysqli_insert_id($mysqli);
$config_base_url = mysqli_real_escape_string($mysqli,$_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']));
$config_api_key = keygen();
$current_database_version = CURRENT_DATABASE_VERSION;
mkdir("uploads/clients/$company_id");
mkdir("uploads/expenses/$company_id");
@ -517,7 +517,7 @@ if(isset($_POST['add_company'])){
//Set User Company Permissions
mysqli_query($mysqli,"INSERT INTO user_companies SET user_id = $session_user_id, company_id = $company_id");
mysqli_query($mysqli,"INSERT INTO settings SET company_id = $company_id, config_invoice_prefix = 'INV-', config_invoice_next_number = 1, config_recurring_prefix = 'REC-', config_recurring_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 = 1, config_enable_cron = 0, config_ticket_next_number = 1, config_base_url = '$config_base_url'");
mysqli_query($mysqli,"INSERT INTO settings SET company_id = $company_id, config_current_database_version = '$current_database_version', config_invoice_prefix = 'INV-', config_invoice_next_number = 1, config_recurring_prefix = 'REC-', config_recurring_next_number = 1, config_invoice_overdue_reminders = '1,3,7', config_quote_prefix = 'QUO-', config_quote_next_number = 1, config_recurring_auto_send_invoice = 1, config_default_net_terms = 7, config_send_invoice_reminders = 1, config_enable_cron = 0, config_ticket_next_number = 1, config_base_url = '$config_base_url'");
//Create Some Data