Modified the way the app detects setup mode, added an alerts setting page and other minor fixes and cleanups

This commit is contained in:
johnny@pittpc.com
2019-08-23 16:32:15 -04:00
parent be1b4d50fb
commit 89762313c5
16 changed files with 115 additions and 40 deletions

View File

@@ -1,7 +1,12 @@
<?php
include("config.php");
include("functions.php");
if(!isset($config_enable_setup) or $config_enable_setup == 0){
header("Location: login.php");
}
$states_array = array(
'AL'=>'Alabama',
'AK'=>'Alaska',
@@ -84,14 +89,8 @@ if(isset($_POST['add_database'])){
fwrite($myfile, $txt);
$txt = "?>";
fwrite($myfile, $txt);
fclose($myfile);
include("config.php");
// Name of the file
$filename = 'db.sql';
// Temporary variable, used to store current query
@@ -191,6 +190,18 @@ if(isset($_POST['add_company_settings'])){
mysqli_query($mysqli,"INSERT INTO calendars SET calendar_name = 'Default', calendar_color = 'blue', calendar_created_at = NOW(), company_id = $company_id");
$myfile = fopen("config.php", "a");
$txt = "\$config_enable_setup = 0;\n\n";
fwrite($myfile, $txt);
$txt = "?>";
fwrite($myfile, $txt);
fclose($myfile);
header("Location: login.php");
}
@@ -445,7 +456,7 @@ if(isset($_POST['add_company_settings'])){
<div class="input-group-prepend">
<span class="input-group-text"><i class="fab fa-fw fa-usps"></i></span>
</div>
<input type="text" class="form-control" name="config_company_zip" placeholder="Zip Code">
<input type="text" class="form-control" name="config_company_zip" placeholder="Zip Code" data-inputmask="'mask': '99999'">
</div>
</div>