diff --git a/db.sql b/db.sql index 22b59531..3ae563a1 100644 --- a/db.sql +++ b/db.sql @@ -622,10 +622,10 @@ CREATE TABLE `settings` ( `config_quote_next_number` int(11) DEFAULT NULL, `config_quote_prefix` varchar(200) DEFAULT NULL, `config_ticket_prefix` varchar(200) DEFAULT NULL, - `config_ticket_next_number` int(11) NOT NULL, - `config_enable_cron` int(1) NOT NULL, + `config_ticket_next_number` int(11) DEFAULT NULL, + `config_enable_cron` int(1) DEFAULT NULL, `enable_alert_domain_expire` int(1) DEFAULT NULL, - `enable_alert_low_balance` int(1) NOT NULL, + `enable_alert_low_balance` int(1) DEFAULT NULL, PRIMARY KEY (`company_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; @@ -813,4 +813,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-08-24 20:19:43 +-- Dump completed on 2019-08-24 21:25:45 diff --git a/setup.php b/setup.php index 8f39d1fc..51047033 100644 --- a/setup.php +++ b/setup.php @@ -3,7 +3,11 @@ include("config.php"); include("functions.php"); -if(!isset($config_enable_setup) or $config_enable_setup == 0){ +if(!isset($config_enable_setup)){ + $config_enable_setup = 1; +} + +if($config_enable_setup == 0){ header("Location: login.php"); } @@ -85,12 +89,14 @@ if(isset($_POST['add_database'])){ fwrite($myfile, $txt); - $txt = "\$config_app_name = 'IT CRM';\n\n"; + $txt = "\$config_app_name = 'IT CRM';\n"; fwrite($myfile, $txt); fclose($myfile); + include("config.php"); + // Name of the file $filename = 'db.sql'; // Temporary variable, used to store current query @@ -196,7 +202,7 @@ if(isset($_POST['add_company_settings'])){ fwrite($myfile, $txt); - $txt = "?>"; + $txt = "?>\n"; fwrite($myfile, $txt);